Class: GetMocksMockIDServerResponsesServerResponseIDResponse401

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



11837
11838
11839
11840
11841
11842
# File 'lib/schemas.rb', line 11837

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

.from_json!(json) ⇒ Object



11844
11845
11846
# File 'lib/schemas.rb', line 11844

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

Instance Method Details

#to_dynamicObject



11848
11849
11850
11851
11852
# File 'lib/schemas.rb', line 11848

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

#to_json(options = nil) ⇒ Object



11854
11855
11856
# File 'lib/schemas.rb', line 11854

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