Class Billing.Builder (2.40.0)

public static final class Billing.Builder extends GeneratedMessageV3.Builder<Billing.Builder> implements BillingOrBuilder

Billing related configuration of the service.

The following example shows how to configure monitored resources and metrics for billing, consumer_destinations is the only supported destination and the monitored resources need at least one label key cloud.googleapis.com/location to indicate the location of the billing usage, using different monitored resources between monitoring and billing is recommended so they can be evolved independently:

 monitored_resources:
 - type: library.googleapis.com/billing_branch
   labels:
   - key: cloud.googleapis.com/location
     description: |
       Predefined label to support billing location restriction.
   - key: city
     description: |
       Custom label to define the city where the library branch is located
       in.
   - key: name
     description: Custom label to define the name of the library branch.
 metrics:
 - name: library.googleapis.com/book/borrowed_count
   metric_kind: DELTA
   value_type: INT64
   unit: "1"
 billing:
   consumer_destinations:
   - monitored_resource: library.googleapis.com/billing_branch
     metrics:
     - library.googleapis.com/book/borrowed_count

Protobuf type google.api.Billing

Implements

BillingOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllConsumerDestinations(Iterable<? extends Billing.BillingDestination> values)

public Billing.Builder addAllConsumerDestinations(Iterable<? extends Billing.BillingDestination> values)

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Parameter
Name Description
values Iterable<? extends com.google.api.Billing.BillingDestination>
Returns
Type Description
Billing.Builder

addConsumerDestinations(Billing.BillingDestination value)

public Billing.Builder addConsumerDestinations(Billing.BillingDestination value)

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Parameter
Name Description
value Billing.BillingDestination
Returns
Type Description
Billing.Builder

addConsumerDestinations(Billing.BillingDestination.Builder builderForValue)

public Billing.Builder addConsumerDestinations(Billing.BillingDestination.Builder builderForValue)

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Parameter
Name Description
builderForValue Billing.BillingDestination.Builder
Returns
Type Description
Billing.Builder

addConsumerDestinations(int index, Billing.BillingDestination value)

public Billing.Builder addConsumerDestinations(int index, Billing.BillingDestination value)

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Parameters
Name Description
index int
value Billing.BillingDestination
Returns
Type Description
Billing.Builder

addConsumerDestinations(int index, Billing.BillingDestination.Builder builderForValue)

public Billing.Builder addConsumerDestinations(int index, Billing.BillingDestination.Builder builderForValue)

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Parameters
Name Description
index int
builderForValue Billing.BillingDestination.Builder
Returns
Type Description
Billing.Builder

addConsumerDestinationsBuilder()

public Billing.BillingDestination.Builder addConsumerDestinationsBuilder()

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Returns
Type Description
Billing.BillingDestination.Builder

addConsumerDestinationsBuilder(int index)

public Billing.BillingDestination.Builder addConsumerDestinationsBuilder(int index)

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Parameter
Name Description
index int
Returns
Type Description
Billing.BillingDestination.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Billing.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Billing.Builder
Overrides

build()

public Billing build()
Returns
Type Description
Billing

buildPartial()

public Billing buildPartial()
Returns
Type Description
Billing

clear()

public Billing.Builder clear()
Returns
Type Description
Billing.Builder
Overrides

clearConsumerDestinations()

public Billing.Builder clearConsumerDestinations()

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Returns
Type Description
Billing.Builder

clearField(Descriptors.FieldDescriptor field)

public Billing.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Billing.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public Billing.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Billing.Builder
Overrides

clone()

public Billing.Builder clone()
Returns
Type Description
Billing.Builder
Overrides

getConsumerDestinations(int index)

public Billing.BillingDestination getConsumerDestinations(int index)

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Parameter
Name Description
index int
Returns
Type Description
Billing.BillingDestination

getConsumerDestinationsBuilder(int index)

public Billing.BillingDestination.Builder getConsumerDestinationsBuilder(int index)

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Parameter
Name Description
index int
Returns
Type Description
Billing.BillingDestination.Builder

getConsumerDestinationsBuilderList()

public List<Billing.BillingDestination.Builder> getConsumerDestinationsBuilderList()

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Returns
Type Description
List<Builder>

getConsumerDestinationsCount()

public int getConsumerDestinationsCount()

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Returns
Type Description
int

getConsumerDestinationsList()

public List<Billing.BillingDestination> getConsumerDestinationsList()

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Returns
Type Description
List<BillingDestination>

getConsumerDestinationsOrBuilder(int index)

public Billing.BillingDestinationOrBuilder getConsumerDestinationsOrBuilder(int index)

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Parameter
Name Description
index int
Returns
Type Description
Billing.BillingDestinationOrBuilder

getConsumerDestinationsOrBuilderList()

public List<? extends Billing.BillingDestinationOrBuilder> getConsumerDestinationsOrBuilderList()

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Returns
Type Description
List<? extends com.google.api.Billing.BillingDestinationOrBuilder>

getDefaultInstanceForType()

public Billing getDefaultInstanceForType()
Returns
Type Description
Billing

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Billing other)

public Billing.Builder mergeFrom(Billing other)
Parameter
Name Description
other Billing
Returns
Type Description
Billing.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Billing.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Billing.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Billing.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Billing.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Billing.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Billing.Builder
Overrides

removeConsumerDestinations(int index)

public Billing.Builder removeConsumerDestinations(int index)

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Parameter
Name Description
index int
Returns
Type Description
Billing.Builder

setConsumerDestinations(int index, Billing.BillingDestination value)

public Billing.Builder setConsumerDestinations(int index, Billing.BillingDestination value)

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Parameters
Name Description
index int
value Billing.BillingDestination
Returns
Type Description
Billing.Builder

setConsumerDestinations(int index, Billing.BillingDestination.Builder builderForValue)

public Billing.Builder setConsumerDestinations(int index, Billing.BillingDestination.Builder builderForValue)

Billing configurations for sending metrics to the consumer project. There can be multiple consumer destinations per service, each one must have a different monitored resource type. A metric can be used in at most one consumer destination.

repeated .google.api.Billing.BillingDestination consumer_destinations = 8;

Parameters
Name Description
index int
builderForValue Billing.BillingDestination.Builder
Returns
Type Description
Billing.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Billing.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Billing.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Billing.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Billing.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Billing.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Billing.Builder
Overrides