Class: PostCollectionsMergeResponse401Error

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



22184
22185
22186
22187
22188
22189
22190
# File 'lib/schemas.rb', line 22184

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

.from_json!(json) ⇒ Object



22192
22193
22194
# File 'lib/schemas.rb', line 22192

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

Instance Method Details

#to_dynamicObject



22196
22197
22198
22199
22200
22201
# File 'lib/schemas.rb', line 22196

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

#to_json(options = nil) ⇒ Object



22203
22204
22205
# File 'lib/schemas.rb', line 22203

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