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: google/api/quota.proto
package com.google.api;
/**
*
* Quota configuration helps to achieve fairness and budgeting in service
* usage.
* The quota configuration works this way:
* - The service configuration defines a set of metrics.
* - For API calls, the quota.metric_rules maps methods to metrics with
* corresponding costs.
* - The quota.limits defines limits on the metrics, which will be used for
* quota checks at runtime.
* An example quota configuration in yaml format:
* quota:
* limits:
* - name: apiWriteQpsPerProject
* metric: library.googleapis.com/write_calls
* unit: "1/min/{project}" # rate limit for consumer projects
* values:
* STANDARD: 10000
* # The metric rules bind all methods to the read_calls metric,
* # except for the UpdateBook and DeleteBook methods. These two methods
* # are mapped to the write_calls metric, with the UpdateBook method
* # consuming at twice rate as the DeleteBook method.
* metric_rules:
* - selector: "*"
* metric_costs:
* library.googleapis.com/read_calls: 1
* - selector: google.example.library.v1.LibraryService.UpdateBook
* metric_costs:
* library.googleapis.com/write_calls: 2
* - selector: google.example.library.v1.LibraryService.DeleteBook
* metric_costs:
* library.googleapis.com/write_calls: 1
* Corresponding Metric definition:
* metrics:
* - name: library.googleapis.com/read_calls
* display_name: Read requests
* metric_kind: DELTA
* value_type: INT64
* - name: library.googleapis.com/write_calls
* display_name: Write requests
* metric_kind: DELTA
* value_type: INT64
*
*
* Protobuf type {@code google.api.Quota}
*/
public final class Quota extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.api.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() {
limits_ = java.util.Collections.emptyList();
metricRules_ = java.util.Collections.emptyList();
}
@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();
}
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;
default: {
if (!parseUnknownFieldProto3(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
case 26: {
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
limits_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
limits_.add(
input.readMessage(com.google.api.QuotaLimit.parser(), extensionRegistry));
break;
}
case 34: {
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
metricRules_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000002;
}
metricRules_.add(
input.readMessage(com.google.api.MetricRule.parser(), extensionRegistry));
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
limits_ = java.util.Collections.unmodifiableList(limits_);
}
if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
metricRules_ = java.util.Collections.unmodifiableList(metricRules_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.QuotaProto.internal_static_google_api_Quota_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.QuotaProto.internal_static_google_api_Quota_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.Quota.class, com.google.api.Quota.Builder.class);
}
public static final int LIMITS_FIELD_NUMBER = 3;
private java.util.List limits_;
/**
*
* List of `QuotaLimit` definitions for the service.
* Used by metric-based quotas only.
*
* List of `MetricRule` definitions, each one mapping a selected method to one
* or more metrics.
* Used by metric-based quotas only.
*
*
* repeated .google.api.MetricRule metric_rules = 4;
*/
public com.google.api.MetricRuleOrBuilder getMetricRulesOrBuilder(
int index) {
return metricRules_.get(index);
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
for (int i = 0; i < limits_.size(); i++) {
output.writeMessage(3, limits_.get(i));
}
for (int i = 0; i < metricRules_.size(); i++) {
output.writeMessage(4, metricRules_.get(i));
}
unknownFields.writeTo(output);
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < limits_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, limits_.get(i));
}
for (int i = 0; i < metricRules_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, metricRules_.get(i));
}
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 com.google.api.Quota)) {
return super.equals(obj);
}
com.google.api.Quota other = (com.google.api.Quota) obj;
boolean result = true;
result = result && getLimitsList()
.equals(other.getLimitsList());
result = result && getMetricRulesList()
.equals(other.getMetricRulesList());
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getLimitsCount() > 0) {
hash = (37 * hash) + LIMITS_FIELD_NUMBER;
hash = (53 * hash) + getLimitsList().hashCode();
}
if (getMetricRulesCount() > 0) {
hash = (37 * hash) + METRIC_RULES_FIELD_NUMBER;
hash = (53 * hash) + getMetricRulesList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.api.Quota parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.Quota parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.api.Quota parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.Quota parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.api.Quota parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.Quota parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.api.Quota parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.api.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 com.google.api.Quota parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.api.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 com.google.api.Quota parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.api.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);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.api.Quota prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
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;
}
/**
*
* Quota configuration helps to achieve fairness and budgeting in service
* usage.
* The quota configuration works this way:
* - The service configuration defines a set of metrics.
* - For API calls, the quota.metric_rules maps methods to metrics with
* corresponding costs.
* - The quota.limits defines limits on the metrics, which will be used for
* quota checks at runtime.
* An example quota configuration in yaml format:
* quota:
* limits:
* - name: apiWriteQpsPerProject
* metric: library.googleapis.com/write_calls
* unit: "1/min/{project}" # rate limit for consumer projects
* values:
* STANDARD: 10000
* # The metric rules bind all methods to the read_calls metric,
* # except for the UpdateBook and DeleteBook methods. These two methods
* # are mapped to the write_calls metric, with the UpdateBook method
* # consuming at twice rate as the DeleteBook method.
* metric_rules:
* - selector: "*"
* metric_costs:
* library.googleapis.com/read_calls: 1
* - selector: google.example.library.v1.LibraryService.UpdateBook
* metric_costs:
* library.googleapis.com/write_calls: 2
* - selector: google.example.library.v1.LibraryService.DeleteBook
* metric_costs:
* library.googleapis.com/write_calls: 1
* Corresponding Metric definition:
* metrics:
* - name: library.googleapis.com/read_calls
* display_name: Read requests
* metric_kind: DELTA
* value_type: INT64
* - name: library.googleapis.com/write_calls
* display_name: Write requests
* metric_kind: DELTA
* value_type: INT64
*