Cloud Resource Manager v3 API - Class TagKeysClient (2.2.0)

public abstract class TagKeysClient

Reference documentation and code samples for the Cloud Resource Manager v3 API class TagKeysClient.

TagKeys client wrapper, for convenient use.

Inheritance

object > TagKeysClient

Derived Types

Namespace

Google.Cloud.ResourceManager.V3

Assembly

Google.Cloud.ResourceManager.V3.dll

Remarks

Allow users to create and manage tag keys.

Properties

CreateTagKeyOperationsClient

public virtual OperationsClient CreateTagKeyOperationsClient { get; }

The long-running operations client for CreateTagKey.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the TagKeys service, which is a host of "cloudresourcemanager.googleapis.com" and a port of 443.

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default TagKeys scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

DeleteTagKeyOperationsClient

public virtual OperationsClient DeleteTagKeyOperationsClient { get; }

The long-running operations client for DeleteTagKey.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual TagKeys.TagKeysClient GrpcClient { get; }

The underlying gRPC TagKeys client

Property Value
TypeDescription
TagKeysTagKeysClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

UpdateTagKeyOperationsClient

public virtual OperationsClient UpdateTagKeyOperationsClient { get; }

The long-running operations client for UpdateTagKey.

Property Value
TypeDescription
OperationsClient

Methods

Create()

public static TagKeysClient Create()

Synchronously creates a TagKeysClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use TagKeysClientBuilder.

Returns
TypeDescription
TagKeysClient

The created TagKeysClient.

CreateAsync(CancellationToken)

public static Task<TagKeysClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a TagKeysClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use TagKeysClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskTagKeysClient

The task representing the created TagKeysClient.

CreateTagKey(CreateTagKeyRequest, CallSettings)

public virtual Operation<TagKey, CreateTagKeyMetadata> CreateTagKey(CreateTagKeyRequest request, CallSettings callSettings = null)

Creates a new TagKey. If another request with the same parameters is sent while the original request is in process, the second request will receive an error. A maximum of 1000 TagKeys can exist under a parent at any given time.

Parameters
NameDescription
requestCreateTagKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationTagKeyCreateTagKeyMetadata

The RPC response.

Example
// Create client
TagKeysClient tagKeysClient = TagKeysClient.Create();
// Initialize request argument(s)
CreateTagKeyRequest request = new CreateTagKeyRequest
{
    TagKey = new TagKey(),
    ValidateOnly = false,
};
// Make the request
Operation<TagKey, CreateTagKeyMetadata> response = tagKeysClient.CreateTagKey(request);

// Poll until the returned long-running operation is complete
Operation<TagKey, CreateTagKeyMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
TagKey result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TagKey, CreateTagKeyMetadata> retrievedResponse = tagKeysClient.PollOnceCreateTagKey(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagKey retrievedResult = retrievedResponse.Result;
}

CreateTagKey(TagKey, CallSettings)

public virtual Operation<TagKey, CreateTagKeyMetadata> CreateTagKey(TagKey tagKey, CallSettings callSettings = null)

Creates a new TagKey. If another request with the same parameters is sent while the original request is in process, the second request will receive an error. A maximum of 1000 TagKeys can exist under a parent at any given time.

Parameters
NameDescription
tagKeyTagKey

Required. The TagKey to be created. Only fields short_name, description, and parent are considered during the creation request.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationTagKeyCreateTagKeyMetadata

The RPC response.

Example
// Create client
TagKeysClient tagKeysClient = TagKeysClient.Create();
// Initialize request argument(s)
TagKey tagKey = new TagKey();
// Make the request
Operation<TagKey, CreateTagKeyMetadata> response = tagKeysClient.CreateTagKey(tagKey);

// Poll until the returned long-running operation is complete
Operation<TagKey, CreateTagKeyMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
TagKey result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TagKey, CreateTagKeyMetadata> retrievedResponse = tagKeysClient.PollOnceCreateTagKey(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagKey retrievedResult = retrievedResponse.Result;
}

CreateTagKeyAsync(CreateTagKeyRequest, CallSettings)

