Network Connectivity v1 API - Class PolicyBasedRoutingServiceClient (2.9.0)

public abstract class PolicyBasedRoutingServiceClient

Reference documentation and code samples for the Network Connectivity v1 API class PolicyBasedRoutingServiceClient.

PolicyBasedRoutingService client wrapper, for convenient use.

Inheritance

object > PolicyBasedRoutingServiceClient

Namespace

Google.Cloud.NetworkConnectivity.V1

Assembly

Google.Cloud.NetworkConnectivity.V1.dll

Remarks

Policy-Based Routing allows GCP customers to specify flexibile routing policies for Layer 4 traffic traversing through the connected service.

Properties

CreatePolicyBasedRouteOperationsClient

public virtual OperationsClient CreatePolicyBasedRouteOperationsClient { get; }

The long-running operations client for CreatePolicyBasedRoute.

Property Value
Type Description
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default PolicyBasedRoutingService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default PolicyBasedRoutingService scopes are:

DeletePolicyBasedRouteOperationsClient

public virtual OperationsClient DeletePolicyBasedRouteOperationsClient { get; }

The long-running operations client for DeletePolicyBasedRoute.

Property Value
Type Description
OperationsClient

GrpcClient

public virtual PolicyBasedRoutingService.PolicyBasedRoutingServiceClient GrpcClient { get; }

The underlying gRPC PolicyBasedRoutingService client

Property Value
Type Description
PolicyBasedRoutingServicePolicyBasedRoutingServiceClient

IAMPolicyClient

public virtual IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
Type Description
IAMPolicyClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static PolicyBasedRoutingServiceClient Create()

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

Returns
Type Description
PolicyBasedRoutingServiceClient

The created PolicyBasedRoutingServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskPolicyBasedRoutingServiceClient

The task representing the created PolicyBasedRoutingServiceClient.

CreatePolicyBasedRoute(LocationName, PolicyBasedRoute, string, CallSettings)

public virtual Operation<PolicyBasedRoute, OperationMetadata> CreatePolicyBasedRoute(LocationName parent, PolicyBasedRoute policyBasedRoute, string policyBasedRouteId, CallSettings callSettings = null)

Creates a new PolicyBasedRoute in a given project and location.

Parameters
Name Description
parent LocationName

Required. The parent resource's name of the PolicyBasedRoute.

policyBasedRoute PolicyBasedRoute

Required. Initial values for a new Policy Based Route.

policyBasedRouteId string

Required. Unique id for the Policy Based Route to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationPolicyBasedRouteOperationMetadata

The RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = PolicyBasedRoutingServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
PolicyBasedRoute policyBasedRoute = new PolicyBasedRoute();
string policyBasedRouteId = "";
// Make the request
Operation<PolicyBasedRoute, OperationMetadata> response = policyBasedRoutingServiceClient.CreatePolicyBasedRoute(parent, policyBasedRoute, policyBasedRouteId);

// Poll until the returned long-running operation is complete
Operation<PolicyBasedRoute, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
PolicyBasedRoute 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
Operation<PolicyBasedRoute, OperationMetadata> retrievedResponse = policyBasedRoutingServiceClient.PollOnceCreatePolicyBasedRoute(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    PolicyBasedRoute retrievedResult = retrievedResponse.Result;
}

CreatePolicyBasedRoute(CreatePolicyBasedRouteRequest, CallSettings)

public virtual Operation<PolicyBasedRoute, OperationMetadata> CreatePolicyBasedRoute(CreatePolicyBasedRouteRequest request, CallSettings callSettings = null)

Creates a new PolicyBasedRoute in a given project and location.

Parameters
Name Description
request CreatePolicyBasedRouteRequest

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
OperationPolicyBasedRouteOperationMetadata

The RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = PolicyBasedRoutingServiceClient.Create();
// Initialize request argument(s)
CreatePolicyBasedRouteRequest request = new CreatePolicyBasedRouteRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    PolicyBasedRouteId = "",
    PolicyBasedRoute = new PolicyBasedRoute(),
    RequestId = "",
};
// Make the request
Operation<PolicyBasedRoute, OperationMetadata> response = policyBasedRoutingServiceClient.CreatePolicyBasedRoute(request);

