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
// Protobuf Java Version: 3.25.3
package com.google.api;
/**
*
* `QuotaLimit` defines a specific limit that applies over a specified duration
* for a limit type. There can be at most one limit for a duration and limit
* type combination defined within a `QuotaGroup`.
*
*
* Protobuf type {@code google.api.QuotaLimit}
*/
public final class QuotaLimit extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.api.QuotaLimit)
QuotaLimitOrBuilder {
private static final long serialVersionUID = 0L;
// Use QuotaLimit.newBuilder() to construct.
private QuotaLimit(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private QuotaLimit() {
name_ = "";
description_ = "";
duration_ = "";
metric_ = "";
unit_ = "";
displayName_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new QuotaLimit();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.QuotaProto.internal_static_google_api_QuotaLimit_descriptor;
}
@SuppressWarnings({"rawtypes"})
@java.lang.Override
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 10:
return internalGetValues();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.QuotaProto.internal_static_google_api_QuotaLimit_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.QuotaLimit.class, com.google.api.QuotaLimit.Builder.class);
}
public static final int NAME_FIELD_NUMBER = 6;
@SuppressWarnings("serial")
private volatile java.lang.Object name_ = "";
/**
*
* Name of the quota limit. The name is used to refer to the limit when
* overriding the default limit on per-consumer basis.
*
* For group-based quota limits, the name must be unique within the quota
* group. If a name is not provided, it will be generated from the limit_by
* and duration fields.
*
* For metric-based quota limits, the name must be provided, and it must be
* unique within the service. The name can only include alphanumeric
* characters as well as '-'.
*
* The maximum length of the limit name is 64 characters.
*
* The name of a limit is used as a unique identifier for this limit.
* Therefore, once a limit has been put into use, its name should be
* immutable. You can use the display_name field to provide a user-friendly
* name for the limit. The display name can be evolved over time without
* affecting the identity of the limit.
*
*
* string name = 6;
* @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;
}
}
/**
*
* Name of the quota limit. The name is used to refer to the limit when
* overriding the default limit on per-consumer basis.
*
* For group-based quota limits, the name must be unique within the quota
* group. If a name is not provided, it will be generated from the limit_by
* and duration fields.
*
* For metric-based quota limits, the name must be provided, and it must be
* unique within the service. The name can only include alphanumeric
* characters as well as '-'.
*
* The maximum length of the limit name is 64 characters.
*
* The name of a limit is used as a unique identifier for this limit.
* Therefore, once a limit has been put into use, its name should be
* immutable. You can use the display_name field to provide a user-friendly
* name for the limit. The display name can be evolved over time without
* affecting the identity of the limit.
*
*
* string name = 6;
* @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 DESCRIPTION_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object description_ = "";
/**
*
* Optional. User-visible, extended description for this quota limit.
* Should be used only when more context is needed to understand this limit
* than provided by the limit's display name (see: `display_name`).
*
* Optional. User-visible, extended description for this quota limit.
* Should be used only when more context is needed to understand this limit
* than provided by the limit's display name (see: `display_name`).
*
*
* string description = 2;
* @return The bytes for description.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getDescriptionBytes() {
java.lang.Object ref = description_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
description_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DEFAULT_LIMIT_FIELD_NUMBER = 3;
private long defaultLimit_ = 0L;
/**
*
* Default number of tokens that can be consumed during the specified
* duration. This is the number of tokens assigned when a client
* application developer activates the service for his/her project.
*
* Specifying a value of 0 will block all requests. This can be used if you
* are provisioning quota to selected consumers and blocking others.
* Similarly, a value of -1 will indicate an unlimited quota. No other
* negative values are allowed.
*
* Used by group-based quotas only.
*
*
* int64 default_limit = 3;
* @return The defaultLimit.
*/
@java.lang.Override
public long getDefaultLimit() {
return defaultLimit_;
}
public static final int MAX_LIMIT_FIELD_NUMBER = 4;
private long maxLimit_ = 0L;
/**
*
* Maximum number of tokens that can be consumed during the specified
* duration. Client application developers can override the default limit up
* to this maximum. If specified, this value cannot be set to a value less
* than the default limit. If not specified, it is set to the default limit.
*
* To allow clients to apply overrides with no upper bound, set this to -1,
* indicating unlimited maximum quota.
*
* Used by group-based quotas only.
*
*
* int64 max_limit = 4;
* @return The maxLimit.
*/
@java.lang.Override
public long getMaxLimit() {
return maxLimit_;
}
public static final int FREE_TIER_FIELD_NUMBER = 7;
private long freeTier_ = 0L;
/**
*
* Free tier value displayed in the Developers Console for this limit.
* The free tier is the number of tokens that will be subtracted from the
* billed amount when billing is enabled.
* This field can only be set on a limit with duration "1d", in a billable
* group; it is invalid on any other limit. If this field is not set, it
* defaults to 0, indicating that there is no free tier for this service.
*
* Used by group-based quotas only.
*
*
* int64 free_tier = 7;
* @return The freeTier.
*/
@java.lang.Override
public long getFreeTier() {
return freeTier_;
}
public static final int DURATION_FIELD_NUMBER = 5;
@SuppressWarnings("serial")
private volatile java.lang.Object duration_ = "";
/**
*
* Duration of this limit in textual notation. Example: "100s", "24h", "1d".
* For duration longer than a day, only multiple of days is supported. We
* support only "100s" and "1d" for now. Additional support will be added in
* the future. "0" indicates indefinite duration.
*
* Used by group-based quotas only.
*
* Duration of this limit in textual notation. Example: "100s", "24h", "1d".
* For duration longer than a day, only multiple of days is supported. We
* support only "100s" and "1d" for now. Additional support will be added in
* the future. "0" indicates indefinite duration.
*
* Used by group-based quotas only.
*
*
* string duration = 5;
* @return The bytes for duration.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getDurationBytes() {
java.lang.Object ref = duration_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
duration_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int METRIC_FIELD_NUMBER = 8;
@SuppressWarnings("serial")
private volatile java.lang.Object metric_ = "";
/**
*
* The name of the metric this quota limit applies to. The quota limits with
* the same metric will be checked together during runtime. The metric must be
* defined within the service config.
*
* Used by metric-based quotas only.
*
* The name of the metric this quota limit applies to. The quota limits with
* the same metric will be checked together during runtime. The metric must be
* defined within the service config.
*
* Used by metric-based quotas only.
*
*
* string metric = 8;
* @return The bytes for metric.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getMetricBytes() {
java.lang.Object ref = metric_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
metric_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int UNIT_FIELD_NUMBER = 9;
@SuppressWarnings("serial")
private volatile java.lang.Object unit_ = "";
/**
*
* Specify the unit of the quota limit. It uses the same syntax as
* [Metric.unit][]. The supported unit kinds are determined by the quota
* backend system.
*
* The [Google Service Control](https://cloud.google.com/service-control)
* supports the following unit components:
* * One of the time intevals:
* * "/min" for quota every minute.
* * "/d" for quota every 24 hours, starting 00:00 US Pacific Time.
* * Otherwise the quota won't be reset by time, such as storage limit.
* * One and only one of the granted containers:
* * "/{organization}" quota for an organization.
* * "/{project}" quota for a project.
* * "/{folder}" quota for a folder.
* * "/{resource}" quota for a universal resource.
* * Zero or more quota segmentation dimension. Not all combos are valid.
* * "/{region}" quota for every region. Not to be used with time intervals.
* * Otherwise the resources granted on the target is not segmented.
* * "/{zone}" quota for every zone. Not to be used with time intervals.
* * Otherwise the resources granted on the target is not segmented.
* * "/{resource}" quota for a resource associated with a project or org.
*
* Here are some examples:
* * "1/min/{project}" for quota per minute per project.
* * "1/min/{user}" for quota per minute per user.
* * "1/min/{organization}" for quota per minute per organization.
*
* Note: the order of unit components is insignificant.
* The "1" at the beginning is required to follow the metric unit syntax.
*
* Used by metric-based quotas only.
*
*
* string unit = 9;
* @return The unit.
*/
@java.lang.Override
public java.lang.String getUnit() {
java.lang.Object ref = unit_;
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();
unit_ = s;
return s;
}
}
/**
*
* Specify the unit of the quota limit. It uses the same syntax as
* [Metric.unit][]. The supported unit kinds are determined by the quota
* backend system.
*
* The [Google Service Control](https://cloud.google.com/service-control)
* supports the following unit components:
* * One of the time intevals:
* * "/min" for quota every minute.
* * "/d" for quota every 24 hours, starting 00:00 US Pacific Time.
* * Otherwise the quota won't be reset by time, such as storage limit.
* * One and only one of the granted containers:
* * "/{organization}" quota for an organization.
* * "/{project}" quota for a project.
* * "/{folder}" quota for a folder.
* * "/{resource}" quota for a universal resource.
* * Zero or more quota segmentation dimension. Not all combos are valid.
* * "/{region}" quota for every region. Not to be used with time intervals.
* * Otherwise the resources granted on the target is not segmented.
* * "/{zone}" quota for every zone. Not to be used with time intervals.
* * Otherwise the resources granted on the target is not segmented.
* * "/{resource}" quota for a resource associated with a project or org.
*
* Here are some examples:
* * "1/min/{project}" for quota per minute per project.
* * "1/min/{user}" for quota per minute per user.
* * "1/min/{organization}" for quota per minute per organization.
*
* Note: the order of unit components is insignificant.
* The "1" at the beginning is required to follow the metric unit syntax.
*
* Used by metric-based quotas only.
*
*
* string unit = 9;
* @return The bytes for unit.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getUnitBytes() {
java.lang.Object ref = unit_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
unit_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int VALUES_FIELD_NUMBER = 10;
private static final class ValuesDefaultEntryHolder {
static final com.google.protobuf.MapEntry<
java.lang.String, java.lang.Long> defaultEntry =
com.google.protobuf.MapEntry
.newDefaultInstance(
com.google.api.QuotaProto.internal_static_google_api_QuotaLimit_ValuesEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.INT64,
0L);
}
@SuppressWarnings("serial")
private com.google.protobuf.MapField<
java.lang.String, java.lang.Long> values_;
private com.google.protobuf.MapField
internalGetValues() {
if (values_ == null) {
return com.google.protobuf.MapField.emptyMapField(
ValuesDefaultEntryHolder.defaultEntry);
}
return values_;
}
public int getValuesCount() {
return internalGetValues().getMap().size();
}
/**
*
* Tiered limit values. Also allows for regional or zone overrides for these
* values if "/{region}" or "/{zone}" is specified in the unit field.
*
* Currently supported tiers from low to high:
* VERY_LOW, LOW, STANDARD, HIGH, VERY_HIGH
*
* To apply different limit values for users according to their tiers, specify
* the values for the tiers you want to differentiate. For example:
* {LOW:100, STANDARD:500, HIGH:1000, VERY_HIGH:5000}
*
* The limit value for each tier is optional except for the tier STANDARD.
* The limit value for an unspecified tier falls to the value of its next
* tier towards tier STANDARD. For the above example, the limit value for tier
* STANDARD is 500.
*
* To apply the same limit value for all users, just specify limit value for
* tier STANDARD. For example: {STANDARD:500}.
*
* To apply a regional overide for a tier, add a map entry with key
* "<TIER>/<region>", where <region> is a region name. Similarly, for a zone
* override, add a map entry with key "<TIER>/{zone}".
* Further, a wildcard can be used at the end of a zone name in order to
* specify zone level overrides. For example:
* LOW: 10, STANDARD: 50, HIGH: 100,
* LOW/us-central1: 20, STANDARD/us-central1: 60, HIGH/us-central1: 200,
* LOW/us-central1-*: 10, STANDARD/us-central1-*: 20, HIGH/us-central1-*: 80
*
* The regional overrides tier set for each region must be the same as
* the tier set for default limit values. Same rule applies for zone overrides
* tier as well.
*
* Used by metric-based quotas only.
*
*
* map<string, int64> values = 10;
*/
@java.lang.Override
public boolean containsValues(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
return internalGetValues().getMap().containsKey(key);
}
/**
* Use {@link #getValuesMap()} instead.
*/
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getValues() {
return getValuesMap();
}
/**
*
* Tiered limit values. Also allows for regional or zone overrides for these
* values if "/{region}" or "/{zone}" is specified in the unit field.
*
* Currently supported tiers from low to high:
* VERY_LOW, LOW, STANDARD, HIGH, VERY_HIGH
*
* To apply different limit values for users according to their tiers, specify
* the values for the tiers you want to differentiate. For example:
* {LOW:100, STANDARD:500, HIGH:1000, VERY_HIGH:5000}
*
* The limit value for each tier is optional except for the tier STANDARD.
* The limit value for an unspecified tier falls to the value of its next
* tier towards tier STANDARD. For the above example, the limit value for tier
* STANDARD is 500.
*
* To apply the same limit value for all users, just specify limit value for
* tier STANDARD. For example: {STANDARD:500}.
*
* To apply a regional overide for a tier, add a map entry with key
* "<TIER>/<region>", where <region> is a region name. Similarly, for a zone
* override, add a map entry with key "<TIER>/{zone}".
* Further, a wildcard can be used at the end of a zone name in order to
* specify zone level overrides. For example:
* LOW: 10, STANDARD: 50, HIGH: 100,
* LOW/us-central1: 20, STANDARD/us-central1: 60, HIGH/us-central1: 200,
* LOW/us-central1-*: 10, STANDARD/us-central1-*: 20, HIGH/us-central1-*: 80
*
* The regional overrides tier set for each region must be the same as
* the tier set for default limit values. Same rule applies for zone overrides
* tier as well.
*
* Used by metric-based quotas only.
*
* Tiered limit values. Also allows for regional or zone overrides for these
* values if "/{region}" or "/{zone}" is specified in the unit field.
*
* Currently supported tiers from low to high:
* VERY_LOW, LOW, STANDARD, HIGH, VERY_HIGH
*
* To apply different limit values for users according to their tiers, specify
* the values for the tiers you want to differentiate. For example:
* {LOW:100, STANDARD:500, HIGH:1000, VERY_HIGH:5000}
*
* The limit value for each tier is optional except for the tier STANDARD.
* The limit value for an unspecified tier falls to the value of its next
* tier towards tier STANDARD. For the above example, the limit value for tier
* STANDARD is 500.
*
* To apply the same limit value for all users, just specify limit value for
* tier STANDARD. For example: {STANDARD:500}.
*
* To apply a regional overide for a tier, add a map entry with key
* "<TIER>/<region>", where <region> is a region name. Similarly, for a zone
* override, add a map entry with key "<TIER>/{zone}".
* Further, a wildcard can be used at the end of a zone name in order to
* specify zone level overrides. For example:
* LOW: 10, STANDARD: 50, HIGH: 100,
* LOW/us-central1: 20, STANDARD/us-central1: 60, HIGH/us-central1: 200,
* LOW/us-central1-*: 10, STANDARD/us-central1-*: 20, HIGH/us-central1-*: 80
*
* The regional overrides tier set for each region must be the same as
* the tier set for default limit values. Same rule applies for zone overrides
* tier as well.
*
* Used by metric-based quotas only.
*
*
* map<string, int64> values = 10;
*/
@java.lang.Override
public long getValuesOrDefault(
java.lang.String key,
long defaultValue) {
if (key == null) { throw new NullPointerException("map key"); }
java.util.Map map =
internalGetValues().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
* Tiered limit values. Also allows for regional or zone overrides for these
* values if "/{region}" or "/{zone}" is specified in the unit field.
*
* Currently supported tiers from low to high:
* VERY_LOW, LOW, STANDARD, HIGH, VERY_HIGH
*
* To apply different limit values for users according to their tiers, specify
* the values for the tiers you want to differentiate. For example:
* {LOW:100, STANDARD:500, HIGH:1000, VERY_HIGH:5000}
*
* The limit value for each tier is optional except for the tier STANDARD.
* The limit value for an unspecified tier falls to the value of its next
* tier towards tier STANDARD. For the above example, the limit value for tier
* STANDARD is 500.
*
* To apply the same limit value for all users, just specify limit value for
* tier STANDARD. For example: {STANDARD:500}.
*
* To apply a regional overide for a tier, add a map entry with key
* "<TIER>/<region>", where <region> is a region name. Similarly, for a zone
* override, add a map entry with key "<TIER>/{zone}".
* Further, a wildcard can be used at the end of a zone name in order to
* specify zone level overrides. For example:
* LOW: 10, STANDARD: 50, HIGH: 100,
* LOW/us-central1: 20, STANDARD/us-central1: 60, HIGH/us-central1: 200,
* LOW/us-central1-*: 10, STANDARD/us-central1-*: 20, HIGH/us-central1-*: 80
*
* The regional overrides tier set for each region must be the same as
* the tier set for default limit values. Same rule applies for zone overrides
* tier as well.
*
* Used by metric-based quotas only.
*
*
* map<string, int64> values = 10;
*/
@java.lang.Override
public long getValuesOrThrow(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
java.util.Map map =
internalGetValues().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public static final int DISPLAY_NAME_FIELD_NUMBER = 12;
@SuppressWarnings("serial")
private volatile java.lang.Object displayName_ = "";
/**
*
* User-visible display name for this limit.
* Optional. If not set, the UI will provide a default display name based on
* the quota configuration. This field can be used to override the default
* display name generated from the configuration.
*
* User-visible display name for this limit.
* Optional. If not set, the UI will provide a default display name based on
* the quota configuration. This field can be used to override the default
* display name generated from the configuration.
*
* `QuotaLimit` defines a specific limit that applies over a specified duration
* for a limit type. There can be at most one limit for a duration and limit
* type combination defined within a `QuotaGroup`.
*
*
* Protobuf type {@code google.api.QuotaLimit}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:google.api.QuotaLimit)
com.google.api.QuotaLimitOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.QuotaProto.internal_static_google_api_QuotaLimit_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 10:
return internalGetValues();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(
int number) {
switch (number) {
case 10:
return internalGetMutableValues();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.QuotaProto.internal_static_google_api_QuotaLimit_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.QuotaLimit.class, com.google.api.QuotaLimit.Builder.class);
}
// Construct using com.google.api.QuotaLimit.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
name_ = "";
description_ = "";
defaultLimit_ = 0L;
maxLimit_ = 0L;
freeTier_ = 0L;
duration_ = "";
metric_ = "";
unit_ = "";
internalGetMutableValues().clear();
displayName_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.api.QuotaProto.internal_static_google_api_QuotaLimit_descriptor;
}
@java.lang.Override
public com.google.api.QuotaLimit getDefaultInstanceForType() {
return com.google.api.QuotaLimit.getDefaultInstance();
}
@java.lang.Override
public com.google.api.QuotaLimit build() {
com.google.api.QuotaLimit result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.api.QuotaLimit buildPartial() {
com.google.api.QuotaLimit result = new com.google.api.QuotaLimit(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(com.google.api.QuotaLimit result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.name_ = name_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.description_ = description_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.defaultLimit_ = defaultLimit_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.maxLimit_ = maxLimit_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.freeTier_ = freeTier_;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.duration_ = duration_;
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.metric_ = metric_;
}
if (((from_bitField0_ & 0x00000080) != 0)) {
result.unit_ = unit_;
}
if (((from_bitField0_ & 0x00000100) != 0)) {
result.values_ = internalGetValues();
result.values_.makeImmutable();
}
if (((from_bitField0_ & 0x00000200) != 0)) {
result.displayName_ = displayName_;
}
}
@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 com.google.api.QuotaLimit) {
return mergeFrom((com.google.api.QuotaLimit)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.api.QuotaLimit other) {
if (other == com.google.api.QuotaLimit.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getDescription().isEmpty()) {
description_ = other.description_;
bitField0_ |= 0x00000002;
onChanged();
}
if (other.getDefaultLimit() != 0L) {
setDefaultLimit(other.getDefaultLimit());
}
if (other.getMaxLimit() != 0L) {
setMaxLimit(other.getMaxLimit());
}
if (other.getFreeTier() != 0L) {
setFreeTier(other.getFreeTier());
}
if (!other.getDuration().isEmpty()) {
duration_ = other.duration_;
bitField0_ |= 0x00000020;
onChanged();
}
if (!other.getMetric().isEmpty()) {
metric_ = other.metric_;
bitField0_ |= 0x00000040;
onChanged();
}
if (!other.getUnit().isEmpty()) {
unit_ = other.unit_;
bitField0_ |= 0x00000080;
onChanged();
}
internalGetMutableValues().mergeFrom(
other.internalGetValues());
bitField0_ |= 0x00000100;
if (!other.getDisplayName().isEmpty()) {
displayName_ = other.displayName_;
bitField0_ |= 0x00000200;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 18: {
description_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
case 24: {
defaultLimit_ = input.readInt64();
bitField0_ |= 0x00000004;
break;
} // case 24
case 32: {
maxLimit_ = input.readInt64();
bitField0_ |= 0x00000008;
break;
} // case 32
case 42: {
duration_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000020;
break;
} // case 42
case 50: {
name_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 50
case 56: {
freeTier_ = input.readInt64();
bitField0_ |= 0x00000010;
break;
} // case 56
case 66: {
metric_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000040;
break;
} // case 66
case 74: {
unit_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000080;
break;
} // case 74
case 82: {
com.google.protobuf.MapEntry
values__ = input.readMessage(
ValuesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
internalGetMutableValues().getMutableMap().put(
values__.getKey(), values__.getValue());
bitField0_ |= 0x00000100;
break;
} // case 82
case 98: {
displayName_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000200;
break;
} // case 98
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object name_ = "";
/**
*
* Name of the quota limit. The name is used to refer to the limit when
* overriding the default limit on per-consumer basis.
*
* For group-based quota limits, the name must be unique within the quota
* group. If a name is not provided, it will be generated from the limit_by
* and duration fields.
*
* For metric-based quota limits, the name must be provided, and it must be
* unique within the service. The name can only include alphanumeric
* characters as well as '-'.
*
* The maximum length of the limit name is 64 characters.
*
* The name of a limit is used as a unique identifier for this limit.
* Therefore, once a limit has been put into use, its name should be
* immutable. You can use the display_name field to provide a user-friendly
* name for the limit. The display name can be evolved over time without
* affecting the identity of the limit.
*
*
* string name = 6;
* @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;
}
}
/**
*
* Name of the quota limit. The name is used to refer to the limit when
* overriding the default limit on per-consumer basis.
*
* For group-based quota limits, the name must be unique within the quota
* group. If a name is not provided, it will be generated from the limit_by
* and duration fields.
*
* For metric-based quota limits, the name must be provided, and it must be
* unique within the service. The name can only include alphanumeric
* characters as well as '-'.
*
* The maximum length of the limit name is 64 characters.
*
* The name of a limit is used as a unique identifier for this limit.
* Therefore, once a limit has been put into use, its name should be
* immutable. You can use the display_name field to provide a user-friendly
* name for the limit. The display name can be evolved over time without
* affecting the identity of the limit.
*
*
* string name = 6;
* @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;
}
}
/**
*
* Name of the quota limit. The name is used to refer to the limit when
* overriding the default limit on per-consumer basis.
*
* For group-based quota limits, the name must be unique within the quota
* group. If a name is not provided, it will be generated from the limit_by
* and duration fields.
*
* For metric-based quota limits, the name must be provided, and it must be
* unique within the service. The name can only include alphanumeric
* characters as well as '-'.
*
* The maximum length of the limit name is 64 characters.
*
* The name of a limit is used as a unique identifier for this limit.
* Therefore, once a limit has been put into use, its name should be
* immutable. You can use the display_name field to provide a user-friendly
* name for the limit. The display name can be evolved over time without
* affecting the identity of the limit.
*
*
* string name = 6;
* @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;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* Name of the quota limit. The name is used to refer to the limit when
* overriding the default limit on per-consumer basis.
*
* For group-based quota limits, the name must be unique within the quota
* group. If a name is not provided, it will be generated from the limit_by
* and duration fields.
*
* For metric-based quota limits, the name must be provided, and it must be
* unique within the service. The name can only include alphanumeric
* characters as well as '-'.
*
* The maximum length of the limit name is 64 characters.
*
* The name of a limit is used as a unique identifier for this limit.
* Therefore, once a limit has been put into use, its name should be
* immutable. You can use the display_name field to provide a user-friendly
* name for the limit. The display name can be evolved over time without
* affecting the identity of the limit.
*
*
* string name = 6;
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
* Name of the quota limit. The name is used to refer to the limit when
* overriding the default limit on per-consumer basis.
*
* For group-based quota limits, the name must be unique within the quota
* group. If a name is not provided, it will be generated from the limit_by
* and duration fields.
*
* For metric-based quota limits, the name must be provided, and it must be
* unique within the service. The name can only include alphanumeric
* characters as well as '-'.
*
* The maximum length of the limit name is 64 characters.
*
* The name of a limit is used as a unique identifier for this limit.
* Therefore, once a limit has been put into use, its name should be
* immutable. You can use the display_name field to provide a user-friendly
* name for the limit. The display name can be evolved over time without
* affecting the identity of the limit.
*
*
* string name = 6;
* @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;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object description_ = "";
/**
*
* Optional. User-visible, extended description for this quota limit.
* Should be used only when more context is needed to understand this limit
* than provided by the limit's display name (see: `display_name`).
*
* Optional. User-visible, extended description for this quota limit.
* Should be used only when more context is needed to understand this limit
* than provided by the limit's display name (see: `display_name`).
*
*
* string description = 2;
* @return The bytes for description.
*/
public com.google.protobuf.ByteString
getDescriptionBytes() {
java.lang.Object ref = description_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
description_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Optional. User-visible, extended description for this quota limit.
* Should be used only when more context is needed to understand this limit
* than provided by the limit's display name (see: `display_name`).
*
*
* string description = 2;
* @param value The description to set.
* @return This builder for chaining.
*/
public Builder setDescription(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
description_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* Optional. User-visible, extended description for this quota limit.
* Should be used only when more context is needed to understand this limit
* than provided by the limit's display name (see: `display_name`).
*
* Optional. User-visible, extended description for this quota limit.
* Should be used only when more context is needed to understand this limit
* than provided by the limit's display name (see: `display_name`).
*
*
* string description = 2;
* @param value The bytes for description to set.
* @return This builder for chaining.
*/
public Builder setDescriptionBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
description_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private long defaultLimit_ ;
/**
*
* Default number of tokens that can be consumed during the specified
* duration. This is the number of tokens assigned when a client
* application developer activates the service for his/her project.
*
* Specifying a value of 0 will block all requests. This can be used if you
* are provisioning quota to selected consumers and blocking others.
* Similarly, a value of -1 will indicate an unlimited quota. No other
* negative values are allowed.
*
* Used by group-based quotas only.
*
*
* int64 default_limit = 3;
* @return The defaultLimit.
*/
@java.lang.Override
public long getDefaultLimit() {
return defaultLimit_;
}
/**
*
* Default number of tokens that can be consumed during the specified
* duration. This is the number of tokens assigned when a client
* application developer activates the service for his/her project.
*
* Specifying a value of 0 will block all requests. This can be used if you
* are provisioning quota to selected consumers and blocking others.
* Similarly, a value of -1 will indicate an unlimited quota. No other
* negative values are allowed.
*
* Used by group-based quotas only.
*
*
* int64 default_limit = 3;
* @param value The defaultLimit to set.
* @return This builder for chaining.
*/
public Builder setDefaultLimit(long value) {
defaultLimit_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* Default number of tokens that can be consumed during the specified
* duration. This is the number of tokens assigned when a client
* application developer activates the service for his/her project.
*
* Specifying a value of 0 will block all requests. This can be used if you
* are provisioning quota to selected consumers and blocking others.
* Similarly, a value of -1 will indicate an unlimited quota. No other
* negative values are allowed.
*
* Used by group-based quotas only.
*
*
* int64 default_limit = 3;
* @return This builder for chaining.
*/
public Builder clearDefaultLimit() {
bitField0_ = (bitField0_ & ~0x00000004);
defaultLimit_ = 0L;
onChanged();
return this;
}
private long maxLimit_ ;
/**
*
* Maximum number of tokens that can be consumed during the specified
* duration. Client application developers can override the default limit up
* to this maximum. If specified, this value cannot be set to a value less
* than the default limit. If not specified, it is set to the default limit.
*
* To allow clients to apply overrides with no upper bound, set this to -1,
* indicating unlimited maximum quota.
*
* Used by group-based quotas only.
*
*
* int64 max_limit = 4;
* @return The maxLimit.
*/
@java.lang.Override
public long getMaxLimit() {
return maxLimit_;
}
/**
*
* Maximum number of tokens that can be consumed during the specified
* duration. Client application developers can override the default limit up
* to this maximum. If specified, this value cannot be set to a value less
* than the default limit. If not specified, it is set to the default limit.
*
* To allow clients to apply overrides with no upper bound, set this to -1,
* indicating unlimited maximum quota.
*
* Used by group-based quotas only.
*
*
* int64 max_limit = 4;
* @param value The maxLimit to set.
* @return This builder for chaining.
*/
public Builder setMaxLimit(long value) {
maxLimit_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* Maximum number of tokens that can be consumed during the specified
* duration. Client application developers can override the default limit up
* to this maximum. If specified, this value cannot be set to a value less
* than the default limit. If not specified, it is set to the default limit.
*
* To allow clients to apply overrides with no upper bound, set this to -1,
* indicating unlimited maximum quota.
*
* Used by group-based quotas only.
*
*
* int64 max_limit = 4;
* @return This builder for chaining.
*/
public Builder clearMaxLimit() {
bitField0_ = (bitField0_ & ~0x00000008);
maxLimit_ = 0L;
onChanged();
return this;
}
private long freeTier_ ;
/**
*
* Free tier value displayed in the Developers Console for this limit.
* The free tier is the number of tokens that will be subtracted from the
* billed amount when billing is enabled.
* This field can only be set on a limit with duration "1d", in a billable
* group; it is invalid on any other limit. If this field is not set, it
* defaults to 0, indicating that there is no free tier for this service.
*
* Used by group-based quotas only.
*
*
* int64 free_tier = 7;
* @return The freeTier.
*/
@java.lang.Override
public long getFreeTier() {
return freeTier_;
}
/**
*
* Free tier value displayed in the Developers Console for this limit.
* The free tier is the number of tokens that will be subtracted from the
* billed amount when billing is enabled.
* This field can only be set on a limit with duration "1d", in a billable
* group; it is invalid on any other limit. If this field is not set, it
* defaults to 0, indicating that there is no free tier for this service.
*
* Used by group-based quotas only.
*
*
* int64 free_tier = 7;
* @param value The freeTier to set.
* @return This builder for chaining.
*/
public Builder setFreeTier(long value) {
freeTier_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
* Free tier value displayed in the Developers Console for this limit.
* The free tier is the number of tokens that will be subtracted from the
* billed amount when billing is enabled.
* This field can only be set on a limit with duration "1d", in a billable
* group; it is invalid on any other limit. If this field is not set, it
* defaults to 0, indicating that there is no free tier for this service.
*
* Used by group-based quotas only.
*
* Duration of this limit in textual notation. Example: "100s", "24h", "1d".
* For duration longer than a day, only multiple of days is supported. We
* support only "100s" and "1d" for now. Additional support will be added in
* the future. "0" indicates indefinite duration.
*
* Used by group-based quotas only.
*
* Duration of this limit in textual notation. Example: "100s", "24h", "1d".
* For duration longer than a day, only multiple of days is supported. We
* support only "100s" and "1d" for now. Additional support will be added in
* the future. "0" indicates indefinite duration.
*
* Used by group-based quotas only.
*
*
* string duration = 5;
* @return The bytes for duration.
*/
public com.google.protobuf.ByteString
getDurationBytes() {
java.lang.Object ref = duration_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
duration_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Duration of this limit in textual notation. Example: "100s", "24h", "1d".
* For duration longer than a day, only multiple of days is supported. We
* support only "100s" and "1d" for now. Additional support will be added in
* the future. "0" indicates indefinite duration.
*
* Used by group-based quotas only.
*
*
* string duration = 5;
* @param value The duration to set.
* @return This builder for chaining.
*/
public Builder setDuration(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
duration_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
* Duration of this limit in textual notation. Example: "100s", "24h", "1d".
* For duration longer than a day, only multiple of days is supported. We
* support only "100s" and "1d" for now. Additional support will be added in
* the future. "0" indicates indefinite duration.
*
* Used by group-based quotas only.
*
* Duration of this limit in textual notation. Example: "100s", "24h", "1d".
* For duration longer than a day, only multiple of days is supported. We
* support only "100s" and "1d" for now. Additional support will be added in
* the future. "0" indicates indefinite duration.
*
* Used by group-based quotas only.
*
*
* string duration = 5;
* @param value The bytes for duration to set.
* @return This builder for chaining.
*/
public Builder setDurationBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
duration_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
private java.lang.Object metric_ = "";
/**
*
* The name of the metric this quota limit applies to. The quota limits with
* the same metric will be checked together during runtime. The metric must be
* defined within the service config.
*
* Used by metric-based quotas only.
*
* The name of the metric this quota limit applies to. The quota limits with
* the same metric will be checked together during runtime. The metric must be
* defined within the service config.
*
* Used by metric-based quotas only.
*
*
* string metric = 8;
* @return The bytes for metric.
*/
public com.google.protobuf.ByteString
getMetricBytes() {
java.lang.Object ref = metric_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
metric_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The name of the metric this quota limit applies to. The quota limits with
* the same metric will be checked together during runtime. The metric must be
* defined within the service config.
*
* Used by metric-based quotas only.
*
*
* string metric = 8;
* @param value The metric to set.
* @return This builder for chaining.
*/
public Builder setMetric(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
metric_ = value;
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
* The name of the metric this quota limit applies to. The quota limits with
* the same metric will be checked together during runtime. The metric must be
* defined within the service config.
*
* Used by metric-based quotas only.
*
* The name of the metric this quota limit applies to. The quota limits with
* the same metric will be checked together during runtime. The metric must be
* defined within the service config.
*
* Used by metric-based quotas only.
*
*
* string metric = 8;
* @param value The bytes for metric to set.
* @return This builder for chaining.
*/
public Builder setMetricBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
metric_ = value;
bitField0_ |= 0x00000040;
onChanged();
return this;
}
private java.lang.Object unit_ = "";
/**
*
* Specify the unit of the quota limit. It uses the same syntax as
* [Metric.unit][]. The supported unit kinds are determined by the quota
* backend system.
*
* The [Google Service Control](https://cloud.google.com/service-control)
* supports the following unit components:
* * One of the time intevals:
* * "/min" for quota every minute.
* * "/d" for quota every 24 hours, starting 00:00 US Pacific Time.
* * Otherwise the quota won't be reset by time, such as storage limit.
* * One and only one of the granted containers:
* * "/{organization}" quota for an organization.
* * "/{project}" quota for a project.
* * "/{folder}" quota for a folder.
* * "/{resource}" quota for a universal resource.
* * Zero or more quota segmentation dimension. Not all combos are valid.
* * "/{region}" quota for every region. Not to be used with time intervals.
* * Otherwise the resources granted on the target is not segmented.
* * "/{zone}" quota for every zone. Not to be used with time intervals.
* * Otherwise the resources granted on the target is not segmented.
* * "/{resource}" quota for a resource associated with a project or org.
*
* Here are some examples:
* * "1/min/{project}" for quota per minute per project.
* * "1/min/{user}" for quota per minute per user.
* * "1/min/{organization}" for quota per minute per organization.
*
* Note: the order of unit components is insignificant.
* The "1" at the beginning is required to follow the metric unit syntax.
*
* Used by metric-based quotas only.
*
*
* string unit = 9;
* @return The unit.
*/
public java.lang.String getUnit() {
java.lang.Object ref = unit_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
unit_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Specify the unit of the quota limit. It uses the same syntax as
* [Metric.unit][]. The supported unit kinds are determined by the quota
* backend system.
*
* The [Google Service Control](https://cloud.google.com/service-control)
* supports the following unit components:
* * One of the time intevals:
* * "/min" for quota every minute.
* * "/d" for quota every 24 hours, starting 00:00 US Pacific Time.
* * Otherwise the quota won't be reset by time, such as storage limit.
* * One and only one of the granted containers:
* * "/{organization}" quota for an organization.
* * "/{project}" quota for a project.
* * "/{folder}" quota for a folder.
* * "/{resource}" quota for a universal resource.
* * Zero or more quota segmentation dimension. Not all combos are valid.
* * "/{region}" quota for every region. Not to be used with time intervals.
* * Otherwise the resources granted on the target is not segmented.
* * "/{zone}" quota for every zone. Not to be used with time intervals.
* * Otherwise the resources granted on the target is not segmented.
* * "/{resource}" quota for a resource associated with a project or org.
*
* Here are some examples:
* * "1/min/{project}" for quota per minute per project.
* * "1/min/{user}" for quota per minute per user.
* * "1/min/{organization}" for quota per minute per organization.
*
* Note: the order of unit components is insignificant.
* The "1" at the beginning is required to follow the metric unit syntax.
*
* Used by metric-based quotas only.
*
*
* string unit = 9;
* @return The bytes for unit.
*/
public com.google.protobuf.ByteString
getUnitBytes() {
java.lang.Object ref = unit_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
unit_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Specify the unit of the quota limit. It uses the same syntax as
* [Metric.unit][]. The supported unit kinds are determined by the quota
* backend system.
*
* The [Google Service Control](https://cloud.google.com/service-control)
* supports the following unit components:
* * One of the time intevals:
* * "/min" for quota every minute.
* * "/d" for quota every 24 hours, starting 00:00 US Pacific Time.
* * Otherwise the quota won't be reset by time, such as storage limit.
* * One and only one of the granted containers:
* * "/{organization}" quota for an organization.
* * "/{project}" quota for a project.
* * "/{folder}" quota for a folder.
* * "/{resource}" quota for a universal resource.
* * Zero or more quota segmentation dimension. Not all combos are valid.
* * "/{region}" quota for every region. Not to be used with time intervals.
* * Otherwise the resources granted on the target is not segmented.
* * "/{zone}" quota for every zone. Not to be used with time intervals.
* * Otherwise the resources granted on the target is not segmented.
* * "/{resource}" quota for a resource associated with a project or org.
*
* Here are some examples:
* * "1/min/{project}" for quota per minute per project.
* * "1/min/{user}" for quota per minute per user.
* * "1/min/{organization}" for quota per minute per organization.
*
* Note: the order of unit components is insignificant.
* The "1" at the beginning is required to follow the metric unit syntax.
*
* Used by metric-based quotas only.
*
*
* string unit = 9;
* @param value The unit to set.
* @return This builder for chaining.
*/
public Builder setUnit(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
unit_ = value;
bitField0_ |= 0x00000080;
onChanged();
return this;
}
/**
*
* Specify the unit of the quota limit. It uses the same syntax as
* [Metric.unit][]. The supported unit kinds are determined by the quota
* backend system.
*
* The [Google Service Control](https://cloud.google.com/service-control)
* supports the following unit components:
* * One of the time intevals:
* * "/min" for quota every minute.
* * "/d" for quota every 24 hours, starting 00:00 US Pacific Time.
* * Otherwise the quota won't be reset by time, such as storage limit.
* * One and only one of the granted containers:
* * "/{organization}" quota for an organization.
* * "/{project}" quota for a project.
* * "/{folder}" quota for a folder.
* * "/{resource}" quota for a universal resource.
* * Zero or more quota segmentation dimension. Not all combos are valid.
* * "/{region}" quota for every region. Not to be used with time intervals.
* * Otherwise the resources granted on the target is not segmented.
* * "/{zone}" quota for every zone. Not to be used with time intervals.
* * Otherwise the resources granted on the target is not segmented.
* * "/{resource}" quota for a resource associated with a project or org.
*
* Here are some examples:
* * "1/min/{project}" for quota per minute per project.
* * "1/min/{user}" for quota per minute per user.
* * "1/min/{organization}" for quota per minute per organization.
*
* Note: the order of unit components is insignificant.
* The "1" at the beginning is required to follow the metric unit syntax.
*
* Used by metric-based quotas only.
*
*
* string unit = 9;
* @return This builder for chaining.
*/
public Builder clearUnit() {
unit_ = getDefaultInstance().getUnit();
bitField0_ = (bitField0_ & ~0x00000080);
onChanged();
return this;
}
/**
*
* Specify the unit of the quota limit. It uses the same syntax as
* [Metric.unit][]. The supported unit kinds are determined by the quota
* backend system.
*
* The [Google Service Control](https://cloud.google.com/service-control)
* supports the following unit components:
* * One of the time intevals:
* * "/min" for quota every minute.
* * "/d" for quota every 24 hours, starting 00:00 US Pacific Time.
* * Otherwise the quota won't be reset by time, such as storage limit.
* * One and only one of the granted containers:
* * "/{organization}" quota for an organization.
* * "/{project}" quota for a project.
* * "/{folder}" quota for a folder.
* * "/{resource}" quota for a universal resource.
* * Zero or more quota segmentation dimension. Not all combos are valid.
* * "/{region}" quota for every region. Not to be used with time intervals.
* * Otherwise the resources granted on the target is not segmented.
* * "/{zone}" quota for every zone. Not to be used with time intervals.
* * Otherwise the resources granted on the target is not segmented.
* * "/{resource}" quota for a resource associated with a project or org.
*
* Here are some examples:
* * "1/min/{project}" for quota per minute per project.
* * "1/min/{user}" for quota per minute per user.
* * "1/min/{organization}" for quota per minute per organization.
*
* Note: the order of unit components is insignificant.
* The "1" at the beginning is required to follow the metric unit syntax.
*
* Used by metric-based quotas only.
*
*
* string unit = 9;
* @param value The bytes for unit to set.
* @return This builder for chaining.
*/
public Builder setUnitBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
unit_ = value;
bitField0_ |= 0x00000080;
onChanged();
return this;
}
private com.google.protobuf.MapField<
java.lang.String, java.lang.Long> values_;
private com.google.protobuf.MapField
internalGetValues() {
if (values_ == null) {
return com.google.protobuf.MapField.emptyMapField(
ValuesDefaultEntryHolder.defaultEntry);
}
return values_;
}
private com.google.protobuf.MapField
internalGetMutableValues() {
if (values_ == null) {
values_ = com.google.protobuf.MapField.newMapField(
ValuesDefaultEntryHolder.defaultEntry);
}
if (!values_.isMutable()) {
values_ = values_.copy();
}
bitField0_ |= 0x00000100;
onChanged();
return values_;
}
public int getValuesCount() {
return internalGetValues().getMap().size();
}
/**
*
* Tiered limit values. Also allows for regional or zone overrides for these
* values if "/{region}" or "/{zone}" is specified in the unit field.
*
* Currently supported tiers from low to high:
* VERY_LOW, LOW, STANDARD, HIGH, VERY_HIGH
*
* To apply different limit values for users according to their tiers, specify
* the values for the tiers you want to differentiate. For example:
* {LOW:100, STANDARD:500, HIGH:1000, VERY_HIGH:5000}
*
* The limit value for each tier is optional except for the tier STANDARD.
* The limit value for an unspecified tier falls to the value of its next
* tier towards tier STANDARD. For the above example, the limit value for tier
* STANDARD is 500.
*
* To apply the same limit value for all users, just specify limit value for
* tier STANDARD. For example: {STANDARD:500}.
*
* To apply a regional overide for a tier, add a map entry with key
* "<TIER>/<region>", where <region> is a region name. Similarly, for a zone
* override, add a map entry with key "<TIER>/{zone}".
* Further, a wildcard can be used at the end of a zone name in order to
* specify zone level overrides. For example:
* LOW: 10, STANDARD: 50, HIGH: 100,
* LOW/us-central1: 20, STANDARD/us-central1: 60, HIGH/us-central1: 200,
* LOW/us-central1-*: 10, STANDARD/us-central1-*: 20, HIGH/us-central1-*: 80
*
* The regional overrides tier set for each region must be the same as
* the tier set for default limit values. Same rule applies for zone overrides
* tier as well.
*
* Used by metric-based quotas only.
*
*
* map<string, int64> values = 10;
*/
@java.lang.Override
public boolean containsValues(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
return internalGetValues().getMap().containsKey(key);
}
/**
* Use {@link #getValuesMap()} instead.
*/
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getValues() {
return getValuesMap();
}
/**
*
* Tiered limit values. Also allows for regional or zone overrides for these
* values if "/{region}" or "/{zone}" is specified in the unit field.
*
* Currently supported tiers from low to high:
* VERY_LOW, LOW, STANDARD, HIGH, VERY_HIGH
*
* To apply different limit values for users according to their tiers, specify
* the values for the tiers you want to differentiate. For example:
* {LOW:100, STANDARD:500, HIGH:1000, VERY_HIGH:5000}
*
* The limit value for each tier is optional except for the tier STANDARD.
* The limit value for an unspecified tier falls to the value of its next
* tier towards tier STANDARD. For the above example, the limit value for tier
* STANDARD is 500.
*
* To apply the same limit value for all users, just specify limit value for
* tier STANDARD. For example: {STANDARD:500}.
*
* To apply a regional overide for a tier, add a map entry with key
* "<TIER>/<region>", where <region> is a region name. Similarly, for a zone
* override, add a map entry with key "<TIER>/{zone}".
* Further, a wildcard can be used at the end of a zone name in order to
* specify zone level overrides. For example:
* LOW: 10, STANDARD: 50, HIGH: 100,
* LOW/us-central1: 20, STANDARD/us-central1: 60, HIGH/us-central1: 200,
* LOW/us-central1-*: 10, STANDARD/us-central1-*: 20, HIGH/us-central1-*: 80
*
* The regional overrides tier set for each region must be the same as
* the tier set for default limit values. Same rule applies for zone overrides
* tier as well.
*
* Used by metric-based quotas only.
*
* Tiered limit values. Also allows for regional or zone overrides for these
* values if "/{region}" or "/{zone}" is specified in the unit field.
*
* Currently supported tiers from low to high:
* VERY_LOW, LOW, STANDARD, HIGH, VERY_HIGH
*
* To apply different limit values for users according to their tiers, specify
* the values for the tiers you want to differentiate. For example:
* {LOW:100, STANDARD:500, HIGH:1000, VERY_HIGH:5000}
*
* The limit value for each tier is optional except for the tier STANDARD.
* The limit value for an unspecified tier falls to the value of its next
* tier towards tier STANDARD. For the above example, the limit value for tier
* STANDARD is 500.
*
* To apply the same limit value for all users, just specify limit value for
* tier STANDARD. For example: {STANDARD:500}.
*
* To apply a regional overide for a tier, add a map entry with key
* "<TIER>/<region>", where <region> is a region name. Similarly, for a zone
* override, add a map entry with key "<TIER>/{zone}".
* Further, a wildcard can be used at the end of a zone name in order to
* specify zone level overrides. For example:
* LOW: 10, STANDARD: 50, HIGH: 100,
* LOW/us-central1: 20, STANDARD/us-central1: 60, HIGH/us-central1: 200,
* LOW/us-central1-*: 10, STANDARD/us-central1-*: 20, HIGH/us-central1-*: 80
*
* The regional overrides tier set for each region must be the same as
* the tier set for default limit values. Same rule applies for zone overrides
* tier as well.
*
* Used by metric-based quotas only.
*
*
* map<string, int64> values = 10;
*/
@java.lang.Override
public long getValuesOrDefault(
java.lang.String key,
long defaultValue) {
if (key == null) { throw new NullPointerException("map key"); }
java.util.Map map =
internalGetValues().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
* Tiered limit values. Also allows for regional or zone overrides for these
* values if "/{region}" or "/{zone}" is specified in the unit field.
*
* Currently supported tiers from low to high:
* VERY_LOW, LOW, STANDARD, HIGH, VERY_HIGH
*
* To apply different limit values for users according to their tiers, specify
* the values for the tiers you want to differentiate. For example:
* {LOW:100, STANDARD:500, HIGH:1000, VERY_HIGH:5000}
*
* The limit value for each tier is optional except for the tier STANDARD.
* The limit value for an unspecified tier falls to the value of its next
* tier towards tier STANDARD. For the above example, the limit value for tier
* STANDARD is 500.
*
* To apply the same limit value for all users, just specify limit value for
* tier STANDARD. For example: {STANDARD:500}.
*
* To apply a regional overide for a tier, add a map entry with key
* "<TIER>/<region>", where <region> is a region name. Similarly, for a zone
* override, add a map entry with key "<TIER>/{zone}".
* Further, a wildcard can be used at the end of a zone name in order to
* specify zone level overrides. For example:
* LOW: 10, STANDARD: 50, HIGH: 100,
* LOW/us-central1: 20, STANDARD/us-central1: 60, HIGH/us-central1: 200,
* LOW/us-central1-*: 10, STANDARD/us-central1-*: 20, HIGH/us-central1-*: 80
*
* The regional overrides tier set for each region must be the same as
* the tier set for default limit values. Same rule applies for zone overrides
* tier as well.
*
* Used by metric-based quotas only.
*
*
* map<string, int64> values = 10;
*/
@java.lang.Override
public long getValuesOrThrow(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
java.util.Map map =
internalGetValues().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public Builder clearValues() {
bitField0_ = (bitField0_ & ~0x00000100);
internalGetMutableValues().getMutableMap()
.clear();
return this;
}
/**
*
* Tiered limit values. Also allows for regional or zone overrides for these
* values if "/{region}" or "/{zone}" is specified in the unit field.
*
* Currently supported tiers from low to high:
* VERY_LOW, LOW, STANDARD, HIGH, VERY_HIGH
*
* To apply different limit values for users according to their tiers, specify
* the values for the tiers you want to differentiate. For example:
* {LOW:100, STANDARD:500, HIGH:1000, VERY_HIGH:5000}
*
* The limit value for each tier is optional except for the tier STANDARD.
* The limit value for an unspecified tier falls to the value of its next
* tier towards tier STANDARD. For the above example, the limit value for tier
* STANDARD is 500.
*
* To apply the same limit value for all users, just specify limit value for
* tier STANDARD. For example: {STANDARD:500}.
*
* To apply a regional overide for a tier, add a map entry with key
* "<TIER>/<region>", where <region> is a region name. Similarly, for a zone
* override, add a map entry with key "<TIER>/{zone}".
* Further, a wildcard can be used at the end of a zone name in order to
* specify zone level overrides. For example:
* LOW: 10, STANDARD: 50, HIGH: 100,
* LOW/us-central1: 20, STANDARD/us-central1: 60, HIGH/us-central1: 200,
* LOW/us-central1-*: 10, STANDARD/us-central1-*: 20, HIGH/us-central1-*: 80
*
* The regional overrides tier set for each region must be the same as
* the tier set for default limit values. Same rule applies for zone overrides
* tier as well.
*
* Used by metric-based quotas only.
*
*
* map<string, int64> values = 10;
*/
public Builder removeValues(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
internalGetMutableValues().getMutableMap()
.remove(key);
return this;
}
/**
* Use alternate mutation accessors instead.
*/
@java.lang.Deprecated
public java.util.Map
getMutableValues() {
bitField0_ |= 0x00000100;
return internalGetMutableValues().getMutableMap();
}
/**
*
* Tiered limit values. Also allows for regional or zone overrides for these
* values if "/{region}" or "/{zone}" is specified in the unit field.
*
* Currently supported tiers from low to high:
* VERY_LOW, LOW, STANDARD, HIGH, VERY_HIGH
*
* To apply different limit values for users according to their tiers, specify
* the values for the tiers you want to differentiate. For example:
* {LOW:100, STANDARD:500, HIGH:1000, VERY_HIGH:5000}
*
* The limit value for each tier is optional except for the tier STANDARD.
* The limit value for an unspecified tier falls to the value of its next
* tier towards tier STANDARD. For the above example, the limit value for tier
* STANDARD is 500.
*
* To apply the same limit value for all users, just specify limit value for
* tier STANDARD. For example: {STANDARD:500}.
*
* To apply a regional overide for a tier, add a map entry with key
* "<TIER>/<region>", where <region> is a region name. Similarly, for a zone
* override, add a map entry with key "<TIER>/{zone}".
* Further, a wildcard can be used at the end of a zone name in order to
* specify zone level overrides. For example:
* LOW: 10, STANDARD: 50, HIGH: 100,
* LOW/us-central1: 20, STANDARD/us-central1: 60, HIGH/us-central1: 200,
* LOW/us-central1-*: 10, STANDARD/us-central1-*: 20, HIGH/us-central1-*: 80
*
* The regional overrides tier set for each region must be the same as
* the tier set for default limit values. Same rule applies for zone overrides
* tier as well.
*
* Used by metric-based quotas only.
*
*
* map<string, int64> values = 10;
*/
public Builder putValues(
java.lang.String key,
long value) {
if (key == null) { throw new NullPointerException("map key"); }
internalGetMutableValues().getMutableMap()
.put(key, value);
bitField0_ |= 0x00000100;
return this;
}
/**
*
* Tiered limit values. Also allows for regional or zone overrides for these
* values if "/{region}" or "/{zone}" is specified in the unit field.
*
* Currently supported tiers from low to high:
* VERY_LOW, LOW, STANDARD, HIGH, VERY_HIGH
*
* To apply different limit values for users according to their tiers, specify
* the values for the tiers you want to differentiate. For example:
* {LOW:100, STANDARD:500, HIGH:1000, VERY_HIGH:5000}
*
* The limit value for each tier is optional except for the tier STANDARD.
* The limit value for an unspecified tier falls to the value of its next
* tier towards tier STANDARD. For the above example, the limit value for tier
* STANDARD is 500.
*
* To apply the same limit value for all users, just specify limit value for
* tier STANDARD. For example: {STANDARD:500}.
*
* To apply a regional overide for a tier, add a map entry with key
* "<TIER>/<region>", where <region> is a region name. Similarly, for a zone
* override, add a map entry with key "<TIER>/{zone}".
* Further, a wildcard can be used at the end of a zone name in order to
* specify zone level overrides. For example:
* LOW: 10, STANDARD: 50, HIGH: 100,
* LOW/us-central1: 20, STANDARD/us-central1: 60, HIGH/us-central1: 200,
* LOW/us-central1-*: 10, STANDARD/us-central1-*: 20, HIGH/us-central1-*: 80
*
* The regional overrides tier set for each region must be the same as
* the tier set for default limit values. Same rule applies for zone overrides
* tier as well.
*
* Used by metric-based quotas only.
*
* User-visible display name for this limit.
* Optional. If not set, the UI will provide a default display name based on
* the quota configuration. This field can be used to override the default
* display name generated from the configuration.
*
* User-visible display name for this limit.
* Optional. If not set, the UI will provide a default display name based on
* the quota configuration. This field can be used to override the default
* display name generated from the configuration.
*
*
* string display_name = 12;
* @return The bytes for displayName.
*/
public com.google.protobuf.ByteString
getDisplayNameBytes() {
java.lang.Object ref = displayName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
displayName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* User-visible display name for this limit.
* Optional. If not set, the UI will provide a default display name based on
* the quota configuration. This field can be used to override the default
* display name generated from the configuration.
*
*
* string display_name = 12;
* @param value The displayName to set.
* @return This builder for chaining.
*/
public Builder setDisplayName(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
displayName_ = value;
bitField0_ |= 0x00000200;
onChanged();
return this;
}
/**
*
* User-visible display name for this limit.
* Optional. If not set, the UI will provide a default display name based on
* the quota configuration. This field can be used to override the default
* display name generated from the configuration.
*
* User-visible display name for this limit.
* Optional. If not set, the UI will provide a default display name based on
* the quota configuration. This field can be used to override the default
* display name generated from the configuration.
*
*
* string display_name = 12;
* @param value The bytes for displayName to set.
* @return This builder for chaining.
*/
public Builder setDisplayNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
displayName_ = value;
bitField0_ |= 0x00000200;
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:google.api.QuotaLimit)
}
// @@protoc_insertion_point(class_scope:google.api.QuotaLimit)
private static final com.google.api.QuotaLimit DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.api.QuotaLimit();
}
public static com.google.api.QuotaLimit getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public QuotaLimit parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.api.QuotaLimit getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}