Class ServicesClient (1.0.0-beta02)

public abstract class ServicesClient

Services client wrapper, for convenient use.

Inheritance

Object > ServicesClient

Derived Types

Namespace

Google.Cloud.Run.V2

Assembly

Google.Cloud.Run.V2.dll

Remarks

Cloud Run Service Control Plane API

Properties

CreateServiceOperationsClient

public virtual OperationsClient CreateServiceOperationsClient { get; }

The long-running operations client for CreateService.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Services scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default Services scopes are:

DeleteServiceOperationsClient

public virtual OperationsClient DeleteServiceOperationsClient { get; }

The long-running operations client for DeleteService.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual Services.ServicesClient GrpcClient { get; }

The underlying gRPC Services client

Property Value
TypeDescription
Services.ServicesClient

UpdateServiceOperationsClient

public virtual OperationsClient UpdateServiceOperationsClient { get; }

The long-running operations client for UpdateService.

Property Value
TypeDescription
OperationsClient

Methods

Create()

public static ServicesClient Create()

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

Returns
TypeDescription
ServicesClient

The created ServicesClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<ServicesClient>

The task representing the created ServicesClient.

CreateService(LocationName, Service, String, CallSettings)

public virtual Operation<Service, Service> CreateService(LocationName parent, Service service, string serviceId, CallSettings callSettings = null)

Creates a new Service in a given project and location.

Parameters
NameDescription
parentLocationName

Required. The location and project in which this service should be created. Format: projects/{projectnumber}/locations/{location}

serviceService

Required. The Service instance to create.

serviceIdString

Required. The unique identifier for the Service. The name of the service becomes {parent}/services/{service_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Service, Service>

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Service service = new Service();
string serviceId = "";
// Make the request
Operation<Service, Service> response = servicesClient.CreateService(parent, service, serviceId);

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

CreateService(CreateServiceRequest, CallSettings)

public virtual Operation<Service, Service> CreateService(CreateServiceRequest request, CallSettings callSettings = null)

Creates a new Service in a given project and location.

Parameters
NameDescription
requestCreateServiceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Service, Service>

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
CreateServiceRequest request = new CreateServiceRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Service = new Service(),
    ServiceId = "",
    ValidateOnly = false,
};
// Make the request
Operation<Service, Service> response = servicesClient.CreateService(request);

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

CreateService(String, Service, String, CallSettings)

public virtual Operation<Service, Service> CreateService(string parent, Service service, string serviceId, CallSettings callSettings = null)

Creates a new Service in a given project and location.

Parameters
NameDescription
parentString

Required. The location and project in which this service should be created. Format: projects/{projectnumber}/locations/{location}

serviceService

Required. The Service instance to create.

serviceIdString