public virtual Task<Operation<TagKey, CreateTagKeyMetadata>> CreateTagKeyAsync(CreateTagKeyRequest request, CallSettings callSettings = null)

Creates a new TagKey. If another request with the same parameters is sent while the original request is in process, the second request will receive an error. A maximum of 1000 TagKeys can exist under a parent at any given time.

Parameters
NameDescription
requestCreateTagKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationTagKeyCreateTagKeyMetadata

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
CreateTagKeyRequest request = new CreateTagKeyRequest
{
    TagKey = new TagKey(),
    ValidateOnly = false,
};
// Make the request
Operation<TagKey, CreateTagKeyMetadata> response = await tagKeysClient.CreateTagKeyAsync(request);

// Poll until the returned long-running operation is complete
Operation<TagKey, CreateTagKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TagKey result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TagKey, CreateTagKeyMetadata> retrievedResponse = await tagKeysClient.PollOnceCreateTagKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagKey retrievedResult = retrievedResponse.Result;
}

CreateTagKeyAsync(CreateTagKeyRequest, CancellationToken)

public virtual Task<Operation<TagKey, CreateTagKeyMetadata>> CreateTagKeyAsync(CreateTagKeyRequest request, CancellationToken cancellationToken)

Creates a new TagKey. If another request with the same parameters is sent while the original request is in process, the second request will receive an error. A maximum of 1000 TagKeys can exist under a parent at any given time.

Parameters
NameDescription
requestCreateTagKeyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationTagKeyCreateTagKeyMetadata

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
CreateTagKeyRequest request = new CreateTagKeyRequest
{
    TagKey = new TagKey(),
    ValidateOnly = false,
};
// Make the request
Operation<TagKey, CreateTagKeyMetadata> response = await tagKeysClient.CreateTagKeyAsync(request);

// Poll until the returned long-running operation is complete
Operation<TagKey, CreateTagKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TagKey result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TagKey, CreateTagKeyMetadata> retrievedResponse = await tagKeysClient.PollOnceCreateTagKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagKey retrievedResult = retrievedResponse.Result;
}

CreateTagKeyAsync(TagKey, CallSettings)

public virtual Task<Operation<TagKey, CreateTagKeyMetadata>> CreateTagKeyAsync(TagKey tagKey, CallSettings callSettings = null)

Creates a new TagKey. If another request with the same parameters is sent while the original request is in process, the second request will receive an error. A maximum of 1000 TagKeys can exist under a parent at any given time.

Parameters
NameDescription
tagKeyTagKey

Required. The TagKey to be created. Only fields short_name, description, and parent are considered during the creation request.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationTagKeyCreateTagKeyMetadata

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
TagKey tagKey = new TagKey();
// Make the request
Operation<TagKey, CreateTagKeyMetadata> response = await tagKeysClient.CreateTagKeyAsync(tagKey);

// Poll until the returned long-running operation is complete
Operation<TagKey, CreateTagKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TagKey result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TagKey, CreateTagKeyMetadata> retrievedResponse = await tagKeysClient.PollOnceCreateTagKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagKey retrievedResult = retrievedResponse.Result;
}

CreateTagKeyAsync(TagKey, CancellationToken)

public virtual Task<Operation<TagKey, CreateTagKeyMetadata>> CreateTagKeyAsync(TagKey tagKey, CancellationToken cancellationToken)

Creates a new TagKey. If another request with the same parameters is sent while the original request is in process, the second request will receive an error. A maximum of 1000 TagKeys can exist under a parent at any given time.

Parameters
NameDescription
tagKeyTagKey

Required. The TagKey to be created. Only fields short_name, description, and parent are considered during the creation request.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationTagKeyCreateTagKeyMetadata

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
TagKey tagKey = new TagKey();
// Make the request
Operation<TagKey, CreateTagKeyMetadata> response = await tagKeysClient.CreateTagKeyAsync(tagKey);

// Poll until the returned long-running operation is complete
Operation<TagKey, CreateTagKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TagKey result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TagKey, CreateTagKeyMetadata> retrievedResponse = await tagKeysClient.PollOnceCreateTagKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagKey retrievedResult = retrievedResponse.Result;
}

