Class: Cadenya::Types::UpdateAIProviderKeyRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(workspace_id: nil, id: nil, metadata: nil, spec: nil, update_mask: nil) ⇒ UpdateAIProviderKeyRequest

Returns a new instance of UpdateAIProviderKeyRequest.



6538
6539
6540
6541
6542
6543
6544
# File 'lib/cadenya/types.rb', line 6538

def initialize(workspace_id: nil, id: nil, metadata: nil, spec: nil, update_mask: nil)
  @workspace_id = workspace_id
  @id = id
  @metadata = 
  @spec = spec
  @update_mask = update_mask
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



6536
6537
6538
# File 'lib/cadenya/types.rb', line 6536

def id
  @id
end

#metadataObject (readonly)

Returns the value of attribute metadata.



6536
6537
6538
# File 'lib/cadenya/types.rb', line 6536

def 
  @metadata
end

#specObject (readonly)

Returns the value of attribute spec.



6536
6537
6538
# File 'lib/cadenya/types.rb', line 6536

def spec
  @spec
end

#update_maskObject (readonly)

Returns the value of attribute update_mask.



6536
6537
6538
# File 'lib/cadenya/types.rb', line 6536

def update_mask
  @update_mask
end

#workspace_idObject (readonly)

Returns the value of attribute workspace_id.



6536
6537
6538
# File 'lib/cadenya/types.rb', line 6536

def workspace_id
  @workspace_id
end

Class Method Details

.from_json(data) ⇒ Object



6546
6547
6548
6549
6550
6551
6552
6553
6554
# File 'lib/cadenya/types.rb', line 6546

def self.from_json(data)
  new(
    workspace_id: data["workspaceId"],
    id: data["id"],
    metadata: data["metadata"].nil? ? nil : Types::UpdateResourceMetadata.from_json(data["metadata"]),
    spec: data["spec"].nil? ? nil : Types::AIProviderKeySpec.from_json(data["spec"]),
    update_mask: data["updateMask"],
  )
end

Instance Method Details

#to_hObject



6556
6557
6558
6559
6560
6561
6562
6563
6564
# File 'lib/cadenya/types.rb', line 6556

def to_h
  {
    workspace_id: Util.plain(@workspace_id),
    id: Util.plain(@id),
    metadata: Util.plain(@metadata),
    spec: Util.plain(@spec),
    update_mask: Util.plain(@update_mask),
  }.reject { |_k, v| v.nil? }
end