Required. The unique identifier for the Service. The name of the service becomes {parent}/services/{service_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Service, Service>

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Service service = new Service();
string serviceId = "";
// Make the request
Operation<Service, Service> response = servicesClient.CreateService(parent, service, serviceId);

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

CreateServiceAsync(LocationName, Service, String, CallSettings)

public virtual Task<Operation<Service, Service>> CreateServiceAsync(LocationName parent, Service service, string serviceId, CallSettings callSettings = null)

Creates a new Service in a given project and location.

Parameters
NameDescription
parentLocationName

Required. The location and project in which this service should be created. Format: projects/{projectnumber}/locations/{location}

serviceService

Required. The Service instance to create.

serviceIdString

Required. The unique identifier for the Service. The name of the service becomes {parent}/services/{service_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Service, Service>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Service service = new Service();
string serviceId = "";
// Make the request
Operation<Service, Service> response = await servicesClient.CreateServiceAsync(parent, service, serviceId);

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

CreateServiceAsync(LocationName, Service, String, CancellationToken)

public virtual Task<Operation<Service, Service>> CreateServiceAsync(LocationName parent, Service service, string serviceId, CancellationToken cancellationToken)

Creates a new Service in a given project and location.

Parameters
NameDescription
parentLocationName

Required. The location and project in which this service should be created. Format: projects/{projectnumber}/locations/{location}

serviceService

Required. The Service instance to create.

serviceIdString

Required. The unique identifier for the Service. The name of the service becomes {parent}/services/{service_id}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Service, Service>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Service service = new Service();
string serviceId = "";
// Make the request
Operation<Service, Service> response = await servicesClient.CreateServiceAsync(parent, service, serviceId);

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

CreateServiceAsync(CreateServiceRequest, CallSettings)

public virtual Task<Operation<Service, Service>> CreateServiceAsync(CreateServiceRequest request, CallSettings callSettings = null)

Creates a new Service in a given project and location.

Parameters
NameDescription
requestCreateServiceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Service, Service>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
CreateServiceRequest request = new CreateServiceRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Service = new Service(),
    ServiceId = "",
    ValidateOnly = false,
};
// Make the request
Operation<Service, Service> response = await servicesClient.CreateServiceAsync(request);

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

CreateServiceAsync(CreateServiceRequest, CancellationToken)

public virtual Task<Operation<Service, Service>> CreateServiceAsync(CreateServiceRequest request, CancellationToken cancellationToken)

Creates a new Service in a given project and location.

Parameters
NameDescription
requestCreateServiceRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Service, Service>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
CreateServiceRequest request = new CreateServiceRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Service = new Service(),
    ServiceId = "",
    ValidateOnly = false,
};
// Make the request
Operation<Service, Service> response = await servicesClient.CreateServiceAsync(request);

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

CreateServiceAsync(String, Service, String, CallSettings)

public virtual Task<Operation<Service, Service>> CreateServiceAsync(string parent, Service service, string serviceId, CallSettings callSettings = null)

Creates a new Service in a given project and location.

Parameters
NameDescription
parentString

Required. The location and project in which this service should be created. Format: projects/{projectnumber}/locations/{location}

serviceService

Required. The Service instance to create.

serviceIdString

Required. The unique identifier for the Service. The name of the service becomes {parent}/services/{service_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Service, Service>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Service service = new Service();
string serviceId = "";
// Make the request
Operation<Service, Service> response = await servicesClient.CreateServiceAsync(parent, service, serviceId);

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

CreateServiceAsync(String, Service, String, CancellationToken)

public virtual Task<Operation<Service, Service>> CreateServiceAsync(string parent, Service service, string serviceId, CancellationToken cancellationToken)

Creates a new Service in a given project and location.

Parameters
NameDescription
parentString

Required. The location and project in which this service should be created. Format: projects/{projectnumber}/locations/{location}

serviceService

Required. The Service instance to create.

serviceIdString

Required. The unique identifier for the Service. The name of the service becomes {parent}/services/{service_id}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Service, Service>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Service service = new Service();
string serviceId = "";
// Make the request
Operation<Service, Service> response = await servicesClient.CreateServiceAsync(parent, service, serviceId);

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

DeleteService(DeleteServiceRequest, CallSettings)

public virtual Operation<Service, Service> DeleteService(DeleteServiceRequest request, CallSettings callSettings = null)

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
NameDescription
requestDeleteServiceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Service, Service>

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
DeleteServiceRequest request = new DeleteServiceRequest
{
    ServiceName = ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]"),
    ValidateOnly = false,
    Etag = "",
};
// Make the request
Operation<Service, Service> response = servicesClient.DeleteService(request);

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

DeleteService(ServiceName, CallSettings)

public virtual Operation<Service, Service> DeleteService(ServiceName name, CallSettings callSettings = null)

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
NameDescription
nameServiceName

Required. The full name of the Service. Format: projects/{projectnumber}/locations/{location}/services/{service}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Service, Service>

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
ServiceName name = ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]");
// Make the request
Operation<Service, Service> response = servicesClient.DeleteService(name);

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

DeleteService(String, CallSettings)

public virtual Operation<Service, Service> DeleteService(string name, CallSettings callSettings = null)

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
NameDescription
nameString

