Class: PostWebhooksResponseWebhook

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



27472
27473
27474
27475
27476
27477
27478
27479
27480
27481
# File 'lib/schemas.rb', line 27472

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    collection:                          d["collection"],
    id:                                  d["id"],
    post_webhooks_response_webhook_name: d["name"],
    uid:                                 d["uid"],
    webhook_url:                         d["webhookUrl"],
  )
end

.from_json!(json) ⇒ Object



27483
27484
27485
# File 'lib/schemas.rb', line 27483

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

Instance Method Details

#to_dynamicObject



27487
27488
27489
27490
27491
27492
27493
27494
27495
# File 'lib/schemas.rb', line 27487

def to_dynamic
  {
    "collection" => collection,
    "id"         => id,
    "name"       => post_webhooks_response_webhook_name,
    "uid"        => uid,
    "webhookUrl" => webhook_url,
  }
end

#to_json(options = nil) ⇒ Object



27497
27498
27499
# File 'lib/schemas.rb', line 27497

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