// Poll until the returned long-running operation is complete
Operation<PolicyBasedRoute, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
PolicyBasedRoute 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
Operation<PolicyBasedRoute, OperationMetadata> retrievedResponse = policyBasedRoutingServiceClient.PollOnceCreatePolicyBasedRoute(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    PolicyBasedRoute retrievedResult = retrievedResponse.Result;
}

CreatePolicyBasedRoute(string, PolicyBasedRoute, string, CallSettings)

public virtual Operation<PolicyBasedRoute, OperationMetadata> CreatePolicyBasedRoute(string parent, PolicyBasedRoute policyBasedRoute, string policyBasedRouteId, CallSettings callSettings = null)

Creates a new PolicyBasedRoute in a given project and location.

Parameters
Name Description
parent string

Required. The parent resource's name of the PolicyBasedRoute.

policyBasedRoute PolicyBasedRoute

Required. Initial values for a new Policy Based Route.

policyBasedRouteId string

Required. Unique id for the Policy Based Route to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationPolicyBasedRouteOperationMetadata

The RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = PolicyBasedRoutingServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
PolicyBasedRoute policyBasedRoute = new PolicyBasedRoute();
string policyBasedRouteId = "";
// Make the request
Operation<PolicyBasedRoute, OperationMetadata> response = policyBasedRoutingServiceClient.CreatePolicyBasedRoute(parent, policyBasedRoute, policyBasedRouteId);

// Poll until the returned long-running operation is complete
Operation<PolicyBasedRoute, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
PolicyBasedRoute 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
Operation<PolicyBasedRoute, OperationMetadata> retrievedResponse = policyBasedRoutingServiceClient.PollOnceCreatePolicyBasedRoute(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    PolicyBasedRoute retrievedResult = retrievedResponse.Result;
}

CreatePolicyBasedRouteAsync(LocationName, PolicyBasedRoute, string, CallSettings)

public virtual Task<Operation<PolicyBasedRoute, OperationMetadata>> CreatePolicyBasedRouteAsync(LocationName parent, PolicyBasedRoute policyBasedRoute, string policyBasedRouteId, CallSettings callSettings = null)

Creates a new PolicyBasedRoute in a given project and location.

Parameters
Name Description
parent LocationName

Required. The parent resource's name of the PolicyBasedRoute.

policyBasedRoute PolicyBasedRoute

Required. Initial values for a new Policy Based Route.

policyBasedRouteId string

Required. Unique id for the Policy Based Route to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationPolicyBasedRouteOperationMetadata

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
PolicyBasedRoute policyBasedRoute = new PolicyBasedRoute();
string policyBasedRouteId = "";
// Make the request
Operation<PolicyBasedRoute, OperationMetadata> response = await policyBasedRoutingServiceClient.CreatePolicyBasedRouteAsync(parent, policyBasedRoute, policyBasedRouteId);

// Poll until the returned long-running operation is complete
Operation<PolicyBasedRoute, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBasedRoute 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
Operation<PolicyBasedRoute, OperationMetadata> retrievedResponse = await policyBasedRoutingServiceClient.PollOnceCreatePolicyBasedRouteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    PolicyBasedRoute retrievedResult = retrievedResponse.Result;
}

CreatePolicyBasedRouteAsync(LocationName, PolicyBasedRoute, string, CancellationToken)

public virtual Task<Operation<PolicyBasedRoute, OperationMetadata>> CreatePolicyBasedRouteAsync(LocationName parent, PolicyBasedRoute policyBasedRoute, string policyBasedRouteId, CancellationToken cancellationToken)

Creates a new PolicyBasedRoute in a given project and location.

Parameters
Name Description
parent LocationName

Required. The parent resource's name of the PolicyBasedRoute.

policyBasedRoute PolicyBasedRoute

Required. Initial values for a new Policy Based Route.

policyBasedRouteId string

