Class: UpdateSecretOptions

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



788
789
790
791
792
793
794
795
796
797
798
799
# File 'lib/schemas.rb', line 788

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"),
    secret_value:               d.fetch("secretValue"),
    skip_multiline_encoding:    d["skipMultilineEncoding"],
    update_secret_options_type: d["type"],
  )
end

.from_json!(json) ⇒ Object



801
802
803
# File 'lib/schemas.rb', line 801

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

Instance Method Details

#to_dynamicObject



805
806
807
808
809
810
811
812
813
814
815
# File 'lib/schemas.rb', line 805

def to_dynamic
  {
    "environment"           => environment,
    "path"                  => path,
    "projectId"             => project_id,
    "secretName"            => secret_name,
    "secretValue"           => secret_value,
    "skipMultilineEncoding" => skip_multiline_encoding,
    "type"                  => update_secret_options_type,
  }
end

#to_json(options = nil) ⇒ Object



817
818
819
# File 'lib/schemas.rb', line 817

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