Network Services v1beta1 API - Class NetworkServicesClient (1.0.0-beta01)

public abstract class NetworkServicesClient

Reference documentation and code samples for the Network Services v1beta1 API class NetworkServicesClient.

NetworkServices client wrapper, for convenient use.

Inheritance

object > NetworkServicesClient

Namespace

Google.Cloud.NetworkServices.V1Beta1

Assembly

Google.Cloud.NetworkServices.V1Beta1.dll

Remarks

Service describing handlers for resources.

Properties

CreateEndpointPolicyOperationsClient

public virtual OperationsClient CreateEndpointPolicyOperationsClient { get; }

The long-running operations client for CreateEndpointPolicy.

Property Value
Type Description
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default NetworkServices scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default NetworkServices scopes are:

DeleteEndpointPolicyOperationsClient

public virtual OperationsClient DeleteEndpointPolicyOperationsClient { get; }

The long-running operations client for DeleteEndpointPolicy.

Property Value
Type Description
OperationsClient

GrpcClient

public virtual NetworkServices.NetworkServicesClient GrpcClient { get; }

The underlying gRPC NetworkServices client

Property Value
Type Description
NetworkServicesNetworkServicesClient

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

UpdateEndpointPolicyOperationsClient

public virtual OperationsClient UpdateEndpointPolicyOperationsClient { get; }

The long-running operations client for UpdateEndpointPolicy.

Property Value
Type Description
OperationsClient

Methods

Create()

public static NetworkServicesClient Create()

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

Returns
Type Description
NetworkServicesClient

The created NetworkServicesClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskNetworkServicesClient

The task representing the created NetworkServicesClient.

CreateEndpointPolicy(LocationName, EndpointPolicy, string, CallSettings)

public virtual Operation<EndpointPolicy, OperationMetadata> CreateEndpointPolicy(LocationName parent, EndpointPolicy endpointPolicy, string endpointPolicyId, CallSettings callSettings = null)

Creates a new EndpointPolicy in a given project and location.

Parameters
Name Description
parent LocationName

Required. The parent resource of the EndpointPolicy. Must be in the format projects/*/locations/global.

endpointPolicy EndpointPolicy

Required. EndpointPolicy resource to be created.

endpointPolicyId string

Required. Short name of the EndpointPolicy resource to be created. E.g. "CustomECS".

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEndpointPolicyOperationMetadata

The RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = NetworkServicesClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
EndpointPolicy endpointPolicy = new EndpointPolicy();
string endpointPolicyId = "";
// Make the request
Operation<EndpointPolicy, OperationMetadata> response = networkServicesClient.CreateEndpointPolicy(parent, endpointPolicy, endpointPolicyId);

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

CreateEndpointPolicy(CreateEndpointPolicyRequest, CallSettings)

public virtual Operation<EndpointPolicy, OperationMetadata> CreateEndpointPolicy(CreateEndpointPolicyRequest request, CallSettings callSettings = null)

Creates a new EndpointPolicy in a given project and location.

Parameters
Name Description
request CreateEndpointPolicyRequest

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
OperationEndpointPolicyOperationMetadata

The RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = NetworkServicesClient.Create();
// Initialize request argument(s)
CreateEndpointPolicyRequest request = new CreateEndpointPolicyRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    EndpointPolicyId = "",
    EndpointPolicy = new EndpointPolicy(),
};
// Make the request
Operation<EndpointPolicy, OperationMetadata> response = networkServicesClient.CreateEndpointPolicy(request);

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

CreateEndpointPolicy(string, EndpointPolicy, string, CallSettings)

public virtual Operation<EndpointPolicy, OperationMetadata> CreateEndpointPolicy(string parent, EndpointPolicy endpointPolicy, string endpointPolicyId, CallSettings callSettings = null)

Creates a new EndpointPolicy in a given project and location.

Parameters
Name Description
parent string

Required. The parent resource of the EndpointPolicy. Must be in the format projects/*/locations/global.

endpointPolicy EndpointPolicy

Required. EndpointPolicy resource to be created.