Required. Unique id for the Policy Based Route to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationPolicyBasedRouteOperationMetadata

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
PolicyBasedRoute policyBasedRoute = new PolicyBasedRoute();
string policyBasedRouteId = "";
// Make the request
Operation<PolicyBasedRoute, OperationMetadata> response = await policyBasedRoutingServiceClient.CreatePolicyBasedRouteAsync(parent, policyBasedRoute, policyBasedRouteId);

// Poll until the returned long-running operation is complete
Operation<PolicyBasedRoute, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBasedRoute 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
Operation<PolicyBasedRoute, OperationMetadata> retrievedResponse = await policyBasedRoutingServiceClient.PollOnceCreatePolicyBasedRouteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    PolicyBasedRoute retrievedResult = retrievedResponse.Result;
}

CreatePolicyBasedRouteAsync(CreatePolicyBasedRouteRequest, CallSettings)

public virtual Task<Operation<PolicyBasedRoute, OperationMetadata>> CreatePolicyBasedRouteAsync(CreatePolicyBasedRouteRequest request, CallSettings callSettings = null)

Creates a new PolicyBasedRoute in a given project and location.

Parameters
Name Description
request CreatePolicyBasedRouteRequest

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
TaskOperationPolicyBasedRouteOperationMetadata

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
CreatePolicyBasedRouteRequest request = new CreatePolicyBasedRouteRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    PolicyBasedRouteId = "",
    PolicyBasedRoute = new PolicyBasedRoute(),
    RequestId = "",
};
// Make the request
Operation<PolicyBasedRoute, OperationMetadata> response = await policyBasedRoutingServiceClient.CreatePolicyBasedRouteAsync(request);

// Poll until the returned long-running operation is complete
Operation<PolicyBasedRoute, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBasedRoute 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
Operation<PolicyBasedRoute, OperationMetadata> retrievedResponse = await policyBasedRoutingServiceClient.PollOnceCreatePolicyBasedRouteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    PolicyBasedRoute retrievedResult = retrievedResponse.Result;
}

CreatePolicyBasedRouteAsync(CreatePolicyBasedRouteRequest, CancellationToken)

public virtual Task<Operation<PolicyBasedRoute, OperationMetadata>> CreatePolicyBasedRouteAsync(CreatePolicyBasedRouteRequest request, CancellationToken cancellationToken)

Creates a new PolicyBasedRoute in a given project and location.

Parameters
Name Description
request CreatePolicyBasedRouteRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationPolicyBasedRouteOperationMetadata

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
CreatePolicyBasedRouteRequest request = new CreatePolicyBasedRouteRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    PolicyBasedRouteId = "",
    PolicyBasedRoute = new PolicyBasedRoute(),
    RequestId = "",
};
// Make the request
Operation<PolicyBasedRoute, OperationMetadata> response = await policyBasedRoutingServiceClient.CreatePolicyBasedRouteAsync(request);

// Poll until the returned long-running operation is complete
Operation<PolicyBasedRoute, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBasedRoute 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
Operation<PolicyBasedRoute, OperationMetadata> retrievedResponse = await policyBasedRoutingServiceClient.PollOnceCreatePolicyBasedRouteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    PolicyBasedRoute retrievedResult = retrievedResponse.Result;
}

CreatePolicyBasedRouteAsync(string, PolicyBasedRoute, string, CallSettings)

public virtual Task<Operation<PolicyBasedRoute, OperationMetadata>> CreatePolicyBasedRouteAsync(string parent, PolicyBasedRoute policyBasedRoute, string policyBasedRouteId, CallSettings callSettings = null)

Creates a new PolicyBasedRoute in a given project and location.

Parameters
Name Description
parent string

Required. The parent resource's name of the PolicyBasedRoute.

policyBasedRoute PolicyBasedRoute

Required. Initial values for a new Policy Based Route.

policyBasedRouteId string

Required. Unique id for the Policy Based Route to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationPolicyBasedRouteOperationMetadata

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
PolicyBasedRoute policyBasedRoute = new PolicyBasedRoute();
string policyBasedRouteId = "";
// Make the request
Operation<PolicyBasedRoute, OperationMetadata> response = await policyBasedRoutingServiceClient.CreatePolicyBasedRouteAsync(parent, policyBasedRoute, policyBasedRouteId);

