Compute Engine v1 API - Class RegionSecurityPoliciesClient (3.2.0)

public abstract class RegionSecurityPoliciesClient

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

RegionSecurityPolicies client wrapper, for convenient use.

Inheritance

object > RegionSecurityPoliciesClient

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Remarks

The RegionSecurityPolicies API.

Properties

AddRuleOperationsClient

public virtual OperationsClient AddRuleOperationsClient { get; }

The long-running operations client for AddRule.

Property Value
Type Description
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default RegionSecurityPolicies scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

DeleteOperationsClient

public virtual OperationsClient DeleteOperationsClient { get; }

The long-running operations client for Delete.

Property Value
Type Description
OperationsClient

GrpcClient

public virtual RegionSecurityPolicies.RegionSecurityPoliciesClient GrpcClient { get; }

The underlying gRPC RegionSecurityPolicies client

Property Value
Type Description
RegionSecurityPoliciesRegionSecurityPoliciesClient

InsertOperationsClient

public virtual OperationsClient InsertOperationsClient { get; }

The long-running operations client for Insert.

Property Value
Type Description
OperationsClient

PatchOperationsClient

public virtual OperationsClient PatchOperationsClient { get; }

The long-running operations client for Patch.

Property Value
Type Description
OperationsClient

PatchRuleOperationsClient

public virtual OperationsClient PatchRuleOperationsClient { get; }

The long-running operations client for PatchRule.

Property Value
Type Description
OperationsClient

RemoveRuleOperationsClient

public virtual OperationsClient RemoveRuleOperationsClient { get; }

The long-running operations client for RemoveRule.

Property Value
Type Description
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

SetLabelsOperationsClient

public virtual OperationsClient SetLabelsOperationsClient { get; }

The long-running operations client for SetLabels.

Property Value
Type Description
OperationsClient

Methods

AddRule(AddRuleRegionSecurityPolicyRequest, CallSettings)

public virtual Operation<Operation, Operation> AddRule(AddRuleRegionSecurityPolicyRequest request, CallSettings callSettings = null)

Inserts a rule into a security policy.

Parameters
Name Description
request AddRuleRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
AddRuleRegionSecurityPolicyRequest request = new AddRuleRegionSecurityPolicyRequest
{
    Region = "",
    SecurityPolicy = "",
    Project = "",
    ValidateOnly = false,
    SecurityPolicyRuleResource = new SecurityPolicyRule(),
};
// Make the request
lro::Operation<Operation, Operation> response = regionSecurityPoliciesClient.AddRule(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 = regionSecurityPoliciesClient.PollOnceAddRule(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;
}

AddRule(string, string, string, SecurityPolicyRule, CallSettings)

public virtual Operation<Operation, Operation> AddRule(string project, string region, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, CallSettings callSettings = null)

Inserts a rule into a security policy.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to update.

securityPolicyRuleResource SecurityPolicyRule

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
SecurityPolicyRule securityPolicyRuleResource = new SecurityPolicyRule();
// Make the request
lro::Operation<Operation, Operation> response = regionSecurityPoliciesClient.AddRule(project, region, securityPolicy, securityPolicyRuleResource);

// 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 = regionSecurityPoliciesClient.PollOnceAddRule(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;
}