DeleteTagKey(DeleteTagKeyRequest, CallSettings)

public virtual Operation<TagKey, DeleteTagKeyMetadata> DeleteTagKey(DeleteTagKeyRequest request, CallSettings callSettings = null)

Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues.

Parameters
NameDescription
requestDeleteTagKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationTagKeyDeleteTagKeyMetadata

The RPC response.

Example
// Create client
TagKeysClient tagKeysClient = TagKeysClient.Create();
// Initialize request argument(s)
DeleteTagKeyRequest request = new DeleteTagKeyRequest
{
    TagKeyName = TagKeyName.FromTagKey("[TAG_KEY]"),
    ValidateOnly = false,
    Etag = "",
};
// Make the request
Operation<TagKey, DeleteTagKeyMetadata> response = tagKeysClient.DeleteTagKey(request);

// Poll until the returned long-running operation is complete
Operation<TagKey, DeleteTagKeyMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
TagKey result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TagKey, DeleteTagKeyMetadata> retrievedResponse = tagKeysClient.PollOnceDeleteTagKey(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagKey retrievedResult = retrievedResponse.Result;
}

DeleteTagKey(TagKeyName, CallSettings)

public virtual Operation<TagKey, DeleteTagKeyMetadata> DeleteTagKey(TagKeyName name, CallSettings callSettings = null)

Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues.

Parameters
NameDescription
nameTagKeyName

Required. The resource name of a TagKey to be deleted in the format tagKeys/123. The TagKey cannot be a parent of any existing TagValues or it will not be deleted successfully.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationTagKeyDeleteTagKeyMetadata

The RPC response.

Example
// Create client
TagKeysClient tagKeysClient = TagKeysClient.Create();
// Initialize request argument(s)
TagKeyName name = TagKeyName.FromTagKey("[TAG_KEY]");
// Make the request
Operation<TagKey, DeleteTagKeyMetadata> response = tagKeysClient.DeleteTagKey(name);

// Poll until the returned long-running operation is complete
Operation<TagKey, DeleteTagKeyMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
TagKey result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TagKey, DeleteTagKeyMetadata> retrievedResponse = tagKeysClient.PollOnceDeleteTagKey(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagKey retrievedResult = retrievedResponse.Result;
}

DeleteTagKey(string, CallSettings)

public virtual Operation<TagKey, DeleteTagKeyMetadata> DeleteTagKey(string name, CallSettings callSettings = null)

Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues.

Parameters
NameDescription
namestring

Required. The resource name of a TagKey to be deleted in the format tagKeys/123. The TagKey cannot be a parent of any existing TagValues or it will not be deleted successfully.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationTagKeyDeleteTagKeyMetadata

The RPC response.

Example
// Create client
TagKeysClient tagKeysClient = TagKeysClient.Create();
// Initialize request argument(s)
string name = "tagKeys/[TAG_KEY]";
// Make the request
Operation<TagKey, DeleteTagKeyMetadata> response = tagKeysClient.DeleteTagKey(name);

// Poll until the returned long-running operation is complete
Operation<TagKey, DeleteTagKeyMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
TagKey result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TagKey, DeleteTagKeyMetadata> retrievedResponse = tagKeysClient.PollOnceDeleteTagKey(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagKey retrievedResult = retrievedResponse.Result;
}

DeleteTagKeyAsync(DeleteTagKeyRequest, CallSettings)

public virtual Task<Operation<TagKey, DeleteTagKeyMetadata>> DeleteTagKeyAsync(DeleteTagKeyRequest request, CallSettings callSettings = null)

Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues.

Parameters
NameDescription
requestDeleteTagKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationTagKeyDeleteTagKeyMetadata

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
DeleteTagKeyRequest request = new DeleteTagKeyRequest
{
    TagKeyName = TagKeyName.FromTagKey("[TAG_KEY]"),
    ValidateOnly = false,
    Etag = "",
};
// Make the request
Operation<TagKey, DeleteTagKeyMetadata> response = await tagKeysClient.DeleteTagKeyAsync(request);

