Class Usage.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderType>
com.google.protobuf.GeneratedMessageV3.Builder<Usage.Builder>
com.google.api.Usage.Builder
All Implemented Interfaces:
UsageOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
Usage

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

    • getDescriptor

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

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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
    • clone

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

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

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

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

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

      public Usage.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Usage.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>
    • mergeFrom

      public Usage.Builder mergeFrom(Usage other)
    • isInitialized

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

      public Usage.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws 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:
      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 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, 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(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(Iterable<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 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(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 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 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 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(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.
    • setUnknownFields

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

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