Class: PutMocksMockIDServerResponsesServerResponseIDResponse400Error

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



33003
33004
33005
33006
33007
33008
33009
33010
# File 'lib/schemas.rb', line 33003

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    details:                                                                      d["details"] ? PutMocksMockIDServerResponsesServerResponseIDResponse400ErrorDetails.from_dynamic!(d["details"]) : nil,
    message:                                                                      d["message"],
    put_mocks_mock_id_server_responses_server_response_id_response400_error_name: d["name"],
  )
end

.from_json!(json) ⇒ Object



33012
33013
33014
# File 'lib/schemas.rb', line 33012

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

Instance Method Details

#to_dynamicObject



33016
33017
33018
33019
33020
33021
33022
# File 'lib/schemas.rb', line 33016

def to_dynamic
  {
    "details" => details&.to_dynamic,
    "message" => message,
    "name"    => put_mocks_mock_id_server_responses_server_response_id_response400_error_name,
  }
end

#to_json(options = nil) ⇒ Object



33024
33025
33026
# File 'lib/schemas.rb', line 33024

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