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/extensions/common/ratelimit/v3/ratelimit.proto
package io.envoyproxy.envoy.extensions.common.ratelimit.v3;
/**
*
* A RateLimitDescriptor is a list of hierarchical entries that are used by the service to
* determine the final rate limit key and overall allowed limit. Here are some examples of how
* they might be used for the domain "envoy".
* .. code-block:: cpp
* ["authenticated": "false"], ["remote_address": "10.0.0.1"]
* What it does: Limits all unauthenticated traffic for the IP address 10.0.0.1. The
* configuration supplies a default limit for the *remote_address* key. If there is a desire to
* raise the limit for 10.0.0.1 or block it entirely it can be specified directly in the
* configuration.
* .. code-block:: cpp
* ["authenticated": "false"], ["path": "/foo/bar"]
* What it does: Limits all unauthenticated traffic globally for a specific path (or prefix if
* configured that way in the service).
* .. code-block:: cpp
* ["authenticated": "false"], ["path": "/foo/bar"], ["remote_address": "10.0.0.1"]
* What it does: Limits unauthenticated traffic to a specific path for a specific IP address.
* Like (1) we can raise/block specific IP addresses if we want with an override configuration.
* .. code-block:: cpp
* ["authenticated": "true"], ["client_id": "foo"]
* What it does: Limits all traffic for an authenticated client "foo"
* .. code-block:: cpp
* ["authenticated": "true"], ["client_id": "foo"], ["path": "/foo/bar"]
* What it does: Limits traffic to a specific path for an authenticated client "foo"
* The idea behind the API is that (1)/(2)/(3) and (4)/(5) can be sent in 1 request if desired.
* This enables building complex application scenarios with a generic backend.
* Optionally the descriptor can contain a limit override under a "limit" key, that specifies
* the number of requests per unit to use instead of the number configured in the
* rate limiting service.
*
*
* Protobuf type {@code envoy.extensions.common.ratelimit.v3.RateLimitDescriptor}
*/
public final class RateLimitDescriptor extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:envoy.extensions.common.ratelimit.v3.RateLimitDescriptor)
RateLimitDescriptorOrBuilder {
private static final long serialVersionUID = 0L;
// Use RateLimitDescriptor.newBuilder() to construct.
private RateLimitDescriptor(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private RateLimitDescriptor() {
entries_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new RateLimitDescriptor();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private RateLimitDescriptor(
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 10: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
entries_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
entries_.add(
input.readMessage(io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.Entry.parser(), extensionRegistry));
break;
}
case 18: {
io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride.Builder subBuilder = null;
if (limit_ != null) {
subBuilder = limit_.toBuilder();
}
limit_ = input.readMessage(io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(limit_);
limit_ = 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)) {
entries_ = java.util.Collections.unmodifiableList(entries_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.envoyproxy.envoy.extensions.common.ratelimit.v3.RatelimitProto.internal_static_envoy_extensions_common_ratelimit_v3_RateLimitDescriptor_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.extensions.common.ratelimit.v3.RatelimitProto.internal_static_envoy_extensions_common_ratelimit_v3_RateLimitDescriptor_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.class, io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.Builder.class);
}
public interface EntryOrBuilder extends
// @@protoc_insertion_point(interface_extends:envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.Entry)
com.google.protobuf.MessageOrBuilder {
/**
*
*
* string value = 2 [(.validate.rules) = { ... }
* @return The bytes for value.
*/
public com.google.protobuf.ByteString
getValueBytes() {
java.lang.Object ref = value_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
value_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Descriptor value.
*
*
* string value = 2 [(.validate.rules) = { ... }
* @param value The value to set.
* @return This builder for chaining.
*/
public Builder setValue(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
value_ = value;
onChanged();
return this;
}
/**
*
* Descriptor value.
*
*
* string value = 2 [(.validate.rules) = { ... }
* @return This builder for chaining.
*/
public Builder clearValue() {
value_ = getDefaultInstance().getValue();
onChanged();
return this;
}
/**
*
* Descriptor value.
*
*
* string value = 2 [(.validate.rules) = { ... }
* @param value The bytes for value to set.
* @return This builder for chaining.
*/
public Builder setValueBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
value_ = 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.extensions.common.ratelimit.v3.RateLimitDescriptor.Entry)
}
// @@protoc_insertion_point(class_scope:envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.Entry)
private static final io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.Entry DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.Entry();
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.Entry getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Entry parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Entry(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.extensions.common.ratelimit.v3.RateLimitDescriptor.Entry getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface RateLimitOverrideOrBuilder extends
// @@protoc_insertion_point(interface_extends:envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride)
com.google.protobuf.MessageOrBuilder {
/**
*
* The number of requests per unit of time.
*
*
* uint32 requests_per_unit = 1;
* @return The requestsPerUnit.
*/
int getRequestsPerUnit();
/**
*
* The unit of time.
*
*
* .envoy.type.v3.RateLimitUnit unit = 2 [(.validate.rules) = { ... }
* @return The enum numeric value on the wire for unit.
*/
int getUnitValue();
/**
*
* The unit of time.
*
*
* .envoy.type.v3.RateLimitUnit unit = 2 [(.validate.rules) = { ... }
* @return The unit.
*/
io.envoyproxy.envoy.type.v3.RateLimitUnit getUnit();
}
/**
*
* Override rate limit to apply to this descriptor instead of the limit
* configured in the rate limit service. See :ref:`rate limit override
* <config_http_filters_rate_limit_rate_limit_override>` for more information.
*
*
* Protobuf type {@code envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride}
*/
public static final class RateLimitOverride extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride)
RateLimitOverrideOrBuilder {
private static final long serialVersionUID = 0L;
// Use RateLimitOverride.newBuilder() to construct.
private RateLimitOverride(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private RateLimitOverride() {
unit_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new RateLimitOverride();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private RateLimitOverride(
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;
}
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.extensions.common.ratelimit.v3.RatelimitProto.internal_static_envoy_extensions_common_ratelimit_v3_RateLimitDescriptor_RateLimitOverride_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.extensions.common.ratelimit.v3.RatelimitProto.internal_static_envoy_extensions_common_ratelimit_v3_RateLimitDescriptor_RateLimitOverride_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride.class, io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride.Builder.class);
}
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.type.v3.RateLimitUnit unit = 2 [(.validate.rules) = { ... }
* @return The enum numeric value on the wire for unit.
*/
@java.lang.Override public int getUnitValue() {
return unit_;
}
/**
*
* The unit of time.
*
*
* .envoy.type.v3.RateLimitUnit unit = 2 [(.validate.rules) = { ... }
* @return The unit.
*/
@java.lang.Override public io.envoyproxy.envoy.type.v3.RateLimitUnit getUnit() {
@SuppressWarnings("deprecation")
io.envoyproxy.envoy.type.v3.RateLimitUnit result = io.envoyproxy.envoy.type.v3.RateLimitUnit.valueOf(unit_);
return result == null ? io.envoyproxy.envoy.type.v3.RateLimitUnit.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.type.v3.RateLimitUnit.UNKNOWN.getNumber()) {
output.writeEnum(2, unit_);
}
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.type.v3.RateLimitUnit.UNKNOWN.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, unit_);
}
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.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride)) {
return super.equals(obj);
}
io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride other = (io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride) obj;
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) + 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.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride 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.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride 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.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride 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.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride 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.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride 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.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride 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;
}
/**
*
* Override rate limit to apply to this descriptor instead of the limit
* configured in the rate limit service. See :ref:`rate limit override
* <config_http_filters_rate_limit_rate_limit_override>` for more information.
*
*
* Protobuf type {@code envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride)
io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverrideOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.envoyproxy.envoy.extensions.common.ratelimit.v3.RatelimitProto.internal_static_envoy_extensions_common_ratelimit_v3_RateLimitDescriptor_RateLimitOverride_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.extensions.common.ratelimit.v3.RatelimitProto.internal_static_envoy_extensions_common_ratelimit_v3_RateLimitDescriptor_RateLimitOverride_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride.class, io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride.Builder.class);
}
// Construct using io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride.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();
requestsPerUnit_ = 0;
unit_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.envoyproxy.envoy.extensions.common.ratelimit.v3.RatelimitProto.internal_static_envoy_extensions_common_ratelimit_v3_RateLimitDescriptor_RateLimitOverride_descriptor;
}
@java.lang.Override
public io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride getDefaultInstanceForType() {
return io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride.getDefaultInstance();
}
@java.lang.Override
public io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride build() {
io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride buildPartial() {
io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride result = new io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride(this);
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.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride) {
return mergeFrom((io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride other) {
if (other == io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride.getDefaultInstance()) return this;
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.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
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.type.v3.RateLimitUnit unit = 2 [(.validate.rules) = { ... }
* @return The enum numeric value on the wire for unit.
*/
@java.lang.Override public int getUnitValue() {
return unit_;
}
/**
*
* The unit of time.
*
*
* .envoy.type.v3.RateLimitUnit unit = 2 [(.validate.rules) = { ... }
* @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.type.v3.RateLimitUnit unit = 2 [(.validate.rules) = { ... }
* @return The unit.
*/
@java.lang.Override
public io.envoyproxy.envoy.type.v3.RateLimitUnit getUnit() {
@SuppressWarnings("deprecation")
io.envoyproxy.envoy.type.v3.RateLimitUnit result = io.envoyproxy.envoy.type.v3.RateLimitUnit.valueOf(unit_);
return result == null ? io.envoyproxy.envoy.type.v3.RateLimitUnit.UNRECOGNIZED : result;
}
/**
*
* The unit of time.
*
*
* .envoy.type.v3.RateLimitUnit unit = 2 [(.validate.rules) = { ... }
* @param value The unit to set.
* @return This builder for chaining.
*/
public Builder setUnit(io.envoyproxy.envoy.type.v3.RateLimitUnit value) {
if (value == null) {
throw new NullPointerException();
}
unit_ = value.getNumber();
onChanged();
return this;
}
/**
*
* The unit of time.
*
*
* .envoy.type.v3.RateLimitUnit unit = 2 [(.validate.rules) = { ... }
* @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.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride)
}
// @@protoc_insertion_point(class_scope:envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride)
private static final io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride();
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public RateLimitOverride parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new RateLimitOverride(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.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public static final int ENTRIES_FIELD_NUMBER = 1;
private java.util.List entries_;
/**
*
* Optional rate limit override to supply to the ratelimit service.
*
*
* .envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride limit = 2;
*/
@java.lang.Override
public io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverrideOrBuilder getLimitOrBuilder() {
return getLimit();
}
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 {
for (int i = 0; i < entries_.size(); i++) {
output.writeMessage(1, entries_.get(i));
}
if (limit_ != null) {
output.writeMessage(2, getLimit());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < entries_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, entries_.get(i));
}
if (limit_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getLimit());
}
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.extensions.common.ratelimit.v3.RateLimitDescriptor)) {
return super.equals(obj);
}
io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor other = (io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor) obj;
if (!getEntriesList()
.equals(other.getEntriesList())) return false;
if (hasLimit() != other.hasLimit()) return false;
if (hasLimit()) {
if (!getLimit()
.equals(other.getLimit())) 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();
if (getEntriesCount() > 0) {
hash = (37 * hash) + ENTRIES_FIELD_NUMBER;
hash = (53 * hash) + getEntriesList().hashCode();
}
if (hasLimit()) {
hash = (37 * hash) + LIMIT_FIELD_NUMBER;
hash = (53 * hash) + getLimit().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor 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.extensions.common.ratelimit.v3.RateLimitDescriptor parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor 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.extensions.common.ratelimit.v3.RateLimitDescriptor parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor 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.extensions.common.ratelimit.v3.RateLimitDescriptor parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor 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.extensions.common.ratelimit.v3.RateLimitDescriptor parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor 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.extensions.common.ratelimit.v3.RateLimitDescriptor 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 RateLimitDescriptor is a list of hierarchical entries that are used by the service to
* determine the final rate limit key and overall allowed limit. Here are some examples of how
* they might be used for the domain "envoy".
* .. code-block:: cpp
* ["authenticated": "false"], ["remote_address": "10.0.0.1"]
* What it does: Limits all unauthenticated traffic for the IP address 10.0.0.1. The
* configuration supplies a default limit for the *remote_address* key. If there is a desire to
* raise the limit for 10.0.0.1 or block it entirely it can be specified directly in the
* configuration.
* .. code-block:: cpp
* ["authenticated": "false"], ["path": "/foo/bar"]
* What it does: Limits all unauthenticated traffic globally for a specific path (or prefix if
* configured that way in the service).
* .. code-block:: cpp
* ["authenticated": "false"], ["path": "/foo/bar"], ["remote_address": "10.0.0.1"]
* What it does: Limits unauthenticated traffic to a specific path for a specific IP address.
* Like (1) we can raise/block specific IP addresses if we want with an override configuration.
* .. code-block:: cpp
* ["authenticated": "true"], ["client_id": "foo"]
* What it does: Limits all traffic for an authenticated client "foo"
* .. code-block:: cpp
* ["authenticated": "true"], ["client_id": "foo"], ["path": "/foo/bar"]
* What it does: Limits traffic to a specific path for an authenticated client "foo"
* The idea behind the API is that (1)/(2)/(3) and (4)/(5) can be sent in 1 request if desired.
* This enables building complex application scenarios with a generic backend.
* Optionally the descriptor can contain a limit override under a "limit" key, that specifies
* the number of requests per unit to use instead of the number configured in the
* rate limiting service.
*