Class: PostWebhooksResponse401Error

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



27537
27538
27539
27540
27541
27542
27543
# File 'lib/schemas.rb', line 27537

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

.from_json!(json) ⇒ Object



27545
27546
27547
# File 'lib/schemas.rb', line 27545

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

Instance Method Details

#to_dynamicObject



27549
27550
27551
27552
27553
27554
# File 'lib/schemas.rb', line 27549

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

#to_json(options = nil) ⇒ Object



27556
27557
27558
# File 'lib/schemas.rb', line 27556

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