Compute Engine v1 API - Class InstantSnapshotsClient (3.2.0)

public abstract class InstantSnapshotsClient

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

InstantSnapshots client wrapper, for convenient use.

Inheritance

object > InstantSnapshotsClient

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Remarks

The InstantSnapshots API.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the InstantSnapshots 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 InstantSnapshots 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 InstantSnapshots.InstantSnapshotsClient GrpcClient { get; }

The underlying gRPC InstantSnapshots client

Property Value
Type Description
InstantSnapshotsInstantSnapshotsClient

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

AggregatedList(AggregatedListInstantSnapshotsRequest, CallSettings)

public virtual PagedEnumerable<InstantSnapshotAggregatedList, KeyValuePair<string, InstantSnapshotsScopedList>> AggregatedList(AggregatedListInstantSnapshotsRequest request, CallSettings callSettings = null)

Retrieves an aggregated list of instantSnapshots. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

Parameters
Name Description
request AggregatedListInstantSnapshotsRequest

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
PagedEnumerableInstantSnapshotAggregatedListKeyValuePairstringInstantSnapshotsScopedList

A pageable sequence of KeyValuePair<TKey, TValue> resources.

Example
// Create client
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
AggregatedListInstantSnapshotsRequest request = new AggregatedListInstantSnapshotsRequest
{
    OrderBy = "",
    Project = "",
    ServiceProjectNumber = 0L,
    Filter = "",
    IncludeAllScopes = false,
    ReturnPartialSuccess = false,
};
// Make the request
PagedEnumerable<InstantSnapshotAggregatedList, KeyValuePair<string, InstantSnapshotsScopedList>> response = instantSnapshotsClient.AggregatedList(request);

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

AggregatedList(string, string, int?, CallSettings)

