Class: DeleteMocksMockIDUnpublishResponse404Error

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



3050
3051
3052
3053
3054
3055
3056
3057
# File 'lib/schemas.rb', line 3050

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

.from_json!(json) ⇒ Object



3059
3060
3061
# File 'lib/schemas.rb', line 3059

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

Instance Method Details

#to_dynamicObject



3063
3064
3065
3066
3067
3068
3069
# File 'lib/schemas.rb', line 3063

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

#to_json(options = nil) ⇒ Object



3071
3072
3073
# File 'lib/schemas.rb', line 3071

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