Class: PostEnvironmentsResponseEnvironment

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



23168
23169
23170
23171
23172
23173
23174
23175
# File 'lib/schemas.rb', line 23168

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    id:                                          d["id"],
    post_environments_response_environment_name: d["name"],
    uid:                                         d["uid"],
  )
end

.from_json!(json) ⇒ Object



23177
23178
23179
# File 'lib/schemas.rb', line 23177

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

Instance Method Details

#to_dynamicObject



23181
23182
23183
23184
23185
23186
23187
# File 'lib/schemas.rb', line 23181

def to_dynamic
  {
    "id"   => id,
    "name" => post_environments_response_environment_name,
    "uid"  => uid,
  }
end

#to_json(options = nil) ⇒ Object



23189
23190
23191
# File 'lib/schemas.rb', line 23189

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