Service Usage v1 API - Class ServiceUsage.ServiceUsageClient (2.4.0)

public class ServiceUsage.ServiceUsageClient : ClientBase<ServiceUsage.ServiceUsageClient>

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

Client for ServiceUsage

Inheritance

object > ClientBase > ClientBaseServiceUsageServiceUsageClient > ServiceUsage.ServiceUsageClient

Namespace

Google.Cloud.ServiceUsage.V1

Assembly

Google.Cloud.ServiceUsage.V1.dll

Constructors

ServiceUsageClient()

protected ServiceUsageClient()

Protected parameterless constructor to allow creation of test doubles.

ServiceUsageClient(CallInvoker)

public ServiceUsageClient(CallInvoker callInvoker)

Creates a new client for ServiceUsage that uses a custom CallInvoker.

Parameter
Name Description
callInvoker CallInvoker

The callInvoker to use to make remote calls.

ServiceUsageClient(ChannelBase)

public ServiceUsageClient(ChannelBase channel)

Creates a new client for ServiceUsage

Parameter
Name Description
channel ChannelBase

The channel to use to make remote calls.

ServiceUsageClient(ClientBaseConfiguration)

protected ServiceUsageClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
Name Description
configuration ClientBaseClientBaseConfiguration

The client configuration.

Methods

BatchEnableServices(BatchEnableServicesRequest, CallOptions)

public virtual Operation BatchEnableServices(BatchEnableServicesRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Operation

The response received from the server.

BatchEnableServices(BatchEnableServicesRequest, Metadata, DateTime?, CancellationToken)

public virtual Operation BatchEnableServices(BatchEnableServicesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Operation

The response received from the server.

BatchEnableServicesAsync(BatchEnableServicesRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> BatchEnableServicesAsync(BatchEnableServicesRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallOperation

The call object.

BatchEnableServicesAsync(BatchEnableServicesRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Operation> BatchEnableServicesAsync(BatchEnableServicesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallOperation

The call object.

BatchGetServices(BatchGetServicesRequest, CallOptions)

public virtual BatchGetServicesResponse BatchGetServices(BatchGetServicesRequest request, CallOptions options)

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

Parameters
Name Description
request BatchGetServicesRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
BatchGetServicesResponse

The response received from the server.

BatchGetServices(BatchGetServicesRequest, Metadata, DateTime?, CancellationToken)

public virtual BatchGetServicesResponse BatchGetServices(BatchGetServicesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request BatchGetServicesRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
BatchGetServicesResponse

The response received from the server.

BatchGetServicesAsync(BatchGetServicesRequest, CallOptions)

public virtual AsyncUnaryCall<BatchGetServicesResponse> BatchGetServicesAsync(BatchGetServicesRequest request, CallOptions options)

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

Parameters
Name Description
request BatchGetServicesRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallBatchGetServicesResponse

The call object.

BatchGetServicesAsync(BatchGetServicesRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<BatchGetServicesResponse> BatchGetServicesAsync(BatchGetServicesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request BatchGetServicesRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallBatchGetServicesResponse

The call object.

CreateOperationsClient()

public virtual Operations.OperationsClient CreateOperationsClient()

Creates a new instance of Operations.OperationsClient using the same call invoker as this client.

Returns
Type Description
OperationsOperationsClient

A new Operations client for the same target as this client.

DisableService(DisableServiceRequest, CallOptions)

public virtual Operation DisableService(DisableServiceRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Operation

The response received from the server.

DisableService(DisableServiceRequest, Metadata, DateTime?, CancellationToken)

public virtual Operation DisableService(DisableServiceRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Operation

The response received from the server.

DisableServiceAsync(DisableServiceRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> DisableServiceAsync(DisableServiceRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallOperation

The call object.

DisableServiceAsync(DisableServiceRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Operation> DisableServiceAsync(DisableServiceRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallOperation

The call object.

EnableService(EnableServiceRequest, CallOptions)

public virtual Operation EnableService(EnableServiceRequest request, CallOptions options)

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

Parameters
Name Description
request EnableServiceRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Operation

The response received from the server.

EnableService(EnableServiceRequest, Metadata, DateTime?, CancellationToken)

public virtual Operation EnableService(EnableServiceRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request EnableServiceRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Operation

The response received from the server.

EnableServiceAsync(EnableServiceRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> EnableServiceAsync(EnableServiceRequest request, CallOptions options)

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

Parameters
Name Description
request EnableServiceRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallOperation

The call object.

EnableServiceAsync(EnableServiceRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Operation> EnableServiceAsync(EnableServiceRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request EnableServiceRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallOperation

The call object.

GetService(GetServiceRequest, CallOptions)

public virtual Service GetService(GetServiceRequest request, CallOptions options)

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

Parameters
Name Description
request GetServiceRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Service

The response received from the server.

GetService(GetServiceRequest, Metadata, DateTime?, CancellationToken)

public virtual Service GetService(GetServiceRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request GetServiceRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Service

The response received from the server.

GetServiceAsync(GetServiceRequest, CallOptions)

public virtual AsyncUnaryCall<Service> GetServiceAsync(GetServiceRequest request, CallOptions options)

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

Parameters
Name Description
request GetServiceRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallService

The call object.

GetServiceAsync(GetServiceRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Service> GetServiceAsync(GetServiceRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request GetServiceRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallService

The call object.

ListServices(ListServicesRequest, CallOptions)

public virtual ListServicesResponse ListServices(ListServicesRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
ListServicesResponse

The response received from the server.

ListServices(ListServicesRequest, Metadata, DateTime?, CancellationToken)

public virtual ListServicesResponse ListServices(ListServicesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
ListServicesResponse

The response received from the server.

ListServicesAsync(ListServicesRequest, CallOptions)

public virtual AsyncUnaryCall<ListServicesResponse> ListServicesAsync(ListServicesRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallListServicesResponse

The call object.

ListServicesAsync(ListServicesRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ListServicesResponse> ListServicesAsync(ListServicesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallListServicesResponse

The call object.

NewInstance(ClientBaseConfiguration)

protected override ServiceUsage.ServiceUsageClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
Name Description
configuration ClientBaseClientBaseConfiguration
Returns
Type Description
ServiceUsageServiceUsageClient
Overrides