Class: PostCollectionsCollectionIDResponsesResponse401Error

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



21611
21612
21613
21614
21615
21616
21617
21618
# File 'lib/schemas.rb', line 21611

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

.from_json!(json) ⇒ Object



21620
21621
21622
# File 'lib/schemas.rb', line 21620

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

Instance Method Details

#to_dynamicObject



21624
21625
21626
21627
21628
21629
21630
# File 'lib/schemas.rb', line 21624

def to_dynamic
  {
    "details" => details&.to_dynamic,
    "message" => message,
    "name"    => post_collections_collection_id_responses_response401_error_name,
  }
end

#to_json(options = nil) ⇒ Object



21632
21633
21634
# File 'lib/schemas.rb', line 21632

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