Class: GetMocksMockIDServerResponsesResponse404Error

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



11548
11549
11550
11551
11552
11553
11554
11555
# File 'lib/schemas.rb', line 11548

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

.from_json!(json) ⇒ Object



11557
11558
11559
# File 'lib/schemas.rb', line 11557

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

Instance Method Details

#to_dynamicObject



11561
11562
11563
11564
11565
11566
11567
# File 'lib/schemas.rb', line 11561

def to_dynamic
  {
    "details" => details,
    "message" => message,
    "name"    => get_mocks_mock_id_server_responses_response404_error_name,
  }
end

#to_json(options = nil) ⇒ Object



11569
11570
11571
# File 'lib/schemas.rb', line 11569

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