Class: PutMocksMockIDServerResponsesServerResponseIDResponse401Error

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



33062
33063
33064
33065
33066
33067
33068
# File 'lib/schemas.rb', line 33062

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    message:                                                                      d["message"],
    put_mocks_mock_id_server_responses_server_response_id_response401_error_name: d["name"],
  )
end

.from_json!(json) ⇒ Object



33070
33071
33072
# File 'lib/schemas.rb', line 33070

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

Instance Method Details

#to_dynamicObject



33074
33075
33076
33077
33078
33079
# File 'lib/schemas.rb', line 33074

def to_dynamic
  {
    "message" => message,
    "name"    => put_mocks_mock_id_server_responses_server_response_id_response401_error_name,
  }
end

#to_json(options = nil) ⇒ Object



33081
33082
33083
# File 'lib/schemas.rb', line 33081

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