Compute Engine v1 API - Class SnapshotsClient (3.1.0)

public abstract class SnapshotsClient

Reference documentation and code samples for the Compute Engine v1 API class SnapshotsClient.

Snapshots client wrapper, for convenient use.

Inheritance

object > SnapshotsClient

Derived Types

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Remarks

The Snapshots API.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Snapshots scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

DeleteOperationsClient

public virtual OperationsClient DeleteOperationsClient { get; }

The long-running operations client for Delete.

Property Value
Type Description
OperationsClient

GrpcClient

public virtual Snapshots.SnapshotsClient GrpcClient { get; }

The underlying gRPC Snapshots client

Property Value
Type Description
SnapshotsSnapshotsClient

InsertOperationsClient

public virtual OperationsClient InsertOperationsClient { get; }

The long-running operations client for Insert.

Property Value
Type Description
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

SetLabelsOperationsClient

public virtual OperationsClient SetLabelsOperationsClient { get; }

The long-running operations client for SetLabels.

Property Value
Type Description
OperationsClient

Methods

Create()

public static SnapshotsClient Create()

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

Returns
Type Description
SnapshotsClient

The created SnapshotsClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskSnapshotsClient

The task representing the created SnapshotsClient.

Delete(DeleteSnapshotRequest, CallSettings)

public virtual Operation<Operation, Operation> Delete(DeleteSnapshotRequest request, CallSettings callSettings = null)

Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. For more information, see Deleting snapshots.

Parameters
Name Description
request DeleteSnapshotRequest

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
OperationOperationOperation

The RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = SnapshotsClient.Create();
// Initialize request argument(s)
DeleteSnapshotRequest request = new DeleteSnapshotRequest
{
    RequestId = "",
    Project = "",
    Snapshot = "",
};
// Make the request
lro::Operation<Operation, Operation> response = snapshotsClient.Delete(request);

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

Delete(string, string, CallSettings)

public virtual Operation<Operation, Operation> Delete(string project, string snapshot, CallSettings callSettings = null)

Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. For more information, see Deleting snapshots.

Parameters
Name Description
project string

Project ID for this request.

snapshot string

Name of the Snapshot resource to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = SnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
string snapshot = "";
// Make the request
lro::Operation<Operation, Operation> response = snapshotsClient.Delete(project, snapshot);

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

