Class: PostEnvironmentsBodyEnvironmentValuesItemItem

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



23072
23073
23074
23075
23076
23077
23078
23079
23080
# File 'lib/schemas.rb', line 23072

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    enabled:                                                  d["enabled"],
    key:                                                      d["key"],
    post_environments_body_environment_values_item_item_type: d["type"],
    value:                                                    d["value"],
  )
end

.from_json!(json) ⇒ Object



23082
23083
23084
# File 'lib/schemas.rb', line 23082

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

Instance Method Details

#to_dynamicObject



23086
23087
23088
23089
23090
23091
23092
23093
# File 'lib/schemas.rb', line 23086

def to_dynamic
  {
    "enabled" => enabled,
    "key"     => key,
    "type"    => post_environments_body_environment_values_item_item_type,
    "value"   => value,
  }
end

#to_json(options = nil) ⇒ Object



23095
23096
23097
# File 'lib/schemas.rb', line 23095

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