Compute Engine v1 API - Class SecurityPoliciesClient (2.15.0)

public abstract class SecurityPoliciesClient

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

SecurityPolicies client wrapper, for convenient use.

Inheritance

object > SecurityPoliciesClient

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Remarks

The SecurityPolicies 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 SecurityPolicies 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 SecurityPolicies 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 SecurityPolicies.SecurityPoliciesClient GrpcClient { get; }

The underlying gRPC SecurityPolicies client

Property Value
Type Description
SecurityPoliciesSecurityPoliciesClient

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(AddRuleSecurityPolicyRequest, CallSettings)

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

Inserts a rule into a security policy.

Parameters
Name Description
request AddRuleSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
AddRuleSecurityPolicyRequest request = new AddRuleSecurityPolicyRequest
{
    SecurityPolicy = "",
    Project = "",
    ValidateOnly = false,
    SecurityPolicyRuleResource = new SecurityPolicyRule(),
};
// Make the request
lro::Operation<Operation, Operation> response = securityPoliciesClient.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 = securityPoliciesClient.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, SecurityPolicyRule, CallSettings)

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

Inserts a rule into a security policy.

Parameters
Name Description
project string

Project ID for 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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
SecurityPolicyRule securityPolicyRuleResource = new SecurityPolicyRule();
// Make the request
lro::Operation<Operation, Operation> response = securityPoliciesClient.AddRule(project, 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 = securityPoliciesClient.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(AddRuleSecurityPolicyRequest, CallSettings)

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

Inserts a rule into a security policy.

Parameters
Name Description
request AddRuleSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
AddRuleSecurityPolicyRequest request = new AddRuleSecurityPolicyRequest
{
    SecurityPolicy = "",
    Project = "",
    ValidateOnly = false,
    SecurityPolicyRuleResource = new SecurityPolicyRule(),
};
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.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 securityPoliciesClient.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(AddRuleSecurityPolicyRequest, CancellationToken)

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

Inserts a rule into a security policy.

Parameters
Name Description
request AddRuleSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
AddRuleSecurityPolicyRequest request = new AddRuleSecurityPolicyRequest
{
    SecurityPolicy = "",
    Project = "",
    ValidateOnly = false,
    SecurityPolicyRuleResource = new SecurityPolicyRule(),
};
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.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 securityPoliciesClient.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, SecurityPolicyRule, CallSettings)

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

Inserts a rule into a security policy.

Parameters
Name Description
project string

Project ID for 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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
SecurityPolicyRule securityPolicyRuleResource = new SecurityPolicyRule();
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.AddRuleAsync(project, 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 securityPoliciesClient.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, SecurityPolicyRule, CancellationToken)

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

Inserts a rule into a security policy.

Parameters
Name Description
project string

Project ID for 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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
SecurityPolicyRule securityPolicyRuleResource = new SecurityPolicyRule();
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.AddRuleAsync(project, 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 securityPoliciesClient.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;
}

AggregatedList(AggregatedListSecurityPoliciesRequest, CallSettings)