// Poll until the returned long-running operation is complete
Operation<TagKey, DeleteTagKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TagKey result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TagKey, DeleteTagKeyMetadata> retrievedResponse = await tagKeysClient.PollOnceDeleteTagKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagKey retrievedResult = retrievedResponse.Result;
}

DeleteTagKeyAsync(DeleteTagKeyRequest, CancellationToken)

public virtual Task<Operation<TagKey, DeleteTagKeyMetadata>> DeleteTagKeyAsync(DeleteTagKeyRequest request, CancellationToken cancellationToken)

Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues.

Parameters
NameDescription
requestDeleteTagKeyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationTagKeyDeleteTagKeyMetadata

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
DeleteTagKeyRequest request = new DeleteTagKeyRequest
{
    TagKeyName = TagKeyName.FromTagKey("[TAG_KEY]"),
    ValidateOnly = false,
    Etag = "",
};
// Make the request
Operation<TagKey, DeleteTagKeyMetadata> response = await tagKeysClient.DeleteTagKeyAsync(request);

// Poll until the returned long-running operation is complete
Operation<TagKey, DeleteTagKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TagKey result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TagKey, DeleteTagKeyMetadata> retrievedResponse = await tagKeysClient.PollOnceDeleteTagKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagKey retrievedResult = retrievedResponse.Result;
}

DeleteTagKeyAsync(TagKeyName, CallSettings)

public virtual Task<Operation<TagKey, DeleteTagKeyMetadata>> DeleteTagKeyAsync(TagKeyName name, CallSettings callSettings = null)

Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues.

Parameters
NameDescription
nameTagKeyName

Required. The resource name of a TagKey to be deleted in the format tagKeys/123. The TagKey cannot be a parent of any existing TagValues or it will not be deleted successfully.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationTagKeyDeleteTagKeyMetadata

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
TagKeyName name = TagKeyName.FromTagKey("[TAG_KEY]");
// Make the request
Operation<TagKey, DeleteTagKeyMetadata> response = await tagKeysClient.DeleteTagKeyAsync(name);

// Poll until the returned long-running operation is complete
Operation<TagKey, DeleteTagKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TagKey result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TagKey, DeleteTagKeyMetadata> retrievedResponse = await tagKeysClient.PollOnceDeleteTagKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagKey retrievedResult = retrievedResponse.Result;
}

DeleteTagKeyAsync(TagKeyName, CancellationToken)

public virtual Task<Operation<TagKey, DeleteTagKeyMetadata>> DeleteTagKeyAsync(TagKeyName name, CancellationToken cancellationToken)

Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues.

Parameters
NameDescription
nameTagKeyName

Required. The resource name of a TagKey to be deleted in the format tagKeys/123. The TagKey cannot be a parent of any existing TagValues or it will not be deleted successfully.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationTagKeyDeleteTagKeyMetadata

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
TagKeyName name = TagKeyName.FromTagKey("[TAG_KEY]");
// Make the request
Operation<TagKey, DeleteTagKeyMetadata> response = await tagKeysClient.DeleteTagKeyAsync(name);

// Poll until the returned long-running operation is complete
Operation<TagKey, DeleteTagKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TagKey result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TagKey, DeleteTagKeyMetadata> retrievedResponse = await tagKeysClient.PollOnceDeleteTagKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagKey retrievedResult = retrievedResponse.Result;
}

DeleteTagKeyAsync(string, CallSettings)

public virtual Task<Operation<TagKey, DeleteTagKeyMetadata>> DeleteTagKeyAsync(string name, CallSettings callSettings = null)

Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues.

Parameters
NameDescription
namestring

Required. The resource name of a TagKey to be deleted in the format tagKeys/123. The TagKey cannot be a parent of any existing TagValues or it will not be deleted successfully.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationTagKeyDeleteTagKeyMetadata

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
string name = "tagKeys/[TAG_KEY]";
// Make the request
Operation<TagKey, DeleteTagKeyMetadata> response = await tagKeysClient.DeleteTagKeyAsync(name);

