Class: PostCollectionsMergeResponse500Error

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



22367
22368
22369
22370
22371
22372
22373
# File 'lib/schemas.rb', line 22367

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

.from_json!(json) ⇒ Object



22375
22376
22377
# File 'lib/schemas.rb', line 22375

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

Instance Method Details

#to_dynamicObject



22379
22380
22381
22382
22383
22384
# File 'lib/schemas.rb', line 22379

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

#to_json(options = nil) ⇒ Object



22386
22387
22388
# File 'lib/schemas.rb', line 22386

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