Class InstanceTemplatesClient (1.1.0)

public abstract 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
IReadOnlyList<String>
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
InstanceTemplates.InstanceTemplatesClient

InsertOperationsClient

public virtual OperationsClient InsertOperationsClient { get; }

The long-running operations client for Insert.

Property Value
TypeDescription
OperationsClient

Methods

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(CancellationToken))

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
Task<InstanceTemplatesClient>

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
Operation<Operation, Operation>

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
Operation<Operation, Operation>

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
Task<Operation<Operation, Operation>>

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
Task<Operation<Operation, Operation>>

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
Task<Operation<Operation, Operation>>

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
Task<Operation<Operation, Operation>>

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. Gets a list of available instance templates by making a list() request.

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. Gets a list of available instance templates by making a list() request.

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. Gets a list of available instance templates by making a list() request.

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
Task<InstanceTemplate>

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. Gets a list of available instance templates by making a list() request.

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
Task<InstanceTemplate>

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. Gets a list of available instance templates by making a list() request.

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
Task<InstanceTemplate>

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. Gets a list of available instance templates by making a list() request.

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
Task<InstanceTemplate>

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
Task<Policy>

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
Task<Policy>

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
Task<Policy>

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
Task<Policy>

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
Operation<Operation, Operation>

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
Operation<Operation, Operation>

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
Task<Operation<Operation, Operation>>

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
Task<Operation<Operation, Operation>>

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
Task<Operation<Operation, Operation>>

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
Task<Operation<Operation, Operation>>

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
PagedEnumerable<InstanceTemplateList, InstanceTemplate>

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, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<InstanceTemplateList, InstanceTemplate> List(string project, string pageToken = null, int? pageSize = default(int? ), 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.

pageSizeNullable<Int32>

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
PagedEnumerable<InstanceTemplateList, InstanceTemplate>

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
PagedAsyncEnumerable<InstanceTemplateList, InstanceTemplate>

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, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<InstanceTemplateList, InstanceTemplate> ListAsync(string project, string pageToken = null, int? pageSize = default(int? ), 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.

pageSizeNullable<Int32>

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
PagedAsyncEnumerable<InstanceTemplateList, InstanceTemplate>

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
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
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
Task<Operation<Operation, Operation>>

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
Operation<Operation, Operation>

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
Task<Operation<Operation, Operation>>

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
Task<Policy>

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
Task<Policy>

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
Task<Policy>

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
Task<Policy>

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
Task<TestPermissionsResponse>

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
Task<TestPermissionsResponse>

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
Task<TestPermissionsResponse>

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
Task<TestPermissionsResponse>

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);