Class RateLimitResponse.Quota.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<RateLimitResponse.Quota.Builder>
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, RateLimitResponse.QuotaOrBuilder, Cloneable
Enclosing class:
RateLimitResponse.Quota

public static final class RateLimitResponse.Quota.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<RateLimitResponse.Quota.Builder> implements RateLimitResponse.QuotaOrBuilder
 Cacheable quota for responses.
 Quota can be granted at different levels: either for each individual descriptor or for the whole descriptor set.
 This is a certain number of requests over a period of time.
 The client may cache this result and apply the effective RateLimitResponse to future matching
 requests without querying rate limit service.

 When quota expires due to timeout, a new RLS request will also be made.
 The implementation may choose to preemptively query the rate limit server for more quota on or
 before expiration or before the available quota runs out.
 [#not-implemented-hide:]
 
Protobuf type envoy.service.ratelimit.v3.RateLimitResponse.Quota
  • 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<RateLimitResponse.Quota.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<RateLimitResponse.Quota.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<RateLimitResponse.Quota.Builder>
    • getDefaultInstanceForType

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

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

      public RateLimitResponse.Quota buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.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<RateLimitResponse.Quota.Builder>
    • setField

      public RateLimitResponse.Quota.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<RateLimitResponse.Quota.Builder>
    • clearField

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

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

      public RateLimitResponse.Quota.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<RateLimitResponse.Quota.Builder>
    • addRepeatedField

      public RateLimitResponse.Quota.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<RateLimitResponse.Quota.Builder>
    • mergeFrom

      public RateLimitResponse.Quota.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<RateLimitResponse.Quota.Builder>
    • mergeFrom

    • isInitialized

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

      public RateLimitResponse.Quota.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<RateLimitResponse.Quota.Builder>
      Throws:
      IOException
    • getExpirationSpecifierCase

      public RateLimitResponse.Quota.ExpirationSpecifierCase getExpirationSpecifierCase()
      Specified by:
      getExpirationSpecifierCase in interface RateLimitResponse.QuotaOrBuilder
    • clearExpirationSpecifier

      public RateLimitResponse.Quota.Builder clearExpirationSpecifier()
    • getRequests

      public int getRequests()
       Number of matching requests granted in quota. Must be 1 or more.
       
      uint32 requests = 1 [(.validate.rules) = { ... }
      Specified by:
      getRequests in interface RateLimitResponse.QuotaOrBuilder
      Returns:
      The requests.
    • setRequests

      public RateLimitResponse.Quota.Builder setRequests(int value)
       Number of matching requests granted in quota. Must be 1 or more.
       
      uint32 requests = 1 [(.validate.rules) = { ... }
      Parameters:
      value - The requests to set.
      Returns:
      This builder for chaining.
    • clearRequests

      public RateLimitResponse.Quota.Builder clearRequests()
       Number of matching requests granted in quota. Must be 1 or more.
       
      uint32 requests = 1 [(.validate.rules) = { ... }
      Returns:
      This builder for chaining.
    • hasValidUntil

      public boolean hasValidUntil()
       Point in time at which the quota expires.
       
      .google.protobuf.Timestamp valid_until = 2;
      Specified by:
      hasValidUntil in interface RateLimitResponse.QuotaOrBuilder
      Returns:
      Whether the validUntil field is set.
    • getValidUntil

      public com.google.protobuf.Timestamp getValidUntil()
       Point in time at which the quota expires.
       
      .google.protobuf.Timestamp valid_until = 2;
      Specified by:
      getValidUntil in interface RateLimitResponse.QuotaOrBuilder
      Returns:
      The validUntil.
    • setValidUntil

      public RateLimitResponse.Quota.Builder setValidUntil(com.google.protobuf.Timestamp value)
       Point in time at which the quota expires.
       
      .google.protobuf.Timestamp valid_until = 2;
    • setValidUntil

      public RateLimitResponse.Quota.Builder setValidUntil(com.google.protobuf.Timestamp.Builder builderForValue)
       Point in time at which the quota expires.
       
      .google.protobuf.Timestamp valid_until = 2;
    • mergeValidUntil

      public RateLimitResponse.Quota.Builder mergeValidUntil(com.google.protobuf.Timestamp value)
       Point in time at which the quota expires.
       
      .google.protobuf.Timestamp valid_until = 2;
    • clearValidUntil

      public RateLimitResponse.Quota.Builder clearValidUntil()
       Point in time at which the quota expires.
       
      .google.protobuf.Timestamp valid_until = 2;
    • getValidUntilBuilder

      public com.google.protobuf.Timestamp.Builder getValidUntilBuilder()
       Point in time at which the quota expires.
       
      .google.protobuf.Timestamp valid_until = 2;
    • getValidUntilOrBuilder

      public com.google.protobuf.TimestampOrBuilder getValidUntilOrBuilder()
       Point in time at which the quota expires.
       
      .google.protobuf.Timestamp valid_until = 2;
      Specified by:
      getValidUntilOrBuilder in interface RateLimitResponse.QuotaOrBuilder
    • getId

      public String getId()
       The unique id that is associated with each Quota either at individual descriptor level or whole descriptor set level.
      
       For a matching policy with boolean logic, for example, match: "request.headers['environment'] == 'staging' || request.headers['environment'] == 'dev'"),
       the request_headers action produces a distinct list of descriptors for each possible value of the ‘environment’ header even though the granted quota is same.
       Thus, the client will use this id information (returned from RLS server) to correctly correlate the multiple descriptors/descriptor sets that have been granted with same quota (i.e., share the same quota among multiple descriptors or descriptor sets.)
      
       If id is empty, this id field will be ignored. If quota for the same id changes (e.g. due to configuration update), the old quota will be overridden by the new one. Shared quotas referenced by ID will still adhere to expiration after `valid_until`.
       
      string id = 3;
      Specified by:
      getId in interface RateLimitResponse.QuotaOrBuilder
      Returns:
      The id.
    • getIdBytes

      public com.google.protobuf.ByteString getIdBytes()
       The unique id that is associated with each Quota either at individual descriptor level or whole descriptor set level.
      
       For a matching policy with boolean logic, for example, match: "request.headers['environment'] == 'staging' || request.headers['environment'] == 'dev'"),
       the request_headers action produces a distinct list of descriptors for each possible value of the ‘environment’ header even though the granted quota is same.
       Thus, the client will use this id information (returned from RLS server) to correctly correlate the multiple descriptors/descriptor sets that have been granted with same quota (i.e., share the same quota among multiple descriptors or descriptor sets.)
      
       If id is empty, this id field will be ignored. If quota for the same id changes (e.g. due to configuration update), the old quota will be overridden by the new one. Shared quotas referenced by ID will still adhere to expiration after `valid_until`.
       
      string id = 3;
      Specified by:
      getIdBytes in interface RateLimitResponse.QuotaOrBuilder
      Returns:
      The bytes for id.
    • setId

       The unique id that is associated with each Quota either at individual descriptor level or whole descriptor set level.
      
       For a matching policy with boolean logic, for example, match: "request.headers['environment'] == 'staging' || request.headers['environment'] == 'dev'"),
       the request_headers action produces a distinct list of descriptors for each possible value of the ‘environment’ header even though the granted quota is same.
       Thus, the client will use this id information (returned from RLS server) to correctly correlate the multiple descriptors/descriptor sets that have been granted with same quota (i.e., share the same quota among multiple descriptors or descriptor sets.)
      
       If id is empty, this id field will be ignored. If quota for the same id changes (e.g. due to configuration update), the old quota will be overridden by the new one. Shared quotas referenced by ID will still adhere to expiration after `valid_until`.
       
      string id = 3;
      Parameters:
      value - The id to set.
      Returns:
      This builder for chaining.
    • clearId

       The unique id that is associated with each Quota either at individual descriptor level or whole descriptor set level.
      
       For a matching policy with boolean logic, for example, match: "request.headers['environment'] == 'staging' || request.headers['environment'] == 'dev'"),
       the request_headers action produces a distinct list of descriptors for each possible value of the ‘environment’ header even though the granted quota is same.
       Thus, the client will use this id information (returned from RLS server) to correctly correlate the multiple descriptors/descriptor sets that have been granted with same quota (i.e., share the same quota among multiple descriptors or descriptor sets.)
      
       If id is empty, this id field will be ignored. If quota for the same id changes (e.g. due to configuration update), the old quota will be overridden by the new one. Shared quotas referenced by ID will still adhere to expiration after `valid_until`.
       
      string id = 3;
      Returns:
      This builder for chaining.
    • setIdBytes

      public RateLimitResponse.Quota.Builder setIdBytes(com.google.protobuf.ByteString value)
       The unique id that is associated with each Quota either at individual descriptor level or whole descriptor set level.
      
       For a matching policy with boolean logic, for example, match: "request.headers['environment'] == 'staging' || request.headers['environment'] == 'dev'"),
       the request_headers action produces a distinct list of descriptors for each possible value of the ‘environment’ header even though the granted quota is same.
       Thus, the client will use this id information (returned from RLS server) to correctly correlate the multiple descriptors/descriptor sets that have been granted with same quota (i.e., share the same quota among multiple descriptors or descriptor sets.)
      
       If id is empty, this id field will be ignored. If quota for the same id changes (e.g. due to configuration update), the old quota will be overridden by the new one. Shared quotas referenced by ID will still adhere to expiration after `valid_until`.
       
      string id = 3;
      Parameters:
      value - The bytes for id to set.
      Returns:
      This builder for chaining.
    • setUnknownFields

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

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