Class Usage.Builder

  • All Implemented Interfaces:
    UsageOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, java.lang.Cloneable
    Enclosing class:
    Usage

    public static final class Usage.Builder
    extends com.google.protobuf.GeneratedMessage.Builder<Usage.Builder>
    implements UsageOrBuilder
     Configuration controlling usage of a service.
     
    Protobuf type google.api.Usage
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Usage.Builder addAllRequirements​(java.lang.Iterable<java.lang.String> values)
      Requirements that must be satisfied before a consumer project can use the service.
      Usage.Builder addAllRules​(java.lang.Iterable<? extends UsageRule> values)
      A list of usage rules that apply to individual API methods.
      Usage.Builder addRequirements​(java.lang.String value)
      Requirements that must be satisfied before a consumer project can use the service.
      Usage.Builder addRequirementsBytes​(com.google.protobuf.ByteString value)
      Requirements that must be satisfied before a consumer project can use the service.
      Usage.Builder addRules​(int index, UsageRule value)
      A list of usage rules that apply to individual API methods.
      Usage.Builder addRules​(int index, UsageRule.Builder builderForValue)
      A list of usage rules that apply to individual API methods.
      Usage.Builder addRules​(UsageRule value)
      A list of usage rules that apply to individual API methods.
      Usage.Builder addRules​(UsageRule.Builder builderForValue)
      A list of usage rules that apply to individual API methods.
      UsageRule.Builder addRulesBuilder()
      A list of usage rules that apply to individual API methods.
      UsageRule.Builder addRulesBuilder​(int index)
      A list of usage rules that apply to individual API methods.
      Usage build()  
      Usage buildPartial()  
      Usage.Builder clear()  
      Usage.Builder clearProducerNotificationChannel()
      The full resource name of a channel used for sending notifications to the service producer.
      Usage.Builder clearRequirements()
      Requirements that must be satisfied before a consumer project can use the service.
      Usage.Builder clearRules()
      A list of usage rules that apply to individual API methods.
      Usage getDefaultInstanceForType()  
      static com.google.protobuf.Descriptors.Descriptor getDescriptor()  
      com.google.protobuf.Descriptors.Descriptor getDescriptorForType()  
      java.lang.String getProducerNotificationChannel()
      The full resource name of a channel used for sending notifications to the service producer.
      com.google.protobuf.ByteString getProducerNotificationChannelBytes()
      The full resource name of a channel used for sending notifications to the service producer.
      java.lang.String getRequirements​(int index)
      Requirements that must be satisfied before a consumer project can use the service.
      com.google.protobuf.ByteString getRequirementsBytes​(int index)
      Requirements that must be satisfied before a consumer project can use the service.
      int getRequirementsCount()
      Requirements that must be satisfied before a consumer project can use the service.
      com.google.protobuf.ProtocolStringList getRequirementsList()
      Requirements that must be satisfied before a consumer project can use the service.
      UsageRule getRules​(int index)
      A list of usage rules that apply to individual API methods.
      UsageRule.Builder getRulesBuilder​(int index)
      A list of usage rules that apply to individual API methods.
      java.util.List<UsageRule.Builder> getRulesBuilderList()
      A list of usage rules that apply to individual API methods.
      int getRulesCount()
      A list of usage rules that apply to individual API methods.
      java.util.List<UsageRule> getRulesList()
      A list of usage rules that apply to individual API methods.
      UsageRuleOrBuilder getRulesOrBuilder​(int index)
      A list of usage rules that apply to individual API methods.
      java.util.List<? extends UsageRuleOrBuilder> getRulesOrBuilderList()
      A list of usage rules that apply to individual API methods.
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()  
      boolean isInitialized()  
      Usage.Builder mergeFrom​(Usage other)  
      Usage.Builder mergeFrom​(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      Usage.Builder mergeFrom​(com.google.protobuf.Message other)  
      Usage.Builder removeRules​(int index)
      A list of usage rules that apply to individual API methods.
      Usage.Builder setProducerNotificationChannel​(java.lang.String value)
      The full resource name of a channel used for sending notifications to the service producer.
      Usage.Builder setProducerNotificationChannelBytes​(com.google.protobuf.ByteString value)
      The full resource name of a channel used for sending notifications to the service producer.
      Usage.Builder setRequirements​(int index, java.lang.String value)
      Requirements that must be satisfied before a consumer project can use the service.
      Usage.Builder setRules​(int index, UsageRule value)
      A list of usage rules that apply to individual API methods.
      Usage.Builder setRules​(int index, UsageRule.Builder builderForValue)
      A list of usage rules that apply to individual API methods.
      • Methods inherited from class com.google.protobuf.GeneratedMessage.Builder

        addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3
      • Methods inherited from class com.google.protobuf.AbstractMessage.Builder

        findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
      • Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

        addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.google.protobuf.Message.Builder

        mergeDelimitedFrom, mergeDelimitedFrom
      • Methods inherited from interface com.google.protobuf.MessageLite.Builder

        mergeFrom
      • Methods inherited from interface com.google.protobuf.MessageOrBuilder

        findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
    • Method Detail

      • getDescriptor

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

        protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<Usage.Builder>
      • clear

        public Usage.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.GeneratedMessage.Builder<Usage.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<Usage.Builder>
      • getDefaultInstanceForType

        public Usage getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

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

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

        public Usage.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<Usage.Builder>
      • isInitialized

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

        public Usage.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<Usage.Builder>
        Throws:
        java.io.IOException
      • getRequirementsList

        public com.google.protobuf.ProtocolStringList getRequirementsList()
         Requirements that must be satisfied before a consumer project can use the
         service. Each requirement is of the form <service.name>/<requirement-id>;
         for example 'serviceusage.googleapis.com/billing-enabled'.
        
         For Google APIs, a Terms of Service requirement must be included here.
         Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
         Other Google APIs should include
         "serviceusage.googleapis.com/tos/universal". Additional ToS can be
         included based on the business needs.
         
        repeated string requirements = 1;
        Specified by:
        getRequirementsList in interface UsageOrBuilder
        Returns:
        A list containing the requirements.
      • getRequirementsCount

        public int getRequirementsCount()
         Requirements that must be satisfied before a consumer project can use the
         service. Each requirement is of the form <service.name>/<requirement-id>;
         for example 'serviceusage.googleapis.com/billing-enabled'.
        
         For Google APIs, a Terms of Service requirement must be included here.
         Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
         Other Google APIs should include
         "serviceusage.googleapis.com/tos/universal". Additional ToS can be
         included based on the business needs.
         
        repeated string requirements = 1;
        Specified by:
        getRequirementsCount in interface UsageOrBuilder
        Returns:
        The count of requirements.
      • getRequirements

        public java.lang.String getRequirements​(int index)
         Requirements that must be satisfied before a consumer project can use the
         service. Each requirement is of the form <service.name>/<requirement-id>;
         for example 'serviceusage.googleapis.com/billing-enabled'.
        
         For Google APIs, a Terms of Service requirement must be included here.
         Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
         Other Google APIs should include
         "serviceusage.googleapis.com/tos/universal". Additional ToS can be
         included based on the business needs.
         
        repeated string requirements = 1;
        Specified by:
        getRequirements in interface UsageOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The requirements at the given index.
      • getRequirementsBytes

        public com.google.protobuf.ByteString getRequirementsBytes​(int index)
         Requirements that must be satisfied before a consumer project can use the
         service. Each requirement is of the form <service.name>/<requirement-id>;
         for example 'serviceusage.googleapis.com/billing-enabled'.
        
         For Google APIs, a Terms of Service requirement must be included here.
         Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
         Other Google APIs should include
         "serviceusage.googleapis.com/tos/universal". Additional ToS can be
         included based on the business needs.
         
        repeated string requirements = 1;
        Specified by:
        getRequirementsBytes in interface UsageOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the requirements at the given index.
      • setRequirements

        public Usage.Builder setRequirements​(int index,
                                             java.lang.String value)
         Requirements that must be satisfied before a consumer project can use the
         service. Each requirement is of the form <service.name>/<requirement-id>;
         for example 'serviceusage.googleapis.com/billing-enabled'.
        
         For Google APIs, a Terms of Service requirement must be included here.
         Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
         Other Google APIs should include
         "serviceusage.googleapis.com/tos/universal". Additional ToS can be
         included based on the business needs.
         
        repeated string requirements = 1;
        Parameters:
        index - The index to set the value at.
        value - The requirements to set.
        Returns:
        This builder for chaining.
      • addRequirements

        public Usage.Builder addRequirements​(java.lang.String value)
         Requirements that must be satisfied before a consumer project can use the
         service. Each requirement is of the form <service.name>/<requirement-id>;
         for example 'serviceusage.googleapis.com/billing-enabled'.
        
         For Google APIs, a Terms of Service requirement must be included here.
         Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
         Other Google APIs should include
         "serviceusage.googleapis.com/tos/universal". Additional ToS can be
         included based on the business needs.
         
        repeated string requirements = 1;
        Parameters:
        value - The requirements to add.
        Returns:
        This builder for chaining.
      • addAllRequirements

        public Usage.Builder addAllRequirements​(java.lang.Iterable<java.lang.String> values)
         Requirements that must be satisfied before a consumer project can use the
         service. Each requirement is of the form <service.name>/<requirement-id>;
         for example 'serviceusage.googleapis.com/billing-enabled'.
        
         For Google APIs, a Terms of Service requirement must be included here.
         Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
         Other Google APIs should include
         "serviceusage.googleapis.com/tos/universal". Additional ToS can be
         included based on the business needs.
         
        repeated string requirements = 1;
        Parameters:
        values - The requirements to add.
        Returns:
        This builder for chaining.
      • clearRequirements

        public Usage.Builder clearRequirements()
         Requirements that must be satisfied before a consumer project can use the
         service. Each requirement is of the form <service.name>/<requirement-id>;
         for example 'serviceusage.googleapis.com/billing-enabled'.
        
         For Google APIs, a Terms of Service requirement must be included here.
         Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
         Other Google APIs should include
         "serviceusage.googleapis.com/tos/universal". Additional ToS can be
         included based on the business needs.
         
        repeated string requirements = 1;
        Returns:
        This builder for chaining.
      • addRequirementsBytes

        public Usage.Builder addRequirementsBytes​(com.google.protobuf.ByteString value)
         Requirements that must be satisfied before a consumer project can use the
         service. Each requirement is of the form <service.name>/<requirement-id>;
         for example 'serviceusage.googleapis.com/billing-enabled'.
        
         For Google APIs, a Terms of Service requirement must be included here.
         Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
         Other Google APIs should include
         "serviceusage.googleapis.com/tos/universal". Additional ToS can be
         included based on the business needs.
         
        repeated string requirements = 1;
        Parameters:
        value - The bytes of the requirements to add.
        Returns:
        This builder for chaining.
      • getRulesList

        public java.util.List<UsageRule> getRulesList()
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
        Specified by:
        getRulesList in interface UsageOrBuilder
      • getRulesCount

        public int getRulesCount()
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
        Specified by:
        getRulesCount in interface UsageOrBuilder
      • getRules

        public UsageRule getRules​(int index)
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
        Specified by:
        getRules in interface UsageOrBuilder
      • setRules

        public Usage.Builder setRules​(int index,
                                      UsageRule value)
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
      • setRules

        public Usage.Builder setRules​(int index,
                                      UsageRule.Builder builderForValue)
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
      • addRules

        public Usage.Builder addRules​(UsageRule value)
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
      • addRules

        public Usage.Builder addRules​(int index,
                                      UsageRule value)
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
      • addRules

        public Usage.Builder addRules​(UsageRule.Builder builderForValue)
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
      • addRules

        public Usage.Builder addRules​(int index,
                                      UsageRule.Builder builderForValue)
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
      • addAllRules

        public Usage.Builder addAllRules​(java.lang.Iterable<? extends UsageRule> values)
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
      • clearRules

        public Usage.Builder clearRules()
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
      • removeRules

        public Usage.Builder removeRules​(int index)
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
      • getRulesBuilder

        public UsageRule.Builder getRulesBuilder​(int index)
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
      • getRulesOrBuilder

        public UsageRuleOrBuilder getRulesOrBuilder​(int index)
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
        Specified by:
        getRulesOrBuilder in interface UsageOrBuilder
      • getRulesOrBuilderList

        public java.util.List<? extends UsageRuleOrBuilder> getRulesOrBuilderList()
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
        Specified by:
        getRulesOrBuilderList in interface UsageOrBuilder
      • addRulesBuilder

        public UsageRule.Builder addRulesBuilder()
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
      • addRulesBuilder

        public UsageRule.Builder addRulesBuilder​(int index)
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
      • getRulesBuilderList

        public java.util.List<UsageRule.Builder> getRulesBuilderList()
         A list of usage rules that apply to individual API methods.
        
         **NOTE:** All service configuration rules follow "last one wins" order.
         
        repeated .google.api.UsageRule rules = 6;
      • getProducerNotificationChannel

        public java.lang.String getProducerNotificationChannel()
         The full resource name of a channel used for sending notifications to the
         service producer.
        
         Google Service Management currently only supports
         [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
         channel. To use Google Cloud Pub/Sub as the channel, this must be the name
         of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format
         documented in https://cloud.google.com/pubsub/docs/overview.
         
        string producer_notification_channel = 7;
        Specified by:
        getProducerNotificationChannel in interface UsageOrBuilder
        Returns:
        The producerNotificationChannel.
      • getProducerNotificationChannelBytes

        public com.google.protobuf.ByteString getProducerNotificationChannelBytes()
         The full resource name of a channel used for sending notifications to the
         service producer.
        
         Google Service Management currently only supports
         [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
         channel. To use Google Cloud Pub/Sub as the channel, this must be the name
         of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format
         documented in https://cloud.google.com/pubsub/docs/overview.
         
        string producer_notification_channel = 7;
        Specified by:
        getProducerNotificationChannelBytes in interface UsageOrBuilder
        Returns:
        The bytes for producerNotificationChannel.
      • setProducerNotificationChannel

        public Usage.Builder setProducerNotificationChannel​(java.lang.String value)
         The full resource name of a channel used for sending notifications to the
         service producer.
        
         Google Service Management currently only supports
         [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
         channel. To use Google Cloud Pub/Sub as the channel, this must be the name
         of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format
         documented in https://cloud.google.com/pubsub/docs/overview.
         
        string producer_notification_channel = 7;
        Parameters:
        value - The producerNotificationChannel to set.
        Returns:
        This builder for chaining.
      • clearProducerNotificationChannel

        public Usage.Builder clearProducerNotificationChannel()
         The full resource name of a channel used for sending notifications to the
         service producer.
        
         Google Service Management currently only supports
         [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
         channel. To use Google Cloud Pub/Sub as the channel, this must be the name
         of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format
         documented in https://cloud.google.com/pubsub/docs/overview.
         
        string producer_notification_channel = 7;
        Returns:
        This builder for chaining.
      • setProducerNotificationChannelBytes

        public Usage.Builder setProducerNotificationChannelBytes​(com.google.protobuf.ByteString value)
         The full resource name of a channel used for sending notifications to the
         service producer.
        
         Google Service Management currently only supports
         [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
         channel. To use Google Cloud Pub/Sub as the channel, this must be the name
         of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format
         documented in https://cloud.google.com/pubsub/docs/overview.
         
        string producer_notification_channel = 7;
        Parameters:
        value - The bytes for producerNotificationChannel to set.
        Returns:
        This builder for chaining.