// Poll until the returned long-running operation is complete
Operation<PolicyBasedRoute, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBasedRoute 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
Operation<PolicyBasedRoute, OperationMetadata> retrievedResponse = await policyBasedRoutingServiceClient.PollOnceCreatePolicyBasedRouteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    PolicyBasedRoute retrievedResult = retrievedResponse.Result;
}

CreatePolicyBasedRouteAsync(string, PolicyBasedRoute, string, CancellationToken)

public virtual Task<Operation<PolicyBasedRoute, OperationMetadata>> CreatePolicyBasedRouteAsync(string parent, PolicyBasedRoute policyBasedRoute, string policyBasedRouteId, CancellationToken cancellationToken)

Creates a new PolicyBasedRoute in a given project and location.

Parameters
Name Description
parent string

Required. The parent resource's name of the PolicyBasedRoute.

policyBasedRoute PolicyBasedRoute

Required. Initial values for a new Policy Based Route.

policyBasedRouteId string

Required. Unique id for the Policy Based Route to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationPolicyBasedRouteOperationMetadata

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
PolicyBasedRoute policyBasedRoute = new PolicyBasedRoute();
string policyBasedRouteId = "";
// Make the request
Operation<PolicyBasedRoute, OperationMetadata> response = await policyBasedRoutingServiceClient.CreatePolicyBasedRouteAsync(parent, policyBasedRoute, policyBasedRouteId);

// Poll until the returned long-running operation is complete
Operation<PolicyBasedRoute, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBasedRoute 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
Operation<PolicyBasedRoute, OperationMetadata> retrievedResponse = await policyBasedRoutingServiceClient.PollOnceCreatePolicyBasedRouteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    PolicyBasedRoute retrievedResult = retrievedResponse.Result;
}