endpointPolicyId string

Required. Short name of the EndpointPolicy resource to be created. E.g. "CustomECS".

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEndpointPolicyOperationMetadata

The RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = NetworkServicesClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
EndpointPolicy endpointPolicy = new EndpointPolicy();
string endpointPolicyId = "";
// Make the request
Operation<EndpointPolicy, OperationMetadata> response = networkServicesClient.CreateEndpointPolicy(parent, endpointPolicy, endpointPolicyId);

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

CreateEndpointPolicyAsync(LocationName, EndpointPolicy, string, CallSettings)

public virtual Task<Operation<EndpointPolicy, OperationMetadata>> CreateEndpointPolicyAsync(LocationName parent, EndpointPolicy endpointPolicy, string endpointPolicyId, CallSettings callSettings = null)

Creates a new EndpointPolicy in a given project and location.

Parameters
Name Description
parent LocationName

Required. The parent resource of the EndpointPolicy. Must be in the format projects/*/locations/global.

endpointPolicy EndpointPolicy

Required. EndpointPolicy resource to be created.

endpointPolicyId string

Required. Short name of the EndpointPolicy resource to be created. E.g. "CustomECS".

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEndpointPolicyOperationMetadata

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
EndpointPolicy endpointPolicy = new EndpointPolicy();
string endpointPolicyId = "";
// Make the request
Operation<EndpointPolicy, OperationMetadata> response = await networkServicesClient.CreateEndpointPolicyAsync(parent, endpointPolicy, endpointPolicyId);

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

CreateEndpointPolicyAsync(LocationName, EndpointPolicy, string, CancellationToken)

public virtual Task<Operation<EndpointPolicy, OperationMetadata>> CreateEndpointPolicyAsync(LocationName parent, EndpointPolicy endpointPolicy, string endpointPolicyId, CancellationToken cancellationToken)

Creates a new EndpointPolicy in a given project and location.

Parameters
Name Description
parent LocationName

Required. The parent resource of the EndpointPolicy. Must be in the format projects/*/locations/global.

endpointPolicy EndpointPolicy

Required. EndpointPolicy resource to be created.

endpointPolicyId string

Required. Short name of the EndpointPolicy resource to be created. E.g. "CustomECS".

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEndpointPolicyOperationMetadata

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
EndpointPolicy endpointPolicy = new EndpointPolicy();
string endpointPolicyId = "";
// Make the request
Operation<EndpointPolicy, OperationMetadata> response = await networkServicesClient.CreateEndpointPolicyAsync(parent, endpointPolicy, endpointPolicyId);

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

CreateEndpointPolicyAsync(CreateEndpointPolicyRequest, CallSettings)

public virtual Task<Operation<EndpointPolicy, OperationMetadata>> CreateEndpointPolicyAsync(CreateEndpointPolicyRequest request, CallSettings callSettings = null)

Creates a new EndpointPolicy in a given project and location.

Parameters
Name Description
request CreateEndpointPolicyRequest

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
TaskOperationEndpointPolicyOperationMetadata

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
CreateEndpointPolicyRequest request = new CreateEndpointPolicyRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    EndpointPolicyId = "",
    EndpointPolicy = new EndpointPolicy(),
};
// Make the request
Operation<EndpointPolicy, OperationMetadata> response = await networkServicesClient.CreateEndpointPolicyAsync(request);

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

CreateEndpointPolicyAsync(CreateEndpointPolicyRequest, CancellationToken)

public virtual Task<Operation<EndpointPolicy, OperationMetadata>> CreateEndpointPolicyAsync(CreateEndpointPolicyRequest request, CancellationToken cancellationToken)

Creates a new EndpointPolicy in a given project and location.

Parameters
Name Description
request CreateEndpointPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEndpointPolicyOperationMetadata

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
CreateEndpointPolicyRequest request = new CreateEndpointPolicyRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    EndpointPolicyId = "",
    EndpointPolicy = new EndpointPolicy(),
};
// Make the request
Operation<EndpointPolicy, OperationMetadata> response = await networkServicesClient.CreateEndpointPolicyAsync(request);

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