Required. The full name of the Service. Format: projects/{projectnumber}/locations/{location}/services/{service}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Service, Service>

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/services/[SERVICE]";
// Make the request
Operation<Service, Service> response = servicesClient.DeleteService(name);

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

DeleteServiceAsync(DeleteServiceRequest, CallSettings)

public virtual Task<Operation<Service, Service>> DeleteServiceAsync(DeleteServiceRequest request, CallSettings callSettings = null)

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
NameDescription
requestDeleteServiceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Service, Service>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
DeleteServiceRequest request = new DeleteServiceRequest
{
    ServiceName = ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]"),
    ValidateOnly = false,
    Etag = "",
};
// Make the request
Operation<Service, Service> response = await servicesClient.DeleteServiceAsync(request);

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

DeleteServiceAsync(DeleteServiceRequest, CancellationToken)

public virtual Task<Operation<Service, Service>> DeleteServiceAsync(DeleteServiceRequest request, CancellationToken cancellationToken)

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
NameDescription
requestDeleteServiceRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Service, Service>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
DeleteServiceRequest request = new DeleteServiceRequest
{
    ServiceName = ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]"),
    ValidateOnly = false,
    Etag = "",
};
// Make the request
Operation<Service, Service> response = await servicesClient.DeleteServiceAsync(request);

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

DeleteServiceAsync(ServiceName, CallSettings)

public virtual Task<Operation<Service, Service>> DeleteServiceAsync(ServiceName name, CallSettings callSettings = null)

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
NameDescription
nameServiceName

Required. The full name of the Service. Format: projects/{projectnumber}/locations/{location}/services/{service}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Service, Service>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
ServiceName name = ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]");
// Make the request
Operation<Service, Service> response = await servicesClient.DeleteServiceAsync(name);

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

DeleteServiceAsync(ServiceName, CancellationToken)

public virtual Task<Operation<Service, Service>> DeleteServiceAsync(ServiceName name, CancellationToken cancellationToken)

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
NameDescription
nameServiceName

Required. The full name of the Service. Format: projects/{projectnumber}/locations/{location}/services/{service}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Service, Service>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
ServiceName name = ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]");
// Make the request
Operation<Service, Service> response = await servicesClient.DeleteServiceAsync(name);

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

DeleteServiceAsync(String, CallSettings)

public virtual Task<Operation<Service, Service>> DeleteServiceAsync(string name, CallSettings callSettings = null)

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
NameDescription
nameString

Required. The full name of the Service. Format: projects/{projectnumber}/locations/{location}/services/{service}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Service, Service>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/services/[SERVICE]";
// Make the request
Operation<Service, Service> response = await servicesClient.DeleteServiceAsync(name);

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

DeleteServiceAsync(String, CancellationToken)

public virtual Task<Operation<Service, Service>> DeleteServiceAsync(string name, CancellationToken cancellationToken)

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
NameDescription
nameString

Required. The full name of the Service. Format: projects/{projectnumber}/locations/{location}/services/{service}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Service, Service>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/services/[SERVICE]";
// Make the request
Operation<Service, Service> response = await servicesClient.DeleteServiceAsync(name);

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

GetIamPolicy(GetIamPolicyRequest, CallSettings)

public virtual Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)

Get the IAM Access Control policy currently in effect for the given Cloud Run Service. This result does not include any inherited policies.

Parameters
NameDescription
requestGetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = servicesClient.GetIamPolicy(request);

GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)

Get the IAM Access Control policy currently in effect for the given Cloud Run Service. This result does not include any inherited policies.

Parameters
NameDescription
requestGetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await servicesClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(GetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CancellationToken cancellationToken)

Get the IAM Access Control policy currently in effect for the given Cloud Run Service. This result does not include any inherited policies.

Parameters
NameDescription
requestGetIamPolicyRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await servicesClient.GetIamPolicyAsync(request);

GetService(GetServiceRequest, CallSettings)