DeletePolicyBasedRoute(DeletePolicyBasedRouteRequest, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeletePolicyBasedRoute(DeletePolicyBasedRouteRequest request, CallSettings callSettings = null)

Deletes a single PolicyBasedRoute.

Parameters
Name Description
request DeletePolicyBasedRouteRequest

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
OperationEmptyOperationMetadata

The RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = PolicyBasedRoutingServiceClient.Create();
// Initialize request argument(s)
DeletePolicyBasedRouteRequest request = new DeletePolicyBasedRouteRequest
{
    PolicyBasedRouteName = PolicyBasedRouteName.FromProjectPolicyBasedRoute("[PROJECT]", "[POLICY_BASED_ROUTE]"),
    RequestId = "",
};
// Make the request
Operation<Empty, OperationMetadata> response = policyBasedRoutingServiceClient.DeletePolicyBasedRoute(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = policyBasedRoutingServiceClient.PollOnceDeletePolicyBasedRoute(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeletePolicyBasedRoute(PolicyBasedRouteName, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeletePolicyBasedRoute(PolicyBasedRouteName name, CallSettings callSettings = null)

Deletes a single PolicyBasedRoute.

Parameters
Name Description
name PolicyBasedRouteName

Required. Name of the PolicyBasedRoute resource to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyOperationMetadata

The RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = PolicyBasedRoutingServiceClient.Create();
// Initialize request argument(s)
PolicyBasedRouteName name = PolicyBasedRouteName.FromProjectPolicyBasedRoute("[PROJECT]", "[POLICY_BASED_ROUTE]");
// Make the request
Operation<Empty, OperationMetadata> response = policyBasedRoutingServiceClient.DeletePolicyBasedRoute(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = policyBasedRoutingServiceClient.PollOnceDeletePolicyBasedRoute(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeletePolicyBasedRoute(string, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeletePolicyBasedRoute(string name, CallSettings callSettings = null)

Deletes a single PolicyBasedRoute.

Parameters
Name Description
name string

Required. Name of the PolicyBasedRoute resource to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyOperationMetadata

The RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = PolicyBasedRoutingServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/global/PolicyBasedRoutes/[POLICY_BASED_ROUTE]";
// Make the request
Operation<Empty, OperationMetadata> response = policyBasedRoutingServiceClient.DeletePolicyBasedRoute(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = policyBasedRoutingServiceClient.PollOnceDeletePolicyBasedRoute(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeletePolicyBasedRouteAsync(DeletePolicyBasedRouteRequest, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeletePolicyBasedRouteAsync(DeletePolicyBasedRouteRequest request, CallSettings callSettings = null)

Deletes a single PolicyBasedRoute.

Parameters
Name Description
request DeletePolicyBasedRouteRequest

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
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
DeletePolicyBasedRouteRequest request = new DeletePolicyBasedRouteRequest
{
    PolicyBasedRouteName = PolicyBasedRouteName.FromProjectPolicyBasedRoute("[PROJECT]", "[POLICY_BASED_ROUTE]"),
    RequestId = "",
};
// Make the request
Operation<Empty, OperationMetadata> response = await policyBasedRoutingServiceClient.DeletePolicyBasedRouteAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await policyBasedRoutingServiceClient.PollOnceDeletePolicyBasedRouteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeletePolicyBasedRouteAsync(DeletePolicyBasedRouteRequest, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeletePolicyBasedRouteAsync(DeletePolicyBasedRouteRequest request, CancellationToken cancellationToken)

Deletes a single PolicyBasedRoute.

Parameters
Name Description
request DeletePolicyBasedRouteRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
DeletePolicyBasedRouteRequest request = new DeletePolicyBasedRouteRequest
{
    PolicyBasedRouteName = PolicyBasedRouteName.FromProjectPolicyBasedRoute("[PROJECT]", "[POLICY_BASED_ROUTE]"),
    RequestId = "",
};
// Make the request
Operation<Empty, OperationMetadata> response = await policyBasedRoutingServiceClient.DeletePolicyBasedRouteAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await policyBasedRoutingServiceClient.PollOnceDeletePolicyBasedRouteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeletePolicyBasedRouteAsync(PolicyBasedRouteName, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeletePolicyBasedRouteAsync(PolicyBasedRouteName name, CallSettings callSettings = null)

Deletes a single PolicyBasedRoute.

Parameters
Name Description
name PolicyBasedRouteName

Required. Name of the PolicyBasedRoute resource to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
PolicyBasedRouteName name = PolicyBasedRouteName.FromProjectPolicyBasedRoute("[PROJECT]", "[POLICY_BASED_ROUTE]");
// Make the request
Operation<Empty, OperationMetadata> response = await policyBasedRoutingServiceClient.DeletePolicyBasedRouteAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await policyBasedRoutingServiceClient.PollOnceDeletePolicyBasedRouteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeletePolicyBasedRouteAsync(PolicyBasedRouteName, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeletePolicyBasedRouteAsync(PolicyBasedRouteName name, CancellationToken cancellationToken)

Deletes a single PolicyBasedRoute.

Parameters
Name Description
name PolicyBasedRouteName

Required. Name of the PolicyBasedRoute resource to delete.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
PolicyBasedRouteName name = PolicyBasedRouteName.FromProjectPolicyBasedRoute("[PROJECT]", "[POLICY_BASED_ROUTE]");
// Make the request
Operation<Empty, OperationMetadata> response = await policyBasedRoutingServiceClient.DeletePolicyBasedRouteAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await policyBasedRoutingServiceClient.PollOnceDeletePolicyBasedRouteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeletePolicyBasedRouteAsync(string, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeletePolicyBasedRouteAsync(string name, CallSettings callSettings = null)

Deletes a single PolicyBasedRoute.

Parameters
Name Description
name string

Required. Name of the PolicyBasedRoute resource to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/global/PolicyBasedRoutes/[POLICY_BASED_ROUTE]";
// Make the request
Operation<Empty, OperationMetadata> response = await policyBasedRoutingServiceClient.DeletePolicyBasedRouteAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await policyBasedRoutingServiceClient.PollOnceDeletePolicyBasedRouteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeletePolicyBasedRouteAsync(string, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeletePolicyBasedRouteAsync(string name, CancellationToken cancellationToken)

Deletes a single PolicyBasedRoute.

Parameters
Name Description
name string

Required. Name of the PolicyBasedRoute resource to delete.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/global/PolicyBasedRoutes/[POLICY_BASED_ROUTE]";
// Make the request
Operation<Empty, OperationMetadata> response = await policyBasedRoutingServiceClient.DeletePolicyBasedRouteAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await policyBasedRoutingServiceClient.PollOnceDeletePolicyBasedRouteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

GetPolicyBasedRoute(GetPolicyBasedRouteRequest, CallSettings)

public virtual PolicyBasedRoute GetPolicyBasedRoute(GetPolicyBasedRouteRequest request, CallSettings callSettings = null)

Gets details of a single PolicyBasedRoute.

Parameters
Name Description
request GetPolicyBasedRouteRequest

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
PolicyBasedRoute

The RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = PolicyBasedRoutingServiceClient.Create();
// Initialize request argument(s)
GetPolicyBasedRouteRequest request = new GetPolicyBasedRouteRequest
{
    PolicyBasedRouteName = PolicyBasedRouteName.FromProjectPolicyBasedRoute("[PROJECT]", "[POLICY_BASED_ROUTE]"),
};
// Make the request
PolicyBasedRoute response = policyBasedRoutingServiceClient.GetPolicyBasedRoute(request);

GetPolicyBasedRoute(PolicyBasedRouteName, CallSettings)

public virtual PolicyBasedRoute GetPolicyBasedRoute(PolicyBasedRouteName name, CallSettings callSettings = null)

Gets details of a single PolicyBasedRoute.

Parameters
Name Description
name PolicyBasedRouteName

Required. Name of the PolicyBasedRoute resource to get.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PolicyBasedRoute

The RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = PolicyBasedRoutingServiceClient.Create();
// Initialize request argument(s)
PolicyBasedRouteName name = PolicyBasedRouteName.FromProjectPolicyBasedRoute("[PROJECT]", "[POLICY_BASED_ROUTE]");
// Make the request
PolicyBasedRoute response = policyBasedRoutingServiceClient.GetPolicyBasedRoute(name);

GetPolicyBasedRoute(string, CallSettings)

public virtual PolicyBasedRoute GetPolicyBasedRoute(string name, CallSettings callSettings = null)

Gets details of a single PolicyBasedRoute.

Parameters
Name Description
name string

Required. Name of the PolicyBasedRoute resource to get.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PolicyBasedRoute

The RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = PolicyBasedRoutingServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/global/PolicyBasedRoutes/[POLICY_BASED_ROUTE]";
// Make the request
PolicyBasedRoute response = policyBasedRoutingServiceClient.GetPolicyBasedRoute(name);

GetPolicyBasedRouteAsync(GetPolicyBasedRouteRequest, CallSettings)

public virtual Task<PolicyBasedRoute> GetPolicyBasedRouteAsync(GetPolicyBasedRouteRequest request, CallSettings callSettings = null)

Gets details of a single PolicyBasedRoute.

Parameters
Name Description
request GetPolicyBasedRouteRequest

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
TaskPolicyBasedRoute

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
GetPolicyBasedRouteRequest request = new GetPolicyBasedRouteRequest
{
    PolicyBasedRouteName = PolicyBasedRouteName.FromProjectPolicyBasedRoute("[PROJECT]", "[POLICY_BASED_ROUTE]"),
};
// Make the request
PolicyBasedRoute response = await policyBasedRoutingServiceClient.GetPolicyBasedRouteAsync(request);

GetPolicyBasedRouteAsync(GetPolicyBasedRouteRequest, CancellationToken)

public virtual Task<PolicyBasedRoute> GetPolicyBasedRouteAsync(GetPolicyBasedRouteRequest request, CancellationToken cancellationToken)

Gets details of a single PolicyBasedRoute.

Parameters
Name Description
request GetPolicyBasedRouteRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskPolicyBasedRoute

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
GetPolicyBasedRouteRequest request = new GetPolicyBasedRouteRequest
{
    PolicyBasedRouteName = PolicyBasedRouteName.FromProjectPolicyBasedRoute("[PROJECT]", "[POLICY_BASED_ROUTE]"),
};
// Make the request
PolicyBasedRoute response = await policyBasedRoutingServiceClient.GetPolicyBasedRouteAsync(request);

GetPolicyBasedRouteAsync(PolicyBasedRouteName, CallSettings)

public virtual Task<PolicyBasedRoute> GetPolicyBasedRouteAsync(PolicyBasedRouteName name, CallSettings callSettings = null)

Gets details of a single PolicyBasedRoute.

Parameters
Name Description
name PolicyBasedRouteName

Required. Name of the PolicyBasedRoute resource to get.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPolicyBasedRoute

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
PolicyBasedRouteName name = PolicyBasedRouteName.FromProjectPolicyBasedRoute("[PROJECT]", "[POLICY_BASED_ROUTE]");
// Make the request
PolicyBasedRoute response = await policyBasedRoutingServiceClient.GetPolicyBasedRouteAsync(name);

GetPolicyBasedRouteAsync(PolicyBasedRouteName, CancellationToken)

public virtual Task<PolicyBasedRoute> GetPolicyBasedRouteAsync(PolicyBasedRouteName name, CancellationToken cancellationToken)

Gets details of a single PolicyBasedRoute.

Parameters
Name Description
name PolicyBasedRouteName

Required. Name of the PolicyBasedRoute resource to get.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskPolicyBasedRoute

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
PolicyBasedRouteName name = PolicyBasedRouteName.FromProjectPolicyBasedRoute("[PROJECT]", "[POLICY_BASED_ROUTE]");
// Make the request
PolicyBasedRoute response = await policyBasedRoutingServiceClient.GetPolicyBasedRouteAsync(name);

GetPolicyBasedRouteAsync(string, CallSettings)

public virtual Task<PolicyBasedRoute> GetPolicyBasedRouteAsync(string name, CallSettings callSettings = null)

Gets details of a single PolicyBasedRoute.

Parameters
Name Description
name string

Required. Name of the PolicyBasedRoute resource to get.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPolicyBasedRoute

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/global/PolicyBasedRoutes/[POLICY_BASED_ROUTE]";
// Make the request
PolicyBasedRoute response = await policyBasedRoutingServiceClient.GetPolicyBasedRouteAsync(name);

GetPolicyBasedRouteAsync(string, CancellationToken)

public virtual Task<PolicyBasedRoute> GetPolicyBasedRouteAsync(string name, CancellationToken cancellationToken)

Gets details of a single PolicyBasedRoute.

Parameters
Name Description
name string

Required. Name of the PolicyBasedRoute resource to get.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskPolicyBasedRoute

A Task containing the RPC response.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/global/PolicyBasedRoutes/[POLICY_BASED_ROUTE]";
// Make the request
PolicyBasedRoute response = await policyBasedRoutingServiceClient.GetPolicyBasedRouteAsync(name);

ListPolicyBasedRoutes(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListPolicyBasedRoutesResponse, PolicyBasedRoute> ListPolicyBasedRoutes(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists PolicyBasedRoutes in a given project and location.

Parameters
Name Description
parent LocationName

Required. The parent resource's name.

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
PagedEnumerableListPolicyBasedRoutesResponsePolicyBasedRoute

A pageable sequence of PolicyBasedRoute resources.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = PolicyBasedRoutingServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListPolicyBasedRoutesResponse, PolicyBasedRoute> response = policyBasedRoutingServiceClient.ListPolicyBasedRoutes(parent);

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

ListPolicyBasedRoutes(ListPolicyBasedRoutesRequest, CallSettings)

public virtual PagedEnumerable<ListPolicyBasedRoutesResponse, PolicyBasedRoute> ListPolicyBasedRoutes(ListPolicyBasedRoutesRequest request, CallSettings callSettings = null)

Lists PolicyBasedRoutes in a given project and location.

Parameters
Name Description
request ListPolicyBasedRoutesRequest

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
PagedEnumerableListPolicyBasedRoutesResponsePolicyBasedRoute

A pageable sequence of PolicyBasedRoute resources.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = PolicyBasedRoutingServiceClient.Create();
// Initialize request argument(s)
ListPolicyBasedRoutesRequest request = new ListPolicyBasedRoutesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedEnumerable<ListPolicyBasedRoutesResponse, PolicyBasedRoute> response = policyBasedRoutingServiceClient.ListPolicyBasedRoutes(request);

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

ListPolicyBasedRoutes(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListPolicyBasedRoutesResponse, PolicyBasedRoute> ListPolicyBasedRoutes(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists PolicyBasedRoutes in a given project and location.

Parameters
Name Description
parent string

Required. The parent resource's name.

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
PagedEnumerableListPolicyBasedRoutesResponsePolicyBasedRoute

A pageable sequence of PolicyBasedRoute resources.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = PolicyBasedRoutingServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListPolicyBasedRoutesResponse, PolicyBasedRoute> response = policyBasedRoutingServiceClient.ListPolicyBasedRoutes(parent);

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

ListPolicyBasedRoutesAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListPolicyBasedRoutesResponse, PolicyBasedRoute> ListPolicyBasedRoutesAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists PolicyBasedRoutes in a given project and location.

Parameters
Name Description
parent LocationName

Required. The parent resource's name.

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
PagedAsyncEnumerableListPolicyBasedRoutesResponsePolicyBasedRoute

A pageable asynchronous sequence of PolicyBasedRoute resources.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListPolicyBasedRoutesResponse, PolicyBasedRoute> response = policyBasedRoutingServiceClient.ListPolicyBasedRoutesAsync(parent);

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

ListPolicyBasedRoutesAsync(ListPolicyBasedRoutesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListPolicyBasedRoutesResponse, PolicyBasedRoute> ListPolicyBasedRoutesAsync(ListPolicyBasedRoutesRequest request, CallSettings callSettings = null)

Lists PolicyBasedRoutes in a given project and location.

Parameters
Name Description
request ListPolicyBasedRoutesRequest

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
PagedAsyncEnumerableListPolicyBasedRoutesResponsePolicyBasedRoute

A pageable asynchronous sequence of PolicyBasedRoute resources.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
ListPolicyBasedRoutesRequest request = new ListPolicyBasedRoutesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedAsyncEnumerable<ListPolicyBasedRoutesResponse, PolicyBasedRoute> response = policyBasedRoutingServiceClient.ListPolicyBasedRoutesAsync(request);

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

ListPolicyBasedRoutesAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListPolicyBasedRoutesResponse, PolicyBasedRoute> ListPolicyBasedRoutesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists PolicyBasedRoutes in a given project and location.

Parameters
Name Description
parent string

Required. The parent resource's name.

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
PagedAsyncEnumerableListPolicyBasedRoutesResponsePolicyBasedRoute

A pageable asynchronous sequence of PolicyBasedRoute resources.

Example
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListPolicyBasedRoutesResponse, PolicyBasedRoute> response = policyBasedRoutingServiceClient.ListPolicyBasedRoutesAsync(parent);

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

PollOnceCreatePolicyBasedRoute(string, CallSettings)

public virtual Operation<PolicyBasedRoute, OperationMetadata> PollOnceCreatePolicyBasedRoute(string operationName, CallSettings callSettings = null)

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

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
OperationPolicyBasedRouteOperationMetadata

The result of polling the operation.

PollOnceCreatePolicyBasedRouteAsync(string, CallSettings)

public virtual Task<Operation<PolicyBasedRoute, OperationMetadata>> PollOnceCreatePolicyBasedRouteAsync(string operationName, CallSettings callSettings = null)

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

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
TaskOperationPolicyBasedRouteOperationMetadata

A task representing the result of polling the operation.

PollOnceDeletePolicyBasedRoute(string, CallSettings)

public virtual Operation<Empty, OperationMetadata> PollOnceDeletePolicyBasedRoute(string operationName, CallSettings callSettings = null)

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

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
OperationEmptyOperationMetadata

The result of polling the operation.

PollOnceDeletePolicyBasedRouteAsync(string, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> PollOnceDeletePolicyBasedRouteAsync(string operationName, CallSettings callSettings = null)

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

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
TaskOperationEmptyOperationMetadata

A task representing the result of polling the operation.

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.