Class: PostMocksMockIDPublishResponse401Error

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



23960
23961
23962
23963
23964
23965
23966
# File 'lib/schemas.rb', line 23960

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

.from_json!(json) ⇒ Object



23968
23969
23970
# File 'lib/schemas.rb', line 23968

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

Instance Method Details

#to_dynamicObject



23972
23973
23974
23975
23976
23977
# File 'lib/schemas.rb', line 23972

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

#to_json(options = nil) ⇒ Object



23979
23980
23981
# File 'lib/schemas.rb', line 23979

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