Class: DeleteSecretResponseSecret

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



1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
# File 'lib/schemas.rb', line 1189

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    environment:    d.fetch("environment"),
    is_fallback:    d["isFallback"],
    secret_comment: d.fetch("secretComment"),
    secret_key:     d.fetch("secretKey"),
    secret_path:    d["secretPath"],
    secret_value:   d.fetch("secretValue"),
    secret_type:    d.fetch("type"),
    version:        d.fetch("version"),
    workspace:      d.fetch("workspace"),
  )
end

.from_json!(json) ⇒ Object



1204
1205
1206
# File 'lib/schemas.rb', line 1204

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

Instance Method Details

#to_dynamicObject



1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
# File 'lib/schemas.rb', line 1208

def to_dynamic
  {
    "environment"   => environment,
    "isFallback"    => is_fallback,
    "secretComment" => secret_comment,
    "secretKey"     => secret_key,
    "secretPath"    => secret_path,
    "secretValue"   => secret_value,
    "type"          => secret_type,
    "version"       => version,
    "workspace"     => workspace,
  }
end

#to_json(options = nil) ⇒ Object



1222
1223
1224
# File 'lib/schemas.rb', line 1222

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