// Poll until the returned long-running operation is complete
Operation<TagKey, DeleteTagKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TagKey result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TagKey, DeleteTagKeyMetadata> retrievedResponse = await tagKeysClient.PollOnceDeleteTagKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagKey retrievedResult = retrievedResponse.Result;
}

DeleteTagKeyAsync(string, CancellationToken)

public virtual Task<Operation<TagKey, DeleteTagKeyMetadata>> DeleteTagKeyAsync(string name, CancellationToken cancellationToken)

Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues.

Parameters
NameDescription
namestring

Required. The resource name of a TagKey to be deleted in the format tagKeys/123. The TagKey cannot be a parent of any existing TagValues or it will not be deleted successfully.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationTagKeyDeleteTagKeyMetadata

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
string name = "tagKeys/[TAG_KEY]";
// Make the request
Operation<TagKey, DeleteTagKeyMetadata> response = await tagKeysClient.DeleteTagKeyAsync(name);

// Poll until the returned long-running operation is complete
Operation<TagKey, DeleteTagKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TagKey result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TagKey, DeleteTagKeyMetadata> retrievedResponse = await tagKeysClient.PollOnceDeleteTagKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagKey retrievedResult = retrievedResponse.Result;
}

GetIamPolicy(IResourceName, CallSettings)

public virtual Policy GetIamPolicy(IResourceName resource, CallSettings callSettings = null)

Gets the access control policy for a TagKey. The returned policy may be empty if no such policy or resource exists. The resource field should be the TagKey's resource name. For example, "tagKeys/1234". The caller must have cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy permission on the specified TagKey.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
TagKeysClient tagKeysClient = TagKeysClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = tagKeysClient.GetIamPolicy(resource);

GetIamPolicy(GetIamPolicyRequest, CallSettings)

public virtual Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the access control policy for a TagKey. The returned policy may be empty if no such policy or resource exists. The resource field should be the TagKey's resource name. For example, "tagKeys/1234". The caller must have cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy permission on the specified TagKey.

Parameters
NameDescription
requestGetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
TagKeysClient tagKeysClient = TagKeysClient.Create();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = tagKeysClient.GetIamPolicy(request);

GetIamPolicy(string, CallSettings)

public virtual Policy GetIamPolicy(string resource, CallSettings callSettings = null)

Gets the access control policy for a TagKey. The returned policy may be empty if no such policy or resource exists. The resource field should be the TagKey's resource name. For example, "tagKeys/1234". The caller must have cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy permission on the specified TagKey.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
TagKeysClient tagKeysClient = TagKeysClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = tagKeysClient.GetIamPolicy(resource);

GetIamPolicyAsync(IResourceName, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CallSettings callSettings = null)

Gets the access control policy for a TagKey. The returned policy may be empty if no such policy or resource exists. The resource field should be the TagKey's resource name. For example, "tagKeys/1234". The caller must have cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy permission on the specified TagKey.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await tagKeysClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(IResourceName, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CancellationToken cancellationToken)

Gets the access control policy for a TagKey. The returned policy may be empty if no such policy or resource exists. The resource field should be the TagKey's resource name. For example, "tagKeys/1234". The caller must have cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy permission on the specified TagKey.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await tagKeysClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the access control policy for a TagKey. The returned policy may be empty if no such policy or resource exists. The resource field should be the TagKey's resource name. For example, "tagKeys/1234". The caller must have cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy permission on the specified TagKey.

Parameters
NameDescription
requestGetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await tagKeysClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(GetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CancellationToken cancellationToken)

Gets the access control policy for a TagKey. The returned policy may be empty if no such policy or resource exists. The resource field should be the TagKey's resource name. For example, "tagKeys/1234". The caller must have cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy permission on the specified TagKey.