DeleteAsync(DeleteSnapshotRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> DeleteAsync(DeleteSnapshotRequest request, CallSettings callSettings = null)

Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. For more information, see Deleting snapshots.

Parameters
Name Description
request DeleteSnapshotRequest

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
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
DeleteSnapshotRequest request = new DeleteSnapshotRequest
{
    RequestId = "",
    Project = "",
    Snapshot = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await snapshotsClient.DeleteAsync(request);

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

DeleteAsync(DeleteSnapshotRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> DeleteAsync(DeleteSnapshotRequest request, CancellationToken cancellationToken)

Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. For more information, see Deleting snapshots.

Parameters
Name Description
request DeleteSnapshotRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
DeleteSnapshotRequest request = new DeleteSnapshotRequest
{
    RequestId = "",
    Project = "",
    Snapshot = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await snapshotsClient.DeleteAsync(request);

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

DeleteAsync(string, string, CallSettings)

public virtual Task<Operation<Operation, Operation>> DeleteAsync(string project, string snapshot, CallSettings callSettings = null)

Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. For more information, see Deleting snapshots.

Parameters
Name Description
project string

Project ID for this request.

snapshot string

Name of the Snapshot resource to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string snapshot = "";
// Make the request
lro::Operation<Operation, Operation> response = await snapshotsClient.DeleteAsync(project, snapshot);

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

DeleteAsync(string, string, CancellationToken)

public virtual Task<Operation<Operation, Operation>> DeleteAsync(string project, string snapshot, CancellationToken cancellationToken)

Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. For more information, see Deleting snapshots.

Parameters
Name Description
project string

Project ID for this request.

snapshot string

Name of the Snapshot resource to delete.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string snapshot = "";
// Make the request
lro::Operation<Operation, Operation> response = await snapshotsClient.DeleteAsync(project, snapshot);

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

Get(GetSnapshotRequest, CallSettings)

public virtual Snapshot Get(GetSnapshotRequest request, CallSettings callSettings = null)

Returns the specified Snapshot resource.

Parameters
Name Description
request GetSnapshotRequest

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
Snapshot

The RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = SnapshotsClient.Create();
// Initialize request argument(s)
GetSnapshotRequest request = new GetSnapshotRequest
{
    Project = "",
    Snapshot = "",
};
// Make the request
Snapshot response = snapshotsClient.Get(request);

Get(string, string, CallSettings)

public virtual Snapshot Get(string project, string snapshot, CallSettings callSettings = null)

Returns the specified Snapshot resource.

Parameters
Name Description
project string

Project ID for this request.

snapshot string

Name of the Snapshot resource to return.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Snapshot

The RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = SnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
string snapshot = "";
// Make the request
Snapshot response = snapshotsClient.Get(project, snapshot);

GetAsync(GetSnapshotRequest, CallSettings)

public virtual Task<Snapshot> GetAsync(GetSnapshotRequest request, CallSettings callSettings = null)

Returns the specified Snapshot resource.

Parameters
Name Description
request GetSnapshotRequest

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
TaskSnapshot

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
GetSnapshotRequest request = new GetSnapshotRequest
{
    Project = "",
    Snapshot = "",
};
// Make the request
Snapshot response = await snapshotsClient.GetAsync(request);

GetAsync(GetSnapshotRequest, CancellationToken)

public virtual Task<Snapshot> GetAsync(GetSnapshotRequest request, CancellationToken cancellationToken)

Returns the specified Snapshot resource.

Parameters
Name Description
request GetSnapshotRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSnapshot

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
GetSnapshotRequest request = new GetSnapshotRequest
{
    Project = "",
    Snapshot = "",
};
// Make the request
Snapshot response = await snapshotsClient.GetAsync(request);

GetAsync(string, string, CallSettings)

public virtual Task<Snapshot> GetAsync(string project, string snapshot, CallSettings callSettings = null)

Returns the specified Snapshot resource.

Parameters
Name Description
project string

Project ID for this request.

snapshot string

Name of the Snapshot resource to return.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSnapshot

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string snapshot = "";
// Make the request
Snapshot response = await snapshotsClient.GetAsync(project, snapshot);

GetAsync(string, string, CancellationToken)

public virtual Task<Snapshot> GetAsync(string project, string snapshot, CancellationToken cancellationToken)

Returns the specified Snapshot resource.

Parameters
Name Description
project string

Project ID for this request.

snapshot string

Name of the Snapshot resource to return.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSnapshot

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string snapshot = "";
// Make the request
Snapshot response = await snapshotsClient.GetAsync(project, snapshot);

GetIamPolicy(GetIamPolicySnapshotRequest, CallSettings)

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

Gets the access control policy for a resource. May be empty if no such policy or resource exists.

Parameters
Name Description
request GetIamPolicySnapshotRequest

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.

Example
// Create client
SnapshotsClient snapshotsClient = SnapshotsClient.Create();
// Initialize request argument(s)
GetIamPolicySnapshotRequest request = new GetIamPolicySnapshotRequest
{
    Resource = "",
    Project = "",
    OptionsRequestedPolicyVersion = 0,
};
// Make the request
Policy response = snapshotsClient.GetIamPolicy(request);

GetIamPolicy(string, string, CallSettings)

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

Gets the access control policy for a resource. May be empty if no such policy or resource exists.

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Policy

The RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = SnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
string resource = "";
// Make the request
Policy response = snapshotsClient.GetIamPolicy(project, resource);

GetIamPolicyAsync(GetIamPolicySnapshotRequest, CallSettings)

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

Gets the access control policy for a resource. May be empty if no such policy or resource exists.

Parameters
Name Description
request GetIamPolicySnapshotRequest

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.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicySnapshotRequest request = new GetIamPolicySnapshotRequest
{
    Resource = "",
    Project = "",
    OptionsRequestedPolicyVersion = 0,
};
// Make the request
Policy response = await snapshotsClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(GetIamPolicySnapshotRequest, CancellationToken)

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

Gets the access control policy for a resource. May be empty if no such policy or resource exists.

Parameters
Name Description
request GetIamPolicySnapshotRequest

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.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicySnapshotRequest request = new GetIamPolicySnapshotRequest
{
    Resource = "",
    Project = "",
    OptionsRequestedPolicyVersion = 0,
};
// Make the request
Policy response = await snapshotsClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(string, string, CallSettings)

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

Gets the access control policy for a resource. May be empty if no such policy or resource exists.

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string resource = "";
// Make the request
Policy response = await snapshotsClient.GetIamPolicyAsync(project, resource);

GetIamPolicyAsync(string, string, CancellationToken)

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

Gets the access control policy for a resource. May be empty if no such policy or resource exists.

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string resource = "";
// Make the request
Policy response = await snapshotsClient.GetIamPolicyAsync(project, resource);

Insert(InsertSnapshotRequest, CallSettings)

public virtual Operation<Operation, Operation> Insert(InsertSnapshotRequest request, CallSettings callSettings = null)

Creates a snapshot in the specified project using the data included in the request. For regular snapshot creation, consider using this method instead of disks.createSnapshot, as this method supports more features, such as creating snapshots in a project different from the source disk project.

Parameters
Name Description
request InsertSnapshotRequest

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
OperationOperationOperation

The RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = SnapshotsClient.Create();
// Initialize request argument(s)
InsertSnapshotRequest request = new InsertSnapshotRequest
{
    RequestId = "",
    Project = "",
    SnapshotResource = new Snapshot(),
};
// Make the request
lro::Operation<Operation, Operation> response = snapshotsClient.Insert(request);

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

Insert(string, Snapshot, CallSettings)

public virtual Operation<Operation, Operation> Insert(string project, Snapshot snapshotResource, CallSettings callSettings = null)

Creates a snapshot in the specified project using the data included in the request. For regular snapshot creation, consider using this method instead of disks.createSnapshot, as this method supports more features, such as creating snapshots in a project different from the source disk project.

Parameters
Name Description
project string

Project ID for this request.

snapshotResource Snapshot

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = SnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
Snapshot snapshotResource = new Snapshot();
// Make the request
lro::Operation<Operation, Operation> response = snapshotsClient.Insert(project, snapshotResource);

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

InsertAsync(InsertSnapshotRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> InsertAsync(InsertSnapshotRequest request, CallSettings callSettings = null)

Creates a snapshot in the specified project using the data included in the request. For regular snapshot creation, consider using this method instead of disks.createSnapshot, as this method supports more features, such as creating snapshots in a project different from the source disk project.

Parameters
Name Description
request InsertSnapshotRequest

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
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
InsertSnapshotRequest request = new InsertSnapshotRequest
{
    RequestId = "",
    Project = "",
    SnapshotResource = new Snapshot(),
};
// Make the request
lro::Operation<Operation, Operation> response = await snapshotsClient.InsertAsync(request);

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

InsertAsync(InsertSnapshotRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> InsertAsync(InsertSnapshotRequest request, CancellationToken cancellationToken)

Creates a snapshot in the specified project using the data included in the request. For regular snapshot creation, consider using this method instead of disks.createSnapshot, as this method supports more features, such as creating snapshots in a project different from the source disk project.

Parameters
Name Description
request InsertSnapshotRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
InsertSnapshotRequest request = new InsertSnapshotRequest
{
    RequestId = "",
    Project = "",
    SnapshotResource = new Snapshot(),
};
// Make the request
lro::Operation<Operation, Operation> response = await snapshotsClient.InsertAsync(request);

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

InsertAsync(string, Snapshot, CallSettings)

public virtual Task<Operation<Operation, Operation>> InsertAsync(string project, Snapshot snapshotResource, CallSettings callSettings = null)

Creates a snapshot in the specified project using the data included in the request. For regular snapshot creation, consider using this method instead of disks.createSnapshot, as this method supports more features, such as creating snapshots in a project different from the source disk project.

Parameters
Name Description
project string

Project ID for this request.

snapshotResource Snapshot

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
Snapshot snapshotResource = new Snapshot();
// Make the request
lro::Operation<Operation, Operation> response = await snapshotsClient.InsertAsync(project, snapshotResource);

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

InsertAsync(string, Snapshot, CancellationToken)

public virtual Task<Operation<Operation, Operation>> InsertAsync(string project, Snapshot snapshotResource, CancellationToken cancellationToken)

Creates a snapshot in the specified project using the data included in the request. For regular snapshot creation, consider using this method instead of disks.createSnapshot, as this method supports more features, such as creating snapshots in a project different from the source disk project.

Parameters
Name Description
project string

Project ID for this request.

snapshotResource Snapshot

The body resource for this request

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
Snapshot snapshotResource = new Snapshot();
// Make the request
lro::Operation<Operation, Operation> response = await snapshotsClient.InsertAsync(project, snapshotResource);

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

List(ListSnapshotsRequest, CallSettings)

public virtual PagedEnumerable<SnapshotList, Snapshot> List(ListSnapshotsRequest request, CallSettings callSettings = null)

Retrieves the list of Snapshot resources contained within the specified project.

Parameters
Name Description
request ListSnapshotsRequest

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
PagedEnumerableSnapshotListSnapshot

A pageable sequence of Snapshot resources.

Example
// Create client
SnapshotsClient snapshotsClient = SnapshotsClient.Create();
// Initialize request argument(s)
ListSnapshotsRequest request = new ListSnapshotsRequest
{
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedEnumerable<SnapshotList, Snapshot> response = snapshotsClient.List(request);

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

List(string, string, int?, CallSettings)

public virtual PagedEnumerable<SnapshotList, Snapshot> List(string project, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves the list of Snapshot resources contained within the specified project.

Parameters
Name Description
project string

Project ID for this request.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableSnapshotListSnapshot

A pageable sequence of Snapshot resources.

Example
// Create client
SnapshotsClient snapshotsClient = SnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
// Make the request
PagedEnumerable<SnapshotList, Snapshot> response = snapshotsClient.List(project);

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

ListAsync(ListSnapshotsRequest, CallSettings)

public virtual PagedAsyncEnumerable<SnapshotList, Snapshot> ListAsync(ListSnapshotsRequest request, CallSettings callSettings = null)

Retrieves the list of Snapshot resources contained within the specified project.

Parameters
Name Description
request ListSnapshotsRequest

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
PagedAsyncEnumerableSnapshotListSnapshot

A pageable asynchronous sequence of Snapshot resources.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
ListSnapshotsRequest request = new ListSnapshotsRequest
{
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedAsyncEnumerable<SnapshotList, Snapshot> response = snapshotsClient.ListAsync(request);

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

ListAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<SnapshotList, Snapshot> ListAsync(string project, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves the list of Snapshot resources contained within the specified project.

Parameters
Name Description
project string

Project ID for this request.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableSnapshotListSnapshot

A pageable asynchronous sequence of Snapshot resources.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
// Make the request
PagedAsyncEnumerable<SnapshotList, Snapshot> response = snapshotsClient.ListAsync(project);

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

PollOnceDelete(string, CallSettings)

public virtual Operation<Operation, Operation> PollOnceDelete(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The result of polling the operation.

PollOnceDeleteAsync(string, CallSettings)

public virtual Task<Operation<Operation, Operation>> PollOnceDeleteAsync(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A task representing the result of polling the operation.

PollOnceInsert(string, CallSettings)

public virtual Operation<Operation, Operation> PollOnceInsert(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The result of polling the operation.

PollOnceInsertAsync(string, CallSettings)

public virtual Task<Operation<Operation, Operation>> PollOnceInsertAsync(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A task representing the result of polling the operation.

PollOnceSetLabels(string, CallSettings)

public virtual Operation<Operation, Operation> PollOnceSetLabels(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The result of polling the operation.

PollOnceSetLabelsAsync(string, CallSettings)

public virtual Task<Operation<Operation, Operation>> PollOnceSetLabelsAsync(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A task representing the result of polling the operation.

SetIamPolicy(SetIamPolicySnapshotRequest, CallSettings)

public virtual Policy SetIamPolicy(SetIamPolicySnapshotRequest request, CallSettings callSettings = null)

Sets the access control policy on the specified resource. Replaces any existing policy.

Parameters
Name Description
request SetIamPolicySnapshotRequest

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.

Example
// Create client
SnapshotsClient snapshotsClient = SnapshotsClient.Create();
// Initialize request argument(s)
SetIamPolicySnapshotRequest request = new SetIamPolicySnapshotRequest
{
    Resource = "",
    Project = "",
    GlobalSetPolicyRequestResource = new GlobalSetPolicyRequest(),
};
// Make the request
Policy response = snapshotsClient.SetIamPolicy(request);

SetIamPolicy(string, string, GlobalSetPolicyRequest, CallSettings)

public virtual Policy SetIamPolicy(string project, string resource, GlobalSetPolicyRequest globalSetPolicyRequestResource, CallSettings callSettings = null)

Sets the access control policy on the specified resource. Replaces any existing policy.

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

globalSetPolicyRequestResource GlobalSetPolicyRequest

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Policy

The RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = SnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
string resource = "";
GlobalSetPolicyRequest globalSetPolicyRequestResource = new GlobalSetPolicyRequest();
// Make the request
Policy response = snapshotsClient.SetIamPolicy(project, resource, globalSetPolicyRequestResource);

SetIamPolicyAsync(SetIamPolicySnapshotRequest, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicySnapshotRequest request, CallSettings callSettings = null)

Sets the access control policy on the specified resource. Replaces any existing policy.

Parameters
Name Description
request SetIamPolicySnapshotRequest

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.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicySnapshotRequest request = new SetIamPolicySnapshotRequest
{
    Resource = "",
    Project = "",
    GlobalSetPolicyRequestResource = new GlobalSetPolicyRequest(),
};
// Make the request
Policy response = await snapshotsClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(SetIamPolicySnapshotRequest, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicySnapshotRequest request, CancellationToken cancellationToken)

Sets the access control policy on the specified resource. Replaces any existing policy.

Parameters
Name Description
request SetIamPolicySnapshotRequest

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.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicySnapshotRequest request = new SetIamPolicySnapshotRequest
{
    Resource = "",
    Project = "",
    GlobalSetPolicyRequestResource = new GlobalSetPolicyRequest(),
};
// Make the request
Policy response = await snapshotsClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(string, string, GlobalSetPolicyRequest, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(string project, string resource, GlobalSetPolicyRequest globalSetPolicyRequestResource, CallSettings callSettings = null)

Sets the access control policy on the specified resource. Replaces any existing policy.

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

globalSetPolicyRequestResource GlobalSetPolicyRequest

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string resource = "";
GlobalSetPolicyRequest globalSetPolicyRequestResource = new GlobalSetPolicyRequest();
// Make the request
Policy response = await snapshotsClient.SetIamPolicyAsync(project, resource, globalSetPolicyRequestResource);

SetIamPolicyAsync(string, string, GlobalSetPolicyRequest, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(string project, string resource, GlobalSetPolicyRequest globalSetPolicyRequestResource, CancellationToken cancellationToken)

Sets the access control policy on the specified resource. Replaces any existing policy.

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

globalSetPolicyRequestResource GlobalSetPolicyRequest

The body resource for this request

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string resource = "";
GlobalSetPolicyRequest globalSetPolicyRequestResource = new GlobalSetPolicyRequest();
// Make the request
Policy response = await snapshotsClient.SetIamPolicyAsync(project, resource, globalSetPolicyRequestResource);

SetLabels(SetLabelsSnapshotRequest, CallSettings)

public virtual Operation<Operation, Operation> SetLabels(SetLabelsSnapshotRequest request, CallSettings callSettings = null)

Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.

Parameters
Name Description
request SetLabelsSnapshotRequest

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
OperationOperationOperation

The RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = SnapshotsClient.Create();
// Initialize request argument(s)
SetLabelsSnapshotRequest request = new SetLabelsSnapshotRequest
{
    Resource = "",
    Project = "",
    GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(),
};
// Make the request
lro::Operation<Operation, Operation> response = snapshotsClient.SetLabels(request);

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

SetLabels(string, string, GlobalSetLabelsRequest, CallSettings)

public virtual Operation<Operation, Operation> SetLabels(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, CallSettings callSettings = null)

Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

globalSetLabelsRequestResource GlobalSetLabelsRequest

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = SnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
string resource = "";
GlobalSetLabelsRequest globalSetLabelsRequestResource = new GlobalSetLabelsRequest();
// Make the request
lro::Operation<Operation, Operation> response = snapshotsClient.SetLabels(project, resource, globalSetLabelsRequestResource);

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

SetLabelsAsync(SetLabelsSnapshotRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> SetLabelsAsync(SetLabelsSnapshotRequest request, CallSettings callSettings = null)

Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.

Parameters
Name Description
request SetLabelsSnapshotRequest

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
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
SetLabelsSnapshotRequest request = new SetLabelsSnapshotRequest
{
    Resource = "",
    Project = "",
    GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(),
};
// Make the request
lro::Operation<Operation, Operation> response = await snapshotsClient.SetLabelsAsync(request);

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

SetLabelsAsync(SetLabelsSnapshotRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> SetLabelsAsync(SetLabelsSnapshotRequest request, CancellationToken cancellationToken)

Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.

Parameters
Name Description
request SetLabelsSnapshotRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
SetLabelsSnapshotRequest request = new SetLabelsSnapshotRequest
{
    Resource = "",
    Project = "",
    GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(),
};
// Make the request
lro::Operation<Operation, Operation> response = await snapshotsClient.SetLabelsAsync(request);

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

SetLabelsAsync(string, string, GlobalSetLabelsRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, CallSettings callSettings = null)

Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

globalSetLabelsRequestResource GlobalSetLabelsRequest

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string resource = "";
GlobalSetLabelsRequest globalSetLabelsRequestResource = new GlobalSetLabelsRequest();
// Make the request
lro::Operation<Operation, Operation> response = await snapshotsClient.SetLabelsAsync(project, resource, globalSetLabelsRequestResource);

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

SetLabelsAsync(string, string, GlobalSetLabelsRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, CancellationToken cancellationToken)

Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

globalSetLabelsRequestResource GlobalSetLabelsRequest

The body resource for this request

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string resource = "";
GlobalSetLabelsRequest globalSetLabelsRequestResource = new GlobalSetLabelsRequest();
// Make the request
lro::Operation<Operation, Operation> response = await snapshotsClient.SetLabelsAsync(project, resource, globalSetLabelsRequestResource);

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

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
Type Description
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.

TestIamPermissions(TestIamPermissionsSnapshotRequest, CallSettings)

public virtual TestPermissionsResponse TestIamPermissions(TestIamPermissionsSnapshotRequest request, CallSettings callSettings = null)

Returns permissions that a caller has on the specified resource.

Parameters
Name Description
request TestIamPermissionsSnapshotRequest

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
TestPermissionsResponse

The RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = SnapshotsClient.Create();
// Initialize request argument(s)
TestIamPermissionsSnapshotRequest request = new TestIamPermissionsSnapshotRequest
{
    Resource = "",
    Project = "",
    TestPermissionsRequestResource = new TestPermissionsRequest(),
};
// Make the request
TestPermissionsResponse response = snapshotsClient.TestIamPermissions(request);

TestIamPermissions(string, string, TestPermissionsRequest, CallSettings)

public virtual TestPermissionsResponse TestIamPermissions(string project, string resource, TestPermissionsRequest testPermissionsRequestResource, CallSettings callSettings = null)

Returns permissions that a caller has on the specified resource.

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

testPermissionsRequestResource TestPermissionsRequest

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TestPermissionsResponse

The RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = SnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
string resource = "";
TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
// Make the request
TestPermissionsResponse response = snapshotsClient.TestIamPermissions(project, resource, testPermissionsRequestResource);

TestIamPermissionsAsync(TestIamPermissionsSnapshotRequest, CallSettings)

public virtual Task<TestPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsSnapshotRequest request, CallSettings callSettings = null)

Returns permissions that a caller has on the specified resource.

Parameters
Name Description
request TestIamPermissionsSnapshotRequest

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
TaskTestPermissionsResponse

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsSnapshotRequest request = new TestIamPermissionsSnapshotRequest
{
    Resource = "",
    Project = "",
    TestPermissionsRequestResource = new TestPermissionsRequest(),
};
// Make the request
TestPermissionsResponse response = await snapshotsClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(TestIamPermissionsSnapshotRequest, CancellationToken)

public virtual Task<TestPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsSnapshotRequest request, CancellationToken cancellationToken)

Returns permissions that a caller has on the specified resource.

Parameters
Name Description
request TestIamPermissionsSnapshotRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTestPermissionsResponse

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsSnapshotRequest request = new TestIamPermissionsSnapshotRequest
{
    Resource = "",
    Project = "",
    TestPermissionsRequestResource = new TestPermissionsRequest(),
};
// Make the request
TestPermissionsResponse response = await snapshotsClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(string, string, TestPermissionsRequest, CallSettings)

public virtual Task<TestPermissionsResponse> TestIamPermissionsAsync(string project, string resource, TestPermissionsRequest testPermissionsRequestResource, CallSettings callSettings = null)

Returns permissions that a caller has on the specified resource.

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

testPermissionsRequestResource TestPermissionsRequest

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTestPermissionsResponse

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string resource = "";
TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
// Make the request
TestPermissionsResponse response = await snapshotsClient.TestIamPermissionsAsync(project, resource, testPermissionsRequestResource);

TestIamPermissionsAsync(string, string, TestPermissionsRequest, CancellationToken)

public virtual Task<TestPermissionsResponse> TestIamPermissionsAsync(string project, string resource, TestPermissionsRequest testPermissionsRequestResource, CancellationToken cancellationToken)

Returns permissions that a caller has on the specified resource.

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

testPermissionsRequestResource TestPermissionsRequest

The body resource for this request

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTestPermissionsResponse

A Task containing the RPC response.

Example
// Create client
SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string resource = "";
TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
// Make the request
TestPermissionsResponse response = await snapshotsClient.TestIamPermissionsAsync(project, resource, testPermissionsRequestResource);