Cloud Resource Manager v3 API - Class TagHoldsClient (2.2.0)

public abstract class TagHoldsClient

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

TagHolds client wrapper, for convenient use.

Inheritance

object > TagHoldsClient

Derived Types

Namespace

Google.Cloud.ResourceManager.V3

Assembly

Google.Cloud.ResourceManager.V3.dll

Remarks

Allow users to create and manage TagHolds for TagValues. TagHolds represent the use of a Tag Value that is not captured by TagBindings but should still block TagValue deletion (such as a reference in a policy condition). This service provides isolated failure domains by cloud location so that TagHolds can be managed in the same location as their usage.

Properties

CreateTagHoldOperationsClient

public virtual OperationsClient CreateTagHoldOperationsClient { get; }

The long-running operations client for CreateTagHold.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the TagHolds 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 TagHolds scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

DeleteTagHoldOperationsClient

public virtual OperationsClient DeleteTagHoldOperationsClient { get; }

The long-running operations client for DeleteTagHold.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual TagHolds.TagHoldsClient GrpcClient { get; }

The underlying gRPC TagHolds client

Property Value
TypeDescription
TagHoldsTagHoldsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static TagHoldsClient Create()

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

Returns
TypeDescription
TagHoldsClient

The created TagHoldsClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskTagHoldsClient

The task representing the created TagHoldsClient.

CreateTagHold(CreateTagHoldRequest, CallSettings)

public virtual Operation<TagHold, CreateTagHoldMetadata> CreateTagHold(CreateTagHoldRequest request, CallSettings callSettings = null)

Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists under the same TagValue.

Parameters
NameDescription
requestCreateTagHoldRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationTagHoldCreateTagHoldMetadata

The RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = TagHoldsClient.Create();
// Initialize request argument(s)
CreateTagHoldRequest request = new CreateTagHoldRequest
{
    ParentAsTagValueName = TagValueName.FromTagValue("[TAG_VALUE]"),
    TagHold = new TagHold(),
    ValidateOnly = false,
};
// Make the request
Operation<TagHold, CreateTagHoldMetadata> response = tagHoldsClient.CreateTagHold(request);

// Poll until the returned long-running operation is complete
Operation<TagHold, CreateTagHoldMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
TagHold 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<TagHold, CreateTagHoldMetadata> retrievedResponse = tagHoldsClient.PollOnceCreateTagHold(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagHold retrievedResult = retrievedResponse.Result;
}

CreateTagHold(TagValueName, TagHold, CallSettings)

public virtual Operation<TagHold, CreateTagHoldMetadata> CreateTagHold(TagValueName parent, TagHold tagHold, CallSettings callSettings = null)

Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists under the same TagValue.

Parameters
NameDescription
parentTagValueName

Required. The resource name of the TagHold's parent TagValue. Must be of the form: tagValues/{tag-value-id}.

tagHoldTagHold

Required. The TagHold to be created.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationTagHoldCreateTagHoldMetadata

The RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = TagHoldsClient.Create();
// Initialize request argument(s)
TagValueName parent = TagValueName.FromTagValue("[TAG_VALUE]");
TagHold tagHold = new TagHold();
// Make the request
Operation<TagHold, CreateTagHoldMetadata> response = tagHoldsClient.CreateTagHold(parent, tagHold);

// Poll until the returned long-running operation is complete
Operation<TagHold, CreateTagHoldMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
TagHold 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<TagHold, CreateTagHoldMetadata> retrievedResponse = tagHoldsClient.PollOnceCreateTagHold(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagHold retrievedResult = retrievedResponse.Result;
}

CreateTagHold(string, TagHold, CallSettings)

public virtual Operation<TagHold, CreateTagHoldMetadata> CreateTagHold(string parent, TagHold tagHold, CallSettings callSettings = null)

Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists under the same TagValue.

Parameters
NameDescription
parentstring

Required. The resource name of the TagHold's parent TagValue. Must be of the form: tagValues/{tag-value-id}.

tagHoldTagHold

Required. The TagHold to be created.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationTagHoldCreateTagHoldMetadata

The RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = TagHoldsClient.Create();
// Initialize request argument(s)
string parent = "tagValues/[TAG_VALUE]";
TagHold tagHold = new TagHold();
// Make the request
Operation<TagHold, CreateTagHoldMetadata> response = tagHoldsClient.CreateTagHold(parent, tagHold);

