Class: CreatePanCollectionCollection

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



36156
36157
36158
36159
36160
36161
36162
36163
36164
# File 'lib/schemas.rb', line 36156

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    environments:     d["environments"],
    id:               d.fetch("id"),
    parent_folder_id: d.fetch("parentFolderId"),
    summary:          d["summary"],
  )
end

.from_json!(json) ⇒ Object



36166
36167
36168
# File 'lib/schemas.rb', line 36166

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

Instance Method Details

#to_dynamicObject



36170
36171
36172
36173
36174
36175
36176
36177
# File 'lib/schemas.rb', line 36170

def to_dynamic
  {
    "environments"   => environments,
    "id"             => id,
    "parentFolderId" => parent_folder_id,
    "summary"        => summary,
  }
end

#to_json(options = nil) ⇒ Object



36179
36180
36181
# File 'lib/schemas.rb', line 36179

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