Class: GetNetworkPrivateNetworkEntityRequestAllResponseRequestsItem

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



13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
# File 'lib/schemas.rb', line 13386

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    created_at: d["createdAt"],
    created_by: d["createdBy"],
    element:    d["element"] ? GetNetworkPrivateNetworkEntityRequestAllResponseRequestsItemElement.from_dynamic!(d["element"]) : nil,
    id:         d["id"],
    message:    d["message"],
    response:   d["response"] ? GetNetworkPrivateNetworkEntityRequestAllResponseRequestsItemResponse.from_dynamic!(d["response"]) : nil,
    status:     d["status"],
  )
end

.from_json!(json) ⇒ Object



13399
13400
13401
# File 'lib/schemas.rb', line 13399

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

Instance Method Details

#to_dynamicObject



13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
# File 'lib/schemas.rb', line 13403

def to_dynamic
  {
    "createdAt" => created_at,
    "createdBy" => created_by,
    "element"   => element&.to_dynamic,
    "id"        => id,
    "message"   => message,
    "response"  => response&.to_dynamic,
    "status"    => status,
  }
end

#to_json(options = nil) ⇒ Object



13415
13416
13417
# File 'lib/schemas.rb', line 13415

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