Parameters
NameDescription
requestGetIamPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await tagKeysClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(string, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(string resource, CallSettings callSettings = null)

Gets the access control policy for a TagKey. The returned policy may be empty if no such policy or resource exists. The resource field should be the TagKey's resource name. For example, "tagKeys/1234". The caller must have cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy permission on the specified TagKey.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await tagKeysClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(string, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(string resource, CancellationToken cancellationToken)

Gets the access control policy for a TagKey. The returned policy may be empty if no such policy or resource exists. The resource field should be the TagKey's resource name. For example, "tagKeys/1234". The caller must have cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy permission on the specified TagKey.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await tagKeysClient.GetIamPolicyAsync(resource);

GetNamespacedTagKey(GetNamespacedTagKeyRequest, CallSettings)

public virtual TagKey GetNamespacedTagKey(GetNamespacedTagKeyRequest request, CallSettings callSettings = null)

Retrieves a TagKey by its namespaced name. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
requestGetNamespacedTagKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TagKey

The RPC response.

Example
// Create client
TagKeysClient tagKeysClient = TagKeysClient.Create();
// Initialize request argument(s)
GetNamespacedTagKeyRequest request = new GetNamespacedTagKeyRequest
{
    TagKeyName = TagKeyName.FromTagKey("[TAG_KEY]"),
};
// Make the request
TagKey response = tagKeysClient.GetNamespacedTagKey(request);

GetNamespacedTagKey(TagKeyName, CallSettings)

public virtual TagKey GetNamespacedTagKey(TagKeyName name, CallSettings callSettings = null)

Retrieves a TagKey by its namespaced name. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
nameTagKeyName

Required. A namespaced tag key name in the format {parentId}/{tagKeyShort}, such as 42/foo for a key with short name "foo" under the organization with ID 42 or r2-d2/bar for a key with short name "bar" under the project r2-d2.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TagKey

The RPC response.

Example
// Create client
TagKeysClient tagKeysClient = TagKeysClient.Create();
// Initialize request argument(s)
TagKeyName name = TagKeyName.FromTagKey("[TAG_KEY]");
// Make the request
TagKey response = tagKeysClient.GetNamespacedTagKey(name);

GetNamespacedTagKey(string, CallSettings)

public virtual TagKey GetNamespacedTagKey(string name, CallSettings callSettings = null)

Retrieves a TagKey by its namespaced name. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
namestring

Required. A namespaced tag key name in the format {parentId}/{tagKeyShort}, such as 42/foo for a key with short name "foo" under the organization with ID 42 or r2-d2/bar for a key with short name "bar" under the project r2-d2.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TagKey

The RPC response.

Example
// Create client
TagKeysClient tagKeysClient = TagKeysClient.Create();
// Initialize request argument(s)
string name = "tagKeys/[TAG_KEY]";
// Make the request
TagKey response = tagKeysClient.GetNamespacedTagKey(name);

GetNamespacedTagKeyAsync(GetNamespacedTagKeyRequest, CallSettings)

public virtual Task<TagKey> GetNamespacedTagKeyAsync(GetNamespacedTagKeyRequest request, CallSettings callSettings = null)

Retrieves a TagKey by its namespaced name. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
requestGetNamespacedTagKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTagKey

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
GetNamespacedTagKeyRequest request = new GetNamespacedTagKeyRequest
{
    TagKeyName = TagKeyName.FromTagKey("[TAG_KEY]"),
};
// Make the request
TagKey response = await tagKeysClient.GetNamespacedTagKeyAsync(request);

GetNamespacedTagKeyAsync(GetNamespacedTagKeyRequest, CancellationToken)

public virtual Task<TagKey> GetNamespacedTagKeyAsync(GetNamespacedTagKeyRequest request, CancellationToken cancellationToken)

Retrieves a TagKey by its namespaced name. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
requestGetNamespacedTagKeyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTagKey

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
GetNamespacedTagKeyRequest request = new GetNamespacedTagKeyRequest
{
    TagKeyName = TagKeyName.FromTagKey("[TAG_KEY]"),
};
// Make the request
TagKey response = await tagKeysClient.GetNamespacedTagKeyAsync(request);

GetNamespacedTagKeyAsync(TagKeyName, CallSettings)

public virtual Task<TagKey> GetNamespacedTagKeyAsync(TagKeyName name, CallSettings callSettings = null)

Retrieves a TagKey by its namespaced name. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
nameTagKeyName

Required. A namespaced tag key name in the format {parentId}/{tagKeyShort}, such as 42/foo for a key with short name "foo" under the organization with ID 42 or r2-d2/bar for a key with short name "bar" under the project r2-d2.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTagKey

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
TagKeyName name = TagKeyName.FromTagKey("[TAG_KEY]");
// Make the request
TagKey response = await tagKeysClient.GetNamespacedTagKeyAsync(name);

GetNamespacedTagKeyAsync(TagKeyName, CancellationToken)

public virtual Task<TagKey> GetNamespacedTagKeyAsync(TagKeyName name, CancellationToken cancellationToken)

Retrieves a TagKey by its namespaced name. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
nameTagKeyName

Required. A namespaced tag key name in the format {parentId}/{tagKeyShort}, such as 42/foo for a key with short name "foo" under the organization with ID 42 or r2-d2/bar for a key with short name "bar" under the project r2-d2.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTagKey

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
TagKeyName name = TagKeyName.FromTagKey("[TAG_KEY]");
// Make the request
TagKey response = await tagKeysClient.GetNamespacedTagKeyAsync(name);

GetNamespacedTagKeyAsync(string, CallSettings)

public virtual Task<TagKey> GetNamespacedTagKeyAsync(string name, CallSettings callSettings = null)

Retrieves a TagKey by its namespaced name. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
namestring

Required. A namespaced tag key name in the format {parentId}/{tagKeyShort}, such as 42/foo for a key with short name "foo" under the organization with ID 42 or r2-d2/bar for a key with short name "bar" under the project r2-d2.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTagKey

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
string name = "tagKeys/[TAG_KEY]";
// Make the request
TagKey response = await tagKeysClient.GetNamespacedTagKeyAsync(name);

GetNamespacedTagKeyAsync(string, CancellationToken)

public virtual Task<TagKey> GetNamespacedTagKeyAsync(string name, CancellationToken cancellationToken)

Retrieves a TagKey by its namespaced name. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
namestring

Required. A namespaced tag key name in the format {parentId}/{tagKeyShort}, such as 42/foo for a key with short name "foo" under the organization with ID 42 or r2-d2/bar for a key with short name "bar" under the project r2-d2.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTagKey

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
string name = "tagKeys/[TAG_KEY]";
// Make the request
TagKey response = await tagKeysClient.GetNamespacedTagKeyAsync(name);

GetTagKey(GetTagKeyRequest, CallSettings)

public virtual TagKey GetTagKey(GetTagKeyRequest request, CallSettings callSettings = null)

Retrieves a TagKey. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
requestGetTagKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TagKey

The RPC response.

Example
// Create client
TagKeysClient tagKeysClient = TagKeysClient.Create();
// Initialize request argument(s)
GetTagKeyRequest request = new GetTagKeyRequest
{
    TagKeyName = TagKeyName.FromTagKey("[TAG_KEY]"),
};
// Make the request
TagKey response = tagKeysClient.GetTagKey(request);

GetTagKey(TagKeyName, CallSettings)

public virtual TagKey GetTagKey(TagKeyName name, CallSettings callSettings = null)

Retrieves a TagKey. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
nameTagKeyName

Required. A resource name in the format tagKeys/{id}, such as tagKeys/123.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TagKey

The RPC response.

Example
// Create client
TagKeysClient tagKeysClient = TagKeysClient.Create();
// Initialize request argument(s)
TagKeyName name = TagKeyName.FromTagKey("[TAG_KEY]");
// Make the request
TagKey response = tagKeysClient.GetTagKey(name);

GetTagKey(string, CallSettings)

public virtual TagKey GetTagKey(string name, CallSettings callSettings = null)

Retrieves a TagKey. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
namestring

Required. A resource name in the format tagKeys/{id}, such as tagKeys/123.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TagKey

The RPC response.

Example
// Create client
TagKeysClient tagKeysClient = TagKeysClient.Create();
// Initialize request argument(s)
string name = "tagKeys/[TAG_KEY]";
// Make the request
TagKey response = tagKeysClient.GetTagKey(name);

GetTagKeyAsync(GetTagKeyRequest, CallSettings)

public virtual Task<TagKey> GetTagKeyAsync(GetTagKeyRequest request, CallSettings callSettings = null)

Retrieves a TagKey. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
requestGetTagKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTagKey

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
GetTagKeyRequest request = new GetTagKeyRequest
{
    TagKeyName = TagKeyName.FromTagKey("[TAG_KEY]"),
};
// Make the request
TagKey response = await tagKeysClient.GetTagKeyAsync(request);

GetTagKeyAsync(GetTagKeyRequest, CancellationToken)

public virtual Task<TagKey> GetTagKeyAsync(GetTagKeyRequest request, CancellationToken cancellationToken)

Retrieves a TagKey. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
requestGetTagKeyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTagKey

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
GetTagKeyRequest request = new GetTagKeyRequest
{
    TagKeyName = TagKeyName.FromTagKey("[TAG_KEY]"),
};
// Make the request
TagKey response = await tagKeysClient.GetTagKeyAsync(request);

GetTagKeyAsync(TagKeyName, CallSettings)

public virtual Task<TagKey> GetTagKeyAsync(TagKeyName name, CallSettings callSettings = null)

Retrieves a TagKey. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
nameTagKeyName

Required. A resource name in the format tagKeys/{id}, such as tagKeys/123.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTagKey

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
TagKeyName name = TagKeyName.FromTagKey("[TAG_KEY]");
// Make the request
TagKey response = await tagKeysClient.GetTagKeyAsync(name);

GetTagKeyAsync(TagKeyName, CancellationToken)

public virtual Task<TagKey> GetTagKeyAsync(TagKeyName name, CancellationToken cancellationToken)

Retrieves a TagKey. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
nameTagKeyName

Required. A resource name in the format tagKeys/{id}, such as tagKeys/123.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTagKey

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
TagKeyName name = TagKeyName.FromTagKey("[TAG_KEY]");
// Make the request
TagKey response = await tagKeysClient.GetTagKeyAsync(name);

GetTagKeyAsync(string, CallSettings)

public virtual Task<TagKey> GetTagKeyAsync(string name, CallSettings callSettings = null)

Retrieves a TagKey. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
namestring

Required. A resource name in the format tagKeys/{id}, such as tagKeys/123.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTagKey

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
string name = "tagKeys/[TAG_KEY]";
// Make the request
TagKey response = await tagKeysClient.GetTagKeyAsync(name);

GetTagKeyAsync(string, CancellationToken)

public virtual Task<TagKey> GetTagKeyAsync(string name, CancellationToken cancellationToken)

Retrieves a TagKey. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it.

Parameters
NameDescription
namestring

Required. A resource name in the format tagKeys/{id}, such as tagKeys/123.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTagKey

A Task containing the RPC response.

Example
// Create client
TagKeysClient tagKeysClient = await TagKeysClient.CreateAsync();
// Initialize request argument(s)
string name = "tagKeys/[TAG_KEY]";
// Make the request
TagKey response = await tagKeysClient.GetTagKeyAsync(name);

ListTagKeys(IResourceName, string, int?, CallSettings)

public virtual PagedEnumerable<ListTagKeysResponse, TagKey> ListTagKeys(IResourceName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all TagKeys for a parent resource.

Parameters
NameDescription
parentIResourceName

Required. The resource name of the new TagKey's parent. Must be of the form folders/{folder_id} or organizations/{org_id}.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListTagKeysResponseTagKey

A pageable sequence of TagKey resources.

Example
// Create client
TagKeysClient tagKeysClient = TagKeysClient.Create();
// Initialize request argument(s)
IResourceName parent = new UnparsedResourceName("a/wildcard/resource");
// Make the request
PagedEnumerable<ListTagKeysResponse, TagKey> response = tagKeysClient.ListTagKeys(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (TagKey item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListTagKeysResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (TagKey item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<TagKey> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (TagKey item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListTagKeys(ListTagKeysRequest, CallSettings)

public virtual PagedEnumerable<ListTagKeysResponse, TagKey> ListTagKeys(ListTagKeysRequest request, CallSettings