Class: PostWebhooksResponse401

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



27564
27565
27566
27567
27568
27569
# File 'lib/schemas.rb', line 27564

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

.from_json!(json) ⇒ Object



27571
27572
27573
# File 'lib/schemas.rb', line 27571

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

Instance Method Details

#to_dynamicObject



27575
27576
27577
27578
27579
# File 'lib/schemas.rb', line 27575

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

#to_json(options = nil) ⇒ Object



27581
27582
27583
# File 'lib/schemas.rb', line 27581

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