Class: APIResultForListSecretsResponse

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



1539
1540
1541
1542
1543
1544
1545
1546
# File 'lib/schemas.rb', line 1539

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

.from_json!(json) ⇒ Object



1548
1549
1550
# File 'lib/schemas.rb', line 1548

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

Instance Method Details

#to_dynamicObject



1552
1553
1554
1555
1556
1557
1558
# File 'lib/schemas.rb', line 1552

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

#to_json(options = nil) ⇒ Object



1560
1561
1562
# File 'lib/schemas.rb', line 1560

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