Class: GetEnvironmentsResponseEnvironmentsItem

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



9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
# File 'lib/schemas.rb', line 9963

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    created_at:                                       d["createdAt"],
    id:                                               d["id"],
    is_public:                                        d["isPublic"],
    get_environments_response_environments_item_name: d["name"],
    owner:                                            d["owner"],
    uid:                                              d["uid"],
    updated_at:                                       d["updatedAt"],
  )
end

.from_json!(json) ⇒ Object



9976
9977
9978
# File 'lib/schemas.rb', line 9976

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

Instance Method Details

#to_dynamicObject



9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
# File 'lib/schemas.rb', line 9980

def to_dynamic
  {
    "createdAt" => created_at,
    "id"        => id,
    "isPublic"  => is_public,
    "name"      => get_environments_response_environments_item_name,
    "owner"     => owner,
    "uid"       => uid,
    "updatedAt" => updated_at,
  }
end

#to_json(options = nil) ⇒ Object



9992
9993
9994
# File 'lib/schemas.rb', line 9992

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