Class: GetMocksMockIDServerResponsesServerResponseIDResponse400

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



11780
11781
11782
11783
11784
11785
# File 'lib/schemas.rb', line 11780

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

.from_json!(json) ⇒ Object



11787
11788
11789
# File 'lib/schemas.rb', line 11787

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

Instance Method Details

#to_dynamicObject



11791
11792
11793
11794
11795
# File 'lib/schemas.rb', line 11791

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

#to_json(options = nil) ⇒ Object



11797
11798
11799
# File 'lib/schemas.rb', line 11797

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