public virtual Service GetService(GetServiceRequest request, CallSettings callSettings = null)

Gets information about a Service.

Parameters
NameDescription
requestGetServiceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Service

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
GetServiceRequest request = new GetServiceRequest
{
    ServiceName = ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]"),
};
// Make the request
Service response = servicesClient.GetService(request);

GetService(ServiceName, CallSettings)

public virtual Service GetService(ServiceName name, CallSettings callSettings = null)

Gets information about a Service.

Parameters
NameDescription
nameServiceName

Required. The full name of the Service. Format: projects/{projectnumber}/locations/{location}/services/{service}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Service

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
ServiceName name = ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]");
// Make the request
Service response = servicesClient.GetService(name);

GetService(String, CallSettings)

public virtual Service GetService(string name, CallSettings callSettings = null)

Gets information about a Service.

Parameters
NameDescription
nameString

Required. The full name of the Service. Format: projects/{projectnumber}/locations/{location}/services/{service}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Service

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/services/[SERVICE]";
// Make the request
Service response = servicesClient.GetService(name);

GetServiceAsync(GetServiceRequest, CallSettings)

public virtual Task<Service> GetServiceAsync(GetServiceRequest request, CallSettings callSettings = null)

Gets information about a Service.

Parameters
NameDescription
requestGetServiceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Service>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
GetServiceRequest request = new GetServiceRequest
{
    ServiceName = ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]"),
};
// Make the request
Service response = await servicesClient.GetServiceAsync(request);

GetServiceAsync(GetServiceRequest, CancellationToken)

public virtual Task<Service> GetServiceAsync(GetServiceRequest request, CancellationToken cancellationToken)

Gets information about a Service.

Parameters
NameDescription
requestGetServiceRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Service>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
GetServiceRequest request = new GetServiceRequest
{
    ServiceName = ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]"),
};
// Make the request
Service response = await servicesClient.GetServiceAsync(request);

GetServiceAsync(ServiceName, CallSettings)

public virtual Task<Service> GetServiceAsync(ServiceName name, CallSettings callSettings = null)

Gets information about a Service.

Parameters
NameDescription
nameServiceName

Required. The full name of the Service. Format: projects/{projectnumber}/locations/{location}/services/{service}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Service>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
ServiceName name = ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]");
// Make the request
Service response = await servicesClient.GetServiceAsync(name);

GetServiceAsync(ServiceName, CancellationToken)

public virtual Task<Service> GetServiceAsync(ServiceName name, CancellationToken cancellationToken)

Gets information about a Service.

Parameters
NameDescription
nameServiceName

Required. The full name of the Service. Format: projects/{projectnumber}/locations/{location}/services/{service}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Service>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
ServiceName name = ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]");
// Make the request
Service response = await servicesClient.GetServiceAsync(name);

GetServiceAsync(String, CallSettings)

public virtual Task<Service> GetServiceAsync(string name, CallSettings callSettings = null)

Gets information about a Service.

Parameters
NameDescription
nameString

Required. The full name of the Service. Format: projects/{projectnumber}/locations/{location}/services/{service}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Service>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/services/[SERVICE]";
// Make the request
Service response = await servicesClient.GetServiceAsync(name);

GetServiceAsync(String, CancellationToken)

public virtual Task<Service> GetServiceAsync(string name, CancellationToken cancellationToken)

Gets information about a Service.

Parameters
NameDescription
nameString

Required. The full name of the Service. Format: projects/{projectnumber}/locations/{location}/services/{service}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Service>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/services/[SERVICE]";
// Make the request
Service response = await servicesClient.GetServiceAsync(name);