public virtual PagedEnumerable<SecurityPoliciesAggregatedList, KeyValuePair<string, SecurityPoliciesScopedList>> AggregatedList(AggregatedListSecurityPoliciesRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request AggregatedListSecurityPoliciesRequest

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
PagedEnumerableSecurityPoliciesAggregatedListKeyValuePairstringSecurityPoliciesScopedList

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

Example
// Create client
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
AggregatedListSecurityPoliciesRequest request = new AggregatedListSecurityPoliciesRequest
{
    OrderBy = "",
    Project = "",
    ServiceProjectNumber = 0L,
    Filter = "",
    IncludeAllScopes = false,
    ReturnPartialSuccess = false,
};
// Make the request
PagedEnumerable<SecurityPoliciesAggregatedList, KeyValuePair<string, SecurityPoliciesScopedList>> response = securityPoliciesClient.AggregatedList(request);

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

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<KeyValuePair<string, SecurityPoliciesScopedList>> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (KeyValuePair<string, SecurityPoliciesScopedList> item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

AggregatedList(string, string, int?, CallSettings)

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

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

Parameters
Name Description
project string

Name of the project 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
PagedEnumerableSecurityPoliciesAggregatedListKeyValuePairstringSecurityPoliciesScopedList

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

Example
// Create client
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
// Make the request
PagedEnumerable<SecurityPoliciesAggregatedList, KeyValuePair<string, SecurityPoliciesScopedList>> response = securityPoliciesClient.AggregatedList(project);

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

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<KeyValuePair<string, SecurityPoliciesScopedList>> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (KeyValuePair<string, SecurityPoliciesScopedList> item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

AggregatedListAsync(AggregatedListSecurityPoliciesRequest, CallSettings)

public virtual PagedAsyncEnumerable<SecurityPoliciesAggregatedList, KeyValuePair<string, SecurityPoliciesScopedList>> AggregatedListAsync(AggregatedListSecurityPoliciesRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request AggregatedListSecurityPoliciesRequest

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
PagedAsyncEnumerableSecurityPoliciesAggregatedListKeyValuePairstringSecurityPoliciesScopedList

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

Example
// Create client
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
AggregatedListSecurityPoliciesRequest request = new AggregatedListSecurityPoliciesRequest
{
    OrderBy = "",
    Project = "",
    ServiceProjectNumber = 0L,
    Filter = "",
    IncludeAllScopes = false,
    ReturnPartialSuccess = false,
};
// Make the request
PagedAsyncEnumerable<SecurityPoliciesAggregatedList, KeyValuePair<string, SecurityPoliciesScopedList>> response = securityPoliciesClient.AggregatedListAsync(request);

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

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<KeyValuePair<string, SecurityPoliciesScopedList>> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (KeyValuePair<string, SecurityPoliciesScopedList> item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

AggregatedListAsync(string, string, int?, CallSettings)

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

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

Parameters
Name Description
project string

Name of the project 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
PagedAsyncEnumerableSecurityPoliciesAggregatedListKeyValuePairstringSecurityPoliciesScopedList

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

Example
// Create client
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
// Make the request
PagedAsyncEnumerable<SecurityPoliciesAggregatedList, KeyValuePair<string, SecurityPoliciesScopedList>> response = securityPoliciesClient.AggregatedListAsync(project);

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

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<KeyValuePair<string, SecurityPoliciesScopedList>> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (KeyValuePair<string, SecurityPoliciesScopedList> item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

Create()

public static SecurityPoliciesClient Create()

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

Returns
Type Description
SecurityPoliciesClient

The created SecurityPoliciesClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskSecurityPoliciesClient

The task representing the created SecurityPoliciesClient.

Delete(DeleteSecurityPolicyRequest, CallSettings)

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

Deletes the specified policy.

Parameters
Name Description
request DeleteSecurityPolicyRequest

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

Delete(string, string, CallSettings)

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

Deletes the specified policy.

Parameters
Name Description
project string

Project ID for 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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
// Make the request
lro::Operation<Operation, Operation> response = securityPoliciesClient.Delete(project, 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 = securityPoliciesClient.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(DeleteSecurityPolicyRequest, CallSettings)

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

Deletes the specified policy.

Parameters
Name Description
request DeleteSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
DeleteSecurityPolicyRequest request = new DeleteSecurityPolicyRequest
{
    RequestId = "",
    SecurityPolicy = "",
    Project = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.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 securityPoliciesClient.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(DeleteSecurityPolicyRequest, CancellationToken)

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

Deletes the specified policy.

Parameters
Name Description
request DeleteSecurityPolicyRequest

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

DeleteAsync(string, string, CallSettings)

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

Deletes the specified policy.

Parameters
Name Description
project string

Project ID for 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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.DeleteAsync(project, 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 securityPoliciesClient.PollOnceDeleteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

DeleteAsync(string, string, CancellationToken)

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

Deletes the specified policy.

Parameters
Name Description
project string

Project ID for 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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.DeleteAsync(project, 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 securityPoliciesClient.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(GetSecurityPolicyRequest, CallSettings)

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

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

Parameters
Name Description
request GetSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
GetSecurityPolicyRequest request = new GetSecurityPolicyRequest
{
    SecurityPolicy = "",
    Project = "",
};
// Make the request
SecurityPolicy response = securityPoliciesClient.Get(request);

Get(string, string, CallSettings)

public virtual SecurityPolicy Get(string project, 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.

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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
// Make the request
SecurityPolicy response = securityPoliciesClient.Get(project, securityPolicy);

GetAsync(GetSecurityPolicyRequest, CallSettings)

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

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

Parameters
Name Description
request GetSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
GetSecurityPolicyRequest request = new GetSecurityPolicyRequest
{
    SecurityPolicy = "",
    Project = "",
};
// Make the request
SecurityPolicy response = await securityPoliciesClient.GetAsync(request);

GetAsync(GetSecurityPolicyRequest, CancellationToken)

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

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

Parameters
Name Description
request GetSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
GetSecurityPolicyRequest request = new GetSecurityPolicyRequest
{
    SecurityPolicy = "",
    Project = "",
};
// Make the request
SecurityPolicy response = await securityPoliciesClient.GetAsync(request);

GetAsync(string, string, CallSettings)

public virtual Task<SecurityPolicy> GetAsync(string project, 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.

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
// Make the request
SecurityPolicy response = await securityPoliciesClient.GetAsync(project, securityPolicy);

GetAsync(string, string, CancellationToken)

public virtual Task<SecurityPolicy> GetAsync(string project, 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.

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
// Make the request
SecurityPolicy response = await securityPoliciesClient.GetAsync(project, securityPolicy);

GetRule(GetRuleSecurityPolicyRequest, CallSettings)

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

Gets a rule at the specified priority.

Parameters
Name Description
request GetRuleSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
GetRuleSecurityPolicyRequest request = new GetRuleSecurityPolicyRequest
{
    SecurityPolicy = "",
    Project = "",
    Priority = 0,
};
// Make the request
SecurityPolicyRule response = securityPoliciesClient.GetRule(request);

GetRule(string, string, CallSettings)

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

Gets a rule at the specified priority.

Parameters
Name Description
project string

Project ID for 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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
// Make the request
SecurityPolicyRule response = securityPoliciesClient.GetRule(project, securityPolicy);

GetRuleAsync(GetRuleSecurityPolicyRequest, CallSettings)

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

Gets a rule at the specified priority.

Parameters
Name Description
request GetRuleSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
GetRuleSecurityPolicyRequest request = new GetRuleSecurityPolicyRequest
{
    SecurityPolicy = "",
    Project = "",
    Priority = 0,
};
// Make the request
SecurityPolicyRule response = await securityPoliciesClient.GetRuleAsync(request);

GetRuleAsync(GetRuleSecurityPolicyRequest, CancellationToken)

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

Gets a rule at the specified priority.

Parameters
Name Description
request GetRuleSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
GetRuleSecurityPolicyRequest request = new GetRuleSecurityPolicyRequest
{
    SecurityPolicy = "",
    Project = "",
    Priority = 0,
};
// Make the request
SecurityPolicyRule response = await securityPoliciesClient.GetRuleAsync(request);

GetRuleAsync(string, string, CallSettings)

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

Gets a rule at the specified priority.

Parameters
Name Description
project string

Project ID for 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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
// Make the request
SecurityPolicyRule response = await securityPoliciesClient.GetRuleAsync(project, securityPolicy);

GetRuleAsync(string, string, CancellationToken)

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

Gets a rule at the specified priority.

Parameters
Name Description
project string

Project ID for 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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
// Make the request
SecurityPolicyRule response = await securityPoliciesClient.GetRuleAsync(project, securityPolicy);

Insert(InsertSecurityPolicyRequest, CallSettings)

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

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

Parameters
Name Description
request InsertSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
InsertSecurityPolicyRequest request = new InsertSecurityPolicyRequest
{
    RequestId = "",
    SecurityPolicyResource = new SecurityPolicy(),
    Project = "",
    ValidateOnly = false,
};
// Make the request
lro::Operation<Operation, Operation> response = securityPoliciesClient.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 = securityPoliciesClient.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, SecurityPolicy, CallSettings)

public virtual Operation<Operation, Operation> Insert(string project, 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.

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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
SecurityPolicy securityPolicyResource = new SecurityPolicy();
// Make the request
lro::Operation<Operation, Operation> response = securityPoliciesClient.Insert(project, 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 = securityPoliciesClient.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(InsertSecurityPolicyRequest, CallSettings)

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

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

Parameters
Name Description
request InsertSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
InsertSecurityPolicyRequest request = new InsertSecurityPolicyRequest
{
    RequestId = "",
    SecurityPolicyResource = new SecurityPolicy(),
    Project = "",
    ValidateOnly = false,
};
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.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 securityPoliciesClient.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(InsertSecurityPolicyRequest, CancellationToken)

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

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

Parameters
Name Description
request InsertSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
InsertSecurityPolicyRequest request = new InsertSecurityPolicyRequest
{
    RequestId = "",
    SecurityPolicyResource = new SecurityPolicy(),
    Project = "",
    ValidateOnly = false,
};
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.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 securityPoliciesClient.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, SecurityPolicy, CallSettings)

public virtual Task<Operation<Operation, Operation>> InsertAsync(string project, 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.

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
SecurityPolicy securityPolicyResource = new SecurityPolicy();
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.InsertAsync(project, 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 securityPoliciesClient.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, SecurityPolicy, CancellationToken)

public virtual Task<Operation<Operation, Operation>> InsertAsync(string project, 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.

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
SecurityPolicy securityPolicyResource = new SecurityPolicy();
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.InsertAsync(project, 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 securityPoliciesClient.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(ListSecurityPoliciesRequest, CallSettings)

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

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

Parameters
Name Description
request ListSecurityPoliciesRequest

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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
ListSecurityPoliciesRequest request = new ListSecurityPoliciesRequest
{
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedEnumerable<SecurityPolicyList, SecurityPolicy> response = securityPoliciesClient.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, int?, CallSettings)

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

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

Parameters
Name Description
project string

Project ID for this request.

pageToken string

The token returned from the previous request. A value of 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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
// Make the request
PagedEnumerable<SecurityPolicyList, SecurityPolicy> response = securityPoliciesClient.List(project);

// 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(ListSecurityPoliciesRequest, CallSettings)

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

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

Parameters
Name Description
request ListSecurityPoliciesRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
ListSecurityPoliciesRequest request = new ListSecurityPoliciesRequest
{
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedAsyncEnumerable<SecurityPolicyList, SecurityPolicy> response = securityPoliciesClient.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, int?, CallSettings)

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

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

Parameters
Name Description
project string

Project ID for this request.

pageToken string

The token returned from the previous request. A value of 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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
// Make the request
PagedAsyncEnumerable<SecurityPolicyList, SecurityPolicy> response = securityPoliciesClient.ListAsync(project);

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

ListPreconfiguredExpressionSets(ListPreconfiguredExpressionSetsSecurityPoliciesRequest, CallSettings)

public virtual SecurityPoliciesListPreconfiguredExpressionSetsResponse ListPreconfiguredExpressionSets(ListPreconfiguredExpressionSetsSecurityPoliciesRequest request, CallSettings callSettings = null)

Gets the current list of preconfigured Web Application Firewall (WAF) expressions.

Parameters
Name Description
request ListPreconfiguredExpressionSetsSecurityPoliciesRequest

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
SecurityPoliciesListPreconfiguredExpressionSetsResponse

The RPC response.

Example
// Create client
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
ListPreconfiguredExpressionSetsSecurityPoliciesRequest request = new ListPreconfiguredExpressionSetsSecurityPoliciesRequest
{
    PageToken = "",
    MaxResults = 0U,
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
SecurityPoliciesListPreconfiguredExpressionSetsResponse response = securityPoliciesClient.ListPreconfiguredExpressionSets(request);

ListPreconfiguredExpressionSets(string, CallSettings)

public virtual SecurityPoliciesListPreconfiguredExpressionSetsResponse ListPreconfiguredExpressionSets(string project, CallSettings callSettings = null)

Gets the current list of preconfigured Web Application Firewall (WAF) expressions.

Parameters
Name Description
project string

Project ID for this request.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SecurityPoliciesListPreconfiguredExpressionSetsResponse

The RPC response.

Example
// Create client
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
// Make the request
SecurityPoliciesListPreconfiguredExpressionSetsResponse response = securityPoliciesClient.ListPreconfiguredExpressionSets(project);

ListPreconfiguredExpressionSetsAsync(ListPreconfiguredExpressionSetsSecurityPoliciesRequest, CallSettings)

public virtual Task<SecurityPoliciesListPreconfiguredExpressionSetsResponse> ListPreconfiguredExpressionSetsAsync(ListPreconfiguredExpressionSetsSecurityPoliciesRequest request, CallSettings callSettings = null)

Gets the current list of preconfigured Web Application Firewall (WAF) expressions.

Parameters
Name Description
request ListPreconfiguredExpressionSetsSecurityPoliciesRequest

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
TaskSecurityPoliciesListPreconfiguredExpressionSetsResponse

A Task containing the RPC response.

Example
// Create client
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
ListPreconfiguredExpressionSetsSecurityPoliciesRequest request = new ListPreconfiguredExpressionSetsSecurityPoliciesRequest
{
    PageToken = "",
    MaxResults = 0U,
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
SecurityPoliciesListPreconfiguredExpressionSetsResponse response = await securityPoliciesClient.ListPreconfiguredExpressionSetsAsync(request);

ListPreconfiguredExpressionSetsAsync(ListPreconfiguredExpressionSetsSecurityPoliciesRequest, CancellationToken)

public virtual Task<SecurityPoliciesListPreconfiguredExpressionSetsResponse> ListPreconfiguredExpressionSetsAsync(ListPreconfiguredExpressionSetsSecurityPoliciesRequest request, CancellationToken cancellationToken)

Gets the current list of preconfigured Web Application Firewall (WAF) expressions.

Parameters
Name Description
request ListPreconfiguredExpressionSetsSecurityPoliciesRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSecurityPoliciesListPreconfiguredExpressionSetsResponse

A Task containing the RPC response.

Example
// Create client
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
ListPreconfiguredExpressionSetsSecurityPoliciesRequest request = new ListPreconfiguredExpressionSetsSecurityPoliciesRequest
{
    PageToken = "",
    MaxResults = 0U,
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
SecurityPoliciesListPreconfiguredExpressionSetsResponse response = await securityPoliciesClient.ListPreconfiguredExpressionSetsAsync(request);

ListPreconfiguredExpressionSetsAsync(string, CallSettings)

public virtual Task<SecurityPoliciesListPreconfiguredExpressionSetsResponse> ListPreconfiguredExpressionSetsAsync(string project, CallSettings callSettings = null)

Gets the current list of preconfigured Web Application Firewall (WAF) expressions.

Parameters
Name Description
project string

Project ID for this request.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSecurityPoliciesListPreconfiguredExpressionSetsResponse

A Task containing the RPC response.

Example
// Create client
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
// Make the request
SecurityPoliciesListPreconfiguredExpressionSetsResponse response = await securityPoliciesClient.ListPreconfiguredExpressionSetsAsync(project);

ListPreconfiguredExpressionSetsAsync(string, CancellationToken)

public virtual Task<SecurityPoliciesListPreconfiguredExpressionSetsResponse> ListPreconfiguredExpressionSetsAsync(string project, CancellationToken cancellationToken)

Gets the current list of preconfigured Web Application Firewall (WAF) expressions.

Parameters
Name Description
project string

Project ID for this request.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSecurityPoliciesListPreconfiguredExpressionSetsResponse

A Task containing the RPC response.

Example
// Create client
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
// Make the request
SecurityPoliciesListPreconfiguredExpressionSetsResponse response = await securityPoliciesClient.ListPreconfiguredExpressionSetsAsync(project);

Patch(PatchSecurityPolicyRequest, CallSettings)

public virtual Operation<Operation, Operation> Patch(PatchSecurityPolicyRequest 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 PatchSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
PatchSecurityPolicyRequest request = new PatchSecurityPolicyRequest
{
    RequestId = "",
    SecurityPolicy = "",
    SecurityPolicyResource = new SecurityPolicy(),
    Project = "",
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = securityPoliciesClient.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 = securityPoliciesClient.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, SecurityPolicy, CallSettings)

public virtual Operation<Operation, Operation> Patch(string project, 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.

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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
SecurityPolicy securityPolicyResource = new SecurityPolicy();
// Make the request
lro::Operation<Operation, Operation> response = securityPoliciesClient.Patch(project, 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 = securityPoliciesClient.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(PatchSecurityPolicyRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> PatchAsync(PatchSecurityPolicyRequest 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 PatchSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
PatchSecurityPolicyRequest request = new PatchSecurityPolicyRequest
{
    RequestId = "",
    SecurityPolicy = "",
    SecurityPolicyResource = new SecurityPolicy(),
    Project = "",
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.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 securityPoliciesClient.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(PatchSecurityPolicyRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> PatchAsync(PatchSecurityPolicyRequest 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 PatchSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
PatchSecurityPolicyRequest request = new PatchSecurityPolicyRequest
{
    RequestId = "",
    SecurityPolicy = "",
    SecurityPolicyResource = new SecurityPolicy(),
    Project = "",
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.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 securityPoliciesClient.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, SecurityPolicy, CallSettings)

public virtual Task<Operation<Operation, Operation>> PatchAsync(string project, 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.

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
SecurityPolicy securityPolicyResource = new SecurityPolicy();
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.PatchAsync(project, 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 securityPoliciesClient.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, SecurityPolicy, CancellationToken)

public virtual Task<Operation<Operation, Operation>> PatchAsync(string project, 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.

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
SecurityPolicy securityPolicyResource = new SecurityPolicy();
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.PatchAsync(project, 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 securityPoliciesClient.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(PatchRuleSecurityPolicyRequest, CallSettings)

public virtual Operation<Operation, Operation> PatchRule(PatchRuleSecurityPolicyRequest 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 PatchRuleSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
PatchRuleSecurityPolicyRequest request = new PatchRuleSecurityPolicyRequest
{
    SecurityPolicy = "",
    Project = "",
    ValidateOnly = false,
    SecurityPolicyRuleResource = new SecurityPolicyRule(),
    Priority = 0,
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = securityPoliciesClient.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 = securityPoliciesClient.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, SecurityPolicyRule, CallSettings)

public virtual Operation<Operation, Operation> PatchRule(string project, 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.

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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
SecurityPolicyRule securityPolicyRuleResource = new SecurityPolicyRule();
// Make the request
lro::Operation<Operation, Operation> response = securityPoliciesClient.PatchRule(project, 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 = securityPoliciesClient.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(PatchRuleSecurityPolicyRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> PatchRuleAsync(PatchRuleSecurityPolicyRequest 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 PatchRuleSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
PatchRuleSecurityPolicyRequest request = new PatchRuleSecurityPolicyRequest
{
    SecurityPolicy = "",
    Project = "",
    ValidateOnly = false,
    SecurityPolicyRuleResource = new SecurityPolicyRule(),
    Priority = 0,
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.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 securityPoliciesClient.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(PatchRuleSecurityPolicyRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> PatchRuleAsync(PatchRuleSecurityPolicyRequest 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 PatchRuleSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
PatchRuleSecurityPolicyRequest request = new PatchRuleSecurityPolicyRequest
{
    SecurityPolicy = "",
    Project = "",
    ValidateOnly = false,
    SecurityPolicyRuleResource = new SecurityPolicyRule(),
    Priority = 0,
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.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 securityPoliciesClient.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, SecurityPolicyRule, CallSettings)

public virtual Task<Operation<Operation, Operation>> PatchRuleAsync(string project, 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.

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
SecurityPolicyRule securityPolicyRuleResource = new SecurityPolicyRule();
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.PatchRuleAsync(project, 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 securityPoliciesClient.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, SecurityPolicyRule, CancellationToken)

public virtual Task<Operation<Operation, Operation>> PatchRuleAsync(string project, 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.

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
SecurityPolicyRule securityPolicyRuleResource = new SecurityPolicyRule();
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.PatchRuleAsync(project, 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 securityPoliciesClient.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(RemoveRuleSecurityPolicyRequest, CallSettings)

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

Deletes a rule at the specified priority.

Parameters
Name Description
request RemoveRuleSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
RemoveRuleSecurityPolicyRequest request = new RemoveRuleSecurityPolicyRequest
{
    SecurityPolicy = "",
    Project = "",
    Priority = 0,
};
// Make the request
lro::Operation<Operation, Operation> response = securityPoliciesClient.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 = securityPoliciesClient.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, CallSettings)

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

Deletes a rule at the specified priority.

Parameters
Name Description
project string

Project ID for 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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
// Make the request
lro::Operation<Operation, Operation> response = securityPoliciesClient.RemoveRule(project, 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 = securityPoliciesClient.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(RemoveRuleSecurityPolicyRequest, CallSettings)

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

Deletes a rule at the specified priority.

Parameters
Name Description
request RemoveRuleSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
RemoveRuleSecurityPolicyRequest request = new RemoveRuleSecurityPolicyRequest
{
    SecurityPolicy = "",
    Project = "",
    Priority = 0,
};
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.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 securityPoliciesClient.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(RemoveRuleSecurityPolicyRequest, CancellationToken)

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

Deletes a rule at the specified priority.

Parameters
Name Description
request RemoveRuleSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
RemoveRuleSecurityPolicyRequest request = new RemoveRuleSecurityPolicyRequest
{
    SecurityPolicy = "",
    Project = "",
    Priority = 0,
};
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.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 securityPoliciesClient.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, CallSettings)

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

Deletes a rule at the specified priority.

Parameters
Name Description
project string

Project ID for 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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.RemoveRuleAsync(project, 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 securityPoliciesClient.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, CancellationToken)

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

Deletes a rule at the specified priority.

Parameters
Name Description
project string

Project ID for 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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string securityPolicy = "";
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.RemoveRuleAsync(project, 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 securityPoliciesClient.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(SetLabelsSecurityPolicyRequest, CallSettings)

public virtual Operation<Operation, Operation> SetLabels(SetLabelsSecurityPolicyRequest 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 SetLabelsSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
SetLabelsSecurityPolicyRequest request = new SetLabelsSecurityPolicyRequest
{
    Resource = "",
    Project = "",
    GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(),
};
// Make the request
lro::Operation<Operation, Operation> response = securityPoliciesClient.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 = securityPoliciesClient.PollOnceSetLabels(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

SetLabels(string, string, GlobalSetLabelsRequest, CallSettings)

public virtual Operation<Operation, Operation> SetLabels(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, CallSettings callSettings = null)

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

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

globalSetLabelsRequestResource GlobalSetLabelsRequest

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
SecurityPoliciesClient securityPoliciesClient = SecurityPoliciesClient.Create();
// Initialize request argument(s)
string project = "";
string resource = "";
GlobalSetLabelsRequest globalSetLabelsRequestResource = new GlobalSetLabelsRequest();
// Make the request
lro::Operation<Operation, Operation> response = securityPoliciesClient.SetLabels(project, resource, globalSetLabelsRequestResource);

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

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = securityPoliciesClient.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(SetLabelsSecurityPolicyRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> SetLabelsAsync(SetLabelsSecurityPolicyRequest 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 SetLabelsSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
SetLabelsSecurityPolicyRequest request = new SetLabelsSecurityPolicyRequest
{
    Resource = "",
    Project = "",
    GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(),
};
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.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 securityPoliciesClient.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(SetLabelsSecurityPolicyRequest, CancellationToken)

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

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

Parameters
Name Description
request SetLabelsSecurityPolicyRequest

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
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
SetLabelsSecurityPolicyRequest request = new SetLabelsSecurityPolicyRequest
{
    Resource = "",
    Project = "",
    GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(),
};
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.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 securityPoliciesClient.PollOnceSetLabelsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

SetLabelsAsync(string, string, GlobalSetLabelsRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, CallSettings callSettings = null)

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

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

globalSetLabelsRequestResource GlobalSetLabelsRequest

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string resource = "";
GlobalSetLabelsRequest globalSetLabelsRequestResource = new GlobalSetLabelsRequest();
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.SetLabelsAsync(project, resource, globalSetLabelsRequestResource);

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

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

SetLabelsAsync(string, string, GlobalSetLabelsRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, CancellationToken cancellationToken)

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

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

globalSetLabelsRequestResource GlobalSetLabelsRequest

The body resource for this request

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SecurityPoliciesClient securityPoliciesClient = await SecurityPoliciesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string resource = "";
GlobalSetLabelsRequest globalSetLabelsRequestResource = new GlobalSetLabelsRequest();
// Make the request
lro::Operation<Operation, Operation> response = await securityPoliciesClient.SetLabelsAsync(project, resource, globalSetLabelsRequestResource);

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

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await securityPoliciesClient.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.