AddRuleAsync(AddRuleRegionSecurityPolicyRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> AddRuleAsync(AddRuleRegionSecurityPolicyRequest request, CallSettings callSettings = null)

Inserts a rule into a security policy.

Parameters
Name Description
request AddRuleRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
AddRuleRegionSecurityPolicyRequest request = new AddRuleRegionSecurityPolicyRequest
{
    Region = "",
    SecurityPolicy = "",
    Project = "",
    ValidateOnly = false,
    SecurityPolicyRuleResource = new SecurityPolicyRule(),
};
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.AddRuleAsync(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 regionSecurityPoliciesClient.PollOnceAddRuleAsync(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;
}

AddRuleAsync(AddRuleRegionSecurityPolicyRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> AddRuleAsync(AddRuleRegionSecurityPolicyRequest request, CancellationToken cancellationToken)

Inserts a rule into a security policy.

Parameters
Name Description
request AddRuleRegionSecurityPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
AddRuleRegionSecurityPolicyRequest request = new AddRuleRegionSecurityPolicyRequest
{
    Region = "",
    SecurityPolicy = "",
    Project = "",
    ValidateOnly = false,
    SecurityPolicyRuleResource = new SecurityPolicyRule(),
};
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.AddRuleAsync(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 regionSecurityPoliciesClient.PollOnceAddRuleAsync(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;
}

AddRuleAsync(string, string, string, SecurityPolicyRule, CallSettings)

public virtual Task<Operation<Operation, Operation>> AddRuleAsync(string project, string region, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, CallSettings callSettings = null)

Inserts a rule into a security policy.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to update.

securityPolicyRuleResource SecurityPolicyRule

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
SecurityPolicyRule securityPolicyRuleResource = new SecurityPolicyRule();
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.AddRuleAsync(project, region, securityPolicy, securityPolicyRuleResource);

// 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 regionSecurityPoliciesClient.PollOnceAddRuleAsync(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;
}

AddRuleAsync(string, string, string, SecurityPolicyRule, CancellationToken)

public virtual Task<Operation<Operation, Operation>> AddRuleAsync(string project, string region, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, CancellationToken cancellationToken)

Inserts a rule into a security policy.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to update.

securityPolicyRuleResource SecurityPolicyRule

The body resource for this request

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
SecurityPolicyRule securityPolicyRuleResource = new SecurityPolicyRule();
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.AddRuleAsync(project, region, securityPolicy, securityPolicyRuleResource);

// 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 regionSecurityPoliciesClient.PollOnceAddRuleAsync(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;
}

Create()

public static RegionSecurityPoliciesClient Create()

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

Returns
Type Description
RegionSecurityPoliciesClient

The created RegionSecurityPoliciesClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskRegionSecurityPoliciesClient

The task representing the created RegionSecurityPoliciesClient.

Delete(DeleteRegionSecurityPolicyRequest, CallSettings)

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

Deletes the specified policy.

Parameters
Name Description
request DeleteRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
DeleteRegionSecurityPolicyRequest request = new DeleteRegionSecurityPolicyRequest
{
    RequestId = "",
    Region = "",
    SecurityPolicy = "",
    Project = "",
};
// Make the request
lro::Operation<Operation, Operation> response = regionSecurityPoliciesClient.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 = regionSecurityPoliciesClient.PollOnceDelete(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

Delete(string, string, string, CallSettings)

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

Deletes the specified policy.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
// Make the request
lro::Operation<Operation, Operation> response = regionSecurityPoliciesClient.Delete(project, region, securityPolicy);

// 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 = regionSecurityPoliciesClient.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(DeleteRegionSecurityPolicyRequest, CallSettings)

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

Deletes the specified policy.

Parameters
Name Description
request DeleteRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

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

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

Deletes the specified policy.

Parameters
Name Description
request DeleteRegionSecurityPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
DeleteRegionSecurityPolicyRequest request = new DeleteRegionSecurityPolicyRequest
{
    RequestId = "",
    Region = "",
    SecurityPolicy = "",
    Project = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.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 regionSecurityPoliciesClient.PollOnceDeleteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

DeleteAsync(string, string, string, CallSettings)

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

Deletes the specified policy.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

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

// 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 regionSecurityPoliciesClient.PollOnceDeleteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

DeleteAsync(string, string, string, CancellationToken)

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

Deletes the specified policy.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to delete.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

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

// 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 regionSecurityPoliciesClient.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(GetRegionSecurityPolicyRequest, CallSettings)

public virtual SecurityPolicy Get(GetRegionSecurityPolicyRequest request, CallSettings callSettings = null)

List all of the ordered rules present in a single specified policy.

Parameters
Name Description
request GetRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SecurityPolicy

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
GetRegionSecurityPolicyRequest request = new GetRegionSecurityPolicyRequest
{
    Region = "",
    SecurityPolicy = "",
    Project = "",
};
// Make the request
SecurityPolicy response = regionSecurityPoliciesClient.Get(request);

Get(string, string, string, CallSettings)

public virtual SecurityPolicy Get(string project, string region, string securityPolicy, CallSettings callSettings = null)

List all of the ordered rules present in a single specified policy.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to get.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SecurityPolicy

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
// Make the request
SecurityPolicy response = regionSecurityPoliciesClient.Get(project, region, securityPolicy);

GetAsync(GetRegionSecurityPolicyRequest, CallSettings)

public virtual Task<SecurityPolicy> GetAsync(GetRegionSecurityPolicyRequest request, CallSettings callSettings = null)

List all of the ordered rules present in a single specified policy.

Parameters
Name Description
request GetRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSecurityPolicy

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
GetRegionSecurityPolicyRequest request = new GetRegionSecurityPolicyRequest
{
    Region = "",
    SecurityPolicy = "",
    Project = "",
};
// Make the request
SecurityPolicy response = await regionSecurityPoliciesClient.GetAsync(request);

GetAsync(GetRegionSecurityPolicyRequest, CancellationToken)

public virtual Task<SecurityPolicy> GetAsync(GetRegionSecurityPolicyRequest request, CancellationToken cancellationToken)

List all of the ordered rules present in a single specified policy.

Parameters
Name Description
request GetRegionSecurityPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSecurityPolicy

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
GetRegionSecurityPolicyRequest request = new GetRegionSecurityPolicyRequest
{
    Region = "",
    SecurityPolicy = "",
    Project = "",
};
// Make the request
SecurityPolicy response = await regionSecurityPoliciesClient.GetAsync(request);

GetAsync(string, string, string, CallSettings)

public virtual Task<SecurityPolicy> GetAsync(string project, string region, string securityPolicy, CallSettings callSettings = null)

List all of the ordered rules present in a single specified policy.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to get.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSecurityPolicy

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
// Make the request
SecurityPolicy response = await regionSecurityPoliciesClient.GetAsync(project, region, securityPolicy);

GetAsync(string, string, string, CancellationToken)

public virtual Task<SecurityPolicy> GetAsync(string project, string region, string securityPolicy, CancellationToken cancellationToken)

List all of the ordered rules present in a single specified policy.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to get.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSecurityPolicy

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
// Make the request
SecurityPolicy response = await regionSecurityPoliciesClient.GetAsync(project, region, securityPolicy);

GetRule(GetRuleRegionSecurityPolicyRequest, CallSettings)

public virtual SecurityPolicyRule GetRule(GetRuleRegionSecurityPolicyRequest request, CallSettings callSettings = null)

Gets a rule at the specified priority.

Parameters
Name Description
request GetRuleRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SecurityPolicyRule

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
GetRuleRegionSecurityPolicyRequest request = new GetRuleRegionSecurityPolicyRequest
{
    Region = "",
    SecurityPolicy = "",
    Project = "",
    Priority = 0,
};
// Make the request
SecurityPolicyRule response = regionSecurityPoliciesClient.GetRule(request);

GetRule(string, string, string, CallSettings)

public virtual SecurityPolicyRule GetRule(string project, string region, string securityPolicy, CallSettings callSettings = null)

Gets a rule at the specified priority.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to which the queried rule belongs.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SecurityPolicyRule

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
// Make the request
SecurityPolicyRule response = regionSecurityPoliciesClient.GetRule(project, region, securityPolicy);

GetRuleAsync(GetRuleRegionSecurityPolicyRequest, CallSettings)

public virtual Task<SecurityPolicyRule> GetRuleAsync(GetRuleRegionSecurityPolicyRequest request, CallSettings callSettings = null)

Gets a rule at the specified priority.

Parameters
Name Description
request GetRuleRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSecurityPolicyRule

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
GetRuleRegionSecurityPolicyRequest request = new GetRuleRegionSecurityPolicyRequest
{
    Region = "",
    SecurityPolicy = "",
    Project = "",
    Priority = 0,
};
// Make the request
SecurityPolicyRule response = await regionSecurityPoliciesClient.GetRuleAsync(request);

GetRuleAsync(GetRuleRegionSecurityPolicyRequest, CancellationToken)

public virtual Task<SecurityPolicyRule> GetRuleAsync(GetRuleRegionSecurityPolicyRequest request, CancellationToken cancellationToken)

Gets a rule at the specified priority.

Parameters
Name Description
request GetRuleRegionSecurityPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSecurityPolicyRule

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
GetRuleRegionSecurityPolicyRequest request = new GetRuleRegionSecurityPolicyRequest
{
    Region = "",
    SecurityPolicy = "",
    Project = "",
    Priority = 0,
};
// Make the request
SecurityPolicyRule response = await regionSecurityPoliciesClient.GetRuleAsync(request);

GetRuleAsync(string, string, string, CallSettings)

public virtual Task<SecurityPolicyRule> GetRuleAsync(string project, string region, string securityPolicy, CallSettings callSettings = null)

Gets a rule at the specified priority.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to which the queried rule belongs.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSecurityPolicyRule

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
// Make the request
SecurityPolicyRule response = await regionSecurityPoliciesClient.GetRuleAsync(project, region, securityPolicy);

GetRuleAsync(string, string, string, CancellationToken)

public virtual Task<SecurityPolicyRule> GetRuleAsync(string project, string region, string securityPolicy, CancellationToken cancellationToken)

Gets a rule at the specified priority.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to which the queried rule belongs.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSecurityPolicyRule

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
// Make the request
SecurityPolicyRule response = await regionSecurityPoliciesClient.GetRuleAsync(project, region, securityPolicy);

Insert(InsertRegionSecurityPolicyRequest, CallSettings)

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

Creates a new policy in the specified project using the data included in the request.

Parameters
Name Description
request InsertRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
InsertRegionSecurityPolicyRequest request = new InsertRegionSecurityPolicyRequest
{
    RequestId = "",
    Region = "",
    SecurityPolicyResource = new SecurityPolicy(),
    Project = "",
    ValidateOnly = false,
};
// Make the request
lro::Operation<Operation, Operation> response = regionSecurityPoliciesClient.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 = regionSecurityPoliciesClient.PollOnceInsert(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

Insert(string, string, SecurityPolicy, CallSettings)

public virtual Operation<Operation, Operation> Insert(string project, string region, SecurityPolicy securityPolicyResource, CallSettings callSettings = null)

Creates a new policy in the specified project using the data included in the request.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicyResource SecurityPolicy

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
SecurityPolicy securityPolicyResource = new SecurityPolicy();
// Make the request
lro::Operation<Operation, Operation> response = regionSecurityPoliciesClient.Insert(project, region, securityPolicyResource);

// 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 = regionSecurityPoliciesClient.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(InsertRegionSecurityPolicyRequest, CallSettings)

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

Creates a new policy in the specified project using the data included in the request.

Parameters
Name Description
request InsertRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
InsertRegionSecurityPolicyRequest request = new InsertRegionSecurityPolicyRequest
{
    RequestId = "",
    Region = "",
    SecurityPolicyResource = new SecurityPolicy(),
    Project = "",
    ValidateOnly = false,
};
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.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 regionSecurityPoliciesClient.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(InsertRegionSecurityPolicyRequest, CancellationToken)

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

Creates a new policy in the specified project using the data included in the request.

Parameters
Name Description
request InsertRegionSecurityPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
InsertRegionSecurityPolicyRequest request = new InsertRegionSecurityPolicyRequest
{
    RequestId = "",
    Region = "",
    SecurityPolicyResource = new SecurityPolicy(),
    Project = "",
    ValidateOnly = false,
};
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.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 regionSecurityPoliciesClient.PollOnceInsertAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

InsertAsync(string, string, SecurityPolicy, CallSettings)

public virtual Task<Operation<Operation, Operation>> InsertAsync(string project, string region, SecurityPolicy securityPolicyResource, CallSettings callSettings = null)

Creates a new policy in the specified project using the data included in the request.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicyResource SecurityPolicy

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
SecurityPolicy securityPolicyResource = new SecurityPolicy();
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.InsertAsync(project, region, securityPolicyResource);

// 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 regionSecurityPoliciesClient.PollOnceInsertAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

InsertAsync(string, string, SecurityPolicy, CancellationToken)

public virtual Task<Operation<Operation, Operation>> InsertAsync(string project, string region, SecurityPolicy securityPolicyResource, CancellationToken cancellationToken)

Creates a new policy in the specified project using the data included in the request.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicyResource SecurityPolicy

The body resource for this request

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
SecurityPolicy securityPolicyResource = new SecurityPolicy();
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.InsertAsync(project, region, securityPolicyResource);

// 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 regionSecurityPoliciesClient.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(ListRegionSecurityPoliciesRequest, CallSettings)

public virtual PagedEnumerable<SecurityPolicyList, SecurityPolicy> List(ListRegionSecurityPoliciesRequest request, CallSettings callSettings = null)

List all the policies that have been configured for the specified project and region.

Parameters
Name Description
request ListRegionSecurityPoliciesRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableSecurityPolicyListSecurityPolicy

A pageable sequence of SecurityPolicy resources.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
ListRegionSecurityPoliciesRequest request = new ListRegionSecurityPoliciesRequest
{
    Region = "",
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedEnumerable<SecurityPolicyList, SecurityPolicy> response = regionSecurityPoliciesClient.List(request);

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

List(string, string, string, int?, CallSettings)

public virtual PagedEnumerable<SecurityPolicyList, SecurityPolicy> List(string project, string region, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List all the policies that have been configured for the specified project and region.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableSecurityPolicyListSecurityPolicy

A pageable sequence of SecurityPolicy resources.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
// Make the request
PagedEnumerable<SecurityPolicyList, SecurityPolicy> response = regionSecurityPoliciesClient.List(project, region);

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

public virtual PagedAsyncEnumerable<SecurityPolicyList, SecurityPolicy> ListAsync(ListRegionSecurityPoliciesRequest request, CallSettings callSettings = null)

List all the policies that have been configured for the specified project and region.

Parameters
Name Description
request ListRegionSecurityPoliciesRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableSecurityPolicyListSecurityPolicy

A pageable asynchronous sequence of SecurityPolicy resources.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
ListRegionSecurityPoliciesRequest request = new ListRegionSecurityPoliciesRequest
{
    Region = "",
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedAsyncEnumerable<SecurityPolicyList, SecurityPolicy> response = regionSecurityPoliciesClient.ListAsync(request);

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

ListAsync(string, string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<SecurityPolicyList, SecurityPolicy> ListAsync(string project, string region, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List all the policies that have been configured for the specified project and region.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableSecurityPolicyListSecurityPolicy

A pageable asynchronous sequence of SecurityPolicy resources.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
// Make the request
PagedAsyncEnumerable<SecurityPolicyList, SecurityPolicy> response = regionSecurityPoliciesClient.ListAsync(project, region);

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

Patch(PatchRegionSecurityPolicyRequest, CallSettings)

public virtual Operation<Operation, Operation> Patch(PatchRegionSecurityPolicyRequest request, CallSettings callSettings = null)

Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.

Parameters
Name Description
request PatchRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
PatchRegionSecurityPolicyRequest request = new PatchRegionSecurityPolicyRequest
{
    RequestId = "",
    Region = "",
    SecurityPolicy = "",
    SecurityPolicyResource = new SecurityPolicy(),
    Project = "",
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = regionSecurityPoliciesClient.Patch(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 = regionSecurityPoliciesClient.PollOncePatch(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;
}

Patch(string, string, string, SecurityPolicy, CallSettings)

public virtual Operation<Operation, Operation> Patch(string project, string region, string securityPolicy, SecurityPolicy securityPolicyResource, CallSettings callSettings = null)

Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to update.

securityPolicyResource SecurityPolicy

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
SecurityPolicy securityPolicyResource = new SecurityPolicy();
// Make the request
lro::Operation<Operation, Operation> response = regionSecurityPoliciesClient.Patch(project, region, securityPolicy, securityPolicyResource);

// 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 = regionSecurityPoliciesClient.PollOncePatch(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;
}

PatchAsync(PatchRegionSecurityPolicyRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> PatchAsync(PatchRegionSecurityPolicyRequest request, CallSettings callSettings = null)

Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.

Parameters
Name Description
request PatchRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
PatchRegionSecurityPolicyRequest request = new PatchRegionSecurityPolicyRequest
{
    RequestId = "",
    Region = "",
    SecurityPolicy = "",
    SecurityPolicyResource = new SecurityPolicy(),
    Project = "",
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.PatchAsync(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 regionSecurityPoliciesClient.PollOncePatchAsync(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;
}

PatchAsync(PatchRegionSecurityPolicyRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> PatchAsync(PatchRegionSecurityPolicyRequest request, CancellationToken cancellationToken)

Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.

Parameters
Name Description
request PatchRegionSecurityPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
PatchRegionSecurityPolicyRequest request = new PatchRegionSecurityPolicyRequest
{
    RequestId = "",
    Region = "",
    SecurityPolicy = "",
    SecurityPolicyResource = new SecurityPolicy(),
    Project = "",
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.PatchAsync(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 regionSecurityPoliciesClient.PollOncePatchAsync(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;
}

PatchAsync(string, string, string, SecurityPolicy, CallSettings)

public virtual Task<Operation<Operation, Operation>> PatchAsync(string project, string region, string securityPolicy, SecurityPolicy securityPolicyResource, CallSettings callSettings = null)

Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to update.

securityPolicyResource SecurityPolicy

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
SecurityPolicy securityPolicyResource = new SecurityPolicy();
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.PatchAsync(project, region, securityPolicy, securityPolicyResource);

// 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 regionSecurityPoliciesClient.PollOncePatchAsync(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;
}

PatchAsync(string, string, string, SecurityPolicy, CancellationToken)

public virtual Task<Operation<Operation, Operation>> PatchAsync(string project, string region, string securityPolicy, SecurityPolicy securityPolicyResource, CancellationToken cancellationToken)

Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to update.

securityPolicyResource SecurityPolicy

The body resource for this request

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
SecurityPolicy securityPolicyResource = new SecurityPolicy();
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.PatchAsync(project, region, securityPolicy, securityPolicyResource);

// 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 regionSecurityPoliciesClient.PollOncePatchAsync(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;
}

PatchRule(PatchRuleRegionSecurityPolicyRequest, CallSettings)

public virtual Operation<Operation, Operation> PatchRule(PatchRuleRegionSecurityPolicyRequest request, CallSettings callSettings = null)

Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.

Parameters
Name Description
request PatchRuleRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
PatchRuleRegionSecurityPolicyRequest request = new PatchRuleRegionSecurityPolicyRequest
{
    Region = "",
    SecurityPolicy = "",
    Project = "",
    ValidateOnly = false,
    SecurityPolicyRuleResource = new SecurityPolicyRule(),
    Priority = 0,
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = regionSecurityPoliciesClient.PatchRule(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 = regionSecurityPoliciesClient.PollOncePatchRule(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;
}

PatchRule(string, string, string, SecurityPolicyRule, CallSettings)

public virtual Operation<Operation, Operation> PatchRule(string project, string region, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, CallSettings callSettings = null)

Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to update.

securityPolicyRuleResource SecurityPolicyRule

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
SecurityPolicyRule securityPolicyRuleResource = new SecurityPolicyRule();
// Make the request
lro::Operation<Operation, Operation> response = regionSecurityPoliciesClient.PatchRule(project, region, securityPolicy, securityPolicyRuleResource);

// 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 = regionSecurityPoliciesClient.PollOncePatchRule(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;
}

PatchRuleAsync(PatchRuleRegionSecurityPolicyRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> PatchRuleAsync(PatchRuleRegionSecurityPolicyRequest request, CallSettings callSettings = null)

Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.

Parameters
Name Description
request PatchRuleRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
PatchRuleRegionSecurityPolicyRequest request = new PatchRuleRegionSecurityPolicyRequest
{
    Region = "",
    SecurityPolicy = "",
    Project = "",
    ValidateOnly = false,
    SecurityPolicyRuleResource = new SecurityPolicyRule(),
    Priority = 0,
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.PatchRuleAsync(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 regionSecurityPoliciesClient.PollOncePatchRuleAsync(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;
}

PatchRuleAsync(PatchRuleRegionSecurityPolicyRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> PatchRuleAsync(PatchRuleRegionSecurityPolicyRequest request, CancellationToken cancellationToken)

Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.

Parameters
Name Description
request PatchRuleRegionSecurityPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
PatchRuleRegionSecurityPolicyRequest request = new PatchRuleRegionSecurityPolicyRequest
{
    Region = "",
    SecurityPolicy = "",
    Project = "",
    ValidateOnly = false,
    SecurityPolicyRuleResource = new SecurityPolicyRule(),
    Priority = 0,
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.PatchRuleAsync(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 regionSecurityPoliciesClient.PollOncePatchRuleAsync(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;
}

PatchRuleAsync(string, string, string, SecurityPolicyRule, CallSettings)

public virtual Task<Operation<Operation, Operation>> PatchRuleAsync(string project, string region, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, CallSettings callSettings = null)

Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to update.

securityPolicyRuleResource SecurityPolicyRule

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
SecurityPolicyRule securityPolicyRuleResource = new SecurityPolicyRule();
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.PatchRuleAsync(project, region, securityPolicy, securityPolicyRuleResource);

// 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 regionSecurityPoliciesClient.PollOncePatchRuleAsync(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;
}

PatchRuleAsync(string, string, string, SecurityPolicyRule, CancellationToken)

public virtual Task<Operation<Operation, Operation>> PatchRuleAsync(string project, string region, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, CancellationToken cancellationToken)

Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to update.

securityPolicyRuleResource SecurityPolicyRule

The body resource for this request

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
SecurityPolicyRule securityPolicyRuleResource = new SecurityPolicyRule();
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.PatchRuleAsync(project, region, securityPolicy, securityPolicyRuleResource);

// 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 regionSecurityPoliciesClient.PollOncePatchRuleAsync(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;
}

PollOnceAddRule(string, CallSettings)

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

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The result of polling the operation.

PollOnceAddRuleAsync(string, CallSettings)

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

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A task representing the result of polling the operation.

PollOnceDelete(string, CallSettings)

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

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The result of polling the operation.

PollOnceDeleteAsync(string, CallSettings)

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

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A task representing the result of polling the operation.

PollOnceInsert(string, CallSettings)

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

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The result of polling the operation.

PollOnceInsertAsync(string, CallSettings)

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

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A task representing the result of polling the operation.

PollOncePatch(string, CallSettings)

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

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The result of polling the operation.

PollOncePatchAsync(string, CallSettings)

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

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A task representing the result of polling the operation.

PollOncePatchRule(string, CallSettings)

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

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The result of polling the operation.

PollOncePatchRuleAsync(string, CallSettings)

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

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A task representing the result of polling the operation.

PollOnceRemoveRule(string, CallSettings)

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

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The result of polling the operation.

PollOnceRemoveRuleAsync(string, CallSettings)

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

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A task representing the result of polling the operation.

PollOnceSetLabels(string, CallSettings)

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

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The result of polling the operation.

PollOnceSetLabelsAsync(string, CallSettings)

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

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A task representing the result of polling the operation.

RemoveRule(RemoveRuleRegionSecurityPolicyRequest, CallSettings)

public virtual Operation<Operation, Operation> RemoveRule(RemoveRuleRegionSecurityPolicyRequest request, CallSettings callSettings = null)

Deletes a rule at the specified priority.

Parameters
Name Description
request RemoveRuleRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
RemoveRuleRegionSecurityPolicyRequest request = new RemoveRuleRegionSecurityPolicyRequest
{
    Region = "",
    SecurityPolicy = "",
    Project = "",
    Priority = 0,
};
// Make the request
lro::Operation<Operation, Operation> response = regionSecurityPoliciesClient.RemoveRule(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 = regionSecurityPoliciesClient.PollOnceRemoveRule(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;
}

RemoveRule(string, string, string, CallSettings)

public virtual Operation<Operation, Operation> RemoveRule(string project, string region, string securityPolicy, CallSettings callSettings = null)

Deletes a rule at the specified priority.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
// Make the request
lro::Operation<Operation, Operation> response = regionSecurityPoliciesClient.RemoveRule(project, region, securityPolicy);

// 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 = regionSecurityPoliciesClient.PollOnceRemoveRule(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;
}

RemoveRuleAsync(RemoveRuleRegionSecurityPolicyRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> RemoveRuleAsync(RemoveRuleRegionSecurityPolicyRequest request, CallSettings callSettings = null)

Deletes a rule at the specified priority.

Parameters
Name Description
request RemoveRuleRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
RemoveRuleRegionSecurityPolicyRequest request = new RemoveRuleRegionSecurityPolicyRequest
{
    Region = "",
    SecurityPolicy = "",
    Project = "",
    Priority = 0,
};
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.RemoveRuleAsync(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 regionSecurityPoliciesClient.PollOnceRemoveRuleAsync(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;
}

RemoveRuleAsync(RemoveRuleRegionSecurityPolicyRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> RemoveRuleAsync(RemoveRuleRegionSecurityPolicyRequest request, CancellationToken cancellationToken)

Deletes a rule at the specified priority.

Parameters
Name Description
request RemoveRuleRegionSecurityPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
RemoveRuleRegionSecurityPolicyRequest request = new RemoveRuleRegionSecurityPolicyRequest
{
    Region = "",
    SecurityPolicy = "",
    Project = "",
    Priority = 0,
};
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.RemoveRuleAsync(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 regionSecurityPoliciesClient.PollOnceRemoveRuleAsync(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;
}

RemoveRuleAsync(string, string, string, CallSettings)

public virtual Task<Operation<Operation, Operation>> RemoveRuleAsync(string project, string region, string securityPolicy, CallSettings callSettings = null)

Deletes a rule at the specified priority.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.RemoveRuleAsync(project, region, securityPolicy);

// 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 regionSecurityPoliciesClient.PollOnceRemoveRuleAsync(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;
}

RemoveRuleAsync(string, string, string, CancellationToken)

public virtual Task<Operation<Operation, Operation>> RemoveRuleAsync(string project, string region, string securityPolicy, CancellationToken cancellationToken)

Deletes a rule at the specified priority.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region scoping this request.

securityPolicy string

Name of the security policy to update.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string securityPolicy = "";
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.RemoveRuleAsync(project, region, securityPolicy);

// 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 regionSecurityPoliciesClient.PollOnceRemoveRuleAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

SetLabels(SetLabelsRegionSecurityPolicyRequest, CallSettings)

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

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

Parameters
Name Description
request SetLabelsRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
SetLabelsRegionSecurityPolicyRequest request = new SetLabelsRegionSecurityPolicyRequest
{
    RequestId = "",
    Region = "",
    Resource = "",
    Project = "",
    RegionSetLabelsRequestResource = new RegionSetLabelsRequest(),
};
// Make the request
lro::Operation<Operation, Operation> response = regionSecurityPoliciesClient.SetLabels(request);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = regionSecurityPoliciesClient.PollOnceSetLabels(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

SetLabels(string, string, string, RegionSetLabelsRequest, CallSettings)

public virtual Operation<Operation, Operation> SetLabels(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, CallSettings callSettings = null)

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

Parameters
Name Description
project string

Project ID for this request.

region string

The region for this request.

resource string

Name or id of the resource for this request.

regionSetLabelsRequestResource RegionSetLabelsRequest

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = RegionSecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
string resource = "";
RegionSetLabelsRequest regionSetLabelsRequestResource = new RegionSetLabelsRequest();
// Make the request
lro::Operation<Operation, Operation> response = regionSecurityPoliciesClient.SetLabels(project, region, resource, regionSetLabelsRequestResource);

// 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 = regionSecurityPoliciesClient.PollOnceSetLabels(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

SetLabelsAsync(SetLabelsRegionSecurityPolicyRequest, CallSettings)

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

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

Parameters
Name Description
request SetLabelsRegionSecurityPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
SetLabelsRegionSecurityPolicyRequest request = new SetLabelsRegionSecurityPolicyRequest
{
    RequestId = "",
    Region = "",
    Resource = "",
    Project = "",
    RegionSetLabelsRequestResource = new RegionSetLabelsRequest(),
};
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.SetLabelsAsync(request);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await regionSecurityPoliciesClient.PollOnceSetLabelsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

SetLabelsAsync(SetLabelsRegionSecurityPolicyRequest, CancellationToken)

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

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

Parameters
Name Description
request SetLabelsRegionSecurityPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
SetLabelsRegionSecurityPolicyRequest request = new SetLabelsRegionSecurityPolicyRequest
{
    RequestId = "",
    Region = "",
    Resource = "",
    Project = "",
    RegionSetLabelsRequestResource = new RegionSetLabelsRequest(),
};
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.SetLabelsAsync(request);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await regionSecurityPoliciesClient.PollOnceSetLabelsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

SetLabelsAsync(string, string, string, RegionSetLabelsRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> SetLabelsAsync(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, CallSettings callSettings = null)

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

Parameters
Name Description
project string

Project ID for this request.

region string

The region for this request.

resource string

Name or id of the resource for this request.

regionSetLabelsRequestResource RegionSetLabelsRequest

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string resource = "";
RegionSetLabelsRequest regionSetLabelsRequestResource = new RegionSetLabelsRequest();
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.SetLabelsAsync(project, region, resource, regionSetLabelsRequestResource);

// 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 regionSecurityPoliciesClient.PollOnceSetLabelsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

SetLabelsAsync(string, string, string, RegionSetLabelsRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> SetLabelsAsync(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, CancellationToken cancellationToken)

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

Parameters
Name Description
project string

Project ID for this request.

region string

The region for this request.

resource string

Name or id of the resource for this request.

regionSetLabelsRequestResource RegionSetLabelsRequest

The body resource for this request

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSecurityPoliciesClient regionSecurityPoliciesClient = await RegionSecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string resource = "";
RegionSetLabelsRequest regionSetLabelsRequestResource = new RegionSetLabelsRequest();
// Make the request
lro::Operation<Operation, Operation> response = await regionSecurityPoliciesClient.SetLabelsAsync(project, region, resource, regionSetLabelsRequestResource);

// 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 regionSecurityPoliciesClient.PollOnceSetLabelsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

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

Returns
Type Description
Task

A task representing the asynchronous shutdown operation.

Remarks

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