public virtual PagedEnumerable<InstantSnapshotAggregatedList, KeyValuePair<string, InstantSnapshotsScopedList>> AggregatedList(string project, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves an aggregated list of instantSnapshots. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

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
PagedEnumerableInstantSnapshotAggregatedListKeyValuePairstringInstantSnapshotsScopedList

A pageable sequence of KeyValuePair<TKey, TValue> resources.

Example
// Create client
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
// Make the request
PagedEnumerable<InstantSnapshotAggregatedList, KeyValuePair<string, InstantSnapshotsScopedList>> response = instantSnapshotsClient.AggregatedList(project);

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

AggregatedListAsync(AggregatedListInstantSnapshotsRequest, CallSettings)

public virtual PagedAsyncEnumerable<InstantSnapshotAggregatedList, KeyValuePair<string, InstantSnapshotsScopedList>> AggregatedListAsync(AggregatedListInstantSnapshotsRequest request, CallSettings callSettings = null)

Retrieves an aggregated list of instantSnapshots. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

Parameters
Name Description
request AggregatedListInstantSnapshotsRequest

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
PagedAsyncEnumerableInstantSnapshotAggregatedListKeyValuePairstringInstantSnapshotsScopedList

A pageable asynchronous sequence of KeyValuePair<TKey, TValue> resources.

Example
// Create client
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
AggregatedListInstantSnapshotsRequest request = new AggregatedListInstantSnapshotsRequest
{
    OrderBy = "",
    Project = "",
    ServiceProjectNumber = 0L,
    Filter = "",
    IncludeAllScopes = false,
    ReturnPartialSuccess = false,
};
// Make the request
PagedAsyncEnumerable<InstantSnapshotAggregatedList, KeyValuePair<string, InstantSnapshotsScopedList>> response = instantSnapshotsClient.AggregatedListAsync(request);

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

AggregatedListAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<InstantSnapshotAggregatedList, KeyValuePair<string, InstantSnapshotsScopedList>> AggregatedListAsync(string project, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves an aggregated list of instantSnapshots. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

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
PagedAsyncEnumerableInstantSnapshotAggregatedListKeyValuePairstringInstantSnapshotsScopedList

A pageable asynchronous sequence of KeyValuePair<TKey, TValue> resources.

Example
// Create client
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
// Make the request
PagedAsyncEnumerable<InstantSnapshotAggregatedList, KeyValuePair<string, InstantSnapshotsScopedList>> response = instantSnapshotsClient.AggregatedListAsync(project);

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

Create()

public static InstantSnapshotsClient Create()

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

Returns
Type Description
InstantSnapshotsClient

The created InstantSnapshotsClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskInstantSnapshotsClient

The task representing the created InstantSnapshotsClient.

Delete(DeleteInstantSnapshotRequest, CallSettings)

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

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

Parameters
Name Description
request DeleteInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
DeleteInstantSnapshotRequest request = new DeleteInstantSnapshotRequest
{
    Zone = "",
    RequestId = "",
    Project = "",
    InstantSnapshot = "",
};
// Make the request
lro::Operation<Operation, Operation> response = instantSnapshotsClient.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 = instantSnapshotsClient.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, string, CallSettings)

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

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

Parameters
Name Description
project string

Project ID for this request.

zone string

The name of the zone for this request.

instantSnapshot string

Name of the InstantSnapshot resource to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
string zone = "";
string instantSnapshot = "";
// Make the request
lro::Operation<Operation, Operation> response = instantSnapshotsClient.Delete(project, zone, instantSnapshot);

// 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 = instantSnapshotsClient.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(DeleteInstantSnapshotRequest, CallSettings)

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

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

Parameters
Name Description
request DeleteInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
DeleteInstantSnapshotRequest request = new DeleteInstantSnapshotRequest
{
    Zone = "",
    RequestId = "",
    Project = "",
    InstantSnapshot = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await instantSnapshotsClient.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 instantSnapshotsClient.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(DeleteInstantSnapshotRequest, CancellationToken)

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

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

Parameters
Name Description
request DeleteInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
DeleteInstantSnapshotRequest request = new DeleteInstantSnapshotRequest
{
    Zone = "",
    RequestId = "",
    Project = "",
    InstantSnapshot = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await instantSnapshotsClient.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 instantSnapshotsClient.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, string, CallSettings)

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

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

Parameters
Name Description
project string

Project ID for this request.

zone string

The name of the zone for this request.

instantSnapshot string

Name of the InstantSnapshot 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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string instantSnapshot = "";
// Make the request
lro::Operation<Operation, Operation> response = await instantSnapshotsClient.DeleteAsync(project, zone, instantSnapshot);

// 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 instantSnapshotsClient.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, string, CancellationToken)

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

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

Parameters
Name Description
project string

Project ID for this request.

zone string

The name of the zone for this request.

instantSnapshot string

Name of the InstantSnapshot 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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string instantSnapshot = "";
// Make the request
lro::Operation<Operation, Operation> response = await instantSnapshotsClient.DeleteAsync(project, zone, instantSnapshot);

// 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 instantSnapshotsClient.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(GetInstantSnapshotRequest, CallSettings)

public virtual InstantSnapshot Get(GetInstantSnapshotRequest request, CallSettings callSettings = null)

Returns the specified InstantSnapshot resource in the specified zone.

Parameters
Name Description
request GetInstantSnapshotRequest

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
InstantSnapshot

The RPC response.

Example
// Create client
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
GetInstantSnapshotRequest request = new GetInstantSnapshotRequest
{
    Zone = "",
    Project = "",
    InstantSnapshot = "",
};
// Make the request
InstantSnapshot response = instantSnapshotsClient.Get(request);

Get(string, string, string, CallSettings)

public virtual InstantSnapshot Get(string project, string zone, string instantSnapshot, CallSettings callSettings = null)

Returns the specified InstantSnapshot resource in the specified zone.

Parameters
Name Description
project string

Project ID for this request.

zone string

The name of the zone for this request.

instantSnapshot string

Name of the InstantSnapshot resource to return.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
InstantSnapshot

The RPC response.

Example
// Create client
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
string zone = "";
string instantSnapshot = "";
// Make the request
InstantSnapshot response = instantSnapshotsClient.Get(project, zone, instantSnapshot);

GetAsync(GetInstantSnapshotRequest, CallSettings)

public virtual Task<InstantSnapshot> GetAsync(GetInstantSnapshotRequest request, CallSettings callSettings = null)

Returns the specified InstantSnapshot resource in the specified zone.

Parameters
Name Description
request GetInstantSnapshotRequest

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
TaskInstantSnapshot

A Task containing the RPC response.

Example
// Create client
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
GetInstantSnapshotRequest request = new GetInstantSnapshotRequest
{
    Zone = "",
    Project = "",
    InstantSnapshot = "",
};
// Make the request
InstantSnapshot response = await instantSnapshotsClient.GetAsync(request);

GetAsync(GetInstantSnapshotRequest, CancellationToken)

public virtual Task<InstantSnapshot> GetAsync(GetInstantSnapshotRequest request, CancellationToken cancellationToken)

Returns the specified InstantSnapshot resource in the specified zone.

Parameters
Name Description
request GetInstantSnapshotRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskInstantSnapshot

A Task containing the RPC response.

Example
// Create client
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
GetInstantSnapshotRequest request = new GetInstantSnapshotRequest
{
    Zone = "",
    Project = "",
    InstantSnapshot = "",
};
// Make the request
InstantSnapshot response = await instantSnapshotsClient.GetAsync(request);

GetAsync(string, string, string, CallSettings)

public virtual Task<InstantSnapshot> GetAsync(string project, string zone, string instantSnapshot, CallSettings callSettings = null)

Returns the specified InstantSnapshot resource in the specified zone.

Parameters
Name Description
project string

Project ID for this request.

zone string

The name of the zone for this request.

instantSnapshot string

Name of the InstantSnapshot resource to return.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskInstantSnapshot

A Task containing the RPC response.

Example
// Create client
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string instantSnapshot = "";
// Make the request
InstantSnapshot response = await instantSnapshotsClient.GetAsync(project, zone, instantSnapshot);

GetAsync(string, string, string, CancellationToken)

public virtual Task<InstantSnapshot> GetAsync(string project, string zone, string instantSnapshot, CancellationToken cancellationToken)

Returns the specified InstantSnapshot resource in the specified zone.

Parameters
Name Description
project string

Project ID for this request.

zone string

The name of the zone for this request.

instantSnapshot string

Name of the InstantSnapshot resource to return.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskInstantSnapshot

A Task containing the RPC response.

Example
// Create client
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string instantSnapshot = "";
// Make the request
InstantSnapshot response = await instantSnapshotsClient.GetAsync(project, zone, instantSnapshot);

GetIamPolicy(GetIamPolicyInstantSnapshotRequest, CallSettings)

public virtual Policy GetIamPolicy(GetIamPolicyInstantSnapshotRequest 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 GetIamPolicyInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
GetIamPolicyInstantSnapshotRequest request = new GetIamPolicyInstantSnapshotRequest
{
    Zone = "",
    Resource = "",
    Project = "",
    OptionsRequestedPolicyVersion = 0,
};
// Make the request
Policy response = instantSnapshotsClient.GetIamPolicy(request);

GetIamPolicy(string, string, string, CallSettings)

public virtual Policy GetIamPolicy(string project, string zone, 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.

zone string

The name of the zone 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
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
string zone = "";
string resource = "";
// Make the request
Policy response = instantSnapshotsClient.GetIamPolicy(project, zone, resource);

GetIamPolicyAsync(GetIamPolicyInstantSnapshotRequest, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyInstantSnapshotRequest 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 GetIamPolicyInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyInstantSnapshotRequest request = new GetIamPolicyInstantSnapshotRequest
{
    Zone = "",
    Resource = "",
    Project = "",
    OptionsRequestedPolicyVersion = 0,
};
// Make the request
Policy response = await instantSnapshotsClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(GetIamPolicyInstantSnapshotRequest, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyInstantSnapshotRequest 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 GetIamPolicyInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyInstantSnapshotRequest request = new GetIamPolicyInstantSnapshotRequest
{
    Zone = "",
    Resource = "",
    Project = "",
    OptionsRequestedPolicyVersion = 0,
};
// Make the request
Policy response = await instantSnapshotsClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(string, string, string, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(string project, string zone, 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.

zone string

The name of the zone 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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string resource = "";
// Make the request
Policy response = await instantSnapshotsClient.GetIamPolicyAsync(project, zone, resource);

GetIamPolicyAsync(string, string, string, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(string project, string zone, 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.

zone string

The name of the zone 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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string resource = "";
// Make the request
Policy response = await instantSnapshotsClient.GetIamPolicyAsync(project, zone, resource);

Insert(InsertInstantSnapshotRequest, CallSettings)

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

Creates an instant snapshot in the specified zone.

Parameters
Name Description
request InsertInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
InsertInstantSnapshotRequest request = new InsertInstantSnapshotRequest
{
    Zone = "",
    RequestId = "",
    Project = "",
    InstantSnapshotResource = new InstantSnapshot(),
};
// Make the request
lro::Operation<Operation, Operation> response = instantSnapshotsClient.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 = instantSnapshotsClient.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, string, InstantSnapshot, CallSettings)

public virtual Operation<Operation, Operation> Insert(string project, string zone, InstantSnapshot instantSnapshotResource, CallSettings callSettings = null)

Creates an instant snapshot in the specified zone.

Parameters
Name Description
project string

Project ID for this request.

zone string

Name of the zone for this request.

instantSnapshotResource InstantSnapshot

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
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
string zone = "";
InstantSnapshot instantSnapshotResource = new InstantSnapshot();
// Make the request
lro::Operation<Operation, Operation> response = instantSnapshotsClient.Insert(project, zone, instantSnapshotResource);

// 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 = instantSnapshotsClient.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(InsertInstantSnapshotRequest, CallSettings)

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

Creates an instant snapshot in the specified zone.

Parameters
Name Description
request InsertInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
InsertInstantSnapshotRequest request = new InsertInstantSnapshotRequest
{
    Zone = "",
    RequestId = "",
    Project = "",
    InstantSnapshotResource = new InstantSnapshot(),
};
// Make the request
lro::Operation<Operation, Operation> response = await instantSnapshotsClient.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 instantSnapshotsClient.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(InsertInstantSnapshotRequest, CancellationToken)

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

Creates an instant snapshot in the specified zone.

Parameters
Name Description
request InsertInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
InsertInstantSnapshotRequest request = new InsertInstantSnapshotRequest
{
    Zone = "",
    RequestId = "",
    Project = "",
    InstantSnapshotResource = new InstantSnapshot(),
};
// Make the request
lro::Operation<Operation, Operation> response = await instantSnapshotsClient.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 instantSnapshotsClient.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, string, InstantSnapshot, CallSettings)

public virtual Task<Operation<Operation, Operation>> InsertAsync(string project, string zone, InstantSnapshot instantSnapshotResource, CallSettings callSettings = null)

Creates an instant snapshot in the specified zone.

Parameters
Name Description
project string

Project ID for this request.

zone string

Name of the zone for this request.

instantSnapshotResource InstantSnapshot

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
InstantSnapshot instantSnapshotResource = new InstantSnapshot();
// Make the request
lro::Operation<Operation, Operation> response = await instantSnapshotsClient.InsertAsync(project, zone, instantSnapshotResource);

// 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 instantSnapshotsClient.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, string, InstantSnapshot, CancellationToken)

public virtual Task<Operation<Operation, Operation>> InsertAsync(string project, string zone, InstantSnapshot instantSnapshotResource, CancellationToken cancellationToken)

Creates an instant snapshot in the specified zone.

Parameters
Name Description
project string

Project ID for this request.

zone string

Name of the zone for this request.

instantSnapshotResource InstantSnapshot

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
InstantSnapshot instantSnapshotResource = new InstantSnapshot();
// Make the request
lro::Operation<Operation, Operation> response = await instantSnapshotsClient.InsertAsync(project, zone, instantSnapshotResource);

// 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 instantSnapshotsClient.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(ListInstantSnapshotsRequest, CallSettings)

public virtual PagedEnumerable<InstantSnapshotList, InstantSnapshot> List(ListInstantSnapshotsRequest request, CallSettings callSettings = null)

Retrieves the list of InstantSnapshot resources contained within the specified zone.

Parameters
Name Description
request ListInstantSnapshotsRequest

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
PagedEnumerableInstantSnapshotListInstantSnapshot

A pageable sequence of InstantSnapshot resources.

Example
// Create client
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
ListInstantSnapshotsRequest request = new ListInstantSnapshotsRequest
{
    Zone = "",
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedEnumerable<InstantSnapshotList, InstantSnapshot> response = instantSnapshotsClient.List(request);

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

public virtual PagedEnumerable<InstantSnapshotList, InstantSnapshot> List(string project, string zone, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves the list of InstantSnapshot resources contained within the specified zone.

Parameters
Name Description
project string

Project ID for this request.

zone string

The name of the zone 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
PagedEnumerableInstantSnapshotListInstantSnapshot

A pageable sequence of InstantSnapshot resources.

Example
// Create client
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
string zone = "";
// Make the request
PagedEnumerable<InstantSnapshotList, InstantSnapshot> response = instantSnapshotsClient.List(project, zone);

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

public virtual PagedAsyncEnumerable<InstantSnapshotList, InstantSnapshot> ListAsync(ListInstantSnapshotsRequest request, CallSettings callSettings = null)

Retrieves the list of InstantSnapshot resources contained within the specified zone.

Parameters
Name Description
request ListInstantSnapshotsRequest

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
PagedAsyncEnumerableInstantSnapshotListInstantSnapshot

A pageable asynchronous sequence of InstantSnapshot resources.

Example
// Create client
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
ListInstantSnapshotsRequest request = new ListInstantSnapshotsRequest
{
    Zone = "",
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedAsyncEnumerable<InstantSnapshotList, InstantSnapshot> response = instantSnapshotsClient.ListAsync(request);

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

public virtual PagedAsyncEnumerable<InstantSnapshotList, InstantSnapshot> ListAsync(string project, string zone, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves the list of InstantSnapshot resources contained within the specified zone.

Parameters
Name Description
project string

Project ID for this request.

zone string

The name of the zone 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
PagedAsyncEnumerableInstantSnapshotListInstantSnapshot

A pageable asynchronous sequence of InstantSnapshot resources.

Example
// Create client
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
// Make the request
PagedAsyncEnumerable<InstantSnapshotList, InstantSnapshot> response = instantSnapshotsClient.ListAsync(project, zone);

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

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

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

Parameters
Name Description
request SetIamPolicyInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
SetIamPolicyInstantSnapshotRequest request = new SetIamPolicyInstantSnapshotRequest
{
    Zone = "",
    Resource = "",
    Project = "",
    ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(),
};
// Make the request
Policy response = instantSnapshotsClient.SetIamPolicy(request);

SetIamPolicy(string, string, string, ZoneSetPolicyRequest, CallSettings)

public virtual Policy SetIamPolicy(string project, string zone, string resource, ZoneSetPolicyRequest zoneSetPolicyRequestResource, 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.

zone string

The name of the zone for this request.

resource string

Name or id of the resource for this request.

zoneSetPolicyRequestResource ZoneSetPolicyRequest

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
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
string zone = "";
string resource = "";
ZoneSetPolicyRequest zoneSetPolicyRequestResource = new ZoneSetPolicyRequest();
// Make the request
Policy response = instantSnapshotsClient.SetIamPolicy(project, zone, resource, zoneSetPolicyRequestResource);

SetIamPolicyAsync(SetIamPolicyInstantSnapshotRequest, CallSettings)

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

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

Parameters
Name Description
request SetIamPolicyInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyInstantSnapshotRequest request = new SetIamPolicyInstantSnapshotRequest
{
    Zone = "",
    Resource = "",
    Project = "",
    ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(),
};
// Make the request
Policy response = await instantSnapshotsClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(SetIamPolicyInstantSnapshotRequest, CancellationToken)

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

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

Parameters
Name Description
request SetIamPolicyInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyInstantSnapshotRequest request = new SetIamPolicyInstantSnapshotRequest
{
    Zone = "",
    Resource = "",
    Project = "",
    ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(),
};
// Make the request
Policy response = await instantSnapshotsClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(string, string, string, ZoneSetPolicyRequest, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(string project, string zone, string resource, ZoneSetPolicyRequest zoneSetPolicyRequestResource, 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.

zone string

The name of the zone for this request.

resource string

Name or id of the resource for this request.

zoneSetPolicyRequestResource ZoneSetPolicyRequest

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string resource = "";
ZoneSetPolicyRequest zoneSetPolicyRequestResource = new ZoneSetPolicyRequest();
// Make the request
Policy response = await instantSnapshotsClient.SetIamPolicyAsync(project, zone, resource, zoneSetPolicyRequestResource);

SetIamPolicyAsync(string, string, string, ZoneSetPolicyRequest, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(string project, string zone, string resource, ZoneSetPolicyRequest zoneSetPolicyRequestResource, 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.

zone string

The name of the zone for this request.

resource string

Name or id of the resource for this request.

zoneSetPolicyRequestResource ZoneSetPolicyRequest

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string resource = "";
ZoneSetPolicyRequest zoneSetPolicyRequestResource = new ZoneSetPolicyRequest();
// Make the request
Policy response = await instantSnapshotsClient.SetIamPolicyAsync(project, zone, resource, zoneSetPolicyRequestResource);

SetLabels(SetLabelsInstantSnapshotRequest, CallSettings)

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

Sets the labels on a instantSnapshot in the given zone. To learn more about labels, read the Labeling Resources documentation.

Parameters
Name Description
request SetLabelsInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
SetLabelsInstantSnapshotRequest request = new SetLabelsInstantSnapshotRequest
{
    Zone = "",
    RequestId = "",
    Resource = "",
    Project = "",
    ZoneSetLabelsRequestResource = new ZoneSetLabelsRequest(),
};
// Make the request
lro::Operation<Operation, Operation> response = instantSnapshotsClient.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 = instantSnapshotsClient.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, string, ZoneSetLabelsRequest, CallSettings)

public virtual Operation<Operation, Operation> SetLabels(string project, string zone, string resource, ZoneSetLabelsRequest zoneSetLabelsRequestResource, CallSettings callSettings = null)

Sets the labels on a instantSnapshot in the given zone. To learn more about labels, read the Labeling Resources documentation.

Parameters
Name Description
project string

Project ID for this request.

zone string

The name of the zone for this request.

resource string

Name or id of the resource for this request.

zoneSetLabelsRequestResource ZoneSetLabelsRequest

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
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
string zone = "";
string resource = "";
ZoneSetLabelsRequest zoneSetLabelsRequestResource = new ZoneSetLabelsRequest();
// Make the request
lro::Operation<Operation, Operation> response = instantSnapshotsClient.SetLabels(project, zone, resource, zoneSetLabelsRequestResource);

// 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 = instantSnapshotsClient.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(SetLabelsInstantSnapshotRequest, CallSettings)

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

Sets the labels on a instantSnapshot in the given zone. To learn more about labels, read the Labeling Resources documentation.

Parameters
Name Description
request SetLabelsInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
SetLabelsInstantSnapshotRequest request = new SetLabelsInstantSnapshotRequest
{
    Zone = "",
    RequestId = "",
    Resource = "",
    Project = "",
    ZoneSetLabelsRequestResource = new ZoneSetLabelsRequest(),
};
// Make the request
lro::Operation<Operation, Operation> response = await instantSnapshotsClient.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 instantSnapshotsClient.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(SetLabelsInstantSnapshotRequest, CancellationToken)

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

Sets the labels on a instantSnapshot in the given zone. To learn more about labels, read the Labeling Resources documentation.

Parameters
Name Description
request SetLabelsInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
SetLabelsInstantSnapshotRequest request = new SetLabelsInstantSnapshotRequest
{
    Zone = "",
    RequestId = "",
    Resource = "",
    Project = "",
    ZoneSetLabelsRequestResource = new ZoneSetLabelsRequest(),
};
// Make the request
lro::Operation<Operation, Operation> response = await instantSnapshotsClient.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 instantSnapshotsClient.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, string, ZoneSetLabelsRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> SetLabelsAsync(string project, string zone, string resource, ZoneSetLabelsRequest zoneSetLabelsRequestResource, CallSettings callSettings = null)

Sets the labels on a instantSnapshot in the given zone. To learn more about labels, read the Labeling Resources documentation.

Parameters
Name Description
project string

Project ID for this request.

zone string

The name of the zone for this request.

resource string

Name or id of the resource for this request.

zoneSetLabelsRequestResource ZoneSetLabelsRequest

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string resource = "";
ZoneSetLabelsRequest zoneSetLabelsRequestResource = new ZoneSetLabelsRequest();
// Make the request
lro::Operation<Operation, Operation> response = await instantSnapshotsClient.SetLabelsAsync(project, zone, resource, zoneSetLabelsRequestResource);

// 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 instantSnapshotsClient.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, string, ZoneSetLabelsRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> SetLabelsAsync(string project, string zone, string resource, ZoneSetLabelsRequest zoneSetLabelsRequestResource, CancellationToken cancellationToken)

Sets the labels on a instantSnapshot in the given zone. To learn more about labels, read the Labeling Resources documentation.

Parameters
Name Description
project string

Project ID for this request.

zone string

The name of the zone for this request.

resource string

Name or id of the resource for this request.

zoneSetLabelsRequestResource ZoneSetLabelsRequest

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string resource = "";
ZoneSetLabelsRequest zoneSetLabelsRequestResource = new ZoneSetLabelsRequest();
// Make the request
lro::Operation<Operation, Operation> response = await instantSnapshotsClient.SetLabelsAsync(project, zone, resource, zoneSetLabelsRequestResource);

// 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 instantSnapshotsClient.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(TestIamPermissionsInstantSnapshotRequest, CallSettings)

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

Returns permissions that a caller has on the specified resource.

Parameters
Name Description
request TestIamPermissionsInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
TestIamPermissionsInstantSnapshotRequest request = new TestIamPermissionsInstantSnapshotRequest
{
    Zone = "",
    Resource = "",
    Project = "",
    TestPermissionsRequestResource = new TestPermissionsRequest(),
};
// Make the request
TestPermissionsResponse response = instantSnapshotsClient.TestIamPermissions(request);

TestIamPermissions(string, string, string, TestPermissionsRequest, CallSettings)

public virtual TestPermissionsResponse TestIamPermissions(string project, string zone, 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.

zone string

The name of the zone 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
InstantSnapshotsClient instantSnapshotsClient = InstantSnapshotsClient.Create();
// Initialize request argument(s)
string project = "";
string zone = "";
string resource = "";
TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
// Make the request
TestPermissionsResponse response = instantSnapshotsClient.TestIamPermissions(project, zone, resource, testPermissionsRequestResource);

TestIamPermissionsAsync(TestIamPermissionsInstantSnapshotRequest, CallSettings)

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

Returns permissions that a caller has on the specified resource.

Parameters
Name Description
request TestIamPermissionsInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsInstantSnapshotRequest request = new TestIamPermissionsInstantSnapshotRequest
{
    Zone = "",
    Resource = "",
    Project = "",
    TestPermissionsRequestResource = new TestPermissionsRequest(),
};
// Make the request
TestPermissionsResponse response = await instantSnapshotsClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(TestIamPermissionsInstantSnapshotRequest, CancellationToken)

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

Returns permissions that a caller has on the specified resource.

Parameters
Name Description
request TestIamPermissionsInstantSnapshotRequest

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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsInstantSnapshotRequest request = new TestIamPermissionsInstantSnapshotRequest
{
    Zone = "",
    Resource = "",
    Project = "",
    TestPermissionsRequestResource = new TestPermissionsRequest(),
};
// Make the request
TestPermissionsResponse response = await instantSnapshotsClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(string, string, string, TestPermissionsRequest, CallSettings)

public virtual Task<TestPermissionsResponse> TestIamPermissionsAsync(string project, string zone, 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.

zone string

The name of the zone 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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string resource = "";
TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
// Make the request
TestPermissionsResponse response = await instantSnapshotsClient.TestIamPermissionsAsync(project, zone, resource, testPermissionsRequestResource);

TestIamPermissionsAsync(string, string, string, TestPermissionsRequest, CancellationToken)

public virtual Task<TestPermissionsResponse> TestIamPermissionsAsync(string project, string zone, 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.

zone string

The name of the zone 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
InstantSnapshotsClient instantSnapshotsClient = await InstantSnapshotsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string resource = "";
TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
// Make the request
TestPermissionsResponse response = await instantSnapshotsClient.TestIamPermissionsAsync(project, zone, resource, testPermissionsRequestResource);