Class: GetMocksMockIDServerResponsesServerResponseIDResponse401Error

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



11810
11811
11812
11813
11814
11815
11816
# File 'lib/schemas.rb', line 11810

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

.from_json!(json) ⇒ Object



11818
11819
11820
# File 'lib/schemas.rb', line 11818

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

Instance Method Details

#to_dynamicObject



11822
11823
11824
11825
11826
11827
# File 'lib/schemas.rb', line 11822

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

#to_json(options = nil) ⇒ Object



11829
11830
11831
# File 'lib/schemas.rb', line 11829

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