Service Usage v1 API - Class ServiceUsageClientImpl (2.4.0)

public sealed class ServiceUsageClientImpl : ServiceUsageClient

Reference documentation and code samples for the Service Usage v1 API class ServiceUsageClientImpl.

ServiceUsage client wrapper implementation, for convenient use.

Inheritance

object > ServiceUsageClient > ServiceUsageClientImpl

Namespace

Google.Cloud.ServiceUsage.V1

Assembly

Google.Cloud.ServiceUsage.V1.dll

Remarks

Enables services that service consumers want to use on Google Cloud Platform, lists the available or enabled services, or disables services that service consumers no longer use.

See Service Usage API

Constructors

ServiceUsageClientImpl(ServiceUsageClient, ServiceUsageSettings, ILogger)

public ServiceUsageClientImpl(ServiceUsage.ServiceUsageClient grpcClient, ServiceUsageSettings settings, ILogger logger)

Constructs a client wrapper for the ServiceUsage service, with the specified gRPC client and settings.

Parameters
Name Description
grpcClient ServiceUsageServiceUsageClient

The underlying gRPC client.

settings ServiceUsageSettings

The base ServiceUsageSettings used within this client.

logger ILogger

Optional ILogger to use within this client.

Properties

BatchEnableServicesOperationsClient

public override OperationsClient BatchEnableServicesOperationsClient { get; }

The long-running operations client for BatchEnableServices.

Property Value
Type Description
OperationsClient
Overrides

DisableServiceOperationsClient

public override OperationsClient DisableServiceOperationsClient { get; }

The long-running operations client for DisableService.

Property Value
Type Description
OperationsClient
Overrides

EnableServiceOperationsClient

public override OperationsClient EnableServiceOperationsClient { get; }

The long-running operations client for EnableService.

Property Value
Type Description
OperationsClient
Overrides

GrpcClient

public override ServiceUsage.ServiceUsageClient GrpcClient { get; }

The underlying gRPC ServiceUsage client

Property Value
Type Description
ServiceUsageServiceUsageClient
Overrides

Methods

BatchEnableServices(BatchEnableServicesRequest, CallSettings)

public override Operation<BatchEnableServicesResponse, OperationMetadata> BatchEnableServices(BatchEnableServicesRequest request, CallSettings callSettings = null)

Enable multiple services on a project. The operation is atomic: if enabling any service fails, then the entire batch fails, and no state changes occur. To enable a single service, use the EnableService method instead.

Parameters
Name Description
request BatchEnableServicesRequest

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
OperationBatchEnableServicesResponseOperationMetadata

The RPC response.

Overrides

BatchEnableServicesAsync(BatchEnableServicesRequest, CallSettings)

public override Task<Operation<BatchEnableServicesResponse, OperationMetadata>> BatchEnableServicesAsync(BatchEnableServicesRequest request, CallSettings callSettings = null)

Enable multiple services on a project. The operation is atomic: if enabling any service fails, then the entire batch fails, and no state changes occur. To enable a single service, use the EnableService method instead.

Parameters
Name Description
request BatchEnableServicesRequest

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
TaskOperationBatchEnableServicesResponseOperationMetadata

A Task containing the RPC response.

Overrides

BatchGetServices(BatchGetServicesRequest, CallSettings)

public override BatchGetServicesResponse BatchGetServices(BatchGetServicesRequest request, CallSettings callSettings = null)

Returns the service configurations and enabled states for a given list of services.

Parameters
Name Description
request BatchGetServicesRequest

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
BatchGetServicesResponse

The RPC response.

Overrides

BatchGetServicesAsync(BatchGetServicesRequest, CallSettings)

public override Task<BatchGetServicesResponse> BatchGetServicesAsync(BatchGetServicesRequest request, CallSettings callSettings = null)

Returns the service configurations and enabled states for a given list of services.

Parameters
Name Description
request BatchGetServicesRequest

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
TaskBatchGetServicesResponse

A Task containing the RPC response.

Overrides

DisableService(DisableServiceRequest, CallSettings)

public override Operation<DisableServiceResponse, OperationMetadata> DisableService(DisableServiceRequest request, CallSettings callSettings = null)

Disable a service so that it can no longer be used with a project. This prevents unintended usage that may cause unexpected billing charges or security leaks.

It is not valid to call the disable method on a service that is not currently enabled. Callers will receive a FAILED_PRECONDITION status if the target service is not currently enabled.

Parameters
Name Description
request DisableServiceRequest

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
OperationDisableServiceResponseOperationMetadata

The RPC response.

Overrides

DisableServiceAsync(DisableServiceRequest, CallSettings)

public override Task<Operation<DisableServiceResponse, OperationMetadata>> DisableServiceAsync(DisableServiceRequest request, CallSettings callSettings = null)

Disable a service so that it can no longer be used with a project. This prevents unintended usage that may cause unexpected billing charges or security leaks.

It is not valid to call the disable method on a service that is not currently enabled. Callers will receive a FAILED_PRECONDITION status if the target service is not currently enabled.

Parameters
Name Description
request DisableServiceRequest

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
TaskOperationDisableServiceResponseOperationMetadata

A Task containing the RPC response.

Overrides

EnableService(EnableServiceRequest, CallSettings)

public override Operation<EnableServiceResponse, OperationMetadata> EnableService(EnableServiceRequest request, CallSettings callSettings = null)

Enable a service so that it can be used with a project.

Parameters
Name Description
request EnableServiceRequest

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
OperationEnableServiceResponseOperationMetadata

The RPC response.

Overrides

EnableServiceAsync(EnableServiceRequest, CallSettings)

public override Task<Operation<EnableServiceResponse, OperationMetadata>> EnableServiceAsync(EnableServiceRequest request, CallSettings callSettings = null)

Enable a service so that it can be used with a project.

Parameters
Name Description
request EnableServiceRequest

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
TaskOperationEnableServiceResponseOperationMetadata

A Task containing the RPC response.

Overrides

GetService(GetServiceRequest, CallSettings)

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

Returns the service configuration and enabled state for a given service.

Parameters
Name Description
request GetServiceRequest

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
Service

The RPC response.

Overrides

GetServiceAsync(GetServiceRequest, CallSettings)

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

Returns the service configuration and enabled state for a given service.

Parameters
Name Description
request GetServiceRequest

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
TaskService

A Task containing the RPC response.

Overrides

ListServices(ListServicesRequest, CallSettings)

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

List all services available to the specified project, and the current state of those services with respect to the project. The list includes all public services, all services for which the calling user has the servicemanagement.services.bind permission, and all services that have already been enabled on the project. The list can be filtered to only include services in a specific state, for example to only include services enabled on the project.

WARNING: If you need to query enabled services frequently or across an organization, you should use Cloud Asset Inventory API, which provides higher throughput and richer filtering capability.

Parameters
Name Description
request ListServicesRequest

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
PagedEnumerableListServicesResponseService

A pageable sequence of Service resources.

Overrides

ListServicesAsync(ListServicesRequest, CallSettings)

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

List all services available to the specified project, and the current state of those services with respect to the project. The list includes all public services, all services for which the calling user has the servicemanagement.services.bind permission, and all services that have already been enabled on the project. The list can be filtered to only include services in a specific state, for example to only include services enabled on the project.

WARNING: If you need to query enabled services frequently or across an organization, you should use Cloud Asset Inventory API, which provides higher throughput and richer filtering capability.

Parameters
Name Description
request ListServicesRequest

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
PagedAsyncEnumerableListServicesResponseService

A pageable asynchronous sequence of Service resources.

Overrides