Class: Cadenya::Types::CreateAPIKeyRequest

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(metadata: nil, spec: nil, workspace_id: nil) ⇒ CreateAPIKeyRequest

Returns a new instance of CreateAPIKeyRequest.



1477
1478
1479
1480
1481
# File 'lib/cadenya/types.rb', line 1477

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

Instance Attribute Details

#metadataObject (readonly)

Returns the value of attribute metadata.



1475
1476
1477
# File 'lib/cadenya/types.rb', line 1475

def 
  @metadata
end

#specObject (readonly)

Returns the value of attribute spec.



1475
1476
1477
# File 'lib/cadenya/types.rb', line 1475

def spec
  @spec
end

#workspace_idObject (readonly)

Returns the value of attribute workspace_id.



1475
1476
1477
# File 'lib/cadenya/types.rb', line 1475

def workspace_id
  @workspace_id
end

Class Method Details

.from_json(data) ⇒ Object



1483
1484
1485
1486
1487
1488
1489
# File 'lib/cadenya/types.rb', line 1483

def self.from_json(data)
  new(
    metadata: data["metadata"].nil? ? nil : Types::CreateAccountResourceMetadata.from_json(data["metadata"]),
    spec: data["spec"].nil? ? nil : Types::APIKeySpec.from_json(data["spec"]),
    workspace_id: data["workspaceId"],
  )
end

Instance Method Details

#to_hObject



1491
1492
1493
1494
1495
1496
1497
# File 'lib/cadenya/types.rb', line 1491

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