diff --git a/generation_config.yaml b/generation_config.yaml index 4146aa220b..286704f8a8 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,4 +1,4 @@ -googleapis_commitish: 66ab6ceb69178f5368b130949eaf518b7c28352f +googleapis_commitish: 2c9122112925d2184fa8179821b6422893a153e8 # the libraries are ordered with respect to library name, which is # java-{library.library_name} or java-{library.api-shortname} when # library.library_name is not defined. diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ErrorDetailsProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ErrorDetailsProto.java index fd66427205..f7624c855f 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ErrorDetailsProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ErrorDetailsProto.java @@ -52,6 +52,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_rpc_QuotaFailure_Violation_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_rpc_QuotaFailure_Violation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_rpc_QuotaFailure_Violation_QuotaDimensionsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_rpc_QuotaFailure_Violation_QuotaDimensionsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_rpc_PreconditionFailure_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -111,12 +115,23 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\013retry_delay\030\001 \001(\0132\031.google.protobuf.Duration\"2\n" + "\tDebugInfo\022\025\n\r" + "stack_entries\030\001 \003(\t\022\016\n" - + "\006detail\030\002 \001(\t\"y\n" + + "\006detail\030\002 \001(\t\"\217\003\n" + "\014QuotaFailure\0226\n\n" - + "violations\030\001 \003(\0132\".google.rpc.QuotaFailure.Violation\0321\n" + + "violations\030\001 \003(\0132\".google.rpc.QuotaFailure.Violation\032\306\002\n" + "\tViolation\022\017\n" + "\007subject\030\001 \001(\t\022\023\n" - + "\013description\030\002 \001(\t\"\225\001\n" + + "\013description\030\002 \001(\t\022\023\n" + + "\013api_service\030\003 \001(\t\022\024\n" + + "\014quota_metric\030\004 \001(\t\022\020\n" + + "\010quota_id\030\005 \001(\t\022Q\n" + + "\020quota_dimensions\030\006 \003(\01327.google" + + ".rpc.QuotaFailure.Violation.QuotaDimensionsEntry\022\023\n" + + "\013quota_value\030\007 \001(\003\022\037\n" + + "\022future_quota_value\030\010 \001(\003H\000\210\001\001\0326\n" + + "\024QuotaDimensionsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001B\025\n" + + "\023_future_quota_value\"\225\001\n" + "\023PreconditionFailure\022=\n\n" + "violations\030\001 \003(\0132).google.rpc.PreconditionFailure.Violation\032?\n" + "\tViolation\022\014\n" @@ -134,8 +149,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "request_id\030\001 \001(\t\022\024\n" + "\014serving_data\030\002 \001(\t\"`\n" + "\014ResourceInfo\022\025\n\r" - + "resource_type\030\001 \001(\t\022\025\n" - + "\r" + + "resource_type\030\001 \001(\t\022\025\n\r" + "resource_name\030\002 \001(\t\022\r\n" + "\005owner\030\003 \001(\t\022\023\n" + "\013description\030\004 \001(\t\"V\n" @@ -147,9 +161,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\020LocalizedMessage\022\016\n" + "\006locale\030\001 \001(\t\022\017\n" + "\007message\030\002 \001(\tBl\n" - + "\016com.google.rpcB\021ErrorDetailsProtoP\001Z?go" - + "ogle.golang.org/genproto/googleapis/rpc/" - + "errdetails;errdetails\242\002\003RPCb\006proto3" + + "\016com.google.rpcB\021ErrorDetailsProtoP\001Z?goo" + + "gle.golang.org/genproto/googleapis/rpc/errdetails;errdetails\242\002\003RPCb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -199,7 +212,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_rpc_QuotaFailure_Violation_descriptor, new java.lang.String[] { - "Subject", "Description", + "Subject", + "Description", + "ApiService", + "QuotaMetric", + "QuotaId", + "QuotaDimensions", + "QuotaValue", + "FutureQuotaValue", + }); + internal_static_google_rpc_QuotaFailure_Violation_QuotaDimensionsEntry_descriptor = + internal_static_google_rpc_QuotaFailure_Violation_descriptor.getNestedTypes().get(0); + internal_static_google_rpc_QuotaFailure_Violation_QuotaDimensionsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_rpc_QuotaFailure_Violation_QuotaDimensionsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", }); internal_static_google_rpc_PreconditionFailure_descriptor = getDescriptor().getMessageTypes().get(4); diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/QuotaFailure.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/QuotaFailure.java index c13a45b90c..0e7b4b4104 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/QuotaFailure.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/QuotaFailure.java @@ -144,6 +144,321 @@ public interface ViolationOrBuilder * @return The bytes for description. */ com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+     * The API Service from which the `QuotaFailure.Violation` orginates. In
+     * some cases, Quota issues originate from an API Service other than the one
+     * that was called. In other words, a dependency of the called API Service
+     * could be the cause of the `QuotaFailure`, and this field would have the
+     * dependency API service name.
+     *
+     * For example, if the called API is Kubernetes Engine API
+     * (container.googleapis.com), and a quota violation occurs in the
+     * Kubernetes Engine API itself, this field would be
+     * "container.googleapis.com". On the other hand, if the quota violation
+     * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
+     * API (compute.googleapis.com), this field would be
+     * "compute.googleapis.com".
+     * 
+ * + * string api_service = 3; + * + * @return The apiService. + */ + java.lang.String getApiService(); + + /** + * + * + *
+     * The API Service from which the `QuotaFailure.Violation` orginates. In
+     * some cases, Quota issues originate from an API Service other than the one
+     * that was called. In other words, a dependency of the called API Service
+     * could be the cause of the `QuotaFailure`, and this field would have the
+     * dependency API service name.
+     *
+     * For example, if the called API is Kubernetes Engine API
+     * (container.googleapis.com), and a quota violation occurs in the
+     * Kubernetes Engine API itself, this field would be
+     * "container.googleapis.com". On the other hand, if the quota violation
+     * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
+     * API (compute.googleapis.com), this field would be
+     * "compute.googleapis.com".
+     * 
+ * + * string api_service = 3; + * + * @return The bytes for apiService. + */ + com.google.protobuf.ByteString getApiServiceBytes(); + + /** + * + * + *
+     * The metric of the violated quota. A quota metric is a named counter to
+     * measure usage, such as API requests or CPUs. When an activity occurs in a
+     * service, such as Virtual Machine allocation, one or more quota metrics
+     * may be affected.
+     *
+     * For example, "compute.googleapis.com/cpus_per_vm_family",
+     * "storage.googleapis.com/internet_egress_bandwidth".
+     * 
+ * + * string quota_metric = 4; + * + * @return The quotaMetric. + */ + java.lang.String getQuotaMetric(); + + /** + * + * + *
+     * The metric of the violated quota. A quota metric is a named counter to
+     * measure usage, such as API requests or CPUs. When an activity occurs in a
+     * service, such as Virtual Machine allocation, one or more quota metrics
+     * may be affected.
+     *
+     * For example, "compute.googleapis.com/cpus_per_vm_family",
+     * "storage.googleapis.com/internet_egress_bandwidth".
+     * 
+ * + * string quota_metric = 4; + * + * @return The bytes for quotaMetric. + */ + com.google.protobuf.ByteString getQuotaMetricBytes(); + + /** + * + * + *
+     * The id of the violated quota. Also know as "limit name", this is the
+     * unique identifier of a quota in the context of an API service.
+     *
+     * For example, "CPUS-PER-VM-FAMILY-per-project-region".
+     * 
+ * + * string quota_id = 5; + * + * @return The quotaId. + */ + java.lang.String getQuotaId(); + + /** + * + * + *
+     * The id of the violated quota. Also know as "limit name", this is the
+     * unique identifier of a quota in the context of an API service.
+     *
+     * For example, "CPUS-PER-VM-FAMILY-per-project-region".
+     * 
+ * + * string quota_id = 5; + * + * @return The bytes for quotaId. + */ + com.google.protobuf.ByteString getQuotaIdBytes(); + + /** + * + * + *
+     * The dimensions of the violated quota. Every non-global quota is enforced
+     * on a set of dimensions. While quota metric defines what to count, the
+     * dimensions specify for what aspects the counter should be increased.
+     *
+     * For example, the quota "CPUs per region per VM family" enforces a limit
+     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
+     * "region" and "vm_family". And if the violation occurred in region
+     * "us-central1" and for VM family "n1", the quota_dimensions would be,
+     *
+     * {
+     *   "region": "us-central1",
+     *   "vm_family": "n1",
+     * }
+     *
+     * When a quota is enforced globally, the quota_dimensions would always be
+     * empty.
+     * 
+ * + * map<string, string> quota_dimensions = 6; + */ + int getQuotaDimensionsCount(); + + /** + * + * + *
+     * The dimensions of the violated quota. Every non-global quota is enforced
+     * on a set of dimensions. While quota metric defines what to count, the
+     * dimensions specify for what aspects the counter should be increased.
+     *
+     * For example, the quota "CPUs per region per VM family" enforces a limit
+     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
+     * "region" and "vm_family". And if the violation occurred in region
+     * "us-central1" and for VM family "n1", the quota_dimensions would be,
+     *
+     * {
+     *   "region": "us-central1",
+     *   "vm_family": "n1",
+     * }
+     *
+     * When a quota is enforced globally, the quota_dimensions would always be
+     * empty.
+     * 
+ * + * map<string, string> quota_dimensions = 6; + */ + boolean containsQuotaDimensions(java.lang.String key); + + /** Use {@link #getQuotaDimensionsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getQuotaDimensions(); + + /** + * + * + *
+     * The dimensions of the violated quota. Every non-global quota is enforced
+     * on a set of dimensions. While quota metric defines what to count, the
+     * dimensions specify for what aspects the counter should be increased.
+     *
+     * For example, the quota "CPUs per region per VM family" enforces a limit
+     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
+     * "region" and "vm_family". And if the violation occurred in region
+     * "us-central1" and for VM family "n1", the quota_dimensions would be,
+     *
+     * {
+     *   "region": "us-central1",
+     *   "vm_family": "n1",
+     * }
+     *
+     * When a quota is enforced globally, the quota_dimensions would always be
+     * empty.
+     * 
+ * + * map<string, string> quota_dimensions = 6; + */ + java.util.Map getQuotaDimensionsMap(); + + /** + * + * + *
+     * The dimensions of the violated quota. Every non-global quota is enforced
+     * on a set of dimensions. While quota metric defines what to count, the
+     * dimensions specify for what aspects the counter should be increased.
+     *
+     * For example, the quota "CPUs per region per VM family" enforces a limit
+     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
+     * "region" and "vm_family". And if the violation occurred in region
+     * "us-central1" and for VM family "n1", the quota_dimensions would be,
+     *
+     * {
+     *   "region": "us-central1",
+     *   "vm_family": "n1",
+     * }
+     *
+     * When a quota is enforced globally, the quota_dimensions would always be
+     * empty.
+     * 
+ * + * map<string, string> quota_dimensions = 6; + */ + /* nullable */ + java.lang.String getQuotaDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+     * The dimensions of the violated quota. Every non-global quota is enforced
+     * on a set of dimensions. While quota metric defines what to count, the
+     * dimensions specify for what aspects the counter should be increased.
+     *
+     * For example, the quota "CPUs per region per VM family" enforces a limit
+     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
+     * "region" and "vm_family". And if the violation occurred in region
+     * "us-central1" and for VM family "n1", the quota_dimensions would be,
+     *
+     * {
+     *   "region": "us-central1",
+     *   "vm_family": "n1",
+     * }
+     *
+     * When a quota is enforced globally, the quota_dimensions would always be
+     * empty.
+     * 
+ * + * map<string, string> quota_dimensions = 6; + */ + java.lang.String getQuotaDimensionsOrThrow(java.lang.String key); + + /** + * + * + *
+     * The enforced quota value at the time of the `QuotaFailure`.
+     *
+     * For example, if the enforced quota value at the time of the
+     * `QuotaFailure` on the number of CPUs is "10", then the value of this
+     * field would reflect this quantity.
+     * 
+ * + * int64 quota_value = 7; + * + * @return The quotaValue. + */ + long getQuotaValue(); + + /** + * + * + *
+     * The new quota value being rolled out at the time of the violation. At the
+     * completion of the rollout, this value will be enforced in place of
+     * quota_value. If no rollout is in progress at the time of the violation,
+     * this field is not set.
+     *
+     * For example, if at the time of the violation a rollout is in progress
+     * changing the number of CPUs quota from 10 to 20, 20 would be the value of
+     * this field.
+     * 
+ * + * optional int64 future_quota_value = 8; + * + * @return Whether the futureQuotaValue field is set. + */ + boolean hasFutureQuotaValue(); + + /** + * + * + *
+     * The new quota value being rolled out at the time of the violation. At the
+     * completion of the rollout, this value will be enforced in place of
+     * quota_value. If no rollout is in progress at the time of the violation,
+     * this field is not set.
+     *
+     * For example, if at the time of the violation a rollout is in progress
+     * changing the number of CPUs quota from 10 to 20, 20 would be the value of
+     * this field.
+     * 
+ * + * optional int64 future_quota_value = 8; + * + * @return The futureQuotaValue. + */ + long getFutureQuotaValue(); } /** @@ -170,6 +485,9 @@ private Violation(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Violation() { subject_ = ""; description_ = ""; + apiService_ = ""; + quotaMetric_ = ""; + quotaId_ = ""; } @java.lang.Override @@ -183,6 +501,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .internal_static_google_rpc_QuotaFailure_Violation_descriptor; } + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetQuotaDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -193,6 +523,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.rpc.QuotaFailure.Violation.Builder.class); } + private int bitField0_; public static final int SUBJECT_FIELD_NUMBER = 1; @SuppressWarnings("serial") @@ -315,87 +646,596 @@ public com.google.protobuf.ByteString getDescriptionBytes() { } } - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + public static final int API_SERVICE_FIELD_NUMBER = 3; - memoizedIsInitialized = 1; - return true; - } + @SuppressWarnings("serial") + private volatile java.lang.Object apiService_ = ""; + /** + * + * + *
+     * The API Service from which the `QuotaFailure.Violation` orginates. In
+     * some cases, Quota issues originate from an API Service other than the one
+     * that was called. In other words, a dependency of the called API Service
+     * could be the cause of the `QuotaFailure`, and this field would have the
+     * dependency API service name.
+     *
+     * For example, if the called API is Kubernetes Engine API
+     * (container.googleapis.com), and a quota violation occurs in the
+     * Kubernetes Engine API itself, this field would be
+     * "container.googleapis.com". On the other hand, if the quota violation
+     * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
+     * API (compute.googleapis.com), this field would be
+     * "compute.googleapis.com".
+     * 
+ * + * string api_service = 3; + * + * @return The apiService. + */ @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subject_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subject_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + public java.lang.String getApiService() { + java.lang.Object ref = apiService_; + 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(); + apiService_ = s; + return s; } - getUnknownFields().writeTo(output); } + /** + * + * + *
+     * The API Service from which the `QuotaFailure.Violation` orginates. In
+     * some cases, Quota issues originate from an API Service other than the one
+     * that was called. In other words, a dependency of the called API Service
+     * could be the cause of the `QuotaFailure`, and this field would have the
+     * dependency API service name.
+     *
+     * For example, if the called API is Kubernetes Engine API
+     * (container.googleapis.com), and a quota violation occurs in the
+     * Kubernetes Engine API itself, this field would be
+     * "container.googleapis.com". On the other hand, if the quota violation
+     * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
+     * API (compute.googleapis.com), this field would be
+     * "compute.googleapis.com".
+     * 
+ * + * string api_service = 3; + * + * @return The bytes for apiService. + */ @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subject_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subject_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + public com.google.protobuf.ByteString getApiServiceBytes() { + java.lang.Object ref = apiService_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiService_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; } + public static final int QUOTA_METRIC_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object quotaMetric_ = ""; + + /** + * + * + *
+     * The metric of the violated quota. A quota metric is a named counter to
+     * measure usage, such as API requests or CPUs. When an activity occurs in a
+     * service, such as Virtual Machine allocation, one or more quota metrics
+     * may be affected.
+     *
+     * For example, "compute.googleapis.com/cpus_per_vm_family",
+     * "storage.googleapis.com/internet_egress_bandwidth".
+     * 
+ * + * string quota_metric = 4; + * + * @return The quotaMetric. + */ @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.rpc.QuotaFailure.Violation)) { - return super.equals(obj); + public java.lang.String getQuotaMetric() { + java.lang.Object ref = quotaMetric_; + 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(); + quotaMetric_ = s; + return s; } - com.google.rpc.QuotaFailure.Violation other = (com.google.rpc.QuotaFailure.Violation) obj; - - if (!getSubject().equals(other.getSubject())) return false; - if (!getDescription().equals(other.getDescription())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; } + /** + * + * + *
+     * The metric of the violated quota. A quota metric is a named counter to
+     * measure usage, such as API requests or CPUs. When an activity occurs in a
+     * service, such as Virtual Machine allocation, one or more quota metrics
+     * may be affected.
+     *
+     * For example, "compute.googleapis.com/cpus_per_vm_family",
+     * "storage.googleapis.com/internet_egress_bandwidth".
+     * 
+ * + * string quota_metric = 4; + * + * @return The bytes for quotaMetric. + */ @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + public com.google.protobuf.ByteString getQuotaMetricBytes() { + java.lang.Object ref = quotaMetric_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaMetric_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + SUBJECT_FIELD_NUMBER; - hash = (53 * hash) + getSubject().hashCode(); - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; } - public static com.google.rpc.QuotaFailure.Violation parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + public static final int QUOTA_ID_FIELD_NUMBER = 5; - public static com.google.rpc.QuotaFailure.Violation parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); + @SuppressWarnings("serial") + private volatile java.lang.Object quotaId_ = ""; + + /** + * + * + *
+     * The id of the violated quota. Also know as "limit name", this is the
+     * unique identifier of a quota in the context of an API service.
+     *
+     * For example, "CPUS-PER-VM-FAMILY-per-project-region".
+     * 
+ * + * string quota_id = 5; + * + * @return The quotaId. + */ + @java.lang.Override + public java.lang.String getQuotaId() { + java.lang.Object ref = quotaId_; + 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(); + quotaId_ = s; + return s; + } + } + + /** + * + * + *
+     * The id of the violated quota. Also know as "limit name", this is the
+     * unique identifier of a quota in the context of an API service.
+     *
+     * For example, "CPUS-PER-VM-FAMILY-per-project-region".
+     * 
+ * + * string quota_id = 5; + * + * @return The bytes for quotaId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQuotaIdBytes() { + java.lang.Object ref = quotaId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUOTA_DIMENSIONS_FIELD_NUMBER = 6; + + private static final class QuotaDimensionsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.rpc.ErrorDetailsProto + .internal_static_google_rpc_QuotaFailure_Violation_QuotaDimensionsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField quotaDimensions_; + + private com.google.protobuf.MapField + internalGetQuotaDimensions() { + if (quotaDimensions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + QuotaDimensionsDefaultEntryHolder.defaultEntry); + } + return quotaDimensions_; + } + + public int getQuotaDimensionsCount() { + return internalGetQuotaDimensions().getMap().size(); + } + + /** + * + * + *
+     * The dimensions of the violated quota. Every non-global quota is enforced
+     * on a set of dimensions. While quota metric defines what to count, the
+     * dimensions specify for what aspects the counter should be increased.
+     *
+     * For example, the quota "CPUs per region per VM family" enforces a limit
+     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
+     * "region" and "vm_family". And if the violation occurred in region
+     * "us-central1" and for VM family "n1", the quota_dimensions would be,
+     *
+     * {
+     *   "region": "us-central1",
+     *   "vm_family": "n1",
+     * }
+     *
+     * When a quota is enforced globally, the quota_dimensions would always be
+     * empty.
+     * 
+ * + * map<string, string> quota_dimensions = 6; + */ + @java.lang.Override + public boolean containsQuotaDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetQuotaDimensions().getMap().containsKey(key); + } + + /** Use {@link #getQuotaDimensionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getQuotaDimensions() { + return getQuotaDimensionsMap(); + } + + /** + * + * + *
+     * The dimensions of the violated quota. Every non-global quota is enforced
+     * on a set of dimensions. While quota metric defines what to count, the
+     * dimensions specify for what aspects the counter should be increased.
+     *
+     * For example, the quota "CPUs per region per VM family" enforces a limit
+     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
+     * "region" and "vm_family". And if the violation occurred in region
+     * "us-central1" and for VM family "n1", the quota_dimensions would be,
+     *
+     * {
+     *   "region": "us-central1",
+     *   "vm_family": "n1",
+     * }
+     *
+     * When a quota is enforced globally, the quota_dimensions would always be
+     * empty.
+     * 
+ * + * map<string, string> quota_dimensions = 6; + */ + @java.lang.Override + public java.util.Map getQuotaDimensionsMap() { + return internalGetQuotaDimensions().getMap(); + } + + /** + * + * + *
+     * The dimensions of the violated quota. Every non-global quota is enforced
+     * on a set of dimensions. While quota metric defines what to count, the
+     * dimensions specify for what aspects the counter should be increased.
+     *
+     * For example, the quota "CPUs per region per VM family" enforces a limit
+     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
+     * "region" and "vm_family". And if the violation occurred in region
+     * "us-central1" and for VM family "n1", the quota_dimensions would be,
+     *
+     * {
+     *   "region": "us-central1",
+     *   "vm_family": "n1",
+     * }
+     *
+     * When a quota is enforced globally, the quota_dimensions would always be
+     * empty.
+     * 
+ * + * map<string, string> quota_dimensions = 6; + */ + @java.lang.Override + public /* nullable */ java.lang.String getQuotaDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetQuotaDimensions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * The dimensions of the violated quota. Every non-global quota is enforced
+     * on a set of dimensions. While quota metric defines what to count, the
+     * dimensions specify for what aspects the counter should be increased.
+     *
+     * For example, the quota "CPUs per region per VM family" enforces a limit
+     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
+     * "region" and "vm_family". And if the violation occurred in region
+     * "us-central1" and for VM family "n1", the quota_dimensions would be,
+     *
+     * {
+     *   "region": "us-central1",
+     *   "vm_family": "n1",
+     * }
+     *
+     * When a quota is enforced globally, the quota_dimensions would always be
+     * empty.
+     * 
+ * + * map<string, string> quota_dimensions = 6; + */ + @java.lang.Override + public java.lang.String getQuotaDimensionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetQuotaDimensions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int QUOTA_VALUE_FIELD_NUMBER = 7; + private long quotaValue_ = 0L; + + /** + * + * + *
+     * The enforced quota value at the time of the `QuotaFailure`.
+     *
+     * For example, if the enforced quota value at the time of the
+     * `QuotaFailure` on the number of CPUs is "10", then the value of this
+     * field would reflect this quantity.
+     * 
+ * + * int64 quota_value = 7; + * + * @return The quotaValue. + */ + @java.lang.Override + public long getQuotaValue() { + return quotaValue_; + } + + public static final int FUTURE_QUOTA_VALUE_FIELD_NUMBER = 8; + private long futureQuotaValue_ = 0L; + + /** + * + * + *
+     * The new quota value being rolled out at the time of the violation. At the
+     * completion of the rollout, this value will be enforced in place of
+     * quota_value. If no rollout is in progress at the time of the violation,
+     * this field is not set.
+     *
+     * For example, if at the time of the violation a rollout is in progress
+     * changing the number of CPUs quota from 10 to 20, 20 would be the value of
+     * this field.
+     * 
+ * + * optional int64 future_quota_value = 8; + * + * @return Whether the futureQuotaValue field is set. + */ + @java.lang.Override + public boolean hasFutureQuotaValue() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The new quota value being rolled out at the time of the violation. At the
+     * completion of the rollout, this value will be enforced in place of
+     * quota_value. If no rollout is in progress at the time of the violation,
+     * this field is not set.
+     *
+     * For example, if at the time of the violation a rollout is in progress
+     * changing the number of CPUs quota from 10 to 20, 20 would be the value of
+     * this field.
+     * 
+ * + * optional int64 future_quota_value = 8; + * + * @return The futureQuotaValue. + */ + @java.lang.Override + public long getFutureQuotaValue() { + return futureQuotaValue_; + } + + 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(subject_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subject_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiService_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, apiService_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaMetric_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, quotaMetric_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, quotaId_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetQuotaDimensions(), QuotaDimensionsDefaultEntryHolder.defaultEntry, 6); + if (quotaValue_ != 0L) { + output.writeInt64(7, quotaValue_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(8, futureQuotaValue_); + } + 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(subject_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subject_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiService_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, apiService_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaMetric_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, quotaMetric_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, quotaId_); + } + for (java.util.Map.Entry entry : + internalGetQuotaDimensions().getMap().entrySet()) { + com.google.protobuf.MapEntry quotaDimensions__ = + QuotaDimensionsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, quotaDimensions__); + } + if (quotaValue_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, quotaValue_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, futureQuotaValue_); + } + 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.rpc.QuotaFailure.Violation)) { + return super.equals(obj); + } + com.google.rpc.QuotaFailure.Violation other = (com.google.rpc.QuotaFailure.Violation) obj; + + if (!getSubject().equals(other.getSubject())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getApiService().equals(other.getApiService())) return false; + if (!getQuotaMetric().equals(other.getQuotaMetric())) return false; + if (!getQuotaId().equals(other.getQuotaId())) return false; + if (!internalGetQuotaDimensions().equals(other.internalGetQuotaDimensions())) return false; + if (getQuotaValue() != other.getQuotaValue()) return false; + if (hasFutureQuotaValue() != other.hasFutureQuotaValue()) return false; + if (hasFutureQuotaValue()) { + if (getFutureQuotaValue() != other.getFutureQuotaValue()) 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) + SUBJECT_FIELD_NUMBER; + hash = (53 * hash) + getSubject().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + API_SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getApiService().hashCode(); + hash = (37 * hash) + QUOTA_METRIC_FIELD_NUMBER; + hash = (53 * hash) + getQuotaMetric().hashCode(); + hash = (37 * hash) + QUOTA_ID_FIELD_NUMBER; + hash = (53 * hash) + getQuotaId().hashCode(); + if (!internalGetQuotaDimensions().getMap().isEmpty()) { + hash = (37 * hash) + QUOTA_DIMENSIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetQuotaDimensions().hashCode(); + } + hash = (37 * hash) + QUOTA_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getQuotaValue()); + if (hasFutureQuotaValue()) { + hash = (37 * hash) + FUTURE_QUOTA_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFutureQuotaValue()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.rpc.QuotaFailure.Violation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.rpc.QuotaFailure.Violation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); } public static com.google.rpc.QuotaFailure.Violation parseFrom( @@ -504,6 +1344,28 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .internal_static_google_rpc_QuotaFailure_Violation_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetQuotaDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetMutableQuotaDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -527,6 +1389,12 @@ public Builder clear() { bitField0_ = 0; subject_ = ""; description_ = ""; + apiService_ = ""; + quotaMetric_ = ""; + quotaId_ = ""; + internalGetMutableQuotaDimensions().clear(); + quotaValue_ = 0L; + futureQuotaValue_ = 0L; return this; } @@ -569,6 +1437,28 @@ private void buildPartial0(com.google.rpc.QuotaFailure.Violation result) { if (((from_bitField0_ & 0x00000002) != 0)) { result.description_ = description_; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.apiService_ = apiService_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.quotaMetric_ = quotaMetric_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.quotaId_ = quotaId_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.quotaDimensions_ = internalGetQuotaDimensions(); + result.quotaDimensions_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.quotaValue_ = quotaValue_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000080) != 0)) { + result.futureQuotaValue_ = futureQuotaValue_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -628,6 +1518,29 @@ public Builder mergeFrom(com.google.rpc.QuotaFailure.Violation other) { bitField0_ |= 0x00000002; onChanged(); } + if (!other.getApiService().isEmpty()) { + apiService_ = other.apiService_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getQuotaMetric().isEmpty()) { + quotaMetric_ = other.quotaMetric_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getQuotaId().isEmpty()) { + quotaId_ = other.quotaId_; + bitField0_ |= 0x00000010; + onChanged(); + } + internalGetMutableQuotaDimensions().mergeFrom(other.internalGetQuotaDimensions()); + bitField0_ |= 0x00000020; + if (other.getQuotaValue() != 0L) { + setQuotaValue(other.getQuotaValue()); + } + if (other.hasFutureQuotaValue()) { + setFutureQuotaValue(other.getFutureQuotaValue()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -666,17 +1579,60 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 18 - default: + case 26: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } + apiService_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); + } // case 26 + case 34: + { + quotaMetric_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + quotaId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + com.google.protobuf.MapEntry + quotaDimensions__ = + input.readMessage( + QuotaDimensionsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableQuotaDimensions() + .getMutableMap() + .put(quotaDimensions__.getKey(), quotaDimensions__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: + { + quotaValue_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: + { + futureQuotaValue_ = input.readInt64(); + bitField0_ |= 0x00000080; + break; + } // case 64 + 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 @@ -947,6 +1903,896 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object apiService_ = ""; + + /** + * + * + *
+       * The API Service from which the `QuotaFailure.Violation` orginates. In
+       * some cases, Quota issues originate from an API Service other than the one
+       * that was called. In other words, a dependency of the called API Service
+       * could be the cause of the `QuotaFailure`, and this field would have the
+       * dependency API service name.
+       *
+       * For example, if the called API is Kubernetes Engine API
+       * (container.googleapis.com), and a quota violation occurs in the
+       * Kubernetes Engine API itself, this field would be
+       * "container.googleapis.com". On the other hand, if the quota violation
+       * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
+       * API (compute.googleapis.com), this field would be
+       * "compute.googleapis.com".
+       * 
+ * + * string api_service = 3; + * + * @return The apiService. + */ + public java.lang.String getApiService() { + java.lang.Object ref = apiService_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiService_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The API Service from which the `QuotaFailure.Violation` orginates. In
+       * some cases, Quota issues originate from an API Service other than the one
+       * that was called. In other words, a dependency of the called API Service
+       * could be the cause of the `QuotaFailure`, and this field would have the
+       * dependency API service name.
+       *
+       * For example, if the called API is Kubernetes Engine API
+       * (container.googleapis.com), and a quota violation occurs in the
+       * Kubernetes Engine API itself, this field would be
+       * "container.googleapis.com". On the other hand, if the quota violation
+       * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
+       * API (compute.googleapis.com), this field would be
+       * "compute.googleapis.com".
+       * 
+ * + * string api_service = 3; + * + * @return The bytes for apiService. + */ + public com.google.protobuf.ByteString getApiServiceBytes() { + java.lang.Object ref = apiService_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiService_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The API Service from which the `QuotaFailure.Violation` orginates. In
+       * some cases, Quota issues originate from an API Service other than the one
+       * that was called. In other words, a dependency of the called API Service
+       * could be the cause of the `QuotaFailure`, and this field would have the
+       * dependency API service name.
+       *
+       * For example, if the called API is Kubernetes Engine API
+       * (container.googleapis.com), and a quota violation occurs in the
+       * Kubernetes Engine API itself, this field would be
+       * "container.googleapis.com". On the other hand, if the quota violation
+       * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
+       * API (compute.googleapis.com), this field would be
+       * "compute.googleapis.com".
+       * 
+ * + * string api_service = 3; + * + * @param value The apiService to set. + * @return This builder for chaining. + */ + public Builder setApiService(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiService_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The API Service from which the `QuotaFailure.Violation` orginates. In
+       * some cases, Quota issues originate from an API Service other than the one
+       * that was called. In other words, a dependency of the called API Service
+       * could be the cause of the `QuotaFailure`, and this field would have the
+       * dependency API service name.
+       *
+       * For example, if the called API is Kubernetes Engine API
+       * (container.googleapis.com), and a quota violation occurs in the
+       * Kubernetes Engine API itself, this field would be
+       * "container.googleapis.com". On the other hand, if the quota violation
+       * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
+       * API (compute.googleapis.com), this field would be
+       * "compute.googleapis.com".
+       * 
+ * + * string api_service = 3; + * + * @return This builder for chaining. + */ + public Builder clearApiService() { + apiService_ = getDefaultInstance().getApiService(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * The API Service from which the `QuotaFailure.Violation` orginates. In
+       * some cases, Quota issues originate from an API Service other than the one
+       * that was called. In other words, a dependency of the called API Service
+       * could be the cause of the `QuotaFailure`, and this field would have the
+       * dependency API service name.
+       *
+       * For example, if the called API is Kubernetes Engine API
+       * (container.googleapis.com), and a quota violation occurs in the
+       * Kubernetes Engine API itself, this field would be
+       * "container.googleapis.com". On the other hand, if the quota violation
+       * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
+       * API (compute.googleapis.com), this field would be
+       * "compute.googleapis.com".
+       * 
+ * + * string api_service = 3; + * + * @param value The bytes for apiService to set. + * @return This builder for chaining. + */ + public Builder setApiServiceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiService_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object quotaMetric_ = ""; + + /** + * + * + *
+       * The metric of the violated quota. A quota metric is a named counter to
+       * measure usage, such as API requests or CPUs. When an activity occurs in a
+       * service, such as Virtual Machine allocation, one or more quota metrics
+       * may be affected.
+       *
+       * For example, "compute.googleapis.com/cpus_per_vm_family",
+       * "storage.googleapis.com/internet_egress_bandwidth".
+       * 
+ * + * string quota_metric = 4; + * + * @return The quotaMetric. + */ + public java.lang.String getQuotaMetric() { + java.lang.Object ref = quotaMetric_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quotaMetric_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The metric of the violated quota. A quota metric is a named counter to
+       * measure usage, such as API requests or CPUs. When an activity occurs in a
+       * service, such as Virtual Machine allocation, one or more quota metrics
+       * may be affected.
+       *
+       * For example, "compute.googleapis.com/cpus_per_vm_family",
+       * "storage.googleapis.com/internet_egress_bandwidth".
+       * 
+ * + * string quota_metric = 4; + * + * @return The bytes for quotaMetric. + */ + public com.google.protobuf.ByteString getQuotaMetricBytes() { + java.lang.Object ref = quotaMetric_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaMetric_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The metric of the violated quota. A quota metric is a named counter to
+       * measure usage, such as API requests or CPUs. When an activity occurs in a
+       * service, such as Virtual Machine allocation, one or more quota metrics
+       * may be affected.
+       *
+       * For example, "compute.googleapis.com/cpus_per_vm_family",
+       * "storage.googleapis.com/internet_egress_bandwidth".
+       * 
+ * + * string quota_metric = 4; + * + * @param value The quotaMetric to set. + * @return This builder for chaining. + */ + public Builder setQuotaMetric(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + quotaMetric_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The metric of the violated quota. A quota metric is a named counter to
+       * measure usage, such as API requests or CPUs. When an activity occurs in a
+       * service, such as Virtual Machine allocation, one or more quota metrics
+       * may be affected.
+       *
+       * For example, "compute.googleapis.com/cpus_per_vm_family",
+       * "storage.googleapis.com/internet_egress_bandwidth".
+       * 
+ * + * string quota_metric = 4; + * + * @return This builder for chaining. + */ + public Builder clearQuotaMetric() { + quotaMetric_ = getDefaultInstance().getQuotaMetric(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+       * The metric of the violated quota. A quota metric is a named counter to
+       * measure usage, such as API requests or CPUs. When an activity occurs in a
+       * service, such as Virtual Machine allocation, one or more quota metrics
+       * may be affected.
+       *
+       * For example, "compute.googleapis.com/cpus_per_vm_family",
+       * "storage.googleapis.com/internet_egress_bandwidth".
+       * 
+ * + * string quota_metric = 4; + * + * @param value The bytes for quotaMetric to set. + * @return This builder for chaining. + */ + public Builder setQuotaMetricBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + quotaMetric_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object quotaId_ = ""; + + /** + * + * + *
+       * The id of the violated quota. Also know as "limit name", this is the
+       * unique identifier of a quota in the context of an API service.
+       *
+       * For example, "CPUS-PER-VM-FAMILY-per-project-region".
+       * 
+ * + * string quota_id = 5; + * + * @return The quotaId. + */ + public java.lang.String getQuotaId() { + java.lang.Object ref = quotaId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quotaId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The id of the violated quota. Also know as "limit name", this is the
+       * unique identifier of a quota in the context of an API service.
+       *
+       * For example, "CPUS-PER-VM-FAMILY-per-project-region".
+       * 
+ * + * string quota_id = 5; + * + * @return The bytes for quotaId. + */ + public com.google.protobuf.ByteString getQuotaIdBytes() { + java.lang.Object ref = quotaId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The id of the violated quota. Also know as "limit name", this is the
+       * unique identifier of a quota in the context of an API service.
+       *
+       * For example, "CPUS-PER-VM-FAMILY-per-project-region".
+       * 
+ * + * string quota_id = 5; + * + * @param value The quotaId to set. + * @return This builder for chaining. + */ + public Builder setQuotaId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + quotaId_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * The id of the violated quota. Also know as "limit name", this is the
+       * unique identifier of a quota in the context of an API service.
+       *
+       * For example, "CPUS-PER-VM-FAMILY-per-project-region".
+       * 
+ * + * string quota_id = 5; + * + * @return This builder for chaining. + */ + public Builder clearQuotaId() { + quotaId_ = getDefaultInstance().getQuotaId(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+       * The id of the violated quota. Also know as "limit name", this is the
+       * unique identifier of a quota in the context of an API service.
+       *
+       * For example, "CPUS-PER-VM-FAMILY-per-project-region".
+       * 
+ * + * string quota_id = 5; + * + * @param value The bytes for quotaId to set. + * @return This builder for chaining. + */ + public Builder setQuotaIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + quotaId_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.MapField quotaDimensions_; + + private com.google.protobuf.MapField + internalGetQuotaDimensions() { + if (quotaDimensions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + QuotaDimensionsDefaultEntryHolder.defaultEntry); + } + return quotaDimensions_; + } + + private com.google.protobuf.MapField + internalGetMutableQuotaDimensions() { + if (quotaDimensions_ == null) { + quotaDimensions_ = + com.google.protobuf.MapField.newMapField( + QuotaDimensionsDefaultEntryHolder.defaultEntry); + } + if (!quotaDimensions_.isMutable()) { + quotaDimensions_ = quotaDimensions_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + return quotaDimensions_; + } + + public int getQuotaDimensionsCount() { + return internalGetQuotaDimensions().getMap().size(); + } + + /** + * + * + *
+       * The dimensions of the violated quota. Every non-global quota is enforced
+       * on a set of dimensions. While quota metric defines what to count, the
+       * dimensions specify for what aspects the counter should be increased.
+       *
+       * For example, the quota "CPUs per region per VM family" enforces a limit
+       * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
+       * "region" and "vm_family". And if the violation occurred in region
+       * "us-central1" and for VM family "n1", the quota_dimensions would be,
+       *
+       * {
+       *   "region": "us-central1",
+       *   "vm_family": "n1",
+       * }
+       *
+       * When a quota is enforced globally, the quota_dimensions would always be
+       * empty.
+       * 
+ * + * map<string, string> quota_dimensions = 6; + */ + @java.lang.Override + public boolean containsQuotaDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetQuotaDimensions().getMap().containsKey(key); + } + + /** Use {@link #getQuotaDimensionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getQuotaDimensions() { + return getQuotaDimensionsMap(); + } + + /** + * + * + *
+       * The dimensions of the violated quota. Every non-global quota is enforced
+       * on a set of dimensions. While quota metric defines what to count, the
+       * dimensions specify for what aspects the counter should be increased.
+       *
+       * For example, the quota "CPUs per region per VM family" enforces a limit
+       * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
+       * "region" and "vm_family". And if the violation occurred in region
+       * "us-central1" and for VM family "n1", the quota_dimensions would be,
+       *
+       * {
+       *   "region": "us-central1",
+       *   "vm_family": "n1",
+       * }
+       *
+       * When a quota is enforced globally, the quota_dimensions would always be
+       * empty.
+       * 
+ * + * map<string, string> quota_dimensions = 6; + */ + @java.lang.Override + public java.util.Map getQuotaDimensionsMap() { + return internalGetQuotaDimensions().getMap(); + } + + /** + * + * + *
+       * The dimensions of the violated quota. Every non-global quota is enforced
+       * on a set of dimensions. While quota metric defines what to count, the
+       * dimensions specify for what aspects the counter should be increased.
+       *
+       * For example, the quota "CPUs per region per VM family" enforces a limit
+       * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
+       * "region" and "vm_family". And if the violation occurred in region
+       * "us-central1" and for VM family "n1", the quota_dimensions would be,
+       *
+       * {
+       *   "region": "us-central1",
+       *   "vm_family": "n1",
+       * }
+       *
+       * When a quota is enforced globally, the quota_dimensions would always be
+       * empty.
+       * 
+ * + * map<string, string> quota_dimensions = 6; + */ + @java.lang.Override + public /* nullable */ java.lang.String getQuotaDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetQuotaDimensions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+       * The dimensions of the violated quota. Every non-global quota is enforced
+       * on a set of dimensions. While quota metric defines what to count, the
+       * dimensions specify for what aspects the counter should be increased.
+       *
+       * For example, the quota "CPUs per region per VM family" enforces a limit
+       * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
+       * "region" and "vm_family". And if the violation occurred in region
+       * "us-central1" and for VM family "n1", the quota_dimensions would be,
+       *
+       * {
+       *   "region": "us-central1",
+       *   "vm_family": "n1",
+       * }
+       *
+       * When a quota is enforced globally, the quota_dimensions would always be
+       * empty.
+       * 
+ * + * map<string, string> quota_dimensions = 6; + */ + @java.lang.Override + public java.lang.String getQuotaDimensionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetQuotaDimensions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearQuotaDimensions() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableQuotaDimensions().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+       * The dimensions of the violated quota. Every non-global quota is enforced
+       * on a set of dimensions. While quota metric defines what to count, the
+       * dimensions specify for what aspects the counter should be increased.
+       *
+       * For example, the quota "CPUs per region per VM family" enforces a limit
+       * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
+       * "region" and "vm_family". And if the violation occurred in region
+       * "us-central1" and for VM family "n1", the quota_dimensions would be,
+       *
+       * {
+       *   "region": "us-central1",
+       *   "vm_family": "n1",
+       * }
+       *
+       * When a quota is enforced globally, the quota_dimensions would always be
+       * empty.
+       * 
+ * + * map<string, string> quota_dimensions = 6; + */ + public Builder removeQuotaDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableQuotaDimensions().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableQuotaDimensions() { + bitField0_ |= 0x00000020; + return internalGetMutableQuotaDimensions().getMutableMap(); + } + + /** + * + * + *
+       * The dimensions of the violated quota. Every non-global quota is enforced
+       * on a set of dimensions. While quota metric defines what to count, the
+       * dimensions specify for what aspects the counter should be increased.
+       *
+       * For example, the quota "CPUs per region per VM family" enforces a limit
+       * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
+       * "region" and "vm_family". And if the violation occurred in region
+       * "us-central1" and for VM family "n1", the quota_dimensions would be,
+       *
+       * {
+       *   "region": "us-central1",
+       *   "vm_family": "n1",
+       * }
+       *
+       * When a quota is enforced globally, the quota_dimensions would always be
+       * empty.
+       * 
+ * + * map<string, string> quota_dimensions = 6; + */ + public Builder putQuotaDimensions(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableQuotaDimensions().getMutableMap().put(key, value); + bitField0_ |= 0x00000020; + return this; + } + + /** + * + * + *
+       * The dimensions of the violated quota. Every non-global quota is enforced
+       * on a set of dimensions. While quota metric defines what to count, the
+       * dimensions specify for what aspects the counter should be increased.
+       *
+       * For example, the quota "CPUs per region per VM family" enforces a limit
+       * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
+       * "region" and "vm_family". And if the violation occurred in region
+       * "us-central1" and for VM family "n1", the quota_dimensions would be,
+       *
+       * {
+       *   "region": "us-central1",
+       *   "vm_family": "n1",
+       * }
+       *
+       * When a quota is enforced globally, the quota_dimensions would always be
+       * empty.
+       * 
+ * + * map<string, string> quota_dimensions = 6; + */ + public Builder putAllQuotaDimensions( + java.util.Map values) { + internalGetMutableQuotaDimensions().getMutableMap().putAll(values); + bitField0_ |= 0x00000020; + return this; + } + + private long quotaValue_; + + /** + * + * + *
+       * The enforced quota value at the time of the `QuotaFailure`.
+       *
+       * For example, if the enforced quota value at the time of the
+       * `QuotaFailure` on the number of CPUs is "10", then the value of this
+       * field would reflect this quantity.
+       * 
+ * + * int64 quota_value = 7; + * + * @return The quotaValue. + */ + @java.lang.Override + public long getQuotaValue() { + return quotaValue_; + } + + /** + * + * + *
+       * The enforced quota value at the time of the `QuotaFailure`.
+       *
+       * For example, if the enforced quota value at the time of the
+       * `QuotaFailure` on the number of CPUs is "10", then the value of this
+       * field would reflect this quantity.
+       * 
+ * + * int64 quota_value = 7; + * + * @param value The quotaValue to set. + * @return This builder for chaining. + */ + public Builder setQuotaValue(long value) { + + quotaValue_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+       * The enforced quota value at the time of the `QuotaFailure`.
+       *
+       * For example, if the enforced quota value at the time of the
+       * `QuotaFailure` on the number of CPUs is "10", then the value of this
+       * field would reflect this quantity.
+       * 
+ * + * int64 quota_value = 7; + * + * @return This builder for chaining. + */ + public Builder clearQuotaValue() { + bitField0_ = (bitField0_ & ~0x00000040); + quotaValue_ = 0L; + onChanged(); + return this; + } + + private long futureQuotaValue_; + + /** + * + * + *
+       * The new quota value being rolled out at the time of the violation. At the
+       * completion of the rollout, this value will be enforced in place of
+       * quota_value. If no rollout is in progress at the time of the violation,
+       * this field is not set.
+       *
+       * For example, if at the time of the violation a rollout is in progress
+       * changing the number of CPUs quota from 10 to 20, 20 would be the value of
+       * this field.
+       * 
+ * + * optional int64 future_quota_value = 8; + * + * @return Whether the futureQuotaValue field is set. + */ + @java.lang.Override + public boolean hasFutureQuotaValue() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+       * The new quota value being rolled out at the time of the violation. At the
+       * completion of the rollout, this value will be enforced in place of
+       * quota_value. If no rollout is in progress at the time of the violation,
+       * this field is not set.
+       *
+       * For example, if at the time of the violation a rollout is in progress
+       * changing the number of CPUs quota from 10 to 20, 20 would be the value of
+       * this field.
+       * 
+ * + * optional int64 future_quota_value = 8; + * + * @return The futureQuotaValue. + */ + @java.lang.Override + public long getFutureQuotaValue() { + return futureQuotaValue_; + } + + /** + * + * + *
+       * The new quota value being rolled out at the time of the violation. At the
+       * completion of the rollout, this value will be enforced in place of
+       * quota_value. If no rollout is in progress at the time of the violation,
+       * this field is not set.
+       *
+       * For example, if at the time of the violation a rollout is in progress
+       * changing the number of CPUs quota from 10 to 20, 20 would be the value of
+       * this field.
+       * 
+ * + * optional int64 future_quota_value = 8; + * + * @param value The futureQuotaValue to set. + * @return This builder for chaining. + */ + public Builder setFutureQuotaValue(long value) { + + futureQuotaValue_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+       * The new quota value being rolled out at the time of the violation. At the
+       * completion of the rollout, this value will be enforced in place of
+       * quota_value. If no rollout is in progress at the time of the violation,
+       * this field is not set.
+       *
+       * For example, if at the time of the violation a rollout is in progress
+       * changing the number of CPUs quota from 10 to 20, 20 would be the value of
+       * this field.
+       * 
+ * + * optional int64 future_quota_value = 8; + * + * @return This builder for chaining. + */ + public Builder clearFutureQuotaValue() { + bitField0_ = (bitField0_ & ~0x00000080); + futureQuotaValue_ = 0L; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/error_details.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/error_details.proto index 46ef5b864e..4f9ecff035 100644 --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/error_details.proto +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/error_details.proto @@ -131,6 +131,71 @@ message QuotaFailure { // For example: "Service disabled" or "Daily Limit for read operations // exceeded". string description = 2; + + // The API Service from which the `QuotaFailure.Violation` orginates. In + // some cases, Quota issues originate from an API Service other than the one + // that was called. In other words, a dependency of the called API Service + // could be the cause of the `QuotaFailure`, and this field would have the + // dependency API service name. + // + // For example, if the called API is Kubernetes Engine API + // (container.googleapis.com), and a quota violation occurs in the + // Kubernetes Engine API itself, this field would be + // "container.googleapis.com". On the other hand, if the quota violation + // occurs when the Kubernetes Engine API creates VMs in the Compute Engine + // API (compute.googleapis.com), this field would be + // "compute.googleapis.com". + string api_service = 3; + + // The metric of the violated quota. A quota metric is a named counter to + // measure usage, such as API requests or CPUs. When an activity occurs in a + // service, such as Virtual Machine allocation, one or more quota metrics + // may be affected. + // + // For example, "compute.googleapis.com/cpus_per_vm_family", + // "storage.googleapis.com/internet_egress_bandwidth". + string quota_metric = 4; + + // The id of the violated quota. Also know as "limit name", this is the + // unique identifier of a quota in the context of an API service. + // + // For example, "CPUS-PER-VM-FAMILY-per-project-region". + string quota_id = 5; + + // The dimensions of the violated quota. Every non-global quota is enforced + // on a set of dimensions. While quota metric defines what to count, the + // dimensions specify for what aspects the counter should be increased. + // + // For example, the quota "CPUs per region per VM family" enforces a limit + // on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions + // "region" and "vm_family". And if the violation occurred in region + // "us-central1" and for VM family "n1", the quota_dimensions would be, + // + // { + // "region": "us-central1", + // "vm_family": "n1", + // } + // + // When a quota is enforced globally, the quota_dimensions would always be + // empty. + map quota_dimensions = 6; + + // The enforced quota value at the time of the `QuotaFailure`. + // + // For example, if the enforced quota value at the time of the + // `QuotaFailure` on the number of CPUs is "10", then the value of this + // field would reflect this quantity. + int64 quota_value = 7; + + // The new quota value being rolled out at the time of the violation. At the + // completion of the rollout, this value will be enforced in place of + // quota_value. If no rollout is in progress at the time of the violation, + // this field is not set. + // + // For example, if at the time of the violation a rollout is in progress + // changing the number of CPUs quota from 10 to 20, 20 would be the value of + // this field. + optional int64 future_quota_value = 8; } // Describes all quota violations.