Class: PostCollectionsCollectionIDResponsesResponseData

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



21388
21389
21390
21391
21392
21393
21394
21395
21396
21397
21398
# File 'lib/schemas.rb', line 21388

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    created_at:      d["createdAt"],
    id:              d["id"],
    last_updated_by: d["lastUpdatedBy"],
    owner:           d["owner"],
    request:         d["request"],
    updated_at:      d["updatedAt"],
  )
end

.from_json!(json) ⇒ Object



21400
21401
21402
# File 'lib/schemas.rb', line 21400

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

Instance Method Details

#to_dynamicObject



21404
21405
21406
21407
21408
21409
21410
21411
21412
21413
# File 'lib/schemas.rb', line 21404

def to_dynamic
  {
    "createdAt"     => created_at,
    "id"            => id,
    "lastUpdatedBy" => last_updated_by,
    "owner"         => owner,
    "request"       => request,
    "updatedAt"     => updated_at,
  }
end

#to_json(options = nil) ⇒ Object



21415
21416
21417
# File 'lib/schemas.rb', line 21415

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