Class: GetSecretTypesResponse

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



16119
16120
16121
16122
16123
16124
16125
# File 'lib/schemas.rb', line 16119

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    data:                           d["data"]&.map { |x| GetSecretTypesResponseDataItem.from_dynamic!(x) },
    get_secret_types_response_meta: d["meta"] ? GetSecretTypesResponseMeta.from_dynamic!(d["meta"]) : nil,
  )
end

.from_json!(json) ⇒ Object



16127
16128
16129
# File 'lib/schemas.rb', line 16127

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

Instance Method Details

#to_dynamicObject



16131
16132
16133
16134
16135
16136
# File 'lib/schemas.rb', line 16131

def to_dynamic
  {
    "data" => data&.map { |x| x.to_dynamic },
    "meta" => get_secret_types_response_meta&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



16138
16139
16140
# File 'lib/schemas.rb', line 16138

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