Class: PostWebhooksResponse500Error

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



27626
27627
27628
27629
27630
27631
27632
# File 'lib/schemas.rb', line 27626

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    message:                              d["message"],
    post_webhooks_response500_error_name: d["name"],
  )
end

.from_json!(json) ⇒ Object



27634
27635
27636
# File 'lib/schemas.rb', line 27634

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

Instance Method Details

#to_dynamicObject



27638
27639
27640
27641
27642
27643
# File 'lib/schemas.rb', line 27638

def to_dynamic
  {
    "message" => message,
    "name"    => post_webhooks_response500_error_name,
  }
end

#to_json(options = nil) ⇒ Object



27645
27646
27647
# File 'lib/schemas.rb', line 27645

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