• 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  * A path-matching rule for a URL. If matched, will use the specified BackendService to handle the traffic arriving at this URL.
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.compute.v1.PathRule}
29  */
30 public final class PathRule extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.PathRule)
33     PathRuleOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use PathRule.newBuilder() to construct.
PathRule(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private PathRule(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
PathRule()40   private PathRule() {
41     paths_ = com.google.protobuf.LazyStringArrayList.EMPTY;
42     service_ = "";
43   }
44 
45   @java.lang.Override
46   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)47   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
48     return new PathRule();
49   }
50 
51   @java.lang.Override
getUnknownFields()52   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
53     return this.unknownFields;
54   }
55 
getDescriptor()56   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
57     return com.google.cloud.compute.v1.Compute
58         .internal_static_google_cloud_compute_v1_PathRule_descriptor;
59   }
60 
61   @java.lang.Override
62   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()63       internalGetFieldAccessorTable() {
64     return com.google.cloud.compute.v1.Compute
65         .internal_static_google_cloud_compute_v1_PathRule_fieldAccessorTable
66         .ensureFieldAccessorsInitialized(
67             com.google.cloud.compute.v1.PathRule.class,
68             com.google.cloud.compute.v1.PathRule.Builder.class);
69   }
70 
71   private int bitField0_;
72   public static final int PATHS_FIELD_NUMBER = 106438894;
73 
74   @SuppressWarnings("serial")
75   private com.google.protobuf.LazyStringList paths_;
76   /**
77    *
78    *
79    * <pre>
80    * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.
81    * </pre>
82    *
83    * <code>repeated string paths = 106438894;</code>
84    *
85    * @return A list containing the paths.
86    */
getPathsList()87   public com.google.protobuf.ProtocolStringList getPathsList() {
88     return paths_;
89   }
90   /**
91    *
92    *
93    * <pre>
94    * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.
95    * </pre>
96    *
97    * <code>repeated string paths = 106438894;</code>
98    *
99    * @return The count of paths.
100    */
getPathsCount()101   public int getPathsCount() {
102     return paths_.size();
103   }
104   /**
105    *
106    *
107    * <pre>
108    * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.
109    * </pre>
110    *
111    * <code>repeated string paths = 106438894;</code>
112    *
113    * @param index The index of the element to return.
114    * @return The paths at the given index.
115    */
getPaths(int index)116   public java.lang.String getPaths(int index) {
117     return paths_.get(index);
118   }
119   /**
120    *
121    *
122    * <pre>
123    * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.
124    * </pre>
125    *
126    * <code>repeated string paths = 106438894;</code>
127    *
128    * @param index The index of the value to return.
129    * @return The bytes of the paths at the given index.
130    */
getPathsBytes(int index)131   public com.google.protobuf.ByteString getPathsBytes(int index) {
132     return paths_.getByteString(index);
133   }
134 
135   public static final int ROUTE_ACTION_FIELD_NUMBER = 424563948;
136   private com.google.cloud.compute.v1.HttpRouteAction routeAction_;
137   /**
138    *
139    *
140    * <pre>
141    * In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within a path rule's routeAction.
142    * </pre>
143    *
144    * <code>optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;</code>
145    *
146    * @return Whether the routeAction field is set.
147    */
148   @java.lang.Override
hasRouteAction()149   public boolean hasRouteAction() {
150     return ((bitField0_ & 0x00000001) != 0);
151   }
152   /**
153    *
154    *
155    * <pre>
156    * In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within a path rule's routeAction.
157    * </pre>
158    *
159    * <code>optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;</code>
160    *
161    * @return The routeAction.
162    */
163   @java.lang.Override
getRouteAction()164   public com.google.cloud.compute.v1.HttpRouteAction getRouteAction() {
165     return routeAction_ == null
166         ? com.google.cloud.compute.v1.HttpRouteAction.getDefaultInstance()
167         : routeAction_;
168   }
169   /**
170    *
171    *
172    * <pre>
173    * In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within a path rule's routeAction.
174    * </pre>
175    *
176    * <code>optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;</code>
177    */
178   @java.lang.Override
getRouteActionOrBuilder()179   public com.google.cloud.compute.v1.HttpRouteActionOrBuilder getRouteActionOrBuilder() {
180     return routeAction_ == null
181         ? com.google.cloud.compute.v1.HttpRouteAction.getDefaultInstance()
182         : routeAction_;
183   }
184 
185   public static final int SERVICE_FIELD_NUMBER = 373540533;
186 
187   @SuppressWarnings("serial")
188   private volatile java.lang.Object service_ = "";
189   /**
190    *
191    *
192    * <pre>
193    * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.
194    * </pre>
195    *
196    * <code>optional string service = 373540533;</code>
197    *
198    * @return Whether the service field is set.
199    */
200   @java.lang.Override
hasService()201   public boolean hasService() {
202     return ((bitField0_ & 0x00000002) != 0);
203   }
204   /**
205    *
206    *
207    * <pre>
208    * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.
209    * </pre>
210    *
211    * <code>optional string service = 373540533;</code>
212    *
213    * @return The service.
214    */
215   @java.lang.Override
getService()216   public java.lang.String getService() {
217     java.lang.Object ref = service_;
218     if (ref instanceof java.lang.String) {
219       return (java.lang.String) ref;
220     } else {
221       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
222       java.lang.String s = bs.toStringUtf8();
223       service_ = s;
224       return s;
225     }
226   }
227   /**
228    *
229    *
230    * <pre>
231    * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.
232    * </pre>
233    *
234    * <code>optional string service = 373540533;</code>
235    *
236    * @return The bytes for service.
237    */
238   @java.lang.Override
getServiceBytes()239   public com.google.protobuf.ByteString getServiceBytes() {
240     java.lang.Object ref = service_;
241     if (ref instanceof java.lang.String) {
242       com.google.protobuf.ByteString b =
243           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
244       service_ = b;
245       return b;
246     } else {
247       return (com.google.protobuf.ByteString) ref;
248     }
249   }
250 
251   public static final int URL_REDIRECT_FIELD_NUMBER = 405147820;
252   private com.google.cloud.compute.v1.HttpRedirectAction urlRedirect_;
253   /**
254    *
255    *
256    * <pre>
257    * When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.
258    * </pre>
259    *
260    * <code>optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;</code>
261    *
262    * @return Whether the urlRedirect field is set.
263    */
264   @java.lang.Override
hasUrlRedirect()265   public boolean hasUrlRedirect() {
266     return ((bitField0_ & 0x00000004) != 0);
267   }
268   /**
269    *
270    *
271    * <pre>
272    * When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.
273    * </pre>
274    *
275    * <code>optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;</code>
276    *
277    * @return The urlRedirect.
278    */
279   @java.lang.Override
getUrlRedirect()280   public com.google.cloud.compute.v1.HttpRedirectAction getUrlRedirect() {
281     return urlRedirect_ == null
282         ? com.google.cloud.compute.v1.HttpRedirectAction.getDefaultInstance()
283         : urlRedirect_;
284   }
285   /**
286    *
287    *
288    * <pre>
289    * When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.
290    * </pre>
291    *
292    * <code>optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;</code>
293    */
294   @java.lang.Override
getUrlRedirectOrBuilder()295   public com.google.cloud.compute.v1.HttpRedirectActionOrBuilder getUrlRedirectOrBuilder() {
296     return urlRedirect_ == null
297         ? com.google.cloud.compute.v1.HttpRedirectAction.getDefaultInstance()
298         : urlRedirect_;
299   }
300 
301   private byte memoizedIsInitialized = -1;
302 
303   @java.lang.Override
isInitialized()304   public final boolean isInitialized() {
305     byte isInitialized = memoizedIsInitialized;
306     if (isInitialized == 1) return true;
307     if (isInitialized == 0) return false;
308 
309     memoizedIsInitialized = 1;
310     return true;
311   }
312 
313   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)314   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
315     for (int i = 0; i < paths_.size(); i++) {
316       com.google.protobuf.GeneratedMessageV3.writeString(output, 106438894, paths_.getRaw(i));
317     }
318     if (((bitField0_ & 0x00000002) != 0)) {
319       com.google.protobuf.GeneratedMessageV3.writeString(output, 373540533, service_);
320     }
321     if (((bitField0_ & 0x00000004) != 0)) {
322       output.writeMessage(405147820, getUrlRedirect());
323     }
324     if (((bitField0_ & 0x00000001) != 0)) {
325       output.writeMessage(424563948, getRouteAction());
326     }
327     getUnknownFields().writeTo(output);
328   }
329 
330   @java.lang.Override
getSerializedSize()331   public int getSerializedSize() {
332     int size = memoizedSize;
333     if (size != -1) return size;
334 
335     size = 0;
336     {
337       int dataSize = 0;
338       for (int i = 0; i < paths_.size(); i++) {
339         dataSize += computeStringSizeNoTag(paths_.getRaw(i));
340       }
341       size += dataSize;
342       size += 5 * getPathsList().size();
343     }
344     if (((bitField0_ & 0x00000002) != 0)) {
345       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(373540533, service_);
346     }
347     if (((bitField0_ & 0x00000004) != 0)) {
348       size += com.google.protobuf.CodedOutputStream.computeMessageSize(405147820, getUrlRedirect());
349     }
350     if (((bitField0_ & 0x00000001) != 0)) {
351       size += com.google.protobuf.CodedOutputStream.computeMessageSize(424563948, getRouteAction());
352     }
353     size += getUnknownFields().getSerializedSize();
354     memoizedSize = size;
355     return size;
356   }
357 
358   @java.lang.Override
equals(final java.lang.Object obj)359   public boolean equals(final java.lang.Object obj) {
360     if (obj == this) {
361       return true;
362     }
363     if (!(obj instanceof com.google.cloud.compute.v1.PathRule)) {
364       return super.equals(obj);
365     }
366     com.google.cloud.compute.v1.PathRule other = (com.google.cloud.compute.v1.PathRule) obj;
367 
368     if (!getPathsList().equals(other.getPathsList())) return false;
369     if (hasRouteAction() != other.hasRouteAction()) return false;
370     if (hasRouteAction()) {
371       if (!getRouteAction().equals(other.getRouteAction())) return false;
372     }
373     if (hasService() != other.hasService()) return false;
374     if (hasService()) {
375       if (!getService().equals(other.getService())) return false;
376     }
377     if (hasUrlRedirect() != other.hasUrlRedirect()) return false;
378     if (hasUrlRedirect()) {
379       if (!getUrlRedirect().equals(other.getUrlRedirect())) return false;
380     }
381     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
382     return true;
383   }
384 
385   @java.lang.Override
hashCode()386   public int hashCode() {
387     if (memoizedHashCode != 0) {
388       return memoizedHashCode;
389     }
390     int hash = 41;
391     hash = (19 * hash) + getDescriptor().hashCode();
392     if (getPathsCount() > 0) {
393       hash = (37 * hash) + PATHS_FIELD_NUMBER;
394       hash = (53 * hash) + getPathsList().hashCode();
395     }
396     if (hasRouteAction()) {
397       hash = (37 * hash) + ROUTE_ACTION_FIELD_NUMBER;
398       hash = (53 * hash) + getRouteAction().hashCode();
399     }
400     if (hasService()) {
401       hash = (37 * hash) + SERVICE_FIELD_NUMBER;
402       hash = (53 * hash) + getService().hashCode();
403     }
404     if (hasUrlRedirect()) {
405       hash = (37 * hash) + URL_REDIRECT_FIELD_NUMBER;
406       hash = (53 * hash) + getUrlRedirect().hashCode();
407     }
408     hash = (29 * hash) + getUnknownFields().hashCode();
409     memoizedHashCode = hash;
410     return hash;
411   }
412 
parseFrom(java.nio.ByteBuffer data)413   public static com.google.cloud.compute.v1.PathRule parseFrom(java.nio.ByteBuffer data)
414       throws com.google.protobuf.InvalidProtocolBufferException {
415     return PARSER.parseFrom(data);
416   }
417 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)418   public static com.google.cloud.compute.v1.PathRule parseFrom(
419       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
420       throws com.google.protobuf.InvalidProtocolBufferException {
421     return PARSER.parseFrom(data, extensionRegistry);
422   }
423 
parseFrom(com.google.protobuf.ByteString data)424   public static com.google.cloud.compute.v1.PathRule parseFrom(com.google.protobuf.ByteString data)
425       throws com.google.protobuf.InvalidProtocolBufferException {
426     return PARSER.parseFrom(data);
427   }
428 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)429   public static com.google.cloud.compute.v1.PathRule parseFrom(
430       com.google.protobuf.ByteString data,
431       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
432       throws com.google.protobuf.InvalidProtocolBufferException {
433     return PARSER.parseFrom(data, extensionRegistry);
434   }
435 
parseFrom(byte[] data)436   public static com.google.cloud.compute.v1.PathRule parseFrom(byte[] data)
437       throws com.google.protobuf.InvalidProtocolBufferException {
438     return PARSER.parseFrom(data);
439   }
440 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)441   public static com.google.cloud.compute.v1.PathRule parseFrom(
442       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
443       throws com.google.protobuf.InvalidProtocolBufferException {
444     return PARSER.parseFrom(data, extensionRegistry);
445   }
446 
parseFrom(java.io.InputStream input)447   public static com.google.cloud.compute.v1.PathRule parseFrom(java.io.InputStream input)
448       throws java.io.IOException {
449     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
450   }
451 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)452   public static com.google.cloud.compute.v1.PathRule parseFrom(
453       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
454       throws java.io.IOException {
455     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
456         PARSER, input, extensionRegistry);
457   }
458 
parseDelimitedFrom(java.io.InputStream input)459   public static com.google.cloud.compute.v1.PathRule parseDelimitedFrom(java.io.InputStream input)
460       throws java.io.IOException {
461     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
462   }
463 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)464   public static com.google.cloud.compute.v1.PathRule parseDelimitedFrom(
465       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
466       throws java.io.IOException {
467     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
468         PARSER, input, extensionRegistry);
469   }
470 
parseFrom( com.google.protobuf.CodedInputStream input)471   public static com.google.cloud.compute.v1.PathRule parseFrom(
472       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
473     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
474   }
475 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)476   public static com.google.cloud.compute.v1.PathRule parseFrom(
477       com.google.protobuf.CodedInputStream input,
478       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
479       throws java.io.IOException {
480     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
481         PARSER, input, extensionRegistry);
482   }
483 
484   @java.lang.Override
newBuilderForType()485   public Builder newBuilderForType() {
486     return newBuilder();
487   }
488 
newBuilder()489   public static Builder newBuilder() {
490     return DEFAULT_INSTANCE.toBuilder();
491   }
492 
newBuilder(com.google.cloud.compute.v1.PathRule prototype)493   public static Builder newBuilder(com.google.cloud.compute.v1.PathRule prototype) {
494     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
495   }
496 
497   @java.lang.Override
toBuilder()498   public Builder toBuilder() {
499     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
500   }
501 
502   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)503   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
504     Builder builder = new Builder(parent);
505     return builder;
506   }
507   /**
508    *
509    *
510    * <pre>
511    * A path-matching rule for a URL. If matched, will use the specified BackendService to handle the traffic arriving at this URL.
512    * </pre>
513    *
514    * Protobuf type {@code google.cloud.compute.v1.PathRule}
515    */
516   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
517       implements
518       // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.PathRule)
519       com.google.cloud.compute.v1.PathRuleOrBuilder {
getDescriptor()520     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
521       return com.google.cloud.compute.v1.Compute
522           .internal_static_google_cloud_compute_v1_PathRule_descriptor;
523     }
524 
525     @java.lang.Override
526     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()527         internalGetFieldAccessorTable() {
528       return com.google.cloud.compute.v1.Compute
529           .internal_static_google_cloud_compute_v1_PathRule_fieldAccessorTable
530           .ensureFieldAccessorsInitialized(
531               com.google.cloud.compute.v1.PathRule.class,
532               com.google.cloud.compute.v1.PathRule.Builder.class);
533     }
534 
535     // Construct using com.google.cloud.compute.v1.PathRule.newBuilder()
Builder()536     private Builder() {
537       maybeForceBuilderInitialization();
538     }
539 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)540     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
541       super(parent);
542       maybeForceBuilderInitialization();
543     }
544 
maybeForceBuilderInitialization()545     private void maybeForceBuilderInitialization() {
546       if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
547         getRouteActionFieldBuilder();
548         getUrlRedirectFieldBuilder();
549       }
550     }
551 
552     @java.lang.Override
clear()553     public Builder clear() {
554       super.clear();
555       bitField0_ = 0;
556       paths_ = com.google.protobuf.LazyStringArrayList.EMPTY;
557       bitField0_ = (bitField0_ & ~0x00000001);
558       routeAction_ = null;
559       if (routeActionBuilder_ != null) {
560         routeActionBuilder_.dispose();
561         routeActionBuilder_ = null;
562       }
563       service_ = "";
564       urlRedirect_ = null;
565       if (urlRedirectBuilder_ != null) {
566         urlRedirectBuilder_.dispose();
567         urlRedirectBuilder_ = null;
568       }
569       return this;
570     }
571 
572     @java.lang.Override
getDescriptorForType()573     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
574       return com.google.cloud.compute.v1.Compute
575           .internal_static_google_cloud_compute_v1_PathRule_descriptor;
576     }
577 
578     @java.lang.Override
getDefaultInstanceForType()579     public com.google.cloud.compute.v1.PathRule getDefaultInstanceForType() {
580       return com.google.cloud.compute.v1.PathRule.getDefaultInstance();
581     }
582 
583     @java.lang.Override
build()584     public com.google.cloud.compute.v1.PathRule build() {
585       com.google.cloud.compute.v1.PathRule result = buildPartial();
586       if (!result.isInitialized()) {
587         throw newUninitializedMessageException(result);
588       }
589       return result;
590     }
591 
592     @java.lang.Override
buildPartial()593     public com.google.cloud.compute.v1.PathRule buildPartial() {
594       com.google.cloud.compute.v1.PathRule result = new com.google.cloud.compute.v1.PathRule(this);
595       buildPartialRepeatedFields(result);
596       if (bitField0_ != 0) {
597         buildPartial0(result);
598       }
599       onBuilt();
600       return result;
601     }
602 
buildPartialRepeatedFields(com.google.cloud.compute.v1.PathRule result)603     private void buildPartialRepeatedFields(com.google.cloud.compute.v1.PathRule result) {
604       if (((bitField0_ & 0x00000001) != 0)) {
605         paths_ = paths_.getUnmodifiableView();
606         bitField0_ = (bitField0_ & ~0x00000001);
607       }
608       result.paths_ = paths_;
609     }
610 
buildPartial0(com.google.cloud.compute.v1.PathRule result)611     private void buildPartial0(com.google.cloud.compute.v1.PathRule result) {
612       int from_bitField0_ = bitField0_;
613       int to_bitField0_ = 0;
614       if (((from_bitField0_ & 0x00000002) != 0)) {
615         result.routeAction_ =
616             routeActionBuilder_ == null ? routeAction_ : routeActionBuilder_.build();
617         to_bitField0_ |= 0x00000001;
618       }
619       if (((from_bitField0_ & 0x00000004) != 0)) {
620         result.service_ = service_;
621         to_bitField0_ |= 0x00000002;
622       }
623       if (((from_bitField0_ & 0x00000008) != 0)) {
624         result.urlRedirect_ =
625             urlRedirectBuilder_ == null ? urlRedirect_ : urlRedirectBuilder_.build();
626         to_bitField0_ |= 0x00000004;
627       }
628       result.bitField0_ |= to_bitField0_;
629     }
630 
631     @java.lang.Override
clone()632     public Builder clone() {
633       return super.clone();
634     }
635 
636     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)637     public Builder setField(
638         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
639       return super.setField(field, value);
640     }
641 
642     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)643     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
644       return super.clearField(field);
645     }
646 
647     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)648     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
649       return super.clearOneof(oneof);
650     }
651 
652     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)653     public Builder setRepeatedField(
654         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
655       return super.setRepeatedField(field, index, value);
656     }
657 
658     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)659     public Builder addRepeatedField(
660         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
661       return super.addRepeatedField(field, value);
662     }
663 
664     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)665     public Builder mergeFrom(com.google.protobuf.Message other) {
666       if (other instanceof com.google.cloud.compute.v1.PathRule) {
667         return mergeFrom((com.google.cloud.compute.v1.PathRule) other);
668       } else {
669         super.mergeFrom(other);
670         return this;
671       }
672     }
673 
mergeFrom(com.google.cloud.compute.v1.PathRule other)674     public Builder mergeFrom(com.google.cloud.compute.v1.PathRule other) {
675       if (other == com.google.cloud.compute.v1.PathRule.getDefaultInstance()) return this;
676       if (!other.paths_.isEmpty()) {
677         if (paths_.isEmpty()) {
678           paths_ = other.paths_;
679           bitField0_ = (bitField0_ & ~0x00000001);
680         } else {
681           ensurePathsIsMutable();
682           paths_.addAll(other.paths_);
683         }
684         onChanged();
685       }
686       if (other.hasRouteAction()) {
687         mergeRouteAction(other.getRouteAction());
688       }
689       if (other.hasService()) {
690         service_ = other.service_;
691         bitField0_ |= 0x00000004;
692         onChanged();
693       }
694       if (other.hasUrlRedirect()) {
695         mergeUrlRedirect(other.getUrlRedirect());
696       }
697       this.mergeUnknownFields(other.getUnknownFields());
698       onChanged();
699       return this;
700     }
701 
702     @java.lang.Override
isInitialized()703     public final boolean isInitialized() {
704       return true;
705     }
706 
707     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)708     public Builder mergeFrom(
709         com.google.protobuf.CodedInputStream input,
710         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
711         throws java.io.IOException {
712       if (extensionRegistry == null) {
713         throw new java.lang.NullPointerException();
714       }
715       try {
716         boolean done = false;
717         while (!done) {
718           int tag = input.readTag();
719           switch (tag) {
720             case 0:
721               done = true;
722               break;
723             case 851511154:
724               {
725                 java.lang.String s = input.readStringRequireUtf8();
726                 ensurePathsIsMutable();
727                 paths_.add(s);
728                 break;
729               } // case 851511154
730             case -1306643030:
731               {
732                 service_ = input.readStringRequireUtf8();
733                 bitField0_ |= 0x00000004;
734                 break;
735               } // case -1306643030
736             case -1053784734:
737               {
738                 input.readMessage(getUrlRedirectFieldBuilder().getBuilder(), extensionRegistry);
739                 bitField0_ |= 0x00000008;
740                 break;
741               } // case -1053784734
742             case -898455710:
743               {
744                 input.readMessage(getRouteActionFieldBuilder().getBuilder(), extensionRegistry);
745                 bitField0_ |= 0x00000002;
746                 break;
747               } // case -898455710
748             default:
749               {
750                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
751                   done = true; // was an endgroup tag
752                 }
753                 break;
754               } // default:
755           } // switch (tag)
756         } // while (!done)
757       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
758         throw e.unwrapIOException();
759       } finally {
760         onChanged();
761       } // finally
762       return this;
763     }
764 
765     private int bitField0_;
766 
767     private com.google.protobuf.LazyStringList paths_ =
768         com.google.protobuf.LazyStringArrayList.EMPTY;
769 
ensurePathsIsMutable()770     private void ensurePathsIsMutable() {
771       if (!((bitField0_ & 0x00000001) != 0)) {
772         paths_ = new com.google.protobuf.LazyStringArrayList(paths_);
773         bitField0_ |= 0x00000001;
774       }
775     }
776     /**
777      *
778      *
779      * <pre>
780      * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.
781      * </pre>
782      *
783      * <code>repeated string paths = 106438894;</code>
784      *
785      * @return A list containing the paths.
786      */
getPathsList()787     public com.google.protobuf.ProtocolStringList getPathsList() {
788       return paths_.getUnmodifiableView();
789     }
790     /**
791      *
792      *
793      * <pre>
794      * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.
795      * </pre>
796      *
797      * <code>repeated string paths = 106438894;</code>
798      *
799      * @return The count of paths.
800      */
getPathsCount()801     public int getPathsCount() {
802       return paths_.size();
803     }
804     /**
805      *
806      *
807      * <pre>
808      * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.
809      * </pre>
810      *
811      * <code>repeated string paths = 106438894;</code>
812      *
813      * @param index The index of the element to return.
814      * @return The paths at the given index.
815      */
getPaths(int index)816     public java.lang.String getPaths(int index) {
817       return paths_.get(index);
818     }
819     /**
820      *
821      *
822      * <pre>
823      * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.
824      * </pre>
825      *
826      * <code>repeated string paths = 106438894;</code>
827      *
828      * @param index The index of the value to return.
829      * @return The bytes of the paths at the given index.
830      */
getPathsBytes(int index)831     public com.google.protobuf.ByteString getPathsBytes(int index) {
832       return paths_.getByteString(index);
833     }
834     /**
835      *
836      *
837      * <pre>
838      * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.
839      * </pre>
840      *
841      * <code>repeated string paths = 106438894;</code>
842      *
843      * @param index The index to set the value at.
844      * @param value The paths to set.
845      * @return This builder for chaining.
846      */
setPaths(int index, java.lang.String value)847     public Builder setPaths(int index, java.lang.String value) {
848       if (value == null) {
849         throw new NullPointerException();
850       }
851       ensurePathsIsMutable();
852       paths_.set(index, value);
853       onChanged();
854       return this;
855     }
856     /**
857      *
858      *
859      * <pre>
860      * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.
861      * </pre>
862      *
863      * <code>repeated string paths = 106438894;</code>
864      *
865      * @param value The paths to add.
866      * @return This builder for chaining.
867      */
addPaths(java.lang.String value)868     public Builder addPaths(java.lang.String value) {
869       if (value == null) {
870         throw new NullPointerException();
871       }
872       ensurePathsIsMutable();
873       paths_.add(value);
874       onChanged();
875       return this;
876     }
877     /**
878      *
879      *
880      * <pre>
881      * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.
882      * </pre>
883      *
884      * <code>repeated string paths = 106438894;</code>
885      *
886      * @param values The paths to add.
887      * @return This builder for chaining.
888      */
addAllPaths(java.lang.Iterable<java.lang.String> values)889     public Builder addAllPaths(java.lang.Iterable<java.lang.String> values) {
890       ensurePathsIsMutable();
891       com.google.protobuf.AbstractMessageLite.Builder.addAll(values, paths_);
892       onChanged();
893       return this;
894     }
895     /**
896      *
897      *
898      * <pre>
899      * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.
900      * </pre>
901      *
902      * <code>repeated string paths = 106438894;</code>
903      *
904      * @return This builder for chaining.
905      */
clearPaths()906     public Builder clearPaths() {
907       paths_ = com.google.protobuf.LazyStringArrayList.EMPTY;
908       bitField0_ = (bitField0_ & ~0x00000001);
909       onChanged();
910       return this;
911     }
912     /**
913      *
914      *
915      * <pre>
916      * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.
917      * </pre>
918      *
919      * <code>repeated string paths = 106438894;</code>
920      *
921      * @param value The bytes of the paths to add.
922      * @return This builder for chaining.
923      */
addPathsBytes(com.google.protobuf.ByteString value)924     public Builder addPathsBytes(com.google.protobuf.ByteString value) {
925       if (value == null) {
926         throw new NullPointerException();
927       }
928       checkByteStringIsUtf8(value);
929       ensurePathsIsMutable();
930       paths_.add(value);
931       onChanged();
932       return this;
933     }
934 
935     private com.google.cloud.compute.v1.HttpRouteAction routeAction_;
936     private com.google.protobuf.SingleFieldBuilderV3<
937             com.google.cloud.compute.v1.HttpRouteAction,
938             com.google.cloud.compute.v1.HttpRouteAction.Builder,
939             com.google.cloud.compute.v1.HttpRouteActionOrBuilder>
940         routeActionBuilder_;
941     /**
942      *
943      *
944      * <pre>
945      * In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within a path rule's routeAction.
946      * </pre>
947      *
948      * <code>optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;</code>
949      *
950      * @return Whether the routeAction field is set.
951      */
hasRouteAction()952     public boolean hasRouteAction() {
953       return ((bitField0_ & 0x00000002) != 0);
954     }
955     /**
956      *
957      *
958      * <pre>
959      * In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within a path rule's routeAction.
960      * </pre>
961      *
962      * <code>optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;</code>
963      *
964      * @return The routeAction.
965      */
getRouteAction()966     public com.google.cloud.compute.v1.HttpRouteAction getRouteAction() {
967       if (routeActionBuilder_ == null) {
968         return routeAction_ == null
969             ? com.google.cloud.compute.v1.HttpRouteAction.getDefaultInstance()
970             : routeAction_;
971       } else {
972         return routeActionBuilder_.getMessage();
973       }
974     }
975     /**
976      *
977      *
978      * <pre>
979      * In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within a path rule's routeAction.
980      * </pre>
981      *
982      * <code>optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;</code>
983      */
setRouteAction(com.google.cloud.compute.v1.HttpRouteAction value)984     public Builder setRouteAction(com.google.cloud.compute.v1.HttpRouteAction value) {
985       if (routeActionBuilder_ == null) {
986         if (value == null) {
987           throw new NullPointerException();
988         }
989         routeAction_ = value;
990       } else {
991         routeActionBuilder_.setMessage(value);
992       }
993       bitField0_ |= 0x00000002;
994       onChanged();
995       return this;
996     }
997     /**
998      *
999      *
1000      * <pre>
1001      * In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within a path rule's routeAction.
1002      * </pre>
1003      *
1004      * <code>optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;</code>
1005      */
setRouteAction( com.google.cloud.compute.v1.HttpRouteAction.Builder builderForValue)1006     public Builder setRouteAction(
1007         com.google.cloud.compute.v1.HttpRouteAction.Builder builderForValue) {
1008       if (routeActionBuilder_ == null) {
1009         routeAction_ = builderForValue.build();
1010       } else {
1011         routeActionBuilder_.setMessage(builderForValue.build());
1012       }
1013       bitField0_ |= 0x00000002;
1014       onChanged();
1015       return this;
1016     }
1017     /**
1018      *
1019      *
1020      * <pre>
1021      * In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within a path rule's routeAction.
1022      * </pre>
1023      *
1024      * <code>optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;</code>
1025      */
mergeRouteAction(com.google.cloud.compute.v1.HttpRouteAction value)1026     public Builder mergeRouteAction(com.google.cloud.compute.v1.HttpRouteAction value) {
1027       if (routeActionBuilder_ == null) {
1028         if (((bitField0_ & 0x00000002) != 0)
1029             && routeAction_ != null
1030             && routeAction_ != com.google.cloud.compute.v1.HttpRouteAction.getDefaultInstance()) {
1031           getRouteActionBuilder().mergeFrom(value);
1032         } else {
1033           routeAction_ = value;
1034         }
1035       } else {
1036         routeActionBuilder_.mergeFrom(value);
1037       }
1038       bitField0_ |= 0x00000002;
1039       onChanged();
1040       return this;
1041     }
1042     /**
1043      *
1044      *
1045      * <pre>
1046      * In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within a path rule's routeAction.
1047      * </pre>
1048      *
1049      * <code>optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;</code>
1050      */
clearRouteAction()1051     public Builder clearRouteAction() {
1052       bitField0_ = (bitField0_ & ~0x00000002);
1053       routeAction_ = null;
1054       if (routeActionBuilder_ != null) {
1055         routeActionBuilder_.dispose();
1056         routeActionBuilder_ = null;
1057       }
1058       onChanged();
1059       return this;
1060     }
1061     /**
1062      *
1063      *
1064      * <pre>
1065      * In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within a path rule's routeAction.
1066      * </pre>
1067      *
1068      * <code>optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;</code>
1069      */
getRouteActionBuilder()1070     public com.google.cloud.compute.v1.HttpRouteAction.Builder getRouteActionBuilder() {
1071       bitField0_ |= 0x00000002;
1072       onChanged();
1073       return getRouteActionFieldBuilder().getBuilder();
1074     }
1075     /**
1076      *
1077      *
1078      * <pre>
1079      * In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within a path rule's routeAction.
1080      * </pre>
1081      *
1082      * <code>optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;</code>
1083      */
getRouteActionOrBuilder()1084     public com.google.cloud.compute.v1.HttpRouteActionOrBuilder getRouteActionOrBuilder() {
1085       if (routeActionBuilder_ != null) {
1086         return routeActionBuilder_.getMessageOrBuilder();
1087       } else {
1088         return routeAction_ == null
1089             ? com.google.cloud.compute.v1.HttpRouteAction.getDefaultInstance()
1090             : routeAction_;
1091       }
1092     }
1093     /**
1094      *
1095      *
1096      * <pre>
1097      * In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within a path rule's routeAction.
1098      * </pre>
1099      *
1100      * <code>optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;</code>
1101      */
1102     private com.google.protobuf.SingleFieldBuilderV3<
1103             com.google.cloud.compute.v1.HttpRouteAction,
1104             com.google.cloud.compute.v1.HttpRouteAction.Builder,
1105             com.google.cloud.compute.v1.HttpRouteActionOrBuilder>
getRouteActionFieldBuilder()1106         getRouteActionFieldBuilder() {
1107       if (routeActionBuilder_ == null) {
1108         routeActionBuilder_ =
1109             new com.google.protobuf.SingleFieldBuilderV3<
1110                 com.google.cloud.compute.v1.HttpRouteAction,
1111                 com.google.cloud.compute.v1.HttpRouteAction.Builder,
1112                 com.google.cloud.compute.v1.HttpRouteActionOrBuilder>(
1113                 getRouteAction(), getParentForChildren(), isClean());
1114         routeAction_ = null;
1115       }
1116       return routeActionBuilder_;
1117     }
1118 
1119     private java.lang.Object service_ = "";
1120     /**
1121      *
1122      *
1123      * <pre>
1124      * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.
1125      * </pre>
1126      *
1127      * <code>optional string service = 373540533;</code>
1128      *
1129      * @return Whether the service field is set.
1130      */
hasService()1131     public boolean hasService() {
1132       return ((bitField0_ & 0x00000004) != 0);
1133     }
1134     /**
1135      *
1136      *
1137      * <pre>
1138      * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.
1139      * </pre>
1140      *
1141      * <code>optional string service = 373540533;</code>
1142      *
1143      * @return The service.
1144      */
getService()1145     public java.lang.String getService() {
1146       java.lang.Object ref = service_;
1147       if (!(ref instanceof java.lang.String)) {
1148         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1149         java.lang.String s = bs.toStringUtf8();
1150         service_ = s;
1151         return s;
1152       } else {
1153         return (java.lang.String) ref;
1154       }
1155     }
1156     /**
1157      *
1158      *
1159      * <pre>
1160      * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.
1161      * </pre>
1162      *
1163      * <code>optional string service = 373540533;</code>
1164      *
1165      * @return The bytes for service.
1166      */
getServiceBytes()1167     public com.google.protobuf.ByteString getServiceBytes() {
1168       java.lang.Object ref = service_;
1169       if (ref instanceof String) {
1170         com.google.protobuf.ByteString b =
1171             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1172         service_ = b;
1173         return b;
1174       } else {
1175         return (com.google.protobuf.ByteString) ref;
1176       }
1177     }
1178     /**
1179      *
1180      *
1181      * <pre>
1182      * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.
1183      * </pre>
1184      *
1185      * <code>optional string service = 373540533;</code>
1186      *
1187      * @param value The service to set.
1188      * @return This builder for chaining.
1189      */
setService(java.lang.String value)1190     public Builder setService(java.lang.String value) {
1191       if (value == null) {
1192         throw new NullPointerException();
1193       }
1194       service_ = value;
1195       bitField0_ |= 0x00000004;
1196       onChanged();
1197       return this;
1198     }
1199     /**
1200      *
1201      *
1202      * <pre>
1203      * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.
1204      * </pre>
1205      *
1206      * <code>optional string service = 373540533;</code>
1207      *
1208      * @return This builder for chaining.
1209      */
clearService()1210     public Builder clearService() {
1211       service_ = getDefaultInstance().getService();
1212       bitField0_ = (bitField0_ & ~0x00000004);
1213       onChanged();
1214       return this;
1215     }
1216     /**
1217      *
1218      *
1219      * <pre>
1220      * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.
1221      * </pre>
1222      *
1223      * <code>optional string service = 373540533;</code>
1224      *
1225      * @param value The bytes for service to set.
1226      * @return This builder for chaining.
1227      */
setServiceBytes(com.google.protobuf.ByteString value)1228     public Builder setServiceBytes(com.google.protobuf.ByteString value) {
1229       if (value == null) {
1230         throw new NullPointerException();
1231       }
1232       checkByteStringIsUtf8(value);
1233       service_ = value;
1234       bitField0_ |= 0x00000004;
1235       onChanged();
1236       return this;
1237     }
1238 
1239     private com.google.cloud.compute.v1.HttpRedirectAction urlRedirect_;
1240     private com.google.protobuf.SingleFieldBuilderV3<
1241             com.google.cloud.compute.v1.HttpRedirectAction,
1242             com.google.cloud.compute.v1.HttpRedirectAction.Builder,
1243             com.google.cloud.compute.v1.HttpRedirectActionOrBuilder>
1244         urlRedirectBuilder_;
1245     /**
1246      *
1247      *
1248      * <pre>
1249      * When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.
1250      * </pre>
1251      *
1252      * <code>optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;</code>
1253      *
1254      * @return Whether the urlRedirect field is set.
1255      */
hasUrlRedirect()1256     public boolean hasUrlRedirect() {
1257       return ((bitField0_ & 0x00000008) != 0);
1258     }
1259     /**
1260      *
1261      *
1262      * <pre>
1263      * When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.
1264      * </pre>
1265      *
1266      * <code>optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;</code>
1267      *
1268      * @return The urlRedirect.
1269      */
getUrlRedirect()1270     public com.google.cloud.compute.v1.HttpRedirectAction getUrlRedirect() {
1271       if (urlRedirectBuilder_ == null) {
1272         return urlRedirect_ == null
1273             ? com.google.cloud.compute.v1.HttpRedirectAction.getDefaultInstance()
1274             : urlRedirect_;
1275       } else {
1276         return urlRedirectBuilder_.getMessage();
1277       }
1278     }
1279     /**
1280      *
1281      *
1282      * <pre>
1283      * When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.
1284      * </pre>
1285      *
1286      * <code>optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;</code>
1287      */
setUrlRedirect(com.google.cloud.compute.v1.HttpRedirectAction value)1288     public Builder setUrlRedirect(com.google.cloud.compute.v1.HttpRedirectAction value) {
1289       if (urlRedirectBuilder_ == null) {
1290         if (value == null) {
1291           throw new NullPointerException();
1292         }
1293         urlRedirect_ = value;
1294       } else {
1295         urlRedirectBuilder_.setMessage(value);
1296       }
1297       bitField0_ |= 0x00000008;
1298       onChanged();
1299       return this;
1300     }
1301     /**
1302      *
1303      *
1304      * <pre>
1305      * When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.
1306      * </pre>
1307      *
1308      * <code>optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;</code>
1309      */
setUrlRedirect( com.google.cloud.compute.v1.HttpRedirectAction.Builder builderForValue)1310     public Builder setUrlRedirect(
1311         com.google.cloud.compute.v1.HttpRedirectAction.Builder builderForValue) {
1312       if (urlRedirectBuilder_ == null) {
1313         urlRedirect_ = builderForValue.build();
1314       } else {
1315         urlRedirectBuilder_.setMessage(builderForValue.build());
1316       }
1317       bitField0_ |= 0x00000008;
1318       onChanged();
1319       return this;
1320     }
1321     /**
1322      *
1323      *
1324      * <pre>
1325      * When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.
1326      * </pre>
1327      *
1328      * <code>optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;</code>
1329      */
mergeUrlRedirect(com.google.cloud.compute.v1.HttpRedirectAction value)1330     public Builder mergeUrlRedirect(com.google.cloud.compute.v1.HttpRedirectAction value) {
1331       if (urlRedirectBuilder_ == null) {
1332         if (((bitField0_ & 0x00000008) != 0)
1333             && urlRedirect_ != null
1334             && urlRedirect_
1335                 != com.google.cloud.compute.v1.HttpRedirectAction.getDefaultInstance()) {
1336           getUrlRedirectBuilder().mergeFrom(value);
1337         } else {
1338           urlRedirect_ = value;
1339         }
1340       } else {
1341         urlRedirectBuilder_.mergeFrom(value);
1342       }
1343       bitField0_ |= 0x00000008;
1344       onChanged();
1345       return this;
1346     }
1347     /**
1348      *
1349      *
1350      * <pre>
1351      * When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.
1352      * </pre>
1353      *
1354      * <code>optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;</code>
1355      */
clearUrlRedirect()1356     public Builder clearUrlRedirect() {
1357       bitField0_ = (bitField0_ & ~0x00000008);
1358       urlRedirect_ = null;
1359       if (urlRedirectBuilder_ != null) {
1360         urlRedirectBuilder_.dispose();
1361         urlRedirectBuilder_ = null;
1362       }
1363       onChanged();
1364       return this;
1365     }
1366     /**
1367      *
1368      *
1369      * <pre>
1370      * When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.
1371      * </pre>
1372      *
1373      * <code>optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;</code>
1374      */
getUrlRedirectBuilder()1375     public com.google.cloud.compute.v1.HttpRedirectAction.Builder getUrlRedirectBuilder() {
1376       bitField0_ |= 0x00000008;
1377       onChanged();
1378       return getUrlRedirectFieldBuilder().getBuilder();
1379     }
1380     /**
1381      *
1382      *
1383      * <pre>
1384      * When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.
1385      * </pre>
1386      *
1387      * <code>optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;</code>
1388      */
getUrlRedirectOrBuilder()1389     public com.google.cloud.compute.v1.HttpRedirectActionOrBuilder getUrlRedirectOrBuilder() {
1390       if (urlRedirectBuilder_ != null) {
1391         return urlRedirectBuilder_.getMessageOrBuilder();
1392       } else {
1393         return urlRedirect_ == null
1394             ? com.google.cloud.compute.v1.HttpRedirectAction.getDefaultInstance()
1395             : urlRedirect_;
1396       }
1397     }
1398     /**
1399      *
1400      *
1401      * <pre>
1402      * When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.
1403      * </pre>
1404      *
1405      * <code>optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;</code>
1406      */
1407     private com.google.protobuf.SingleFieldBuilderV3<
1408             com.google.cloud.compute.v1.HttpRedirectAction,
1409             com.google.cloud.compute.v1.HttpRedirectAction.Builder,
1410             com.google.cloud.compute.v1.HttpRedirectActionOrBuilder>
getUrlRedirectFieldBuilder()1411         getUrlRedirectFieldBuilder() {
1412       if (urlRedirectBuilder_ == null) {
1413         urlRedirectBuilder_ =
1414             new com.google.protobuf.SingleFieldBuilderV3<
1415                 com.google.cloud.compute.v1.HttpRedirectAction,
1416                 com.google.cloud.compute.v1.HttpRedirectAction.Builder,
1417                 com.google.cloud.compute.v1.HttpRedirectActionOrBuilder>(
1418                 getUrlRedirect(), getParentForChildren(), isClean());
1419         urlRedirect_ = null;
1420       }
1421       return urlRedirectBuilder_;
1422     }
1423 
1424     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1425     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1426       return super.setUnknownFields(unknownFields);
1427     }
1428 
1429     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1430     public final Builder mergeUnknownFields(
1431         final com.google.protobuf.UnknownFieldSet unknownFields) {
1432       return super.mergeUnknownFields(unknownFields);
1433     }
1434 
1435     // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.PathRule)
1436   }
1437 
1438   // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.PathRule)
1439   private static final com.google.cloud.compute.v1.PathRule DEFAULT_INSTANCE;
1440 
1441   static {
1442     DEFAULT_INSTANCE = new com.google.cloud.compute.v1.PathRule();
1443   }
1444 
getDefaultInstance()1445   public static com.google.cloud.compute.v1.PathRule getDefaultInstance() {
1446     return DEFAULT_INSTANCE;
1447   }
1448 
1449   private static final com.google.protobuf.Parser<PathRule> PARSER =
1450       new com.google.protobuf.AbstractParser<PathRule>() {
1451         @java.lang.Override
1452         public PathRule parsePartialFrom(
1453             com.google.protobuf.CodedInputStream input,
1454             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1455             throws com.google.protobuf.InvalidProtocolBufferException {
1456           Builder builder = newBuilder();
1457           try {
1458             builder.mergeFrom(input, extensionRegistry);
1459           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1460             throw e.setUnfinishedMessage(builder.buildPartial());
1461           } catch (com.google.protobuf.UninitializedMessageException e) {
1462             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1463           } catch (java.io.IOException e) {
1464             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1465                 .setUnfinishedMessage(builder.buildPartial());
1466           }
1467           return builder.buildPartial();
1468         }
1469       };
1470 
parser()1471   public static com.google.protobuf.Parser<PathRule> parser() {
1472     return PARSER;
1473   }
1474 
1475   @java.lang.Override
getParserForType()1476   public com.google.protobuf.Parser<PathRule> getParserForType() {
1477     return PARSER;
1478   }
1479 
1480   @java.lang.Override
getDefaultInstanceForType()1481   public com.google.cloud.compute.v1.PathRule getDefaultInstanceForType() {
1482     return DEFAULT_INSTANCE;
1483   }
1484 }
1485