• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 // Generated by the protocol buffer compiler.  DO NOT EDIT!
17 // source: google/cloud/compute/v1/compute.proto
18 
19 package com.google.cloud.compute.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * The retry policy associates with HttpRouteRule
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.compute.v1.HttpRetryPolicy}
29  */
30 public final class HttpRetryPolicy extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.HttpRetryPolicy)
33     HttpRetryPolicyOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use HttpRetryPolicy.newBuilder() to construct.
HttpRetryPolicy(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private HttpRetryPolicy(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
HttpRetryPolicy()40   private HttpRetryPolicy() {
41     retryConditions_ = com.google.protobuf.LazyStringArrayList.EMPTY;
42   }
43 
44   @java.lang.Override
45   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)46   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
47     return new HttpRetryPolicy();
48   }
49 
50   @java.lang.Override
getUnknownFields()51   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
52     return this.unknownFields;
53   }
54 
getDescriptor()55   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
56     return com.google.cloud.compute.v1.Compute
57         .internal_static_google_cloud_compute_v1_HttpRetryPolicy_descriptor;
58   }
59 
60   @java.lang.Override
61   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()62       internalGetFieldAccessorTable() {
63     return com.google.cloud.compute.v1.Compute
64         .internal_static_google_cloud_compute_v1_HttpRetryPolicy_fieldAccessorTable
65         .ensureFieldAccessorsInitialized(
66             com.google.cloud.compute.v1.HttpRetryPolicy.class,
67             com.google.cloud.compute.v1.HttpRetryPolicy.Builder.class);
68   }
69 
70   private int bitField0_;
71   public static final int NUM_RETRIES_FIELD_NUMBER = 251680141;
72   private int numRetries_ = 0;
73   /**
74    *
75    *
76    * <pre>
77    * Specifies the allowed number retries. This number must be &gt; 0. If not specified, defaults to 1.
78    * </pre>
79    *
80    * <code>optional uint32 num_retries = 251680141;</code>
81    *
82    * @return Whether the numRetries field is set.
83    */
84   @java.lang.Override
hasNumRetries()85   public boolean hasNumRetries() {
86     return ((bitField0_ & 0x00000001) != 0);
87   }
88   /**
89    *
90    *
91    * <pre>
92    * Specifies the allowed number retries. This number must be &gt; 0. If not specified, defaults to 1.
93    * </pre>
94    *
95    * <code>optional uint32 num_retries = 251680141;</code>
96    *
97    * @return The numRetries.
98    */
99   @java.lang.Override
getNumRetries()100   public int getNumRetries() {
101     return numRetries_;
102   }
103 
104   public static final int PER_TRY_TIMEOUT_FIELD_NUMBER = 280041147;
105   private com.google.cloud.compute.v1.Duration perTryTimeout_;
106   /**
107    *
108    *
109    * <pre>
110    * Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.
111    * </pre>
112    *
113    * <code>optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;</code>
114    *
115    * @return Whether the perTryTimeout field is set.
116    */
117   @java.lang.Override
hasPerTryTimeout()118   public boolean hasPerTryTimeout() {
119     return ((bitField0_ & 0x00000002) != 0);
120   }
121   /**
122    *
123    *
124    * <pre>
125    * Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.
126    * </pre>
127    *
128    * <code>optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;</code>
129    *
130    * @return The perTryTimeout.
131    */
132   @java.lang.Override
getPerTryTimeout()133   public com.google.cloud.compute.v1.Duration getPerTryTimeout() {
134     return perTryTimeout_ == null
135         ? com.google.cloud.compute.v1.Duration.getDefaultInstance()
136         : perTryTimeout_;
137   }
138   /**
139    *
140    *
141    * <pre>
142    * Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.
143    * </pre>
144    *
145    * <code>optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;</code>
146    */
147   @java.lang.Override
getPerTryTimeoutOrBuilder()148   public com.google.cloud.compute.v1.DurationOrBuilder getPerTryTimeoutOrBuilder() {
149     return perTryTimeout_ == null
150         ? com.google.cloud.compute.v1.Duration.getDefaultInstance()
151         : perTryTimeout_;
152   }
153 
154   public static final int RETRY_CONDITIONS_FIELD_NUMBER = 28815535;
155 
156   @SuppressWarnings("serial")
157   private com.google.protobuf.LazyStringList retryConditions_;
158   /**
159    *
160    *
161    * <pre>
162    * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable
163    * </pre>
164    *
165    * <code>repeated string retry_conditions = 28815535;</code>
166    *
167    * @return A list containing the retryConditions.
168    */
getRetryConditionsList()169   public com.google.protobuf.ProtocolStringList getRetryConditionsList() {
170     return retryConditions_;
171   }
172   /**
173    *
174    *
175    * <pre>
176    * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable
177    * </pre>
178    *
179    * <code>repeated string retry_conditions = 28815535;</code>
180    *
181    * @return The count of retryConditions.
182    */
getRetryConditionsCount()183   public int getRetryConditionsCount() {
184     return retryConditions_.size();
185   }
186   /**
187    *
188    *
189    * <pre>
190    * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable
191    * </pre>
192    *
193    * <code>repeated string retry_conditions = 28815535;</code>
194    *
195    * @param index The index of the element to return.
196    * @return The retryConditions at the given index.
197    */
getRetryConditions(int index)198   public java.lang.String getRetryConditions(int index) {
199     return retryConditions_.get(index);
200   }
201   /**
202    *
203    *
204    * <pre>
205    * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable
206    * </pre>
207    *
208    * <code>repeated string retry_conditions = 28815535;</code>
209    *
210    * @param index The index of the value to return.
211    * @return The bytes of the retryConditions at the given index.
212    */
getRetryConditionsBytes(int index)213   public com.google.protobuf.ByteString getRetryConditionsBytes(int index) {
214     return retryConditions_.getByteString(index);
215   }
216 
217   private byte memoizedIsInitialized = -1;
218 
219   @java.lang.Override
isInitialized()220   public final boolean isInitialized() {
221     byte isInitialized = memoizedIsInitialized;
222     if (isInitialized == 1) return true;
223     if (isInitialized == 0) return false;
224 
225     memoizedIsInitialized = 1;
226     return true;
227   }
228 
229   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)230   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
231     for (int i = 0; i < retryConditions_.size(); i++) {
232       com.google.protobuf.GeneratedMessageV3.writeString(
233           output, 28815535, retryConditions_.getRaw(i));
234     }
235     if (((bitField0_ & 0x00000001) != 0)) {
236       output.writeUInt32(251680141, numRetries_);
237     }
238     if (((bitField0_ & 0x00000002) != 0)) {
239       output.writeMessage(280041147, getPerTryTimeout());
240     }
241     getUnknownFields().writeTo(output);
242   }
243 
244   @java.lang.Override
getSerializedSize()245   public int getSerializedSize() {
246     int size = memoizedSize;
247     if (size != -1) return size;
248 
249     size = 0;
250     {
251       int dataSize = 0;
252       for (int i = 0; i < retryConditions_.size(); i++) {
253         dataSize += computeStringSizeNoTag(retryConditions_.getRaw(i));
254       }
255       size += dataSize;
256       size += 4 * getRetryConditionsList().size();
257     }
258     if (((bitField0_ & 0x00000001) != 0)) {
259       size += com.google.protobuf.CodedOutputStream.computeUInt32Size(251680141, numRetries_);
260     }
261     if (((bitField0_ & 0x00000002) != 0)) {
262       size +=
263           com.google.protobuf.CodedOutputStream.computeMessageSize(280041147, getPerTryTimeout());
264     }
265     size += getUnknownFields().getSerializedSize();
266     memoizedSize = size;
267     return size;
268   }
269 
270   @java.lang.Override
equals(final java.lang.Object obj)271   public boolean equals(final java.lang.Object obj) {
272     if (obj == this) {
273       return true;
274     }
275     if (!(obj instanceof com.google.cloud.compute.v1.HttpRetryPolicy)) {
276       return super.equals(obj);
277     }
278     com.google.cloud.compute.v1.HttpRetryPolicy other =
279         (com.google.cloud.compute.v1.HttpRetryPolicy) obj;
280 
281     if (hasNumRetries() != other.hasNumRetries()) return false;
282     if (hasNumRetries()) {
283       if (getNumRetries() != other.getNumRetries()) return false;
284     }
285     if (hasPerTryTimeout() != other.hasPerTryTimeout()) return false;
286     if (hasPerTryTimeout()) {
287       if (!getPerTryTimeout().equals(other.getPerTryTimeout())) return false;
288     }
289     if (!getRetryConditionsList().equals(other.getRetryConditionsList())) return false;
290     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
291     return true;
292   }
293 
294   @java.lang.Override
hashCode()295   public int hashCode() {
296     if (memoizedHashCode != 0) {
297       return memoizedHashCode;
298     }
299     int hash = 41;
300     hash = (19 * hash) + getDescriptor().hashCode();
301     if (hasNumRetries()) {
302       hash = (37 * hash) + NUM_RETRIES_FIELD_NUMBER;
303       hash = (53 * hash) + getNumRetries();
304     }
305     if (hasPerTryTimeout()) {
306       hash = (37 * hash) + PER_TRY_TIMEOUT_FIELD_NUMBER;
307       hash = (53 * hash) + getPerTryTimeout().hashCode();
308     }
309     if (getRetryConditionsCount() > 0) {
310       hash = (37 * hash) + RETRY_CONDITIONS_FIELD_NUMBER;
311       hash = (53 * hash) + getRetryConditionsList().hashCode();
312     }
313     hash = (29 * hash) + getUnknownFields().hashCode();
314     memoizedHashCode = hash;
315     return hash;
316   }
317 
parseFrom(java.nio.ByteBuffer data)318   public static com.google.cloud.compute.v1.HttpRetryPolicy parseFrom(java.nio.ByteBuffer data)
319       throws com.google.protobuf.InvalidProtocolBufferException {
320     return PARSER.parseFrom(data);
321   }
322 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)323   public static com.google.cloud.compute.v1.HttpRetryPolicy parseFrom(
324       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
325       throws com.google.protobuf.InvalidProtocolBufferException {
326     return PARSER.parseFrom(data, extensionRegistry);
327   }
328 
parseFrom( com.google.protobuf.ByteString data)329   public static com.google.cloud.compute.v1.HttpRetryPolicy parseFrom(
330       com.google.protobuf.ByteString data)
331       throws com.google.protobuf.InvalidProtocolBufferException {
332     return PARSER.parseFrom(data);
333   }
334 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)335   public static com.google.cloud.compute.v1.HttpRetryPolicy parseFrom(
336       com.google.protobuf.ByteString data,
337       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
338       throws com.google.protobuf.InvalidProtocolBufferException {
339     return PARSER.parseFrom(data, extensionRegistry);
340   }
341 
parseFrom(byte[] data)342   public static com.google.cloud.compute.v1.HttpRetryPolicy parseFrom(byte[] data)
343       throws com.google.protobuf.InvalidProtocolBufferException {
344     return PARSER.parseFrom(data);
345   }
346 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)347   public static com.google.cloud.compute.v1.HttpRetryPolicy parseFrom(
348       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
349       throws com.google.protobuf.InvalidProtocolBufferException {
350     return PARSER.parseFrom(data, extensionRegistry);
351   }
352 
parseFrom(java.io.InputStream input)353   public static com.google.cloud.compute.v1.HttpRetryPolicy parseFrom(java.io.InputStream input)
354       throws java.io.IOException {
355     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
356   }
357 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)358   public static com.google.cloud.compute.v1.HttpRetryPolicy parseFrom(
359       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
360       throws java.io.IOException {
361     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
362         PARSER, input, extensionRegistry);
363   }
364 
parseDelimitedFrom( java.io.InputStream input)365   public static com.google.cloud.compute.v1.HttpRetryPolicy parseDelimitedFrom(
366       java.io.InputStream input) throws java.io.IOException {
367     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
368   }
369 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)370   public static com.google.cloud.compute.v1.HttpRetryPolicy parseDelimitedFrom(
371       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
372       throws java.io.IOException {
373     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
374         PARSER, input, extensionRegistry);
375   }
376 
parseFrom( com.google.protobuf.CodedInputStream input)377   public static com.google.cloud.compute.v1.HttpRetryPolicy parseFrom(
378       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
379     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
380   }
381 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)382   public static com.google.cloud.compute.v1.HttpRetryPolicy parseFrom(
383       com.google.protobuf.CodedInputStream input,
384       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
385       throws java.io.IOException {
386     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
387         PARSER, input, extensionRegistry);
388   }
389 
390   @java.lang.Override
newBuilderForType()391   public Builder newBuilderForType() {
392     return newBuilder();
393   }
394 
newBuilder()395   public static Builder newBuilder() {
396     return DEFAULT_INSTANCE.toBuilder();
397   }
398 
newBuilder(com.google.cloud.compute.v1.HttpRetryPolicy prototype)399   public static Builder newBuilder(com.google.cloud.compute.v1.HttpRetryPolicy prototype) {
400     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
401   }
402 
403   @java.lang.Override
toBuilder()404   public Builder toBuilder() {
405     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
406   }
407 
408   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)409   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
410     Builder builder = new Builder(parent);
411     return builder;
412   }
413   /**
414    *
415    *
416    * <pre>
417    * The retry policy associates with HttpRouteRule
418    * </pre>
419    *
420    * Protobuf type {@code google.cloud.compute.v1.HttpRetryPolicy}
421    */
422   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
423       implements
424       // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.HttpRetryPolicy)
425       com.google.cloud.compute.v1.HttpRetryPolicyOrBuilder {
getDescriptor()426     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
427       return com.google.cloud.compute.v1.Compute
428           .internal_static_google_cloud_compute_v1_HttpRetryPolicy_descriptor;
429     }
430 
431     @java.lang.Override
432     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()433         internalGetFieldAccessorTable() {
434       return com.google.cloud.compute.v1.Compute
435           .internal_static_google_cloud_compute_v1_HttpRetryPolicy_fieldAccessorTable
436           .ensureFieldAccessorsInitialized(
437               com.google.cloud.compute.v1.HttpRetryPolicy.class,
438               com.google.cloud.compute.v1.HttpRetryPolicy.Builder.class);
439     }
440 
441     // Construct using com.google.cloud.compute.v1.HttpRetryPolicy.newBuilder()
Builder()442     private Builder() {
443       maybeForceBuilderInitialization();
444     }
445 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)446     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
447       super(parent);
448       maybeForceBuilderInitialization();
449     }
450 
maybeForceBuilderInitialization()451     private void maybeForceBuilderInitialization() {
452       if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
453         getPerTryTimeoutFieldBuilder();
454       }
455     }
456 
457     @java.lang.Override
clear()458     public Builder clear() {
459       super.clear();
460       bitField0_ = 0;
461       numRetries_ = 0;
462       perTryTimeout_ = null;
463       if (perTryTimeoutBuilder_ != null) {
464         perTryTimeoutBuilder_.dispose();
465         perTryTimeoutBuilder_ = null;
466       }
467       retryConditions_ = com.google.protobuf.LazyStringArrayList.EMPTY;
468       bitField0_ = (bitField0_ & ~0x00000004);
469       return this;
470     }
471 
472     @java.lang.Override
getDescriptorForType()473     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
474       return com.google.cloud.compute.v1.Compute
475           .internal_static_google_cloud_compute_v1_HttpRetryPolicy_descriptor;
476     }
477 
478     @java.lang.Override
getDefaultInstanceForType()479     public com.google.cloud.compute.v1.HttpRetryPolicy getDefaultInstanceForType() {
480       return com.google.cloud.compute.v1.HttpRetryPolicy.getDefaultInstance();
481     }
482 
483     @java.lang.Override
build()484     public com.google.cloud.compute.v1.HttpRetryPolicy build() {
485       com.google.cloud.compute.v1.HttpRetryPolicy result = buildPartial();
486       if (!result.isInitialized()) {
487         throw newUninitializedMessageException(result);
488       }
489       return result;
490     }
491 
492     @java.lang.Override
buildPartial()493     public com.google.cloud.compute.v1.HttpRetryPolicy buildPartial() {
494       com.google.cloud.compute.v1.HttpRetryPolicy result =
495           new com.google.cloud.compute.v1.HttpRetryPolicy(this);
496       buildPartialRepeatedFields(result);
497       if (bitField0_ != 0) {
498         buildPartial0(result);
499       }
500       onBuilt();
501       return result;
502     }
503 
buildPartialRepeatedFields(com.google.cloud.compute.v1.HttpRetryPolicy result)504     private void buildPartialRepeatedFields(com.google.cloud.compute.v1.HttpRetryPolicy result) {
505       if (((bitField0_ & 0x00000004) != 0)) {
506         retryConditions_ = retryConditions_.getUnmodifiableView();
507         bitField0_ = (bitField0_ & ~0x00000004);
508       }
509       result.retryConditions_ = retryConditions_;
510     }
511 
buildPartial0(com.google.cloud.compute.v1.HttpRetryPolicy result)512     private void buildPartial0(com.google.cloud.compute.v1.HttpRetryPolicy result) {
513       int from_bitField0_ = bitField0_;
514       int to_bitField0_ = 0;
515       if (((from_bitField0_ & 0x00000001) != 0)) {
516         result.numRetries_ = numRetries_;
517         to_bitField0_ |= 0x00000001;
518       }
519       if (((from_bitField0_ & 0x00000002) != 0)) {
520         result.perTryTimeout_ =
521             perTryTimeoutBuilder_ == null ? perTryTimeout_ : perTryTimeoutBuilder_.build();
522         to_bitField0_ |= 0x00000002;
523       }
524       result.bitField0_ |= to_bitField0_;
525     }
526 
527     @java.lang.Override
clone()528     public Builder clone() {
529       return super.clone();
530     }
531 
532     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)533     public Builder setField(
534         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
535       return super.setField(field, value);
536     }
537 
538     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)539     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
540       return super.clearField(field);
541     }
542 
543     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)544     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
545       return super.clearOneof(oneof);
546     }
547 
548     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)549     public Builder setRepeatedField(
550         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
551       return super.setRepeatedField(field, index, value);
552     }
553 
554     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)555     public Builder addRepeatedField(
556         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
557       return super.addRepeatedField(field, value);
558     }
559 
560     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)561     public Builder mergeFrom(com.google.protobuf.Message other) {
562       if (other instanceof com.google.cloud.compute.v1.HttpRetryPolicy) {
563         return mergeFrom((com.google.cloud.compute.v1.HttpRetryPolicy) other);
564       } else {
565         super.mergeFrom(other);
566         return this;
567       }
568     }
569 
mergeFrom(com.google.cloud.compute.v1.HttpRetryPolicy other)570     public Builder mergeFrom(com.google.cloud.compute.v1.HttpRetryPolicy other) {
571       if (other == com.google.cloud.compute.v1.HttpRetryPolicy.getDefaultInstance()) return this;
572       if (other.hasNumRetries()) {
573         setNumRetries(other.getNumRetries());
574       }
575       if (other.hasPerTryTimeout()) {
576         mergePerTryTimeout(other.getPerTryTimeout());
577       }
578       if (!other.retryConditions_.isEmpty()) {
579         if (retryConditions_.isEmpty()) {
580           retryConditions_ = other.retryConditions_;
581           bitField0_ = (bitField0_ & ~0x00000004);
582         } else {
583           ensureRetryConditionsIsMutable();
584           retryConditions_.addAll(other.retryConditions_);
585         }
586         onChanged();
587       }
588       this.mergeUnknownFields(other.getUnknownFields());
589       onChanged();
590       return this;
591     }
592 
593     @java.lang.Override
isInitialized()594     public final boolean isInitialized() {
595       return true;
596     }
597 
598     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)599     public Builder mergeFrom(
600         com.google.protobuf.CodedInputStream input,
601         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
602         throws java.io.IOException {
603       if (extensionRegistry == null) {
604         throw new java.lang.NullPointerException();
605       }
606       try {
607         boolean done = false;
608         while (!done) {
609           int tag = input.readTag();
610           switch (tag) {
611             case 0:
612               done = true;
613               break;
614             case 230524282:
615               {
616                 java.lang.String s = input.readStringRequireUtf8();
617                 ensureRetryConditionsIsMutable();
618                 retryConditions_.add(s);
619                 break;
620               } // case 230524282
621             case 2013441128:
622               {
623                 numRetries_ = input.readUInt32();
624                 bitField0_ |= 0x00000001;
625                 break;
626               } // case 2013441128
627             case -2054638118:
628               {
629                 input.readMessage(getPerTryTimeoutFieldBuilder().getBuilder(), extensionRegistry);
630                 bitField0_ |= 0x00000002;
631                 break;
632               } // case -2054638118
633             default:
634               {
635                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
636                   done = true; // was an endgroup tag
637                 }
638                 break;
639               } // default:
640           } // switch (tag)
641         } // while (!done)
642       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
643         throw e.unwrapIOException();
644       } finally {
645         onChanged();
646       } // finally
647       return this;
648     }
649 
650     private int bitField0_;
651 
652     private int numRetries_;
653     /**
654      *
655      *
656      * <pre>
657      * Specifies the allowed number retries. This number must be &gt; 0. If not specified, defaults to 1.
658      * </pre>
659      *
660      * <code>optional uint32 num_retries = 251680141;</code>
661      *
662      * @return Whether the numRetries field is set.
663      */
664     @java.lang.Override
hasNumRetries()665     public boolean hasNumRetries() {
666       return ((bitField0_ & 0x00000001) != 0);
667     }
668     /**
669      *
670      *
671      * <pre>
672      * Specifies the allowed number retries. This number must be &gt; 0. If not specified, defaults to 1.
673      * </pre>
674      *
675      * <code>optional uint32 num_retries = 251680141;</code>
676      *
677      * @return The numRetries.
678      */
679     @java.lang.Override
getNumRetries()680     public int getNumRetries() {
681       return numRetries_;
682     }
683     /**
684      *
685      *
686      * <pre>
687      * Specifies the allowed number retries. This number must be &gt; 0. If not specified, defaults to 1.
688      * </pre>
689      *
690      * <code>optional uint32 num_retries = 251680141;</code>
691      *
692      * @param value The numRetries to set.
693      * @return This builder for chaining.
694      */
setNumRetries(int value)695     public Builder setNumRetries(int value) {
696 
697       numRetries_ = value;
698       bitField0_ |= 0x00000001;
699       onChanged();
700       return this;
701     }
702     /**
703      *
704      *
705      * <pre>
706      * Specifies the allowed number retries. This number must be &gt; 0. If not specified, defaults to 1.
707      * </pre>
708      *
709      * <code>optional uint32 num_retries = 251680141;</code>
710      *
711      * @return This builder for chaining.
712      */
clearNumRetries()713     public Builder clearNumRetries() {
714       bitField0_ = (bitField0_ & ~0x00000001);
715       numRetries_ = 0;
716       onChanged();
717       return this;
718     }
719 
720     private com.google.cloud.compute.v1.Duration perTryTimeout_;
721     private com.google.protobuf.SingleFieldBuilderV3<
722             com.google.cloud.compute.v1.Duration,
723             com.google.cloud.compute.v1.Duration.Builder,
724             com.google.cloud.compute.v1.DurationOrBuilder>
725         perTryTimeoutBuilder_;
726     /**
727      *
728      *
729      * <pre>
730      * Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.
731      * </pre>
732      *
733      * <code>optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;</code>
734      *
735      * @return Whether the perTryTimeout field is set.
736      */
hasPerTryTimeout()737     public boolean hasPerTryTimeout() {
738       return ((bitField0_ & 0x00000002) != 0);
739     }
740     /**
741      *
742      *
743      * <pre>
744      * Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.
745      * </pre>
746      *
747      * <code>optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;</code>
748      *
749      * @return The perTryTimeout.
750      */
getPerTryTimeout()751     public com.google.cloud.compute.v1.Duration getPerTryTimeout() {
752       if (perTryTimeoutBuilder_ == null) {
753         return perTryTimeout_ == null
754             ? com.google.cloud.compute.v1.Duration.getDefaultInstance()
755             : perTryTimeout_;
756       } else {
757         return perTryTimeoutBuilder_.getMessage();
758       }
759     }
760     /**
761      *
762      *
763      * <pre>
764      * Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.
765      * </pre>
766      *
767      * <code>optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;</code>
768      */
setPerTryTimeout(com.google.cloud.compute.v1.Duration value)769     public Builder setPerTryTimeout(com.google.cloud.compute.v1.Duration value) {
770       if (perTryTimeoutBuilder_ == null) {
771         if (value == null) {
772           throw new NullPointerException();
773         }
774         perTryTimeout_ = value;
775       } else {
776         perTryTimeoutBuilder_.setMessage(value);
777       }
778       bitField0_ |= 0x00000002;
779       onChanged();
780       return this;
781     }
782     /**
783      *
784      *
785      * <pre>
786      * Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.
787      * </pre>
788      *
789      * <code>optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;</code>
790      */
setPerTryTimeout(com.google.cloud.compute.v1.Duration.Builder builderForValue)791     public Builder setPerTryTimeout(com.google.cloud.compute.v1.Duration.Builder builderForValue) {
792       if (perTryTimeoutBuilder_ == null) {
793         perTryTimeout_ = builderForValue.build();
794       } else {
795         perTryTimeoutBuilder_.setMessage(builderForValue.build());
796       }
797       bitField0_ |= 0x00000002;
798       onChanged();
799       return this;
800     }
801     /**
802      *
803      *
804      * <pre>
805      * Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.
806      * </pre>
807      *
808      * <code>optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;</code>
809      */
mergePerTryTimeout(com.google.cloud.compute.v1.Duration value)810     public Builder mergePerTryTimeout(com.google.cloud.compute.v1.Duration value) {
811       if (perTryTimeoutBuilder_ == null) {
812         if (((bitField0_ & 0x00000002) != 0)
813             && perTryTimeout_ != null
814             && perTryTimeout_ != com.google.cloud.compute.v1.Duration.getDefaultInstance()) {
815           getPerTryTimeoutBuilder().mergeFrom(value);
816         } else {
817           perTryTimeout_ = value;
818         }
819       } else {
820         perTryTimeoutBuilder_.mergeFrom(value);
821       }
822       bitField0_ |= 0x00000002;
823       onChanged();
824       return this;
825     }
826     /**
827      *
828      *
829      * <pre>
830      * Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.
831      * </pre>
832      *
833      * <code>optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;</code>
834      */
clearPerTryTimeout()835     public Builder clearPerTryTimeout() {
836       bitField0_ = (bitField0_ & ~0x00000002);
837       perTryTimeout_ = null;
838       if (perTryTimeoutBuilder_ != null) {
839         perTryTimeoutBuilder_.dispose();
840         perTryTimeoutBuilder_ = null;
841       }
842       onChanged();
843       return this;
844     }
845     /**
846      *
847      *
848      * <pre>
849      * Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.
850      * </pre>
851      *
852      * <code>optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;</code>
853      */
getPerTryTimeoutBuilder()854     public com.google.cloud.compute.v1.Duration.Builder getPerTryTimeoutBuilder() {
855       bitField0_ |= 0x00000002;
856       onChanged();
857       return getPerTryTimeoutFieldBuilder().getBuilder();
858     }
859     /**
860      *
861      *
862      * <pre>
863      * Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.
864      * </pre>
865      *
866      * <code>optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;</code>
867      */
getPerTryTimeoutOrBuilder()868     public com.google.cloud.compute.v1.DurationOrBuilder getPerTryTimeoutOrBuilder() {
869       if (perTryTimeoutBuilder_ != null) {
870         return perTryTimeoutBuilder_.getMessageOrBuilder();
871       } else {
872         return perTryTimeout_ == null
873             ? com.google.cloud.compute.v1.Duration.getDefaultInstance()
874             : perTryTimeout_;
875       }
876     }
877     /**
878      *
879      *
880      * <pre>
881      * Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.
882      * </pre>
883      *
884      * <code>optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147;</code>
885      */
886     private com.google.protobuf.SingleFieldBuilderV3<
887             com.google.cloud.compute.v1.Duration,
888             com.google.cloud.compute.v1.Duration.Builder,
889             com.google.cloud.compute.v1.DurationOrBuilder>
getPerTryTimeoutFieldBuilder()890         getPerTryTimeoutFieldBuilder() {
891       if (perTryTimeoutBuilder_ == null) {
892         perTryTimeoutBuilder_ =
893             new com.google.protobuf.SingleFieldBuilderV3<
894                 com.google.cloud.compute.v1.Duration,
895                 com.google.cloud.compute.v1.Duration.Builder,
896                 com.google.cloud.compute.v1.DurationOrBuilder>(
897                 getPerTryTimeout(), getParentForChildren(), isClean());
898         perTryTimeout_ = null;
899       }
900       return perTryTimeoutBuilder_;
901     }
902 
903     private com.google.protobuf.LazyStringList retryConditions_ =
904         com.google.protobuf.LazyStringArrayList.EMPTY;
905 
ensureRetryConditionsIsMutable()906     private void ensureRetryConditionsIsMutable() {
907       if (!((bitField0_ & 0x00000004) != 0)) {
908         retryConditions_ = new com.google.protobuf.LazyStringArrayList(retryConditions_);
909         bitField0_ |= 0x00000004;
910       }
911     }
912     /**
913      *
914      *
915      * <pre>
916      * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable
917      * </pre>
918      *
919      * <code>repeated string retry_conditions = 28815535;</code>
920      *
921      * @return A list containing the retryConditions.
922      */
getRetryConditionsList()923     public com.google.protobuf.ProtocolStringList getRetryConditionsList() {
924       return retryConditions_.getUnmodifiableView();
925     }
926     /**
927      *
928      *
929      * <pre>
930      * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable
931      * </pre>
932      *
933      * <code>repeated string retry_conditions = 28815535;</code>
934      *
935      * @return The count of retryConditions.
936      */
getRetryConditionsCount()937     public int getRetryConditionsCount() {
938       return retryConditions_.size();
939     }
940     /**
941      *
942      *
943      * <pre>
944      * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable
945      * </pre>
946      *
947      * <code>repeated string retry_conditions = 28815535;</code>
948      *
949      * @param index The index of the element to return.
950      * @return The retryConditions at the given index.
951      */
getRetryConditions(int index)952     public java.lang.String getRetryConditions(int index) {
953       return retryConditions_.get(index);
954     }
955     /**
956      *
957      *
958      * <pre>
959      * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable
960      * </pre>
961      *
962      * <code>repeated string retry_conditions = 28815535;</code>
963      *
964      * @param index The index of the value to return.
965      * @return The bytes of the retryConditions at the given index.
966      */
getRetryConditionsBytes(int index)967     public com.google.protobuf.ByteString getRetryConditionsBytes(int index) {
968       return retryConditions_.getByteString(index);
969     }
970     /**
971      *
972      *
973      * <pre>
974      * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable
975      * </pre>
976      *
977      * <code>repeated string retry_conditions = 28815535;</code>
978      *
979      * @param index The index to set the value at.
980      * @param value The retryConditions to set.
981      * @return This builder for chaining.
982      */
setRetryConditions(int index, java.lang.String value)983     public Builder setRetryConditions(int index, java.lang.String value) {
984       if (value == null) {
985         throw new NullPointerException();
986       }
987       ensureRetryConditionsIsMutable();
988       retryConditions_.set(index, value);
989       onChanged();
990       return this;
991     }
992     /**
993      *
994      *
995      * <pre>
996      * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable
997      * </pre>
998      *
999      * <code>repeated string retry_conditions = 28815535;</code>
1000      *
1001      * @param value The retryConditions to add.
1002      * @return This builder for chaining.
1003      */
addRetryConditions(java.lang.String value)1004     public Builder addRetryConditions(java.lang.String value) {
1005       if (value == null) {
1006         throw new NullPointerException();
1007       }
1008       ensureRetryConditionsIsMutable();
1009       retryConditions_.add(value);
1010       onChanged();
1011       return this;
1012     }
1013     /**
1014      *
1015      *
1016      * <pre>
1017      * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable
1018      * </pre>
1019      *
1020      * <code>repeated string retry_conditions = 28815535;</code>
1021      *
1022      * @param values The retryConditions to add.
1023      * @return This builder for chaining.
1024      */
addAllRetryConditions(java.lang.Iterable<java.lang.String> values)1025     public Builder addAllRetryConditions(java.lang.Iterable<java.lang.String> values) {
1026       ensureRetryConditionsIsMutable();
1027       com.google.protobuf.AbstractMessageLite.Builder.addAll(values, retryConditions_);
1028       onChanged();
1029       return this;
1030     }
1031     /**
1032      *
1033      *
1034      * <pre>
1035      * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable
1036      * </pre>
1037      *
1038      * <code>repeated string retry_conditions = 28815535;</code>
1039      *
1040      * @return This builder for chaining.
1041      */
clearRetryConditions()1042     public Builder clearRetryConditions() {
1043       retryConditions_ = com.google.protobuf.LazyStringArrayList.EMPTY;
1044       bitField0_ = (bitField0_ & ~0x00000004);
1045       onChanged();
1046       return this;
1047     }
1048     /**
1049      *
1050      *
1051      * <pre>
1052      * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable
1053      * </pre>
1054      *
1055      * <code>repeated string retry_conditions = 28815535;</code>
1056      *
1057      * @param value The bytes of the retryConditions to add.
1058      * @return This builder for chaining.
1059      */
addRetryConditionsBytes(com.google.protobuf.ByteString value)1060     public Builder addRetryConditionsBytes(com.google.protobuf.ByteString value) {
1061       if (value == null) {
1062         throw new NullPointerException();
1063       }
1064       checkByteStringIsUtf8(value);
1065       ensureRetryConditionsIsMutable();
1066       retryConditions_.add(value);
1067       onChanged();
1068       return this;
1069     }
1070 
1071     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1072     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1073       return super.setUnknownFields(unknownFields);
1074     }
1075 
1076     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1077     public final Builder mergeUnknownFields(
1078         final com.google.protobuf.UnknownFieldSet unknownFields) {
1079       return super.mergeUnknownFields(unknownFields);
1080     }
1081 
1082     // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.HttpRetryPolicy)
1083   }
1084 
1085   // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.HttpRetryPolicy)
1086   private static final com.google.cloud.compute.v1.HttpRetryPolicy DEFAULT_INSTANCE;
1087 
1088   static {
1089     DEFAULT_INSTANCE = new com.google.cloud.compute.v1.HttpRetryPolicy();
1090   }
1091 
getDefaultInstance()1092   public static com.google.cloud.compute.v1.HttpRetryPolicy getDefaultInstance() {
1093     return DEFAULT_INSTANCE;
1094   }
1095 
1096   private static final com.google.protobuf.Parser<HttpRetryPolicy> PARSER =
1097       new com.google.protobuf.AbstractParser<HttpRetryPolicy>() {
1098         @java.lang.Override
1099         public HttpRetryPolicy parsePartialFrom(
1100             com.google.protobuf.CodedInputStream input,
1101             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1102             throws com.google.protobuf.InvalidProtocolBufferException {
1103           Builder builder = newBuilder();
1104           try {
1105             builder.mergeFrom(input, extensionRegistry);
1106           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1107             throw e.setUnfinishedMessage(builder.buildPartial());
1108           } catch (com.google.protobuf.UninitializedMessageException e) {
1109             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1110           } catch (java.io.IOException e) {
1111             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1112                 .setUnfinishedMessage(builder.buildPartial());
1113           }
1114           return builder.buildPartial();
1115         }
1116       };
1117 
parser()1118   public static com.google.protobuf.Parser<HttpRetryPolicy> parser() {
1119     return PARSER;
1120   }
1121 
1122   @java.lang.Override
getParserForType()1123   public com.google.protobuf.Parser<HttpRetryPolicy> getParserForType() {
1124     return PARSER;
1125   }
1126 
1127   @java.lang.Override
getDefaultInstanceForType()1128   public com.google.cloud.compute.v1.HttpRetryPolicy getDefaultInstanceForType() {
1129     return DEFAULT_INSTANCE;
1130   }
1131 }
1132