Class: PostMocksMockIDServerResponsesResponse401Error

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



24362
24363
24364
24365
24366
24367
24368
# File 'lib/schemas.rb', line 24362

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

.from_json!(json) ⇒ Object



24370
24371
24372
# File 'lib/schemas.rb', line 24370

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

Instance Method Details

#to_dynamicObject



24374
24375
24376
24377
24378
24379
# File 'lib/schemas.rb', line 24374

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

#to_json(options = nil) ⇒ Object



24381
24382
24383
# File 'lib/schemas.rb', line 24381

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