CreateEndpointPolicyAsync(string, EndpointPolicy, string, CallSettings)

public virtual Task<Operation<EndpointPolicy, OperationMetadata>> CreateEndpointPolicyAsync(string parent, EndpointPolicy endpointPolicy, string endpointPolicyId, CallSettings callSettings = null)

Creates a new EndpointPolicy in a given project and location.

Parameters
Name Description
parent string

Required. The parent resource of the EndpointPolicy. Must be in the format projects/*/locations/global.

endpointPolicy EndpointPolicy

Required. EndpointPolicy resource to be created.

endpointPolicyId string

Required. Short name of the EndpointPolicy resource to be created. E.g. "CustomECS".

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEndpointPolicyOperationMetadata

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
EndpointPolicy endpointPolicy = new EndpointPolicy();
string endpointPolicyId = "";
// Make the request
Operation<EndpointPolicy, OperationMetadata> response = await networkServicesClient.CreateEndpointPolicyAsync(parent, endpointPolicy, endpointPolicyId);

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

CreateEndpointPolicyAsync(string, EndpointPolicy, string, CancellationToken)

public virtual Task<Operation<EndpointPolicy, OperationMetadata>> CreateEndpointPolicyAsync(string parent, EndpointPolicy endpointPolicy, string endpointPolicyId, CancellationToken cancellationToken)

Creates a new EndpointPolicy in a given project and location.

Parameters
Name Description
parent string

Required. The parent resource of the EndpointPolicy. Must be in the format projects/*/locations/global.

endpointPolicy EndpointPolicy

Required. EndpointPolicy resource to be created.

endpointPolicyId string

Required. Short name of the EndpointPolicy resource to be created. E.g. "CustomECS".

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEndpointPolicyOperationMetadata

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
EndpointPolicy endpointPolicy = new EndpointPolicy();
string endpointPolicyId = "";
// Make the request
Operation<EndpointPolicy, OperationMetadata> response = await networkServicesClient.CreateEndpointPolicyAsync(parent, endpointPolicy, endpointPolicyId);

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

