Class: DeleteSecretOptions

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



513
514
515
516
517
518
519
520
521
522
# File 'lib/schemas.rb', line 513

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    environment:                d.fetch("environment"),
    path:                       d["path"],
    project_id:                 d.fetch("projectId"),
    secret_name:                d.fetch("secretName"),
    delete_secret_options_type: d["type"],
  )
end

.from_json!(json) ⇒ Object



524
525
526
# File 'lib/schemas.rb', line 524

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

Instance Method Details

#to_dynamicObject



528
529
530
531
532
533
534
535
536
# File 'lib/schemas.rb', line 528

def to_dynamic
  {
    "environment" => environment,
    "path"        => path,
    "projectId"   => project_id,
    "secretName"  => secret_name,
    "type"        => delete_secret_options_type,
  }
end

#to_json(options = nil) ⇒ Object



538
539
540
# File 'lib/schemas.rb', line 538

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