Class: SecretDeleteResponse

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



2159
2160
2161
2162
2163
2164
2165
# File 'lib/schemas.rb', line 2159

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    error: d["error"],
    id:    d.fetch("id"),
  )
end

.from_json!(json) ⇒ Object



2167
2168
2169
# File 'lib/schemas.rb', line 2167

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

Instance Method Details

#to_dynamicObject



2171
2172
2173
2174
2175
2176
# File 'lib/schemas.rb', line 2171

def to_dynamic
  {
    "error" => error,
    "id"    => id,
  }
end

#to_json(options = nil) ⇒ Object



2178
2179
2180
# File 'lib/schemas.rb', line 2178

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