Class: ProjectPutRequest

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



943
944
945
946
947
948
949
950
# File 'lib/schemas.rb', line 943

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    id:                       d.fetch("id"),
    project_put_request_name: d.fetch("name"),
    organization_id:          d.fetch("organizationId"),
  )
end

.from_json!(json) ⇒ Object



952
953
954
# File 'lib/schemas.rb', line 952

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

Instance Method Details

#to_dynamicObject



956
957
958
959
960
961
962
# File 'lib/schemas.rb', line 956

def to_dynamic
  {
    "id"             => id,
    "name"           => project_put_request_name,
    "organizationId" => organization_id,
  }
end

#to_json(options = nil) ⇒ Object



964
965
966
# File 'lib/schemas.rb', line 964

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