Class: ResponseForDeleteSecretResponse

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



1287
1288
1289
1290
1291
1292
1293
1294
# File 'lib/schemas.rb', line 1287

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    data:          d["data"] ? DeleteSecretResponse.from_dynamic!(d["data"]) : nil,
    error_message: d["errorMessage"],
    success:       d.fetch("success"),
  )
end

.from_json!(json) ⇒ Object



1296
1297
1298
# File 'lib/schemas.rb', line 1296

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

Instance Method Details

#to_dynamicObject



1300
1301
1302
1303
1304
1305
1306
# File 'lib/schemas.rb', line 1300

def to_dynamic
  {
    "data"         => data&.to_dynamic,
    "errorMessage" => error_message,
    "success"      => success,
  }
end

#to_json(options = nil) ⇒ Object



1308
1309
1310
# File 'lib/schemas.rb', line 1308

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