public final class Billing extends com.google.protobuf.GeneratedMessageV3 implements BillingOrBuilder
Billing related configuration of the service.
The following example shows how to configure metrics for billing:
metrics:
- name: library.googleapis.com/read_calls
metric_kind: DELTA
value_type: INT64
- name: library.googleapis.com/write_calls
metric_kind: DELTA
value_type: INT64
billing:
metrics:
- library.googleapis.com/read_calls
- library.googleapis.com/write_calls
The next example shows how to enable billing status check and customize the
check behavior. It makes sure billing status check is included in the `Check`
method of [Service Control API](https://cloud.google.com/service-control/).
In the example, "google.storage.Get" method can be served when the billing
status is either `current` or `delinquent`, while "google.storage.Write"
method can only be served when the billing status is `current`:
billing:
rules:
- selector: google.storage.Get
allowed_statuses:
- current
- delinquent
- selector: google.storage.Write
allowed_statuses: current
Mostly services should only allow `current` status when serving requests.
In addition, services can choose to allow both `current` and `delinquent`
statuses when serving read-only requests to resources. If there's no
matching selector for operation, no billing status check will be performed.
Protobuf type google.api.Billing| Modifier and Type | Class and Description |
|---|---|
static class |
Billing.Builder
Billing related configuration of the service.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable| Modifier and Type | Field and Description |
|---|---|
static int |
METRICS_FIELD_NUMBER |
static int |
RULES_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
static Billing |
getDefaultInstance() |
Billing |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
java.lang.String |
getMetrics(int index)
Names of the metrics to report to billing.
|
com.google.protobuf.ByteString |
getMetricsBytes(int index)
Names of the metrics to report to billing.
|
int |
getMetricsCount()
Names of the metrics to report to billing.
|
com.google.protobuf.ProtocolStringList |
getMetricsList()
Names of the metrics to report to billing.
|
com.google.protobuf.Parser<Billing> |
getParserForType() |
BillingStatusRule |
getRules(int index)
A list of billing status rules for configuring billing status check.
|
int |
getRulesCount()
A list of billing status rules for configuring billing status check.
|
java.util.List<BillingStatusRule> |
getRulesList()
A list of billing status rules for configuring billing status check.
|
BillingStatusRuleOrBuilder |
getRulesOrBuilder(int index)
A list of billing status rules for configuring billing status check.
|
java.util.List<? extends BillingStatusRuleOrBuilder> |
getRulesOrBuilderList()
A list of billing status rules for configuring billing status check.
|
int |
getSerializedSize() |
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static Billing.Builder |
newBuilder() |
static Billing.Builder |
newBuilder(Billing prototype) |
Billing.Builder |
newBuilderForType() |
protected Billing.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
static Billing |
parseDelimitedFrom(java.io.InputStream input) |
static Billing |
parseDelimitedFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Billing |
parseFrom(byte[] data) |
static Billing |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Billing |
parseFrom(com.google.protobuf.ByteString data) |
static Billing |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Billing |
parseFrom(com.google.protobuf.CodedInputStream input) |
static Billing |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Billing |
parseFrom(java.io.InputStream input) |
static Billing |
parseFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<Billing> |
parser() |
Billing.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
computeStringSize, computeStringSizeNoTag, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, newBuilderForType, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int METRICS_FIELD_NUMBER
public static final int RULES_FIELD_NUMBER
public final com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields in interface com.google.protobuf.MessageOrBuildergetUnknownFields in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public com.google.protobuf.ProtocolStringList getMetricsList()
Names of the metrics to report to billing. Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
repeated string metrics = 1;getMetricsList in interface BillingOrBuilderpublic int getMetricsCount()
Names of the metrics to report to billing. Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
repeated string metrics = 1;getMetricsCount in interface BillingOrBuilderpublic java.lang.String getMetrics(int index)
Names of the metrics to report to billing. Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
repeated string metrics = 1;getMetrics in interface BillingOrBuilderpublic com.google.protobuf.ByteString getMetricsBytes(int index)
Names of the metrics to report to billing. Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
repeated string metrics = 1;getMetricsBytes in interface BillingOrBuilderpublic java.util.List<BillingStatusRule> getRulesList()
A list of billing status rules for configuring billing status check.
repeated .google.api.BillingStatusRule rules = 5;getRulesList in interface BillingOrBuilderpublic java.util.List<? extends BillingStatusRuleOrBuilder> getRulesOrBuilderList()
A list of billing status rules for configuring billing status check.
repeated .google.api.BillingStatusRule rules = 5;getRulesOrBuilderList in interface BillingOrBuilderpublic int getRulesCount()
A list of billing status rules for configuring billing status check.
repeated .google.api.BillingStatusRule rules = 5;getRulesCount in interface BillingOrBuilderpublic BillingStatusRule getRules(int index)
A list of billing status rules for configuring billing status check.
repeated .google.api.BillingStatusRule rules = 5;getRules in interface BillingOrBuilderpublic BillingStatusRuleOrBuilder getRulesOrBuilder(int index)
A list of billing status rules for configuring billing status check.
repeated .google.api.BillingStatusRule rules = 5;getRulesOrBuilder in interface BillingOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3java.io.IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(java.lang.Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static Billing parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Billing parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Billing parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Billing parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Billing parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static Billing parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static Billing parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static Billing parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static Billing parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException
java.io.IOExceptionpublic static Billing parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic Billing.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static Billing.Builder newBuilder()
public static Billing.Builder newBuilder(Billing prototype)
public Billing.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected Billing.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static Billing getDefaultInstance()
public static com.google.protobuf.Parser<Billing> parser()
public com.google.protobuf.Parser<Billing> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public Billing getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder