public abstract class TagKeysClient
Reference documentation and code samples for the Cloud Resource Manager v3 API class TagKeysClient.
TagKeys client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.ResourceManager.V3Assembly
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default TagKeys scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default TagKeys scopes are:
DeleteTagKeyOperationsClient
public virtual OperationsClient DeleteTagKeyOperationsClient { get; }
The long-running operations client for DeleteTagKey
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
GrpcClient
public virtual TagKeys.TagKeysClient GrpcClient { get; }
The underlying gRPC TagKeys client
Property Value | |
---|---|
Type | Description |
TagKeysTagKeysClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
ServiceMetadata |
UpdateTagKeyOperationsClient
public virtual OperationsClient UpdateTagKeyOperationsClient { get; }
The long-running operations client for UpdateTagKey
.
Property Value | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | CreateTagKeyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationTagKeyCreateTagKeyMetadata | The RPC response. |
// 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 | |
---|---|
Name | Description |
tagKey | TagKey Required. The TagKey to be created. Only fields |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationTagKeyCreateTagKeyMetadata | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | CreateTagKeyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationTagKeyCreateTagKeyMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | CreateTagKeyRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationTagKeyCreateTagKeyMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
tagKey | TagKey Required. The TagKey to be created. Only fields |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationTagKeyCreateTagKeyMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
tagKey | TagKey Required. The TagKey to be created. Only fields |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationTagKeyCreateTagKeyMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | DeleteTagKeyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationTagKeyDeleteTagKeyMetadata | The RPC response. |
// 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 | |
---|---|
Name | Description |
name | TagKeyName Required. The resource name of a TagKey to be deleted in the format
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationTagKeyDeleteTagKeyMetadata | The RPC response. |
// 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 | |
---|---|
Name | Description |
name | string Required. The resource name of a TagKey to be deleted in the format
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationTagKeyDeleteTagKeyMetadata | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | DeleteTagKeyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationTagKeyDeleteTagKeyMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | DeleteTagKeyRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationTagKeyDeleteTagKeyMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | TagKeyName Required. The resource name of a TagKey to be deleted in the format
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationTagKeyDeleteTagKeyMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | TagKeyName Required. The resource name of a TagKey to be deleted in the format
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationTagKeyDeleteTagKeyMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | string Required. The resource name of a TagKey to be deleted in the format
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationTagKeyDeleteTagKeyMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | string Required. The resource name of a TagKey to be deleted in the format
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationTagKeyDeleteTagKeyMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetIamPolicyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// 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 | |
---|---|
Name | Description |
resource | string REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// 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 | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskPolicy | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskPolicy | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetIamPolicyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskPolicy | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetIamPolicyRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskPolicy | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
resource | string REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskPolicy | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
resource | string REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskPolicy | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetNamespacedTagKeyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TagKey | The RPC response. |
// 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 | |
---|---|
Name | Description |
name | TagKeyName Required. A namespaced tag key name in the format
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TagKey | The RPC response. |
// 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 | |
---|---|
Name | Description |
name | string Required. A namespaced tag key name in the format
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TagKey | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetNamespacedTagKeyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskTagKey | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetNamespacedTagKeyRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskTagKey | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | TagKeyName Required. A namespaced tag key name in the format
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskTagKey | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | TagKeyName Required. A namespaced tag key name in the format
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskTagKey | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | string Required. A namespaced tag key name in the format
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskTagKey | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | string Required. A namespaced tag key name in the format
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskTagKey | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetTagKeyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TagKey | The RPC response. |
// 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 | |
---|---|
Name | Description |
name | TagKeyName Required. A resource name in the format |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TagKey | The RPC response. |
// 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 | |
---|---|
Name | Description |
name | string Required. A resource name in the format |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TagKey | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetTagKeyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskTagKey | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetTagKeyRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskTagKey | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | TagKeyName Required. A resource name in the format |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskTagKey | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | TagKeyName Required. A resource name in the format |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskTagKey | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | string Required. A resource name in the format |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskTagKey | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | string Required. A resource name in the format |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskTagKey | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
parent | IResourceName Required. The resource name of the new TagKey's parent.
Must be of the form |
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListTagKeysResponseTagKey | A pageable sequence of TagKey resources. |
// 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