Service Usage v1 API - Class ServiceUsageClientImpl (2.2.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
NameDescription
grpcClientServiceUsageServiceUsageClient

The underlying gRPC client.

settingsServiceUsageSettings

The base ServiceUsageSettings used within this client.

loggerILogger

Optional ILogger to use within this client.

Properties

BatchEnableServicesOperationsClient

public override OperationsClient BatchEnableServicesOperationsClient { get; }

The long-running operations client for BatchEnableServices.

Property Value
TypeDescription
OperationsClient
Overrides

DisableServiceOperationsClient

public override OperationsClient DisableServiceOperationsClient { get; }

The long-running operations client for DisableService.

Property Value
TypeDescription
OperationsClient
Overrides

EnableServiceOperationsClient

public override OperationsClient EnableServiceOperationsClient { get; }

The long-running operations client for EnableService.

Property Value
TypeDescription
OperationsClient
Overrides

GrpcClient

public override ServiceUsage.ServiceUsageClient GrpcClient { get; }

The underlying gRPC ServiceUsage client

Property Value
TypeDescription
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
NameDescription
requestBatchEnableServicesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestBatchEnableServicesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestBatchGetServicesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestBatchGetServicesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestDisableServiceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestDisableServiceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestEnableServiceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestEnableServiceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
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.

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
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
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
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
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
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
PagedAsyncEnumerableListServicesResponseService

A pageable asynchronous sequence of Service resources.

Overrides