Class: GetMocksMockIDServerResponsesResponse404

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



11577
11578
11579
11580
11581
11582
# File 'lib/schemas.rb', line 11577

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

.from_json!(json) ⇒ Object



11584
11585
11586
# File 'lib/schemas.rb', line 11584

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

Instance Method Details

#to_dynamicObject



11588
11589
11590
11591
11592
# File 'lib/schemas.rb', line 11588

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

#to_json(options = nil) ⇒ Object



11594
11595
11596
# File 'lib/schemas.rb', line 11594

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