Class: PostEnvironmentsBody

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



23135
23136
23137
23138
23139
23140
# File 'lib/schemas.rb', line 23135

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

.from_json!(json) ⇒ Object



23142
23143
23144
# File 'lib/schemas.rb', line 23142

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

Instance Method Details

#to_dynamicObject



23146
23147
23148
23149
23150
# File 'lib/schemas.rb', line 23146

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

#to_json(options = nil) ⇒ Object



23152
23153
23154
# File 'lib/schemas.rb', line 23152

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