ListServices(LocationName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListServicesResponse, Service> ListServices(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List Services.

Parameters
NameDescription
parentLocationName

Required. The location and project to list resources on. Location must be a valid GCP region, and may not be the "-" wildcard. Format: projects/{projectnumber}/locations/{location}

pageTokenString

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

pageSizeNullable<Int32>

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListServicesResponse, Service>

A pageable sequence of Service resources.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListServicesResponse, Service> response = servicesClient.ListServices(parent);

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

ListServices(ListServicesRequest, CallSettings)

public virtual PagedEnumerable<ListServicesResponse, Service> ListServices(ListServicesRequest request, CallSettings callSettings = null)

List Services.

Parameters
NameDescription
requestListServicesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListServicesResponse, Service>

A pageable sequence of Service resources.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
ListServicesRequest request = new ListServicesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    ShowDeleted = false,
};
// Make the request
PagedEnumerable<ListServicesResponse, Service> response = servicesClient.ListServices(request);

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

ListServices(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListServicesResponse, Service> ListServices(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List Services.

Parameters
NameDescription
parentString

Required. The location and project to list resources on. Location must be a valid GCP region, and may not be the "-" wildcard. Format: projects/{projectnumber}/locations/{location}

pageTokenString

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

pageSizeNullable<Int32>

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListServicesResponse, Service>

A pageable sequence of Service resources.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListServicesResponse, Service> response = servicesClient.ListServices(parent);

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

ListServicesAsync(LocationName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListServicesResponse, Service> ListServicesAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List Services.

Parameters
NameDescription
parentLocationName

Required. The location and project to list resources on. Location must be a valid GCP region, and may not be the "-" wildcard. Format: projects/{projectnumber}/locations/{location}

pageTokenString

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

pageSizeNullable<Int32>

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListServicesResponse, Service>

A pageable asynchronous sequence of Service resources.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListServicesResponse, Service> response = servicesClient.ListServicesAsync(parent);

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

ListServicesAsync(ListServicesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListServicesResponse, Service> ListServicesAsync(ListServicesRequest request, CallSettings callSettings = null)

List Services.

Parameters
NameDescription
requestListServicesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListServicesResponse, Service>

A pageable asynchronous sequence of Service resources.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
ListServicesRequest request = new ListServicesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    ShowDeleted = false,
};
// Make the request
PagedAsyncEnumerable<ListServicesResponse, Service> response = servicesClient.ListServicesAsync(request);

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

ListServicesAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListServicesResponse, Service> ListServicesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List Services.

Parameters
NameDescription
parentString

Required. The location and project to list resources on. Location must be a valid GCP region, and may not be the "-" wildcard. Format: projects/{projectnumber}/locations/{location}

pageTokenString

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

pageSizeNullable<Int32>

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListServicesResponse, Service>

A pageable asynchronous sequence of Service resources.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListServicesResponse, Service> response = servicesClient.ListServicesAsync(parent);

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

PollOnceCreateService(String, CallSettings)

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

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

Parameters
NameDescription
operationNameString

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Service, Service>

The result of polling the operation.

PollOnceCreateServiceAsync(String, CallSettings)

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

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

Parameters
NameDescription
operationNameString

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Service, Service>>

A task representing the result of polling the operation.

PollOnceDeleteService(String, CallSettings)

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

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

Parameters
NameDescription
operationNameString

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Service, Service>

The result of polling the operation.

PollOnceDeleteServiceAsync(String, CallSettings)

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

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

Parameters
NameDescription
operationNameString

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Service, Service>>

A task representing the result of polling the operation.

PollOnceUpdateService(String, CallSettings)

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

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

Parameters
NameDescription
operationNameString

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Service, Service>

The result of polling the operation.

PollOnceUpdateServiceAsync(String, CallSettings)

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

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

Parameters
NameDescription
operationNameString

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Service, Service>>

A task representing the result of polling the operation.

SetIamPolicy(SetIamPolicyRequest, CallSettings)

public virtual Policy SetIamPolicy(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the IAM Access control policy for the specified Service. Overwrites any existing policy.

Parameters
NameDescription
requestSetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = servicesClient.SetIamPolicy(request);

SetIamPolicyAsync(SetIamPolicyRequest, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the IAM Access control policy for the specified Service. Overwrites any existing policy.

Parameters
NameDescription
requestSetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = await servicesClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(SetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CancellationToken cancellationToken)

Sets the IAM Access control policy for the specified Service. Overwrites any existing policy.

Parameters
NameDescription
requestSetIamPolicyRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = await servicesClient.SetIamPolicyAsync(request);

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

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

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

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

TestIamPermissions(TestIamPermissionsRequest, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(TestIamPermissionsRequest request, CallSettings callSettings = null)

Returns permissions that a caller has on the specified Project.

There are no permissions required for making this API call.

Parameters
NameDescription
requestTestIamPermissionsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestIamPermissionsResponse

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = servicesClient.TestIamPermissions(request);

TestIamPermissionsAsync(TestIamPermissionsRequest, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CallSettings callSettings = null)

Returns permissions that a caller has on the specified Project.

There are no permissions required for making this API call.

Parameters
NameDescription
requestTestIamPermissionsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await servicesClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(TestIamPermissionsRequest, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CancellationToken cancellationToken)

Returns permissions that a caller has on the specified Project.

There are no permissions required for making this API call.

Parameters
NameDescription
requestTestIamPermissionsRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await servicesClient.TestIamPermissionsAsync(request);

UpdateService(Service, CallSettings)

public virtual Operation<Service, Service> UpdateService(Service service, CallSettings callSettings = null)

Updates a Service.

Parameters
NameDescription
serviceService

Required. The Service to be updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Service, Service>

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
Service service = new Service();
// Make the request
Operation<Service, Service> response = servicesClient.UpdateService(service);

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

UpdateService(UpdateServiceRequest, CallSettings)

public virtual Operation<Service, Service> UpdateService(UpdateServiceRequest request, CallSettings callSettings = null)

Updates a Service.

Parameters
NameDescription
requestUpdateServiceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Service, Service>

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
UpdateServiceRequest request = new UpdateServiceRequest
{
    Service = new Service(),
    ValidateOnly = false,
    AllowMissing = false,
};
// Make the request
Operation<Service, Service> response = servicesClient.UpdateService(request);

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

UpdateServiceAsync(Service, CallSettings)

public virtual Task<Operation<Service, Service>> UpdateServiceAsync(Service service, CallSettings callSettings = null)

Updates a Service.

Parameters
NameDescription
serviceService

Required. The Service to be updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Service, Service>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
Service service = new Service();
// Make the request
Operation<Service, Service> response = await servicesClient.UpdateServiceAsync(service);

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

UpdateServiceAsync(Service, CancellationToken)

public virtual Task<Operation<Service, Service>> UpdateServiceAsync(Service service, CancellationToken cancellationToken)

Updates a Service.

Parameters
NameDescription
serviceService

Required. The Service to be updated.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Service, Service>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
Service service = new Service();
// Make the request
Operation<Service, Service> response = await servicesClient.UpdateServiceAsync(service);

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

UpdateServiceAsync(UpdateServiceRequest, CallSettings)

public virtual Task<Operation<Service, Service>> UpdateServiceAsync(UpdateServiceRequest request, CallSettings callSettings = null)

Updates a Service.

Parameters
NameDescription
requestUpdateServiceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Service, Service>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
UpdateServiceRequest request = new UpdateServiceRequest
{
    Service = new Service(),
    ValidateOnly = false,
    AllowMissing = false,
};
// Make the request
Operation<Service, Service> response = await servicesClient.UpdateServiceAsync(request);

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

UpdateServiceAsync(UpdateServiceRequest, CancellationToken)

public virtual Task<Operation<Service, Service>> UpdateServiceAsync(UpdateServiceRequest request, CancellationToken cancellationToken)

Updates a Service.

Parameters
NameDescription
requestUpdateServiceRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Service, Service>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
UpdateServiceRequest request = new UpdateServiceRequest
{
    Service = new Service(),
    ValidateOnly = false,
    AllowMissing = false,
};
// Make the request
Operation<Service, Service> response = await servicesClient.UpdateServiceAsync(request);

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