Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: envoy/service/ratelimit/v3/rls.proto
package io.envoyproxy.envoy.service.ratelimit.v3;
/**
*
* A response from a ShouldRateLimit call.
* [#next-free-field: 8]
*
*
* Protobuf type {@code envoy.service.ratelimit.v3.RateLimitResponse}
*/
public final class RateLimitResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:envoy.service.ratelimit.v3.RateLimitResponse)
RateLimitResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use RateLimitResponse.newBuilder() to construct.
private RateLimitResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private RateLimitResponse() {
overallCode_ = 0;
statuses_ = java.util.Collections.emptyList();
responseHeadersToAdd_ = java.util.Collections.emptyList();
requestHeadersToAdd_ = java.util.Collections.emptyList();
rawBody_ = com.google.protobuf.ByteString.EMPTY;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new RateLimitResponse();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private RateLimitResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
int rawValue = input.readEnum();
overallCode_ = rawValue;
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
statuses_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
statuses_.add(
input.readMessage(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus.parser(), extensionRegistry));
break;
}
case 26: {
if (!((mutable_bitField0_ & 0x00000002) != 0)) {
responseHeadersToAdd_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000002;
}
responseHeadersToAdd_.add(
input.readMessage(io.envoyproxy.envoy.config.core.v3.HeaderValue.parser(), extensionRegistry));
break;
}
case 34: {
if (!((mutable_bitField0_ & 0x00000004) != 0)) {
requestHeadersToAdd_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000004;
}
requestHeadersToAdd_.add(
input.readMessage(io.envoyproxy.envoy.config.core.v3.HeaderValue.parser(), extensionRegistry));
break;
}
case 42: {
rawBody_ = input.readBytes();
break;
}
case 50: {
com.google.protobuf.Struct.Builder subBuilder = null;
if (dynamicMetadata_ != null) {
subBuilder = dynamicMetadata_.toBuilder();
}
dynamicMetadata_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(dynamicMetadata_);
dynamicMetadata_ = subBuilder.buildPartial();
}
break;
}
case 58: {
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.Builder subBuilder = null;
if (quota_ != null) {
subBuilder = quota_.toBuilder();
}
quota_ = input.readMessage(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(quota_);
quota_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
statuses_ = java.util.Collections.unmodifiableList(statuses_);
}
if (((mutable_bitField0_ & 0x00000002) != 0)) {
responseHeadersToAdd_ = java.util.Collections.unmodifiableList(responseHeadersToAdd_);
}
if (((mutable_bitField0_ & 0x00000004) != 0)) {
requestHeadersToAdd_ = java.util.Collections.unmodifiableList(requestHeadersToAdd_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.class, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Builder.class);
}
/**
* Protobuf enum {@code envoy.service.ratelimit.v3.RateLimitResponse.Code}
*/
public enum Code
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* The response code is not known.
*
*
* UNKNOWN = 0;
*/
UNKNOWN(0),
/**
*
* The response code to notify that the number of requests are under limit.
*
*
* OK = 1;
*/
OK(1),
/**
*
* The response code to notify that the number of requests are over limit.
*
*
* UNKNOWN = 0;
*/
public static final int UNKNOWN_VALUE = 0;
/**
*
* The response code to notify that the number of requests are under limit.
*
*
* OK = 1;
*/
public static final int OK_VALUE = 1;
/**
*
* The response code to notify that the number of requests are over limit.
*
*
* OVER_LIMIT = 2;
*/
public static final int OVER_LIMIT_VALUE = 2;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Code valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static Code forNumber(int value) {
switch (value) {
case 0: return UNKNOWN;
case 1: return OK;
case 2: return OVER_LIMIT;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
Code> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Code findValueByNumber(int number) {
return Code.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.getDescriptor().getEnumTypes().get(0);
}
private static final Code[] VALUES = values();
public static Code valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Code(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:envoy.service.ratelimit.v3.RateLimitResponse.Code)
}
public interface RateLimitOrBuilder extends
// @@protoc_insertion_point(interface_extends:envoy.service.ratelimit.v3.RateLimitResponse.RateLimit)
com.google.protobuf.MessageOrBuilder {
/**
*
* A name or description of this limit.
*
*
* string name = 3;
* @return The name.
*/
java.lang.String getName();
/**
*
* A name or description of this limit.
*
*
* string name = 3;
* @return The bytes for name.
*/
com.google.protobuf.ByteString
getNameBytes();
/**
*
* The number of requests per unit of time.
*
*
* uint32 requests_per_unit = 1;
* @return The requestsPerUnit.
*/
int getRequestsPerUnit();
/**
*
* The unit of time.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit unit = 2;
* @return The enum numeric value on the wire for unit.
*/
int getUnitValue();
/**
*
* The unit of time.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit unit = 2;
* @return The unit.
*/
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit getUnit();
}
/**
*
* Defines an actual rate limit in terms of requests per unit of time and the unit itself.
*
*
* Protobuf type {@code envoy.service.ratelimit.v3.RateLimitResponse.RateLimit}
*/
public static final class RateLimit extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:envoy.service.ratelimit.v3.RateLimitResponse.RateLimit)
RateLimitOrBuilder {
private static final long serialVersionUID = 0L;
// Use RateLimit.newBuilder() to construct.
private RateLimit(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private RateLimit() {
name_ = "";
unit_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new RateLimit();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private RateLimit(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
requestsPerUnit_ = input.readUInt32();
break;
}
case 16: {
int rawValue = input.readEnum();
unit_ = rawValue;
break;
}
case 26: {
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_RateLimit_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_RateLimit_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.class, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Builder.class);
}
/**
*
* Identifies the unit of of time for rate limit.
* [#comment: replace by envoy/type/v3/ratelimit_unit.proto in v4]
*
*
* Protobuf enum {@code envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit}
*/
public enum Unit
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
*
* UNKNOWN = 0;
*/
public static final int UNKNOWN_VALUE = 0;
/**
*
* The time unit representing a second.
*
*
* SECOND = 1;
*/
public static final int SECOND_VALUE = 1;
/**
*
* The time unit representing a minute.
*
*
* MINUTE = 2;
*/
public static final int MINUTE_VALUE = 2;
/**
*
* The time unit representing an hour.
*
*
* HOUR = 3;
*/
public static final int HOUR_VALUE = 3;
/**
*
* The time unit representing a day.
*
*
* DAY = 4;
*/
public static final int DAY_VALUE = 4;
/**
*
* The time unit representing a month.
*
*
* MONTH = 5;
*/
public static final int MONTH_VALUE = 5;
/**
*
* The time unit representing a year.
*
*
* YEAR = 6;
*/
public static final int YEAR_VALUE = 6;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Unit valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static Unit forNumber(int value) {
switch (value) {
case 0: return UNKNOWN;
case 1: return SECOND;
case 2: return MINUTE;
case 3: return HOUR;
case 4: return DAY;
case 5: return MONTH;
case 6: return YEAR;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
Unit> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Unit findValueByNumber(int number) {
return Unit.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.getDescriptor().getEnumTypes().get(0);
}
private static final Unit[] VALUES = values();
public static Unit valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Unit(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit)
}
public static final int NAME_FIELD_NUMBER = 3;
private volatile java.lang.Object name_;
/**
*
* A name or description of this limit.
*
*
* string name = 3;
* @return The name.
*/
@java.lang.Override
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
*
* A name or description of this limit.
*
*
* string name = 3;
* @return The bytes for name.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int REQUESTS_PER_UNIT_FIELD_NUMBER = 1;
private int requestsPerUnit_;
/**
*
* The number of requests per unit of time.
*
*
* uint32 requests_per_unit = 1;
* @return The requestsPerUnit.
*/
@java.lang.Override
public int getRequestsPerUnit() {
return requestsPerUnit_;
}
public static final int UNIT_FIELD_NUMBER = 2;
private int unit_;
/**
*
* The unit of time.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit unit = 2;
* @return The enum numeric value on the wire for unit.
*/
@java.lang.Override public int getUnitValue() {
return unit_;
}
/**
*
* The unit of time.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit unit = 2;
* @return The unit.
*/
@java.lang.Override public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit getUnit() {
@SuppressWarnings("deprecation")
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit result = io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit.valueOf(unit_);
return result == null ? io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit.UNRECOGNIZED : result;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (requestsPerUnit_ != 0) {
output.writeUInt32(1, requestsPerUnit_);
}
if (unit_ != io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit.UNKNOWN.getNumber()) {
output.writeEnum(2, unit_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (requestsPerUnit_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(1, requestsPerUnit_);
}
if (unit_ != io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit.UNKNOWN.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, unit_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit)) {
return super.equals(obj);
}
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit other = (io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit) obj;
if (!getName()
.equals(other.getName())) return false;
if (getRequestsPerUnit()
!= other.getRequestsPerUnit()) return false;
if (unit_ != other.unit_) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
hash = (37 * hash) + REQUESTS_PER_UNIT_FIELD_NUMBER;
hash = (53 * hash) + getRequestsPerUnit();
hash = (37 * hash) + UNIT_FIELD_NUMBER;
hash = (53 * hash) + unit_;
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Defines an actual rate limit in terms of requests per unit of time and the unit itself.
*
*
* Protobuf type {@code envoy.service.ratelimit.v3.RateLimitResponse.RateLimit}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:envoy.service.ratelimit.v3.RateLimitResponse.RateLimit)
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimitOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_RateLimit_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_RateLimit_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.class, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Builder.class);
}
// Construct using io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
name_ = "";
requestsPerUnit_ = 0;
unit_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_RateLimit_descriptor;
}
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit getDefaultInstanceForType() {
return io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.getDefaultInstance();
}
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit build() {
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit buildPartial() {
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit result = new io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit(this);
result.name_ = name_;
result.requestsPerUnit_ = requestsPerUnit_;
result.unit_ = unit_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit) {
return mergeFrom((io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit other) {
if (other == io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
if (other.getRequestsPerUnit() != 0) {
setRequestsPerUnit(other.getRequestsPerUnit());
}
if (other.unit_ != 0) {
setUnitValue(other.getUnitValue());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object name_ = "";
/**
*
* A name or description of this limit.
*
*
* string name = 3;
* @return The name.
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* A name or description of this limit.
*
*
* string name = 3;
* @return The bytes for name.
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* A name or description of this limit.
*
*
* string name = 3;
* @param value The name to set.
* @return This builder for chaining.
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
*
* A name or description of this limit.
*
*
* string name = 3;
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
*
* A name or description of this limit.
*
*
* string name = 3;
* @param value The bytes for name to set.
* @return This builder for chaining.
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
private int requestsPerUnit_ ;
/**
*
* The number of requests per unit of time.
*
*
* uint32 requests_per_unit = 1;
* @return The requestsPerUnit.
*/
@java.lang.Override
public int getRequestsPerUnit() {
return requestsPerUnit_;
}
/**
*
* The number of requests per unit of time.
*
*
* uint32 requests_per_unit = 1;
* @param value The requestsPerUnit to set.
* @return This builder for chaining.
*/
public Builder setRequestsPerUnit(int value) {
requestsPerUnit_ = value;
onChanged();
return this;
}
/**
*
* The number of requests per unit of time.
*
*
* uint32 requests_per_unit = 1;
* @return This builder for chaining.
*/
public Builder clearRequestsPerUnit() {
requestsPerUnit_ = 0;
onChanged();
return this;
}
private int unit_ = 0;
/**
*
* The unit of time.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit unit = 2;
* @return The enum numeric value on the wire for unit.
*/
@java.lang.Override public int getUnitValue() {
return unit_;
}
/**
*
* The unit of time.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit unit = 2;
* @param value The enum numeric value on the wire for unit to set.
* @return This builder for chaining.
*/
public Builder setUnitValue(int value) {
unit_ = value;
onChanged();
return this;
}
/**
*
* The unit of time.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit unit = 2;
* @return The unit.
*/
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit getUnit() {
@SuppressWarnings("deprecation")
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit result = io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit.valueOf(unit_);
return result == null ? io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit.UNRECOGNIZED : result;
}
/**
*
* The unit of time.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit unit = 2;
* @param value The unit to set.
* @return This builder for chaining.
*/
public Builder setUnit(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit value) {
if (value == null) {
throw new NullPointerException();
}
unit_ = value.getNumber();
onChanged();
return this;
}
/**
*
* The unit of time.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Unit unit = 2;
* @return This builder for chaining.
*/
public Builder clearUnit() {
unit_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:envoy.service.ratelimit.v3.RateLimitResponse.RateLimit)
}
// @@protoc_insertion_point(class_scope:envoy.service.ratelimit.v3.RateLimitResponse.RateLimit)
private static final io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit();
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public RateLimit parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new RateLimit(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface QuotaOrBuilder extends
// @@protoc_insertion_point(interface_extends:envoy.service.ratelimit.v3.RateLimitResponse.Quota)
com.google.protobuf.MessageOrBuilder {
/**
*
* Number of matching requests granted in quota. Must be 1 or more.
*
*
* uint32 requests = 1 [(.validate.rules) = { ... }
* @return The requests.
*/
int getRequests();
/**
*
* Point in time at which the quota expires.
*
*
* .google.protobuf.Timestamp valid_until = 2;
* @return Whether the validUntil field is set.
*/
boolean hasValidUntil();
/**
*
* 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;
* @return The id.
*/
java.lang.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;
* @return The bytes for id.
*/
com.google.protobuf.ByteString
getIdBytes();
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.ExpirationSpecifierCase getExpirationSpecifierCase();
}
/**
*
* 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 {@code envoy.service.ratelimit.v3.RateLimitResponse.Quota}
*/
public static final class Quota extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:envoy.service.ratelimit.v3.RateLimitResponse.Quota)
QuotaOrBuilder {
private static final long serialVersionUID = 0L;
// Use Quota.newBuilder() to construct.
private Quota(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Quota() {
id_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Quota();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Quota(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
requests_ = input.readUInt32();
break;
}
case 18: {
com.google.protobuf.Timestamp.Builder subBuilder = null;
if (expirationSpecifierCase_ == 2) {
subBuilder = ((com.google.protobuf.Timestamp) expirationSpecifier_).toBuilder();
}
expirationSpecifier_ =
input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.google.protobuf.Timestamp) expirationSpecifier_);
expirationSpecifier_ = subBuilder.buildPartial();
}
expirationSpecifierCase_ = 2;
break;
}
case 26: {
java.lang.String s = input.readStringRequireUtf8();
id_ = s;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_Quota_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_Quota_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.class, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.Builder.class);
}
private int expirationSpecifierCase_ = 0;
private java.lang.Object expirationSpecifier_;
public enum ExpirationSpecifierCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
VALID_UNTIL(2),
EXPIRATIONSPECIFIER_NOT_SET(0);
private final int value;
private ExpirationSpecifierCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static ExpirationSpecifierCase valueOf(int value) {
return forNumber(value);
}
public static ExpirationSpecifierCase forNumber(int value) {
switch (value) {
case 2: return VALID_UNTIL;
case 0: return EXPIRATIONSPECIFIER_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public ExpirationSpecifierCase
getExpirationSpecifierCase() {
return ExpirationSpecifierCase.forNumber(
expirationSpecifierCase_);
}
public static final int REQUESTS_FIELD_NUMBER = 1;
private int requests_;
/**
*
* Number of matching requests granted in quota. Must be 1 or more.
*
*
* uint32 requests = 1 [(.validate.rules) = { ... }
* @return The requests.
*/
@java.lang.Override
public int getRequests() {
return requests_;
}
public static final int VALID_UNTIL_FIELD_NUMBER = 2;
/**
*
* Point in time at which the quota expires.
*
*
* .google.protobuf.Timestamp valid_until = 2;
* @return Whether the validUntil field is set.
*/
@java.lang.Override
public boolean hasValidUntil() {
return expirationSpecifierCase_ == 2;
}
/**
*
* Point in time at which the quota expires.
*
*
* .google.protobuf.Timestamp valid_until = 2;
* @return The validUntil.
*/
@java.lang.Override
public com.google.protobuf.Timestamp getValidUntil() {
if (expirationSpecifierCase_ == 2) {
return (com.google.protobuf.Timestamp) expirationSpecifier_;
}
return com.google.protobuf.Timestamp.getDefaultInstance();
}
/**
*
* Point in time at which the quota expires.
*
*
* .google.protobuf.Timestamp valid_until = 2;
*/
@java.lang.Override
public com.google.protobuf.TimestampOrBuilder getValidUntilOrBuilder() {
if (expirationSpecifierCase_ == 2) {
return (com.google.protobuf.Timestamp) expirationSpecifier_;
}
return com.google.protobuf.Timestamp.getDefaultInstance();
}
public static final int ID_FIELD_NUMBER = 3;
private volatile java.lang.Object id_;
/**
*
* 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;
* @return The id.
*/
@java.lang.Override
public java.lang.String getId() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
id_ = s;
return s;
}
}
/**
*
* 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;
* @return The bytes for id.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (requests_ != 0) {
output.writeUInt32(1, requests_);
}
if (expirationSpecifierCase_ == 2) {
output.writeMessage(2, (com.google.protobuf.Timestamp) expirationSpecifier_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, id_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (requests_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(1, requests_);
}
if (expirationSpecifierCase_ == 2) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, (com.google.protobuf.Timestamp) expirationSpecifier_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, id_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota)) {
return super.equals(obj);
}
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota other = (io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota) obj;
if (getRequests()
!= other.getRequests()) return false;
if (!getId()
.equals(other.getId())) return false;
if (!getExpirationSpecifierCase().equals(other.getExpirationSpecifierCase())) return false;
switch (expirationSpecifierCase_) {
case 2:
if (!getValidUntil()
.equals(other.getValidUntil())) return false;
break;
case 0:
default:
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + REQUESTS_FIELD_NUMBER;
hash = (53 * hash) + getRequests();
hash = (37 * hash) + ID_FIELD_NUMBER;
hash = (53 * hash) + getId().hashCode();
switch (expirationSpecifierCase_) {
case 2:
hash = (37 * hash) + VALID_UNTIL_FIELD_NUMBER;
hash = (53 * hash) + getValidUntil().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* 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 {@code envoy.service.ratelimit.v3.RateLimitResponse.Quota}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:envoy.service.ratelimit.v3.RateLimitResponse.Quota)
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.QuotaOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_Quota_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_Quota_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.class, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.Builder.class);
}
// Construct using io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
requests_ = 0;
id_ = "";
expirationSpecifierCase_ = 0;
expirationSpecifier_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_Quota_descriptor;
}
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota getDefaultInstanceForType() {
return io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.getDefaultInstance();
}
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota build() {
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota buildPartial() {
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota result = new io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota(this);
result.requests_ = requests_;
if (expirationSpecifierCase_ == 2) {
if (validUntilBuilder_ == null) {
result.expirationSpecifier_ = expirationSpecifier_;
} else {
result.expirationSpecifier_ = validUntilBuilder_.build();
}
}
result.id_ = id_;
result.expirationSpecifierCase_ = expirationSpecifierCase_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota) {
return mergeFrom((io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota other) {
if (other == io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.getDefaultInstance()) return this;
if (other.getRequests() != 0) {
setRequests(other.getRequests());
}
if (!other.getId().isEmpty()) {
id_ = other.id_;
onChanged();
}
switch (other.getExpirationSpecifierCase()) {
case VALID_UNTIL: {
mergeValidUntil(other.getValidUntil());
break;
}
case EXPIRATIONSPECIFIER_NOT_SET: {
break;
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int expirationSpecifierCase_ = 0;
private java.lang.Object expirationSpecifier_;
public ExpirationSpecifierCase
getExpirationSpecifierCase() {
return ExpirationSpecifierCase.forNumber(
expirationSpecifierCase_);
}
public Builder clearExpirationSpecifier() {
expirationSpecifierCase_ = 0;
expirationSpecifier_ = null;
onChanged();
return this;
}
private int requests_ ;
/**
*
* Number of matching requests granted in quota. Must be 1 or more.
*
*
* uint32 requests = 1 [(.validate.rules) = { ... }
* @return The requests.
*/
@java.lang.Override
public int getRequests() {
return requests_;
}
/**
*
* Number of matching requests granted in quota. Must be 1 or more.
*
*
* uint32 requests = 1 [(.validate.rules) = { ... }
* @param value The requests to set.
* @return This builder for chaining.
*/
public Builder setRequests(int value) {
requests_ = value;
onChanged();
return this;
}
/**
*
* Number of matching requests granted in quota. Must be 1 or more.
*
* 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;
* @return The id.
*/
public java.lang.String getId() {
java.lang.Object ref = id_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
id_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* 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;
* @return The bytes for id.
*/
public com.google.protobuf.ByteString
getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* 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;
* @param value The id to set.
* @return This builder for chaining.
*/
public Builder setId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
id_ = value;
onChanged();
return this;
}
/**
*
* 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;
* @return This builder for chaining.
*/
public Builder clearId() {
id_ = getDefaultInstance().getId();
onChanged();
return this;
}
/**
*
* 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;
* @param value The bytes for id to set.
* @return This builder for chaining.
*/
public Builder setIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
id_ = value;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:envoy.service.ratelimit.v3.RateLimitResponse.Quota)
}
// @@protoc_insertion_point(class_scope:envoy.service.ratelimit.v3.RateLimitResponse.Quota)
private static final io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota();
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Quota parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Quota(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface DescriptorStatusOrBuilder extends
// @@protoc_insertion_point(interface_extends:envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus)
com.google.protobuf.MessageOrBuilder {
/**
*
* The response code for an individual descriptor.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Code code = 1;
* @return The enum numeric value on the wire for code.
*/
int getCodeValue();
/**
*
* The response code for an individual descriptor.
*
* Quota is available for a request if its descriptor set has cached quota available for all
* descriptors.
* This is for each individual descriptor in the descriptor set. The client will perform matches for each individual descriptor against available per-descriptor quota.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1 for
* all matching descriptors.
* If there is not sufficient quota, there are three cases:
* 1. A cached entry exists for a RLS descriptor that is out-of-quota, but not expired.
* In this case, the request will be treated as OVER_LIMIT.
* 2. Some RLS descriptors have a cached entry that has valid quota but some RLS descriptors
* have no cached entry. This will trigger a new RLS request.
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* 3. All RLS descriptors lack a cached entry, this will trigger a new RLS request,
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* [#not-implemented-hide:]
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Quota quota = 5;
* @return Whether the quota field is set.
*/
boolean hasQuota();
/**
*
* Quota is available for a request if its descriptor set has cached quota available for all
* descriptors.
* This is for each individual descriptor in the descriptor set. The client will perform matches for each individual descriptor against available per-descriptor quota.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1 for
* all matching descriptors.
* If there is not sufficient quota, there are three cases:
* 1. A cached entry exists for a RLS descriptor that is out-of-quota, but not expired.
* In this case, the request will be treated as OVER_LIMIT.
* 2. Some RLS descriptors have a cached entry that has valid quota but some RLS descriptors
* have no cached entry. This will trigger a new RLS request.
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* 3. All RLS descriptors lack a cached entry, this will trigger a new RLS request,
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* [#not-implemented-hide:]
*
* Quota is available for a request if its descriptor set has cached quota available for all
* descriptors.
* This is for each individual descriptor in the descriptor set. The client will perform matches for each individual descriptor against available per-descriptor quota.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1 for
* all matching descriptors.
* If there is not sufficient quota, there are three cases:
* 1. A cached entry exists for a RLS descriptor that is out-of-quota, but not expired.
* In this case, the request will be treated as OVER_LIMIT.
* 2. Some RLS descriptors have a cached entry that has valid quota but some RLS descriptors
* have no cached entry. This will trigger a new RLS request.
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* 3. All RLS descriptors lack a cached entry, this will trigger a new RLS request,
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* [#not-implemented-hide:]
*
*
* Protobuf type {@code envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus}
*/
public static final class DescriptorStatus extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus)
DescriptorStatusOrBuilder {
private static final long serialVersionUID = 0L;
// Use DescriptorStatus.newBuilder() to construct.
private DescriptorStatus(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private DescriptorStatus() {
code_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DescriptorStatus();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DescriptorStatus(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
int rawValue = input.readEnum();
code_ = rawValue;
break;
}
case 18: {
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.Builder subBuilder = null;
if (currentLimit_ != null) {
subBuilder = currentLimit_.toBuilder();
}
currentLimit_ = input.readMessage(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(currentLimit_);
currentLimit_ = subBuilder.buildPartial();
}
break;
}
case 24: {
limitRemaining_ = input.readUInt32();
break;
}
case 34: {
com.google.protobuf.Duration.Builder subBuilder = null;
if (durationUntilReset_ != null) {
subBuilder = durationUntilReset_.toBuilder();
}
durationUntilReset_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(durationUntilReset_);
durationUntilReset_ = subBuilder.buildPartial();
}
break;
}
case 42: {
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.Builder subBuilder = null;
if (quota_ != null) {
subBuilder = quota_.toBuilder();
}
quota_ = input.readMessage(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(quota_);
quota_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_DescriptorStatus_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_DescriptorStatus_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus.class, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus.Builder.class);
}
public static final int CODE_FIELD_NUMBER = 1;
private int code_;
/**
*
* The response code for an individual descriptor.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Code code = 1;
* @return The enum numeric value on the wire for code.
*/
@java.lang.Override public int getCodeValue() {
return code_;
}
/**
*
* The response code for an individual descriptor.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Code code = 1;
* @return The code.
*/
@java.lang.Override public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code getCode() {
@SuppressWarnings("deprecation")
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code result = io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code.valueOf(code_);
return result == null ? io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code.UNRECOGNIZED : result;
}
public static final int CURRENT_LIMIT_FIELD_NUMBER = 2;
private io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.RateLimit currentLimit_;
/**
*
* The current limit as configured by the server. Useful for debugging, etc.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.RateLimit current_limit = 2;
* @return Whether the currentLimit field is set.
*/
@java.lang.Override
public boolean hasCurrentLimit() {
return currentLimit_ != null;
}
/**
*
* The current limit as configured by the server. Useful for debugging, etc.
*
* Duration until reset of the current limit window.
*
*
* .google.protobuf.Duration duration_until_reset = 4;
*/
@java.lang.Override
public com.google.protobuf.DurationOrBuilder getDurationUntilResetOrBuilder() {
return getDurationUntilReset();
}
public static final int QUOTA_FIELD_NUMBER = 5;
private io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota quota_;
/**
*
* Quota is available for a request if its descriptor set has cached quota available for all
* descriptors.
* This is for each individual descriptor in the descriptor set. The client will perform matches for each individual descriptor against available per-descriptor quota.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1 for
* all matching descriptors.
* If there is not sufficient quota, there are three cases:
* 1. A cached entry exists for a RLS descriptor that is out-of-quota, but not expired.
* In this case, the request will be treated as OVER_LIMIT.
* 2. Some RLS descriptors have a cached entry that has valid quota but some RLS descriptors
* have no cached entry. This will trigger a new RLS request.
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* 3. All RLS descriptors lack a cached entry, this will trigger a new RLS request,
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* [#not-implemented-hide:]
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Quota quota = 5;
* @return Whether the quota field is set.
*/
@java.lang.Override
public boolean hasQuota() {
return quota_ != null;
}
/**
*
* Quota is available for a request if its descriptor set has cached quota available for all
* descriptors.
* This is for each individual descriptor in the descriptor set. The client will perform matches for each individual descriptor against available per-descriptor quota.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1 for
* all matching descriptors.
* If there is not sufficient quota, there are three cases:
* 1. A cached entry exists for a RLS descriptor that is out-of-quota, but not expired.
* In this case, the request will be treated as OVER_LIMIT.
* 2. Some RLS descriptors have a cached entry that has valid quota but some RLS descriptors
* have no cached entry. This will trigger a new RLS request.
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* 3. All RLS descriptors lack a cached entry, this will trigger a new RLS request,
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* [#not-implemented-hide:]
*
* Quota is available for a request if its descriptor set has cached quota available for all
* descriptors.
* This is for each individual descriptor in the descriptor set. The client will perform matches for each individual descriptor against available per-descriptor quota.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1 for
* all matching descriptors.
* If there is not sufficient quota, there are three cases:
* 1. A cached entry exists for a RLS descriptor that is out-of-quota, but not expired.
* In this case, the request will be treated as OVER_LIMIT.
* 2. Some RLS descriptors have a cached entry that has valid quota but some RLS descriptors
* have no cached entry. This will trigger a new RLS request.
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* 3. All RLS descriptors lack a cached entry, this will trigger a new RLS request,
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* [#not-implemented-hide:]
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Quota quota = 5;
*/
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.QuotaOrBuilder getQuotaOrBuilder() {
return getQuota();
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (code_ != io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code.UNKNOWN.getNumber()) {
output.writeEnum(1, code_);
}
if (currentLimit_ != null) {
output.writeMessage(2, getCurrentLimit());
}
if (limitRemaining_ != 0) {
output.writeUInt32(3, limitRemaining_);
}
if (durationUntilReset_ != null) {
output.writeMessage(4, getDurationUntilReset());
}
if (quota_ != null) {
output.writeMessage(5, getQuota());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (code_ != io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code.UNKNOWN.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, code_);
}
if (currentLimit_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getCurrentLimit());
}
if (limitRemaining_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(3, limitRemaining_);
}
if (durationUntilReset_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getDurationUntilReset());
}
if (quota_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, getQuota());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus)) {
return super.equals(obj);
}
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus other = (io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus) obj;
if (code_ != other.code_) return false;
if (hasCurrentLimit() != other.hasCurrentLimit()) return false;
if (hasCurrentLimit()) {
if (!getCurrentLimit()
.equals(other.getCurrentLimit())) return false;
}
if (getLimitRemaining()
!= other.getLimitRemaining()) return false;
if (hasDurationUntilReset() != other.hasDurationUntilReset()) return false;
if (hasDurationUntilReset()) {
if (!getDurationUntilReset()
.equals(other.getDurationUntilReset())) return false;
}
if (hasQuota() != other.hasQuota()) return false;
if (hasQuota()) {
if (!getQuota()
.equals(other.getQuota())) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + CODE_FIELD_NUMBER;
hash = (53 * hash) + code_;
if (hasCurrentLimit()) {
hash = (37 * hash) + CURRENT_LIMIT_FIELD_NUMBER;
hash = (53 * hash) + getCurrentLimit().hashCode();
}
hash = (37 * hash) + LIMIT_REMAINING_FIELD_NUMBER;
hash = (53 * hash) + getLimitRemaining();
if (hasDurationUntilReset()) {
hash = (37 * hash) + DURATION_UNTIL_RESET_FIELD_NUMBER;
hash = (53 * hash) + getDurationUntilReset().hashCode();
}
if (hasQuota()) {
hash = (37 * hash) + QUOTA_FIELD_NUMBER;
hash = (53 * hash) + getQuota().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* [#next-free-field: 6]
*
*
* Protobuf type {@code envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus)
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatusOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_DescriptorStatus_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_DescriptorStatus_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus.class, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus.Builder.class);
}
// Construct using io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
code_ = 0;
if (currentLimitBuilder_ == null) {
currentLimit_ = null;
} else {
currentLimit_ = null;
currentLimitBuilder_ = null;
}
limitRemaining_ = 0;
if (durationUntilResetBuilder_ == null) {
durationUntilReset_ = null;
} else {
durationUntilReset_ = null;
durationUntilResetBuilder_ = null;
}
if (quotaBuilder_ == null) {
quota_ = null;
} else {
quota_ = null;
quotaBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.envoyproxy.envoy.service.ratelimit.v3.RlsProto.internal_static_envoy_service_ratelimit_v3_RateLimitResponse_DescriptorStatus_descriptor;
}
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus getDefaultInstanceForType() {
return io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus.getDefaultInstance();
}
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus build() {
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus buildPartial() {
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus result = new io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus(this);
result.code_ = code_;
if (currentLimitBuilder_ == null) {
result.currentLimit_ = currentLimit_;
} else {
result.currentLimit_ = currentLimitBuilder_.build();
}
result.limitRemaining_ = limitRemaining_;
if (durationUntilResetBuilder_ == null) {
result.durationUntilReset_ = durationUntilReset_;
} else {
result.durationUntilReset_ = durationUntilResetBuilder_.build();
}
if (quotaBuilder_ == null) {
result.quota_ = quota_;
} else {
result.quota_ = quotaBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus) {
return mergeFrom((io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus other) {
if (other == io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus.getDefaultInstance()) return this;
if (other.code_ != 0) {
setCodeValue(other.getCodeValue());
}
if (other.hasCurrentLimit()) {
mergeCurrentLimit(other.getCurrentLimit());
}
if (other.getLimitRemaining() != 0) {
setLimitRemaining(other.getLimitRemaining());
}
if (other.hasDurationUntilReset()) {
mergeDurationUntilReset(other.getDurationUntilReset());
}
if (other.hasQuota()) {
mergeQuota(other.getQuota());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int code_ = 0;
/**
*
* The response code for an individual descriptor.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Code code = 1;
* @return The enum numeric value on the wire for code.
*/
@java.lang.Override public int getCodeValue() {
return code_;
}
/**
*
* The response code for an individual descriptor.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Code code = 1;
* @param value The enum numeric value on the wire for code to set.
* @return This builder for chaining.
*/
public Builder setCodeValue(int value) {
code_ = value;
onChanged();
return this;
}
/**
*
* The response code for an individual descriptor.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Code code = 1;
* @return The code.
*/
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code getCode() {
@SuppressWarnings("deprecation")
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code result = io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code.valueOf(code_);
return result == null ? io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code.UNRECOGNIZED : result;
}
/**
*
* The response code for an individual descriptor.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Code code = 1;
* @param value The code to set.
* @return This builder for chaining.
*/
public Builder setCode(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code value) {
if (value == null) {
throw new NullPointerException();
}
code_ = value.getNumber();
onChanged();
return this;
}
/**
*
* The response code for an individual descriptor.
*
* Quota is available for a request if its descriptor set has cached quota available for all
* descriptors.
* This is for each individual descriptor in the descriptor set. The client will perform matches for each individual descriptor against available per-descriptor quota.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1 for
* all matching descriptors.
* If there is not sufficient quota, there are three cases:
* 1. A cached entry exists for a RLS descriptor that is out-of-quota, but not expired.
* In this case, the request will be treated as OVER_LIMIT.
* 2. Some RLS descriptors have a cached entry that has valid quota but some RLS descriptors
* have no cached entry. This will trigger a new RLS request.
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* 3. All RLS descriptors lack a cached entry, this will trigger a new RLS request,
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* [#not-implemented-hide:]
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Quota quota = 5;
* @return Whether the quota field is set.
*/
public boolean hasQuota() {
return quotaBuilder_ != null || quota_ != null;
}
/**
*
* Quota is available for a request if its descriptor set has cached quota available for all
* descriptors.
* This is for each individual descriptor in the descriptor set. The client will perform matches for each individual descriptor against available per-descriptor quota.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1 for
* all matching descriptors.
* If there is not sufficient quota, there are three cases:
* 1. A cached entry exists for a RLS descriptor that is out-of-quota, but not expired.
* In this case, the request will be treated as OVER_LIMIT.
* 2. Some RLS descriptors have a cached entry that has valid quota but some RLS descriptors
* have no cached entry. This will trigger a new RLS request.
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* 3. All RLS descriptors lack a cached entry, this will trigger a new RLS request,
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* [#not-implemented-hide:]
*
* Quota is available for a request if its descriptor set has cached quota available for all
* descriptors.
* This is for each individual descriptor in the descriptor set. The client will perform matches for each individual descriptor against available per-descriptor quota.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1 for
* all matching descriptors.
* If there is not sufficient quota, there are three cases:
* 1. A cached entry exists for a RLS descriptor that is out-of-quota, but not expired.
* In this case, the request will be treated as OVER_LIMIT.
* 2. Some RLS descriptors have a cached entry that has valid quota but some RLS descriptors
* have no cached entry. This will trigger a new RLS request.
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* 3. All RLS descriptors lack a cached entry, this will trigger a new RLS request,
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* [#not-implemented-hide:]
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Quota quota = 5;
*/
public Builder setQuota(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota value) {
if (quotaBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
quota_ = value;
onChanged();
} else {
quotaBuilder_.setMessage(value);
}
return this;
}
/**
*
* Quota is available for a request if its descriptor set has cached quota available for all
* descriptors.
* This is for each individual descriptor in the descriptor set. The client will perform matches for each individual descriptor against available per-descriptor quota.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1 for
* all matching descriptors.
* If there is not sufficient quota, there are three cases:
* 1. A cached entry exists for a RLS descriptor that is out-of-quota, but not expired.
* In this case, the request will be treated as OVER_LIMIT.
* 2. Some RLS descriptors have a cached entry that has valid quota but some RLS descriptors
* have no cached entry. This will trigger a new RLS request.
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* 3. All RLS descriptors lack a cached entry, this will trigger a new RLS request,
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* [#not-implemented-hide:]
*
* Quota is available for a request if its descriptor set has cached quota available for all
* descriptors.
* This is for each individual descriptor in the descriptor set. The client will perform matches for each individual descriptor against available per-descriptor quota.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1 for
* all matching descriptors.
* If there is not sufficient quota, there are three cases:
* 1. A cached entry exists for a RLS descriptor that is out-of-quota, but not expired.
* In this case, the request will be treated as OVER_LIMIT.
* 2. Some RLS descriptors have a cached entry that has valid quota but some RLS descriptors
* have no cached entry. This will trigger a new RLS request.
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* 3. All RLS descriptors lack a cached entry, this will trigger a new RLS request,
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* [#not-implemented-hide:]
*
* Quota is available for a request if its descriptor set has cached quota available for all
* descriptors.
* This is for each individual descriptor in the descriptor set. The client will perform matches for each individual descriptor against available per-descriptor quota.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1 for
* all matching descriptors.
* If there is not sufficient quota, there are three cases:
* 1. A cached entry exists for a RLS descriptor that is out-of-quota, but not expired.
* In this case, the request will be treated as OVER_LIMIT.
* 2. Some RLS descriptors have a cached entry that has valid quota but some RLS descriptors
* have no cached entry. This will trigger a new RLS request.
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* 3. All RLS descriptors lack a cached entry, this will trigger a new RLS request,
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* [#not-implemented-hide:]
*
* Quota is available for a request if its descriptor set has cached quota available for all
* descriptors.
* This is for each individual descriptor in the descriptor set. The client will perform matches for each individual descriptor against available per-descriptor quota.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1 for
* all matching descriptors.
* If there is not sufficient quota, there are three cases:
* 1. A cached entry exists for a RLS descriptor that is out-of-quota, but not expired.
* In this case, the request will be treated as OVER_LIMIT.
* 2. Some RLS descriptors have a cached entry that has valid quota but some RLS descriptors
* have no cached entry. This will trigger a new RLS request.
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* 3. All RLS descriptors lack a cached entry, this will trigger a new RLS request,
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* [#not-implemented-hide:]
*
* Quota is available for a request if its descriptor set has cached quota available for all
* descriptors.
* This is for each individual descriptor in the descriptor set. The client will perform matches for each individual descriptor against available per-descriptor quota.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1 for
* all matching descriptors.
* If there is not sufficient quota, there are three cases:
* 1. A cached entry exists for a RLS descriptor that is out-of-quota, but not expired.
* In this case, the request will be treated as OVER_LIMIT.
* 2. Some RLS descriptors have a cached entry that has valid quota but some RLS descriptors
* have no cached entry. This will trigger a new RLS request.
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* 3. All RLS descriptors lack a cached entry, this will trigger a new RLS request,
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* [#not-implemented-hide:]
*
* Quota is available for a request if its descriptor set has cached quota available for all
* descriptors.
* This is for each individual descriptor in the descriptor set. The client will perform matches for each individual descriptor against available per-descriptor quota.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1 for
* all matching descriptors.
* If there is not sufficient quota, there are three cases:
* 1. A cached entry exists for a RLS descriptor that is out-of-quota, but not expired.
* In this case, the request will be treated as OVER_LIMIT.
* 2. Some RLS descriptors have a cached entry that has valid quota but some RLS descriptors
* have no cached entry. This will trigger a new RLS request.
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* 3. All RLS descriptors lack a cached entry, this will trigger a new RLS request,
* When the result is returned, a single unit will be consumed from the quota for all
* matching descriptors.
* If the server did not provide a quota, such as the quota message is empty for some of
* the descriptors, then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* [#not-implemented-hide:]
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Quota quota = 5;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.Builder, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.QuotaOrBuilder>
getQuotaFieldBuilder() {
if (quotaBuilder_ == null) {
quotaBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.Builder, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.QuotaOrBuilder>(
getQuota(),
getParentForChildren(),
isClean());
quota_ = null;
}
return quotaBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus)
}
// @@protoc_insertion_point(class_scope:envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus)
private static final io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus();
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public DescriptorStatus parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DescriptorStatus(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public static final int OVERALL_CODE_FIELD_NUMBER = 1;
private int overallCode_;
/**
*
* The overall response code which takes into account all of the descriptors that were passed
* in the RateLimitRequest message.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Code overall_code = 1;
* @return The enum numeric value on the wire for overallCode.
*/
@java.lang.Override public int getOverallCodeValue() {
return overallCode_;
}
/**
*
* The overall response code which takes into account all of the descriptors that were passed
* in the RateLimitRequest message.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Code overall_code = 1;
* @return The overallCode.
*/
@java.lang.Override public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code getOverallCode() {
@SuppressWarnings("deprecation")
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code result = io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code.valueOf(overallCode_);
return result == null ? io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code.UNRECOGNIZED : result;
}
public static final int STATUSES_FIELD_NUMBER = 2;
private java.util.List statuses_;
/**
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
*
* repeated .envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus statuses = 2;
*/
@java.lang.Override
public int getStatusesCount() {
return statuses_.size();
}
/**
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
*
* repeated .envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus statuses = 2;
*/
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatusOrBuilder getStatusesOrBuilder(
int index) {
return statuses_.get(index);
}
public static final int RESPONSE_HEADERS_TO_ADD_FIELD_NUMBER = 3;
private java.util.List responseHeadersToAdd_;
/**
*
* A list of headers to add to the request when forwarded
*
*
* repeated .envoy.config.core.v3.HeaderValue request_headers_to_add = 4;
*/
@java.lang.Override
public io.envoyproxy.envoy.config.core.v3.HeaderValueOrBuilder getRequestHeadersToAddOrBuilder(
int index) {
return requestHeadersToAdd_.get(index);
}
public static final int RAW_BODY_FIELD_NUMBER = 5;
private com.google.protobuf.ByteString rawBody_;
/**
*
* A response body to send to the downstream client when the response code is not OK.
*
*
* bytes raw_body = 5;
* @return The rawBody.
*/
@java.lang.Override
public com.google.protobuf.ByteString getRawBody() {
return rawBody_;
}
public static final int DYNAMIC_METADATA_FIELD_NUMBER = 6;
private com.google.protobuf.Struct dynamicMetadata_;
/**
*
* Optional response metadata that will be emitted as dynamic metadata to be consumed by the next
* filter. This metadata lives in a namespace specified by the canonical name of extension filter
* that requires it:
* - :ref:`envoy.filters.http.ratelimit <config_http_filters_ratelimit_dynamic_metadata>` for HTTP filter.
* - :ref:`envoy.filters.network.ratelimit <config_network_filters_ratelimit_dynamic_metadata>` for network filter.
* - :ref:`envoy.filters.thrift.rate_limit <config_thrift_filters_rate_limit_dynamic_metadata>` for Thrift filter.
*
*
* .google.protobuf.Struct dynamic_metadata = 6;
* @return Whether the dynamicMetadata field is set.
*/
@java.lang.Override
public boolean hasDynamicMetadata() {
return dynamicMetadata_ != null;
}
/**
*
* Optional response metadata that will be emitted as dynamic metadata to be consumed by the next
* filter. This metadata lives in a namespace specified by the canonical name of extension filter
* that requires it:
* - :ref:`envoy.filters.http.ratelimit <config_http_filters_ratelimit_dynamic_metadata>` for HTTP filter.
* - :ref:`envoy.filters.network.ratelimit <config_network_filters_ratelimit_dynamic_metadata>` for network filter.
* - :ref:`envoy.filters.thrift.rate_limit <config_thrift_filters_rate_limit_dynamic_metadata>` for Thrift filter.
*
* Optional response metadata that will be emitted as dynamic metadata to be consumed by the next
* filter. This metadata lives in a namespace specified by the canonical name of extension filter
* that requires it:
* - :ref:`envoy.filters.http.ratelimit <config_http_filters_ratelimit_dynamic_metadata>` for HTTP filter.
* - :ref:`envoy.filters.network.ratelimit <config_network_filters_ratelimit_dynamic_metadata>` for network filter.
* - :ref:`envoy.filters.thrift.rate_limit <config_thrift_filters_rate_limit_dynamic_metadata>` for Thrift filter.
*
*
* .google.protobuf.Struct dynamic_metadata = 6;
*/
@java.lang.Override
public com.google.protobuf.StructOrBuilder getDynamicMetadataOrBuilder() {
return getDynamicMetadata();
}
public static final int QUOTA_FIELD_NUMBER = 7;
private io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota quota_;
/**
*
* Quota is available for a request if its entire descriptor set has cached quota available.
* This is a union of all descriptors in the descriptor set. Clients can use the quota for future matches if and only if the descriptor set matches what was sent in the request that originated this response.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1.
* If quota is not available (i.e., a cached entry doesn't exist for a RLS descriptor set), a RLS request will be triggered.
* If the server did not provide a quota, such as the quota message is empty then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* If there is not sufficient quota and the cached entry exists for a RLS descriptor set is out-of-quota but not expired,
* the request will be treated as OVER_LIMIT.
* [#not-implemented-hide:]
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Quota quota = 7;
* @return Whether the quota field is set.
*/
@java.lang.Override
public boolean hasQuota() {
return quota_ != null;
}
/**
*
* Quota is available for a request if its entire descriptor set has cached quota available.
* This is a union of all descriptors in the descriptor set. Clients can use the quota for future matches if and only if the descriptor set matches what was sent in the request that originated this response.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1.
* If quota is not available (i.e., a cached entry doesn't exist for a RLS descriptor set), a RLS request will be triggered.
* If the server did not provide a quota, such as the quota message is empty then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* If there is not sufficient quota and the cached entry exists for a RLS descriptor set is out-of-quota but not expired,
* the request will be treated as OVER_LIMIT.
* [#not-implemented-hide:]
*
* Quota is available for a request if its entire descriptor set has cached quota available.
* This is a union of all descriptors in the descriptor set. Clients can use the quota for future matches if and only if the descriptor set matches what was sent in the request that originated this response.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1.
* If quota is not available (i.e., a cached entry doesn't exist for a RLS descriptor set), a RLS request will be triggered.
* If the server did not provide a quota, such as the quota message is empty then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* If there is not sufficient quota and the cached entry exists for a RLS descriptor set is out-of-quota but not expired,
* the request will be treated as OVER_LIMIT.
* [#not-implemented-hide:]
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Quota quota = 7;
*/
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.QuotaOrBuilder getQuotaOrBuilder() {
return getQuota();
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (overallCode_ != io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code.UNKNOWN.getNumber()) {
output.writeEnum(1, overallCode_);
}
for (int i = 0; i < statuses_.size(); i++) {
output.writeMessage(2, statuses_.get(i));
}
for (int i = 0; i < responseHeadersToAdd_.size(); i++) {
output.writeMessage(3, responseHeadersToAdd_.get(i));
}
for (int i = 0; i < requestHeadersToAdd_.size(); i++) {
output.writeMessage(4, requestHeadersToAdd_.get(i));
}
if (!rawBody_.isEmpty()) {
output.writeBytes(5, rawBody_);
}
if (dynamicMetadata_ != null) {
output.writeMessage(6, getDynamicMetadata());
}
if (quota_ != null) {
output.writeMessage(7, getQuota());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (overallCode_ != io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code.UNKNOWN.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, overallCode_);
}
for (int i = 0; i < statuses_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, statuses_.get(i));
}
for (int i = 0; i < responseHeadersToAdd_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, responseHeadersToAdd_.get(i));
}
for (int i = 0; i < requestHeadersToAdd_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, requestHeadersToAdd_.get(i));
}
if (!rawBody_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(5, rawBody_);
}
if (dynamicMetadata_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(6, getDynamicMetadata());
}
if (quota_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(7, getQuota());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse)) {
return super.equals(obj);
}
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse other = (io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse) obj;
if (overallCode_ != other.overallCode_) return false;
if (!getStatusesList()
.equals(other.getStatusesList())) return false;
if (!getResponseHeadersToAddList()
.equals(other.getResponseHeadersToAddList())) return false;
if (!getRequestHeadersToAddList()
.equals(other.getRequestHeadersToAddList())) return false;
if (!getRawBody()
.equals(other.getRawBody())) return false;
if (hasDynamicMetadata() != other.hasDynamicMetadata()) return false;
if (hasDynamicMetadata()) {
if (!getDynamicMetadata()
.equals(other.getDynamicMetadata())) return false;
}
if (hasQuota() != other.hasQuota()) return false;
if (hasQuota()) {
if (!getQuota()
.equals(other.getQuota())) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + OVERALL_CODE_FIELD_NUMBER;
hash = (53 * hash) + overallCode_;
if (getStatusesCount() > 0) {
hash = (37 * hash) + STATUSES_FIELD_NUMBER;
hash = (53 * hash) + getStatusesList().hashCode();
}
if (getResponseHeadersToAddCount() > 0) {
hash = (37 * hash) + RESPONSE_HEADERS_TO_ADD_FIELD_NUMBER;
hash = (53 * hash) + getResponseHeadersToAddList().hashCode();
}
if (getRequestHeadersToAddCount() > 0) {
hash = (37 * hash) + REQUEST_HEADERS_TO_ADD_FIELD_NUMBER;
hash = (53 * hash) + getRequestHeadersToAddList().hashCode();
}
hash = (37 * hash) + RAW_BODY_FIELD_NUMBER;
hash = (53 * hash) + getRawBody().hashCode();
if (hasDynamicMetadata()) {
hash = (37 * hash) + DYNAMIC_METADATA_FIELD_NUMBER;
hash = (53 * hash) + getDynamicMetadata().hashCode();
}
if (hasQuota()) {
hash = (37 * hash) + QUOTA_FIELD_NUMBER;
hash = (53 * hash) + getQuota().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* A response from a ShouldRateLimit call.
* [#next-free-field: 8]
*
* The overall response code which takes into account all of the descriptors that were passed
* in the RateLimitRequest message.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Code overall_code = 1;
* @return The enum numeric value on the wire for overallCode.
*/
@java.lang.Override public int getOverallCodeValue() {
return overallCode_;
}
/**
*
* The overall response code which takes into account all of the descriptors that were passed
* in the RateLimitRequest message.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Code overall_code = 1;
* @param value The enum numeric value on the wire for overallCode to set.
* @return This builder for chaining.
*/
public Builder setOverallCodeValue(int value) {
overallCode_ = value;
onChanged();
return this;
}
/**
*
* The overall response code which takes into account all of the descriptors that were passed
* in the RateLimitRequest message.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Code overall_code = 1;
* @return The overallCode.
*/
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code getOverallCode() {
@SuppressWarnings("deprecation")
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code result = io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code.valueOf(overallCode_);
return result == null ? io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code.UNRECOGNIZED : result;
}
/**
*
* The overall response code which takes into account all of the descriptors that were passed
* in the RateLimitRequest message.
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Code overall_code = 1;
* @param value The overallCode to set.
* @return This builder for chaining.
*/
public Builder setOverallCode(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Code value) {
if (value == null) {
throw new NullPointerException();
}
overallCode_ = value.getNumber();
onChanged();
return this;
}
/**
*
* The overall response code which takes into account all of the descriptors that were passed
* in the RateLimitRequest message.
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
*
* repeated .envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus statuses = 2;
*/
public int getStatusesCount() {
if (statusesBuilder_ == null) {
return statuses_.size();
} else {
return statusesBuilder_.getCount();
}
}
/**
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
*
* repeated .envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus statuses = 2;
*/
public Builder setStatuses(
int index, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus value) {
if (statusesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureStatusesIsMutable();
statuses_.set(index, value);
onChanged();
} else {
statusesBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
*
* repeated .envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus statuses = 2;
*/
public Builder addStatuses(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus value) {
if (statusesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureStatusesIsMutable();
statuses_.add(value);
onChanged();
} else {
statusesBuilder_.addMessage(value);
}
return this;
}
/**
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
*
* repeated .envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus statuses = 2;
*/
public Builder addStatuses(
int index, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus value) {
if (statusesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureStatusesIsMutable();
statuses_.add(index, value);
onChanged();
} else {
statusesBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
*
* repeated .envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus statuses = 2;
*/
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus.Builder getStatusesBuilder(
int index) {
return getStatusesFieldBuilder().getBuilder(index);
}
/**
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
*
* repeated .envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatus statuses = 2;
*/
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.DescriptorStatusOrBuilder getStatusesOrBuilder(
int index) {
if (statusesBuilder_ == null) {
return statuses_.get(index); } else {
return statusesBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
* A list of DescriptorStatus messages which matches the length of the descriptor list passed
* in the RateLimitRequest. This can be used by the caller to determine which individual
* descriptors failed and/or what the currently configured limits are for all of them.
*
* Optional response metadata that will be emitted as dynamic metadata to be consumed by the next
* filter. This metadata lives in a namespace specified by the canonical name of extension filter
* that requires it:
* - :ref:`envoy.filters.http.ratelimit <config_http_filters_ratelimit_dynamic_metadata>` for HTTP filter.
* - :ref:`envoy.filters.network.ratelimit <config_network_filters_ratelimit_dynamic_metadata>` for network filter.
* - :ref:`envoy.filters.thrift.rate_limit <config_thrift_filters_rate_limit_dynamic_metadata>` for Thrift filter.
*
*
* .google.protobuf.Struct dynamic_metadata = 6;
* @return Whether the dynamicMetadata field is set.
*/
public boolean hasDynamicMetadata() {
return dynamicMetadataBuilder_ != null || dynamicMetadata_ != null;
}
/**
*
* Optional response metadata that will be emitted as dynamic metadata to be consumed by the next
* filter. This metadata lives in a namespace specified by the canonical name of extension filter
* that requires it:
* - :ref:`envoy.filters.http.ratelimit <config_http_filters_ratelimit_dynamic_metadata>` for HTTP filter.
* - :ref:`envoy.filters.network.ratelimit <config_network_filters_ratelimit_dynamic_metadata>` for network filter.
* - :ref:`envoy.filters.thrift.rate_limit <config_thrift_filters_rate_limit_dynamic_metadata>` for Thrift filter.
*
* Optional response metadata that will be emitted as dynamic metadata to be consumed by the next
* filter. This metadata lives in a namespace specified by the canonical name of extension filter
* that requires it:
* - :ref:`envoy.filters.http.ratelimit <config_http_filters_ratelimit_dynamic_metadata>` for HTTP filter.
* - :ref:`envoy.filters.network.ratelimit <config_network_filters_ratelimit_dynamic_metadata>` for network filter.
* - :ref:`envoy.filters.thrift.rate_limit <config_thrift_filters_rate_limit_dynamic_metadata>` for Thrift filter.
*
*
* .google.protobuf.Struct dynamic_metadata = 6;
*/
public Builder setDynamicMetadata(com.google.protobuf.Struct value) {
if (dynamicMetadataBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
dynamicMetadata_ = value;
onChanged();
} else {
dynamicMetadataBuilder_.setMessage(value);
}
return this;
}
/**
*
* Optional response metadata that will be emitted as dynamic metadata to be consumed by the next
* filter. This metadata lives in a namespace specified by the canonical name of extension filter
* that requires it:
* - :ref:`envoy.filters.http.ratelimit <config_http_filters_ratelimit_dynamic_metadata>` for HTTP filter.
* - :ref:`envoy.filters.network.ratelimit <config_network_filters_ratelimit_dynamic_metadata>` for network filter.
* - :ref:`envoy.filters.thrift.rate_limit <config_thrift_filters_rate_limit_dynamic_metadata>` for Thrift filter.
*
* Optional response metadata that will be emitted as dynamic metadata to be consumed by the next
* filter. This metadata lives in a namespace specified by the canonical name of extension filter
* that requires it:
* - :ref:`envoy.filters.http.ratelimit <config_http_filters_ratelimit_dynamic_metadata>` for HTTP filter.
* - :ref:`envoy.filters.network.ratelimit <config_network_filters_ratelimit_dynamic_metadata>` for network filter.
* - :ref:`envoy.filters.thrift.rate_limit <config_thrift_filters_rate_limit_dynamic_metadata>` for Thrift filter.
*
* Optional response metadata that will be emitted as dynamic metadata to be consumed by the next
* filter. This metadata lives in a namespace specified by the canonical name of extension filter
* that requires it:
* - :ref:`envoy.filters.http.ratelimit <config_http_filters_ratelimit_dynamic_metadata>` for HTTP filter.
* - :ref:`envoy.filters.network.ratelimit <config_network_filters_ratelimit_dynamic_metadata>` for network filter.
* - :ref:`envoy.filters.thrift.rate_limit <config_thrift_filters_rate_limit_dynamic_metadata>` for Thrift filter.
*
* Optional response metadata that will be emitted as dynamic metadata to be consumed by the next
* filter. This metadata lives in a namespace specified by the canonical name of extension filter
* that requires it:
* - :ref:`envoy.filters.http.ratelimit <config_http_filters_ratelimit_dynamic_metadata>` for HTTP filter.
* - :ref:`envoy.filters.network.ratelimit <config_network_filters_ratelimit_dynamic_metadata>` for network filter.
* - :ref:`envoy.filters.thrift.rate_limit <config_thrift_filters_rate_limit_dynamic_metadata>` for Thrift filter.
*
* Optional response metadata that will be emitted as dynamic metadata to be consumed by the next
* filter. This metadata lives in a namespace specified by the canonical name of extension filter
* that requires it:
* - :ref:`envoy.filters.http.ratelimit <config_http_filters_ratelimit_dynamic_metadata>` for HTTP filter.
* - :ref:`envoy.filters.network.ratelimit <config_network_filters_ratelimit_dynamic_metadata>` for network filter.
* - :ref:`envoy.filters.thrift.rate_limit <config_thrift_filters_rate_limit_dynamic_metadata>` for Thrift filter.
*
* Optional response metadata that will be emitted as dynamic metadata to be consumed by the next
* filter. This metadata lives in a namespace specified by the canonical name of extension filter
* that requires it:
* - :ref:`envoy.filters.http.ratelimit <config_http_filters_ratelimit_dynamic_metadata>` for HTTP filter.
* - :ref:`envoy.filters.network.ratelimit <config_network_filters_ratelimit_dynamic_metadata>` for network filter.
* - :ref:`envoy.filters.thrift.rate_limit <config_thrift_filters_rate_limit_dynamic_metadata>` for Thrift filter.
*
* Quota is available for a request if its entire descriptor set has cached quota available.
* This is a union of all descriptors in the descriptor set. Clients can use the quota for future matches if and only if the descriptor set matches what was sent in the request that originated this response.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1.
* If quota is not available (i.e., a cached entry doesn't exist for a RLS descriptor set), a RLS request will be triggered.
* If the server did not provide a quota, such as the quota message is empty then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* If there is not sufficient quota and the cached entry exists for a RLS descriptor set is out-of-quota but not expired,
* the request will be treated as OVER_LIMIT.
* [#not-implemented-hide:]
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Quota quota = 7;
* @return Whether the quota field is set.
*/
public boolean hasQuota() {
return quotaBuilder_ != null || quota_ != null;
}
/**
*
* Quota is available for a request if its entire descriptor set has cached quota available.
* This is a union of all descriptors in the descriptor set. Clients can use the quota for future matches if and only if the descriptor set matches what was sent in the request that originated this response.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1.
* If quota is not available (i.e., a cached entry doesn't exist for a RLS descriptor set), a RLS request will be triggered.
* If the server did not provide a quota, such as the quota message is empty then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* If there is not sufficient quota and the cached entry exists for a RLS descriptor set is out-of-quota but not expired,
* the request will be treated as OVER_LIMIT.
* [#not-implemented-hide:]
*
* Quota is available for a request if its entire descriptor set has cached quota available.
* This is a union of all descriptors in the descriptor set. Clients can use the quota for future matches if and only if the descriptor set matches what was sent in the request that originated this response.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1.
* If quota is not available (i.e., a cached entry doesn't exist for a RLS descriptor set), a RLS request will be triggered.
* If the server did not provide a quota, such as the quota message is empty then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* If there is not sufficient quota and the cached entry exists for a RLS descriptor set is out-of-quota but not expired,
* the request will be treated as OVER_LIMIT.
* [#not-implemented-hide:]
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Quota quota = 7;
*/
public Builder setQuota(io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota value) {
if (quotaBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
quota_ = value;
onChanged();
} else {
quotaBuilder_.setMessage(value);
}
return this;
}
/**
*
* Quota is available for a request if its entire descriptor set has cached quota available.
* This is a union of all descriptors in the descriptor set. Clients can use the quota for future matches if and only if the descriptor set matches what was sent in the request that originated this response.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1.
* If quota is not available (i.e., a cached entry doesn't exist for a RLS descriptor set), a RLS request will be triggered.
* If the server did not provide a quota, such as the quota message is empty then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* If there is not sufficient quota and the cached entry exists for a RLS descriptor set is out-of-quota but not expired,
* the request will be treated as OVER_LIMIT.
* [#not-implemented-hide:]
*
* Quota is available for a request if its entire descriptor set has cached quota available.
* This is a union of all descriptors in the descriptor set. Clients can use the quota for future matches if and only if the descriptor set matches what was sent in the request that originated this response.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1.
* If quota is not available (i.e., a cached entry doesn't exist for a RLS descriptor set), a RLS request will be triggered.
* If the server did not provide a quota, such as the quota message is empty then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* If there is not sufficient quota and the cached entry exists for a RLS descriptor set is out-of-quota but not expired,
* the request will be treated as OVER_LIMIT.
* [#not-implemented-hide:]
*
* Quota is available for a request if its entire descriptor set has cached quota available.
* This is a union of all descriptors in the descriptor set. Clients can use the quota for future matches if and only if the descriptor set matches what was sent in the request that originated this response.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1.
* If quota is not available (i.e., a cached entry doesn't exist for a RLS descriptor set), a RLS request will be triggered.
* If the server did not provide a quota, such as the quota message is empty then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* If there is not sufficient quota and the cached entry exists for a RLS descriptor set is out-of-quota but not expired,
* the request will be treated as OVER_LIMIT.
* [#not-implemented-hide:]
*
* Quota is available for a request if its entire descriptor set has cached quota available.
* This is a union of all descriptors in the descriptor set. Clients can use the quota for future matches if and only if the descriptor set matches what was sent in the request that originated this response.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1.
* If quota is not available (i.e., a cached entry doesn't exist for a RLS descriptor set), a RLS request will be triggered.
* If the server did not provide a quota, such as the quota message is empty then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* If there is not sufficient quota and the cached entry exists for a RLS descriptor set is out-of-quota but not expired,
* the request will be treated as OVER_LIMIT.
* [#not-implemented-hide:]
*
* Quota is available for a request if its entire descriptor set has cached quota available.
* This is a union of all descriptors in the descriptor set. Clients can use the quota for future matches if and only if the descriptor set matches what was sent in the request that originated this response.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1.
* If quota is not available (i.e., a cached entry doesn't exist for a RLS descriptor set), a RLS request will be triggered.
* If the server did not provide a quota, such as the quota message is empty then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* If there is not sufficient quota and the cached entry exists for a RLS descriptor set is out-of-quota but not expired,
* the request will be treated as OVER_LIMIT.
* [#not-implemented-hide:]
*
* Quota is available for a request if its entire descriptor set has cached quota available.
* This is a union of all descriptors in the descriptor set. Clients can use the quota for future matches if and only if the descriptor set matches what was sent in the request that originated this response.
* If quota is available, a RLS request will not be made and the quota will be reduced by 1.
* If quota is not available (i.e., a cached entry doesn't exist for a RLS descriptor set), a RLS request will be triggered.
* If the server did not provide a quota, such as the quota message is empty then the request admission is determined by the
* :ref:`overall_code <envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.overall_code>`.
* If there is not sufficient quota and the cached entry exists for a RLS descriptor set is out-of-quota but not expired,
* the request will be treated as OVER_LIMIT.
* [#not-implemented-hide:]
*
*
* .envoy.service.ratelimit.v3.RateLimitResponse.Quota quota = 7;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.Builder, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.QuotaOrBuilder>
getQuotaFieldBuilder() {
if (quotaBuilder_ == null) {
quotaBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.Quota.Builder, io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse.QuotaOrBuilder>(
getQuota(),
getParentForChildren(),
isClean());
quota_ = null;
}
return quotaBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:envoy.service.ratelimit.v3.RateLimitResponse)
}
// @@protoc_insertion_point(class_scope:envoy.service.ratelimit.v3.RateLimitResponse)
private static final io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse();
}
public static io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public RateLimitResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new RateLimitResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}