Class: PostEnvironmentsResponse

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



23197
23198
23199
23200
23201
23202
# File 'lib/schemas.rb', line 23197

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    environment: d["environment"] ? PostEnvironmentsResponseEnvironment.from_dynamic!(d["environment"]) : nil,
  )
end

.from_json!(json) ⇒ Object



23204
23205
23206
# File 'lib/schemas.rb', line 23204

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

Instance Method Details

#to_dynamicObject



23208
23209
23210
23211
23212
# File 'lib/schemas.rb', line 23208

def to_dynamic
  {
    "environment" => environment&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



23214
23215
23216
# File 'lib/schemas.rb', line 23214

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