Compute Engine v1 API - Class InstanceTemplatesClient (2.14.0)

public abstract class InstanceTemplatesClient

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

InstanceTemplates client wrapper, for convenient use.

Inheritance

object > InstanceTemplatesClient

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Remarks

The InstanceTemplates API.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default InstanceTemplates scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

DeleteOperationsClient

public virtual OperationsClient DeleteOperationsClient { get; }

The long-running operations client for Delete.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual InstanceTemplates.InstanceTemplatesClient GrpcClient { get; }

The underlying gRPC InstanceTemplates client

Property Value
TypeDescription
InstanceTemplatesInstanceTemplatesClient

InsertOperationsClient

public virtual OperationsClient InsertOperationsClient { get; }

The long-running operations client for Insert.

Property Value
TypeDescription
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

AggregatedList(AggregatedListInstanceTemplatesRequest, CallSettings)

public virtual PagedEnumerable<InstanceTemplateAggregatedList, KeyValuePair<string, InstanceTemplatesScopedList>> AggregatedList(AggregatedListInstanceTemplatesRequest request, CallSettings callSettings = null)

Retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

Parameters
NameDescription
requestAggregatedListInstanceTemplatesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableInstanceTemplateAggregatedListKeyValuePairstringInstanceTemplatesScopedList

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

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create();
// Initialize request argument(s)
AggregatedListInstanceTemplatesRequest request = new AggregatedListInstanceTemplatesRequest
{
    OrderBy = "",
    Project = "",
    ServiceProjectNumber = 0L,
    Filter = "",
    IncludeAllScopes = false,
    ReturnPartialSuccess = false,
};
// Make the request
PagedEnumerable<InstanceTemplateAggregatedList, KeyValuePair<string, InstanceTemplatesScopedList>> response = instanceTemplatesClient.AggregatedList(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (KeyValuePair<string, InstanceTemplatesScopedList> 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 (InstanceTemplateAggregatedList page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (KeyValuePair<string, InstanceTemplatesScopedList> 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, InstanceTemplatesScopedList>> 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, InstanceTemplatesScopedList> 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<InstanceTemplateAggregatedList, KeyValuePair<string, InstanceTemplatesScopedList>> AggregatedList(string project, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

Parameters
NameDescription
projectstring

Name of the project scoping this request.

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableInstanceTemplateAggregatedListKeyValuePairstringInstanceTemplatesScopedList

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

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create();
// Initialize request argument(s)
string project = "";
// Make the request
PagedEnumerable<InstanceTemplateAggregatedList, KeyValuePair<string, InstanceTemplatesScopedList>> response = instanceTemplatesClient.AggregatedList(project);

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

public virtual PagedAsyncEnumerable<InstanceTemplateAggregatedList, KeyValuePair<string, InstanceTemplatesScopedList>> AggregatedListAsync(AggregatedListInstanceTemplatesRequest request, CallSettings callSettings = null)

Retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

Parameters
NameDescription
requestAggregatedListInstanceTemplatesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableInstanceTemplateAggregatedListKeyValuePairstringInstanceTemplatesScopedList

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

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
AggregatedListInstanceTemplatesRequest request = new AggregatedListInstanceTemplatesRequest
{
    OrderBy = "",
    Project = "",
    ServiceProjectNumber = 0L,
    Filter = "",
    IncludeAllScopes = false,
    ReturnPartialSuccess = false,
};
// Make the request
PagedAsyncEnumerable<InstanceTemplateAggregatedList, KeyValuePair<string, InstanceTemplatesScopedList>> response = instanceTemplatesClient.AggregatedListAsync(request);

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

Retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

Parameters
NameDescription
projectstring

Name of the project scoping this request.

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableInstanceTemplateAggregatedListKeyValuePairstringInstanceTemplatesScopedList

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

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
// Make the request
PagedAsyncEnumerable<InstanceTemplateAggregatedList, KeyValuePair<string, InstanceTemplatesScopedList>> response = instanceTemplatesClient.AggregatedListAsync(project);

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

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

Returns
TypeDescription
InstanceTemplatesClient

The created InstanceTemplatesClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskInstanceTemplatesClient

The task representing the created InstanceTemplatesClient.

Delete(DeleteInstanceTemplateRequest, CallSettings)

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

Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group.

Parameters
NameDescription
requestDeleteInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationOperationOperation

The RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create();
// Initialize request argument(s)
DeleteInstanceTemplateRequest request = new DeleteInstanceTemplateRequest
{
    RequestId = "",
    Project = "",
    InstanceTemplate = "",
};
// Make the request
lro::Operation<Operation, Operation> response = instanceTemplatesClient.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 = instanceTemplatesClient.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 instanceTemplate, CallSettings callSettings = null)

Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group.

Parameters
NameDescription
projectstring

Project ID for this request.

instanceTemplatestring

The name of the instance template to delete.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationOperationOperation

The RPC response.

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

// 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 = instanceTemplatesClient.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(DeleteInstanceTemplateRequest, CallSettings)

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

Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group.

Parameters
NameDescription
requestDeleteInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
DeleteInstanceTemplateRequest request = new DeleteInstanceTemplateRequest
{
    RequestId = "",
    Project = "",
    InstanceTemplate = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await instanceTemplatesClient.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 instanceTemplatesClient.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(DeleteInstanceTemplateRequest, CancellationToken)

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

Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group.

Parameters
NameDescription
requestDeleteInstanceTemplateRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
DeleteInstanceTemplateRequest request = new DeleteInstanceTemplateRequest
{
    RequestId = "",
    Project = "",
    InstanceTemplate = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await instanceTemplatesClient.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 instanceTemplatesClient.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 instanceTemplate, CallSettings callSettings = null)

Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group.

Parameters
NameDescription
projectstring

Project ID for this request.

instanceTemplatestring

The name of the instance template to delete.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

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

// 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 instanceTemplatesClient.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 instanceTemplate, CancellationToken cancellationToken)

Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group.

Parameters
NameDescription
projectstring

Project ID for this request.

instanceTemplatestring

The name of the instance template to delete.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

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

// 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 instanceTemplatesClient.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(GetInstanceTemplateRequest, CallSettings)

public virtual InstanceTemplate Get(GetInstanceTemplateRequest request, CallSettings callSettings = null)

Returns the specified instance template.

Parameters
NameDescription
requestGetInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
InstanceTemplate

The RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create();
// Initialize request argument(s)
GetInstanceTemplateRequest request = new GetInstanceTemplateRequest
{
    Project = "",
    InstanceTemplate = "",
};
// Make the request
InstanceTemplate response = instanceTemplatesClient.Get(request);

Get(string, string, CallSettings)

public virtual InstanceTemplate Get(string project, string instanceTemplate, CallSettings callSettings = null)

Returns the specified instance template.

Parameters
NameDescription
projectstring

Project ID for this request.

instanceTemplatestring

The name of the instance template.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
InstanceTemplate

The RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create();
// Initialize request argument(s)
string project = "";
string instanceTemplate = "";
// Make the request
InstanceTemplate response = instanceTemplatesClient.Get(project, instanceTemplate);

GetAsync(GetInstanceTemplateRequest, CallSettings)

public virtual Task<InstanceTemplate> GetAsync(GetInstanceTemplateRequest request, CallSettings callSettings = null)

Returns the specified instance template.

Parameters
NameDescription
requestGetInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskInstanceTemplate

A Task containing the RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
GetInstanceTemplateRequest request = new GetInstanceTemplateRequest
{
    Project = "",
    InstanceTemplate = "",
};
// Make the request
InstanceTemplate response = await instanceTemplatesClient.GetAsync(request);

GetAsync(GetInstanceTemplateRequest, CancellationToken)

public virtual Task<InstanceTemplate> GetAsync(GetInstanceTemplateRequest request, CancellationToken cancellationToken)

Returns the specified instance template.

Parameters
NameDescription
requestGetInstanceTemplateRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskInstanceTemplate

A Task containing the RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
GetInstanceTemplateRequest request = new GetInstanceTemplateRequest
{
    Project = "",
    InstanceTemplate = "",
};
// Make the request
InstanceTemplate response = await instanceTemplatesClient.GetAsync(request);

GetAsync(string, string, CallSettings)

public virtual Task<InstanceTemplate> GetAsync(string project, string instanceTemplate, CallSettings callSettings = null)

Returns the specified instance template.

Parameters
NameDescription
projectstring

Project ID for this request.

instanceTemplatestring

The name of the instance template.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskInstanceTemplate

A Task containing the RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string instanceTemplate = "";
// Make the request
InstanceTemplate response = await instanceTemplatesClient.GetAsync(project, instanceTemplate);

GetAsync(string, string, CancellationToken)

public virtual Task<InstanceTemplate> GetAsync(string project, string instanceTemplate, CancellationToken cancellationToken)

Returns the specified instance template.

Parameters
NameDescription
projectstring

Project ID for this request.

instanceTemplatestring

The name of the instance template.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskInstanceTemplate

A Task containing the RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string instanceTemplate = "";
// Make the request
InstanceTemplate response = await instanceTemplatesClient.GetAsync(project, instanceTemplate);

GetIamPolicy(GetIamPolicyInstanceTemplateRequest, CallSettings)

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

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

Parameters
NameDescription
requestGetIamPolicyInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create();
// Initialize request argument(s)
GetIamPolicyInstanceTemplateRequest request = new GetIamPolicyInstanceTemplateRequest
{
    Resource = "",
    Project = "",
    OptionsRequestedPolicyVersion = 0,
};
// Make the request
Policy response = instanceTemplatesClient.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
NameDescription
projectstring

Project ID for this request.

resourcestring

Name or id of the resource for this request.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

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

GetIamPolicyAsync(GetIamPolicyInstanceTemplateRequest, CallSettings)

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

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

Parameters
NameDescription
requestGetIamPolicyInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

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

GetIamPolicyAsync(GetIamPolicyInstanceTemplateRequest, CancellationToken)

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

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

Parameters
NameDescription
requestGetIamPolicyInstanceTemplateRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyInstanceTemplateRequest request = new GetIamPolicyInstanceTemplateRequest
{
    Resource = "",
    Project = "",
    OptionsRequestedPolicyVersion = 0,
};
// Make the request
Policy response = await instanceTemplatesClient.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
NameDescription
projectstring

Project ID for this request.

resourcestring

Name or id of the resource for this request.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string resource = "";
// Make the request
Policy response = await instanceTemplatesClient.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
NameDescription
projectstring

Project ID for this request.

resourcestring

Name or id of the resource for this request.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

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

Insert(InsertInstanceTemplateRequest, CallSettings)

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

Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.

Parameters
NameDescription
requestInsertInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationOperationOperation

The RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create();
// Initialize request argument(s)
InsertInstanceTemplateRequest request = new InsertInstanceTemplateRequest
{
    InstanceTemplateResource = new InstanceTemplate(),
    RequestId = "",
    Project = "",
};
// Make the request
lro::Operation<Operation, Operation> response = instanceTemplatesClient.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 = instanceTemplatesClient.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, InstanceTemplate, CallSettings)

public virtual Operation<Operation, Operation> Insert(string project, InstanceTemplate instanceTemplateResource, CallSettings callSettings = null)

Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.

Parameters
NameDescription
projectstring

Project ID for this request.

instanceTemplateResourceInstanceTemplate

The body resource for this request

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationOperationOperation

The RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create();
// Initialize request argument(s)
string project = "";
InstanceTemplate instanceTemplateResource = new InstanceTemplate();
// Make the request
lro::Operation<Operation, Operation> response = instanceTemplatesClient.Insert(project, instanceTemplateResource);

// 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 = instanceTemplatesClient.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(InsertInstanceTemplateRequest, CallSettings)

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

Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.

Parameters
NameDescription
requestInsertInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
InsertInstanceTemplateRequest request = new InsertInstanceTemplateRequest
{
    InstanceTemplateResource = new InstanceTemplate(),
    RequestId = "",
    Project = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await instanceTemplatesClient.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 instanceTemplatesClient.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(InsertInstanceTemplateRequest, CancellationToken)

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

Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.

Parameters
NameDescription
requestInsertInstanceTemplateRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
InsertInstanceTemplateRequest request = new InsertInstanceTemplateRequest
{
    InstanceTemplateResource = new InstanceTemplate(),
    RequestId = "",
    Project = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await instanceTemplatesClient.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 instanceTemplatesClient.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, InstanceTemplate, CallSettings)

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

Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.

Parameters
NameDescription
projectstring

Project ID for this request.

instanceTemplateResourceInstanceTemplate

The body resource for this request

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
InstanceTemplate instanceTemplateResource = new InstanceTemplate();
// Make the request
lro::Operation<Operation, Operation> response = await instanceTemplatesClient.InsertAsync(project, instanceTemplateResource);

// 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 instanceTemplatesClient.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, InstanceTemplate, CancellationToken)

public virtual Task<Operation<Operation, Operation>> InsertAsync(string project, InstanceTemplate instanceTemplateResource, CancellationToken cancellationToken)

Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.

Parameters
NameDescription
projectstring

Project ID for this request.

instanceTemplateResourceInstanceTemplate

The body resource for this request

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
InstanceTemplate instanceTemplateResource = new InstanceTemplate();
// Make the request
lro::Operation<Operation, Operation> response = await instanceTemplatesClient.InsertAsync(project, instanceTemplateResource);

// 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 instanceTemplatesClient.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(ListInstanceTemplatesRequest, CallSettings)

public virtual PagedEnumerable<InstanceTemplateList, InstanceTemplate> List(ListInstanceTemplatesRequest request, CallSettings callSettings = null)

Retrieves a list of instance templates that are contained within the specified project.

Parameters
NameDescription
requestListInstanceTemplatesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableInstanceTemplateListInstanceTemplate

A pageable sequence of InstanceTemplate resources.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create();
// Initialize request argument(s)
ListInstanceTemplatesRequest request = new ListInstanceTemplatesRequest
{
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedEnumerable<InstanceTemplateList, InstanceTemplate> response = instanceTemplatesClient.List(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (InstanceTemplate 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 (InstanceTemplateList page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (InstanceTemplate 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<InstanceTemplate> 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 (InstanceTemplate item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

List(string, string, int?, CallSettings)

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

Retrieves a list of instance templates that are contained within the specified project.

Parameters
NameDescription
projectstring

Project ID for this request.

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableInstanceTemplateListInstanceTemplate

A pageable sequence of InstanceTemplate resources.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create();
// Initialize request argument(s)
string project = "";
// Make the request
PagedEnumerable<InstanceTemplateList, InstanceTemplate> response = instanceTemplatesClient.List(project);

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

public virtual PagedAsyncEnumerable<InstanceTemplateList, InstanceTemplate> ListAsync(ListInstanceTemplatesRequest request, CallSettings callSettings = null)

Retrieves a list of instance templates that are contained within the specified project.

Parameters
NameDescription
requestListInstanceTemplatesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableInstanceTemplateListInstanceTemplate

A pageable asynchronous sequence of InstanceTemplate resources.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
ListInstanceTemplatesRequest request = new ListInstanceTemplatesRequest
{
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedAsyncEnumerable<InstanceTemplateList, InstanceTemplate> response = instanceTemplatesClient.ListAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((InstanceTemplate 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((InstanceTemplateList page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (InstanceTemplate 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<InstanceTemplate> 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 (InstanceTemplate item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAsync(string, string, int?, CallSettings)

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

Retrieves a list of instance templates that are contained within the specified project.

Parameters
NameDescription
projectstring

Project ID for this request.

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableInstanceTemplateListInstanceTemplate

A pageable asynchronous sequence of InstanceTemplate resources.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
// Make the request
PagedAsyncEnumerable<InstanceTemplateList, InstanceTemplate> response = instanceTemplatesClient.ListAsync(project);

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

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationOperationOperation

A task representing the result of polling the operation.

SetIamPolicy(SetIamPolicyInstanceTemplateRequest, CallSettings)

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

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

Parameters
NameDescription
requestSetIamPolicyInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create();
// Initialize request argument(s)
SetIamPolicyInstanceTemplateRequest request = new SetIamPolicyInstanceTemplateRequest
{
    Resource = "",
    Project = "",
    GlobalSetPolicyRequestResource = new GlobalSetPolicyRequest(),
};
// Make the request
Policy response = instanceTemplatesClient.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
NameDescription
projectstring

Project ID for this request.

resourcestring

Name or id of the resource for this request.

globalSetPolicyRequestResourceGlobalSetPolicyRequest

The body resource for this request

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

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

SetIamPolicyAsync(SetIamPolicyInstanceTemplateRequest, CallSettings)

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

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

Parameters
NameDescription
requestSetIamPolicyInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

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

SetIamPolicyAsync(SetIamPolicyInstanceTemplateRequest, CancellationToken)

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

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

Parameters
NameDescription
requestSetIamPolicyInstanceTemplateRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyInstanceTemplateRequest request = new SetIamPolicyInstanceTemplateRequest
{
    Resource = "",
    Project = "",
    GlobalSetPolicyRequestResource = new GlobalSetPolicyRequest(),
};
// Make the request
Policy response = await instanceTemplatesClient.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
NameDescription
projectstring

Project ID for this request.

resourcestring

Name or id of the resource for this request.

globalSetPolicyRequestResourceGlobalSetPolicyRequest

The body resource for this request

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string resource = "";
GlobalSetPolicyRequest globalSetPolicyRequestResource = new GlobalSetPolicyRequest();
// Make the request
Policy response = await instanceTemplatesClient.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
NameDescription
projectstring

Project ID for this request.

resourcestring

Name or id of the resource for this request.

globalSetPolicyRequestResourceGlobalSetPolicyRequest

The body resource for this request

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

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

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

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

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

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

TestIamPermissions(TestIamPermissionsInstanceTemplateRequest, CallSettings)

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

Returns permissions that a caller has on the specified resource.

Parameters
NameDescription
requestTestIamPermissionsInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestPermissionsResponse

The RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create();
// Initialize request argument(s)
TestIamPermissionsInstanceTemplateRequest request = new TestIamPermissionsInstanceTemplateRequest
{
    Resource = "",
    Project = "",
    TestPermissionsRequestResource = new TestPermissionsRequest(),
};
// Make the request
TestPermissionsResponse response = instanceTemplatesClient.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
NameDescription
projectstring

Project ID for this request.

resourcestring

Name or id of the resource for this request.

testPermissionsRequestResourceTestPermissionsRequest

The body resource for this request

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestPermissionsResponse

The RPC response.

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

TestIamPermissionsAsync(TestIamPermissionsInstanceTemplateRequest, CallSettings)

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

Returns permissions that a caller has on the specified resource.

Parameters
NameDescription
requestTestIamPermissionsInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTestPermissionsResponse

A Task containing the RPC response.

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

TestIamPermissionsAsync(TestIamPermissionsInstanceTemplateRequest, CancellationToken)

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

Returns permissions that a caller has on the specified resource.

Parameters
NameDescription
requestTestIamPermissionsInstanceTemplateRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTestPermissionsResponse

A Task containing the RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsInstanceTemplateRequest request = new TestIamPermissionsInstanceTemplateRequest
{
    Resource = "",
    Project = "",
    TestPermissionsRequestResource = new TestPermissionsRequest(),
};
// Make the request
TestPermissionsResponse response = await instanceTemplatesClient.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
NameDescription
projectstring

Project ID for this request.

resourcestring

Name or id of the resource for this request.

testPermissionsRequestResourceTestPermissionsRequest

The body resource for this request

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTestPermissionsResponse

A Task containing the RPC response.

Example
// Create client
InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string resource = "";
TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
// Make the request
TestPermissionsResponse response = await instanceTemplatesClient.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
NameDescription
projectstring

Project ID for this request.

resourcestring

Name or id of the resource for this request.

testPermissionsRequestResourceTestPermissionsRequest

The body resource for this request

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTestPermissionsResponse

A Task containing the RPC response.

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