Class: PANFolderCreated

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



17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
# File 'lib/schemas.rb', line 17843

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    created_at:              d["createdAt"],
    created_by:              d["createdBy"],
    description:             d["description"],
    id:                      d["id"],
    pan_folder_created_name: d["name"],
    parent_folder_id:        d["parentFolderId"],
    pan_folder_created_type: d["type"],
    updated_at:              d["updatedAt"],
    updated_by:              d["updatedBy"],
  )
end

.from_json!(json) ⇒ Object



17858
17859
17860
# File 'lib/schemas.rb', line 17858

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

Instance Method Details

#to_dynamicObject



17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
# File 'lib/schemas.rb', line 17862

def to_dynamic
  {
    "createdAt"      => created_at,
    "createdBy"      => created_by,
    "description"    => description,
    "id"             => id,
    "name"           => pan_folder_created_name,
    "parentFolderId" => parent_folder_id,
    "type"           => pan_folder_created_type,
    "updatedAt"      => updated_at,
    "updatedBy"      => updated_by,
  }
end

#to_json(options = nil) ⇒ Object



17876
17877
17878
# File 'lib/schemas.rb', line 17876

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