Class: PostWebhooksResponse

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/schemas.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



27507
27508
27509
27510
27511
27512
# File 'lib/schemas.rb', line 27507

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    webhook: d["webhook"] ? PostWebhooksResponseWebhook.from_dynamic!(d["webhook"]) : nil,
  )
end

.from_json!(json) ⇒ Object



27514
27515
27516
# File 'lib/schemas.rb', line 27514

def self.from_json!(json)
  from_dynamic!(JSON.parse(json))
end

Instance Method Details

#to_dynamicObject



27518
27519
27520
27521
27522
# File 'lib/schemas.rb', line 27518

def to_dynamic
  {
    "webhook" => webhook&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



27524
27525
27526
# File 'lib/schemas.rb', line 27524

def to_json(options = nil)
  JSON.generate(to_dynamic, options)
end