Class: GetEnvironmentsResponse

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



10000
10001
10002
10003
10004
10005
# File 'lib/schemas.rb', line 10000

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    environments: d["environments"]&.map { |x| GetEnvironmentsResponseEnvironmentsItem.from_dynamic!(x) },
  )
end

.from_json!(json) ⇒ Object



10007
10008
10009
# File 'lib/schemas.rb', line 10007

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

Instance Method Details

#to_dynamicObject



10011
10012
10013
10014
10015
# File 'lib/schemas.rb', line 10011

def to_dynamic
  {
    "environments" => environments&.map { |x| x.to_dynamic },
  }
end

#to_json(options = nil) ⇒ Object



10017
10018
10019
# File 'lib/schemas.rb', line 10017

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