• 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  * Represents a Nat resource. It enables the VMs within the specified subnetworks to access Internet without external IP addresses. It specifies a list of subnetworks (and the ranges within) that want to use NAT. Customers can also provide the external IPs that would be used for NAT. GCP would auto-allocate ephemeral IPs if no external IPs are provided.
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.compute.v1.RouterNat}
29  */
30 public final class RouterNat extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.RouterNat)
33     RouterNatOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use RouterNat.newBuilder() to construct.
RouterNat(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private RouterNat(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
RouterNat()40   private RouterNat() {
41     drainNatIps_ = com.google.protobuf.LazyStringArrayList.EMPTY;
42     endpointTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
43     name_ = "";
44     natIpAllocateOption_ = "";
45     natIps_ = com.google.protobuf.LazyStringArrayList.EMPTY;
46     rules_ = java.util.Collections.emptyList();
47     sourceSubnetworkIpRangesToNat_ = "";
48     subnetworks_ = java.util.Collections.emptyList();
49   }
50 
51   @java.lang.Override
52   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)53   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
54     return new RouterNat();
55   }
56 
57   @java.lang.Override
getUnknownFields()58   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
59     return this.unknownFields;
60   }
61 
getDescriptor()62   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
63     return com.google.cloud.compute.v1.Compute
64         .internal_static_google_cloud_compute_v1_RouterNat_descriptor;
65   }
66 
67   @java.lang.Override
68   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()69       internalGetFieldAccessorTable() {
70     return com.google.cloud.compute.v1.Compute
71         .internal_static_google_cloud_compute_v1_RouterNat_fieldAccessorTable
72         .ensureFieldAccessorsInitialized(
73             com.google.cloud.compute.v1.RouterNat.class,
74             com.google.cloud.compute.v1.RouterNat.Builder.class);
75   }
76 
77   /**
78    *
79    *
80    * <pre>
81    * </pre>
82    *
83    * Protobuf enum {@code google.cloud.compute.v1.RouterNat.EndpointTypes}
84    */
85   public enum EndpointTypes implements com.google.protobuf.ProtocolMessageEnum {
86     /**
87      *
88      *
89      * <pre>
90      * A value indicating that the enum field is not set.
91      * </pre>
92      *
93      * <code>UNDEFINED_ENDPOINT_TYPES = 0;</code>
94      */
95     UNDEFINED_ENDPOINT_TYPES(0),
96     /**
97      *
98      *
99      * <pre>
100      * This is used for Secure Web Gateway endpoints.
101      * </pre>
102      *
103      * <code>ENDPOINT_TYPE_SWG = 159344456;</code>
104      */
105     ENDPOINT_TYPE_SWG(159344456),
106     /**
107      *
108      *
109      * <pre>
110      * This is the default.
111      * </pre>
112      *
113      * <code>ENDPOINT_TYPE_VM = 57095474;</code>
114      */
115     ENDPOINT_TYPE_VM(57095474),
116     UNRECOGNIZED(-1),
117     ;
118 
119     /**
120      *
121      *
122      * <pre>
123      * A value indicating that the enum field is not set.
124      * </pre>
125      *
126      * <code>UNDEFINED_ENDPOINT_TYPES = 0;</code>
127      */
128     public static final int UNDEFINED_ENDPOINT_TYPES_VALUE = 0;
129     /**
130      *
131      *
132      * <pre>
133      * This is used for Secure Web Gateway endpoints.
134      * </pre>
135      *
136      * <code>ENDPOINT_TYPE_SWG = 159344456;</code>
137      */
138     public static final int ENDPOINT_TYPE_SWG_VALUE = 159344456;
139     /**
140      *
141      *
142      * <pre>
143      * This is the default.
144      * </pre>
145      *
146      * <code>ENDPOINT_TYPE_VM = 57095474;</code>
147      */
148     public static final int ENDPOINT_TYPE_VM_VALUE = 57095474;
149 
getNumber()150     public final int getNumber() {
151       if (this == UNRECOGNIZED) {
152         throw new java.lang.IllegalArgumentException(
153             "Can't get the number of an unknown enum value.");
154       }
155       return value;
156     }
157 
158     /**
159      * @param value The numeric wire value of the corresponding enum entry.
160      * @return The enum associated with the given numeric wire value.
161      * @deprecated Use {@link #forNumber(int)} instead.
162      */
163     @java.lang.Deprecated
valueOf(int value)164     public static EndpointTypes valueOf(int value) {
165       return forNumber(value);
166     }
167 
168     /**
169      * @param value The numeric wire value of the corresponding enum entry.
170      * @return The enum associated with the given numeric wire value.
171      */
forNumber(int value)172     public static EndpointTypes forNumber(int value) {
173       switch (value) {
174         case 0:
175           return UNDEFINED_ENDPOINT_TYPES;
176         case 159344456:
177           return ENDPOINT_TYPE_SWG;
178         case 57095474:
179           return ENDPOINT_TYPE_VM;
180         default:
181           return null;
182       }
183     }
184 
internalGetValueMap()185     public static com.google.protobuf.Internal.EnumLiteMap<EndpointTypes> internalGetValueMap() {
186       return internalValueMap;
187     }
188 
189     private static final com.google.protobuf.Internal.EnumLiteMap<EndpointTypes> internalValueMap =
190         new com.google.protobuf.Internal.EnumLiteMap<EndpointTypes>() {
191           public EndpointTypes findValueByNumber(int number) {
192             return EndpointTypes.forNumber(number);
193           }
194         };
195 
getValueDescriptor()196     public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
197       if (this == UNRECOGNIZED) {
198         throw new java.lang.IllegalStateException(
199             "Can't get the descriptor of an unrecognized enum value.");
200       }
201       return getDescriptor().getValues().get(ordinal());
202     }
203 
getDescriptorForType()204     public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
205       return getDescriptor();
206     }
207 
getDescriptor()208     public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
209       return com.google.cloud.compute.v1.RouterNat.getDescriptor().getEnumTypes().get(0);
210     }
211 
212     private static final EndpointTypes[] VALUES = values();
213 
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)214     public static EndpointTypes valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
215       if (desc.getType() != getDescriptor()) {
216         throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
217       }
218       if (desc.getIndex() == -1) {
219         return UNRECOGNIZED;
220       }
221       return VALUES[desc.getIndex()];
222     }
223 
224     private final int value;
225 
EndpointTypes(int value)226     private EndpointTypes(int value) {
227       this.value = value;
228     }
229 
230     // @@protoc_insertion_point(enum_scope:google.cloud.compute.v1.RouterNat.EndpointTypes)
231   }
232 
233   /**
234    *
235    *
236    * <pre>
237    * Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty.
238    * </pre>
239    *
240    * Protobuf enum {@code google.cloud.compute.v1.RouterNat.NatIpAllocateOption}
241    */
242   public enum NatIpAllocateOption implements com.google.protobuf.ProtocolMessageEnum {
243     /**
244      *
245      *
246      * <pre>
247      * A value indicating that the enum field is not set.
248      * </pre>
249      *
250      * <code>UNDEFINED_NAT_IP_ALLOCATE_OPTION = 0;</code>
251      */
252     UNDEFINED_NAT_IP_ALLOCATE_OPTION(0),
253     /**
254      *
255      *
256      * <pre>
257      * Nat IPs are allocated by GCP; customers can not specify any Nat IPs.
258      * </pre>
259      *
260      * <code>AUTO_ONLY = 182333500;</code>
261      */
262     AUTO_ONLY(182333500),
263     /**
264      *
265      *
266      * <pre>
267      * Only use Nat IPs provided by customers. When specified Nat IPs are not enough then the Nat service fails for new VMs.
268      * </pre>
269      *
270      * <code>MANUAL_ONLY = 261251205;</code>
271      */
272     MANUAL_ONLY(261251205),
273     UNRECOGNIZED(-1),
274     ;
275 
276     /**
277      *
278      *
279      * <pre>
280      * A value indicating that the enum field is not set.
281      * </pre>
282      *
283      * <code>UNDEFINED_NAT_IP_ALLOCATE_OPTION = 0;</code>
284      */
285     public static final int UNDEFINED_NAT_IP_ALLOCATE_OPTION_VALUE = 0;
286     /**
287      *
288      *
289      * <pre>
290      * Nat IPs are allocated by GCP; customers can not specify any Nat IPs.
291      * </pre>
292      *
293      * <code>AUTO_ONLY = 182333500;</code>
294      */
295     public static final int AUTO_ONLY_VALUE = 182333500;
296     /**
297      *
298      *
299      * <pre>
300      * Only use Nat IPs provided by customers. When specified Nat IPs are not enough then the Nat service fails for new VMs.
301      * </pre>
302      *
303      * <code>MANUAL_ONLY = 261251205;</code>
304      */
305     public static final int MANUAL_ONLY_VALUE = 261251205;
306 
getNumber()307     public final int getNumber() {
308       if (this == UNRECOGNIZED) {
309         throw new java.lang.IllegalArgumentException(
310             "Can't get the number of an unknown enum value.");
311       }
312       return value;
313     }
314 
315     /**
316      * @param value The numeric wire value of the corresponding enum entry.
317      * @return The enum associated with the given numeric wire value.
318      * @deprecated Use {@link #forNumber(int)} instead.
319      */
320     @java.lang.Deprecated
valueOf(int value)321     public static NatIpAllocateOption valueOf(int value) {
322       return forNumber(value);
323     }
324 
325     /**
326      * @param value The numeric wire value of the corresponding enum entry.
327      * @return The enum associated with the given numeric wire value.
328      */
forNumber(int value)329     public static NatIpAllocateOption forNumber(int value) {
330       switch (value) {
331         case 0:
332           return UNDEFINED_NAT_IP_ALLOCATE_OPTION;
333         case 182333500:
334           return AUTO_ONLY;
335         case 261251205:
336           return MANUAL_ONLY;
337         default:
338           return null;
339       }
340     }
341 
342     public static com.google.protobuf.Internal.EnumLiteMap<NatIpAllocateOption>
internalGetValueMap()343         internalGetValueMap() {
344       return internalValueMap;
345     }
346 
347     private static final com.google.protobuf.Internal.EnumLiteMap<NatIpAllocateOption>
348         internalValueMap =
349             new com.google.protobuf.Internal.EnumLiteMap<NatIpAllocateOption>() {
350               public NatIpAllocateOption findValueByNumber(int number) {
351                 return NatIpAllocateOption.forNumber(number);
352               }
353             };
354 
getValueDescriptor()355     public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
356       if (this == UNRECOGNIZED) {
357         throw new java.lang.IllegalStateException(
358             "Can't get the descriptor of an unrecognized enum value.");
359       }
360       return getDescriptor().getValues().get(ordinal());
361     }
362 
getDescriptorForType()363     public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
364       return getDescriptor();
365     }
366 
getDescriptor()367     public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
368       return com.google.cloud.compute.v1.RouterNat.getDescriptor().getEnumTypes().get(1);
369     }
370 
371     private static final NatIpAllocateOption[] VALUES = values();
372 
valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc)373     public static NatIpAllocateOption valueOf(
374         com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
375       if (desc.getType() != getDescriptor()) {
376         throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
377       }
378       if (desc.getIndex() == -1) {
379         return UNRECOGNIZED;
380       }
381       return VALUES[desc.getIndex()];
382     }
383 
384     private final int value;
385 
NatIpAllocateOption(int value)386     private NatIpAllocateOption(int value) {
387       this.value = value;
388     }
389 
390     // @@protoc_insertion_point(enum_scope:google.cloud.compute.v1.RouterNat.NatIpAllocateOption)
391   }
392 
393   /**
394    *
395    *
396    * <pre>
397    * Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other Router.Nat section in any Router for this network in this region.
398    * </pre>
399    *
400    * Protobuf enum {@code google.cloud.compute.v1.RouterNat.SourceSubnetworkIpRangesToNat}
401    */
402   public enum SourceSubnetworkIpRangesToNat implements com.google.protobuf.ProtocolMessageEnum {
403     /**
404      *
405      *
406      * <pre>
407      * A value indicating that the enum field is not set.
408      * </pre>
409      *
410      * <code>UNDEFINED_SOURCE_SUBNETWORK_IP_RANGES_TO_NAT = 0;</code>
411      */
412     UNDEFINED_SOURCE_SUBNETWORK_IP_RANGES_TO_NAT(0),
413     /**
414      *
415      *
416      * <pre>
417      * All the IP ranges in every Subnetwork are allowed to Nat.
418      * </pre>
419      *
420      * <code>ALL_SUBNETWORKS_ALL_IP_RANGES = 179964376;</code>
421      */
422     ALL_SUBNETWORKS_ALL_IP_RANGES(179964376),
423     /**
424      *
425      *
426      * <pre>
427      * All the primary IP ranges in every Subnetwork are allowed to Nat.
428      * </pre>
429      *
430      * <code>ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES = 185573819;</code>
431      */
432     ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES(185573819),
433     /**
434      *
435      *
436      * <pre>
437      * A list of Subnetworks are allowed to Nat (specified in the field subnetwork below)
438      * </pre>
439      *
440      * <code>LIST_OF_SUBNETWORKS = 517542270;</code>
441      */
442     LIST_OF_SUBNETWORKS(517542270),
443     UNRECOGNIZED(-1),
444     ;
445 
446     /**
447      *
448      *
449      * <pre>
450      * A value indicating that the enum field is not set.
451      * </pre>
452      *
453      * <code>UNDEFINED_SOURCE_SUBNETWORK_IP_RANGES_TO_NAT = 0;</code>
454      */
455     public static final int UNDEFINED_SOURCE_SUBNETWORK_IP_RANGES_TO_NAT_VALUE = 0;
456     /**
457      *
458      *
459      * <pre>
460      * All the IP ranges in every Subnetwork are allowed to Nat.
461      * </pre>
462      *
463      * <code>ALL_SUBNETWORKS_ALL_IP_RANGES = 179964376;</code>
464      */
465     public static final int ALL_SUBNETWORKS_ALL_IP_RANGES_VALUE = 179964376;
466     /**
467      *
468      *
469      * <pre>
470      * All the primary IP ranges in every Subnetwork are allowed to Nat.
471      * </pre>
472      *
473      * <code>ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES = 185573819;</code>
474      */
475     public static final int ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES_VALUE = 185573819;
476     /**
477      *
478      *
479      * <pre>
480      * A list of Subnetworks are allowed to Nat (specified in the field subnetwork below)
481      * </pre>
482      *
483      * <code>LIST_OF_SUBNETWORKS = 517542270;</code>
484      */
485     public static final int LIST_OF_SUBNETWORKS_VALUE = 517542270;
486 
getNumber()487     public final int getNumber() {
488       if (this == UNRECOGNIZED) {
489         throw new java.lang.IllegalArgumentException(
490             "Can't get the number of an unknown enum value.");
491       }
492       return value;
493     }
494 
495     /**
496      * @param value The numeric wire value of the corresponding enum entry.
497      * @return The enum associated with the given numeric wire value.
498      * @deprecated Use {@link #forNumber(int)} instead.
499      */
500     @java.lang.Deprecated
valueOf(int value)501     public static SourceSubnetworkIpRangesToNat valueOf(int value) {
502       return forNumber(value);
503     }
504 
505     /**
506      * @param value The numeric wire value of the corresponding enum entry.
507      * @return The enum associated with the given numeric wire value.
508      */
forNumber(int value)509     public static SourceSubnetworkIpRangesToNat forNumber(int value) {
510       switch (value) {
511         case 0:
512           return UNDEFINED_SOURCE_SUBNETWORK_IP_RANGES_TO_NAT;
513         case 179964376:
514           return ALL_SUBNETWORKS_ALL_IP_RANGES;
515         case 185573819:
516           return ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES;
517         case 517542270:
518           return LIST_OF_SUBNETWORKS;
519         default:
520           return null;
521       }
522     }
523 
524     public static com.google.protobuf.Internal.EnumLiteMap<SourceSubnetworkIpRangesToNat>
internalGetValueMap()525         internalGetValueMap() {
526       return internalValueMap;
527     }
528 
529     private static final com.google.protobuf.Internal.EnumLiteMap<SourceSubnetworkIpRangesToNat>
530         internalValueMap =
531             new com.google.protobuf.Internal.EnumLiteMap<SourceSubnetworkIpRangesToNat>() {
532               public SourceSubnetworkIpRangesToNat findValueByNumber(int number) {
533                 return SourceSubnetworkIpRangesToNat.forNumber(number);
534               }
535             };
536 
getValueDescriptor()537     public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
538       if (this == UNRECOGNIZED) {
539         throw new java.lang.IllegalStateException(
540             "Can't get the descriptor of an unrecognized enum value.");
541       }
542       return getDescriptor().getValues().get(ordinal());
543     }
544 
getDescriptorForType()545     public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
546       return getDescriptor();
547     }
548 
getDescriptor()549     public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
550       return com.google.cloud.compute.v1.RouterNat.getDescriptor().getEnumTypes().get(2);
551     }
552 
553     private static final SourceSubnetworkIpRangesToNat[] VALUES = values();
554 
valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc)555     public static SourceSubnetworkIpRangesToNat valueOf(
556         com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
557       if (desc.getType() != getDescriptor()) {
558         throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
559       }
560       if (desc.getIndex() == -1) {
561         return UNRECOGNIZED;
562       }
563       return VALUES[desc.getIndex()];
564     }
565 
566     private final int value;
567 
SourceSubnetworkIpRangesToNat(int value)568     private SourceSubnetworkIpRangesToNat(int value) {
569       this.value = value;
570     }
571 
572     // @@protoc_insertion_point(enum_scope:google.cloud.compute.v1.RouterNat.SourceSubnetworkIpRangesToNat)
573   }
574 
575   private int bitField0_;
576   public static final int DRAIN_NAT_IPS_FIELD_NUMBER = 504078535;
577 
578   @SuppressWarnings("serial")
579   private com.google.protobuf.LazyStringList drainNatIps_;
580   /**
581    *
582    *
583    * <pre>
584    * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.
585    * </pre>
586    *
587    * <code>repeated string drain_nat_ips = 504078535;</code>
588    *
589    * @return A list containing the drainNatIps.
590    */
getDrainNatIpsList()591   public com.google.protobuf.ProtocolStringList getDrainNatIpsList() {
592     return drainNatIps_;
593   }
594   /**
595    *
596    *
597    * <pre>
598    * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.
599    * </pre>
600    *
601    * <code>repeated string drain_nat_ips = 504078535;</code>
602    *
603    * @return The count of drainNatIps.
604    */
getDrainNatIpsCount()605   public int getDrainNatIpsCount() {
606     return drainNatIps_.size();
607   }
608   /**
609    *
610    *
611    * <pre>
612    * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.
613    * </pre>
614    *
615    * <code>repeated string drain_nat_ips = 504078535;</code>
616    *
617    * @param index The index of the element to return.
618    * @return The drainNatIps at the given index.
619    */
getDrainNatIps(int index)620   public java.lang.String getDrainNatIps(int index) {
621     return drainNatIps_.get(index);
622   }
623   /**
624    *
625    *
626    * <pre>
627    * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.
628    * </pre>
629    *
630    * <code>repeated string drain_nat_ips = 504078535;</code>
631    *
632    * @param index The index of the value to return.
633    * @return The bytes of the drainNatIps at the given index.
634    */
getDrainNatIpsBytes(int index)635   public com.google.protobuf.ByteString getDrainNatIpsBytes(int index) {
636     return drainNatIps_.getByteString(index);
637   }
638 
639   public static final int ENABLE_DYNAMIC_PORT_ALLOCATION_FIELD_NUMBER = 532106402;
640   private boolean enableDynamicPortAllocation_ = false;
641   /**
642    *
643    *
644    * <pre>
645    * Enable Dynamic Port Allocation. If not specified, it is disabled by default. If set to true, - Dynamic Port Allocation will be enabled on this NAT config. - enableEndpointIndependentMapping cannot be set to true. - If minPorts is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config.
646    * </pre>
647    *
648    * <code>optional bool enable_dynamic_port_allocation = 532106402;</code>
649    *
650    * @return Whether the enableDynamicPortAllocation field is set.
651    */
652   @java.lang.Override
hasEnableDynamicPortAllocation()653   public boolean hasEnableDynamicPortAllocation() {
654     return ((bitField0_ & 0x00000001) != 0);
655   }
656   /**
657    *
658    *
659    * <pre>
660    * Enable Dynamic Port Allocation. If not specified, it is disabled by default. If set to true, - Dynamic Port Allocation will be enabled on this NAT config. - enableEndpointIndependentMapping cannot be set to true. - If minPorts is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config.
661    * </pre>
662    *
663    * <code>optional bool enable_dynamic_port_allocation = 532106402;</code>
664    *
665    * @return The enableDynamicPortAllocation.
666    */
667   @java.lang.Override
getEnableDynamicPortAllocation()668   public boolean getEnableDynamicPortAllocation() {
669     return enableDynamicPortAllocation_;
670   }
671 
672   public static final int ENABLE_ENDPOINT_INDEPENDENT_MAPPING_FIELD_NUMBER = 259441819;
673   private boolean enableEndpointIndependentMapping_ = false;
674   /**
675    * <code>optional bool enable_endpoint_independent_mapping = 259441819;</code>
676    *
677    * @return Whether the enableEndpointIndependentMapping field is set.
678    */
679   @java.lang.Override
hasEnableEndpointIndependentMapping()680   public boolean hasEnableEndpointIndependentMapping() {
681     return ((bitField0_ & 0x00000002) != 0);
682   }
683   /**
684    * <code>optional bool enable_endpoint_independent_mapping = 259441819;</code>
685    *
686    * @return The enableEndpointIndependentMapping.
687    */
688   @java.lang.Override
getEnableEndpointIndependentMapping()689   public boolean getEnableEndpointIndependentMapping() {
690     return enableEndpointIndependentMapping_;
691   }
692 
693   public static final int ENDPOINT_TYPES_FIELD_NUMBER = 502633807;
694 
695   @SuppressWarnings("serial")
696   private com.google.protobuf.LazyStringList endpointTypes_;
697   /**
698    *
699    *
700    * <pre>
701    * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM
702    * Check the EndpointTypes enum for the list of possible values.
703    * </pre>
704    *
705    * <code>repeated string endpoint_types = 502633807;</code>
706    *
707    * @return A list containing the endpointTypes.
708    */
getEndpointTypesList()709   public com.google.protobuf.ProtocolStringList getEndpointTypesList() {
710     return endpointTypes_;
711   }
712   /**
713    *
714    *
715    * <pre>
716    * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM
717    * Check the EndpointTypes enum for the list of possible values.
718    * </pre>
719    *
720    * <code>repeated string endpoint_types = 502633807;</code>
721    *
722    * @return The count of endpointTypes.
723    */
getEndpointTypesCount()724   public int getEndpointTypesCount() {
725     return endpointTypes_.size();
726   }
727   /**
728    *
729    *
730    * <pre>
731    * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM
732    * Check the EndpointTypes enum for the list of possible values.
733    * </pre>
734    *
735    * <code>repeated string endpoint_types = 502633807;</code>
736    *
737    * @param index The index of the element to return.
738    * @return The endpointTypes at the given index.
739    */
getEndpointTypes(int index)740   public java.lang.String getEndpointTypes(int index) {
741     return endpointTypes_.get(index);
742   }
743   /**
744    *
745    *
746    * <pre>
747    * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM
748    * Check the EndpointTypes enum for the list of possible values.
749    * </pre>
750    *
751    * <code>repeated string endpoint_types = 502633807;</code>
752    *
753    * @param index The index of the value to return.
754    * @return The bytes of the endpointTypes at the given index.
755    */
getEndpointTypesBytes(int index)756   public com.google.protobuf.ByteString getEndpointTypesBytes(int index) {
757     return endpointTypes_.getByteString(index);
758   }
759 
760   public static final int ICMP_IDLE_TIMEOUT_SEC_FIELD_NUMBER = 3647562;
761   private int icmpIdleTimeoutSec_ = 0;
762   /**
763    *
764    *
765    * <pre>
766    * Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
767    * </pre>
768    *
769    * <code>optional int32 icmp_idle_timeout_sec = 3647562;</code>
770    *
771    * @return Whether the icmpIdleTimeoutSec field is set.
772    */
773   @java.lang.Override
hasIcmpIdleTimeoutSec()774   public boolean hasIcmpIdleTimeoutSec() {
775     return ((bitField0_ & 0x00000004) != 0);
776   }
777   /**
778    *
779    *
780    * <pre>
781    * Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
782    * </pre>
783    *
784    * <code>optional int32 icmp_idle_timeout_sec = 3647562;</code>
785    *
786    * @return The icmpIdleTimeoutSec.
787    */
788   @java.lang.Override
getIcmpIdleTimeoutSec()789   public int getIcmpIdleTimeoutSec() {
790     return icmpIdleTimeoutSec_;
791   }
792 
793   public static final int LOG_CONFIG_FIELD_NUMBER = 351299741;
794   private com.google.cloud.compute.v1.RouterNatLogConfig logConfig_;
795   /**
796    *
797    *
798    * <pre>
799    * Configure logging on this NAT.
800    * </pre>
801    *
802    * <code>optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;</code>
803    *
804    * @return Whether the logConfig field is set.
805    */
806   @java.lang.Override
hasLogConfig()807   public boolean hasLogConfig() {
808     return ((bitField0_ & 0x00000008) != 0);
809   }
810   /**
811    *
812    *
813    * <pre>
814    * Configure logging on this NAT.
815    * </pre>
816    *
817    * <code>optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;</code>
818    *
819    * @return The logConfig.
820    */
821   @java.lang.Override
getLogConfig()822   public com.google.cloud.compute.v1.RouterNatLogConfig getLogConfig() {
823     return logConfig_ == null
824         ? com.google.cloud.compute.v1.RouterNatLogConfig.getDefaultInstance()
825         : logConfig_;
826   }
827   /**
828    *
829    *
830    * <pre>
831    * Configure logging on this NAT.
832    * </pre>
833    *
834    * <code>optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;</code>
835    */
836   @java.lang.Override
getLogConfigOrBuilder()837   public com.google.cloud.compute.v1.RouterNatLogConfigOrBuilder getLogConfigOrBuilder() {
838     return logConfig_ == null
839         ? com.google.cloud.compute.v1.RouterNatLogConfig.getDefaultInstance()
840         : logConfig_;
841   }
842 
843   public static final int MAX_PORTS_PER_VM_FIELD_NUMBER = 250062049;
844   private int maxPortsPerVm_ = 0;
845   /**
846    *
847    *
848    * <pre>
849    * Maximum number of ports allocated to a VM from this NAT config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation is not enabled, this field has no effect. If Dynamic Port Allocation is enabled, and this field is set, it must be set to a power of two greater than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port Allocation is enabled and this field is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config.
850    * </pre>
851    *
852    * <code>optional int32 max_ports_per_vm = 250062049;</code>
853    *
854    * @return Whether the maxPortsPerVm field is set.
855    */
856   @java.lang.Override
hasMaxPortsPerVm()857   public boolean hasMaxPortsPerVm() {
858     return ((bitField0_ & 0x00000010) != 0);
859   }
860   /**
861    *
862    *
863    * <pre>
864    * Maximum number of ports allocated to a VM from this NAT config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation is not enabled, this field has no effect. If Dynamic Port Allocation is enabled, and this field is set, it must be set to a power of two greater than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port Allocation is enabled and this field is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config.
865    * </pre>
866    *
867    * <code>optional int32 max_ports_per_vm = 250062049;</code>
868    *
869    * @return The maxPortsPerVm.
870    */
871   @java.lang.Override
getMaxPortsPerVm()872   public int getMaxPortsPerVm() {
873     return maxPortsPerVm_;
874   }
875 
876   public static final int MIN_PORTS_PER_VM_FIELD_NUMBER = 186193587;
877   private int minPortsPerVm_ = 0;
878   /**
879    *
880    *
881    * <pre>
882    * Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM.
883    * </pre>
884    *
885    * <code>optional int32 min_ports_per_vm = 186193587;</code>
886    *
887    * @return Whether the minPortsPerVm field is set.
888    */
889   @java.lang.Override
hasMinPortsPerVm()890   public boolean hasMinPortsPerVm() {
891     return ((bitField0_ & 0x00000020) != 0);
892   }
893   /**
894    *
895    *
896    * <pre>
897    * Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM.
898    * </pre>
899    *
900    * <code>optional int32 min_ports_per_vm = 186193587;</code>
901    *
902    * @return The minPortsPerVm.
903    */
904   @java.lang.Override
getMinPortsPerVm()905   public int getMinPortsPerVm() {
906     return minPortsPerVm_;
907   }
908 
909   public static final int NAME_FIELD_NUMBER = 3373707;
910 
911   @SuppressWarnings("serial")
912   private volatile java.lang.Object name_ = "";
913   /**
914    *
915    *
916    * <pre>
917    * Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.
918    * </pre>
919    *
920    * <code>optional string name = 3373707;</code>
921    *
922    * @return Whether the name field is set.
923    */
924   @java.lang.Override
hasName()925   public boolean hasName() {
926     return ((bitField0_ & 0x00000040) != 0);
927   }
928   /**
929    *
930    *
931    * <pre>
932    * Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.
933    * </pre>
934    *
935    * <code>optional string name = 3373707;</code>
936    *
937    * @return The name.
938    */
939   @java.lang.Override
getName()940   public java.lang.String getName() {
941     java.lang.Object ref = name_;
942     if (ref instanceof java.lang.String) {
943       return (java.lang.String) ref;
944     } else {
945       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
946       java.lang.String s = bs.toStringUtf8();
947       name_ = s;
948       return s;
949     }
950   }
951   /**
952    *
953    *
954    * <pre>
955    * Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.
956    * </pre>
957    *
958    * <code>optional string name = 3373707;</code>
959    *
960    * @return The bytes for name.
961    */
962   @java.lang.Override
getNameBytes()963   public com.google.protobuf.ByteString getNameBytes() {
964     java.lang.Object ref = name_;
965     if (ref instanceof java.lang.String) {
966       com.google.protobuf.ByteString b =
967           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
968       name_ = b;
969       return b;
970     } else {
971       return (com.google.protobuf.ByteString) ref;
972     }
973   }
974 
975   public static final int NAT_IP_ALLOCATE_OPTION_FIELD_NUMBER = 429726845;
976 
977   @SuppressWarnings("serial")
978   private volatile java.lang.Object natIpAllocateOption_ = "";
979   /**
980    *
981    *
982    * <pre>
983    * Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty.
984    * Check the NatIpAllocateOption enum for the list of possible values.
985    * </pre>
986    *
987    * <code>optional string nat_ip_allocate_option = 429726845;</code>
988    *
989    * @return Whether the natIpAllocateOption field is set.
990    */
991   @java.lang.Override
hasNatIpAllocateOption()992   public boolean hasNatIpAllocateOption() {
993     return ((bitField0_ & 0x00000080) != 0);
994   }
995   /**
996    *
997    *
998    * <pre>
999    * Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty.
1000    * Check the NatIpAllocateOption enum for the list of possible values.
1001    * </pre>
1002    *
1003    * <code>optional string nat_ip_allocate_option = 429726845;</code>
1004    *
1005    * @return The natIpAllocateOption.
1006    */
1007   @java.lang.Override
getNatIpAllocateOption()1008   public java.lang.String getNatIpAllocateOption() {
1009     java.lang.Object ref = natIpAllocateOption_;
1010     if (ref instanceof java.lang.String) {
1011       return (java.lang.String) ref;
1012     } else {
1013       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1014       java.lang.String s = bs.toStringUtf8();
1015       natIpAllocateOption_ = s;
1016       return s;
1017     }
1018   }
1019   /**
1020    *
1021    *
1022    * <pre>
1023    * Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty.
1024    * Check the NatIpAllocateOption enum for the list of possible values.
1025    * </pre>
1026    *
1027    * <code>optional string nat_ip_allocate_option = 429726845;</code>
1028    *
1029    * @return The bytes for natIpAllocateOption.
1030    */
1031   @java.lang.Override
getNatIpAllocateOptionBytes()1032   public com.google.protobuf.ByteString getNatIpAllocateOptionBytes() {
1033     java.lang.Object ref = natIpAllocateOption_;
1034     if (ref instanceof java.lang.String) {
1035       com.google.protobuf.ByteString b =
1036           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1037       natIpAllocateOption_ = b;
1038       return b;
1039     } else {
1040       return (com.google.protobuf.ByteString) ref;
1041     }
1042   }
1043 
1044   public static final int NAT_IPS_FIELD_NUMBER = 117635086;
1045 
1046   @SuppressWarnings("serial")
1047   private com.google.protobuf.LazyStringList natIps_;
1048   /**
1049    *
1050    *
1051    * <pre>
1052    * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.
1053    * </pre>
1054    *
1055    * <code>repeated string nat_ips = 117635086;</code>
1056    *
1057    * @return A list containing the natIps.
1058    */
getNatIpsList()1059   public com.google.protobuf.ProtocolStringList getNatIpsList() {
1060     return natIps_;
1061   }
1062   /**
1063    *
1064    *
1065    * <pre>
1066    * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.
1067    * </pre>
1068    *
1069    * <code>repeated string nat_ips = 117635086;</code>
1070    *
1071    * @return The count of natIps.
1072    */
getNatIpsCount()1073   public int getNatIpsCount() {
1074     return natIps_.size();
1075   }
1076   /**
1077    *
1078    *
1079    * <pre>
1080    * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.
1081    * </pre>
1082    *
1083    * <code>repeated string nat_ips = 117635086;</code>
1084    *
1085    * @param index The index of the element to return.
1086    * @return The natIps at the given index.
1087    */
getNatIps(int index)1088   public java.lang.String getNatIps(int index) {
1089     return natIps_.get(index);
1090   }
1091   /**
1092    *
1093    *
1094    * <pre>
1095    * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.
1096    * </pre>
1097    *
1098    * <code>repeated string nat_ips = 117635086;</code>
1099    *
1100    * @param index The index of the value to return.
1101    * @return The bytes of the natIps at the given index.
1102    */
getNatIpsBytes(int index)1103   public com.google.protobuf.ByteString getNatIpsBytes(int index) {
1104     return natIps_.getByteString(index);
1105   }
1106 
1107   public static final int RULES_FIELD_NUMBER = 108873975;
1108 
1109   @SuppressWarnings("serial")
1110   private java.util.List<com.google.cloud.compute.v1.RouterNatRule> rules_;
1111   /**
1112    *
1113    *
1114    * <pre>
1115    * A list of rules associated with this NAT.
1116    * </pre>
1117    *
1118    * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
1119    */
1120   @java.lang.Override
getRulesList()1121   public java.util.List<com.google.cloud.compute.v1.RouterNatRule> getRulesList() {
1122     return rules_;
1123   }
1124   /**
1125    *
1126    *
1127    * <pre>
1128    * A list of rules associated with this NAT.
1129    * </pre>
1130    *
1131    * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
1132    */
1133   @java.lang.Override
1134   public java.util.List<? extends com.google.cloud.compute.v1.RouterNatRuleOrBuilder>
getRulesOrBuilderList()1135       getRulesOrBuilderList() {
1136     return rules_;
1137   }
1138   /**
1139    *
1140    *
1141    * <pre>
1142    * A list of rules associated with this NAT.
1143    * </pre>
1144    *
1145    * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
1146    */
1147   @java.lang.Override
getRulesCount()1148   public int getRulesCount() {
1149     return rules_.size();
1150   }
1151   /**
1152    *
1153    *
1154    * <pre>
1155    * A list of rules associated with this NAT.
1156    * </pre>
1157    *
1158    * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
1159    */
1160   @java.lang.Override
getRules(int index)1161   public com.google.cloud.compute.v1.RouterNatRule getRules(int index) {
1162     return rules_.get(index);
1163   }
1164   /**
1165    *
1166    *
1167    * <pre>
1168    * A list of rules associated with this NAT.
1169    * </pre>
1170    *
1171    * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
1172    */
1173   @java.lang.Override
getRulesOrBuilder(int index)1174   public com.google.cloud.compute.v1.RouterNatRuleOrBuilder getRulesOrBuilder(int index) {
1175     return rules_.get(index);
1176   }
1177 
1178   public static final int SOURCE_SUBNETWORK_IP_RANGES_TO_NAT_FIELD_NUMBER = 252213211;
1179 
1180   @SuppressWarnings("serial")
1181   private volatile java.lang.Object sourceSubnetworkIpRangesToNat_ = "";
1182   /**
1183    *
1184    *
1185    * <pre>
1186    * Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other Router.Nat section in any Router for this network in this region.
1187    * Check the SourceSubnetworkIpRangesToNat enum for the list of possible values.
1188    * </pre>
1189    *
1190    * <code>optional string source_subnetwork_ip_ranges_to_nat = 252213211;</code>
1191    *
1192    * @return Whether the sourceSubnetworkIpRangesToNat field is set.
1193    */
1194   @java.lang.Override
hasSourceSubnetworkIpRangesToNat()1195   public boolean hasSourceSubnetworkIpRangesToNat() {
1196     return ((bitField0_ & 0x00000100) != 0);
1197   }
1198   /**
1199    *
1200    *
1201    * <pre>
1202    * Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other Router.Nat section in any Router for this network in this region.
1203    * Check the SourceSubnetworkIpRangesToNat enum for the list of possible values.
1204    * </pre>
1205    *
1206    * <code>optional string source_subnetwork_ip_ranges_to_nat = 252213211;</code>
1207    *
1208    * @return The sourceSubnetworkIpRangesToNat.
1209    */
1210   @java.lang.Override
getSourceSubnetworkIpRangesToNat()1211   public java.lang.String getSourceSubnetworkIpRangesToNat() {
1212     java.lang.Object ref = sourceSubnetworkIpRangesToNat_;
1213     if (ref instanceof java.lang.String) {
1214       return (java.lang.String) ref;
1215     } else {
1216       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1217       java.lang.String s = bs.toStringUtf8();
1218       sourceSubnetworkIpRangesToNat_ = s;
1219       return s;
1220     }
1221   }
1222   /**
1223    *
1224    *
1225    * <pre>
1226    * Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other Router.Nat section in any Router for this network in this region.
1227    * Check the SourceSubnetworkIpRangesToNat enum for the list of possible values.
1228    * </pre>
1229    *
1230    * <code>optional string source_subnetwork_ip_ranges_to_nat = 252213211;</code>
1231    *
1232    * @return The bytes for sourceSubnetworkIpRangesToNat.
1233    */
1234   @java.lang.Override
getSourceSubnetworkIpRangesToNatBytes()1235   public com.google.protobuf.ByteString getSourceSubnetworkIpRangesToNatBytes() {
1236     java.lang.Object ref = sourceSubnetworkIpRangesToNat_;
1237     if (ref instanceof java.lang.String) {
1238       com.google.protobuf.ByteString b =
1239           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1240       sourceSubnetworkIpRangesToNat_ = b;
1241       return b;
1242     } else {
1243       return (com.google.protobuf.ByteString) ref;
1244     }
1245   }
1246 
1247   public static final int SUBNETWORKS_FIELD_NUMBER = 415853125;
1248 
1249   @SuppressWarnings("serial")
1250   private java.util.List<com.google.cloud.compute.v1.RouterNatSubnetworkToNat> subnetworks_;
1251   /**
1252    *
1253    *
1254    * <pre>
1255    * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
1256    * </pre>
1257    *
1258    * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
1259    * </code>
1260    */
1261   @java.lang.Override
getSubnetworksList()1262   public java.util.List<com.google.cloud.compute.v1.RouterNatSubnetworkToNat> getSubnetworksList() {
1263     return subnetworks_;
1264   }
1265   /**
1266    *
1267    *
1268    * <pre>
1269    * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
1270    * </pre>
1271    *
1272    * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
1273    * </code>
1274    */
1275   @java.lang.Override
1276   public java.util.List<? extends com.google.cloud.compute.v1.RouterNatSubnetworkToNatOrBuilder>
getSubnetworksOrBuilderList()1277       getSubnetworksOrBuilderList() {
1278     return subnetworks_;
1279   }
1280   /**
1281    *
1282    *
1283    * <pre>
1284    * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
1285    * </pre>
1286    *
1287    * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
1288    * </code>
1289    */
1290   @java.lang.Override
getSubnetworksCount()1291   public int getSubnetworksCount() {
1292     return subnetworks_.size();
1293   }
1294   /**
1295    *
1296    *
1297    * <pre>
1298    * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
1299    * </pre>
1300    *
1301    * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
1302    * </code>
1303    */
1304   @java.lang.Override
getSubnetworks(int index)1305   public com.google.cloud.compute.v1.RouterNatSubnetworkToNat getSubnetworks(int index) {
1306     return subnetworks_.get(index);
1307   }
1308   /**
1309    *
1310    *
1311    * <pre>
1312    * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
1313    * </pre>
1314    *
1315    * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
1316    * </code>
1317    */
1318   @java.lang.Override
getSubnetworksOrBuilder( int index)1319   public com.google.cloud.compute.v1.RouterNatSubnetworkToNatOrBuilder getSubnetworksOrBuilder(
1320       int index) {
1321     return subnetworks_.get(index);
1322   }
1323 
1324   public static final int TCP_ESTABLISHED_IDLE_TIMEOUT_SEC_FIELD_NUMBER = 223098349;
1325   private int tcpEstablishedIdleTimeoutSec_ = 0;
1326   /**
1327    *
1328    *
1329    * <pre>
1330    * Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
1331    * </pre>
1332    *
1333    * <code>optional int32 tcp_established_idle_timeout_sec = 223098349;</code>
1334    *
1335    * @return Whether the tcpEstablishedIdleTimeoutSec field is set.
1336    */
1337   @java.lang.Override
hasTcpEstablishedIdleTimeoutSec()1338   public boolean hasTcpEstablishedIdleTimeoutSec() {
1339     return ((bitField0_ & 0x00000200) != 0);
1340   }
1341   /**
1342    *
1343    *
1344    * <pre>
1345    * Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
1346    * </pre>
1347    *
1348    * <code>optional int32 tcp_established_idle_timeout_sec = 223098349;</code>
1349    *
1350    * @return The tcpEstablishedIdleTimeoutSec.
1351    */
1352   @java.lang.Override
getTcpEstablishedIdleTimeoutSec()1353   public int getTcpEstablishedIdleTimeoutSec() {
1354     return tcpEstablishedIdleTimeoutSec_;
1355   }
1356 
1357   public static final int TCP_TIME_WAIT_TIMEOUT_SEC_FIELD_NUMBER = 513596925;
1358   private int tcpTimeWaitTimeoutSec_ = 0;
1359   /**
1360    *
1361    *
1362    * <pre>
1363    * Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
1364    * </pre>
1365    *
1366    * <code>optional int32 tcp_time_wait_timeout_sec = 513596925;</code>
1367    *
1368    * @return Whether the tcpTimeWaitTimeoutSec field is set.
1369    */
1370   @java.lang.Override
hasTcpTimeWaitTimeoutSec()1371   public boolean hasTcpTimeWaitTimeoutSec() {
1372     return ((bitField0_ & 0x00000400) != 0);
1373   }
1374   /**
1375    *
1376    *
1377    * <pre>
1378    * Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
1379    * </pre>
1380    *
1381    * <code>optional int32 tcp_time_wait_timeout_sec = 513596925;</code>
1382    *
1383    * @return The tcpTimeWaitTimeoutSec.
1384    */
1385   @java.lang.Override
getTcpTimeWaitTimeoutSec()1386   public int getTcpTimeWaitTimeoutSec() {
1387     return tcpTimeWaitTimeoutSec_;
1388   }
1389 
1390   public static final int TCP_TRANSITORY_IDLE_TIMEOUT_SEC_FIELD_NUMBER = 205028774;
1391   private int tcpTransitoryIdleTimeoutSec_ = 0;
1392   /**
1393    *
1394    *
1395    * <pre>
1396    * Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
1397    * </pre>
1398    *
1399    * <code>optional int32 tcp_transitory_idle_timeout_sec = 205028774;</code>
1400    *
1401    * @return Whether the tcpTransitoryIdleTimeoutSec field is set.
1402    */
1403   @java.lang.Override
hasTcpTransitoryIdleTimeoutSec()1404   public boolean hasTcpTransitoryIdleTimeoutSec() {
1405     return ((bitField0_ & 0x00000800) != 0);
1406   }
1407   /**
1408    *
1409    *
1410    * <pre>
1411    * Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
1412    * </pre>
1413    *
1414    * <code>optional int32 tcp_transitory_idle_timeout_sec = 205028774;</code>
1415    *
1416    * @return The tcpTransitoryIdleTimeoutSec.
1417    */
1418   @java.lang.Override
getTcpTransitoryIdleTimeoutSec()1419   public int getTcpTransitoryIdleTimeoutSec() {
1420     return tcpTransitoryIdleTimeoutSec_;
1421   }
1422 
1423   public static final int UDP_IDLE_TIMEOUT_SEC_FIELD_NUMBER = 64919878;
1424   private int udpIdleTimeoutSec_ = 0;
1425   /**
1426    *
1427    *
1428    * <pre>
1429    * Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
1430    * </pre>
1431    *
1432    * <code>optional int32 udp_idle_timeout_sec = 64919878;</code>
1433    *
1434    * @return Whether the udpIdleTimeoutSec field is set.
1435    */
1436   @java.lang.Override
hasUdpIdleTimeoutSec()1437   public boolean hasUdpIdleTimeoutSec() {
1438     return ((bitField0_ & 0x00001000) != 0);
1439   }
1440   /**
1441    *
1442    *
1443    * <pre>
1444    * Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
1445    * </pre>
1446    *
1447    * <code>optional int32 udp_idle_timeout_sec = 64919878;</code>
1448    *
1449    * @return The udpIdleTimeoutSec.
1450    */
1451   @java.lang.Override
getUdpIdleTimeoutSec()1452   public int getUdpIdleTimeoutSec() {
1453     return udpIdleTimeoutSec_;
1454   }
1455 
1456   private byte memoizedIsInitialized = -1;
1457 
1458   @java.lang.Override
isInitialized()1459   public final boolean isInitialized() {
1460     byte isInitialized = memoizedIsInitialized;
1461     if (isInitialized == 1) return true;
1462     if (isInitialized == 0) return false;
1463 
1464     memoizedIsInitialized = 1;
1465     return true;
1466   }
1467 
1468   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)1469   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
1470     if (((bitField0_ & 0x00000040) != 0)) {
1471       com.google.protobuf.GeneratedMessageV3.writeString(output, 3373707, name_);
1472     }
1473     if (((bitField0_ & 0x00000004) != 0)) {
1474       output.writeInt32(3647562, icmpIdleTimeoutSec_);
1475     }
1476     if (((bitField0_ & 0x00001000) != 0)) {
1477       output.writeInt32(64919878, udpIdleTimeoutSec_);
1478     }
1479     for (int i = 0; i < rules_.size(); i++) {
1480       output.writeMessage(108873975, rules_.get(i));
1481     }
1482     for (int i = 0; i < natIps_.size(); i++) {
1483       com.google.protobuf.GeneratedMessageV3.writeString(output, 117635086, natIps_.getRaw(i));
1484     }
1485     if (((bitField0_ & 0x00000020) != 0)) {
1486       output.writeInt32(186193587, minPortsPerVm_);
1487     }
1488     if (((bitField0_ & 0x00000800) != 0)) {
1489       output.writeInt32(205028774, tcpTransitoryIdleTimeoutSec_);
1490     }
1491     if (((bitField0_ & 0x00000200) != 0)) {
1492       output.writeInt32(223098349, tcpEstablishedIdleTimeoutSec_);
1493     }
1494     if (((bitField0_ & 0x00000010) != 0)) {
1495       output.writeInt32(250062049, maxPortsPerVm_);
1496     }
1497     if (((bitField0_ & 0x00000100) != 0)) {
1498       com.google.protobuf.GeneratedMessageV3.writeString(
1499           output, 252213211, sourceSubnetworkIpRangesToNat_);
1500     }
1501     if (((bitField0_ & 0x00000002) != 0)) {
1502       output.writeBool(259441819, enableEndpointIndependentMapping_);
1503     }
1504     if (((bitField0_ & 0x00000008) != 0)) {
1505       output.writeMessage(351299741, getLogConfig());
1506     }
1507     for (int i = 0; i < subnetworks_.size(); i++) {
1508       output.writeMessage(415853125, subnetworks_.get(i));
1509     }
1510     if (((bitField0_ & 0x00000080) != 0)) {
1511       com.google.protobuf.GeneratedMessageV3.writeString(output, 429726845, natIpAllocateOption_);
1512     }
1513     for (int i = 0; i < endpointTypes_.size(); i++) {
1514       com.google.protobuf.GeneratedMessageV3.writeString(
1515           output, 502633807, endpointTypes_.getRaw(i));
1516     }
1517     for (int i = 0; i < drainNatIps_.size(); i++) {
1518       com.google.protobuf.GeneratedMessageV3.writeString(output, 504078535, drainNatIps_.getRaw(i));
1519     }
1520     if (((bitField0_ & 0x00000400) != 0)) {
1521       output.writeInt32(513596925, tcpTimeWaitTimeoutSec_);
1522     }
1523     if (((bitField0_ & 0x00000001) != 0)) {
1524       output.writeBool(532106402, enableDynamicPortAllocation_);
1525     }
1526     getUnknownFields().writeTo(output);
1527   }
1528 
1529   @java.lang.Override
getSerializedSize()1530   public int getSerializedSize() {
1531     int size = memoizedSize;
1532     if (size != -1) return size;
1533 
1534     size = 0;
1535     if (((bitField0_ & 0x00000040) != 0)) {
1536       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3373707, name_);
1537     }
1538     if (((bitField0_ & 0x00000004) != 0)) {
1539       size += com.google.protobuf.CodedOutputStream.computeInt32Size(3647562, icmpIdleTimeoutSec_);
1540     }
1541     if (((bitField0_ & 0x00001000) != 0)) {
1542       size += com.google.protobuf.CodedOutputStream.computeInt32Size(64919878, udpIdleTimeoutSec_);
1543     }
1544     for (int i = 0; i < rules_.size(); i++) {
1545       size += com.google.protobuf.CodedOutputStream.computeMessageSize(108873975, rules_.get(i));
1546     }
1547     {
1548       int dataSize = 0;
1549       for (int i = 0; i < natIps_.size(); i++) {
1550         dataSize += computeStringSizeNoTag(natIps_.getRaw(i));
1551       }
1552       size += dataSize;
1553       size += 5 * getNatIpsList().size();
1554     }
1555     if (((bitField0_ & 0x00000020) != 0)) {
1556       size += com.google.protobuf.CodedOutputStream.computeInt32Size(186193587, minPortsPerVm_);
1557     }
1558     if (((bitField0_ & 0x00000800) != 0)) {
1559       size +=
1560           com.google.protobuf.CodedOutputStream.computeInt32Size(
1561               205028774, tcpTransitoryIdleTimeoutSec_);
1562     }
1563     if (((bitField0_ & 0x00000200) != 0)) {
1564       size +=
1565           com.google.protobuf.CodedOutputStream.computeInt32Size(
1566               223098349, tcpEstablishedIdleTimeoutSec_);
1567     }
1568     if (((bitField0_ & 0x00000010) != 0)) {
1569       size += com.google.protobuf.CodedOutputStream.computeInt32Size(250062049, maxPortsPerVm_);
1570     }
1571     if (((bitField0_ & 0x00000100) != 0)) {
1572       size +=
1573           com.google.protobuf.GeneratedMessageV3.computeStringSize(
1574               252213211, sourceSubnetworkIpRangesToNat_);
1575     }
1576     if (((bitField0_ & 0x00000002) != 0)) {
1577       size +=
1578           com.google.protobuf.CodedOutputStream.computeBoolSize(
1579               259441819, enableEndpointIndependentMapping_);
1580     }
1581     if (((bitField0_ & 0x00000008) != 0)) {
1582       size += com.google.protobuf.CodedOutputStream.computeMessageSize(351299741, getLogConfig());
1583     }
1584     for (int i = 0; i < subnetworks_.size(); i++) {
1585       size +=
1586           com.google.protobuf.CodedOutputStream.computeMessageSize(415853125, subnetworks_.get(i));
1587     }
1588     if (((bitField0_ & 0x00000080) != 0)) {
1589       size +=
1590           com.google.protobuf.GeneratedMessageV3.computeStringSize(429726845, natIpAllocateOption_);
1591     }
1592     {
1593       int dataSize = 0;
1594       for (int i = 0; i < endpointTypes_.size(); i++) {
1595         dataSize += computeStringSizeNoTag(endpointTypes_.getRaw(i));
1596       }
1597       size += dataSize;
1598       size += 5 * getEndpointTypesList().size();
1599     }
1600     {
1601       int dataSize = 0;
1602       for (int i = 0; i < drainNatIps_.size(); i++) {
1603         dataSize += computeStringSizeNoTag(drainNatIps_.getRaw(i));
1604       }
1605       size += dataSize;
1606       size += 5 * getDrainNatIpsList().size();
1607     }
1608     if (((bitField0_ & 0x00000400) != 0)) {
1609       size +=
1610           com.google.protobuf.CodedOutputStream.computeInt32Size(513596925, tcpTimeWaitTimeoutSec_);
1611     }
1612     if (((bitField0_ & 0x00000001) != 0)) {
1613       size +=
1614           com.google.protobuf.CodedOutputStream.computeBoolSize(
1615               532106402, enableDynamicPortAllocation_);
1616     }
1617     size += getUnknownFields().getSerializedSize();
1618     memoizedSize = size;
1619     return size;
1620   }
1621 
1622   @java.lang.Override
equals(final java.lang.Object obj)1623   public boolean equals(final java.lang.Object obj) {
1624     if (obj == this) {
1625       return true;
1626     }
1627     if (!(obj instanceof com.google.cloud.compute.v1.RouterNat)) {
1628       return super.equals(obj);
1629     }
1630     com.google.cloud.compute.v1.RouterNat other = (com.google.cloud.compute.v1.RouterNat) obj;
1631 
1632     if (!getDrainNatIpsList().equals(other.getDrainNatIpsList())) return false;
1633     if (hasEnableDynamicPortAllocation() != other.hasEnableDynamicPortAllocation()) return false;
1634     if (hasEnableDynamicPortAllocation()) {
1635       if (getEnableDynamicPortAllocation() != other.getEnableDynamicPortAllocation()) return false;
1636     }
1637     if (hasEnableEndpointIndependentMapping() != other.hasEnableEndpointIndependentMapping())
1638       return false;
1639     if (hasEnableEndpointIndependentMapping()) {
1640       if (getEnableEndpointIndependentMapping() != other.getEnableEndpointIndependentMapping())
1641         return false;
1642     }
1643     if (!getEndpointTypesList().equals(other.getEndpointTypesList())) return false;
1644     if (hasIcmpIdleTimeoutSec() != other.hasIcmpIdleTimeoutSec()) return false;
1645     if (hasIcmpIdleTimeoutSec()) {
1646       if (getIcmpIdleTimeoutSec() != other.getIcmpIdleTimeoutSec()) return false;
1647     }
1648     if (hasLogConfig() != other.hasLogConfig()) return false;
1649     if (hasLogConfig()) {
1650       if (!getLogConfig().equals(other.getLogConfig())) return false;
1651     }
1652     if (hasMaxPortsPerVm() != other.hasMaxPortsPerVm()) return false;
1653     if (hasMaxPortsPerVm()) {
1654       if (getMaxPortsPerVm() != other.getMaxPortsPerVm()) return false;
1655     }
1656     if (hasMinPortsPerVm() != other.hasMinPortsPerVm()) return false;
1657     if (hasMinPortsPerVm()) {
1658       if (getMinPortsPerVm() != other.getMinPortsPerVm()) return false;
1659     }
1660     if (hasName() != other.hasName()) return false;
1661     if (hasName()) {
1662       if (!getName().equals(other.getName())) return false;
1663     }
1664     if (hasNatIpAllocateOption() != other.hasNatIpAllocateOption()) return false;
1665     if (hasNatIpAllocateOption()) {
1666       if (!getNatIpAllocateOption().equals(other.getNatIpAllocateOption())) return false;
1667     }
1668     if (!getNatIpsList().equals(other.getNatIpsList())) return false;
1669     if (!getRulesList().equals(other.getRulesList())) return false;
1670     if (hasSourceSubnetworkIpRangesToNat() != other.hasSourceSubnetworkIpRangesToNat())
1671       return false;
1672     if (hasSourceSubnetworkIpRangesToNat()) {
1673       if (!getSourceSubnetworkIpRangesToNat().equals(other.getSourceSubnetworkIpRangesToNat()))
1674         return false;
1675     }
1676     if (!getSubnetworksList().equals(other.getSubnetworksList())) return false;
1677     if (hasTcpEstablishedIdleTimeoutSec() != other.hasTcpEstablishedIdleTimeoutSec()) return false;
1678     if (hasTcpEstablishedIdleTimeoutSec()) {
1679       if (getTcpEstablishedIdleTimeoutSec() != other.getTcpEstablishedIdleTimeoutSec())
1680         return false;
1681     }
1682     if (hasTcpTimeWaitTimeoutSec() != other.hasTcpTimeWaitTimeoutSec()) return false;
1683     if (hasTcpTimeWaitTimeoutSec()) {
1684       if (getTcpTimeWaitTimeoutSec() != other.getTcpTimeWaitTimeoutSec()) return false;
1685     }
1686     if (hasTcpTransitoryIdleTimeoutSec() != other.hasTcpTransitoryIdleTimeoutSec()) return false;
1687     if (hasTcpTransitoryIdleTimeoutSec()) {
1688       if (getTcpTransitoryIdleTimeoutSec() != other.getTcpTransitoryIdleTimeoutSec()) return false;
1689     }
1690     if (hasUdpIdleTimeoutSec() != other.hasUdpIdleTimeoutSec()) return false;
1691     if (hasUdpIdleTimeoutSec()) {
1692       if (getUdpIdleTimeoutSec() != other.getUdpIdleTimeoutSec()) return false;
1693     }
1694     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
1695     return true;
1696   }
1697 
1698   @java.lang.Override
hashCode()1699   public int hashCode() {
1700     if (memoizedHashCode != 0) {
1701       return memoizedHashCode;
1702     }
1703     int hash = 41;
1704     hash = (19 * hash) + getDescriptor().hashCode();
1705     if (getDrainNatIpsCount() > 0) {
1706       hash = (37 * hash) + DRAIN_NAT_IPS_FIELD_NUMBER;
1707       hash = (53 * hash) + getDrainNatIpsList().hashCode();
1708     }
1709     if (hasEnableDynamicPortAllocation()) {
1710       hash = (37 * hash) + ENABLE_DYNAMIC_PORT_ALLOCATION_FIELD_NUMBER;
1711       hash =
1712           (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableDynamicPortAllocation());
1713     }
1714     if (hasEnableEndpointIndependentMapping()) {
1715       hash = (37 * hash) + ENABLE_ENDPOINT_INDEPENDENT_MAPPING_FIELD_NUMBER;
1716       hash =
1717           (53 * hash)
1718               + com.google.protobuf.Internal.hashBoolean(getEnableEndpointIndependentMapping());
1719     }
1720     if (getEndpointTypesCount() > 0) {
1721       hash = (37 * hash) + ENDPOINT_TYPES_FIELD_NUMBER;
1722       hash = (53 * hash) + getEndpointTypesList().hashCode();
1723     }
1724     if (hasIcmpIdleTimeoutSec()) {
1725       hash = (37 * hash) + ICMP_IDLE_TIMEOUT_SEC_FIELD_NUMBER;
1726       hash = (53 * hash) + getIcmpIdleTimeoutSec();
1727     }
1728     if (hasLogConfig()) {
1729       hash = (37 * hash) + LOG_CONFIG_FIELD_NUMBER;
1730       hash = (53 * hash) + getLogConfig().hashCode();
1731     }
1732     if (hasMaxPortsPerVm()) {
1733       hash = (37 * hash) + MAX_PORTS_PER_VM_FIELD_NUMBER;
1734       hash = (53 * hash) + getMaxPortsPerVm();
1735     }
1736     if (hasMinPortsPerVm()) {
1737       hash = (37 * hash) + MIN_PORTS_PER_VM_FIELD_NUMBER;
1738       hash = (53 * hash) + getMinPortsPerVm();
1739     }
1740     if (hasName()) {
1741       hash = (37 * hash) + NAME_FIELD_NUMBER;
1742       hash = (53 * hash) + getName().hashCode();
1743     }
1744     if (hasNatIpAllocateOption()) {
1745       hash = (37 * hash) + NAT_IP_ALLOCATE_OPTION_FIELD_NUMBER;
1746       hash = (53 * hash) + getNatIpAllocateOption().hashCode();
1747     }
1748     if (getNatIpsCount() > 0) {
1749       hash = (37 * hash) + NAT_IPS_FIELD_NUMBER;
1750       hash = (53 * hash) + getNatIpsList().hashCode();
1751     }
1752     if (getRulesCount() > 0) {
1753       hash = (37 * hash) + RULES_FIELD_NUMBER;
1754       hash = (53 * hash) + getRulesList().hashCode();
1755     }
1756     if (hasSourceSubnetworkIpRangesToNat()) {
1757       hash = (37 * hash) + SOURCE_SUBNETWORK_IP_RANGES_TO_NAT_FIELD_NUMBER;
1758       hash = (53 * hash) + getSourceSubnetworkIpRangesToNat().hashCode();
1759     }
1760     if (getSubnetworksCount() > 0) {
1761       hash = (37 * hash) + SUBNETWORKS_FIELD_NUMBER;
1762       hash = (53 * hash) + getSubnetworksList().hashCode();
1763     }
1764     if (hasTcpEstablishedIdleTimeoutSec()) {
1765       hash = (37 * hash) + TCP_ESTABLISHED_IDLE_TIMEOUT_SEC_FIELD_NUMBER;
1766       hash = (53 * hash) + getTcpEstablishedIdleTimeoutSec();
1767     }
1768     if (hasTcpTimeWaitTimeoutSec()) {
1769       hash = (37 * hash) + TCP_TIME_WAIT_TIMEOUT_SEC_FIELD_NUMBER;
1770       hash = (53 * hash) + getTcpTimeWaitTimeoutSec();
1771     }
1772     if (hasTcpTransitoryIdleTimeoutSec()) {
1773       hash = (37 * hash) + TCP_TRANSITORY_IDLE_TIMEOUT_SEC_FIELD_NUMBER;
1774       hash = (53 * hash) + getTcpTransitoryIdleTimeoutSec();
1775     }
1776     if (hasUdpIdleTimeoutSec()) {
1777       hash = (37 * hash) + UDP_IDLE_TIMEOUT_SEC_FIELD_NUMBER;
1778       hash = (53 * hash) + getUdpIdleTimeoutSec();
1779     }
1780     hash = (29 * hash) + getUnknownFields().hashCode();
1781     memoizedHashCode = hash;
1782     return hash;
1783   }
1784 
parseFrom(java.nio.ByteBuffer data)1785   public static com.google.cloud.compute.v1.RouterNat parseFrom(java.nio.ByteBuffer data)
1786       throws com.google.protobuf.InvalidProtocolBufferException {
1787     return PARSER.parseFrom(data);
1788   }
1789 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1790   public static com.google.cloud.compute.v1.RouterNat parseFrom(
1791       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1792       throws com.google.protobuf.InvalidProtocolBufferException {
1793     return PARSER.parseFrom(data, extensionRegistry);
1794   }
1795 
parseFrom(com.google.protobuf.ByteString data)1796   public static com.google.cloud.compute.v1.RouterNat parseFrom(com.google.protobuf.ByteString data)
1797       throws com.google.protobuf.InvalidProtocolBufferException {
1798     return PARSER.parseFrom(data);
1799   }
1800 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1801   public static com.google.cloud.compute.v1.RouterNat parseFrom(
1802       com.google.protobuf.ByteString data,
1803       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1804       throws com.google.protobuf.InvalidProtocolBufferException {
1805     return PARSER.parseFrom(data, extensionRegistry);
1806   }
1807 
parseFrom(byte[] data)1808   public static com.google.cloud.compute.v1.RouterNat parseFrom(byte[] data)
1809       throws com.google.protobuf.InvalidProtocolBufferException {
1810     return PARSER.parseFrom(data);
1811   }
1812 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1813   public static com.google.cloud.compute.v1.RouterNat parseFrom(
1814       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1815       throws com.google.protobuf.InvalidProtocolBufferException {
1816     return PARSER.parseFrom(data, extensionRegistry);
1817   }
1818 
parseFrom(java.io.InputStream input)1819   public static com.google.cloud.compute.v1.RouterNat parseFrom(java.io.InputStream input)
1820       throws java.io.IOException {
1821     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
1822   }
1823 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1824   public static com.google.cloud.compute.v1.RouterNat parseFrom(
1825       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1826       throws java.io.IOException {
1827     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
1828         PARSER, input, extensionRegistry);
1829   }
1830 
parseDelimitedFrom(java.io.InputStream input)1831   public static com.google.cloud.compute.v1.RouterNat parseDelimitedFrom(java.io.InputStream input)
1832       throws java.io.IOException {
1833     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
1834   }
1835 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1836   public static com.google.cloud.compute.v1.RouterNat parseDelimitedFrom(
1837       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1838       throws java.io.IOException {
1839     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
1840         PARSER, input, extensionRegistry);
1841   }
1842 
parseFrom( com.google.protobuf.CodedInputStream input)1843   public static com.google.cloud.compute.v1.RouterNat parseFrom(
1844       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
1845     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
1846   }
1847 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1848   public static com.google.cloud.compute.v1.RouterNat parseFrom(
1849       com.google.protobuf.CodedInputStream input,
1850       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1851       throws java.io.IOException {
1852     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
1853         PARSER, input, extensionRegistry);
1854   }
1855 
1856   @java.lang.Override
newBuilderForType()1857   public Builder newBuilderForType() {
1858     return newBuilder();
1859   }
1860 
newBuilder()1861   public static Builder newBuilder() {
1862     return DEFAULT_INSTANCE.toBuilder();
1863   }
1864 
newBuilder(com.google.cloud.compute.v1.RouterNat prototype)1865   public static Builder newBuilder(com.google.cloud.compute.v1.RouterNat prototype) {
1866     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
1867   }
1868 
1869   @java.lang.Override
toBuilder()1870   public Builder toBuilder() {
1871     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
1872   }
1873 
1874   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1875   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
1876     Builder builder = new Builder(parent);
1877     return builder;
1878   }
1879   /**
1880    *
1881    *
1882    * <pre>
1883    * Represents a Nat resource. It enables the VMs within the specified subnetworks to access Internet without external IP addresses. It specifies a list of subnetworks (and the ranges within) that want to use NAT. Customers can also provide the external IPs that would be used for NAT. GCP would auto-allocate ephemeral IPs if no external IPs are provided.
1884    * </pre>
1885    *
1886    * Protobuf type {@code google.cloud.compute.v1.RouterNat}
1887    */
1888   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
1889       implements
1890       // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.RouterNat)
1891       com.google.cloud.compute.v1.RouterNatOrBuilder {
getDescriptor()1892     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
1893       return com.google.cloud.compute.v1.Compute
1894           .internal_static_google_cloud_compute_v1_RouterNat_descriptor;
1895     }
1896 
1897     @java.lang.Override
1898     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()1899         internalGetFieldAccessorTable() {
1900       return com.google.cloud.compute.v1.Compute
1901           .internal_static_google_cloud_compute_v1_RouterNat_fieldAccessorTable
1902           .ensureFieldAccessorsInitialized(
1903               com.google.cloud.compute.v1.RouterNat.class,
1904               com.google.cloud.compute.v1.RouterNat.Builder.class);
1905     }
1906 
1907     // Construct using com.google.cloud.compute.v1.RouterNat.newBuilder()
Builder()1908     private Builder() {
1909       maybeForceBuilderInitialization();
1910     }
1911 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1912     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
1913       super(parent);
1914       maybeForceBuilderInitialization();
1915     }
1916 
maybeForceBuilderInitialization()1917     private void maybeForceBuilderInitialization() {
1918       if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
1919         getLogConfigFieldBuilder();
1920         getRulesFieldBuilder();
1921         getSubnetworksFieldBuilder();
1922       }
1923     }
1924 
1925     @java.lang.Override
clear()1926     public Builder clear() {
1927       super.clear();
1928       bitField0_ = 0;
1929       drainNatIps_ = com.google.protobuf.LazyStringArrayList.EMPTY;
1930       bitField0_ = (bitField0_ & ~0x00000001);
1931       enableDynamicPortAllocation_ = false;
1932       enableEndpointIndependentMapping_ = false;
1933       endpointTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
1934       bitField0_ = (bitField0_ & ~0x00000008);
1935       icmpIdleTimeoutSec_ = 0;
1936       logConfig_ = null;
1937       if (logConfigBuilder_ != null) {
1938         logConfigBuilder_.dispose();
1939         logConfigBuilder_ = null;
1940       }
1941       maxPortsPerVm_ = 0;
1942       minPortsPerVm_ = 0;
1943       name_ = "";
1944       natIpAllocateOption_ = "";
1945       natIps_ = com.google.protobuf.LazyStringArrayList.EMPTY;
1946       bitField0_ = (bitField0_ & ~0x00000400);
1947       if (rulesBuilder_ == null) {
1948         rules_ = java.util.Collections.emptyList();
1949       } else {
1950         rules_ = null;
1951         rulesBuilder_.clear();
1952       }
1953       bitField0_ = (bitField0_ & ~0x00000800);
1954       sourceSubnetworkIpRangesToNat_ = "";
1955       if (subnetworksBuilder_ == null) {
1956         subnetworks_ = java.util.Collections.emptyList();
1957       } else {
1958         subnetworks_ = null;
1959         subnetworksBuilder_.clear();
1960       }
1961       bitField0_ = (bitField0_ & ~0x00002000);
1962       tcpEstablishedIdleTimeoutSec_ = 0;
1963       tcpTimeWaitTimeoutSec_ = 0;
1964       tcpTransitoryIdleTimeoutSec_ = 0;
1965       udpIdleTimeoutSec_ = 0;
1966       return this;
1967     }
1968 
1969     @java.lang.Override
getDescriptorForType()1970     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
1971       return com.google.cloud.compute.v1.Compute
1972           .internal_static_google_cloud_compute_v1_RouterNat_descriptor;
1973     }
1974 
1975     @java.lang.Override
getDefaultInstanceForType()1976     public com.google.cloud.compute.v1.RouterNat getDefaultInstanceForType() {
1977       return com.google.cloud.compute.v1.RouterNat.getDefaultInstance();
1978     }
1979 
1980     @java.lang.Override
build()1981     public com.google.cloud.compute.v1.RouterNat build() {
1982       com.google.cloud.compute.v1.RouterNat result = buildPartial();
1983       if (!result.isInitialized()) {
1984         throw newUninitializedMessageException(result);
1985       }
1986       return result;
1987     }
1988 
1989     @java.lang.Override
buildPartial()1990     public com.google.cloud.compute.v1.RouterNat buildPartial() {
1991       com.google.cloud.compute.v1.RouterNat result =
1992           new com.google.cloud.compute.v1.RouterNat(this);
1993       buildPartialRepeatedFields(result);
1994       if (bitField0_ != 0) {
1995         buildPartial0(result);
1996       }
1997       onBuilt();
1998       return result;
1999     }
2000 
buildPartialRepeatedFields(com.google.cloud.compute.v1.RouterNat result)2001     private void buildPartialRepeatedFields(com.google.cloud.compute.v1.RouterNat result) {
2002       if (((bitField0_ & 0x00000001) != 0)) {
2003         drainNatIps_ = drainNatIps_.getUnmodifiableView();
2004         bitField0_ = (bitField0_ & ~0x00000001);
2005       }
2006       result.drainNatIps_ = drainNatIps_;
2007       if (((bitField0_ & 0x00000008) != 0)) {
2008         endpointTypes_ = endpointTypes_.getUnmodifiableView();
2009         bitField0_ = (bitField0_ & ~0x00000008);
2010       }
2011       result.endpointTypes_ = endpointTypes_;
2012       if (((bitField0_ & 0x00000400) != 0)) {
2013         natIps_ = natIps_.getUnmodifiableView();
2014         bitField0_ = (bitField0_ & ~0x00000400);
2015       }
2016       result.natIps_ = natIps_;
2017       if (rulesBuilder_ == null) {
2018         if (((bitField0_ & 0x00000800) != 0)) {
2019           rules_ = java.util.Collections.unmodifiableList(rules_);
2020           bitField0_ = (bitField0_ & ~0x00000800);
2021         }
2022         result.rules_ = rules_;
2023       } else {
2024         result.rules_ = rulesBuilder_.build();
2025       }
2026       if (subnetworksBuilder_ == null) {
2027         if (((bitField0_ & 0x00002000) != 0)) {
2028           subnetworks_ = java.util.Collections.unmodifiableList(subnetworks_);
2029           bitField0_ = (bitField0_ & ~0x00002000);
2030         }
2031         result.subnetworks_ = subnetworks_;
2032       } else {
2033         result.subnetworks_ = subnetworksBuilder_.build();
2034       }
2035     }
2036 
buildPartial0(com.google.cloud.compute.v1.RouterNat result)2037     private void buildPartial0(com.google.cloud.compute.v1.RouterNat result) {
2038       int from_bitField0_ = bitField0_;
2039       int to_bitField0_ = 0;
2040       if (((from_bitField0_ & 0x00000002) != 0)) {
2041         result.enableDynamicPortAllocation_ = enableDynamicPortAllocation_;
2042         to_bitField0_ |= 0x00000001;
2043       }
2044       if (((from_bitField0_ & 0x00000004) != 0)) {
2045         result.enableEndpointIndependentMapping_ = enableEndpointIndependentMapping_;
2046         to_bitField0_ |= 0x00000002;
2047       }
2048       if (((from_bitField0_ & 0x00000010) != 0)) {
2049         result.icmpIdleTimeoutSec_ = icmpIdleTimeoutSec_;
2050         to_bitField0_ |= 0x00000004;
2051       }
2052       if (((from_bitField0_ & 0x00000020) != 0)) {
2053         result.logConfig_ = logConfigBuilder_ == null ? logConfig_ : logConfigBuilder_.build();
2054         to_bitField0_ |= 0x00000008;
2055       }
2056       if (((from_bitField0_ & 0x00000040) != 0)) {
2057         result.maxPortsPerVm_ = maxPortsPerVm_;
2058         to_bitField0_ |= 0x00000010;
2059       }
2060       if (((from_bitField0_ & 0x00000080) != 0)) {
2061         result.minPortsPerVm_ = minPortsPerVm_;
2062         to_bitField0_ |= 0x00000020;
2063       }
2064       if (((from_bitField0_ & 0x00000100) != 0)) {
2065         result.name_ = name_;
2066         to_bitField0_ |= 0x00000040;
2067       }
2068       if (((from_bitField0_ & 0x00000200) != 0)) {
2069         result.natIpAllocateOption_ = natIpAllocateOption_;
2070         to_bitField0_ |= 0x00000080;
2071       }
2072       if (((from_bitField0_ & 0x00001000) != 0)) {
2073         result.sourceSubnetworkIpRangesToNat_ = sourceSubnetworkIpRangesToNat_;
2074         to_bitField0_ |= 0x00000100;
2075       }
2076       if (((from_bitField0_ & 0x00004000) != 0)) {
2077         result.tcpEstablishedIdleTimeoutSec_ = tcpEstablishedIdleTimeoutSec_;
2078         to_bitField0_ |= 0x00000200;
2079       }
2080       if (((from_bitField0_ & 0x00008000) != 0)) {
2081         result.tcpTimeWaitTimeoutSec_ = tcpTimeWaitTimeoutSec_;
2082         to_bitField0_ |= 0x00000400;
2083       }
2084       if (((from_bitField0_ & 0x00010000) != 0)) {
2085         result.tcpTransitoryIdleTimeoutSec_ = tcpTransitoryIdleTimeoutSec_;
2086         to_bitField0_ |= 0x00000800;
2087       }
2088       if (((from_bitField0_ & 0x00020000) != 0)) {
2089         result.udpIdleTimeoutSec_ = udpIdleTimeoutSec_;
2090         to_bitField0_ |= 0x00001000;
2091       }
2092       result.bitField0_ |= to_bitField0_;
2093     }
2094 
2095     @java.lang.Override
clone()2096     public Builder clone() {
2097       return super.clone();
2098     }
2099 
2100     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2101     public Builder setField(
2102         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
2103       return super.setField(field, value);
2104     }
2105 
2106     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)2107     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
2108       return super.clearField(field);
2109     }
2110 
2111     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)2112     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
2113       return super.clearOneof(oneof);
2114     }
2115 
2116     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)2117     public Builder setRepeatedField(
2118         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
2119       return super.setRepeatedField(field, index, value);
2120     }
2121 
2122     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2123     public Builder addRepeatedField(
2124         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
2125       return super.addRepeatedField(field, value);
2126     }
2127 
2128     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)2129     public Builder mergeFrom(com.google.protobuf.Message other) {
2130       if (other instanceof com.google.cloud.compute.v1.RouterNat) {
2131         return mergeFrom((com.google.cloud.compute.v1.RouterNat) other);
2132       } else {
2133         super.mergeFrom(other);
2134         return this;
2135       }
2136     }
2137 
mergeFrom(com.google.cloud.compute.v1.RouterNat other)2138     public Builder mergeFrom(com.google.cloud.compute.v1.RouterNat other) {
2139       if (other == com.google.cloud.compute.v1.RouterNat.getDefaultInstance()) return this;
2140       if (!other.drainNatIps_.isEmpty()) {
2141         if (drainNatIps_.isEmpty()) {
2142           drainNatIps_ = other.drainNatIps_;
2143           bitField0_ = (bitField0_ & ~0x00000001);
2144         } else {
2145           ensureDrainNatIpsIsMutable();
2146           drainNatIps_.addAll(other.drainNatIps_);
2147         }
2148         onChanged();
2149       }
2150       if (other.hasEnableDynamicPortAllocation()) {
2151         setEnableDynamicPortAllocation(other.getEnableDynamicPortAllocation());
2152       }
2153       if (other.hasEnableEndpointIndependentMapping()) {
2154         setEnableEndpointIndependentMapping(other.getEnableEndpointIndependentMapping());
2155       }
2156       if (!other.endpointTypes_.isEmpty()) {
2157         if (endpointTypes_.isEmpty()) {
2158           endpointTypes_ = other.endpointTypes_;
2159           bitField0_ = (bitField0_ & ~0x00000008);
2160         } else {
2161           ensureEndpointTypesIsMutable();
2162           endpointTypes_.addAll(other.endpointTypes_);
2163         }
2164         onChanged();
2165       }
2166       if (other.hasIcmpIdleTimeoutSec()) {
2167         setIcmpIdleTimeoutSec(other.getIcmpIdleTimeoutSec());
2168       }
2169       if (other.hasLogConfig()) {
2170         mergeLogConfig(other.getLogConfig());
2171       }
2172       if (other.hasMaxPortsPerVm()) {
2173         setMaxPortsPerVm(other.getMaxPortsPerVm());
2174       }
2175       if (other.hasMinPortsPerVm()) {
2176         setMinPortsPerVm(other.getMinPortsPerVm());
2177       }
2178       if (other.hasName()) {
2179         name_ = other.name_;
2180         bitField0_ |= 0x00000100;
2181         onChanged();
2182       }
2183       if (other.hasNatIpAllocateOption()) {
2184         natIpAllocateOption_ = other.natIpAllocateOption_;
2185         bitField0_ |= 0x00000200;
2186         onChanged();
2187       }
2188       if (!other.natIps_.isEmpty()) {
2189         if (natIps_.isEmpty()) {
2190           natIps_ = other.natIps_;
2191           bitField0_ = (bitField0_ & ~0x00000400);
2192         } else {
2193           ensureNatIpsIsMutable();
2194           natIps_.addAll(other.natIps_);
2195         }
2196         onChanged();
2197       }
2198       if (rulesBuilder_ == null) {
2199         if (!other.rules_.isEmpty()) {
2200           if (rules_.isEmpty()) {
2201             rules_ = other.rules_;
2202             bitField0_ = (bitField0_ & ~0x00000800);
2203           } else {
2204             ensureRulesIsMutable();
2205             rules_.addAll(other.rules_);
2206           }
2207           onChanged();
2208         }
2209       } else {
2210         if (!other.rules_.isEmpty()) {
2211           if (rulesBuilder_.isEmpty()) {
2212             rulesBuilder_.dispose();
2213             rulesBuilder_ = null;
2214             rules_ = other.rules_;
2215             bitField0_ = (bitField0_ & ~0x00000800);
2216             rulesBuilder_ =
2217                 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
2218                     ? getRulesFieldBuilder()
2219                     : null;
2220           } else {
2221             rulesBuilder_.addAllMessages(other.rules_);
2222           }
2223         }
2224       }
2225       if (other.hasSourceSubnetworkIpRangesToNat()) {
2226         sourceSubnetworkIpRangesToNat_ = other.sourceSubnetworkIpRangesToNat_;
2227         bitField0_ |= 0x00001000;
2228         onChanged();
2229       }
2230       if (subnetworksBuilder_ == null) {
2231         if (!other.subnetworks_.isEmpty()) {
2232           if (subnetworks_.isEmpty()) {
2233             subnetworks_ = other.subnetworks_;
2234             bitField0_ = (bitField0_ & ~0x00002000);
2235           } else {
2236             ensureSubnetworksIsMutable();
2237             subnetworks_.addAll(other.subnetworks_);
2238           }
2239           onChanged();
2240         }
2241       } else {
2242         if (!other.subnetworks_.isEmpty()) {
2243           if (subnetworksBuilder_.isEmpty()) {
2244             subnetworksBuilder_.dispose();
2245             subnetworksBuilder_ = null;
2246             subnetworks_ = other.subnetworks_;
2247             bitField0_ = (bitField0_ & ~0x00002000);
2248             subnetworksBuilder_ =
2249                 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
2250                     ? getSubnetworksFieldBuilder()
2251                     : null;
2252           } else {
2253             subnetworksBuilder_.addAllMessages(other.subnetworks_);
2254           }
2255         }
2256       }
2257       if (other.hasTcpEstablishedIdleTimeoutSec()) {
2258         setTcpEstablishedIdleTimeoutSec(other.getTcpEstablishedIdleTimeoutSec());
2259       }
2260       if (other.hasTcpTimeWaitTimeoutSec()) {
2261         setTcpTimeWaitTimeoutSec(other.getTcpTimeWaitTimeoutSec());
2262       }
2263       if (other.hasTcpTransitoryIdleTimeoutSec()) {
2264         setTcpTransitoryIdleTimeoutSec(other.getTcpTransitoryIdleTimeoutSec());
2265       }
2266       if (other.hasUdpIdleTimeoutSec()) {
2267         setUdpIdleTimeoutSec(other.getUdpIdleTimeoutSec());
2268       }
2269       this.mergeUnknownFields(other.getUnknownFields());
2270       onChanged();
2271       return this;
2272     }
2273 
2274     @java.lang.Override
isInitialized()2275     public final boolean isInitialized() {
2276       return true;
2277     }
2278 
2279     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2280     public Builder mergeFrom(
2281         com.google.protobuf.CodedInputStream input,
2282         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2283         throws java.io.IOException {
2284       if (extensionRegistry == null) {
2285         throw new java.lang.NullPointerException();
2286       }
2287       try {
2288         boolean done = false;
2289         while (!done) {
2290           int tag = input.readTag();
2291           switch (tag) {
2292             case 0:
2293               done = true;
2294               break;
2295             case 26989658:
2296               {
2297                 name_ = input.readStringRequireUtf8();
2298                 bitField0_ |= 0x00000100;
2299                 break;
2300               } // case 26989658
2301             case 29180496:
2302               {
2303                 icmpIdleTimeoutSec_ = input.readInt32();
2304                 bitField0_ |= 0x00000010;
2305                 break;
2306               } // case 29180496
2307             case 519359024:
2308               {
2309                 udpIdleTimeoutSec_ = input.readInt32();
2310                 bitField0_ |= 0x00020000;
2311                 break;
2312               } // case 519359024
2313             case 870991802:
2314               {
2315                 com.google.cloud.compute.v1.RouterNatRule m =
2316                     input.readMessage(
2317                         com.google.cloud.compute.v1.RouterNatRule.parser(), extensionRegistry);
2318                 if (rulesBuilder_ == null) {
2319                   ensureRulesIsMutable();
2320                   rules_.add(m);
2321                 } else {
2322                   rulesBuilder_.addMessage(m);
2323                 }
2324                 break;
2325               } // case 870991802
2326             case 941080690:
2327               {
2328                 java.lang.String s = input.readStringRequireUtf8();
2329                 ensureNatIpsIsMutable();
2330                 natIps_.add(s);
2331                 break;
2332               } // case 941080690
2333             case 1489548696:
2334               {
2335                 minPortsPerVm_ = input.readInt32();
2336                 bitField0_ |= 0x00000080;
2337                 break;
2338               } // case 1489548696
2339             case 1640230192:
2340               {
2341                 tcpTransitoryIdleTimeoutSec_ = input.readInt32();
2342                 bitField0_ |= 0x00010000;
2343                 break;
2344               } // case 1640230192
2345             case 1784786792:
2346               {
2347                 tcpEstablishedIdleTimeoutSec_ = input.readInt32();
2348                 bitField0_ |= 0x00004000;
2349                 break;
2350               } // case 1784786792
2351             case 2000496392:
2352               {
2353                 maxPortsPerVm_ = input.readInt32();
2354                 bitField0_ |= 0x00000040;
2355                 break;
2356               } // case 2000496392
2357             case 2017705690:
2358               {
2359                 sourceSubnetworkIpRangesToNat_ = input.readStringRequireUtf8();
2360                 bitField0_ |= 0x00001000;
2361                 break;
2362               } // case 2017705690
2363             case 2075534552:
2364               {
2365                 enableEndpointIndependentMapping_ = input.readBool();
2366                 bitField0_ |= 0x00000004;
2367                 break;
2368               } // case 2075534552
2369             case -1484569366:
2370               {
2371                 input.readMessage(getLogConfigFieldBuilder().getBuilder(), extensionRegistry);
2372                 bitField0_ |= 0x00000020;
2373                 break;
2374               } // case -1484569366
2375             case -968142294:
2376               {
2377                 com.google.cloud.compute.v1.RouterNatSubnetworkToNat m =
2378                     input.readMessage(
2379                         com.google.cloud.compute.v1.RouterNatSubnetworkToNat.parser(),
2380                         extensionRegistry);
2381                 if (subnetworksBuilder_ == null) {
2382                   ensureSubnetworksIsMutable();
2383                   subnetworks_.add(m);
2384                 } else {
2385                   subnetworksBuilder_.addMessage(m);
2386                 }
2387                 break;
2388               } // case -968142294
2389             case -857152534:
2390               {
2391                 natIpAllocateOption_ = input.readStringRequireUtf8();
2392                 bitField0_ |= 0x00000200;
2393                 break;
2394               } // case -857152534
2395             case -273896838:
2396               {
2397                 java.lang.String s = input.readStringRequireUtf8();
2398                 ensureEndpointTypesIsMutable();
2399                 endpointTypes_.add(s);
2400                 break;
2401               } // case -273896838
2402             case -262339014:
2403               {
2404                 java.lang.String s = input.readStringRequireUtf8();
2405                 ensureDrainNatIpsIsMutable();
2406                 drainNatIps_.add(s);
2407                 break;
2408               } // case -262339014
2409             case -186191896:
2410               {
2411                 tcpTimeWaitTimeoutSec_ = input.readInt32();
2412                 bitField0_ |= 0x00008000;
2413                 break;
2414               } // case -186191896
2415             case -38116080:
2416               {
2417                 enableDynamicPortAllocation_ = input.readBool();
2418                 bitField0_ |= 0x00000002;
2419                 break;
2420               } // case -38116080
2421             default:
2422               {
2423                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
2424                   done = true; // was an endgroup tag
2425                 }
2426                 break;
2427               } // default:
2428           } // switch (tag)
2429         } // while (!done)
2430       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
2431         throw e.unwrapIOException();
2432       } finally {
2433         onChanged();
2434       } // finally
2435       return this;
2436     }
2437 
2438     private int bitField0_;
2439 
2440     private com.google.protobuf.LazyStringList drainNatIps_ =
2441         com.google.protobuf.LazyStringArrayList.EMPTY;
2442 
ensureDrainNatIpsIsMutable()2443     private void ensureDrainNatIpsIsMutable() {
2444       if (!((bitField0_ & 0x00000001) != 0)) {
2445         drainNatIps_ = new com.google.protobuf.LazyStringArrayList(drainNatIps_);
2446         bitField0_ |= 0x00000001;
2447       }
2448     }
2449     /**
2450      *
2451      *
2452      * <pre>
2453      * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.
2454      * </pre>
2455      *
2456      * <code>repeated string drain_nat_ips = 504078535;</code>
2457      *
2458      * @return A list containing the drainNatIps.
2459      */
getDrainNatIpsList()2460     public com.google.protobuf.ProtocolStringList getDrainNatIpsList() {
2461       return drainNatIps_.getUnmodifiableView();
2462     }
2463     /**
2464      *
2465      *
2466      * <pre>
2467      * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.
2468      * </pre>
2469      *
2470      * <code>repeated string drain_nat_ips = 504078535;</code>
2471      *
2472      * @return The count of drainNatIps.
2473      */
getDrainNatIpsCount()2474     public int getDrainNatIpsCount() {
2475       return drainNatIps_.size();
2476     }
2477     /**
2478      *
2479      *
2480      * <pre>
2481      * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.
2482      * </pre>
2483      *
2484      * <code>repeated string drain_nat_ips = 504078535;</code>
2485      *
2486      * @param index The index of the element to return.
2487      * @return The drainNatIps at the given index.
2488      */
getDrainNatIps(int index)2489     public java.lang.String getDrainNatIps(int index) {
2490       return drainNatIps_.get(index);
2491     }
2492     /**
2493      *
2494      *
2495      * <pre>
2496      * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.
2497      * </pre>
2498      *
2499      * <code>repeated string drain_nat_ips = 504078535;</code>
2500      *
2501      * @param index The index of the value to return.
2502      * @return The bytes of the drainNatIps at the given index.
2503      */
getDrainNatIpsBytes(int index)2504     public com.google.protobuf.ByteString getDrainNatIpsBytes(int index) {
2505       return drainNatIps_.getByteString(index);
2506     }
2507     /**
2508      *
2509      *
2510      * <pre>
2511      * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.
2512      * </pre>
2513      *
2514      * <code>repeated string drain_nat_ips = 504078535;</code>
2515      *
2516      * @param index The index to set the value at.
2517      * @param value The drainNatIps to set.
2518      * @return This builder for chaining.
2519      */
setDrainNatIps(int index, java.lang.String value)2520     public Builder setDrainNatIps(int index, java.lang.String value) {
2521       if (value == null) {
2522         throw new NullPointerException();
2523       }
2524       ensureDrainNatIpsIsMutable();
2525       drainNatIps_.set(index, value);
2526       onChanged();
2527       return this;
2528     }
2529     /**
2530      *
2531      *
2532      * <pre>
2533      * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.
2534      * </pre>
2535      *
2536      * <code>repeated string drain_nat_ips = 504078535;</code>
2537      *
2538      * @param value The drainNatIps to add.
2539      * @return This builder for chaining.
2540      */
addDrainNatIps(java.lang.String value)2541     public Builder addDrainNatIps(java.lang.String value) {
2542       if (value == null) {
2543         throw new NullPointerException();
2544       }
2545       ensureDrainNatIpsIsMutable();
2546       drainNatIps_.add(value);
2547       onChanged();
2548       return this;
2549     }
2550     /**
2551      *
2552      *
2553      * <pre>
2554      * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.
2555      * </pre>
2556      *
2557      * <code>repeated string drain_nat_ips = 504078535;</code>
2558      *
2559      * @param values The drainNatIps to add.
2560      * @return This builder for chaining.
2561      */
addAllDrainNatIps(java.lang.Iterable<java.lang.String> values)2562     public Builder addAllDrainNatIps(java.lang.Iterable<java.lang.String> values) {
2563       ensureDrainNatIpsIsMutable();
2564       com.google.protobuf.AbstractMessageLite.Builder.addAll(values, drainNatIps_);
2565       onChanged();
2566       return this;
2567     }
2568     /**
2569      *
2570      *
2571      * <pre>
2572      * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.
2573      * </pre>
2574      *
2575      * <code>repeated string drain_nat_ips = 504078535;</code>
2576      *
2577      * @return This builder for chaining.
2578      */
clearDrainNatIps()2579     public Builder clearDrainNatIps() {
2580       drainNatIps_ = com.google.protobuf.LazyStringArrayList.EMPTY;
2581       bitField0_ = (bitField0_ & ~0x00000001);
2582       onChanged();
2583       return this;
2584     }
2585     /**
2586      *
2587      *
2588      * <pre>
2589      * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.
2590      * </pre>
2591      *
2592      * <code>repeated string drain_nat_ips = 504078535;</code>
2593      *
2594      * @param value The bytes of the drainNatIps to add.
2595      * @return This builder for chaining.
2596      */
addDrainNatIpsBytes(com.google.protobuf.ByteString value)2597     public Builder addDrainNatIpsBytes(com.google.protobuf.ByteString value) {
2598       if (value == null) {
2599         throw new NullPointerException();
2600       }
2601       checkByteStringIsUtf8(value);
2602       ensureDrainNatIpsIsMutable();
2603       drainNatIps_.add(value);
2604       onChanged();
2605       return this;
2606     }
2607 
2608     private boolean enableDynamicPortAllocation_;
2609     /**
2610      *
2611      *
2612      * <pre>
2613      * Enable Dynamic Port Allocation. If not specified, it is disabled by default. If set to true, - Dynamic Port Allocation will be enabled on this NAT config. - enableEndpointIndependentMapping cannot be set to true. - If minPorts is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config.
2614      * </pre>
2615      *
2616      * <code>optional bool enable_dynamic_port_allocation = 532106402;</code>
2617      *
2618      * @return Whether the enableDynamicPortAllocation field is set.
2619      */
2620     @java.lang.Override
hasEnableDynamicPortAllocation()2621     public boolean hasEnableDynamicPortAllocation() {
2622       return ((bitField0_ & 0x00000002) != 0);
2623     }
2624     /**
2625      *
2626      *
2627      * <pre>
2628      * Enable Dynamic Port Allocation. If not specified, it is disabled by default. If set to true, - Dynamic Port Allocation will be enabled on this NAT config. - enableEndpointIndependentMapping cannot be set to true. - If minPorts is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config.
2629      * </pre>
2630      *
2631      * <code>optional bool enable_dynamic_port_allocation = 532106402;</code>
2632      *
2633      * @return The enableDynamicPortAllocation.
2634      */
2635     @java.lang.Override
getEnableDynamicPortAllocation()2636     public boolean getEnableDynamicPortAllocation() {
2637       return enableDynamicPortAllocation_;
2638     }
2639     /**
2640      *
2641      *
2642      * <pre>
2643      * Enable Dynamic Port Allocation. If not specified, it is disabled by default. If set to true, - Dynamic Port Allocation will be enabled on this NAT config. - enableEndpointIndependentMapping cannot be set to true. - If minPorts is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config.
2644      * </pre>
2645      *
2646      * <code>optional bool enable_dynamic_port_allocation = 532106402;</code>
2647      *
2648      * @param value The enableDynamicPortAllocation to set.
2649      * @return This builder for chaining.
2650      */
setEnableDynamicPortAllocation(boolean value)2651     public Builder setEnableDynamicPortAllocation(boolean value) {
2652 
2653       enableDynamicPortAllocation_ = value;
2654       bitField0_ |= 0x00000002;
2655       onChanged();
2656       return this;
2657     }
2658     /**
2659      *
2660      *
2661      * <pre>
2662      * Enable Dynamic Port Allocation. If not specified, it is disabled by default. If set to true, - Dynamic Port Allocation will be enabled on this NAT config. - enableEndpointIndependentMapping cannot be set to true. - If minPorts is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config.
2663      * </pre>
2664      *
2665      * <code>optional bool enable_dynamic_port_allocation = 532106402;</code>
2666      *
2667      * @return This builder for chaining.
2668      */
clearEnableDynamicPortAllocation()2669     public Builder clearEnableDynamicPortAllocation() {
2670       bitField0_ = (bitField0_ & ~0x00000002);
2671       enableDynamicPortAllocation_ = false;
2672       onChanged();
2673       return this;
2674     }
2675 
2676     private boolean enableEndpointIndependentMapping_;
2677     /**
2678      * <code>optional bool enable_endpoint_independent_mapping = 259441819;</code>
2679      *
2680      * @return Whether the enableEndpointIndependentMapping field is set.
2681      */
2682     @java.lang.Override
hasEnableEndpointIndependentMapping()2683     public boolean hasEnableEndpointIndependentMapping() {
2684       return ((bitField0_ & 0x00000004) != 0);
2685     }
2686     /**
2687      * <code>optional bool enable_endpoint_independent_mapping = 259441819;</code>
2688      *
2689      * @return The enableEndpointIndependentMapping.
2690      */
2691     @java.lang.Override
getEnableEndpointIndependentMapping()2692     public boolean getEnableEndpointIndependentMapping() {
2693       return enableEndpointIndependentMapping_;
2694     }
2695     /**
2696      * <code>optional bool enable_endpoint_independent_mapping = 259441819;</code>
2697      *
2698      * @param value The enableEndpointIndependentMapping to set.
2699      * @return This builder for chaining.
2700      */
setEnableEndpointIndependentMapping(boolean value)2701     public Builder setEnableEndpointIndependentMapping(boolean value) {
2702 
2703       enableEndpointIndependentMapping_ = value;
2704       bitField0_ |= 0x00000004;
2705       onChanged();
2706       return this;
2707     }
2708     /**
2709      * <code>optional bool enable_endpoint_independent_mapping = 259441819;</code>
2710      *
2711      * @return This builder for chaining.
2712      */
clearEnableEndpointIndependentMapping()2713     public Builder clearEnableEndpointIndependentMapping() {
2714       bitField0_ = (bitField0_ & ~0x00000004);
2715       enableEndpointIndependentMapping_ = false;
2716       onChanged();
2717       return this;
2718     }
2719 
2720     private com.google.protobuf.LazyStringList endpointTypes_ =
2721         com.google.protobuf.LazyStringArrayList.EMPTY;
2722 
ensureEndpointTypesIsMutable()2723     private void ensureEndpointTypesIsMutable() {
2724       if (!((bitField0_ & 0x00000008) != 0)) {
2725         endpointTypes_ = new com.google.protobuf.LazyStringArrayList(endpointTypes_);
2726         bitField0_ |= 0x00000008;
2727       }
2728     }
2729     /**
2730      *
2731      *
2732      * <pre>
2733      * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM
2734      * Check the EndpointTypes enum for the list of possible values.
2735      * </pre>
2736      *
2737      * <code>repeated string endpoint_types = 502633807;</code>
2738      *
2739      * @return A list containing the endpointTypes.
2740      */
getEndpointTypesList()2741     public com.google.protobuf.ProtocolStringList getEndpointTypesList() {
2742       return endpointTypes_.getUnmodifiableView();
2743     }
2744     /**
2745      *
2746      *
2747      * <pre>
2748      * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM
2749      * Check the EndpointTypes enum for the list of possible values.
2750      * </pre>
2751      *
2752      * <code>repeated string endpoint_types = 502633807;</code>
2753      *
2754      * @return The count of endpointTypes.
2755      */
getEndpointTypesCount()2756     public int getEndpointTypesCount() {
2757       return endpointTypes_.size();
2758     }
2759     /**
2760      *
2761      *
2762      * <pre>
2763      * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM
2764      * Check the EndpointTypes enum for the list of possible values.
2765      * </pre>
2766      *
2767      * <code>repeated string endpoint_types = 502633807;</code>
2768      *
2769      * @param index The index of the element to return.
2770      * @return The endpointTypes at the given index.
2771      */
getEndpointTypes(int index)2772     public java.lang.String getEndpointTypes(int index) {
2773       return endpointTypes_.get(index);
2774     }
2775     /**
2776      *
2777      *
2778      * <pre>
2779      * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM
2780      * Check the EndpointTypes enum for the list of possible values.
2781      * </pre>
2782      *
2783      * <code>repeated string endpoint_types = 502633807;</code>
2784      *
2785      * @param index The index of the value to return.
2786      * @return The bytes of the endpointTypes at the given index.
2787      */
getEndpointTypesBytes(int index)2788     public com.google.protobuf.ByteString getEndpointTypesBytes(int index) {
2789       return endpointTypes_.getByteString(index);
2790     }
2791     /**
2792      *
2793      *
2794      * <pre>
2795      * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM
2796      * Check the EndpointTypes enum for the list of possible values.
2797      * </pre>
2798      *
2799      * <code>repeated string endpoint_types = 502633807;</code>
2800      *
2801      * @param index The index to set the value at.
2802      * @param value The endpointTypes to set.
2803      * @return This builder for chaining.
2804      */
setEndpointTypes(int index, java.lang.String value)2805     public Builder setEndpointTypes(int index, java.lang.String value) {
2806       if (value == null) {
2807         throw new NullPointerException();
2808       }
2809       ensureEndpointTypesIsMutable();
2810       endpointTypes_.set(index, value);
2811       onChanged();
2812       return this;
2813     }
2814     /**
2815      *
2816      *
2817      * <pre>
2818      * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM
2819      * Check the EndpointTypes enum for the list of possible values.
2820      * </pre>
2821      *
2822      * <code>repeated string endpoint_types = 502633807;</code>
2823      *
2824      * @param value The endpointTypes to add.
2825      * @return This builder for chaining.
2826      */
addEndpointTypes(java.lang.String value)2827     public Builder addEndpointTypes(java.lang.String value) {
2828       if (value == null) {
2829         throw new NullPointerException();
2830       }
2831       ensureEndpointTypesIsMutable();
2832       endpointTypes_.add(value);
2833       onChanged();
2834       return this;
2835     }
2836     /**
2837      *
2838      *
2839      * <pre>
2840      * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM
2841      * Check the EndpointTypes enum for the list of possible values.
2842      * </pre>
2843      *
2844      * <code>repeated string endpoint_types = 502633807;</code>
2845      *
2846      * @param values The endpointTypes to add.
2847      * @return This builder for chaining.
2848      */
addAllEndpointTypes(java.lang.Iterable<java.lang.String> values)2849     public Builder addAllEndpointTypes(java.lang.Iterable<java.lang.String> values) {
2850       ensureEndpointTypesIsMutable();
2851       com.google.protobuf.AbstractMessageLite.Builder.addAll(values, endpointTypes_);
2852       onChanged();
2853       return this;
2854     }
2855     /**
2856      *
2857      *
2858      * <pre>
2859      * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM
2860      * Check the EndpointTypes enum for the list of possible values.
2861      * </pre>
2862      *
2863      * <code>repeated string endpoint_types = 502633807;</code>
2864      *
2865      * @return This builder for chaining.
2866      */
clearEndpointTypes()2867     public Builder clearEndpointTypes() {
2868       endpointTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
2869       bitField0_ = (bitField0_ & ~0x00000008);
2870       onChanged();
2871       return this;
2872     }
2873     /**
2874      *
2875      *
2876      * <pre>
2877      * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM
2878      * Check the EndpointTypes enum for the list of possible values.
2879      * </pre>
2880      *
2881      * <code>repeated string endpoint_types = 502633807;</code>
2882      *
2883      * @param value The bytes of the endpointTypes to add.
2884      * @return This builder for chaining.
2885      */
addEndpointTypesBytes(com.google.protobuf.ByteString value)2886     public Builder addEndpointTypesBytes(com.google.protobuf.ByteString value) {
2887       if (value == null) {
2888         throw new NullPointerException();
2889       }
2890       checkByteStringIsUtf8(value);
2891       ensureEndpointTypesIsMutable();
2892       endpointTypes_.add(value);
2893       onChanged();
2894       return this;
2895     }
2896 
2897     private int icmpIdleTimeoutSec_;
2898     /**
2899      *
2900      *
2901      * <pre>
2902      * Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
2903      * </pre>
2904      *
2905      * <code>optional int32 icmp_idle_timeout_sec = 3647562;</code>
2906      *
2907      * @return Whether the icmpIdleTimeoutSec field is set.
2908      */
2909     @java.lang.Override
hasIcmpIdleTimeoutSec()2910     public boolean hasIcmpIdleTimeoutSec() {
2911       return ((bitField0_ & 0x00000010) != 0);
2912     }
2913     /**
2914      *
2915      *
2916      * <pre>
2917      * Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
2918      * </pre>
2919      *
2920      * <code>optional int32 icmp_idle_timeout_sec = 3647562;</code>
2921      *
2922      * @return The icmpIdleTimeoutSec.
2923      */
2924     @java.lang.Override
getIcmpIdleTimeoutSec()2925     public int getIcmpIdleTimeoutSec() {
2926       return icmpIdleTimeoutSec_;
2927     }
2928     /**
2929      *
2930      *
2931      * <pre>
2932      * Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
2933      * </pre>
2934      *
2935      * <code>optional int32 icmp_idle_timeout_sec = 3647562;</code>
2936      *
2937      * @param value The icmpIdleTimeoutSec to set.
2938      * @return This builder for chaining.
2939      */
setIcmpIdleTimeoutSec(int value)2940     public Builder setIcmpIdleTimeoutSec(int value) {
2941 
2942       icmpIdleTimeoutSec_ = value;
2943       bitField0_ |= 0x00000010;
2944       onChanged();
2945       return this;
2946     }
2947     /**
2948      *
2949      *
2950      * <pre>
2951      * Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
2952      * </pre>
2953      *
2954      * <code>optional int32 icmp_idle_timeout_sec = 3647562;</code>
2955      *
2956      * @return This builder for chaining.
2957      */
clearIcmpIdleTimeoutSec()2958     public Builder clearIcmpIdleTimeoutSec() {
2959       bitField0_ = (bitField0_ & ~0x00000010);
2960       icmpIdleTimeoutSec_ = 0;
2961       onChanged();
2962       return this;
2963     }
2964 
2965     private com.google.cloud.compute.v1.RouterNatLogConfig logConfig_;
2966     private com.google.protobuf.SingleFieldBuilderV3<
2967             com.google.cloud.compute.v1.RouterNatLogConfig,
2968             com.google.cloud.compute.v1.RouterNatLogConfig.Builder,
2969             com.google.cloud.compute.v1.RouterNatLogConfigOrBuilder>
2970         logConfigBuilder_;
2971     /**
2972      *
2973      *
2974      * <pre>
2975      * Configure logging on this NAT.
2976      * </pre>
2977      *
2978      * <code>optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;</code>
2979      *
2980      * @return Whether the logConfig field is set.
2981      */
hasLogConfig()2982     public boolean hasLogConfig() {
2983       return ((bitField0_ & 0x00000020) != 0);
2984     }
2985     /**
2986      *
2987      *
2988      * <pre>
2989      * Configure logging on this NAT.
2990      * </pre>
2991      *
2992      * <code>optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;</code>
2993      *
2994      * @return The logConfig.
2995      */
getLogConfig()2996     public com.google.cloud.compute.v1.RouterNatLogConfig getLogConfig() {
2997       if (logConfigBuilder_ == null) {
2998         return logConfig_ == null
2999             ? com.google.cloud.compute.v1.RouterNatLogConfig.getDefaultInstance()
3000             : logConfig_;
3001       } else {
3002         return logConfigBuilder_.getMessage();
3003       }
3004     }
3005     /**
3006      *
3007      *
3008      * <pre>
3009      * Configure logging on this NAT.
3010      * </pre>
3011      *
3012      * <code>optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;</code>
3013      */
setLogConfig(com.google.cloud.compute.v1.RouterNatLogConfig value)3014     public Builder setLogConfig(com.google.cloud.compute.v1.RouterNatLogConfig value) {
3015       if (logConfigBuilder_ == null) {
3016         if (value == null) {
3017           throw new NullPointerException();
3018         }
3019         logConfig_ = value;
3020       } else {
3021         logConfigBuilder_.setMessage(value);
3022       }
3023       bitField0_ |= 0x00000020;
3024       onChanged();
3025       return this;
3026     }
3027     /**
3028      *
3029      *
3030      * <pre>
3031      * Configure logging on this NAT.
3032      * </pre>
3033      *
3034      * <code>optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;</code>
3035      */
setLogConfig( com.google.cloud.compute.v1.RouterNatLogConfig.Builder builderForValue)3036     public Builder setLogConfig(
3037         com.google.cloud.compute.v1.RouterNatLogConfig.Builder builderForValue) {
3038       if (logConfigBuilder_ == null) {
3039         logConfig_ = builderForValue.build();
3040       } else {
3041         logConfigBuilder_.setMessage(builderForValue.build());
3042       }
3043       bitField0_ |= 0x00000020;
3044       onChanged();
3045       return this;
3046     }
3047     /**
3048      *
3049      *
3050      * <pre>
3051      * Configure logging on this NAT.
3052      * </pre>
3053      *
3054      * <code>optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;</code>
3055      */
mergeLogConfig(com.google.cloud.compute.v1.RouterNatLogConfig value)3056     public Builder mergeLogConfig(com.google.cloud.compute.v1.RouterNatLogConfig value) {
3057       if (logConfigBuilder_ == null) {
3058         if (((bitField0_ & 0x00000020) != 0)
3059             && logConfig_ != null
3060             && logConfig_ != com.google.cloud.compute.v1.RouterNatLogConfig.getDefaultInstance()) {
3061           getLogConfigBuilder().mergeFrom(value);
3062         } else {
3063           logConfig_ = value;
3064         }
3065       } else {
3066         logConfigBuilder_.mergeFrom(value);
3067       }
3068       bitField0_ |= 0x00000020;
3069       onChanged();
3070       return this;
3071     }
3072     /**
3073      *
3074      *
3075      * <pre>
3076      * Configure logging on this NAT.
3077      * </pre>
3078      *
3079      * <code>optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;</code>
3080      */
clearLogConfig()3081     public Builder clearLogConfig() {
3082       bitField0_ = (bitField0_ & ~0x00000020);
3083       logConfig_ = null;
3084       if (logConfigBuilder_ != null) {
3085         logConfigBuilder_.dispose();
3086         logConfigBuilder_ = null;
3087       }
3088       onChanged();
3089       return this;
3090     }
3091     /**
3092      *
3093      *
3094      * <pre>
3095      * Configure logging on this NAT.
3096      * </pre>
3097      *
3098      * <code>optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;</code>
3099      */
getLogConfigBuilder()3100     public com.google.cloud.compute.v1.RouterNatLogConfig.Builder getLogConfigBuilder() {
3101       bitField0_ |= 0x00000020;
3102       onChanged();
3103       return getLogConfigFieldBuilder().getBuilder();
3104     }
3105     /**
3106      *
3107      *
3108      * <pre>
3109      * Configure logging on this NAT.
3110      * </pre>
3111      *
3112      * <code>optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;</code>
3113      */
getLogConfigOrBuilder()3114     public com.google.cloud.compute.v1.RouterNatLogConfigOrBuilder getLogConfigOrBuilder() {
3115       if (logConfigBuilder_ != null) {
3116         return logConfigBuilder_.getMessageOrBuilder();
3117       } else {
3118         return logConfig_ == null
3119             ? com.google.cloud.compute.v1.RouterNatLogConfig.getDefaultInstance()
3120             : logConfig_;
3121       }
3122     }
3123     /**
3124      *
3125      *
3126      * <pre>
3127      * Configure logging on this NAT.
3128      * </pre>
3129      *
3130      * <code>optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;</code>
3131      */
3132     private com.google.protobuf.SingleFieldBuilderV3<
3133             com.google.cloud.compute.v1.RouterNatLogConfig,
3134             com.google.cloud.compute.v1.RouterNatLogConfig.Builder,
3135             com.google.cloud.compute.v1.RouterNatLogConfigOrBuilder>
getLogConfigFieldBuilder()3136         getLogConfigFieldBuilder() {
3137       if (logConfigBuilder_ == null) {
3138         logConfigBuilder_ =
3139             new com.google.protobuf.SingleFieldBuilderV3<
3140                 com.google.cloud.compute.v1.RouterNatLogConfig,
3141                 com.google.cloud.compute.v1.RouterNatLogConfig.Builder,
3142                 com.google.cloud.compute.v1.RouterNatLogConfigOrBuilder>(
3143                 getLogConfig(), getParentForChildren(), isClean());
3144         logConfig_ = null;
3145       }
3146       return logConfigBuilder_;
3147     }
3148 
3149     private int maxPortsPerVm_;
3150     /**
3151      *
3152      *
3153      * <pre>
3154      * Maximum number of ports allocated to a VM from this NAT config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation is not enabled, this field has no effect. If Dynamic Port Allocation is enabled, and this field is set, it must be set to a power of two greater than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port Allocation is enabled and this field is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config.
3155      * </pre>
3156      *
3157      * <code>optional int32 max_ports_per_vm = 250062049;</code>
3158      *
3159      * @return Whether the maxPortsPerVm field is set.
3160      */
3161     @java.lang.Override
hasMaxPortsPerVm()3162     public boolean hasMaxPortsPerVm() {
3163       return ((bitField0_ & 0x00000040) != 0);
3164     }
3165     /**
3166      *
3167      *
3168      * <pre>
3169      * Maximum number of ports allocated to a VM from this NAT config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation is not enabled, this field has no effect. If Dynamic Port Allocation is enabled, and this field is set, it must be set to a power of two greater than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port Allocation is enabled and this field is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config.
3170      * </pre>
3171      *
3172      * <code>optional int32 max_ports_per_vm = 250062049;</code>
3173      *
3174      * @return The maxPortsPerVm.
3175      */
3176     @java.lang.Override
getMaxPortsPerVm()3177     public int getMaxPortsPerVm() {
3178       return maxPortsPerVm_;
3179     }
3180     /**
3181      *
3182      *
3183      * <pre>
3184      * Maximum number of ports allocated to a VM from this NAT config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation is not enabled, this field has no effect. If Dynamic Port Allocation is enabled, and this field is set, it must be set to a power of two greater than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port Allocation is enabled and this field is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config.
3185      * </pre>
3186      *
3187      * <code>optional int32 max_ports_per_vm = 250062049;</code>
3188      *
3189      * @param value The maxPortsPerVm to set.
3190      * @return This builder for chaining.
3191      */
setMaxPortsPerVm(int value)3192     public Builder setMaxPortsPerVm(int value) {
3193 
3194       maxPortsPerVm_ = value;
3195       bitField0_ |= 0x00000040;
3196       onChanged();
3197       return this;
3198     }
3199     /**
3200      *
3201      *
3202      * <pre>
3203      * Maximum number of ports allocated to a VM from this NAT config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation is not enabled, this field has no effect. If Dynamic Port Allocation is enabled, and this field is set, it must be set to a power of two greater than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port Allocation is enabled and this field is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config.
3204      * </pre>
3205      *
3206      * <code>optional int32 max_ports_per_vm = 250062049;</code>
3207      *
3208      * @return This builder for chaining.
3209      */
clearMaxPortsPerVm()3210     public Builder clearMaxPortsPerVm() {
3211       bitField0_ = (bitField0_ & ~0x00000040);
3212       maxPortsPerVm_ = 0;
3213       onChanged();
3214       return this;
3215     }
3216 
3217     private int minPortsPerVm_;
3218     /**
3219      *
3220      *
3221      * <pre>
3222      * Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM.
3223      * </pre>
3224      *
3225      * <code>optional int32 min_ports_per_vm = 186193587;</code>
3226      *
3227      * @return Whether the minPortsPerVm field is set.
3228      */
3229     @java.lang.Override
hasMinPortsPerVm()3230     public boolean hasMinPortsPerVm() {
3231       return ((bitField0_ & 0x00000080) != 0);
3232     }
3233     /**
3234      *
3235      *
3236      * <pre>
3237      * Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM.
3238      * </pre>
3239      *
3240      * <code>optional int32 min_ports_per_vm = 186193587;</code>
3241      *
3242      * @return The minPortsPerVm.
3243      */
3244     @java.lang.Override
getMinPortsPerVm()3245     public int getMinPortsPerVm() {
3246       return minPortsPerVm_;
3247     }
3248     /**
3249      *
3250      *
3251      * <pre>
3252      * Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM.
3253      * </pre>
3254      *
3255      * <code>optional int32 min_ports_per_vm = 186193587;</code>
3256      *
3257      * @param value The minPortsPerVm to set.
3258      * @return This builder for chaining.
3259      */
setMinPortsPerVm(int value)3260     public Builder setMinPortsPerVm(int value) {
3261 
3262       minPortsPerVm_ = value;
3263       bitField0_ |= 0x00000080;
3264       onChanged();
3265       return this;
3266     }
3267     /**
3268      *
3269      *
3270      * <pre>
3271      * Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM.
3272      * </pre>
3273      *
3274      * <code>optional int32 min_ports_per_vm = 186193587;</code>
3275      *
3276      * @return This builder for chaining.
3277      */
clearMinPortsPerVm()3278     public Builder clearMinPortsPerVm() {
3279       bitField0_ = (bitField0_ & ~0x00000080);
3280       minPortsPerVm_ = 0;
3281       onChanged();
3282       return this;
3283     }
3284 
3285     private java.lang.Object name_ = "";
3286     /**
3287      *
3288      *
3289      * <pre>
3290      * Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.
3291      * </pre>
3292      *
3293      * <code>optional string name = 3373707;</code>
3294      *
3295      * @return Whether the name field is set.
3296      */
hasName()3297     public boolean hasName() {
3298       return ((bitField0_ & 0x00000100) != 0);
3299     }
3300     /**
3301      *
3302      *
3303      * <pre>
3304      * Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.
3305      * </pre>
3306      *
3307      * <code>optional string name = 3373707;</code>
3308      *
3309      * @return The name.
3310      */
getName()3311     public java.lang.String getName() {
3312       java.lang.Object ref = name_;
3313       if (!(ref instanceof java.lang.String)) {
3314         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
3315         java.lang.String s = bs.toStringUtf8();
3316         name_ = s;
3317         return s;
3318       } else {
3319         return (java.lang.String) ref;
3320       }
3321     }
3322     /**
3323      *
3324      *
3325      * <pre>
3326      * Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.
3327      * </pre>
3328      *
3329      * <code>optional string name = 3373707;</code>
3330      *
3331      * @return The bytes for name.
3332      */
getNameBytes()3333     public com.google.protobuf.ByteString getNameBytes() {
3334       java.lang.Object ref = name_;
3335       if (ref instanceof String) {
3336         com.google.protobuf.ByteString b =
3337             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
3338         name_ = b;
3339         return b;
3340       } else {
3341         return (com.google.protobuf.ByteString) ref;
3342       }
3343     }
3344     /**
3345      *
3346      *
3347      * <pre>
3348      * Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.
3349      * </pre>
3350      *
3351      * <code>optional string name = 3373707;</code>
3352      *
3353      * @param value The name to set.
3354      * @return This builder for chaining.
3355      */
setName(java.lang.String value)3356     public Builder setName(java.lang.String value) {
3357       if (value == null) {
3358         throw new NullPointerException();
3359       }
3360       name_ = value;
3361       bitField0_ |= 0x00000100;
3362       onChanged();
3363       return this;
3364     }
3365     /**
3366      *
3367      *
3368      * <pre>
3369      * Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.
3370      * </pre>
3371      *
3372      * <code>optional string name = 3373707;</code>
3373      *
3374      * @return This builder for chaining.
3375      */
clearName()3376     public Builder clearName() {
3377       name_ = getDefaultInstance().getName();
3378       bitField0_ = (bitField0_ & ~0x00000100);
3379       onChanged();
3380       return this;
3381     }
3382     /**
3383      *
3384      *
3385      * <pre>
3386      * Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.
3387      * </pre>
3388      *
3389      * <code>optional string name = 3373707;</code>
3390      *
3391      * @param value The bytes for name to set.
3392      * @return This builder for chaining.
3393      */
setNameBytes(com.google.protobuf.ByteString value)3394     public Builder setNameBytes(com.google.protobuf.ByteString value) {
3395       if (value == null) {
3396         throw new NullPointerException();
3397       }
3398       checkByteStringIsUtf8(value);
3399       name_ = value;
3400       bitField0_ |= 0x00000100;
3401       onChanged();
3402       return this;
3403     }
3404 
3405     private java.lang.Object natIpAllocateOption_ = "";
3406     /**
3407      *
3408      *
3409      * <pre>
3410      * Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty.
3411      * Check the NatIpAllocateOption enum for the list of possible values.
3412      * </pre>
3413      *
3414      * <code>optional string nat_ip_allocate_option = 429726845;</code>
3415      *
3416      * @return Whether the natIpAllocateOption field is set.
3417      */
hasNatIpAllocateOption()3418     public boolean hasNatIpAllocateOption() {
3419       return ((bitField0_ & 0x00000200) != 0);
3420     }
3421     /**
3422      *
3423      *
3424      * <pre>
3425      * Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty.
3426      * Check the NatIpAllocateOption enum for the list of possible values.
3427      * </pre>
3428      *
3429      * <code>optional string nat_ip_allocate_option = 429726845;</code>
3430      *
3431      * @return The natIpAllocateOption.
3432      */
getNatIpAllocateOption()3433     public java.lang.String getNatIpAllocateOption() {
3434       java.lang.Object ref = natIpAllocateOption_;
3435       if (!(ref instanceof java.lang.String)) {
3436         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
3437         java.lang.String s = bs.toStringUtf8();
3438         natIpAllocateOption_ = s;
3439         return s;
3440       } else {
3441         return (java.lang.String) ref;
3442       }
3443     }
3444     /**
3445      *
3446      *
3447      * <pre>
3448      * Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty.
3449      * Check the NatIpAllocateOption enum for the list of possible values.
3450      * </pre>
3451      *
3452      * <code>optional string nat_ip_allocate_option = 429726845;</code>
3453      *
3454      * @return The bytes for natIpAllocateOption.
3455      */
getNatIpAllocateOptionBytes()3456     public com.google.protobuf.ByteString getNatIpAllocateOptionBytes() {
3457       java.lang.Object ref = natIpAllocateOption_;
3458       if (ref instanceof String) {
3459         com.google.protobuf.ByteString b =
3460             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
3461         natIpAllocateOption_ = b;
3462         return b;
3463       } else {
3464         return (com.google.protobuf.ByteString) ref;
3465       }
3466     }
3467     /**
3468      *
3469      *
3470      * <pre>
3471      * Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty.
3472      * Check the NatIpAllocateOption enum for the list of possible values.
3473      * </pre>
3474      *
3475      * <code>optional string nat_ip_allocate_option = 429726845;</code>
3476      *
3477      * @param value The natIpAllocateOption to set.
3478      * @return This builder for chaining.
3479      */
setNatIpAllocateOption(java.lang.String value)3480     public Builder setNatIpAllocateOption(java.lang.String value) {
3481       if (value == null) {
3482         throw new NullPointerException();
3483       }
3484       natIpAllocateOption_ = value;
3485       bitField0_ |= 0x00000200;
3486       onChanged();
3487       return this;
3488     }
3489     /**
3490      *
3491      *
3492      * <pre>
3493      * Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty.
3494      * Check the NatIpAllocateOption enum for the list of possible values.
3495      * </pre>
3496      *
3497      * <code>optional string nat_ip_allocate_option = 429726845;</code>
3498      *
3499      * @return This builder for chaining.
3500      */
clearNatIpAllocateOption()3501     public Builder clearNatIpAllocateOption() {
3502       natIpAllocateOption_ = getDefaultInstance().getNatIpAllocateOption();
3503       bitField0_ = (bitField0_ & ~0x00000200);
3504       onChanged();
3505       return this;
3506     }
3507     /**
3508      *
3509      *
3510      * <pre>
3511      * Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty.
3512      * Check the NatIpAllocateOption enum for the list of possible values.
3513      * </pre>
3514      *
3515      * <code>optional string nat_ip_allocate_option = 429726845;</code>
3516      *
3517      * @param value The bytes for natIpAllocateOption to set.
3518      * @return This builder for chaining.
3519      */
setNatIpAllocateOptionBytes(com.google.protobuf.ByteString value)3520     public Builder setNatIpAllocateOptionBytes(com.google.protobuf.ByteString value) {
3521       if (value == null) {
3522         throw new NullPointerException();
3523       }
3524       checkByteStringIsUtf8(value);
3525       natIpAllocateOption_ = value;
3526       bitField0_ |= 0x00000200;
3527       onChanged();
3528       return this;
3529     }
3530 
3531     private com.google.protobuf.LazyStringList natIps_ =
3532         com.google.protobuf.LazyStringArrayList.EMPTY;
3533 
ensureNatIpsIsMutable()3534     private void ensureNatIpsIsMutable() {
3535       if (!((bitField0_ & 0x00000400) != 0)) {
3536         natIps_ = new com.google.protobuf.LazyStringArrayList(natIps_);
3537         bitField0_ |= 0x00000400;
3538       }
3539     }
3540     /**
3541      *
3542      *
3543      * <pre>
3544      * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.
3545      * </pre>
3546      *
3547      * <code>repeated string nat_ips = 117635086;</code>
3548      *
3549      * @return A list containing the natIps.
3550      */
getNatIpsList()3551     public com.google.protobuf.ProtocolStringList getNatIpsList() {
3552       return natIps_.getUnmodifiableView();
3553     }
3554     /**
3555      *
3556      *
3557      * <pre>
3558      * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.
3559      * </pre>
3560      *
3561      * <code>repeated string nat_ips = 117635086;</code>
3562      *
3563      * @return The count of natIps.
3564      */
getNatIpsCount()3565     public int getNatIpsCount() {
3566       return natIps_.size();
3567     }
3568     /**
3569      *
3570      *
3571      * <pre>
3572      * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.
3573      * </pre>
3574      *
3575      * <code>repeated string nat_ips = 117635086;</code>
3576      *
3577      * @param index The index of the element to return.
3578      * @return The natIps at the given index.
3579      */
getNatIps(int index)3580     public java.lang.String getNatIps(int index) {
3581       return natIps_.get(index);
3582     }
3583     /**
3584      *
3585      *
3586      * <pre>
3587      * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.
3588      * </pre>
3589      *
3590      * <code>repeated string nat_ips = 117635086;</code>
3591      *
3592      * @param index The index of the value to return.
3593      * @return The bytes of the natIps at the given index.
3594      */
getNatIpsBytes(int index)3595     public com.google.protobuf.ByteString getNatIpsBytes(int index) {
3596       return natIps_.getByteString(index);
3597     }
3598     /**
3599      *
3600      *
3601      * <pre>
3602      * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.
3603      * </pre>
3604      *
3605      * <code>repeated string nat_ips = 117635086;</code>
3606      *
3607      * @param index The index to set the value at.
3608      * @param value The natIps to set.
3609      * @return This builder for chaining.
3610      */
setNatIps(int index, java.lang.String value)3611     public Builder setNatIps(int index, java.lang.String value) {
3612       if (value == null) {
3613         throw new NullPointerException();
3614       }
3615       ensureNatIpsIsMutable();
3616       natIps_.set(index, value);
3617       onChanged();
3618       return this;
3619     }
3620     /**
3621      *
3622      *
3623      * <pre>
3624      * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.
3625      * </pre>
3626      *
3627      * <code>repeated string nat_ips = 117635086;</code>
3628      *
3629      * @param value The natIps to add.
3630      * @return This builder for chaining.
3631      */
addNatIps(java.lang.String value)3632     public Builder addNatIps(java.lang.String value) {
3633       if (value == null) {
3634         throw new NullPointerException();
3635       }
3636       ensureNatIpsIsMutable();
3637       natIps_.add(value);
3638       onChanged();
3639       return this;
3640     }
3641     /**
3642      *
3643      *
3644      * <pre>
3645      * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.
3646      * </pre>
3647      *
3648      * <code>repeated string nat_ips = 117635086;</code>
3649      *
3650      * @param values The natIps to add.
3651      * @return This builder for chaining.
3652      */
addAllNatIps(java.lang.Iterable<java.lang.String> values)3653     public Builder addAllNatIps(java.lang.Iterable<java.lang.String> values) {
3654       ensureNatIpsIsMutable();
3655       com.google.protobuf.AbstractMessageLite.Builder.addAll(values, natIps_);
3656       onChanged();
3657       return this;
3658     }
3659     /**
3660      *
3661      *
3662      * <pre>
3663      * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.
3664      * </pre>
3665      *
3666      * <code>repeated string nat_ips = 117635086;</code>
3667      *
3668      * @return This builder for chaining.
3669      */
clearNatIps()3670     public Builder clearNatIps() {
3671       natIps_ = com.google.protobuf.LazyStringArrayList.EMPTY;
3672       bitField0_ = (bitField0_ & ~0x00000400);
3673       onChanged();
3674       return this;
3675     }
3676     /**
3677      *
3678      *
3679      * <pre>
3680      * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.
3681      * </pre>
3682      *
3683      * <code>repeated string nat_ips = 117635086;</code>
3684      *
3685      * @param value The bytes of the natIps to add.
3686      * @return This builder for chaining.
3687      */
addNatIpsBytes(com.google.protobuf.ByteString value)3688     public Builder addNatIpsBytes(com.google.protobuf.ByteString value) {
3689       if (value == null) {
3690         throw new NullPointerException();
3691       }
3692       checkByteStringIsUtf8(value);
3693       ensureNatIpsIsMutable();
3694       natIps_.add(value);
3695       onChanged();
3696       return this;
3697     }
3698 
3699     private java.util.List<com.google.cloud.compute.v1.RouterNatRule> rules_ =
3700         java.util.Collections.emptyList();
3701 
ensureRulesIsMutable()3702     private void ensureRulesIsMutable() {
3703       if (!((bitField0_ & 0x00000800) != 0)) {
3704         rules_ = new java.util.ArrayList<com.google.cloud.compute.v1.RouterNatRule>(rules_);
3705         bitField0_ |= 0x00000800;
3706       }
3707     }
3708 
3709     private com.google.protobuf.RepeatedFieldBuilderV3<
3710             com.google.cloud.compute.v1.RouterNatRule,
3711             com.google.cloud.compute.v1.RouterNatRule.Builder,
3712             com.google.cloud.compute.v1.RouterNatRuleOrBuilder>
3713         rulesBuilder_;
3714 
3715     /**
3716      *
3717      *
3718      * <pre>
3719      * A list of rules associated with this NAT.
3720      * </pre>
3721      *
3722      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
3723      */
getRulesList()3724     public java.util.List<com.google.cloud.compute.v1.RouterNatRule> getRulesList() {
3725       if (rulesBuilder_ == null) {
3726         return java.util.Collections.unmodifiableList(rules_);
3727       } else {
3728         return rulesBuilder_.getMessageList();
3729       }
3730     }
3731     /**
3732      *
3733      *
3734      * <pre>
3735      * A list of rules associated with this NAT.
3736      * </pre>
3737      *
3738      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
3739      */
getRulesCount()3740     public int getRulesCount() {
3741       if (rulesBuilder_ == null) {
3742         return rules_.size();
3743       } else {
3744         return rulesBuilder_.getCount();
3745       }
3746     }
3747     /**
3748      *
3749      *
3750      * <pre>
3751      * A list of rules associated with this NAT.
3752      * </pre>
3753      *
3754      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
3755      */
getRules(int index)3756     public com.google.cloud.compute.v1.RouterNatRule getRules(int index) {
3757       if (rulesBuilder_ == null) {
3758         return rules_.get(index);
3759       } else {
3760         return rulesBuilder_.getMessage(index);
3761       }
3762     }
3763     /**
3764      *
3765      *
3766      * <pre>
3767      * A list of rules associated with this NAT.
3768      * </pre>
3769      *
3770      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
3771      */
setRules(int index, com.google.cloud.compute.v1.RouterNatRule value)3772     public Builder setRules(int index, com.google.cloud.compute.v1.RouterNatRule value) {
3773       if (rulesBuilder_ == null) {
3774         if (value == null) {
3775           throw new NullPointerException();
3776         }
3777         ensureRulesIsMutable();
3778         rules_.set(index, value);
3779         onChanged();
3780       } else {
3781         rulesBuilder_.setMessage(index, value);
3782       }
3783       return this;
3784     }
3785     /**
3786      *
3787      *
3788      * <pre>
3789      * A list of rules associated with this NAT.
3790      * </pre>
3791      *
3792      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
3793      */
setRules( int index, com.google.cloud.compute.v1.RouterNatRule.Builder builderForValue)3794     public Builder setRules(
3795         int index, com.google.cloud.compute.v1.RouterNatRule.Builder builderForValue) {
3796       if (rulesBuilder_ == null) {
3797         ensureRulesIsMutable();
3798         rules_.set(index, builderForValue.build());
3799         onChanged();
3800       } else {
3801         rulesBuilder_.setMessage(index, builderForValue.build());
3802       }
3803       return this;
3804     }
3805     /**
3806      *
3807      *
3808      * <pre>
3809      * A list of rules associated with this NAT.
3810      * </pre>
3811      *
3812      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
3813      */
addRules(com.google.cloud.compute.v1.RouterNatRule value)3814     public Builder addRules(com.google.cloud.compute.v1.RouterNatRule value) {
3815       if (rulesBuilder_ == null) {
3816         if (value == null) {
3817           throw new NullPointerException();
3818         }
3819         ensureRulesIsMutable();
3820         rules_.add(value);
3821         onChanged();
3822       } else {
3823         rulesBuilder_.addMessage(value);
3824       }
3825       return this;
3826     }
3827     /**
3828      *
3829      *
3830      * <pre>
3831      * A list of rules associated with this NAT.
3832      * </pre>
3833      *
3834      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
3835      */
addRules(int index, com.google.cloud.compute.v1.RouterNatRule value)3836     public Builder addRules(int index, com.google.cloud.compute.v1.RouterNatRule value) {
3837       if (rulesBuilder_ == null) {
3838         if (value == null) {
3839           throw new NullPointerException();
3840         }
3841         ensureRulesIsMutable();
3842         rules_.add(index, value);
3843         onChanged();
3844       } else {
3845         rulesBuilder_.addMessage(index, value);
3846       }
3847       return this;
3848     }
3849     /**
3850      *
3851      *
3852      * <pre>
3853      * A list of rules associated with this NAT.
3854      * </pre>
3855      *
3856      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
3857      */
addRules(com.google.cloud.compute.v1.RouterNatRule.Builder builderForValue)3858     public Builder addRules(com.google.cloud.compute.v1.RouterNatRule.Builder builderForValue) {
3859       if (rulesBuilder_ == null) {
3860         ensureRulesIsMutable();
3861         rules_.add(builderForValue.build());
3862         onChanged();
3863       } else {
3864         rulesBuilder_.addMessage(builderForValue.build());
3865       }
3866       return this;
3867     }
3868     /**
3869      *
3870      *
3871      * <pre>
3872      * A list of rules associated with this NAT.
3873      * </pre>
3874      *
3875      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
3876      */
addRules( int index, com.google.cloud.compute.v1.RouterNatRule.Builder builderForValue)3877     public Builder addRules(
3878         int index, com.google.cloud.compute.v1.RouterNatRule.Builder builderForValue) {
3879       if (rulesBuilder_ == null) {
3880         ensureRulesIsMutable();
3881         rules_.add(index, builderForValue.build());
3882         onChanged();
3883       } else {
3884         rulesBuilder_.addMessage(index, builderForValue.build());
3885       }
3886       return this;
3887     }
3888     /**
3889      *
3890      *
3891      * <pre>
3892      * A list of rules associated with this NAT.
3893      * </pre>
3894      *
3895      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
3896      */
addAllRules( java.lang.Iterable<? extends com.google.cloud.compute.v1.RouterNatRule> values)3897     public Builder addAllRules(
3898         java.lang.Iterable<? extends com.google.cloud.compute.v1.RouterNatRule> values) {
3899       if (rulesBuilder_ == null) {
3900         ensureRulesIsMutable();
3901         com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rules_);
3902         onChanged();
3903       } else {
3904         rulesBuilder_.addAllMessages(values);
3905       }
3906       return this;
3907     }
3908     /**
3909      *
3910      *
3911      * <pre>
3912      * A list of rules associated with this NAT.
3913      * </pre>
3914      *
3915      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
3916      */
clearRules()3917     public Builder clearRules() {
3918       if (rulesBuilder_ == null) {
3919         rules_ = java.util.Collections.emptyList();
3920         bitField0_ = (bitField0_ & ~0x00000800);
3921         onChanged();
3922       } else {
3923         rulesBuilder_.clear();
3924       }
3925       return this;
3926     }
3927     /**
3928      *
3929      *
3930      * <pre>
3931      * A list of rules associated with this NAT.
3932      * </pre>
3933      *
3934      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
3935      */
removeRules(int index)3936     public Builder removeRules(int index) {
3937       if (rulesBuilder_ == null) {
3938         ensureRulesIsMutable();
3939         rules_.remove(index);
3940         onChanged();
3941       } else {
3942         rulesBuilder_.remove(index);
3943       }
3944       return this;
3945     }
3946     /**
3947      *
3948      *
3949      * <pre>
3950      * A list of rules associated with this NAT.
3951      * </pre>
3952      *
3953      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
3954      */
getRulesBuilder(int index)3955     public com.google.cloud.compute.v1.RouterNatRule.Builder getRulesBuilder(int index) {
3956       return getRulesFieldBuilder().getBuilder(index);
3957     }
3958     /**
3959      *
3960      *
3961      * <pre>
3962      * A list of rules associated with this NAT.
3963      * </pre>
3964      *
3965      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
3966      */
getRulesOrBuilder(int index)3967     public com.google.cloud.compute.v1.RouterNatRuleOrBuilder getRulesOrBuilder(int index) {
3968       if (rulesBuilder_ == null) {
3969         return rules_.get(index);
3970       } else {
3971         return rulesBuilder_.getMessageOrBuilder(index);
3972       }
3973     }
3974     /**
3975      *
3976      *
3977      * <pre>
3978      * A list of rules associated with this NAT.
3979      * </pre>
3980      *
3981      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
3982      */
3983     public java.util.List<? extends com.google.cloud.compute.v1.RouterNatRuleOrBuilder>
getRulesOrBuilderList()3984         getRulesOrBuilderList() {
3985       if (rulesBuilder_ != null) {
3986         return rulesBuilder_.getMessageOrBuilderList();
3987       } else {
3988         return java.util.Collections.unmodifiableList(rules_);
3989       }
3990     }
3991     /**
3992      *
3993      *
3994      * <pre>
3995      * A list of rules associated with this NAT.
3996      * </pre>
3997      *
3998      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
3999      */
addRulesBuilder()4000     public com.google.cloud.compute.v1.RouterNatRule.Builder addRulesBuilder() {
4001       return getRulesFieldBuilder()
4002           .addBuilder(com.google.cloud.compute.v1.RouterNatRule.getDefaultInstance());
4003     }
4004     /**
4005      *
4006      *
4007      * <pre>
4008      * A list of rules associated with this NAT.
4009      * </pre>
4010      *
4011      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
4012      */
addRulesBuilder(int index)4013     public com.google.cloud.compute.v1.RouterNatRule.Builder addRulesBuilder(int index) {
4014       return getRulesFieldBuilder()
4015           .addBuilder(index, com.google.cloud.compute.v1.RouterNatRule.getDefaultInstance());
4016     }
4017     /**
4018      *
4019      *
4020      * <pre>
4021      * A list of rules associated with this NAT.
4022      * </pre>
4023      *
4024      * <code>repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;</code>
4025      */
getRulesBuilderList()4026     public java.util.List<com.google.cloud.compute.v1.RouterNatRule.Builder> getRulesBuilderList() {
4027       return getRulesFieldBuilder().getBuilderList();
4028     }
4029 
4030     private com.google.protobuf.RepeatedFieldBuilderV3<
4031             com.google.cloud.compute.v1.RouterNatRule,
4032             com.google.cloud.compute.v1.RouterNatRule.Builder,
4033             com.google.cloud.compute.v1.RouterNatRuleOrBuilder>
getRulesFieldBuilder()4034         getRulesFieldBuilder() {
4035       if (rulesBuilder_ == null) {
4036         rulesBuilder_ =
4037             new com.google.protobuf.RepeatedFieldBuilderV3<
4038                 com.google.cloud.compute.v1.RouterNatRule,
4039                 com.google.cloud.compute.v1.RouterNatRule.Builder,
4040                 com.google.cloud.compute.v1.RouterNatRuleOrBuilder>(
4041                 rules_, ((bitField0_ & 0x00000800) != 0), getParentForChildren(), isClean());
4042         rules_ = null;
4043       }
4044       return rulesBuilder_;
4045     }
4046 
4047     private java.lang.Object sourceSubnetworkIpRangesToNat_ = "";
4048     /**
4049      *
4050      *
4051      * <pre>
4052      * Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other Router.Nat section in any Router for this network in this region.
4053      * Check the SourceSubnetworkIpRangesToNat enum for the list of possible values.
4054      * </pre>
4055      *
4056      * <code>optional string source_subnetwork_ip_ranges_to_nat = 252213211;</code>
4057      *
4058      * @return Whether the sourceSubnetworkIpRangesToNat field is set.
4059      */
hasSourceSubnetworkIpRangesToNat()4060     public boolean hasSourceSubnetworkIpRangesToNat() {
4061       return ((bitField0_ & 0x00001000) != 0);
4062     }
4063     /**
4064      *
4065      *
4066      * <pre>
4067      * Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other Router.Nat section in any Router for this network in this region.
4068      * Check the SourceSubnetworkIpRangesToNat enum for the list of possible values.
4069      * </pre>
4070      *
4071      * <code>optional string source_subnetwork_ip_ranges_to_nat = 252213211;</code>
4072      *
4073      * @return The sourceSubnetworkIpRangesToNat.
4074      */
getSourceSubnetworkIpRangesToNat()4075     public java.lang.String getSourceSubnetworkIpRangesToNat() {
4076       java.lang.Object ref = sourceSubnetworkIpRangesToNat_;
4077       if (!(ref instanceof java.lang.String)) {
4078         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
4079         java.lang.String s = bs.toStringUtf8();
4080         sourceSubnetworkIpRangesToNat_ = s;
4081         return s;
4082       } else {
4083         return (java.lang.String) ref;
4084       }
4085     }
4086     /**
4087      *
4088      *
4089      * <pre>
4090      * Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other Router.Nat section in any Router for this network in this region.
4091      * Check the SourceSubnetworkIpRangesToNat enum for the list of possible values.
4092      * </pre>
4093      *
4094      * <code>optional string source_subnetwork_ip_ranges_to_nat = 252213211;</code>
4095      *
4096      * @return The bytes for sourceSubnetworkIpRangesToNat.
4097      */
getSourceSubnetworkIpRangesToNatBytes()4098     public com.google.protobuf.ByteString getSourceSubnetworkIpRangesToNatBytes() {
4099       java.lang.Object ref = sourceSubnetworkIpRangesToNat_;
4100       if (ref instanceof String) {
4101         com.google.protobuf.ByteString b =
4102             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
4103         sourceSubnetworkIpRangesToNat_ = b;
4104         return b;
4105       } else {
4106         return (com.google.protobuf.ByteString) ref;
4107       }
4108     }
4109     /**
4110      *
4111      *
4112      * <pre>
4113      * Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other Router.Nat section in any Router for this network in this region.
4114      * Check the SourceSubnetworkIpRangesToNat enum for the list of possible values.
4115      * </pre>
4116      *
4117      * <code>optional string source_subnetwork_ip_ranges_to_nat = 252213211;</code>
4118      *
4119      * @param value The sourceSubnetworkIpRangesToNat to set.
4120      * @return This builder for chaining.
4121      */
setSourceSubnetworkIpRangesToNat(java.lang.String value)4122     public Builder setSourceSubnetworkIpRangesToNat(java.lang.String value) {
4123       if (value == null) {
4124         throw new NullPointerException();
4125       }
4126       sourceSubnetworkIpRangesToNat_ = value;
4127       bitField0_ |= 0x00001000;
4128       onChanged();
4129       return this;
4130     }
4131     /**
4132      *
4133      *
4134      * <pre>
4135      * Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other Router.Nat section in any Router for this network in this region.
4136      * Check the SourceSubnetworkIpRangesToNat enum for the list of possible values.
4137      * </pre>
4138      *
4139      * <code>optional string source_subnetwork_ip_ranges_to_nat = 252213211;</code>
4140      *
4141      * @return This builder for chaining.
4142      */
clearSourceSubnetworkIpRangesToNat()4143     public Builder clearSourceSubnetworkIpRangesToNat() {
4144       sourceSubnetworkIpRangesToNat_ = getDefaultInstance().getSourceSubnetworkIpRangesToNat();
4145       bitField0_ = (bitField0_ & ~0x00001000);
4146       onChanged();
4147       return this;
4148     }
4149     /**
4150      *
4151      *
4152      * <pre>
4153      * Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other Router.Nat section in any Router for this network in this region.
4154      * Check the SourceSubnetworkIpRangesToNat enum for the list of possible values.
4155      * </pre>
4156      *
4157      * <code>optional string source_subnetwork_ip_ranges_to_nat = 252213211;</code>
4158      *
4159      * @param value The bytes for sourceSubnetworkIpRangesToNat to set.
4160      * @return This builder for chaining.
4161      */
setSourceSubnetworkIpRangesToNatBytes(com.google.protobuf.ByteString value)4162     public Builder setSourceSubnetworkIpRangesToNatBytes(com.google.protobuf.ByteString value) {
4163       if (value == null) {
4164         throw new NullPointerException();
4165       }
4166       checkByteStringIsUtf8(value);
4167       sourceSubnetworkIpRangesToNat_ = value;
4168       bitField0_ |= 0x00001000;
4169       onChanged();
4170       return this;
4171     }
4172 
4173     private java.util.List<com.google.cloud.compute.v1.RouterNatSubnetworkToNat> subnetworks_ =
4174         java.util.Collections.emptyList();
4175 
ensureSubnetworksIsMutable()4176     private void ensureSubnetworksIsMutable() {
4177       if (!((bitField0_ & 0x00002000) != 0)) {
4178         subnetworks_ =
4179             new java.util.ArrayList<com.google.cloud.compute.v1.RouterNatSubnetworkToNat>(
4180                 subnetworks_);
4181         bitField0_ |= 0x00002000;
4182       }
4183     }
4184 
4185     private com.google.protobuf.RepeatedFieldBuilderV3<
4186             com.google.cloud.compute.v1.RouterNatSubnetworkToNat,
4187             com.google.cloud.compute.v1.RouterNatSubnetworkToNat.Builder,
4188             com.google.cloud.compute.v1.RouterNatSubnetworkToNatOrBuilder>
4189         subnetworksBuilder_;
4190 
4191     /**
4192      *
4193      *
4194      * <pre>
4195      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4196      * </pre>
4197      *
4198      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4199      * </code>
4200      */
4201     public java.util.List<com.google.cloud.compute.v1.RouterNatSubnetworkToNat>
getSubnetworksList()4202         getSubnetworksList() {
4203       if (subnetworksBuilder_ == null) {
4204         return java.util.Collections.unmodifiableList(subnetworks_);
4205       } else {
4206         return subnetworksBuilder_.getMessageList();
4207       }
4208     }
4209     /**
4210      *
4211      *
4212      * <pre>
4213      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4214      * </pre>
4215      *
4216      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4217      * </code>
4218      */
getSubnetworksCount()4219     public int getSubnetworksCount() {
4220       if (subnetworksBuilder_ == null) {
4221         return subnetworks_.size();
4222       } else {
4223         return subnetworksBuilder_.getCount();
4224       }
4225     }
4226     /**
4227      *
4228      *
4229      * <pre>
4230      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4231      * </pre>
4232      *
4233      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4234      * </code>
4235      */
getSubnetworks(int index)4236     public com.google.cloud.compute.v1.RouterNatSubnetworkToNat getSubnetworks(int index) {
4237       if (subnetworksBuilder_ == null) {
4238         return subnetworks_.get(index);
4239       } else {
4240         return subnetworksBuilder_.getMessage(index);
4241       }
4242     }
4243     /**
4244      *
4245      *
4246      * <pre>
4247      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4248      * </pre>
4249      *
4250      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4251      * </code>
4252      */
setSubnetworks( int index, com.google.cloud.compute.v1.RouterNatSubnetworkToNat value)4253     public Builder setSubnetworks(
4254         int index, com.google.cloud.compute.v1.RouterNatSubnetworkToNat value) {
4255       if (subnetworksBuilder_ == null) {
4256         if (value == null) {
4257           throw new NullPointerException();
4258         }
4259         ensureSubnetworksIsMutable();
4260         subnetworks_.set(index, value);
4261         onChanged();
4262       } else {
4263         subnetworksBuilder_.setMessage(index, value);
4264       }
4265       return this;
4266     }
4267     /**
4268      *
4269      *
4270      * <pre>
4271      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4272      * </pre>
4273      *
4274      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4275      * </code>
4276      */
setSubnetworks( int index, com.google.cloud.compute.v1.RouterNatSubnetworkToNat.Builder builderForValue)4277     public Builder setSubnetworks(
4278         int index, com.google.cloud.compute.v1.RouterNatSubnetworkToNat.Builder builderForValue) {
4279       if (subnetworksBuilder_ == null) {
4280         ensureSubnetworksIsMutable();
4281         subnetworks_.set(index, builderForValue.build());
4282         onChanged();
4283       } else {
4284         subnetworksBuilder_.setMessage(index, builderForValue.build());
4285       }
4286       return this;
4287     }
4288     /**
4289      *
4290      *
4291      * <pre>
4292      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4293      * </pre>
4294      *
4295      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4296      * </code>
4297      */
addSubnetworks(com.google.cloud.compute.v1.RouterNatSubnetworkToNat value)4298     public Builder addSubnetworks(com.google.cloud.compute.v1.RouterNatSubnetworkToNat value) {
4299       if (subnetworksBuilder_ == null) {
4300         if (value == null) {
4301           throw new NullPointerException();
4302         }
4303         ensureSubnetworksIsMutable();
4304         subnetworks_.add(value);
4305         onChanged();
4306       } else {
4307         subnetworksBuilder_.addMessage(value);
4308       }
4309       return this;
4310     }
4311     /**
4312      *
4313      *
4314      * <pre>
4315      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4316      * </pre>
4317      *
4318      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4319      * </code>
4320      */
addSubnetworks( int index, com.google.cloud.compute.v1.RouterNatSubnetworkToNat value)4321     public Builder addSubnetworks(
4322         int index, com.google.cloud.compute.v1.RouterNatSubnetworkToNat value) {
4323       if (subnetworksBuilder_ == null) {
4324         if (value == null) {
4325           throw new NullPointerException();
4326         }
4327         ensureSubnetworksIsMutable();
4328         subnetworks_.add(index, value);
4329         onChanged();
4330       } else {
4331         subnetworksBuilder_.addMessage(index, value);
4332       }
4333       return this;
4334     }
4335     /**
4336      *
4337      *
4338      * <pre>
4339      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4340      * </pre>
4341      *
4342      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4343      * </code>
4344      */
addSubnetworks( com.google.cloud.compute.v1.RouterNatSubnetworkToNat.Builder builderForValue)4345     public Builder addSubnetworks(
4346         com.google.cloud.compute.v1.RouterNatSubnetworkToNat.Builder builderForValue) {
4347       if (subnetworksBuilder_ == null) {
4348         ensureSubnetworksIsMutable();
4349         subnetworks_.add(builderForValue.build());
4350         onChanged();
4351       } else {
4352         subnetworksBuilder_.addMessage(builderForValue.build());
4353       }
4354       return this;
4355     }
4356     /**
4357      *
4358      *
4359      * <pre>
4360      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4361      * </pre>
4362      *
4363      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4364      * </code>
4365      */
addSubnetworks( int index, com.google.cloud.compute.v1.RouterNatSubnetworkToNat.Builder builderForValue)4366     public Builder addSubnetworks(
4367         int index, com.google.cloud.compute.v1.RouterNatSubnetworkToNat.Builder builderForValue) {
4368       if (subnetworksBuilder_ == null) {
4369         ensureSubnetworksIsMutable();
4370         subnetworks_.add(index, builderForValue.build());
4371         onChanged();
4372       } else {
4373         subnetworksBuilder_.addMessage(index, builderForValue.build());
4374       }
4375       return this;
4376     }
4377     /**
4378      *
4379      *
4380      * <pre>
4381      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4382      * </pre>
4383      *
4384      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4385      * </code>
4386      */
addAllSubnetworks( java.lang.Iterable<? extends com.google.cloud.compute.v1.RouterNatSubnetworkToNat> values)4387     public Builder addAllSubnetworks(
4388         java.lang.Iterable<? extends com.google.cloud.compute.v1.RouterNatSubnetworkToNat> values) {
4389       if (subnetworksBuilder_ == null) {
4390         ensureSubnetworksIsMutable();
4391         com.google.protobuf.AbstractMessageLite.Builder.addAll(values, subnetworks_);
4392         onChanged();
4393       } else {
4394         subnetworksBuilder_.addAllMessages(values);
4395       }
4396       return this;
4397     }
4398     /**
4399      *
4400      *
4401      * <pre>
4402      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4403      * </pre>
4404      *
4405      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4406      * </code>
4407      */
clearSubnetworks()4408     public Builder clearSubnetworks() {
4409       if (subnetworksBuilder_ == null) {
4410         subnetworks_ = java.util.Collections.emptyList();
4411         bitField0_ = (bitField0_ & ~0x00002000);
4412         onChanged();
4413       } else {
4414         subnetworksBuilder_.clear();
4415       }
4416       return this;
4417     }
4418     /**
4419      *
4420      *
4421      * <pre>
4422      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4423      * </pre>
4424      *
4425      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4426      * </code>
4427      */
removeSubnetworks(int index)4428     public Builder removeSubnetworks(int index) {
4429       if (subnetworksBuilder_ == null) {
4430         ensureSubnetworksIsMutable();
4431         subnetworks_.remove(index);
4432         onChanged();
4433       } else {
4434         subnetworksBuilder_.remove(index);
4435       }
4436       return this;
4437     }
4438     /**
4439      *
4440      *
4441      * <pre>
4442      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4443      * </pre>
4444      *
4445      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4446      * </code>
4447      */
getSubnetworksBuilder( int index)4448     public com.google.cloud.compute.v1.RouterNatSubnetworkToNat.Builder getSubnetworksBuilder(
4449         int index) {
4450       return getSubnetworksFieldBuilder().getBuilder(index);
4451     }
4452     /**
4453      *
4454      *
4455      * <pre>
4456      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4457      * </pre>
4458      *
4459      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4460      * </code>
4461      */
getSubnetworksOrBuilder( int index)4462     public com.google.cloud.compute.v1.RouterNatSubnetworkToNatOrBuilder getSubnetworksOrBuilder(
4463         int index) {
4464       if (subnetworksBuilder_ == null) {
4465         return subnetworks_.get(index);
4466       } else {
4467         return subnetworksBuilder_.getMessageOrBuilder(index);
4468       }
4469     }
4470     /**
4471      *
4472      *
4473      * <pre>
4474      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4475      * </pre>
4476      *
4477      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4478      * </code>
4479      */
4480     public java.util.List<? extends com.google.cloud.compute.v1.RouterNatSubnetworkToNatOrBuilder>
getSubnetworksOrBuilderList()4481         getSubnetworksOrBuilderList() {
4482       if (subnetworksBuilder_ != null) {
4483         return subnetworksBuilder_.getMessageOrBuilderList();
4484       } else {
4485         return java.util.Collections.unmodifiableList(subnetworks_);
4486       }
4487     }
4488     /**
4489      *
4490      *
4491      * <pre>
4492      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4493      * </pre>
4494      *
4495      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4496      * </code>
4497      */
addSubnetworksBuilder()4498     public com.google.cloud.compute.v1.RouterNatSubnetworkToNat.Builder addSubnetworksBuilder() {
4499       return getSubnetworksFieldBuilder()
4500           .addBuilder(com.google.cloud.compute.v1.RouterNatSubnetworkToNat.getDefaultInstance());
4501     }
4502     /**
4503      *
4504      *
4505      * <pre>
4506      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4507      * </pre>
4508      *
4509      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4510      * </code>
4511      */
addSubnetworksBuilder( int index)4512     public com.google.cloud.compute.v1.RouterNatSubnetworkToNat.Builder addSubnetworksBuilder(
4513         int index) {
4514       return getSubnetworksFieldBuilder()
4515           .addBuilder(
4516               index, com.google.cloud.compute.v1.RouterNatSubnetworkToNat.getDefaultInstance());
4517     }
4518     /**
4519      *
4520      *
4521      * <pre>
4522      * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.
4523      * </pre>
4524      *
4525      * <code>repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;
4526      * </code>
4527      */
4528     public java.util.List<com.google.cloud.compute.v1.RouterNatSubnetworkToNat.Builder>
getSubnetworksBuilderList()4529         getSubnetworksBuilderList() {
4530       return getSubnetworksFieldBuilder().getBuilderList();
4531     }
4532 
4533     private com.google.protobuf.RepeatedFieldBuilderV3<
4534             com.google.cloud.compute.v1.RouterNatSubnetworkToNat,
4535             com.google.cloud.compute.v1.RouterNatSubnetworkToNat.Builder,
4536             com.google.cloud.compute.v1.RouterNatSubnetworkToNatOrBuilder>
getSubnetworksFieldBuilder()4537         getSubnetworksFieldBuilder() {
4538       if (subnetworksBuilder_ == null) {
4539         subnetworksBuilder_ =
4540             new com.google.protobuf.RepeatedFieldBuilderV3<
4541                 com.google.cloud.compute.v1.RouterNatSubnetworkToNat,
4542                 com.google.cloud.compute.v1.RouterNatSubnetworkToNat.Builder,
4543                 com.google.cloud.compute.v1.RouterNatSubnetworkToNatOrBuilder>(
4544                 subnetworks_, ((bitField0_ & 0x00002000) != 0), getParentForChildren(), isClean());
4545         subnetworks_ = null;
4546       }
4547       return subnetworksBuilder_;
4548     }
4549 
4550     private int tcpEstablishedIdleTimeoutSec_;
4551     /**
4552      *
4553      *
4554      * <pre>
4555      * Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
4556      * </pre>
4557      *
4558      * <code>optional int32 tcp_established_idle_timeout_sec = 223098349;</code>
4559      *
4560      * @return Whether the tcpEstablishedIdleTimeoutSec field is set.
4561      */
4562     @java.lang.Override
hasTcpEstablishedIdleTimeoutSec()4563     public boolean hasTcpEstablishedIdleTimeoutSec() {
4564       return ((bitField0_ & 0x00004000) != 0);
4565     }
4566     /**
4567      *
4568      *
4569      * <pre>
4570      * Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
4571      * </pre>
4572      *
4573      * <code>optional int32 tcp_established_idle_timeout_sec = 223098349;</code>
4574      *
4575      * @return The tcpEstablishedIdleTimeoutSec.
4576      */
4577     @java.lang.Override
getTcpEstablishedIdleTimeoutSec()4578     public int getTcpEstablishedIdleTimeoutSec() {
4579       return tcpEstablishedIdleTimeoutSec_;
4580     }
4581     /**
4582      *
4583      *
4584      * <pre>
4585      * Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
4586      * </pre>
4587      *
4588      * <code>optional int32 tcp_established_idle_timeout_sec = 223098349;</code>
4589      *
4590      * @param value The tcpEstablishedIdleTimeoutSec to set.
4591      * @return This builder for chaining.
4592      */
setTcpEstablishedIdleTimeoutSec(int value)4593     public Builder setTcpEstablishedIdleTimeoutSec(int value) {
4594 
4595       tcpEstablishedIdleTimeoutSec_ = value;
4596       bitField0_ |= 0x00004000;
4597       onChanged();
4598       return this;
4599     }
4600     /**
4601      *
4602      *
4603      * <pre>
4604      * Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
4605      * </pre>
4606      *
4607      * <code>optional int32 tcp_established_idle_timeout_sec = 223098349;</code>
4608      *
4609      * @return This builder for chaining.
4610      */
clearTcpEstablishedIdleTimeoutSec()4611     public Builder clearTcpEstablishedIdleTimeoutSec() {
4612       bitField0_ = (bitField0_ & ~0x00004000);
4613       tcpEstablishedIdleTimeoutSec_ = 0;
4614       onChanged();
4615       return this;
4616     }
4617 
4618     private int tcpTimeWaitTimeoutSec_;
4619     /**
4620      *
4621      *
4622      * <pre>
4623      * Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
4624      * </pre>
4625      *
4626      * <code>optional int32 tcp_time_wait_timeout_sec = 513596925;</code>
4627      *
4628      * @return Whether the tcpTimeWaitTimeoutSec field is set.
4629      */
4630     @java.lang.Override
hasTcpTimeWaitTimeoutSec()4631     public boolean hasTcpTimeWaitTimeoutSec() {
4632       return ((bitField0_ & 0x00008000) != 0);
4633     }
4634     /**
4635      *
4636      *
4637      * <pre>
4638      * Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
4639      * </pre>
4640      *
4641      * <code>optional int32 tcp_time_wait_timeout_sec = 513596925;</code>
4642      *
4643      * @return The tcpTimeWaitTimeoutSec.
4644      */
4645     @java.lang.Override
getTcpTimeWaitTimeoutSec()4646     public int getTcpTimeWaitTimeoutSec() {
4647       return tcpTimeWaitTimeoutSec_;
4648     }
4649     /**
4650      *
4651      *
4652      * <pre>
4653      * Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
4654      * </pre>
4655      *
4656      * <code>optional int32 tcp_time_wait_timeout_sec = 513596925;</code>
4657      *
4658      * @param value The tcpTimeWaitTimeoutSec to set.
4659      * @return This builder for chaining.
4660      */
setTcpTimeWaitTimeoutSec(int value)4661     public Builder setTcpTimeWaitTimeoutSec(int value) {
4662 
4663       tcpTimeWaitTimeoutSec_ = value;
4664       bitField0_ |= 0x00008000;
4665       onChanged();
4666       return this;
4667     }
4668     /**
4669      *
4670      *
4671      * <pre>
4672      * Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
4673      * </pre>
4674      *
4675      * <code>optional int32 tcp_time_wait_timeout_sec = 513596925;</code>
4676      *
4677      * @return This builder for chaining.
4678      */
clearTcpTimeWaitTimeoutSec()4679     public Builder clearTcpTimeWaitTimeoutSec() {
4680       bitField0_ = (bitField0_ & ~0x00008000);
4681       tcpTimeWaitTimeoutSec_ = 0;
4682       onChanged();
4683       return this;
4684     }
4685 
4686     private int tcpTransitoryIdleTimeoutSec_;
4687     /**
4688      *
4689      *
4690      * <pre>
4691      * Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
4692      * </pre>
4693      *
4694      * <code>optional int32 tcp_transitory_idle_timeout_sec = 205028774;</code>
4695      *
4696      * @return Whether the tcpTransitoryIdleTimeoutSec field is set.
4697      */
4698     @java.lang.Override
hasTcpTransitoryIdleTimeoutSec()4699     public boolean hasTcpTransitoryIdleTimeoutSec() {
4700       return ((bitField0_ & 0x00010000) != 0);
4701     }
4702     /**
4703      *
4704      *
4705      * <pre>
4706      * Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
4707      * </pre>
4708      *
4709      * <code>optional int32 tcp_transitory_idle_timeout_sec = 205028774;</code>
4710      *
4711      * @return The tcpTransitoryIdleTimeoutSec.
4712      */
4713     @java.lang.Override
getTcpTransitoryIdleTimeoutSec()4714     public int getTcpTransitoryIdleTimeoutSec() {
4715       return tcpTransitoryIdleTimeoutSec_;
4716     }
4717     /**
4718      *
4719      *
4720      * <pre>
4721      * Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
4722      * </pre>
4723      *
4724      * <code>optional int32 tcp_transitory_idle_timeout_sec = 205028774;</code>
4725      *
4726      * @param value The tcpTransitoryIdleTimeoutSec to set.
4727      * @return This builder for chaining.
4728      */
setTcpTransitoryIdleTimeoutSec(int value)4729     public Builder setTcpTransitoryIdleTimeoutSec(int value) {
4730 
4731       tcpTransitoryIdleTimeoutSec_ = value;
4732       bitField0_ |= 0x00010000;
4733       onChanged();
4734       return this;
4735     }
4736     /**
4737      *
4738      *
4739      * <pre>
4740      * Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
4741      * </pre>
4742      *
4743      * <code>optional int32 tcp_transitory_idle_timeout_sec = 205028774;</code>
4744      *
4745      * @return This builder for chaining.
4746      */
clearTcpTransitoryIdleTimeoutSec()4747     public Builder clearTcpTransitoryIdleTimeoutSec() {
4748       bitField0_ = (bitField0_ & ~0x00010000);
4749       tcpTransitoryIdleTimeoutSec_ = 0;
4750       onChanged();
4751       return this;
4752     }
4753 
4754     private int udpIdleTimeoutSec_;
4755     /**
4756      *
4757      *
4758      * <pre>
4759      * Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
4760      * </pre>
4761      *
4762      * <code>optional int32 udp_idle_timeout_sec = 64919878;</code>
4763      *
4764      * @return Whether the udpIdleTimeoutSec field is set.
4765      */
4766     @java.lang.Override
hasUdpIdleTimeoutSec()4767     public boolean hasUdpIdleTimeoutSec() {
4768       return ((bitField0_ & 0x00020000) != 0);
4769     }
4770     /**
4771      *
4772      *
4773      * <pre>
4774      * Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
4775      * </pre>
4776      *
4777      * <code>optional int32 udp_idle_timeout_sec = 64919878;</code>
4778      *
4779      * @return The udpIdleTimeoutSec.
4780      */
4781     @java.lang.Override
getUdpIdleTimeoutSec()4782     public int getUdpIdleTimeoutSec() {
4783       return udpIdleTimeoutSec_;
4784     }
4785     /**
4786      *
4787      *
4788      * <pre>
4789      * Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
4790      * </pre>
4791      *
4792      * <code>optional int32 udp_idle_timeout_sec = 64919878;</code>
4793      *
4794      * @param value The udpIdleTimeoutSec to set.
4795      * @return This builder for chaining.
4796      */
setUdpIdleTimeoutSec(int value)4797     public Builder setUdpIdleTimeoutSec(int value) {
4798 
4799       udpIdleTimeoutSec_ = value;
4800       bitField0_ |= 0x00020000;
4801       onChanged();
4802       return this;
4803     }
4804     /**
4805      *
4806      *
4807      * <pre>
4808      * Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
4809      * </pre>
4810      *
4811      * <code>optional int32 udp_idle_timeout_sec = 64919878;</code>
4812      *
4813      * @return This builder for chaining.
4814      */
clearUdpIdleTimeoutSec()4815     public Builder clearUdpIdleTimeoutSec() {
4816       bitField0_ = (bitField0_ & ~0x00020000);
4817       udpIdleTimeoutSec_ = 0;
4818       onChanged();
4819       return this;
4820     }
4821 
4822     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)4823     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
4824       return super.setUnknownFields(unknownFields);
4825     }
4826 
4827     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)4828     public final Builder mergeUnknownFields(
4829         final com.google.protobuf.UnknownFieldSet unknownFields) {
4830       return super.mergeUnknownFields(unknownFields);
4831     }
4832 
4833     // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.RouterNat)
4834   }
4835 
4836   // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.RouterNat)
4837   private static final com.google.cloud.compute.v1.RouterNat DEFAULT_INSTANCE;
4838 
4839   static {
4840     DEFAULT_INSTANCE = new com.google.cloud.compute.v1.RouterNat();
4841   }
4842 
getDefaultInstance()4843   public static com.google.cloud.compute.v1.RouterNat getDefaultInstance() {
4844     return DEFAULT_INSTANCE;
4845   }
4846 
4847   private static final com.google.protobuf.Parser<RouterNat> PARSER =
4848       new com.google.protobuf.AbstractParser<RouterNat>() {
4849         @java.lang.Override
4850         public RouterNat parsePartialFrom(
4851             com.google.protobuf.CodedInputStream input,
4852             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
4853             throws com.google.protobuf.InvalidProtocolBufferException {
4854           Builder builder = newBuilder();
4855           try {
4856             builder.mergeFrom(input, extensionRegistry);
4857           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
4858             throw e.setUnfinishedMessage(builder.buildPartial());
4859           } catch (com.google.protobuf.UninitializedMessageException e) {
4860             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
4861           } catch (java.io.IOException e) {
4862             throw new com.google.protobuf.InvalidProtocolBufferException(e)
4863                 .setUnfinishedMessage(builder.buildPartial());
4864           }
4865           return builder.buildPartial();
4866         }
4867       };
4868 
parser()4869   public static com.google.protobuf.Parser<RouterNat> parser() {
4870     return PARSER;
4871   }
4872 
4873   @java.lang.Override
getParserForType()4874   public com.google.protobuf.Parser<RouterNat> getParserForType() {
4875     return PARSER;
4876   }
4877 
4878   @java.lang.Override
getDefaultInstanceForType()4879   public com.google.cloud.compute.v1.RouterNat getDefaultInstanceForType() {
4880     return DEFAULT_INSTANCE;
4881   }
4882 }
4883