Class: PostMocksMockIDPublishResponse400Error

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



23903
23904
23905
23906
23907
23908
23909
# File 'lib/schemas.rb', line 23903

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

.from_json!(json) ⇒ Object



23911
23912
23913
# File 'lib/schemas.rb', line 23911

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

Instance Method Details

#to_dynamicObject



23915
23916
23917
23918
23919
23920
# File 'lib/schemas.rb', line 23915

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

#to_json(options = nil) ⇒ Object



23922
23923
23924
# File 'lib/schemas.rb', line 23922

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