public abstract class SnapshotsClient
Snapshots client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Compute.V1Assembly
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 |
IReadOnlyList<String> |
The default Snapshots scopes are:
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 |
Snapshots.SnapshotsClient |
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(CancellationToken))
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 |
Task<SnapshotsClient> | 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 |
Operation<Operation, Operation> | The RPC response. |
// 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 |
Operation<Operation, Operation> | The RPC response. |
// 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 |
Task<Operation<Operation, Operation>> | A Task containing the RPC response. |
// 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 |
Task<Operation<Operation, Operation>> | A Task containing the RPC response. |
// 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 |
Task<Operation<Operation, Operation>> | A Task containing the RPC response. |
// 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 |
Task<Operation<Operation, Operation>> | A Task containing the RPC response. |
// 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. Gets a list of available snapshots by making a list() request.
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. |
// 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. Gets a list of available snapshots by making a list() request.
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. |
// 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. Gets a list of available snapshots by making a list() request.
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 |
Task<Snapshot> | A Task containing the RPC response. |
// 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. Gets a list of available snapshots by making a list() request.
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 |
Task<Snapshot> | A Task containing the RPC response. |
// 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. Gets a list of available snapshots by making a list() request.
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 |
Task<Snapshot> | A Task containing the RPC response. |
// 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. Gets a list of available snapshots by making a list() request.
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 |
Task<Snapshot> | A Task containing the RPC response. |
// 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. |
// 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. |
// 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 |
Task<Policy> | A Task containing the RPC response. |
// 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 |
Task<Policy> | A Task containing the RPC response. |
// 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 |
Task<Policy> | A Task containing the RPC response. |
// 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 |
Task<Policy> | A Task containing the RPC response. |
// 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);
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 |
PagedEnumerable<SnapshotList, Snapshot> | A pageable sequence of Snapshot resources. |
// 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, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<SnapshotList, Snapshot> List(string project, string pageToken = null, int? pageSize = default(int? ), 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 |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<SnapshotList, Snapshot> | A pageable sequence of Snapshot resources. |
// 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 |
PagedAsyncEnumerable<SnapshotList, Snapshot> | A pageable asynchronous sequence of Snapshot resources. |
// 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, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<SnapshotList, Snapshot> ListAsync(string project, string pageToken = null, int? pageSize = default(int? ), 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 |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<SnapshotList, Snapshot> | A pageable asynchronous sequence of Snapshot resources. |
// 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 |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Operation, Operation> | 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 |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Operation, Operation>> | 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 |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Operation, Operation> | 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 |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Operation, Operation>> | 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. |
// 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. |
// 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 |
Task<Policy> | A Task containing the RPC response. |
// 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 |
Task<Policy> | A Task containing the RPC response. |
// 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 |
Task<Policy> | A Task containing the RPC response. |
// 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 |
Task<Policy> | A Task containing the RPC response. |
// 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 |
Operation<Operation, Operation> | The RPC response. |
// 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 |
Operation<Operation, Operation> | The RPC response. |
// 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 |
Task<Operation<Operation, Operation>> | A Task containing the RPC response. |
// 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 |
Task<Operation<Operation, Operation>> | A Task containing the RPC response. |
// 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 |
Task<Operation<Operation, Operation>> | A Task containing the RPC response. |
// 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 |
Task<Operation<Operation, Operation>> | A Task containing the RPC response. |
// 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. |
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. |
// 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. |
// 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 |
Task<TestPermissionsResponse> | A Task containing the RPC response. |
// 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 |
Task<TestPermissionsResponse> | A Task containing the RPC response. |
// 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 |
Task<TestPermissionsResponse> | A Task containing the RPC response. |
// 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 |
Task<TestPermissionsResponse> | A Task containing the RPC response. |
// 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);