Class: PostCollectionsResponse400Error

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



22489
22490
22491
22492
22493
22494
22495
22496
# File 'lib/schemas.rb', line 22489

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

.from_json!(json) ⇒ Object



22498
22499
22500
# File 'lib/schemas.rb', line 22498

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

Instance Method Details

#to_dynamicObject



22502
22503
22504
22505
22506
22507
22508
# File 'lib/schemas.rb', line 22502

def to_dynamic
  {
    "details" => details,
    "message" => message,
    "name"    => post_collections_response400_error_name,
  }
end

#to_json(options = nil) ⇒ Object



22510
22511
22512
# File 'lib/schemas.rb', line 22510

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