Class: CreatePANFolder

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



36249
36250
36251
36252
36253
36254
# File 'lib/schemas.rb', line 36249

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    folder: d["folder"] ? CreatePanFolderFolder.from_dynamic!(d["folder"]) : nil,
  )
end

.from_json!(json) ⇒ Object



36256
36257
36258
# File 'lib/schemas.rb', line 36256

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

Instance Method Details

#to_dynamicObject



36260
36261
36262
36263
36264
# File 'lib/schemas.rb', line 36260

def to_dynamic
  {
    "folder" => folder&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



36266
36267
36268
# File 'lib/schemas.rb', line 36266

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