Class Billing.Builder

  • All Implemented Interfaces:
    BillingOrBuilder, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<com.google.protobuf.GeneratedMessageV3>, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, java.lang.Cloneable
    Enclosing class:
    Billing

    public static final class Billing.Builder
    extends com.google.protobuf.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
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Overrides:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<Billing.Builder>
      • clear

        public Billing.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<Billing.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<Billing.Builder>
      • getDefaultInstanceForType

        public Billing getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<com.google.protobuf.GeneratedMessageV3>
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public Billing build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public Billing buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public Billing.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<Billing.Builder>
      • setField

        public Billing.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                        java.lang.Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<Billing.Builder>
      • clearField

        public Billing.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<Billing.Builder>
      • clearOneof

        public Billing.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Billing.Builder>
      • setRepeatedField

        public Billing.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                int index,
                                                java.lang.Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Billing.Builder>
      • addRepeatedField

        public Billing.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                java.lang.Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Billing.Builder>
      • mergeFrom

        public Billing.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Billing.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessage.ExtendableBuilder<com.google.protobuf.GeneratedMessageV3,​Billing.Builder>
      • mergeFrom

        public Billing.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                  throws java.io.IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Billing.Builder>
        Throws:
        java.io.IOException
      • getConsumerDestinationsList

        public java.util.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;
        Specified by:
        getConsumerDestinationsList in interface BillingOrBuilder
      • 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;
        Specified by:
        getConsumerDestinationsCount in interface BillingOrBuilder
      • getConsumerDestinations

        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;
        Specified by:
        getConsumerDestinations in interface BillingOrBuilder
      • setConsumerDestinations

        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;
      • setConsumerDestinations

        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;
      • addConsumerDestinations

        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;
      • addConsumerDestinations

        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;
      • addConsumerDestinations

        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;
      • addConsumerDestinations

        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;
      • addAllConsumerDestinations

        public Billing.Builder addAllConsumerDestinations​(java.lang.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;
      • 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;
      • removeConsumerDestinations

        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;
      • getConsumerDestinationsBuilder

        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;
      • getConsumerDestinationsOrBuilder

        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;
        Specified by:
        getConsumerDestinationsOrBuilder in interface BillingOrBuilder
      • getConsumerDestinationsOrBuilderList

        public java.util.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;
        Specified by:
        getConsumerDestinationsOrBuilderList in interface BillingOrBuilder
      • 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;
      • addConsumerDestinationsBuilder

        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;
      • getConsumerDestinationsBuilderList

        public java.util.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;
      • setUnknownFields

        public final Billing.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Billing.Builder>
      • mergeUnknownFields

        public final Billing.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Billing.Builder>