Class: SecretsSyncResponse
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- SecretsSyncResponse
- Defined in:
- lib/schemas.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_dynamic!(d) ⇒ Object
2249 2250 2251 2252 2253 2254 2255 |
# File 'lib/schemas.rb', line 2249 def self.from_dynamic!(d) d = Types::Hash[d] new( has_changes: d.fetch("hasChanges"), secrets: d["secrets"]&.map { |x| SecretResponse.from_dynamic!(x) }, ) end |
.from_json!(json) ⇒ Object
2257 2258 2259 |
# File 'lib/schemas.rb', line 2257 def self.from_json!(json) from_dynamic!(JSON.parse(json)) end |
Instance Method Details
#to_dynamic ⇒ Object
2261 2262 2263 2264 2265 2266 |
# File 'lib/schemas.rb', line 2261 def to_dynamic { "hasChanges" => has_changes, "secrets" => secrets&.map { |x| x.to_dynamic }, } end |
#to_json(options = nil) ⇒ Object
2268 2269 2270 |
# File 'lib/schemas.rb', line 2268 def to_json( = nil) JSON.generate(to_dynamic, ) end |