// Poll until the returned long-running operation is complete
Operation<TagHold, CreateTagHoldMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
TagHold 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<TagHold, CreateTagHoldMetadata> retrievedResponse = tagHoldsClient.PollOnceCreateTagHold(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagHold retrievedResult = retrievedResponse.Result;
}

CreateTagHoldAsync(CreateTagHoldRequest, CallSettings)

public virtual Task<Operation<TagHold, CreateTagHoldMetadata>> CreateTagHoldAsync(CreateTagHoldRequest request, CallSettings callSettings = null)

Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists under the same TagValue.

Parameters
NameDescription
requestCreateTagHoldRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationTagHoldCreateTagHoldMetadata

A Task containing the RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = await TagHoldsClient.CreateAsync();
// Initialize request argument(s)
CreateTagHoldRequest request = new CreateTagHoldRequest
{
    ParentAsTagValueName = TagValueName.FromTagValue("[TAG_VALUE]"),
    TagHold = new TagHold(),
    ValidateOnly = false,
};
// Make the request
Operation<TagHold, CreateTagHoldMetadata> response = await tagHoldsClient.CreateTagHoldAsync(request);

// Poll until the returned long-running operation is complete
Operation<TagHold, CreateTagHoldMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TagHold 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<TagHold, CreateTagHoldMetadata> retrievedResponse = await tagHoldsClient.PollOnceCreateTagHoldAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagHold retrievedResult = retrievedResponse.Result;
}

CreateTagHoldAsync(CreateTagHoldRequest, CancellationToken)

public virtual Task<Operation<TagHold, CreateTagHoldMetadata>> CreateTagHoldAsync(CreateTagHoldRequest request, CancellationToken cancellationToken)

Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists under the same TagValue.

Parameters
NameDescription
requestCreateTagHoldRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationTagHoldCreateTagHoldMetadata

A Task containing the RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = await TagHoldsClient.CreateAsync();
// Initialize request argument(s)
CreateTagHoldRequest request = new CreateTagHoldRequest
{
    ParentAsTagValueName = TagValueName.FromTagValue("[TAG_VALUE]"),
    TagHold = new TagHold(),
    ValidateOnly = false,
};
// Make the request
Operation<TagHold, CreateTagHoldMetadata> response = await tagHoldsClient.CreateTagHoldAsync(request);

// Poll until the returned long-running operation is complete
Operation<TagHold, CreateTagHoldMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TagHold 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<TagHold, CreateTagHoldMetadata> retrievedResponse = await tagHoldsClient.PollOnceCreateTagHoldAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagHold retrievedResult = retrievedResponse.Result;
}

CreateTagHoldAsync(TagValueName, TagHold, CallSettings)

public virtual Task<Operation<TagHold, CreateTagHoldMetadata>> CreateTagHoldAsync(TagValueName parent, TagHold tagHold, CallSettings callSettings = null)

Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists under the same TagValue.

Parameters
NameDescription
parentTagValueName

Required. The resource name of the TagHold's parent TagValue. Must be of the form: tagValues/{tag-value-id}.

tagHoldTagHold

Required. The TagHold to be created.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationTagHoldCreateTagHoldMetadata

A Task containing the RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = await TagHoldsClient.CreateAsync();
// Initialize request argument(s)
TagValueName parent = TagValueName.FromTagValue("[TAG_VALUE]");
TagHold tagHold = new TagHold();
// Make the request
Operation<TagHold, CreateTagHoldMetadata> response = await tagHoldsClient.CreateTagHoldAsync(parent, tagHold);

// Poll until the returned long-running operation is complete
Operation<TagHold, CreateTagHoldMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TagHold 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<TagHold, CreateTagHoldMetadata> retrievedResponse = await tagHoldsClient.PollOnceCreateTagHoldAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagHold retrievedResult = retrievedResponse.Result;
}

CreateTagHoldAsync(TagValueName, TagHold, CancellationToken)

public virtual Task<Operation<TagHold, CreateTagHoldMetadata>> CreateTagHoldAsync(TagValueName parent, TagHold tagHold, CancellationToken cancellationToken)

Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists under the same TagValue.

Parameters
NameDescription
parentTagValueName

Required. The resource name of the TagHold's parent TagValue. Must be of the form: tagValues/{tag-value-id}.

tagHoldTagHold

Required. The TagHold to be created.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationTagHoldCreateTagHoldMetadata

A Task containing the RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = await TagHoldsClient.CreateAsync();
// Initialize request argument(s)
TagValueName parent = TagValueName.FromTagValue("[TAG_VALUE]");
TagHold tagHold = new TagHold();
// Make the request
Operation<TagHold, CreateTagHoldMetadata> response = await tagHoldsClient.CreateTagHoldAsync(parent, tagHold);

// Poll until the returned long-running operation is complete
Operation<TagHold, CreateTagHoldMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TagHold 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<TagHold, CreateTagHoldMetadata> retrievedResponse = await tagHoldsClient.PollOnceCreateTagHoldAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagHold retrievedResult = retrievedResponse.Result;
}

CreateTagHoldAsync(string, TagHold, CallSettings)

public virtual Task<Operation<TagHold, CreateTagHoldMetadata>> CreateTagHoldAsync(string parent, TagHold tagHold, CallSettings callSettings = null)

Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists under the same TagValue.

Parameters
NameDescription
parentstring

Required. The resource name of the TagHold's parent TagValue. Must be of the form: tagValues/{tag-value-id}.

tagHoldTagHold

Required. The TagHold to be created.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationTagHoldCreateTagHoldMetadata

A Task containing the RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = await TagHoldsClient.CreateAsync();
// Initialize request argument(s)
string parent = "tagValues/[TAG_VALUE]";
TagHold tagHold = new TagHold();
// Make the request
Operation<TagHold, CreateTagHoldMetadata> response = await tagHoldsClient.CreateTagHoldAsync(parent, tagHold);

// Poll until the returned long-running operation is complete
Operation<TagHold, CreateTagHoldMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TagHold 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<TagHold, CreateTagHoldMetadata> retrievedResponse = await tagHoldsClient.PollOnceCreateTagHoldAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagHold retrievedResult = retrievedResponse.Result;
}

CreateTagHoldAsync(string, TagHold, CancellationToken)

public virtual Task<Operation<TagHold, CreateTagHoldMetadata>> CreateTagHoldAsync(string parent, TagHold tagHold, CancellationToken cancellationToken)

Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists under the same TagValue.

Parameters
NameDescription
parentstring

Required. The resource name of the TagHold's parent TagValue. Must be of the form: tagValues/{tag-value-id}.

tagHoldTagHold

Required. The TagHold to be created.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationTagHoldCreateTagHoldMetadata

A Task containing the RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = await TagHoldsClient.CreateAsync();
// Initialize request argument(s)
string parent = "tagValues/[TAG_VALUE]";
TagHold tagHold = new TagHold();
// Make the request
Operation<TagHold, CreateTagHoldMetadata> response = await tagHoldsClient.CreateTagHoldAsync(parent, tagHold);

// Poll until the returned long-running operation is complete
Operation<TagHold, CreateTagHoldMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TagHold 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<TagHold, CreateTagHoldMetadata> retrievedResponse = await tagHoldsClient.PollOnceCreateTagHoldAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TagHold retrievedResult = retrievedResponse.Result;
}

DeleteTagHold(DeleteTagHoldRequest, CallSettings)

public virtual Operation<Empty, DeleteTagHoldMetadata> DeleteTagHold(DeleteTagHoldRequest request, CallSettings callSettings = null)

Deletes a TagHold.

Parameters
NameDescription
requestDeleteTagHoldRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationEmptyDeleteTagHoldMetadata

The RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = TagHoldsClient.Create();
// Initialize request argument(s)
DeleteTagHoldRequest request = new DeleteTagHoldRequest
{
    TagHoldName = TagHoldName.FromTagValueTagHold("[TAG_VALUE]", "[TAG_HOLD]"),
    ValidateOnly = false,
};
// Make the request
Operation<Empty, DeleteTagHoldMetadata> response = tagHoldsClient.DeleteTagHold(request);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteTagHoldMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, DeleteTagHoldMetadata> retrievedResponse = tagHoldsClient.PollOnceDeleteTagHold(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteTagHold(TagHoldName, CallSettings)

public virtual Operation<Empty, DeleteTagHoldMetadata> DeleteTagHold(TagHoldName name, CallSettings callSettings = null)

Deletes a TagHold.

Parameters
NameDescription
nameTagHoldName

Required. The resource name of the TagHold to delete. Must be of the form: tagValues/{tag-value-id}/tagHolds/{tag-hold-id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationEmptyDeleteTagHoldMetadata

The RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = TagHoldsClient.Create();
// Initialize request argument(s)
TagHoldName name = TagHoldName.FromTagValueTagHold("[TAG_VALUE]", "[TAG_HOLD]");
// Make the request
Operation<Empty, DeleteTagHoldMetadata> response = tagHoldsClient.DeleteTagHold(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteTagHoldMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, DeleteTagHoldMetadata> retrievedResponse = tagHoldsClient.PollOnceDeleteTagHold(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteTagHold(string, CallSettings)

public virtual Operation<Empty, DeleteTagHoldMetadata> DeleteTagHold(string name, CallSettings callSettings = null)

Deletes a TagHold.

Parameters
NameDescription
namestring

Required. The resource name of the TagHold to delete. Must be of the form: tagValues/{tag-value-id}/tagHolds/{tag-hold-id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationEmptyDeleteTagHoldMetadata

The RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = TagHoldsClient.Create();
// Initialize request argument(s)
string name = "tagValues/[TAG_VALUE]/tagHolds/[TAG_HOLD]";
// Make the request
Operation<Empty, DeleteTagHoldMetadata> response = tagHoldsClient.DeleteTagHold(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteTagHoldMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, DeleteTagHoldMetadata> retrievedResponse = tagHoldsClient.PollOnceDeleteTagHold(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteTagHoldAsync(DeleteTagHoldRequest, CallSettings)

public virtual Task<Operation<Empty, DeleteTagHoldMetadata>> DeleteTagHoldAsync(DeleteTagHoldRequest request, CallSettings callSettings = null)

Deletes a TagHold.

Parameters
NameDescription
requestDeleteTagHoldRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationEmptyDeleteTagHoldMetadata

A Task containing the RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = await TagHoldsClient.CreateAsync();
// Initialize request argument(s)
DeleteTagHoldRequest request = new DeleteTagHoldRequest
{
    TagHoldName = TagHoldName.FromTagValueTagHold("[TAG_VALUE]", "[TAG_HOLD]"),
    ValidateOnly = false,
};
// Make the request
Operation<Empty, DeleteTagHoldMetadata> response = await tagHoldsClient.DeleteTagHoldAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteTagHoldMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteTagHoldMetadata> retrievedResponse = await tagHoldsClient.PollOnceDeleteTagHoldAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteTagHoldAsync(DeleteTagHoldRequest, CancellationToken)

public virtual Task<Operation<Empty, DeleteTagHoldMetadata>> DeleteTagHoldAsync(DeleteTagHoldRequest request, CancellationToken cancellationToken)

Deletes a TagHold.

Parameters
NameDescription
requestDeleteTagHoldRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationEmptyDeleteTagHoldMetadata

A Task containing the RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = await TagHoldsClient.CreateAsync();
// Initialize request argument(s)
DeleteTagHoldRequest request = new DeleteTagHoldRequest
{
    TagHoldName = TagHoldName.FromTagValueTagHold("[TAG_VALUE]", "[TAG_HOLD]"),
    ValidateOnly = false,
};
// Make the request
Operation<Empty, DeleteTagHoldMetadata> response = await tagHoldsClient.DeleteTagHoldAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteTagHoldMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteTagHoldMetadata> retrievedResponse = await tagHoldsClient.PollOnceDeleteTagHoldAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteTagHoldAsync(TagHoldName, CallSettings)

public virtual Task<Operation<Empty, DeleteTagHoldMetadata>> DeleteTagHoldAsync(TagHoldName name, CallSettings callSettings = null)

Deletes a TagHold.

Parameters
NameDescription
nameTagHoldName

Required. The resource name of the TagHold to delete. Must be of the form: tagValues/{tag-value-id}/tagHolds/{tag-hold-id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationEmptyDeleteTagHoldMetadata

A Task containing the RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = await TagHoldsClient.CreateAsync();
// Initialize request argument(s)
TagHoldName name = TagHoldName.FromTagValueTagHold("[TAG_VALUE]", "[TAG_HOLD]");
// Make the request
Operation<Empty, DeleteTagHoldMetadata> response = await tagHoldsClient.DeleteTagHoldAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteTagHoldMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteTagHoldMetadata> retrievedResponse = await tagHoldsClient.PollOnceDeleteTagHoldAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteTagHoldAsync(TagHoldName, CancellationToken)

public virtual Task<Operation<Empty, DeleteTagHoldMetadata>> DeleteTagHoldAsync(TagHoldName name, CancellationToken cancellationToken)

Deletes a TagHold.

Parameters
NameDescription
nameTagHoldName

Required. The resource name of the TagHold to delete. Must be of the form: tagValues/{tag-value-id}/tagHolds/{tag-hold-id}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationEmptyDeleteTagHoldMetadata

A Task containing the RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = await TagHoldsClient.CreateAsync();
// Initialize request argument(s)
TagHoldName name = TagHoldName.FromTagValueTagHold("[TAG_VALUE]", "[TAG_HOLD]");
// Make the request
Operation<Empty, DeleteTagHoldMetadata> response = await tagHoldsClient.DeleteTagHoldAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteTagHoldMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteTagHoldMetadata> retrievedResponse = await tagHoldsClient.PollOnceDeleteTagHoldAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteTagHoldAsync(string, CallSettings)

public virtual Task<Operation<Empty, DeleteTagHoldMetadata>> DeleteTagHoldAsync(string name, CallSettings callSettings = null)

Deletes a TagHold.

Parameters
NameDescription
namestring

Required. The resource name of the TagHold to delete. Must be of the form: tagValues/{tag-value-id}/tagHolds/{tag-hold-id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationEmptyDeleteTagHoldMetadata

A Task containing the RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = await TagHoldsClient.CreateAsync();
// Initialize request argument(s)
string name = "tagValues/[TAG_VALUE]/tagHolds/[TAG_HOLD]";
// Make the request
Operation<Empty, DeleteTagHoldMetadata> response = await tagHoldsClient.DeleteTagHoldAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteTagHoldMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteTagHoldMetadata> retrievedResponse = await tagHoldsClient.PollOnceDeleteTagHoldAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteTagHoldAsync(string, CancellationToken)

public virtual Task<Operation<Empty, DeleteTagHoldMetadata>> DeleteTagHoldAsync(string name, CancellationToken cancellationToken)

Deletes a TagHold.

Parameters
NameDescription
namestring

Required. The resource name of the TagHold to delete. Must be of the form: tagValues/{tag-value-id}/tagHolds/{tag-hold-id}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationEmptyDeleteTagHoldMetadata

A Task containing the RPC response.

Example
// Create client
TagHoldsClient tagHoldsClient = await TagHoldsClient.CreateAsync();
// Initialize request argument(s)
string name = "tagValues/[TAG_VALUE]/tagHolds/[TAG_HOLD]";
// Make the request
Operation<Empty, DeleteTagHoldMetadata> response = await tagHoldsClient.DeleteTagHoldAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteTagHoldMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteTagHoldMetadata> retrievedResponse = await tagHoldsClient.PollOnceDeleteTagHoldAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

ListTagHolds(ListTagHoldsRequest, CallSettings)

public virtual PagedEnumerable<ListTagHoldsResponse, TagHold> ListTagHolds(ListTagHoldsRequest request, CallSettings callSettings = null)

Lists TagHolds under a TagValue.

Parameters
NameDescription
requestListTagHoldsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListTagHoldsResponseTagHold

A pageable sequence of TagHold resources.

Example
// Create client
TagHoldsClient tagHoldsClient = TagHoldsClient.Create();
// Initialize request argument(s)
ListTagHoldsRequest request = new ListTagHoldsRequest
{
    ParentAsTagValueName = TagValueName.FromTagValue("[TAG_VALUE]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListTagHoldsResponse, TagHold> response = tagHoldsClient.ListTagHolds(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (TagHold 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 (ListTagHoldsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (TagHold 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<TagHold> 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 (TagHold 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;

ListTagHolds(TagValueName, string, int?, CallSettings)

public virtual PagedEnumerable<ListTagHoldsResponse, TagHold> ListTagHolds(TagValueName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists TagHolds under a TagValue.

Parameters
NameDescription
parentTagValueName

Required. The resource name of the parent TagValue. Must be of the form: tagValues/{tag-value-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
PagedEnumerableListTagHoldsResponseTagHold

A pageable sequence of TagHold resources.

Example
// Create client
TagHoldsClient tagHoldsClient = TagHoldsClient.Create();
// Initialize request argument(s)
TagValueName parent = TagValueName.FromTagValue("[TAG_VALUE]");
// Make the request
PagedEnumerable<ListTagHoldsResponse, TagHold> response = tagHoldsClient.ListTagHolds(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (TagHold 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 (ListTagHoldsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (TagHold 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<TagHold> 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 (TagHold 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;

ListTagHolds(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListTagHoldsResponse, TagHold> ListTagHolds(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists TagHolds under a TagValue.

Parameters
NameDescription
parentstring

Required. The resource name of the parent TagValue. Must be of the form: tagValues/{tag-value-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
PagedEnumerableListTagHoldsResponseTagHold

A pageable sequence of TagHold resources.

Example
// Create client
TagHoldsClient tagHoldsClient = TagHoldsClient.Create();
// Initialize request argument(s)
string parent = "tagValues/[TAG_VALUE]";
// Make the request
PagedEnumerable<ListTagHoldsResponse, TagHold> response = tagHoldsClient.ListTagHolds(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (TagHold 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 (ListTagHoldsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (TagHold 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<TagHold> 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 (TagHold 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;

ListTagHoldsAsync(ListTagHoldsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListTagHoldsResponse, TagHold> ListTagHoldsAsync(ListTagHoldsRequest request, CallSettings callSettings = null)

Lists TagHolds under a TagValue.

Parameters
NameDescription
requestListTagHoldsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListTagHoldsResponseTagHold

A pageable asynchronous sequence of TagHold resources.

Example
// Create client
TagHoldsClient tagHoldsClient = await TagHoldsClient.CreateAsync();
// Initialize request argument(s)
ListTagHoldsRequest request = new ListTagHoldsRequest
{
    ParentAsTagValueName = TagValueName.FromTagValue("[TAG_VALUE]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListTagHoldsResponse, TagHold> response = tagHoldsClient.ListTagHoldsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((TagHold item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListTagHoldsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (TagHold 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<TagHold> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (TagHold 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;

ListTagHoldsAsync(TagValueName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListTagHoldsResponse, TagHold> ListTagHoldsAsync(TagValueName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists TagHolds under a TagValue.

Parameters
NameDescription
parentTagValueName

Required. The resource name of the parent TagValue. Must be of the form: tagValues/{tag-value-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
PagedAsyncEnumerableListTagHoldsResponseTagHold

A pageable asynchronous sequence of TagHold resources.

Example
// Create client
TagHoldsClient tagHoldsClient = await TagHoldsClient.CreateAsync();
// Initialize request argument(s)
TagValueName parent = TagValueName.FromTagValue("[TAG_VALUE]");
// Make the request
PagedAsyncEnumerable<ListTagHoldsResponse, TagHold> response = tagHoldsClient.ListTagHoldsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((TagHold item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListTagHoldsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (TagHold 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<TagHold> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (TagHold 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;

ListTagHoldsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListTagHoldsResponse, TagHold> ListTagHoldsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists TagHolds under a TagValue.

Parameters
NameDescription
parentstring

Required. The resource name of the parent TagValue. Must be of the form: tagValues/{tag-value-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
PagedAsyncEnumerableListTagHoldsResponseTagHold

A pageable asynchronous sequence of TagHold resources.

Example
// Create client
TagHoldsClient tagHoldsClient = await TagHoldsClient.CreateAsync();
// Initialize request argument(s)
string parent = "tagValues/[TAG_VALUE]";
// Make the request
PagedAsyncEnumerable<ListTagHoldsResponse, TagHold> response = tagHoldsClient.ListTagHoldsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((TagHold item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListTagHoldsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (TagHold 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<TagHold> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (TagHold 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;

PollOnceCreateTagHold(string, CallSettings)

public virtual Operation<TagHold, CreateTagHoldMetadata> PollOnceCreateTagHold(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of CreateTagHold.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationTagHoldCreateTagHoldMetadata

The result of polling the operation.

PollOnceCreateTagHoldAsync(string, CallSettings)

public virtual Task<Operation<TagHold, CreateTagHoldMetadata>> PollOnceCreateTagHoldAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of CreateTagHold.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationTagHoldCreateTagHoldMetadata

A task representing the result of polling the operation.

PollOnceDeleteTagHold(string, CallSettings)

public virtual Operation<Empty, DeleteTagHoldMetadata> PollOnceDeleteTagHold(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of DeleteTagHold.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationEmptyDeleteTagHoldMetadata

The result of polling the operation.

PollOnceDeleteTagHoldAsync(string, CallSettings)

public virtual Task<Operation<Empty, DeleteTagHoldMetadata>> PollOnceDeleteTagHoldAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of DeleteTagHold.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationEmptyDeleteTagHoldMetadata

A task representing the result of polling the operation.

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.