Class: GetEnvironmentsEnvironmentIDResponseEnvironment

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



9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
# File 'lib/schemas.rb', line 9678

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    created_at:                                                d["createdAt"],
    id:                                                        d["id"],
    is_public:                                                 d["isPublic"],
    get_environments_environment_id_response_environment_name: d["name"],
    owner:                                                     d["owner"],
    updated_at:                                                d["updatedAt"],
    values:                                                    d["values"]&.map { |x| x.map { |x| GetEnvironmentsEnvironmentIDResponseEnvironmentValuesItemItem.from_dynamic!(x) } },
  )
end

.from_json!(json) ⇒ Object



9691
9692
9693
# File 'lib/schemas.rb', line 9691

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

Instance Method Details

#to_dynamicObject



9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
# File 'lib/schemas.rb', line 9695

def to_dynamic
  {
    "createdAt" => created_at,
    "id"        => id,
    "isPublic"  => is_public,
    "name"      => get_environments_environment_id_response_environment_name,
    "owner"     => owner,
    "updatedAt" => updated_at,
    "values"    => values&.map { |x| x.map { |x| x.to_dynamic } },
  }
end

#to_json(options = nil) ⇒ Object



9707
9708
9709
# File 'lib/schemas.rb', line 9707

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