Class: APIResultForDeleteSecretResponse

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



1257
1258
1259
1260
1261
1262
1263
1264
# File 'lib/schemas.rb', line 1257

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

.from_json!(json) ⇒ Object



1266
1267
1268
# File 'lib/schemas.rb', line 1266

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

Instance Method Details

#to_dynamicObject



1270
1271
1272
1273
1274
1275
1276
# File 'lib/schemas.rb', line 1270

def to_dynamic
  {
    "data"    => data&.to_dynamic,
    "message" => message,
    "status"  => status,
  }
end

#to_json(options = nil) ⇒ Object



1278
1279
1280
# File 'lib/schemas.rb', line 1278

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