All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/api/serviceusage/v1beta1/resources.proto

// Protobuf Java Version: 3.25.5
package com.google.api.serviceusage.v1beta1;

/**
 *
 *
 * 
 * Quota policy created by service producer.
 * 
* * Protobuf type {@code google.api.serviceusage.v1beta1.ProducerQuotaPolicy} */ public final class ProducerQuotaPolicy extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.api.serviceusage.v1beta1.ProducerQuotaPolicy) ProducerQuotaPolicyOrBuilder { private static final long serialVersionUID = 0L; // Use ProducerQuotaPolicy.newBuilder() to construct. private ProducerQuotaPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private ProducerQuotaPolicy() { name_ = ""; metric_ = ""; unit_ = ""; container_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new ProducerQuotaPolicy(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.serviceusage.v1beta1.ResourcesProto .internal_static_google_api_serviceusage_v1beta1_ProducerQuotaPolicy_descriptor; } @SuppressWarnings({"rawtypes"}) @java.lang.Override protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( int number) { switch (number) { case 3: return internalGetDimensions(); default: throw new RuntimeException("Invalid map field number: " + number); } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.serviceusage.v1beta1.ResourcesProto .internal_static_google_api_serviceusage_v1beta1_ProducerQuotaPolicy_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy.class, com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy.Builder.class); } public static final int NAME_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object name_ = ""; /** * * *
   * The resource name of the policy.
   * This name is generated by the server when the policy is created.
   *
   * Example names would be:
   * `organizations/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerQuotaPolicies/4a3f2c1d`
   * 
* * string name = 1; * * @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; } } /** * * *
   * The resource name of the policy.
   * This name is generated by the server when the policy is created.
   *
   * Example names would be:
   * `organizations/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerQuotaPolicies/4a3f2c1d`
   * 
* * string name = 1; * * @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 POLICY_VALUE_FIELD_NUMBER = 2; private long policyValue_ = 0L; /** * * *
   * The quota policy value.
   * Can be any nonnegative integer, or -1 (unlimited quota).
   * 
* * int64 policy_value = 2; * * @return The policyValue. */ @java.lang.Override public long getPolicyValue() { return policyValue_; } public static final int DIMENSIONS_FIELD_NUMBER = 3; private static final class DimensionsDefaultEntryHolder { static final com.google.protobuf.MapEntry defaultEntry = com.google.protobuf.MapEntry.newDefaultInstance( com.google.api.serviceusage.v1beta1.ResourcesProto .internal_static_google_api_serviceusage_v1beta1_ProducerQuotaPolicy_DimensionsEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.STRING, ""); } @SuppressWarnings("serial") private com.google.protobuf.MapField dimensions_; private com.google.protobuf.MapField internalGetDimensions() { if (dimensions_ == null) { return com.google.protobuf.MapField.emptyMapField(DimensionsDefaultEntryHolder.defaultEntry); } return dimensions_; } public int getDimensionsCount() { return internalGetDimensions().getMap().size(); } /** * * *
   *
   * If this map is nonempty, then this policy applies only to specific values
   * for dimensions defined in the limit unit.
   *
   * For example, a policy on a limit with the unit `1/{project}/{region}`
   * could contain an entry with the key `region` and the value `us-east-1`;
   * the policy is only applied to quota consumed in that region.
   *
   * This map has the following restrictions:
   *
   * *   Keys that are not defined in the limit's unit are not valid keys.
   *     Any string appearing in {brackets} in the unit (besides {project} or
   *     {user}) is a defined key.
   * *   `project` is not a valid key; the project is already specified in
   *     the parent resource name.
   * *   `user` is not a valid key; the API does not support quota policies
   *     that apply only to a specific user.
   * *   If `region` appears as a key, its value must be a valid Cloud region.
   * *   If `zone` appears as a key, its value must be a valid Cloud zone.
   * *   If any valid key other than `region` or `zone` appears in the map, then
   *     all valid keys other than `region` or `zone` must also appear in the
   *     map.
   * 
* * map<string, string> dimensions = 3; */ @java.lang.Override public boolean containsDimensions(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } return internalGetDimensions().getMap().containsKey(key); } /** Use {@link #getDimensionsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getDimensions() { return getDimensionsMap(); } /** * * *
   *
   * If this map is nonempty, then this policy applies only to specific values
   * for dimensions defined in the limit unit.
   *
   * For example, a policy on a limit with the unit `1/{project}/{region}`
   * could contain an entry with the key `region` and the value `us-east-1`;
   * the policy is only applied to quota consumed in that region.
   *
   * This map has the following restrictions:
   *
   * *   Keys that are not defined in the limit's unit are not valid keys.
   *     Any string appearing in {brackets} in the unit (besides {project} or
   *     {user}) is a defined key.
   * *   `project` is not a valid key; the project is already specified in
   *     the parent resource name.
   * *   `user` is not a valid key; the API does not support quota policies
   *     that apply only to a specific user.
   * *   If `region` appears as a key, its value must be a valid Cloud region.
   * *   If `zone` appears as a key, its value must be a valid Cloud zone.
   * *   If any valid key other than `region` or `zone` appears in the map, then
   *     all valid keys other than `region` or `zone` must also appear in the
   *     map.
   * 
* * map<string, string> dimensions = 3; */ @java.lang.Override public java.util.Map getDimensionsMap() { return internalGetDimensions().getMap(); } /** * * *
   *
   * If this map is nonempty, then this policy applies only to specific values
   * for dimensions defined in the limit unit.
   *
   * For example, a policy on a limit with the unit `1/{project}/{region}`
   * could contain an entry with the key `region` and the value `us-east-1`;
   * the policy is only applied to quota consumed in that region.
   *
   * This map has the following restrictions:
   *
   * *   Keys that are not defined in the limit's unit are not valid keys.
   *     Any string appearing in {brackets} in the unit (besides {project} or
   *     {user}) is a defined key.
   * *   `project` is not a valid key; the project is already specified in
   *     the parent resource name.
   * *   `user` is not a valid key; the API does not support quota policies
   *     that apply only to a specific user.
   * *   If `region` appears as a key, its value must be a valid Cloud region.
   * *   If `zone` appears as a key, its value must be a valid Cloud zone.
   * *   If any valid key other than `region` or `zone` appears in the map, then
   *     all valid keys other than `region` or `zone` must also appear in the
   *     map.
   * 
* * map<string, string> dimensions = 3; */ @java.lang.Override public /* nullable */ java.lang.String getDimensionsOrDefault( java.lang.String key, /* nullable */ java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetDimensions().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * * *
   *
   * If this map is nonempty, then this policy applies only to specific values
   * for dimensions defined in the limit unit.
   *
   * For example, a policy on a limit with the unit `1/{project}/{region}`
   * could contain an entry with the key `region` and the value `us-east-1`;
   * the policy is only applied to quota consumed in that region.
   *
   * This map has the following restrictions:
   *
   * *   Keys that are not defined in the limit's unit are not valid keys.
   *     Any string appearing in {brackets} in the unit (besides {project} or
   *     {user}) is a defined key.
   * *   `project` is not a valid key; the project is already specified in
   *     the parent resource name.
   * *   `user` is not a valid key; the API does not support quota policies
   *     that apply only to a specific user.
   * *   If `region` appears as a key, its value must be a valid Cloud region.
   * *   If `zone` appears as a key, its value must be a valid Cloud zone.
   * *   If any valid key other than `region` or `zone` appears in the map, then
   *     all valid keys other than `region` or `zone` must also appear in the
   *     map.
   * 
* * map<string, string> dimensions = 3; */ @java.lang.Override public java.lang.String getDimensionsOrThrow(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetDimensions().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public static final int METRIC_FIELD_NUMBER = 4; @SuppressWarnings("serial") private volatile java.lang.Object metric_ = ""; /** * * *
   * The name of the metric to which this policy applies.
   *
   * An example name would be:
   * `compute.googleapis.com/cpus`
   * 
* * string metric = 4; * * @return The metric. */ @java.lang.Override public java.lang.String getMetric() { java.lang.Object ref = metric_; 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(); metric_ = s; return s; } } /** * * *
   * The name of the metric to which this policy applies.
   *
   * An example name would be:
   * `compute.googleapis.com/cpus`
   * 
* * string metric = 4; * * @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 = 5; @SuppressWarnings("serial") private volatile java.lang.Object unit_ = ""; /** * * *
   * The limit unit of the limit to which this policy applies.
   *
   * An example unit would be:
   * `1/{project}/{region}`
   * Note that `{project}` and `{region}` are not placeholders in this example;
   * the literal characters `{` and `}` occur in the string.
   * 
* * string unit = 5; * * @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; } } /** * * *
   * The limit unit of the limit to which this policy applies.
   *
   * An example unit would be:
   * `1/{project}/{region}`
   * Note that `{project}` and `{region}` are not placeholders in this example;
   * the literal characters `{` and `}` occur in the string.
   * 
* * string unit = 5; * * @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 CONTAINER_FIELD_NUMBER = 6; @SuppressWarnings("serial") private volatile java.lang.Object container_ = ""; /** * * *
   * The cloud resource container at which the quota policy is created. The
   * format is `{container_type}/{container_number}`
   * 
* * string container = 6; * * @return The container. */ @java.lang.Override public java.lang.String getContainer() { java.lang.Object ref = container_; 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(); container_ = s; return s; } } /** * * *
   * The cloud resource container at which the quota policy is created. The
   * format is `{container_type}/{container_number}`
   * 
* * string container = 6; * * @return The bytes for container. */ @java.lang.Override public com.google.protobuf.ByteString getContainerBytes() { java.lang.Object ref = container_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); container_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } if (policyValue_ != 0L) { output.writeInt64(2, policyValue_); } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( output, internalGetDimensions(), DimensionsDefaultEntryHolder.defaultEntry, 3); if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metric_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, metric_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, unit_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(container_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, container_); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } if (policyValue_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, policyValue_); } for (java.util.Map.Entry entry : internalGetDimensions().getMap().entrySet()) { com.google.protobuf.MapEntry dimensions__ = DimensionsDefaultEntryHolder.defaultEntry .newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, dimensions__); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metric_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, metric_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, unit_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(container_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, container_); } size += getUnknownFields().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.serviceusage.v1beta1.ProducerQuotaPolicy)) { return super.equals(obj); } com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy other = (com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy) obj; if (!getName().equals(other.getName())) return false; if (getPolicyValue() != other.getPolicyValue()) return false; if (!internalGetDimensions().equals(other.internalGetDimensions())) return false; if (!getMetric().equals(other.getMetric())) return false; if (!getUnit().equals(other.getUnit())) return false; if (!getContainer().equals(other.getContainer())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + POLICY_VALUE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPolicyValue()); if (!internalGetDimensions().getMap().isEmpty()) { hash = (37 * hash) + DIMENSIONS_FIELD_NUMBER; hash = (53 * hash) + internalGetDimensions().hashCode(); } hash = (37 * hash) + METRIC_FIELD_NUMBER; hash = (53 * hash) + getMetric().hashCode(); hash = (37 * hash) + UNIT_FIELD_NUMBER; hash = (53 * hash) + getUnit().hashCode(); hash = (37 * hash) + CONTAINER_FIELD_NUMBER; hash = (53 * hash) + getContainer().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy 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.serviceusage.v1beta1.ProducerQuotaPolicy parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy 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.serviceusage.v1beta1.ProducerQuotaPolicy parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy 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.serviceusage.v1beta1.ProducerQuotaPolicy parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy 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.serviceusage.v1beta1.ProducerQuotaPolicy parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy 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( com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy 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; } /** * * *
   * Quota policy created by service producer.
   * 
* * Protobuf type {@code google.api.serviceusage.v1beta1.ProducerQuotaPolicy} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.api.serviceusage.v1beta1.ProducerQuotaPolicy) com.google.api.serviceusage.v1beta1.ProducerQuotaPolicyOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.serviceusage.v1beta1.ResourcesProto .internal_static_google_api_serviceusage_v1beta1_ProducerQuotaPolicy_descriptor; } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( int number) { switch (number) { case 3: return internalGetDimensions(); default: throw new RuntimeException("Invalid map field number: " + number); } } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( int number) { switch (number) { case 3: return internalGetMutableDimensions(); default: throw new RuntimeException("Invalid map field number: " + number); } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.serviceusage.v1beta1.ResourcesProto .internal_static_google_api_serviceusage_v1beta1_ProducerQuotaPolicy_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy.class, com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy.Builder.class); } // Construct using com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; name_ = ""; policyValue_ = 0L; internalGetMutableDimensions().clear(); metric_ = ""; unit_ = ""; container_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.api.serviceusage.v1beta1.ResourcesProto .internal_static_google_api_serviceusage_v1beta1_ProducerQuotaPolicy_descriptor; } @java.lang.Override public com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy getDefaultInstanceForType() { return com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy.getDefaultInstance(); } @java.lang.Override public com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy build() { com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy buildPartial() { com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy result = new com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0(com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.name_ = name_; } if (((from_bitField0_ & 0x00000002) != 0)) { result.policyValue_ = policyValue_; } if (((from_bitField0_ & 0x00000004) != 0)) { result.dimensions_ = internalGetDimensions(); result.dimensions_.makeImmutable(); } if (((from_bitField0_ & 0x00000008) != 0)) { result.metric_ = metric_; } if (((from_bitField0_ & 0x00000010) != 0)) { result.unit_ = unit_; } if (((from_bitField0_ & 0x00000020) != 0)) { result.container_ = container_; } } @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.serviceusage.v1beta1.ProducerQuotaPolicy) { return mergeFrom((com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy other) { if (other == com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; bitField0_ |= 0x00000001; onChanged(); } if (other.getPolicyValue() != 0L) { setPolicyValue(other.getPolicyValue()); } internalGetMutableDimensions().mergeFrom(other.internalGetDimensions()); bitField0_ |= 0x00000004; if (!other.getMetric().isEmpty()) { metric_ = other.metric_; bitField0_ |= 0x00000008; onChanged(); } if (!other.getUnit().isEmpty()) { unit_ = other.unit_; bitField0_ |= 0x00000010; onChanged(); } if (!other.getContainer().isEmpty()) { container_ = other.container_; bitField0_ |= 0x00000020; 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 10: { name_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 10 case 16: { policyValue_ = input.readInt64(); bitField0_ |= 0x00000002; break; } // case 16 case 26: { com.google.protobuf.MapEntry dimensions__ = input.readMessage( DimensionsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); internalGetMutableDimensions() .getMutableMap() .put(dimensions__.getKey(), dimensions__.getValue()); bitField0_ |= 0x00000004; break; } // case 26 case 34: { metric_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000008; break; } // case 34 case 42: { unit_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000010; break; } // case 42 case 50: { container_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000020; break; } // case 50 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_ = ""; /** * * *
     * The resource name of the policy.
     * This name is generated by the server when the policy is created.
     *
     * Example names would be:
     * `organizations/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerQuotaPolicies/4a3f2c1d`
     * 
* * string name = 1; * * @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; } } /** * * *
     * The resource name of the policy.
     * This name is generated by the server when the policy is created.
     *
     * Example names would be:
     * `organizations/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerQuotaPolicies/4a3f2c1d`
     * 
* * string name = 1; * * @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; } } /** * * *
     * The resource name of the policy.
     * This name is generated by the server when the policy is created.
     *
     * Example names would be:
     * `organizations/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerQuotaPolicies/4a3f2c1d`
     * 
* * string name = 1; * * @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; } /** * * *
     * The resource name of the policy.
     * This name is generated by the server when the policy is created.
     *
     * Example names would be:
     * `organizations/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerQuotaPolicies/4a3f2c1d`
     * 
* * string name = 1; * * @return This builder for chaining. */ public Builder clearName() { name_ = getDefaultInstance().getName(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * * *
     * The resource name of the policy.
     * This name is generated by the server when the policy is created.
     *
     * Example names would be:
     * `organizations/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerQuotaPolicies/4a3f2c1d`
     * 
* * string name = 1; * * @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 long policyValue_; /** * * *
     * The quota policy value.
     * Can be any nonnegative integer, or -1 (unlimited quota).
     * 
* * int64 policy_value = 2; * * @return The policyValue. */ @java.lang.Override public long getPolicyValue() { return policyValue_; } /** * * *
     * The quota policy value.
     * Can be any nonnegative integer, or -1 (unlimited quota).
     * 
* * int64 policy_value = 2; * * @param value The policyValue to set. * @return This builder for chaining. */ public Builder setPolicyValue(long value) { policyValue_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
     * The quota policy value.
     * Can be any nonnegative integer, or -1 (unlimited quota).
     * 
* * int64 policy_value = 2; * * @return This builder for chaining. */ public Builder clearPolicyValue() { bitField0_ = (bitField0_ & ~0x00000002); policyValue_ = 0L; onChanged(); return this; } private com.google.protobuf.MapField dimensions_; private com.google.protobuf.MapField internalGetDimensions() { if (dimensions_ == null) { return com.google.protobuf.MapField.emptyMapField( DimensionsDefaultEntryHolder.defaultEntry); } return dimensions_; } private com.google.protobuf.MapField internalGetMutableDimensions() { if (dimensions_ == null) { dimensions_ = com.google.protobuf.MapField.newMapField(DimensionsDefaultEntryHolder.defaultEntry); } if (!dimensions_.isMutable()) { dimensions_ = dimensions_.copy(); } bitField0_ |= 0x00000004; onChanged(); return dimensions_; } public int getDimensionsCount() { return internalGetDimensions().getMap().size(); } /** * * *
     *
     * If this map is nonempty, then this policy applies only to specific values
     * for dimensions defined in the limit unit.
     *
     * For example, a policy on a limit with the unit `1/{project}/{region}`
     * could contain an entry with the key `region` and the value `us-east-1`;
     * the policy is only applied to quota consumed in that region.
     *
     * This map has the following restrictions:
     *
     * *   Keys that are not defined in the limit's unit are not valid keys.
     *     Any string appearing in {brackets} in the unit (besides {project} or
     *     {user}) is a defined key.
     * *   `project` is not a valid key; the project is already specified in
     *     the parent resource name.
     * *   `user` is not a valid key; the API does not support quota policies
     *     that apply only to a specific user.
     * *   If `region` appears as a key, its value must be a valid Cloud region.
     * *   If `zone` appears as a key, its value must be a valid Cloud zone.
     * *   If any valid key other than `region` or `zone` appears in the map, then
     *     all valid keys other than `region` or `zone` must also appear in the
     *     map.
     * 
* * map<string, string> dimensions = 3; */ @java.lang.Override public boolean containsDimensions(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } return internalGetDimensions().getMap().containsKey(key); } /** Use {@link #getDimensionsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getDimensions() { return getDimensionsMap(); } /** * * *
     *
     * If this map is nonempty, then this policy applies only to specific values
     * for dimensions defined in the limit unit.
     *
     * For example, a policy on a limit with the unit `1/{project}/{region}`
     * could contain an entry with the key `region` and the value `us-east-1`;
     * the policy is only applied to quota consumed in that region.
     *
     * This map has the following restrictions:
     *
     * *   Keys that are not defined in the limit's unit are not valid keys.
     *     Any string appearing in {brackets} in the unit (besides {project} or
     *     {user}) is a defined key.
     * *   `project` is not a valid key; the project is already specified in
     *     the parent resource name.
     * *   `user` is not a valid key; the API does not support quota policies
     *     that apply only to a specific user.
     * *   If `region` appears as a key, its value must be a valid Cloud region.
     * *   If `zone` appears as a key, its value must be a valid Cloud zone.
     * *   If any valid key other than `region` or `zone` appears in the map, then
     *     all valid keys other than `region` or `zone` must also appear in the
     *     map.
     * 
* * map<string, string> dimensions = 3; */ @java.lang.Override public java.util.Map getDimensionsMap() { return internalGetDimensions().getMap(); } /** * * *
     *
     * If this map is nonempty, then this policy applies only to specific values
     * for dimensions defined in the limit unit.
     *
     * For example, a policy on a limit with the unit `1/{project}/{region}`
     * could contain an entry with the key `region` and the value `us-east-1`;
     * the policy is only applied to quota consumed in that region.
     *
     * This map has the following restrictions:
     *
     * *   Keys that are not defined in the limit's unit are not valid keys.
     *     Any string appearing in {brackets} in the unit (besides {project} or
     *     {user}) is a defined key.
     * *   `project` is not a valid key; the project is already specified in
     *     the parent resource name.
     * *   `user` is not a valid key; the API does not support quota policies
     *     that apply only to a specific user.
     * *   If `region` appears as a key, its value must be a valid Cloud region.
     * *   If `zone` appears as a key, its value must be a valid Cloud zone.
     * *   If any valid key other than `region` or `zone` appears in the map, then
     *     all valid keys other than `region` or `zone` must also appear in the
     *     map.
     * 
* * map<string, string> dimensions = 3; */ @java.lang.Override public /* nullable */ java.lang.String getDimensionsOrDefault( java.lang.String key, /* nullable */ java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetDimensions().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * * *
     *
     * If this map is nonempty, then this policy applies only to specific values
     * for dimensions defined in the limit unit.
     *
     * For example, a policy on a limit with the unit `1/{project}/{region}`
     * could contain an entry with the key `region` and the value `us-east-1`;
     * the policy is only applied to quota consumed in that region.
     *
     * This map has the following restrictions:
     *
     * *   Keys that are not defined in the limit's unit are not valid keys.
     *     Any string appearing in {brackets} in the unit (besides {project} or
     *     {user}) is a defined key.
     * *   `project` is not a valid key; the project is already specified in
     *     the parent resource name.
     * *   `user` is not a valid key; the API does not support quota policies
     *     that apply only to a specific user.
     * *   If `region` appears as a key, its value must be a valid Cloud region.
     * *   If `zone` appears as a key, its value must be a valid Cloud zone.
     * *   If any valid key other than `region` or `zone` appears in the map, then
     *     all valid keys other than `region` or `zone` must also appear in the
     *     map.
     * 
* * map<string, string> dimensions = 3; */ @java.lang.Override public java.lang.String getDimensionsOrThrow(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetDimensions().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearDimensions() { bitField0_ = (bitField0_ & ~0x00000004); internalGetMutableDimensions().getMutableMap().clear(); return this; } /** * * *
     *
     * If this map is nonempty, then this policy applies only to specific values
     * for dimensions defined in the limit unit.
     *
     * For example, a policy on a limit with the unit `1/{project}/{region}`
     * could contain an entry with the key `region` and the value `us-east-1`;
     * the policy is only applied to quota consumed in that region.
     *
     * This map has the following restrictions:
     *
     * *   Keys that are not defined in the limit's unit are not valid keys.
     *     Any string appearing in {brackets} in the unit (besides {project} or
     *     {user}) is a defined key.
     * *   `project` is not a valid key; the project is already specified in
     *     the parent resource name.
     * *   `user` is not a valid key; the API does not support quota policies
     *     that apply only to a specific user.
     * *   If `region` appears as a key, its value must be a valid Cloud region.
     * *   If `zone` appears as a key, its value must be a valid Cloud zone.
     * *   If any valid key other than `region` or `zone` appears in the map, then
     *     all valid keys other than `region` or `zone` must also appear in the
     *     map.
     * 
* * map<string, string> dimensions = 3; */ public Builder removeDimensions(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } internalGetMutableDimensions().getMutableMap().remove(key); return this; } /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableDimensions() { bitField0_ |= 0x00000004; return internalGetMutableDimensions().getMutableMap(); } /** * * *
     *
     * If this map is nonempty, then this policy applies only to specific values
     * for dimensions defined in the limit unit.
     *
     * For example, a policy on a limit with the unit `1/{project}/{region}`
     * could contain an entry with the key `region` and the value `us-east-1`;
     * the policy is only applied to quota consumed in that region.
     *
     * This map has the following restrictions:
     *
     * *   Keys that are not defined in the limit's unit are not valid keys.
     *     Any string appearing in {brackets} in the unit (besides {project} or
     *     {user}) is a defined key.
     * *   `project` is not a valid key; the project is already specified in
     *     the parent resource name.
     * *   `user` is not a valid key; the API does not support quota policies
     *     that apply only to a specific user.
     * *   If `region` appears as a key, its value must be a valid Cloud region.
     * *   If `zone` appears as a key, its value must be a valid Cloud zone.
     * *   If any valid key other than `region` or `zone` appears in the map, then
     *     all valid keys other than `region` or `zone` must also appear in the
     *     map.
     * 
* * map<string, string> dimensions = 3; */ public Builder putDimensions(java.lang.String key, java.lang.String value) { if (key == null) { throw new NullPointerException("map key"); } if (value == null) { throw new NullPointerException("map value"); } internalGetMutableDimensions().getMutableMap().put(key, value); bitField0_ |= 0x00000004; return this; } /** * * *
     *
     * If this map is nonempty, then this policy applies only to specific values
     * for dimensions defined in the limit unit.
     *
     * For example, a policy on a limit with the unit `1/{project}/{region}`
     * could contain an entry with the key `region` and the value `us-east-1`;
     * the policy is only applied to quota consumed in that region.
     *
     * This map has the following restrictions:
     *
     * *   Keys that are not defined in the limit's unit are not valid keys.
     *     Any string appearing in {brackets} in the unit (besides {project} or
     *     {user}) is a defined key.
     * *   `project` is not a valid key; the project is already specified in
     *     the parent resource name.
     * *   `user` is not a valid key; the API does not support quota policies
     *     that apply only to a specific user.
     * *   If `region` appears as a key, its value must be a valid Cloud region.
     * *   If `zone` appears as a key, its value must be a valid Cloud zone.
     * *   If any valid key other than `region` or `zone` appears in the map, then
     *     all valid keys other than `region` or `zone` must also appear in the
     *     map.
     * 
* * map<string, string> dimensions = 3; */ public Builder putAllDimensions(java.util.Map values) { internalGetMutableDimensions().getMutableMap().putAll(values); bitField0_ |= 0x00000004; return this; } private java.lang.Object metric_ = ""; /** * * *
     * The name of the metric to which this policy applies.
     *
     * An example name would be:
     * `compute.googleapis.com/cpus`
     * 
* * string metric = 4; * * @return The metric. */ public java.lang.String getMetric() { java.lang.Object ref = metric_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); metric_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * The name of the metric to which this policy applies.
     *
     * An example name would be:
     * `compute.googleapis.com/cpus`
     * 
* * string metric = 4; * * @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 to which this policy applies.
     *
     * An example name would be:
     * `compute.googleapis.com/cpus`
     * 
* * string metric = 4; * * @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_ |= 0x00000008; onChanged(); return this; } /** * * *
     * The name of the metric to which this policy applies.
     *
     * An example name would be:
     * `compute.googleapis.com/cpus`
     * 
* * string metric = 4; * * @return This builder for chaining. */ public Builder clearMetric() { metric_ = getDefaultInstance().getMetric(); bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } /** * * *
     * The name of the metric to which this policy applies.
     *
     * An example name would be:
     * `compute.googleapis.com/cpus`
     * 
* * string metric = 4; * * @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_ |= 0x00000008; onChanged(); return this; } private java.lang.Object unit_ = ""; /** * * *
     * The limit unit of the limit to which this policy applies.
     *
     * An example unit would be:
     * `1/{project}/{region}`
     * Note that `{project}` and `{region}` are not placeholders in this example;
     * the literal characters `{` and `}` occur in the string.
     * 
* * string unit = 5; * * @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; } } /** * * *
     * The limit unit of the limit to which this policy applies.
     *
     * An example unit would be:
     * `1/{project}/{region}`
     * Note that `{project}` and `{region}` are not placeholders in this example;
     * the literal characters `{` and `}` occur in the string.
     * 
* * string unit = 5; * * @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; } } /** * * *
     * The limit unit of the limit to which this policy applies.
     *
     * An example unit would be:
     * `1/{project}/{region}`
     * Note that `{project}` and `{region}` are not placeholders in this example;
     * the literal characters `{` and `}` occur in the string.
     * 
* * string unit = 5; * * @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_ |= 0x00000010; onChanged(); return this; } /** * * *
     * The limit unit of the limit to which this policy applies.
     *
     * An example unit would be:
     * `1/{project}/{region}`
     * Note that `{project}` and `{region}` are not placeholders in this example;
     * the literal characters `{` and `}` occur in the string.
     * 
* * string unit = 5; * * @return This builder for chaining. */ public Builder clearUnit() { unit_ = getDefaultInstance().getUnit(); bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } /** * * *
     * The limit unit of the limit to which this policy applies.
     *
     * An example unit would be:
     * `1/{project}/{region}`
     * Note that `{project}` and `{region}` are not placeholders in this example;
     * the literal characters `{` and `}` occur in the string.
     * 
* * string unit = 5; * * @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_ |= 0x00000010; onChanged(); return this; } private java.lang.Object container_ = ""; /** * * *
     * The cloud resource container at which the quota policy is created. The
     * format is `{container_type}/{container_number}`
     * 
* * string container = 6; * * @return The container. */ public java.lang.String getContainer() { java.lang.Object ref = container_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); container_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * The cloud resource container at which the quota policy is created. The
     * format is `{container_type}/{container_number}`
     * 
* * string container = 6; * * @return The bytes for container. */ public com.google.protobuf.ByteString getContainerBytes() { java.lang.Object ref = container_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); container_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * The cloud resource container at which the quota policy is created. The
     * format is `{container_type}/{container_number}`
     * 
* * string container = 6; * * @param value The container to set. * @return This builder for chaining. */ public Builder setContainer(java.lang.String value) { if (value == null) { throw new NullPointerException(); } container_ = value; bitField0_ |= 0x00000020; onChanged(); return this; } /** * * *
     * The cloud resource container at which the quota policy is created. The
     * format is `{container_type}/{container_number}`
     * 
* * string container = 6; * * @return This builder for chaining. */ public Builder clearContainer() { container_ = getDefaultInstance().getContainer(); bitField0_ = (bitField0_ & ~0x00000020); onChanged(); return this; } /** * * *
     * The cloud resource container at which the quota policy is created. The
     * format is `{container_type}/{container_number}`
     * 
* * string container = 6; * * @param value The bytes for container to set. * @return This builder for chaining. */ public Builder setContainerBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); container_ = value; bitField0_ |= 0x00000020; 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.serviceusage.v1beta1.ProducerQuotaPolicy) } // @@protoc_insertion_point(class_scope:google.api.serviceusage.v1beta1.ProducerQuotaPolicy) private static final com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy(); } public static com.google.api.serviceusage.v1beta1.ProducerQuotaPolicy getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public ProducerQuotaPolicy 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.serviceusage.v1beta1.ProducerQuotaPolicy getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy