Class: PostCollectionsForkCollectionIDResponse401Error

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



21840
21841
21842
21843
21844
21845
21846
# File 'lib/schemas.rb', line 21840

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

.from_json!(json) ⇒ Object



21848
21849
21850
# File 'lib/schemas.rb', line 21848

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

Instance Method Details

#to_dynamicObject



21852
21853
21854
21855
21856
21857
# File 'lib/schemas.rb', line 21852

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

#to_json(options = nil) ⇒ Object



21859
21860
21861
# File 'lib/schemas.rb', line 21859

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