DeleteEndpointPolicy(DeleteEndpointPolicyRequest, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteEndpointPolicy(DeleteEndpointPolicyRequest request, CallSettings callSettings = null)

Deletes a single EndpointPolicy.

Parameters
Name Description
request DeleteEndpointPolicyRequest

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
NetworkServicesClient networkServicesClient = NetworkServicesClient.Create();
// Initialize request argument(s)
DeleteEndpointPolicyRequest request = new DeleteEndpointPolicyRequest
{
    EndpointPolicyName = EndpointPolicyName.FromProjectLocationEndpointPolicy("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]"),
};
// Make the request
Operation<Empty, OperationMetadata> response = networkServicesClient.DeleteEndpointPolicy(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 = networkServicesClient.PollOnceDeleteEndpointPolicy(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;
}

DeleteEndpointPolicy(EndpointPolicyName, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteEndpointPolicy(EndpointPolicyName name, CallSettings callSettings = null)

Deletes a single EndpointPolicy.

Parameters
Name Description
name EndpointPolicyName

Required. A name of the EndpointPolicy to delete. Must be in the format projects/*/locations/global/endpointPolicies/*.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyOperationMetadata

The RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = NetworkServicesClient.Create();
// Initialize request argument(s)
EndpointPolicyName name = EndpointPolicyName.FromProjectLocationEndpointPolicy("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]");
// Make the request
Operation<Empty, OperationMetadata> response = networkServicesClient.DeleteEndpointPolicy(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 = networkServicesClient.PollOnceDeleteEndpointPolicy(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;
}

DeleteEndpointPolicy(string, CallSettings)

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

Deletes a single EndpointPolicy.

Parameters
Name Description
name string

Required. A name of the EndpointPolicy to delete. Must be in the format projects/*/locations/global/endpointPolicies/*.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyOperationMetadata

The RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = NetworkServicesClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/endpointPolicies/[ENDPOINT_POLICY]";
// Make the request
Operation<Empty, OperationMetadata> response = networkServicesClient.DeleteEndpointPolicy(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 = networkServicesClient.PollOnceDeleteEndpointPolicy(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;
}

DeleteEndpointPolicyAsync(DeleteEndpointPolicyRequest, CallSettings)

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

Deletes a single EndpointPolicy.

Parameters
Name Description
request DeleteEndpointPolicyRequest

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
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
DeleteEndpointPolicyRequest request = new DeleteEndpointPolicyRequest
{
    EndpointPolicyName = EndpointPolicyName.FromProjectLocationEndpointPolicy("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]"),
};
// Make the request
Operation<Empty, OperationMetadata> response = await networkServicesClient.DeleteEndpointPolicyAsync(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 networkServicesClient.PollOnceDeleteEndpointPolicyAsync(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;
}

DeleteEndpointPolicyAsync(DeleteEndpointPolicyRequest, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteEndpointPolicyAsync(DeleteEndpointPolicyRequest request, CancellationToken cancellationToken)

Deletes a single EndpointPolicy.

Parameters
Name Description
request DeleteEndpointPolicyRequest

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
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
DeleteEndpointPolicyRequest request = new DeleteEndpointPolicyRequest
{
    EndpointPolicyName = EndpointPolicyName.FromProjectLocationEndpointPolicy("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]"),
};
// Make the request
Operation<Empty, OperationMetadata> response = await networkServicesClient.DeleteEndpointPolicyAsync(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 networkServicesClient.PollOnceDeleteEndpointPolicyAsync(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;
}

DeleteEndpointPolicyAsync(EndpointPolicyName, CallSettings)

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

Deletes a single EndpointPolicy.

Parameters
Name Description
name EndpointPolicyName

Required. A name of the EndpointPolicy to delete. Must be in the format projects/*/locations/global/endpointPolicies/*.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
EndpointPolicyName name = EndpointPolicyName.FromProjectLocationEndpointPolicy("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]");
// Make the request
Operation<Empty, OperationMetadata> response = await networkServicesClient.DeleteEndpointPolicyAsync(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 networkServicesClient.PollOnceDeleteEndpointPolicyAsync(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;
}

DeleteEndpointPolicyAsync(EndpointPolicyName, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteEndpointPolicyAsync(EndpointPolicyName name, CancellationToken cancellationToken)

Deletes a single EndpointPolicy.

Parameters
Name Description
name EndpointPolicyName

Required. A name of the EndpointPolicy to delete. Must be in the format projects/*/locations/global/endpointPolicies/*.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
EndpointPolicyName name = EndpointPolicyName.FromProjectLocationEndpointPolicy("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]");
// Make the request
Operation<Empty, OperationMetadata> response = await networkServicesClient.DeleteEndpointPolicyAsync(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 networkServicesClient.PollOnceDeleteEndpointPolicyAsync(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;
}

DeleteEndpointPolicyAsync(string, CallSettings)

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

Deletes a single EndpointPolicy.

Parameters
Name Description
name string

Required. A name of the EndpointPolicy to delete. Must be in the format projects/*/locations/global/endpointPolicies/*.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/endpointPolicies/[ENDPOINT_POLICY]";
// Make the request
Operation<Empty, OperationMetadata> response = await networkServicesClient.DeleteEndpointPolicyAsync(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 networkServicesClient.PollOnceDeleteEndpointPolicyAsync(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;
}

DeleteEndpointPolicyAsync(string, CancellationToken)

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

Deletes a single EndpointPolicy.

Parameters
Name Description
name string

Required. A name of the EndpointPolicy to delete. Must be in the format projects/*/locations/global/endpointPolicies/*.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/endpointPolicies/[ENDPOINT_POLICY]";
// Make the request
Operation<Empty, OperationMetadata> response = await networkServicesClient.DeleteEndpointPolicyAsync(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 networkServicesClient.PollOnceDeleteEndpointPolicyAsync(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;
}

GetEndpointPolicy(EndpointPolicyName, CallSettings)

public virtual EndpointPolicy GetEndpointPolicy(EndpointPolicyName name, CallSettings callSettings = null)

Gets details of a single EndpointPolicy.

Parameters
Name Description
name EndpointPolicyName

Required. A name of the EndpointPolicy to get. Must be in the format projects/*/locations/global/endpointPolicies/*.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
EndpointPolicy

The RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = NetworkServicesClient.Create();
// Initialize request argument(s)
EndpointPolicyName name = EndpointPolicyName.FromProjectLocationEndpointPolicy("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]");
// Make the request
EndpointPolicy response = networkServicesClient.GetEndpointPolicy(name);

GetEndpointPolicy(GetEndpointPolicyRequest, CallSettings)

public virtual EndpointPolicy GetEndpointPolicy(GetEndpointPolicyRequest request, CallSettings callSettings = null)

Gets details of a single EndpointPolicy.

Parameters
Name Description
request GetEndpointPolicyRequest

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
EndpointPolicy

The RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = NetworkServicesClient.Create();
// Initialize request argument(s)
GetEndpointPolicyRequest request = new GetEndpointPolicyRequest
{
    EndpointPolicyName = EndpointPolicyName.FromProjectLocationEndpointPolicy("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]"),
};
// Make the request
EndpointPolicy response = networkServicesClient.GetEndpointPolicy(request);

GetEndpointPolicy(string, CallSettings)

public virtual EndpointPolicy GetEndpointPolicy(string name, CallSettings callSettings = null)

Gets details of a single EndpointPolicy.

Parameters
Name Description
name string

Required. A name of the EndpointPolicy to get. Must be in the format projects/*/locations/global/endpointPolicies/*.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
EndpointPolicy

The RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = NetworkServicesClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/endpointPolicies/[ENDPOINT_POLICY]";
// Make the request
EndpointPolicy response = networkServicesClient.GetEndpointPolicy(name);

GetEndpointPolicyAsync(EndpointPolicyName, CallSettings)

public virtual Task<EndpointPolicy> GetEndpointPolicyAsync(EndpointPolicyName name, CallSettings callSettings = null)

Gets details of a single EndpointPolicy.

Parameters
Name Description
name EndpointPolicyName

Required. A name of the EndpointPolicy to get. Must be in the format projects/*/locations/global/endpointPolicies/*.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskEndpointPolicy

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
EndpointPolicyName name = EndpointPolicyName.FromProjectLocationEndpointPolicy("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]");
// Make the request
EndpointPolicy response = await networkServicesClient.GetEndpointPolicyAsync(name);

GetEndpointPolicyAsync(EndpointPolicyName, CancellationToken)

public virtual Task<EndpointPolicy> GetEndpointPolicyAsync(EndpointPolicyName name, CancellationToken cancellationToken)

Gets details of a single EndpointPolicy.

Parameters
Name Description
name EndpointPolicyName

Required. A name of the EndpointPolicy to get. Must be in the format projects/*/locations/global/endpointPolicies/*.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskEndpointPolicy

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
EndpointPolicyName name = EndpointPolicyName.FromProjectLocationEndpointPolicy("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]");
// Make the request
EndpointPolicy response = await networkServicesClient.GetEndpointPolicyAsync(name);

GetEndpointPolicyAsync(GetEndpointPolicyRequest, CallSettings)

public virtual Task<EndpointPolicy> GetEndpointPolicyAsync(GetEndpointPolicyRequest request, CallSettings callSettings = null)

Gets details of a single EndpointPolicy.

Parameters
Name Description
request GetEndpointPolicyRequest

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
TaskEndpointPolicy

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
GetEndpointPolicyRequest request = new GetEndpointPolicyRequest
{
    EndpointPolicyName = EndpointPolicyName.FromProjectLocationEndpointPolicy("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]"),
};
// Make the request
EndpointPolicy response = await networkServicesClient.GetEndpointPolicyAsync(request);

GetEndpointPolicyAsync(GetEndpointPolicyRequest, CancellationToken)

public virtual Task<EndpointPolicy> GetEndpointPolicyAsync(GetEndpointPolicyRequest request, CancellationToken cancellationToken)

Gets details of a single EndpointPolicy.

Parameters
Name Description
request GetEndpointPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskEndpointPolicy

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
GetEndpointPolicyRequest request = new GetEndpointPolicyRequest
{
    EndpointPolicyName = EndpointPolicyName.FromProjectLocationEndpointPolicy("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]"),
};
// Make the request
EndpointPolicy response = await networkServicesClient.GetEndpointPolicyAsync(request);

GetEndpointPolicyAsync(string, CallSettings)

public virtual Task<EndpointPolicy> GetEndpointPolicyAsync(string name, CallSettings callSettings = null)

Gets details of a single EndpointPolicy.

Parameters
Name Description
name string

Required. A name of the EndpointPolicy to get. Must be in the format projects/*/locations/global/endpointPolicies/*.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskEndpointPolicy

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/endpointPolicies/[ENDPOINT_POLICY]";
// Make the request
EndpointPolicy response = await networkServicesClient.GetEndpointPolicyAsync(name);

GetEndpointPolicyAsync(string, CancellationToken)

public virtual Task<EndpointPolicy> GetEndpointPolicyAsync(string name, CancellationToken cancellationToken)

Gets details of a single EndpointPolicy.

Parameters
Name Description
name string

Required. A name of the EndpointPolicy to get. Must be in the format projects/*/locations/global/endpointPolicies/*.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskEndpointPolicy

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/endpointPolicies/[ENDPOINT_POLICY]";
// Make the request
EndpointPolicy response = await networkServicesClient.GetEndpointPolicyAsync(name);

ListEndpointPolicies(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListEndpointPoliciesResponse, EndpointPolicy> ListEndpointPolicies(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists EndpointPolicies in a given project and location.

Parameters
Name Description
parent LocationName

Required. The project and location from which the EndpointPolicies should be listed, specified in the format projects/*/locations/global.

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
PagedEnumerableListEndpointPoliciesResponseEndpointPolicy

A pageable sequence of EndpointPolicy resources.

Example
// Create client
NetworkServicesClient networkServicesClient = NetworkServicesClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListEndpointPoliciesResponse, EndpointPolicy> response = networkServicesClient.ListEndpointPolicies(parent);

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

ListEndpointPolicies(ListEndpointPoliciesRequest, CallSettings)

public virtual PagedEnumerable<ListEndpointPoliciesResponse, EndpointPolicy> ListEndpointPolicies(ListEndpointPoliciesRequest request, CallSettings callSettings = null)

Lists EndpointPolicies in a given project and location.

Parameters
Name Description
request ListEndpointPoliciesRequest

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
PagedEnumerableListEndpointPoliciesResponseEndpointPolicy

A pageable sequence of EndpointPolicy resources.

Example
// Create client
NetworkServicesClient networkServicesClient = NetworkServicesClient.Create();
// Initialize request argument(s)
ListEndpointPoliciesRequest request = new ListEndpointPoliciesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedEnumerable<ListEndpointPoliciesResponse, EndpointPolicy> response = networkServicesClient.ListEndpointPolicies(request);

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

ListEndpointPolicies(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListEndpointPoliciesResponse, EndpointPolicy> ListEndpointPolicies(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists EndpointPolicies in a given project and location.

Parameters
Name Description
parent string

Required. The project and location from which the EndpointPolicies should be listed, specified in the format projects/*/locations/global.

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
PagedEnumerableListEndpointPoliciesResponseEndpointPolicy

A pageable sequence of EndpointPolicy resources.

Example
// Create client
NetworkServicesClient networkServicesClient = NetworkServicesClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListEndpointPoliciesResponse, EndpointPolicy> response = networkServicesClient.ListEndpointPolicies(parent);

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

ListEndpointPoliciesAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListEndpointPoliciesResponse, EndpointPolicy> ListEndpointPoliciesAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists EndpointPolicies in a given project and location.

Parameters
Name Description
parent LocationName

Required. The project and location from which the EndpointPolicies should be listed, specified in the format projects/*/locations/global.

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
PagedAsyncEnumerableListEndpointPoliciesResponseEndpointPolicy

A pageable asynchronous sequence of EndpointPolicy resources.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListEndpointPoliciesResponse, EndpointPolicy> response = networkServicesClient.ListEndpointPoliciesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await foreach (EndpointPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListEndpointPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (EndpointPolicy 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<EndpointPolicy> 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 (EndpointPolicy 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;

ListEndpointPoliciesAsync(ListEndpointPoliciesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListEndpointPoliciesResponse, EndpointPolicy> ListEndpointPoliciesAsync(ListEndpointPoliciesRequest request, CallSettings callSettings = null)

Lists EndpointPolicies in a given project and location.

Parameters
Name Description
request ListEndpointPoliciesRequest

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
PagedAsyncEnumerableListEndpointPoliciesResponseEndpointPolicy

A pageable asynchronous sequence of EndpointPolicy resources.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
ListEndpointPoliciesRequest request = new ListEndpointPoliciesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedAsyncEnumerable<ListEndpointPoliciesResponse, EndpointPolicy> response = networkServicesClient.ListEndpointPoliciesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await foreach (EndpointPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListEndpointPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (EndpointPolicy 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<EndpointPolicy> 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 (EndpointPolicy 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;

ListEndpointPoliciesAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListEndpointPoliciesResponse, EndpointPolicy> ListEndpointPoliciesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists EndpointPolicies in a given project and location.

Parameters
Name Description
parent string

Required. The project and location from which the EndpointPolicies should be listed, specified in the format projects/*/locations/global.

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
PagedAsyncEnumerableListEndpointPoliciesResponseEndpointPolicy

A pageable asynchronous sequence of EndpointPolicy resources.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListEndpointPoliciesResponse, EndpointPolicy> response = networkServicesClient.ListEndpointPoliciesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await foreach (EndpointPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListEndpointPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (EndpointPolicy 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<EndpointPolicy> 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 (EndpointPolicy 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;

PollOnceCreateEndpointPolicy(string, CallSettings)

public virtual Operation<EndpointPolicy, OperationMetadata> PollOnceCreateEndpointPolicy(string operationName, CallSettings callSettings = null)

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

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
OperationEndpointPolicyOperationMetadata

The result of polling the operation.

PollOnceCreateEndpointPolicyAsync(string, CallSettings)

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

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

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
TaskOperationEndpointPolicyOperationMetadata

A task representing the result of polling the operation.

PollOnceDeleteEndpointPolicy(string, CallSettings)

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

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

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.

PollOnceDeleteEndpointPolicyAsync(string, CallSettings)

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

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

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.

PollOnceUpdateEndpointPolicy(string, CallSettings)

public virtual Operation<EndpointPolicy, OperationMetadata> PollOnceUpdateEndpointPolicy(string operationName, CallSettings callSettings = null)

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

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
OperationEndpointPolicyOperationMetadata

The result of polling the operation.

PollOnceUpdateEndpointPolicyAsync(string, CallSettings)

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

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

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
TaskOperationEndpointPolicyOperationMetadata

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.

UpdateEndpointPolicy(EndpointPolicy, FieldMask, CallSettings)

public virtual Operation<EndpointPolicy, OperationMetadata> UpdateEndpointPolicy(EndpointPolicy endpointPolicy, FieldMask updateMask, CallSettings callSettings = null)

Updates the parameters of a single EndpointPolicy.

Parameters
Name Description
endpointPolicy EndpointPolicy

Required. Updated EndpointPolicy resource.

updateMask FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the EndpointPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEndpointPolicyOperationMetadata

The RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = NetworkServicesClient.Create();
// Initialize request argument(s)
EndpointPolicy endpointPolicy = new EndpointPolicy();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<EndpointPolicy, OperationMetadata> response = networkServicesClient.UpdateEndpointPolicy(endpointPolicy, updateMask);

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

UpdateEndpointPolicy(UpdateEndpointPolicyRequest, CallSettings)

public virtual Operation<EndpointPolicy, OperationMetadata> UpdateEndpointPolicy(UpdateEndpointPolicyRequest request, CallSettings callSettings = null)

Updates the parameters of a single EndpointPolicy.

Parameters
Name Description
request UpdateEndpointPolicyRequest

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
OperationEndpointPolicyOperationMetadata

The RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = NetworkServicesClient.Create();
// Initialize request argument(s)
UpdateEndpointPolicyRequest request = new UpdateEndpointPolicyRequest
{
    UpdateMask = new FieldMask(),
    EndpointPolicy = new EndpointPolicy(),
};
// Make the request
Operation<EndpointPolicy, OperationMetadata> response = networkServicesClient.UpdateEndpointPolicy(request);

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

UpdateEndpointPolicyAsync(EndpointPolicy, FieldMask, CallSettings)

public virtual Task<Operation<EndpointPolicy, OperationMetadata>> UpdateEndpointPolicyAsync(EndpointPolicy endpointPolicy, FieldMask updateMask, CallSettings callSettings = null)

Updates the parameters of a single EndpointPolicy.

Parameters
Name Description
endpointPolicy EndpointPolicy

Required. Updated EndpointPolicy resource.

updateMask FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the EndpointPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEndpointPolicyOperationMetadata

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
EndpointPolicy endpointPolicy = new EndpointPolicy();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<EndpointPolicy, OperationMetadata> response = await networkServicesClient.UpdateEndpointPolicyAsync(endpointPolicy, updateMask);

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

UpdateEndpointPolicyAsync(EndpointPolicy, FieldMask, CancellationToken)

public virtual Task<Operation<EndpointPolicy, OperationMetadata>> UpdateEndpointPolicyAsync(EndpointPolicy endpointPolicy, FieldMask updateMask, CancellationToken cancellationToken)

Updates the parameters of a single EndpointPolicy.

Parameters
Name Description
endpointPolicy EndpointPolicy

Required. Updated EndpointPolicy resource.

updateMask FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the EndpointPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEndpointPolicyOperationMetadata

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
EndpointPolicy endpointPolicy = new EndpointPolicy();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<EndpointPolicy, OperationMetadata> response = await networkServicesClient.UpdateEndpointPolicyAsync(endpointPolicy, updateMask);

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

UpdateEndpointPolicyAsync(UpdateEndpointPolicyRequest, CallSettings)

public virtual Task<Operation<EndpointPolicy, OperationMetadata>> UpdateEndpointPolicyAsync(UpdateEndpointPolicyRequest request, CallSettings callSettings = null)

Updates the parameters of a single EndpointPolicy.

Parameters
Name Description
request UpdateEndpointPolicyRequest

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
TaskOperationEndpointPolicyOperationMetadata

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
UpdateEndpointPolicyRequest request = new UpdateEndpointPolicyRequest
{
    UpdateMask = new FieldMask(),
    EndpointPolicy = new EndpointPolicy(),
};
// Make the request
Operation<EndpointPolicy, OperationMetadata> response = await networkServicesClient.UpdateEndpointPolicyAsync(request);

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

UpdateEndpointPolicyAsync(UpdateEndpointPolicyRequest, CancellationToken)

public virtual Task<Operation<EndpointPolicy, OperationMetadata>> UpdateEndpointPolicyAsync(UpdateEndpointPolicyRequest request, CancellationToken cancellationToken)

Updates the parameters of a single EndpointPolicy.

Parameters
Name Description
request UpdateEndpointPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEndpointPolicyOperationMetadata

A Task containing the RPC response.

Example
// Create client
NetworkServicesClient networkServicesClient = await NetworkServicesClient.CreateAsync();
// Initialize request argument(s)
UpdateEndpointPolicyRequest request = new UpdateEndpointPolicyRequest
{
    UpdateMask = new FieldMask(),
    EndpointPolicy = new EndpointPolicy(),
};
// Make the request
Operation<EndpointPolicy, OperationMetadata> response = await networkServicesClient.UpdateEndpointPolicyAsync(request);

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