Class: PostMocksMockIDPublishResponse404Error

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



24020
24021
24022
24023
24024
24025
24026
24027
# File 'lib/schemas.rb', line 24020

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

.from_json!(json) ⇒ Object



24029
24030
24031
# File 'lib/schemas.rb', line 24029

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

Instance Method Details

#to_dynamicObject



24033
24034
24035
24036
24037
24038
24039
# File 'lib/schemas.rb', line 24033

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

#to_json(options = nil) ⇒ Object



24041
24042
24043
# File 'lib/schemas.rb', line 24041

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