• 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  * Cloud Autoscaler policy.
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.compute.v1.AutoscalingPolicy}
29  */
30 public final class AutoscalingPolicy extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.AutoscalingPolicy)
33     AutoscalingPolicyOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use AutoscalingPolicy.newBuilder() to construct.
AutoscalingPolicy(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private AutoscalingPolicy(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
AutoscalingPolicy()40   private AutoscalingPolicy() {
41     customMetricUtilizations_ = java.util.Collections.emptyList();
42     mode_ = "";
43   }
44 
45   @java.lang.Override
46   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)47   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
48     return new AutoscalingPolicy();
49   }
50 
51   @java.lang.Override
getUnknownFields()52   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
53     return this.unknownFields;
54   }
55 
getDescriptor()56   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
57     return com.google.cloud.compute.v1.Compute
58         .internal_static_google_cloud_compute_v1_AutoscalingPolicy_descriptor;
59   }
60 
61   @SuppressWarnings({"rawtypes"})
62   @java.lang.Override
internalGetMapField(int number)63   protected com.google.protobuf.MapField internalGetMapField(int number) {
64     switch (number) {
65       case 355416580:
66         return internalGetScalingSchedules();
67       default:
68         throw new RuntimeException("Invalid map field number: " + number);
69     }
70   }
71 
72   @java.lang.Override
73   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()74       internalGetFieldAccessorTable() {
75     return com.google.cloud.compute.v1.Compute
76         .internal_static_google_cloud_compute_v1_AutoscalingPolicy_fieldAccessorTable
77         .ensureFieldAccessorsInitialized(
78             com.google.cloud.compute.v1.AutoscalingPolicy.class,
79             com.google.cloud.compute.v1.AutoscalingPolicy.Builder.class);
80   }
81 
82   /**
83    *
84    *
85    * <pre>
86    * Defines operating mode for this policy.
87    * </pre>
88    *
89    * Protobuf enum {@code google.cloud.compute.v1.AutoscalingPolicy.Mode}
90    */
91   public enum Mode implements com.google.protobuf.ProtocolMessageEnum {
92     /**
93      *
94      *
95      * <pre>
96      * A value indicating that the enum field is not set.
97      * </pre>
98      *
99      * <code>UNDEFINED_MODE = 0;</code>
100      */
101     UNDEFINED_MODE(0),
102     /**
103      *
104      *
105      * <pre>
106      * Do not automatically scale the MIG in or out. The recommended_size field contains the size of MIG that would be set if the actuation mode was enabled.
107      * </pre>
108      *
109      * <code>OFF = 78159;</code>
110      */
111     OFF(78159),
112     /**
113      *
114      *
115      * <pre>
116      * Automatically scale the MIG in and out according to the policy.
117      * </pre>
118      *
119      * <code>ON = 2527;</code>
120      */
121     ON(2527),
122     /**
123      *
124      *
125      * <pre>
126      * Automatically create VMs according to the policy, but do not scale the MIG in.
127      * </pre>
128      *
129      * <code>ONLY_SCALE_OUT = 152713670;</code>
130      */
131     ONLY_SCALE_OUT(152713670),
132     /**
133      *
134      *
135      * <pre>
136      * Automatically create VMs according to the policy, but do not scale the MIG in.
137      * </pre>
138      *
139      * <code>ONLY_UP = 478095374;</code>
140      */
141     ONLY_UP(478095374),
142     UNRECOGNIZED(-1),
143     ;
144 
145     /**
146      *
147      *
148      * <pre>
149      * A value indicating that the enum field is not set.
150      * </pre>
151      *
152      * <code>UNDEFINED_MODE = 0;</code>
153      */
154     public static final int UNDEFINED_MODE_VALUE = 0;
155     /**
156      *
157      *
158      * <pre>
159      * Do not automatically scale the MIG in or out. The recommended_size field contains the size of MIG that would be set if the actuation mode was enabled.
160      * </pre>
161      *
162      * <code>OFF = 78159;</code>
163      */
164     public static final int OFF_VALUE = 78159;
165     /**
166      *
167      *
168      * <pre>
169      * Automatically scale the MIG in and out according to the policy.
170      * </pre>
171      *
172      * <code>ON = 2527;</code>
173      */
174     public static final int ON_VALUE = 2527;
175     /**
176      *
177      *
178      * <pre>
179      * Automatically create VMs according to the policy, but do not scale the MIG in.
180      * </pre>
181      *
182      * <code>ONLY_SCALE_OUT = 152713670;</code>
183      */
184     public static final int ONLY_SCALE_OUT_VALUE = 152713670;
185     /**
186      *
187      *
188      * <pre>
189      * Automatically create VMs according to the policy, but do not scale the MIG in.
190      * </pre>
191      *
192      * <code>ONLY_UP = 478095374;</code>
193      */
194     public static final int ONLY_UP_VALUE = 478095374;
195 
getNumber()196     public final int getNumber() {
197       if (this == UNRECOGNIZED) {
198         throw new java.lang.IllegalArgumentException(
199             "Can't get the number of an unknown enum value.");
200       }
201       return value;
202     }
203 
204     /**
205      * @param value The numeric wire value of the corresponding enum entry.
206      * @return The enum associated with the given numeric wire value.
207      * @deprecated Use {@link #forNumber(int)} instead.
208      */
209     @java.lang.Deprecated
valueOf(int value)210     public static Mode valueOf(int value) {
211       return forNumber(value);
212     }
213 
214     /**
215      * @param value The numeric wire value of the corresponding enum entry.
216      * @return The enum associated with the given numeric wire value.
217      */
forNumber(int value)218     public static Mode forNumber(int value) {
219       switch (value) {
220         case 0:
221           return UNDEFINED_MODE;
222         case 78159:
223           return OFF;
224         case 2527:
225           return ON;
226         case 152713670:
227           return ONLY_SCALE_OUT;
228         case 478095374:
229           return ONLY_UP;
230         default:
231           return null;
232       }
233     }
234 
internalGetValueMap()235     public static com.google.protobuf.Internal.EnumLiteMap<Mode> internalGetValueMap() {
236       return internalValueMap;
237     }
238 
239     private static final com.google.protobuf.Internal.EnumLiteMap<Mode> internalValueMap =
240         new com.google.protobuf.Internal.EnumLiteMap<Mode>() {
241           public Mode findValueByNumber(int number) {
242             return Mode.forNumber(number);
243           }
244         };
245 
getValueDescriptor()246     public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
247       if (this == UNRECOGNIZED) {
248         throw new java.lang.IllegalStateException(
249             "Can't get the descriptor of an unrecognized enum value.");
250       }
251       return getDescriptor().getValues().get(ordinal());
252     }
253 
getDescriptorForType()254     public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
255       return getDescriptor();
256     }
257 
getDescriptor()258     public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
259       return com.google.cloud.compute.v1.AutoscalingPolicy.getDescriptor().getEnumTypes().get(0);
260     }
261 
262     private static final Mode[] VALUES = values();
263 
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)264     public static Mode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
265       if (desc.getType() != getDescriptor()) {
266         throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
267       }
268       if (desc.getIndex() == -1) {
269         return UNRECOGNIZED;
270       }
271       return VALUES[desc.getIndex()];
272     }
273 
274     private final int value;
275 
Mode(int value)276     private Mode(int value) {
277       this.value = value;
278     }
279 
280     // @@protoc_insertion_point(enum_scope:google.cloud.compute.v1.AutoscalingPolicy.Mode)
281   }
282 
283   private int bitField0_;
284   public static final int COOL_DOWN_PERIOD_SEC_FIELD_NUMBER = 107692954;
285   private int coolDownPeriodSec_ = 0;
286   /**
287    *
288    *
289    * <pre>
290    * The number of seconds that the autoscaler waits before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.
291    * </pre>
292    *
293    * <code>optional int32 cool_down_period_sec = 107692954;</code>
294    *
295    * @return Whether the coolDownPeriodSec field is set.
296    */
297   @java.lang.Override
hasCoolDownPeriodSec()298   public boolean hasCoolDownPeriodSec() {
299     return ((bitField0_ & 0x00000001) != 0);
300   }
301   /**
302    *
303    *
304    * <pre>
305    * The number of seconds that the autoscaler waits before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.
306    * </pre>
307    *
308    * <code>optional int32 cool_down_period_sec = 107692954;</code>
309    *
310    * @return The coolDownPeriodSec.
311    */
312   @java.lang.Override
getCoolDownPeriodSec()313   public int getCoolDownPeriodSec() {
314     return coolDownPeriodSec_;
315   }
316 
317   public static final int CPU_UTILIZATION_FIELD_NUMBER = 381211147;
318   private com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpuUtilization_;
319   /**
320    *
321    *
322    * <pre>
323    * Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
324    * </pre>
325    *
326    * <code>
327    * optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;
328    * </code>
329    *
330    * @return Whether the cpuUtilization field is set.
331    */
332   @java.lang.Override
hasCpuUtilization()333   public boolean hasCpuUtilization() {
334     return ((bitField0_ & 0x00000002) != 0);
335   }
336   /**
337    *
338    *
339    * <pre>
340    * Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
341    * </pre>
342    *
343    * <code>
344    * optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;
345    * </code>
346    *
347    * @return The cpuUtilization.
348    */
349   @java.lang.Override
getCpuUtilization()350   public com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization getCpuUtilization() {
351     return cpuUtilization_ == null
352         ? com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.getDefaultInstance()
353         : cpuUtilization_;
354   }
355   /**
356    *
357    *
358    * <pre>
359    * Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
360    * </pre>
361    *
362    * <code>
363    * optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;
364    * </code>
365    */
366   @java.lang.Override
367   public com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilizationOrBuilder
getCpuUtilizationOrBuilder()368       getCpuUtilizationOrBuilder() {
369     return cpuUtilization_ == null
370         ? com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.getDefaultInstance()
371         : cpuUtilization_;
372   }
373 
374   public static final int CUSTOM_METRIC_UTILIZATIONS_FIELD_NUMBER = 131972850;
375 
376   @SuppressWarnings("serial")
377   private java.util.List<com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization>
378       customMetricUtilizations_;
379   /**
380    *
381    *
382    * <pre>
383    * Configuration parameters of autoscaling based on a custom metric.
384    * </pre>
385    *
386    * <code>
387    * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
388    * </code>
389    */
390   @java.lang.Override
391   public java.util.List<com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization>
getCustomMetricUtilizationsList()392       getCustomMetricUtilizationsList() {
393     return customMetricUtilizations_;
394   }
395   /**
396    *
397    *
398    * <pre>
399    * Configuration parameters of autoscaling based on a custom metric.
400    * </pre>
401    *
402    * <code>
403    * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
404    * </code>
405    */
406   @java.lang.Override
407   public java.util.List<
408           ? extends com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilizationOrBuilder>
getCustomMetricUtilizationsOrBuilderList()409       getCustomMetricUtilizationsOrBuilderList() {
410     return customMetricUtilizations_;
411   }
412   /**
413    *
414    *
415    * <pre>
416    * Configuration parameters of autoscaling based on a custom metric.
417    * </pre>
418    *
419    * <code>
420    * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
421    * </code>
422    */
423   @java.lang.Override
getCustomMetricUtilizationsCount()424   public int getCustomMetricUtilizationsCount() {
425     return customMetricUtilizations_.size();
426   }
427   /**
428    *
429    *
430    * <pre>
431    * Configuration parameters of autoscaling based on a custom metric.
432    * </pre>
433    *
434    * <code>
435    * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
436    * </code>
437    */
438   @java.lang.Override
439   public com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization
getCustomMetricUtilizations(int index)440       getCustomMetricUtilizations(int index) {
441     return customMetricUtilizations_.get(index);
442   }
443   /**
444    *
445    *
446    * <pre>
447    * Configuration parameters of autoscaling based on a custom metric.
448    * </pre>
449    *
450    * <code>
451    * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
452    * </code>
453    */
454   @java.lang.Override
455   public com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilizationOrBuilder
getCustomMetricUtilizationsOrBuilder(int index)456       getCustomMetricUtilizationsOrBuilder(int index) {
457     return customMetricUtilizations_.get(index);
458   }
459 
460   public static final int LOAD_BALANCING_UTILIZATION_FIELD_NUMBER = 429746403;
461   private com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization
462       loadBalancingUtilization_;
463   /**
464    *
465    *
466    * <pre>
467    * Configuration parameters of autoscaling based on load balancer.
468    * </pre>
469    *
470    * <code>
471    * optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;
472    * </code>
473    *
474    * @return Whether the loadBalancingUtilization field is set.
475    */
476   @java.lang.Override
hasLoadBalancingUtilization()477   public boolean hasLoadBalancingUtilization() {
478     return ((bitField0_ & 0x00000004) != 0);
479   }
480   /**
481    *
482    *
483    * <pre>
484    * Configuration parameters of autoscaling based on load balancer.
485    * </pre>
486    *
487    * <code>
488    * optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;
489    * </code>
490    *
491    * @return The loadBalancingUtilization.
492    */
493   @java.lang.Override
494   public com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization
getLoadBalancingUtilization()495       getLoadBalancingUtilization() {
496     return loadBalancingUtilization_ == null
497         ? com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.getDefaultInstance()
498         : loadBalancingUtilization_;
499   }
500   /**
501    *
502    *
503    * <pre>
504    * Configuration parameters of autoscaling based on load balancer.
505    * </pre>
506    *
507    * <code>
508    * optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;
509    * </code>
510    */
511   @java.lang.Override
512   public com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilizationOrBuilder
getLoadBalancingUtilizationOrBuilder()513       getLoadBalancingUtilizationOrBuilder() {
514     return loadBalancingUtilization_ == null
515         ? com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.getDefaultInstance()
516         : loadBalancingUtilization_;
517   }
518 
519   public static final int MAX_NUM_REPLICAS_FIELD_NUMBER = 62327375;
520   private int maxNumReplicas_ = 0;
521   /**
522    *
523    *
524    * <pre>
525    * The maximum number of instances that the autoscaler can scale out to. This is required when creating or updating an autoscaler. The maximum number of replicas must not be lower than minimal number of replicas.
526    * </pre>
527    *
528    * <code>optional int32 max_num_replicas = 62327375;</code>
529    *
530    * @return Whether the maxNumReplicas field is set.
531    */
532   @java.lang.Override
hasMaxNumReplicas()533   public boolean hasMaxNumReplicas() {
534     return ((bitField0_ & 0x00000008) != 0);
535   }
536   /**
537    *
538    *
539    * <pre>
540    * The maximum number of instances that the autoscaler can scale out to. This is required when creating or updating an autoscaler. The maximum number of replicas must not be lower than minimal number of replicas.
541    * </pre>
542    *
543    * <code>optional int32 max_num_replicas = 62327375;</code>
544    *
545    * @return The maxNumReplicas.
546    */
547   @java.lang.Override
getMaxNumReplicas()548   public int getMaxNumReplicas() {
549     return maxNumReplicas_;
550   }
551 
552   public static final int MIN_NUM_REPLICAS_FIELD_NUMBER = 535329825;
553   private int minNumReplicas_ = 0;
554   /**
555    *
556    *
557    * <pre>
558    * The minimum number of replicas that the autoscaler can scale in to. This cannot be less than 0. If not provided, autoscaler chooses a default value depending on maximum number of instances allowed.
559    * </pre>
560    *
561    * <code>optional int32 min_num_replicas = 535329825;</code>
562    *
563    * @return Whether the minNumReplicas field is set.
564    */
565   @java.lang.Override
hasMinNumReplicas()566   public boolean hasMinNumReplicas() {
567     return ((bitField0_ & 0x00000010) != 0);
568   }
569   /**
570    *
571    *
572    * <pre>
573    * The minimum number of replicas that the autoscaler can scale in to. This cannot be less than 0. If not provided, autoscaler chooses a default value depending on maximum number of instances allowed.
574    * </pre>
575    *
576    * <code>optional int32 min_num_replicas = 535329825;</code>
577    *
578    * @return The minNumReplicas.
579    */
580   @java.lang.Override
getMinNumReplicas()581   public int getMinNumReplicas() {
582     return minNumReplicas_;
583   }
584 
585   public static final int MODE_FIELD_NUMBER = 3357091;
586 
587   @SuppressWarnings("serial")
588   private volatile java.lang.Object mode_ = "";
589   /**
590    *
591    *
592    * <pre>
593    * Defines operating mode for this policy.
594    * Check the Mode enum for the list of possible values.
595    * </pre>
596    *
597    * <code>optional string mode = 3357091;</code>
598    *
599    * @return Whether the mode field is set.
600    */
601   @java.lang.Override
hasMode()602   public boolean hasMode() {
603     return ((bitField0_ & 0x00000020) != 0);
604   }
605   /**
606    *
607    *
608    * <pre>
609    * Defines operating mode for this policy.
610    * Check the Mode enum for the list of possible values.
611    * </pre>
612    *
613    * <code>optional string mode = 3357091;</code>
614    *
615    * @return The mode.
616    */
617   @java.lang.Override
getMode()618   public java.lang.String getMode() {
619     java.lang.Object ref = mode_;
620     if (ref instanceof java.lang.String) {
621       return (java.lang.String) ref;
622     } else {
623       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
624       java.lang.String s = bs.toStringUtf8();
625       mode_ = s;
626       return s;
627     }
628   }
629   /**
630    *
631    *
632    * <pre>
633    * Defines operating mode for this policy.
634    * Check the Mode enum for the list of possible values.
635    * </pre>
636    *
637    * <code>optional string mode = 3357091;</code>
638    *
639    * @return The bytes for mode.
640    */
641   @java.lang.Override
getModeBytes()642   public com.google.protobuf.ByteString getModeBytes() {
643     java.lang.Object ref = mode_;
644     if (ref instanceof java.lang.String) {
645       com.google.protobuf.ByteString b =
646           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
647       mode_ = b;
648       return b;
649     } else {
650       return (com.google.protobuf.ByteString) ref;
651     }
652   }
653 
654   public static final int SCALE_IN_CONTROL_FIELD_NUMBER = 527670872;
655   private com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl scaleInControl_;
656   /**
657    * <code>
658    * optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;
659    * </code>
660    *
661    * @return Whether the scaleInControl field is set.
662    */
663   @java.lang.Override
hasScaleInControl()664   public boolean hasScaleInControl() {
665     return ((bitField0_ & 0x00000040) != 0);
666   }
667   /**
668    * <code>
669    * optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;
670    * </code>
671    *
672    * @return The scaleInControl.
673    */
674   @java.lang.Override
getScaleInControl()675   public com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl getScaleInControl() {
676     return scaleInControl_ == null
677         ? com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl.getDefaultInstance()
678         : scaleInControl_;
679   }
680   /**
681    * <code>
682    * optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;
683    * </code>
684    */
685   @java.lang.Override
686   public com.google.cloud.compute.v1.AutoscalingPolicyScaleInControlOrBuilder
getScaleInControlOrBuilder()687       getScaleInControlOrBuilder() {
688     return scaleInControl_ == null
689         ? com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl.getDefaultInstance()
690         : scaleInControl_;
691   }
692 
693   public static final int SCALING_SCHEDULES_FIELD_NUMBER = 355416580;
694 
695   private static final class ScalingSchedulesDefaultEntryHolder {
696     static final com.google.protobuf.MapEntry<
697             java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
698         defaultEntry =
699             com.google.protobuf.MapEntry
700                 .<java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
701                     newDefaultInstance(
702                         com.google.cloud.compute.v1.Compute
703                             .internal_static_google_cloud_compute_v1_AutoscalingPolicy_ScalingSchedulesEntry_descriptor,
704                         com.google.protobuf.WireFormat.FieldType.STRING,
705                         "",
706                         com.google.protobuf.WireFormat.FieldType.MESSAGE,
707                         com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule
708                             .getDefaultInstance());
709   }
710 
711   @SuppressWarnings("serial")
712   private com.google.protobuf.MapField<
713           java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
714       scalingSchedules_;
715 
716   private com.google.protobuf.MapField<
717           java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
internalGetScalingSchedules()718       internalGetScalingSchedules() {
719     if (scalingSchedules_ == null) {
720       return com.google.protobuf.MapField.emptyMapField(
721           ScalingSchedulesDefaultEntryHolder.defaultEntry);
722     }
723     return scalingSchedules_;
724   }
725 
getScalingSchedulesCount()726   public int getScalingSchedulesCount() {
727     return internalGetScalingSchedules().getMap().size();
728   }
729   /**
730    *
731    *
732    * <pre>
733    * Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed.
734    * </pre>
735    *
736    * <code>
737    * map&lt;string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule&gt; scaling_schedules = 355416580;
738    * </code>
739    */
740   @java.lang.Override
containsScalingSchedules(java.lang.String key)741   public boolean containsScalingSchedules(java.lang.String key) {
742     if (key == null) {
743       throw new NullPointerException("map key");
744     }
745     return internalGetScalingSchedules().getMap().containsKey(key);
746   }
747   /** Use {@link #getScalingSchedulesMap()} instead. */
748   @java.lang.Override
749   @java.lang.Deprecated
750   public java.util.Map<
751           java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
getScalingSchedules()752       getScalingSchedules() {
753     return getScalingSchedulesMap();
754   }
755   /**
756    *
757    *
758    * <pre>
759    * Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed.
760    * </pre>
761    *
762    * <code>
763    * map&lt;string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule&gt; scaling_schedules = 355416580;
764    * </code>
765    */
766   @java.lang.Override
767   public java.util.Map<
768           java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
getScalingSchedulesMap()769       getScalingSchedulesMap() {
770     return internalGetScalingSchedules().getMap();
771   }
772   /**
773    *
774    *
775    * <pre>
776    * Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed.
777    * </pre>
778    *
779    * <code>
780    * map&lt;string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule&gt; scaling_schedules = 355416580;
781    * </code>
782    */
783   @java.lang.Override
784   public /* nullable */ com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule
getScalingSchedulesOrDefault( java.lang.String key, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule defaultValue)785       getScalingSchedulesOrDefault(
786           java.lang.String key,
787           /* nullable */
788           com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule defaultValue) {
789     if (key == null) {
790       throw new NullPointerException("map key");
791     }
792     java.util.Map<java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
793         map = internalGetScalingSchedules().getMap();
794     return map.containsKey(key) ? map.get(key) : defaultValue;
795   }
796   /**
797    *
798    *
799    * <pre>
800    * Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed.
801    * </pre>
802    *
803    * <code>
804    * map&lt;string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule&gt; scaling_schedules = 355416580;
805    * </code>
806    */
807   @java.lang.Override
getScalingSchedulesOrThrow( java.lang.String key)808   public com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule getScalingSchedulesOrThrow(
809       java.lang.String key) {
810     if (key == null) {
811       throw new NullPointerException("map key");
812     }
813     java.util.Map<java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
814         map = internalGetScalingSchedules().getMap();
815     if (!map.containsKey(key)) {
816       throw new java.lang.IllegalArgumentException();
817     }
818     return map.get(key);
819   }
820 
821   private byte memoizedIsInitialized = -1;
822 
823   @java.lang.Override
isInitialized()824   public final boolean isInitialized() {
825     byte isInitialized = memoizedIsInitialized;
826     if (isInitialized == 1) return true;
827     if (isInitialized == 0) return false;
828 
829     memoizedIsInitialized = 1;
830     return true;
831   }
832 
833   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)834   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
835     if (((bitField0_ & 0x00000020) != 0)) {
836       com.google.protobuf.GeneratedMessageV3.writeString(output, 3357091, mode_);
837     }
838     if (((bitField0_ & 0x00000008) != 0)) {
839       output.writeInt32(62327375, maxNumReplicas_);
840     }
841     if (((bitField0_ & 0x00000001) != 0)) {
842       output.writeInt32(107692954, coolDownPeriodSec_);
843     }
844     for (int i = 0; i < customMetricUtilizations_.size(); i++) {
845       output.writeMessage(131972850, customMetricUtilizations_.get(i));
846     }
847     com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
848         output,
849         internalGetScalingSchedules(),
850         ScalingSchedulesDefaultEntryHolder.defaultEntry,
851         355416580);
852     if (((bitField0_ & 0x00000002) != 0)) {
853       output.writeMessage(381211147, getCpuUtilization());
854     }
855     if (((bitField0_ & 0x00000004) != 0)) {
856       output.writeMessage(429746403, getLoadBalancingUtilization());
857     }
858     if (((bitField0_ & 0x00000040) != 0)) {
859       output.writeMessage(527670872, getScaleInControl());
860     }
861     if (((bitField0_ & 0x00000010) != 0)) {
862       output.writeInt32(535329825, minNumReplicas_);
863     }
864     getUnknownFields().writeTo(output);
865   }
866 
867   @java.lang.Override
getSerializedSize()868   public int getSerializedSize() {
869     int size = memoizedSize;
870     if (size != -1) return size;
871 
872     size = 0;
873     if (((bitField0_ & 0x00000020) != 0)) {
874       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3357091, mode_);
875     }
876     if (((bitField0_ & 0x00000008) != 0)) {
877       size += com.google.protobuf.CodedOutputStream.computeInt32Size(62327375, maxNumReplicas_);
878     }
879     if (((bitField0_ & 0x00000001) != 0)) {
880       size += com.google.protobuf.CodedOutputStream.computeInt32Size(107692954, coolDownPeriodSec_);
881     }
882     for (int i = 0; i < customMetricUtilizations_.size(); i++) {
883       size +=
884           com.google.protobuf.CodedOutputStream.computeMessageSize(
885               131972850, customMetricUtilizations_.get(i));
886     }
887     for (java.util.Map.Entry<
888             java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
889         entry : internalGetScalingSchedules().getMap().entrySet()) {
890       com.google.protobuf.MapEntry<
891               java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
892           scalingSchedules__ =
893               ScalingSchedulesDefaultEntryHolder.defaultEntry
894                   .newBuilderForType()
895                   .setKey(entry.getKey())
896                   .setValue(entry.getValue())
897                   .build();
898       size +=
899           com.google.protobuf.CodedOutputStream.computeMessageSize(355416580, scalingSchedules__);
900     }
901     if (((bitField0_ & 0x00000002) != 0)) {
902       size +=
903           com.google.protobuf.CodedOutputStream.computeMessageSize(381211147, getCpuUtilization());
904     }
905     if (((bitField0_ & 0x00000004) != 0)) {
906       size +=
907           com.google.protobuf.CodedOutputStream.computeMessageSize(
908               429746403, getLoadBalancingUtilization());
909     }
910     if (((bitField0_ & 0x00000040) != 0)) {
911       size +=
912           com.google.protobuf.CodedOutputStream.computeMessageSize(527670872, getScaleInControl());
913     }
914     if (((bitField0_ & 0x00000010) != 0)) {
915       size += com.google.protobuf.CodedOutputStream.computeInt32Size(535329825, minNumReplicas_);
916     }
917     size += getUnknownFields().getSerializedSize();
918     memoizedSize = size;
919     return size;
920   }
921 
922   @java.lang.Override
equals(final java.lang.Object obj)923   public boolean equals(final java.lang.Object obj) {
924     if (obj == this) {
925       return true;
926     }
927     if (!(obj instanceof com.google.cloud.compute.v1.AutoscalingPolicy)) {
928       return super.equals(obj);
929     }
930     com.google.cloud.compute.v1.AutoscalingPolicy other =
931         (com.google.cloud.compute.v1.AutoscalingPolicy) obj;
932 
933     if (hasCoolDownPeriodSec() != other.hasCoolDownPeriodSec()) return false;
934     if (hasCoolDownPeriodSec()) {
935       if (getCoolDownPeriodSec() != other.getCoolDownPeriodSec()) return false;
936     }
937     if (hasCpuUtilization() != other.hasCpuUtilization()) return false;
938     if (hasCpuUtilization()) {
939       if (!getCpuUtilization().equals(other.getCpuUtilization())) return false;
940     }
941     if (!getCustomMetricUtilizationsList().equals(other.getCustomMetricUtilizationsList()))
942       return false;
943     if (hasLoadBalancingUtilization() != other.hasLoadBalancingUtilization()) return false;
944     if (hasLoadBalancingUtilization()) {
945       if (!getLoadBalancingUtilization().equals(other.getLoadBalancingUtilization())) return false;
946     }
947     if (hasMaxNumReplicas() != other.hasMaxNumReplicas()) return false;
948     if (hasMaxNumReplicas()) {
949       if (getMaxNumReplicas() != other.getMaxNumReplicas()) return false;
950     }
951     if (hasMinNumReplicas() != other.hasMinNumReplicas()) return false;
952     if (hasMinNumReplicas()) {
953       if (getMinNumReplicas() != other.getMinNumReplicas()) return false;
954     }
955     if (hasMode() != other.hasMode()) return false;
956     if (hasMode()) {
957       if (!getMode().equals(other.getMode())) return false;
958     }
959     if (hasScaleInControl() != other.hasScaleInControl()) return false;
960     if (hasScaleInControl()) {
961       if (!getScaleInControl().equals(other.getScaleInControl())) return false;
962     }
963     if (!internalGetScalingSchedules().equals(other.internalGetScalingSchedules())) return false;
964     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
965     return true;
966   }
967 
968   @java.lang.Override
hashCode()969   public int hashCode() {
970     if (memoizedHashCode != 0) {
971       return memoizedHashCode;
972     }
973     int hash = 41;
974     hash = (19 * hash) + getDescriptor().hashCode();
975     if (hasCoolDownPeriodSec()) {
976       hash = (37 * hash) + COOL_DOWN_PERIOD_SEC_FIELD_NUMBER;
977       hash = (53 * hash) + getCoolDownPeriodSec();
978     }
979     if (hasCpuUtilization()) {
980       hash = (37 * hash) + CPU_UTILIZATION_FIELD_NUMBER;
981       hash = (53 * hash) + getCpuUtilization().hashCode();
982     }
983     if (getCustomMetricUtilizationsCount() > 0) {
984       hash = (37 * hash) + CUSTOM_METRIC_UTILIZATIONS_FIELD_NUMBER;
985       hash = (53 * hash) + getCustomMetricUtilizationsList().hashCode();
986     }
987     if (hasLoadBalancingUtilization()) {
988       hash = (37 * hash) + LOAD_BALANCING_UTILIZATION_FIELD_NUMBER;
989       hash = (53 * hash) + getLoadBalancingUtilization().hashCode();
990     }
991     if (hasMaxNumReplicas()) {
992       hash = (37 * hash) + MAX_NUM_REPLICAS_FIELD_NUMBER;
993       hash = (53 * hash) + getMaxNumReplicas();
994     }
995     if (hasMinNumReplicas()) {
996       hash = (37 * hash) + MIN_NUM_REPLICAS_FIELD_NUMBER;
997       hash = (53 * hash) + getMinNumReplicas();
998     }
999     if (hasMode()) {
1000       hash = (37 * hash) + MODE_FIELD_NUMBER;
1001       hash = (53 * hash) + getMode().hashCode();
1002     }
1003     if (hasScaleInControl()) {
1004       hash = (37 * hash) + SCALE_IN_CONTROL_FIELD_NUMBER;
1005       hash = (53 * hash) + getScaleInControl().hashCode();
1006     }
1007     if (!internalGetScalingSchedules().getMap().isEmpty()) {
1008       hash = (37 * hash) + SCALING_SCHEDULES_FIELD_NUMBER;
1009       hash = (53 * hash) + internalGetScalingSchedules().hashCode();
1010     }
1011     hash = (29 * hash) + getUnknownFields().hashCode();
1012     memoizedHashCode = hash;
1013     return hash;
1014   }
1015 
parseFrom(java.nio.ByteBuffer data)1016   public static com.google.cloud.compute.v1.AutoscalingPolicy parseFrom(java.nio.ByteBuffer data)
1017       throws com.google.protobuf.InvalidProtocolBufferException {
1018     return PARSER.parseFrom(data);
1019   }
1020 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1021   public static com.google.cloud.compute.v1.AutoscalingPolicy parseFrom(
1022       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1023       throws com.google.protobuf.InvalidProtocolBufferException {
1024     return PARSER.parseFrom(data, extensionRegistry);
1025   }
1026 
parseFrom( com.google.protobuf.ByteString data)1027   public static com.google.cloud.compute.v1.AutoscalingPolicy parseFrom(
1028       com.google.protobuf.ByteString data)
1029       throws com.google.protobuf.InvalidProtocolBufferException {
1030     return PARSER.parseFrom(data);
1031   }
1032 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1033   public static com.google.cloud.compute.v1.AutoscalingPolicy parseFrom(
1034       com.google.protobuf.ByteString data,
1035       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1036       throws com.google.protobuf.InvalidProtocolBufferException {
1037     return PARSER.parseFrom(data, extensionRegistry);
1038   }
1039 
parseFrom(byte[] data)1040   public static com.google.cloud.compute.v1.AutoscalingPolicy parseFrom(byte[] data)
1041       throws com.google.protobuf.InvalidProtocolBufferException {
1042     return PARSER.parseFrom(data);
1043   }
1044 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1045   public static com.google.cloud.compute.v1.AutoscalingPolicy parseFrom(
1046       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1047       throws com.google.protobuf.InvalidProtocolBufferException {
1048     return PARSER.parseFrom(data, extensionRegistry);
1049   }
1050 
parseFrom(java.io.InputStream input)1051   public static com.google.cloud.compute.v1.AutoscalingPolicy parseFrom(java.io.InputStream input)
1052       throws java.io.IOException {
1053     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
1054   }
1055 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1056   public static com.google.cloud.compute.v1.AutoscalingPolicy parseFrom(
1057       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1058       throws java.io.IOException {
1059     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
1060         PARSER, input, extensionRegistry);
1061   }
1062 
parseDelimitedFrom( java.io.InputStream input)1063   public static com.google.cloud.compute.v1.AutoscalingPolicy parseDelimitedFrom(
1064       java.io.InputStream input) throws java.io.IOException {
1065     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
1066   }
1067 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1068   public static com.google.cloud.compute.v1.AutoscalingPolicy parseDelimitedFrom(
1069       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1070       throws java.io.IOException {
1071     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
1072         PARSER, input, extensionRegistry);
1073   }
1074 
parseFrom( com.google.protobuf.CodedInputStream input)1075   public static com.google.cloud.compute.v1.AutoscalingPolicy parseFrom(
1076       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
1077     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
1078   }
1079 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1080   public static com.google.cloud.compute.v1.AutoscalingPolicy parseFrom(
1081       com.google.protobuf.CodedInputStream input,
1082       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1083       throws java.io.IOException {
1084     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
1085         PARSER, input, extensionRegistry);
1086   }
1087 
1088   @java.lang.Override
newBuilderForType()1089   public Builder newBuilderForType() {
1090     return newBuilder();
1091   }
1092 
newBuilder()1093   public static Builder newBuilder() {
1094     return DEFAULT_INSTANCE.toBuilder();
1095   }
1096 
newBuilder(com.google.cloud.compute.v1.AutoscalingPolicy prototype)1097   public static Builder newBuilder(com.google.cloud.compute.v1.AutoscalingPolicy prototype) {
1098     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
1099   }
1100 
1101   @java.lang.Override
toBuilder()1102   public Builder toBuilder() {
1103     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
1104   }
1105 
1106   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1107   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
1108     Builder builder = new Builder(parent);
1109     return builder;
1110   }
1111   /**
1112    *
1113    *
1114    * <pre>
1115    * Cloud Autoscaler policy.
1116    * </pre>
1117    *
1118    * Protobuf type {@code google.cloud.compute.v1.AutoscalingPolicy}
1119    */
1120   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
1121       implements
1122       // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.AutoscalingPolicy)
1123       com.google.cloud.compute.v1.AutoscalingPolicyOrBuilder {
getDescriptor()1124     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
1125       return com.google.cloud.compute.v1.Compute
1126           .internal_static_google_cloud_compute_v1_AutoscalingPolicy_descriptor;
1127     }
1128 
1129     @SuppressWarnings({"rawtypes"})
internalGetMapField(int number)1130     protected com.google.protobuf.MapField internalGetMapField(int number) {
1131       switch (number) {
1132         case 355416580:
1133           return internalGetScalingSchedules();
1134         default:
1135           throw new RuntimeException("Invalid map field number: " + number);
1136       }
1137     }
1138 
1139     @SuppressWarnings({"rawtypes"})
internalGetMutableMapField(int number)1140     protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
1141       switch (number) {
1142         case 355416580:
1143           return internalGetMutableScalingSchedules();
1144         default:
1145           throw new RuntimeException("Invalid map field number: " + number);
1146       }
1147     }
1148 
1149     @java.lang.Override
1150     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()1151         internalGetFieldAccessorTable() {
1152       return com.google.cloud.compute.v1.Compute
1153           .internal_static_google_cloud_compute_v1_AutoscalingPolicy_fieldAccessorTable
1154           .ensureFieldAccessorsInitialized(
1155               com.google.cloud.compute.v1.AutoscalingPolicy.class,
1156               com.google.cloud.compute.v1.AutoscalingPolicy.Builder.class);
1157     }
1158 
1159     // Construct using com.google.cloud.compute.v1.AutoscalingPolicy.newBuilder()
Builder()1160     private Builder() {
1161       maybeForceBuilderInitialization();
1162     }
1163 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1164     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
1165       super(parent);
1166       maybeForceBuilderInitialization();
1167     }
1168 
maybeForceBuilderInitialization()1169     private void maybeForceBuilderInitialization() {
1170       if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
1171         getCpuUtilizationFieldBuilder();
1172         getCustomMetricUtilizationsFieldBuilder();
1173         getLoadBalancingUtilizationFieldBuilder();
1174         getScaleInControlFieldBuilder();
1175       }
1176     }
1177 
1178     @java.lang.Override
clear()1179     public Builder clear() {
1180       super.clear();
1181       bitField0_ = 0;
1182       coolDownPeriodSec_ = 0;
1183       cpuUtilization_ = null;
1184       if (cpuUtilizationBuilder_ != null) {
1185         cpuUtilizationBuilder_.dispose();
1186         cpuUtilizationBuilder_ = null;
1187       }
1188       if (customMetricUtilizationsBuilder_ == null) {
1189         customMetricUtilizations_ = java.util.Collections.emptyList();
1190       } else {
1191         customMetricUtilizations_ = null;
1192         customMetricUtilizationsBuilder_.clear();
1193       }
1194       bitField0_ = (bitField0_ & ~0x00000004);
1195       loadBalancingUtilization_ = null;
1196       if (loadBalancingUtilizationBuilder_ != null) {
1197         loadBalancingUtilizationBuilder_.dispose();
1198         loadBalancingUtilizationBuilder_ = null;
1199       }
1200       maxNumReplicas_ = 0;
1201       minNumReplicas_ = 0;
1202       mode_ = "";
1203       scaleInControl_ = null;
1204       if (scaleInControlBuilder_ != null) {
1205         scaleInControlBuilder_.dispose();
1206         scaleInControlBuilder_ = null;
1207       }
1208       internalGetMutableScalingSchedules().clear();
1209       return this;
1210     }
1211 
1212     @java.lang.Override
getDescriptorForType()1213     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
1214       return com.google.cloud.compute.v1.Compute
1215           .internal_static_google_cloud_compute_v1_AutoscalingPolicy_descriptor;
1216     }
1217 
1218     @java.lang.Override
getDefaultInstanceForType()1219     public com.google.cloud.compute.v1.AutoscalingPolicy getDefaultInstanceForType() {
1220       return com.google.cloud.compute.v1.AutoscalingPolicy.getDefaultInstance();
1221     }
1222 
1223     @java.lang.Override
build()1224     public com.google.cloud.compute.v1.AutoscalingPolicy build() {
1225       com.google.cloud.compute.v1.AutoscalingPolicy result = buildPartial();
1226       if (!result.isInitialized()) {
1227         throw newUninitializedMessageException(result);
1228       }
1229       return result;
1230     }
1231 
1232     @java.lang.Override
buildPartial()1233     public com.google.cloud.compute.v1.AutoscalingPolicy buildPartial() {
1234       com.google.cloud.compute.v1.AutoscalingPolicy result =
1235           new com.google.cloud.compute.v1.AutoscalingPolicy(this);
1236       buildPartialRepeatedFields(result);
1237       if (bitField0_ != 0) {
1238         buildPartial0(result);
1239       }
1240       onBuilt();
1241       return result;
1242     }
1243 
buildPartialRepeatedFields(com.google.cloud.compute.v1.AutoscalingPolicy result)1244     private void buildPartialRepeatedFields(com.google.cloud.compute.v1.AutoscalingPolicy result) {
1245       if (customMetricUtilizationsBuilder_ == null) {
1246         if (((bitField0_ & 0x00000004) != 0)) {
1247           customMetricUtilizations_ =
1248               java.util.Collections.unmodifiableList(customMetricUtilizations_);
1249           bitField0_ = (bitField0_ & ~0x00000004);
1250         }
1251         result.customMetricUtilizations_ = customMetricUtilizations_;
1252       } else {
1253         result.customMetricUtilizations_ = customMetricUtilizationsBuilder_.build();
1254       }
1255     }
1256 
buildPartial0(com.google.cloud.compute.v1.AutoscalingPolicy result)1257     private void buildPartial0(com.google.cloud.compute.v1.AutoscalingPolicy result) {
1258       int from_bitField0_ = bitField0_;
1259       int to_bitField0_ = 0;
1260       if (((from_bitField0_ & 0x00000001) != 0)) {
1261         result.coolDownPeriodSec_ = coolDownPeriodSec_;
1262         to_bitField0_ |= 0x00000001;
1263       }
1264       if (((from_bitField0_ & 0x00000002) != 0)) {
1265         result.cpuUtilization_ =
1266             cpuUtilizationBuilder_ == null ? cpuUtilization_ : cpuUtilizationBuilder_.build();
1267         to_bitField0_ |= 0x00000002;
1268       }
1269       if (((from_bitField0_ & 0x00000008) != 0)) {
1270         result.loadBalancingUtilization_ =
1271             loadBalancingUtilizationBuilder_ == null
1272                 ? loadBalancingUtilization_
1273                 : loadBalancingUtilizationBuilder_.build();
1274         to_bitField0_ |= 0x00000004;
1275       }
1276       if (((from_bitField0_ & 0x00000010) != 0)) {
1277         result.maxNumReplicas_ = maxNumReplicas_;
1278         to_bitField0_ |= 0x00000008;
1279       }
1280       if (((from_bitField0_ & 0x00000020) != 0)) {
1281         result.minNumReplicas_ = minNumReplicas_;
1282         to_bitField0_ |= 0x00000010;
1283       }
1284       if (((from_bitField0_ & 0x00000040) != 0)) {
1285         result.mode_ = mode_;
1286         to_bitField0_ |= 0x00000020;
1287       }
1288       if (((from_bitField0_ & 0x00000080) != 0)) {
1289         result.scaleInControl_ =
1290             scaleInControlBuilder_ == null ? scaleInControl_ : scaleInControlBuilder_.build();
1291         to_bitField0_ |= 0x00000040;
1292       }
1293       if (((from_bitField0_ & 0x00000100) != 0)) {
1294         result.scalingSchedules_ = internalGetScalingSchedules();
1295         result.scalingSchedules_.makeImmutable();
1296       }
1297       result.bitField0_ |= to_bitField0_;
1298     }
1299 
1300     @java.lang.Override
clone()1301     public Builder clone() {
1302       return super.clone();
1303     }
1304 
1305     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1306     public Builder setField(
1307         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
1308       return super.setField(field, value);
1309     }
1310 
1311     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1312     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
1313       return super.clearField(field);
1314     }
1315 
1316     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1317     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
1318       return super.clearOneof(oneof);
1319     }
1320 
1321     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1322     public Builder setRepeatedField(
1323         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
1324       return super.setRepeatedField(field, index, value);
1325     }
1326 
1327     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1328     public Builder addRepeatedField(
1329         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
1330       return super.addRepeatedField(field, value);
1331     }
1332 
1333     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)1334     public Builder mergeFrom(com.google.protobuf.Message other) {
1335       if (other instanceof com.google.cloud.compute.v1.AutoscalingPolicy) {
1336         return mergeFrom((com.google.cloud.compute.v1.AutoscalingPolicy) other);
1337       } else {
1338         super.mergeFrom(other);
1339         return this;
1340       }
1341     }
1342 
mergeFrom(com.google.cloud.compute.v1.AutoscalingPolicy other)1343     public Builder mergeFrom(com.google.cloud.compute.v1.AutoscalingPolicy other) {
1344       if (other == com.google.cloud.compute.v1.AutoscalingPolicy.getDefaultInstance()) return this;
1345       if (other.hasCoolDownPeriodSec()) {
1346         setCoolDownPeriodSec(other.getCoolDownPeriodSec());
1347       }
1348       if (other.hasCpuUtilization()) {
1349         mergeCpuUtilization(other.getCpuUtilization());
1350       }
1351       if (customMetricUtilizationsBuilder_ == null) {
1352         if (!other.customMetricUtilizations_.isEmpty()) {
1353           if (customMetricUtilizations_.isEmpty()) {
1354             customMetricUtilizations_ = other.customMetricUtilizations_;
1355             bitField0_ = (bitField0_ & ~0x00000004);
1356           } else {
1357             ensureCustomMetricUtilizationsIsMutable();
1358             customMetricUtilizations_.addAll(other.customMetricUtilizations_);
1359           }
1360           onChanged();
1361         }
1362       } else {
1363         if (!other.customMetricUtilizations_.isEmpty()) {
1364           if (customMetricUtilizationsBuilder_.isEmpty()) {
1365             customMetricUtilizationsBuilder_.dispose();
1366             customMetricUtilizationsBuilder_ = null;
1367             customMetricUtilizations_ = other.customMetricUtilizations_;
1368             bitField0_ = (bitField0_ & ~0x00000004);
1369             customMetricUtilizationsBuilder_ =
1370                 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
1371                     ? getCustomMetricUtilizationsFieldBuilder()
1372                     : null;
1373           } else {
1374             customMetricUtilizationsBuilder_.addAllMessages(other.customMetricUtilizations_);
1375           }
1376         }
1377       }
1378       if (other.hasLoadBalancingUtilization()) {
1379         mergeLoadBalancingUtilization(other.getLoadBalancingUtilization());
1380       }
1381       if (other.hasMaxNumReplicas()) {
1382         setMaxNumReplicas(other.getMaxNumReplicas());
1383       }
1384       if (other.hasMinNumReplicas()) {
1385         setMinNumReplicas(other.getMinNumReplicas());
1386       }
1387       if (other.hasMode()) {
1388         mode_ = other.mode_;
1389         bitField0_ |= 0x00000040;
1390         onChanged();
1391       }
1392       if (other.hasScaleInControl()) {
1393         mergeScaleInControl(other.getScaleInControl());
1394       }
1395       internalGetMutableScalingSchedules().mergeFrom(other.internalGetScalingSchedules());
1396       bitField0_ |= 0x00000100;
1397       this.mergeUnknownFields(other.getUnknownFields());
1398       onChanged();
1399       return this;
1400     }
1401 
1402     @java.lang.Override
isInitialized()1403     public final boolean isInitialized() {
1404       return true;
1405     }
1406 
1407     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1408     public Builder mergeFrom(
1409         com.google.protobuf.CodedInputStream input,
1410         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1411         throws java.io.IOException {
1412       if (extensionRegistry == null) {
1413         throw new java.lang.NullPointerException();
1414       }
1415       try {
1416         boolean done = false;
1417         while (!done) {
1418           int tag = input.readTag();
1419           switch (tag) {
1420             case 0:
1421               done = true;
1422               break;
1423             case 26856730:
1424               {
1425                 mode_ = input.readStringRequireUtf8();
1426                 bitField0_ |= 0x00000040;
1427                 break;
1428               } // case 26856730
1429             case 498619000:
1430               {
1431                 maxNumReplicas_ = input.readInt32();
1432                 bitField0_ |= 0x00000010;
1433                 break;
1434               } // case 498619000
1435             case 861543632:
1436               {
1437                 coolDownPeriodSec_ = input.readInt32();
1438                 bitField0_ |= 0x00000001;
1439                 break;
1440               } // case 861543632
1441             case 1055782802:
1442               {
1443                 com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization m =
1444                     input.readMessage(
1445                         com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization
1446                             .parser(),
1447                         extensionRegistry);
1448                 if (customMetricUtilizationsBuilder_ == null) {
1449                   ensureCustomMetricUtilizationsIsMutable();
1450                   customMetricUtilizations_.add(m);
1451                 } else {
1452                   customMetricUtilizationsBuilder_.addMessage(m);
1453                 }
1454                 break;
1455               } // case 1055782802
1456             case -1451634654:
1457               {
1458                 com.google.protobuf.MapEntry<
1459                         java.lang.String,
1460                         com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
1461                     scalingSchedules__ =
1462                         input.readMessage(
1463                             ScalingSchedulesDefaultEntryHolder.defaultEntry.getParserForType(),
1464                             extensionRegistry);
1465                 internalGetMutableScalingSchedules()
1466                     .getMutableMap()
1467                     .put(scalingSchedules__.getKey(), scalingSchedules__.getValue());
1468                 bitField0_ |= 0x00000100;
1469                 break;
1470               } // case -1451634654
1471             case -1245278118:
1472               {
1473                 input.readMessage(getCpuUtilizationFieldBuilder().getBuilder(), extensionRegistry);
1474                 bitField0_ |= 0x00000002;
1475                 break;
1476               } // case -1245278118
1477             case -856996070:
1478               {
1479                 input.readMessage(
1480                     getLoadBalancingUtilizationFieldBuilder().getBuilder(), extensionRegistry);
1481                 bitField0_ |= 0x00000008;
1482                 break;
1483               } // case -856996070
1484             case -73600318:
1485               {
1486                 input.readMessage(getScaleInControlFieldBuilder().getBuilder(), extensionRegistry);
1487                 bitField0_ |= 0x00000080;
1488                 break;
1489               } // case -73600318
1490             case -12328696:
1491               {
1492                 minNumReplicas_ = input.readInt32();
1493                 bitField0_ |= 0x00000020;
1494                 break;
1495               } // case -12328696
1496             default:
1497               {
1498                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
1499                   done = true; // was an endgroup tag
1500                 }
1501                 break;
1502               } // default:
1503           } // switch (tag)
1504         } // while (!done)
1505       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1506         throw e.unwrapIOException();
1507       } finally {
1508         onChanged();
1509       } // finally
1510       return this;
1511     }
1512 
1513     private int bitField0_;
1514 
1515     private int coolDownPeriodSec_;
1516     /**
1517      *
1518      *
1519      * <pre>
1520      * The number of seconds that the autoscaler waits before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.
1521      * </pre>
1522      *
1523      * <code>optional int32 cool_down_period_sec = 107692954;</code>
1524      *
1525      * @return Whether the coolDownPeriodSec field is set.
1526      */
1527     @java.lang.Override
hasCoolDownPeriodSec()1528     public boolean hasCoolDownPeriodSec() {
1529       return ((bitField0_ & 0x00000001) != 0);
1530     }
1531     /**
1532      *
1533      *
1534      * <pre>
1535      * The number of seconds that the autoscaler waits before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.
1536      * </pre>
1537      *
1538      * <code>optional int32 cool_down_period_sec = 107692954;</code>
1539      *
1540      * @return The coolDownPeriodSec.
1541      */
1542     @java.lang.Override
getCoolDownPeriodSec()1543     public int getCoolDownPeriodSec() {
1544       return coolDownPeriodSec_;
1545     }
1546     /**
1547      *
1548      *
1549      * <pre>
1550      * The number of seconds that the autoscaler waits before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.
1551      * </pre>
1552      *
1553      * <code>optional int32 cool_down_period_sec = 107692954;</code>
1554      *
1555      * @param value The coolDownPeriodSec to set.
1556      * @return This builder for chaining.
1557      */
setCoolDownPeriodSec(int value)1558     public Builder setCoolDownPeriodSec(int value) {
1559 
1560       coolDownPeriodSec_ = value;
1561       bitField0_ |= 0x00000001;
1562       onChanged();
1563       return this;
1564     }
1565     /**
1566      *
1567      *
1568      * <pre>
1569      * The number of seconds that the autoscaler waits before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.
1570      * </pre>
1571      *
1572      * <code>optional int32 cool_down_period_sec = 107692954;</code>
1573      *
1574      * @return This builder for chaining.
1575      */
clearCoolDownPeriodSec()1576     public Builder clearCoolDownPeriodSec() {
1577       bitField0_ = (bitField0_ & ~0x00000001);
1578       coolDownPeriodSec_ = 0;
1579       onChanged();
1580       return this;
1581     }
1582 
1583     private com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpuUtilization_;
1584     private com.google.protobuf.SingleFieldBuilderV3<
1585             com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization,
1586             com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.Builder,
1587             com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilizationOrBuilder>
1588         cpuUtilizationBuilder_;
1589     /**
1590      *
1591      *
1592      * <pre>
1593      * Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
1594      * </pre>
1595      *
1596      * <code>
1597      * optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;
1598      * </code>
1599      *
1600      * @return Whether the cpuUtilization field is set.
1601      */
hasCpuUtilization()1602     public boolean hasCpuUtilization() {
1603       return ((bitField0_ & 0x00000002) != 0);
1604     }
1605     /**
1606      *
1607      *
1608      * <pre>
1609      * Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
1610      * </pre>
1611      *
1612      * <code>
1613      * optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;
1614      * </code>
1615      *
1616      * @return The cpuUtilization.
1617      */
getCpuUtilization()1618     public com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization getCpuUtilization() {
1619       if (cpuUtilizationBuilder_ == null) {
1620         return cpuUtilization_ == null
1621             ? com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.getDefaultInstance()
1622             : cpuUtilization_;
1623       } else {
1624         return cpuUtilizationBuilder_.getMessage();
1625       }
1626     }
1627     /**
1628      *
1629      *
1630      * <pre>
1631      * Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
1632      * </pre>
1633      *
1634      * <code>
1635      * optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;
1636      * </code>
1637      */
setCpuUtilization( com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization value)1638     public Builder setCpuUtilization(
1639         com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization value) {
1640       if (cpuUtilizationBuilder_ == null) {
1641         if (value == null) {
1642           throw new NullPointerException();
1643         }
1644         cpuUtilization_ = value;
1645       } else {
1646         cpuUtilizationBuilder_.setMessage(value);
1647       }
1648       bitField0_ |= 0x00000002;
1649       onChanged();
1650       return this;
1651     }
1652     /**
1653      *
1654      *
1655      * <pre>
1656      * Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
1657      * </pre>
1658      *
1659      * <code>
1660      * optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;
1661      * </code>
1662      */
setCpuUtilization( com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.Builder builderForValue)1663     public Builder setCpuUtilization(
1664         com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.Builder builderForValue) {
1665       if (cpuUtilizationBuilder_ == null) {
1666         cpuUtilization_ = builderForValue.build();
1667       } else {
1668         cpuUtilizationBuilder_.setMessage(builderForValue.build());
1669       }
1670       bitField0_ |= 0x00000002;
1671       onChanged();
1672       return this;
1673     }
1674     /**
1675      *
1676      *
1677      * <pre>
1678      * Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
1679      * </pre>
1680      *
1681      * <code>
1682      * optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;
1683      * </code>
1684      */
mergeCpuUtilization( com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization value)1685     public Builder mergeCpuUtilization(
1686         com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization value) {
1687       if (cpuUtilizationBuilder_ == null) {
1688         if (((bitField0_ & 0x00000002) != 0)
1689             && cpuUtilization_ != null
1690             && cpuUtilization_
1691                 != com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization
1692                     .getDefaultInstance()) {
1693           getCpuUtilizationBuilder().mergeFrom(value);
1694         } else {
1695           cpuUtilization_ = value;
1696         }
1697       } else {
1698         cpuUtilizationBuilder_.mergeFrom(value);
1699       }
1700       bitField0_ |= 0x00000002;
1701       onChanged();
1702       return this;
1703     }
1704     /**
1705      *
1706      *
1707      * <pre>
1708      * Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
1709      * </pre>
1710      *
1711      * <code>
1712      * optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;
1713      * </code>
1714      */
clearCpuUtilization()1715     public Builder clearCpuUtilization() {
1716       bitField0_ = (bitField0_ & ~0x00000002);
1717       cpuUtilization_ = null;
1718       if (cpuUtilizationBuilder_ != null) {
1719         cpuUtilizationBuilder_.dispose();
1720         cpuUtilizationBuilder_ = null;
1721       }
1722       onChanged();
1723       return this;
1724     }
1725     /**
1726      *
1727      *
1728      * <pre>
1729      * Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
1730      * </pre>
1731      *
1732      * <code>
1733      * optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;
1734      * </code>
1735      */
1736     public com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.Builder
getCpuUtilizationBuilder()1737         getCpuUtilizationBuilder() {
1738       bitField0_ |= 0x00000002;
1739       onChanged();
1740       return getCpuUtilizationFieldBuilder().getBuilder();
1741     }
1742     /**
1743      *
1744      *
1745      * <pre>
1746      * Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
1747      * </pre>
1748      *
1749      * <code>
1750      * optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;
1751      * </code>
1752      */
1753     public com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilizationOrBuilder
getCpuUtilizationOrBuilder()1754         getCpuUtilizationOrBuilder() {
1755       if (cpuUtilizationBuilder_ != null) {
1756         return cpuUtilizationBuilder_.getMessageOrBuilder();
1757       } else {
1758         return cpuUtilization_ == null
1759             ? com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.getDefaultInstance()
1760             : cpuUtilization_;
1761       }
1762     }
1763     /**
1764      *
1765      *
1766      * <pre>
1767      * Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
1768      * </pre>
1769      *
1770      * <code>
1771      * optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;
1772      * </code>
1773      */
1774     private com.google.protobuf.SingleFieldBuilderV3<
1775             com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization,
1776             com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.Builder,
1777             com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilizationOrBuilder>
getCpuUtilizationFieldBuilder()1778         getCpuUtilizationFieldBuilder() {
1779       if (cpuUtilizationBuilder_ == null) {
1780         cpuUtilizationBuilder_ =
1781             new com.google.protobuf.SingleFieldBuilderV3<
1782                 com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization,
1783                 com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.Builder,
1784                 com.google.cloud.compute.v1.AutoscalingPolicyCpuUtilizationOrBuilder>(
1785                 getCpuUtilization(), getParentForChildren(), isClean());
1786         cpuUtilization_ = null;
1787       }
1788       return cpuUtilizationBuilder_;
1789     }
1790 
1791     private java.util.List<com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization>
1792         customMetricUtilizations_ = java.util.Collections.emptyList();
1793 
ensureCustomMetricUtilizationsIsMutable()1794     private void ensureCustomMetricUtilizationsIsMutable() {
1795       if (!((bitField0_ & 0x00000004) != 0)) {
1796         customMetricUtilizations_ =
1797             new java.util.ArrayList<
1798                 com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization>(
1799                 customMetricUtilizations_);
1800         bitField0_ |= 0x00000004;
1801       }
1802     }
1803 
1804     private com.google.protobuf.RepeatedFieldBuilderV3<
1805             com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization,
1806             com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.Builder,
1807             com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilizationOrBuilder>
1808         customMetricUtilizationsBuilder_;
1809 
1810     /**
1811      *
1812      *
1813      * <pre>
1814      * Configuration parameters of autoscaling based on a custom metric.
1815      * </pre>
1816      *
1817      * <code>
1818      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
1819      * </code>
1820      */
1821     public java.util.List<com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization>
getCustomMetricUtilizationsList()1822         getCustomMetricUtilizationsList() {
1823       if (customMetricUtilizationsBuilder_ == null) {
1824         return java.util.Collections.unmodifiableList(customMetricUtilizations_);
1825       } else {
1826         return customMetricUtilizationsBuilder_.getMessageList();
1827       }
1828     }
1829     /**
1830      *
1831      *
1832      * <pre>
1833      * Configuration parameters of autoscaling based on a custom metric.
1834      * </pre>
1835      *
1836      * <code>
1837      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
1838      * </code>
1839      */
getCustomMetricUtilizationsCount()1840     public int getCustomMetricUtilizationsCount() {
1841       if (customMetricUtilizationsBuilder_ == null) {
1842         return customMetricUtilizations_.size();
1843       } else {
1844         return customMetricUtilizationsBuilder_.getCount();
1845       }
1846     }
1847     /**
1848      *
1849      *
1850      * <pre>
1851      * Configuration parameters of autoscaling based on a custom metric.
1852      * </pre>
1853      *
1854      * <code>
1855      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
1856      * </code>
1857      */
1858     public com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization
getCustomMetricUtilizations(int index)1859         getCustomMetricUtilizations(int index) {
1860       if (customMetricUtilizationsBuilder_ == null) {
1861         return customMetricUtilizations_.get(index);
1862       } else {
1863         return customMetricUtilizationsBuilder_.getMessage(index);
1864       }
1865     }
1866     /**
1867      *
1868      *
1869      * <pre>
1870      * Configuration parameters of autoscaling based on a custom metric.
1871      * </pre>
1872      *
1873      * <code>
1874      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
1875      * </code>
1876      */
setCustomMetricUtilizations( int index, com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization value)1877     public Builder setCustomMetricUtilizations(
1878         int index, com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization value) {
1879       if (customMetricUtilizationsBuilder_ == null) {
1880         if (value == null) {
1881           throw new NullPointerException();
1882         }
1883         ensureCustomMetricUtilizationsIsMutable();
1884         customMetricUtilizations_.set(index, value);
1885         onChanged();
1886       } else {
1887         customMetricUtilizationsBuilder_.setMessage(index, value);
1888       }
1889       return this;
1890     }
1891     /**
1892      *
1893      *
1894      * <pre>
1895      * Configuration parameters of autoscaling based on a custom metric.
1896      * </pre>
1897      *
1898      * <code>
1899      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
1900      * </code>
1901      */
setCustomMetricUtilizations( int index, com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.Builder builderForValue)1902     public Builder setCustomMetricUtilizations(
1903         int index,
1904         com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.Builder
1905             builderForValue) {
1906       if (customMetricUtilizationsBuilder_ == null) {
1907         ensureCustomMetricUtilizationsIsMutable();
1908         customMetricUtilizations_.set(index, builderForValue.build());
1909         onChanged();
1910       } else {
1911         customMetricUtilizationsBuilder_.setMessage(index, builderForValue.build());
1912       }
1913       return this;
1914     }
1915     /**
1916      *
1917      *
1918      * <pre>
1919      * Configuration parameters of autoscaling based on a custom metric.
1920      * </pre>
1921      *
1922      * <code>
1923      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
1924      * </code>
1925      */
addCustomMetricUtilizations( com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization value)1926     public Builder addCustomMetricUtilizations(
1927         com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization value) {
1928       if (customMetricUtilizationsBuilder_ == null) {
1929         if (value == null) {
1930           throw new NullPointerException();
1931         }
1932         ensureCustomMetricUtilizationsIsMutable();
1933         customMetricUtilizations_.add(value);
1934         onChanged();
1935       } else {
1936         customMetricUtilizationsBuilder_.addMessage(value);
1937       }
1938       return this;
1939     }
1940     /**
1941      *
1942      *
1943      * <pre>
1944      * Configuration parameters of autoscaling based on a custom metric.
1945      * </pre>
1946      *
1947      * <code>
1948      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
1949      * </code>
1950      */
addCustomMetricUtilizations( int index, com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization value)1951     public Builder addCustomMetricUtilizations(
1952         int index, com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization value) {
1953       if (customMetricUtilizationsBuilder_ == null) {
1954         if (value == null) {
1955           throw new NullPointerException();
1956         }
1957         ensureCustomMetricUtilizationsIsMutable();
1958         customMetricUtilizations_.add(index, value);
1959         onChanged();
1960       } else {
1961         customMetricUtilizationsBuilder_.addMessage(index, value);
1962       }
1963       return this;
1964     }
1965     /**
1966      *
1967      *
1968      * <pre>
1969      * Configuration parameters of autoscaling based on a custom metric.
1970      * </pre>
1971      *
1972      * <code>
1973      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
1974      * </code>
1975      */
addCustomMetricUtilizations( com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.Builder builderForValue)1976     public Builder addCustomMetricUtilizations(
1977         com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.Builder
1978             builderForValue) {
1979       if (customMetricUtilizationsBuilder_ == null) {
1980         ensureCustomMetricUtilizationsIsMutable();
1981         customMetricUtilizations_.add(builderForValue.build());
1982         onChanged();
1983       } else {
1984         customMetricUtilizationsBuilder_.addMessage(builderForValue.build());
1985       }
1986       return this;
1987     }
1988     /**
1989      *
1990      *
1991      * <pre>
1992      * Configuration parameters of autoscaling based on a custom metric.
1993      * </pre>
1994      *
1995      * <code>
1996      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
1997      * </code>
1998      */
addCustomMetricUtilizations( int index, com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.Builder builderForValue)1999     public Builder addCustomMetricUtilizations(
2000         int index,
2001         com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.Builder
2002             builderForValue) {
2003       if (customMetricUtilizationsBuilder_ == null) {
2004         ensureCustomMetricUtilizationsIsMutable();
2005         customMetricUtilizations_.add(index, builderForValue.build());
2006         onChanged();
2007       } else {
2008         customMetricUtilizationsBuilder_.addMessage(index, builderForValue.build());
2009       }
2010       return this;
2011     }
2012     /**
2013      *
2014      *
2015      * <pre>
2016      * Configuration parameters of autoscaling based on a custom metric.
2017      * </pre>
2018      *
2019      * <code>
2020      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
2021      * </code>
2022      */
addAllCustomMetricUtilizations( java.lang.Iterable< ? extends com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization> values)2023     public Builder addAllCustomMetricUtilizations(
2024         java.lang.Iterable<
2025                 ? extends com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization>
2026             values) {
2027       if (customMetricUtilizationsBuilder_ == null) {
2028         ensureCustomMetricUtilizationsIsMutable();
2029         com.google.protobuf.AbstractMessageLite.Builder.addAll(values, customMetricUtilizations_);
2030         onChanged();
2031       } else {
2032         customMetricUtilizationsBuilder_.addAllMessages(values);
2033       }
2034       return this;
2035     }
2036     /**
2037      *
2038      *
2039      * <pre>
2040      * Configuration parameters of autoscaling based on a custom metric.
2041      * </pre>
2042      *
2043      * <code>
2044      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
2045      * </code>
2046      */
clearCustomMetricUtilizations()2047     public Builder clearCustomMetricUtilizations() {
2048       if (customMetricUtilizationsBuilder_ == null) {
2049         customMetricUtilizations_ = java.util.Collections.emptyList();
2050         bitField0_ = (bitField0_ & ~0x00000004);
2051         onChanged();
2052       } else {
2053         customMetricUtilizationsBuilder_.clear();
2054       }
2055       return this;
2056     }
2057     /**
2058      *
2059      *
2060      * <pre>
2061      * Configuration parameters of autoscaling based on a custom metric.
2062      * </pre>
2063      *
2064      * <code>
2065      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
2066      * </code>
2067      */
removeCustomMetricUtilizations(int index)2068     public Builder removeCustomMetricUtilizations(int index) {
2069       if (customMetricUtilizationsBuilder_ == null) {
2070         ensureCustomMetricUtilizationsIsMutable();
2071         customMetricUtilizations_.remove(index);
2072         onChanged();
2073       } else {
2074         customMetricUtilizationsBuilder_.remove(index);
2075       }
2076       return this;
2077     }
2078     /**
2079      *
2080      *
2081      * <pre>
2082      * Configuration parameters of autoscaling based on a custom metric.
2083      * </pre>
2084      *
2085      * <code>
2086      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
2087      * </code>
2088      */
2089     public com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.Builder
getCustomMetricUtilizationsBuilder(int index)2090         getCustomMetricUtilizationsBuilder(int index) {
2091       return getCustomMetricUtilizationsFieldBuilder().getBuilder(index);
2092     }
2093     /**
2094      *
2095      *
2096      * <pre>
2097      * Configuration parameters of autoscaling based on a custom metric.
2098      * </pre>
2099      *
2100      * <code>
2101      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
2102      * </code>
2103      */
2104     public com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilizationOrBuilder
getCustomMetricUtilizationsOrBuilder(int index)2105         getCustomMetricUtilizationsOrBuilder(int index) {
2106       if (customMetricUtilizationsBuilder_ == null) {
2107         return customMetricUtilizations_.get(index);
2108       } else {
2109         return customMetricUtilizationsBuilder_.getMessageOrBuilder(index);
2110       }
2111     }
2112     /**
2113      *
2114      *
2115      * <pre>
2116      * Configuration parameters of autoscaling based on a custom metric.
2117      * </pre>
2118      *
2119      * <code>
2120      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
2121      * </code>
2122      */
2123     public java.util.List<
2124             ? extends com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilizationOrBuilder>
getCustomMetricUtilizationsOrBuilderList()2125         getCustomMetricUtilizationsOrBuilderList() {
2126       if (customMetricUtilizationsBuilder_ != null) {
2127         return customMetricUtilizationsBuilder_.getMessageOrBuilderList();
2128       } else {
2129         return java.util.Collections.unmodifiableList(customMetricUtilizations_);
2130       }
2131     }
2132     /**
2133      *
2134      *
2135      * <pre>
2136      * Configuration parameters of autoscaling based on a custom metric.
2137      * </pre>
2138      *
2139      * <code>
2140      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
2141      * </code>
2142      */
2143     public com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.Builder
addCustomMetricUtilizationsBuilder()2144         addCustomMetricUtilizationsBuilder() {
2145       return getCustomMetricUtilizationsFieldBuilder()
2146           .addBuilder(
2147               com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization
2148                   .getDefaultInstance());
2149     }
2150     /**
2151      *
2152      *
2153      * <pre>
2154      * Configuration parameters of autoscaling based on a custom metric.
2155      * </pre>
2156      *
2157      * <code>
2158      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
2159      * </code>
2160      */
2161     public com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.Builder
addCustomMetricUtilizationsBuilder(int index)2162         addCustomMetricUtilizationsBuilder(int index) {
2163       return getCustomMetricUtilizationsFieldBuilder()
2164           .addBuilder(
2165               index,
2166               com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization
2167                   .getDefaultInstance());
2168     }
2169     /**
2170      *
2171      *
2172      * <pre>
2173      * Configuration parameters of autoscaling based on a custom metric.
2174      * </pre>
2175      *
2176      * <code>
2177      * repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
2178      * </code>
2179      */
2180     public java.util.List<
2181             com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.Builder>
getCustomMetricUtilizationsBuilderList()2182         getCustomMetricUtilizationsBuilderList() {
2183       return getCustomMetricUtilizationsFieldBuilder().getBuilderList();
2184     }
2185 
2186     private com.google.protobuf.RepeatedFieldBuilderV3<
2187             com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization,
2188             com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.Builder,
2189             com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilizationOrBuilder>
getCustomMetricUtilizationsFieldBuilder()2190         getCustomMetricUtilizationsFieldBuilder() {
2191       if (customMetricUtilizationsBuilder_ == null) {
2192         customMetricUtilizationsBuilder_ =
2193             new com.google.protobuf.RepeatedFieldBuilderV3<
2194                 com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization,
2195                 com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.Builder,
2196                 com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilizationOrBuilder>(
2197                 customMetricUtilizations_,
2198                 ((bitField0_ & 0x00000004) != 0),
2199                 getParentForChildren(),
2200                 isClean());
2201         customMetricUtilizations_ = null;
2202       }
2203       return customMetricUtilizationsBuilder_;
2204     }
2205 
2206     private com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization
2207         loadBalancingUtilization_;
2208     private com.google.protobuf.SingleFieldBuilderV3<
2209             com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization,
2210             com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.Builder,
2211             com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilizationOrBuilder>
2212         loadBalancingUtilizationBuilder_;
2213     /**
2214      *
2215      *
2216      * <pre>
2217      * Configuration parameters of autoscaling based on load balancer.
2218      * </pre>
2219      *
2220      * <code>
2221      * optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;
2222      * </code>
2223      *
2224      * @return Whether the loadBalancingUtilization field is set.
2225      */
hasLoadBalancingUtilization()2226     public boolean hasLoadBalancingUtilization() {
2227       return ((bitField0_ & 0x00000008) != 0);
2228     }
2229     /**
2230      *
2231      *
2232      * <pre>
2233      * Configuration parameters of autoscaling based on load balancer.
2234      * </pre>
2235      *
2236      * <code>
2237      * optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;
2238      * </code>
2239      *
2240      * @return The loadBalancingUtilization.
2241      */
2242     public com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization
getLoadBalancingUtilization()2243         getLoadBalancingUtilization() {
2244       if (loadBalancingUtilizationBuilder_ == null) {
2245         return loadBalancingUtilization_ == null
2246             ? com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization
2247                 .getDefaultInstance()
2248             : loadBalancingUtilization_;
2249       } else {
2250         return loadBalancingUtilizationBuilder_.getMessage();
2251       }
2252     }
2253     /**
2254      *
2255      *
2256      * <pre>
2257      * Configuration parameters of autoscaling based on load balancer.
2258      * </pre>
2259      *
2260      * <code>
2261      * optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;
2262      * </code>
2263      */
setLoadBalancingUtilization( com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization value)2264     public Builder setLoadBalancingUtilization(
2265         com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization value) {
2266       if (loadBalancingUtilizationBuilder_ == null) {
2267         if (value == null) {
2268           throw new NullPointerException();
2269         }
2270         loadBalancingUtilization_ = value;
2271       } else {
2272         loadBalancingUtilizationBuilder_.setMessage(value);
2273       }
2274       bitField0_ |= 0x00000008;
2275       onChanged();
2276       return this;
2277     }
2278     /**
2279      *
2280      *
2281      * <pre>
2282      * Configuration parameters of autoscaling based on load balancer.
2283      * </pre>
2284      *
2285      * <code>
2286      * optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;
2287      * </code>
2288      */
setLoadBalancingUtilization( com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.Builder builderForValue)2289     public Builder setLoadBalancingUtilization(
2290         com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.Builder
2291             builderForValue) {
2292       if (loadBalancingUtilizationBuilder_ == null) {
2293         loadBalancingUtilization_ = builderForValue.build();
2294       } else {
2295         loadBalancingUtilizationBuilder_.setMessage(builderForValue.build());
2296       }
2297       bitField0_ |= 0x00000008;
2298       onChanged();
2299       return this;
2300     }
2301     /**
2302      *
2303      *
2304      * <pre>
2305      * Configuration parameters of autoscaling based on load balancer.
2306      * </pre>
2307      *
2308      * <code>
2309      * optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;
2310      * </code>
2311      */
mergeLoadBalancingUtilization( com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization value)2312     public Builder mergeLoadBalancingUtilization(
2313         com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization value) {
2314       if (loadBalancingUtilizationBuilder_ == null) {
2315         if (((bitField0_ & 0x00000008) != 0)
2316             && loadBalancingUtilization_ != null
2317             && loadBalancingUtilization_
2318                 != com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization
2319                     .getDefaultInstance()) {
2320           getLoadBalancingUtilizationBuilder().mergeFrom(value);
2321         } else {
2322           loadBalancingUtilization_ = value;
2323         }
2324       } else {
2325         loadBalancingUtilizationBuilder_.mergeFrom(value);
2326       }
2327       bitField0_ |= 0x00000008;
2328       onChanged();
2329       return this;
2330     }
2331     /**
2332      *
2333      *
2334      * <pre>
2335      * Configuration parameters of autoscaling based on load balancer.
2336      * </pre>
2337      *
2338      * <code>
2339      * optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;
2340      * </code>
2341      */
clearLoadBalancingUtilization()2342     public Builder clearLoadBalancingUtilization() {
2343       bitField0_ = (bitField0_ & ~0x00000008);
2344       loadBalancingUtilization_ = null;
2345       if (loadBalancingUtilizationBuilder_ != null) {
2346         loadBalancingUtilizationBuilder_.dispose();
2347         loadBalancingUtilizationBuilder_ = null;
2348       }
2349       onChanged();
2350       return this;
2351     }
2352     /**
2353      *
2354      *
2355      * <pre>
2356      * Configuration parameters of autoscaling based on load balancer.
2357      * </pre>
2358      *
2359      * <code>
2360      * optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;
2361      * </code>
2362      */
2363     public com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.Builder
getLoadBalancingUtilizationBuilder()2364         getLoadBalancingUtilizationBuilder() {
2365       bitField0_ |= 0x00000008;
2366       onChanged();
2367       return getLoadBalancingUtilizationFieldBuilder().getBuilder();
2368     }
2369     /**
2370      *
2371      *
2372      * <pre>
2373      * Configuration parameters of autoscaling based on load balancer.
2374      * </pre>
2375      *
2376      * <code>
2377      * optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;
2378      * </code>
2379      */
2380     public com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilizationOrBuilder
getLoadBalancingUtilizationOrBuilder()2381         getLoadBalancingUtilizationOrBuilder() {
2382       if (loadBalancingUtilizationBuilder_ != null) {
2383         return loadBalancingUtilizationBuilder_.getMessageOrBuilder();
2384       } else {
2385         return loadBalancingUtilization_ == null
2386             ? com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization
2387                 .getDefaultInstance()
2388             : loadBalancingUtilization_;
2389       }
2390     }
2391     /**
2392      *
2393      *
2394      * <pre>
2395      * Configuration parameters of autoscaling based on load balancer.
2396      * </pre>
2397      *
2398      * <code>
2399      * optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;
2400      * </code>
2401      */
2402     private com.google.protobuf.SingleFieldBuilderV3<
2403             com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization,
2404             com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.Builder,
2405             com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilizationOrBuilder>
getLoadBalancingUtilizationFieldBuilder()2406         getLoadBalancingUtilizationFieldBuilder() {
2407       if (loadBalancingUtilizationBuilder_ == null) {
2408         loadBalancingUtilizationBuilder_ =
2409             new com.google.protobuf.SingleFieldBuilderV3<
2410                 com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization,
2411                 com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.Builder,
2412                 com.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilizationOrBuilder>(
2413                 getLoadBalancingUtilization(), getParentForChildren(), isClean());
2414         loadBalancingUtilization_ = null;
2415       }
2416       return loadBalancingUtilizationBuilder_;
2417     }
2418 
2419     private int maxNumReplicas_;
2420     /**
2421      *
2422      *
2423      * <pre>
2424      * The maximum number of instances that the autoscaler can scale out to. This is required when creating or updating an autoscaler. The maximum number of replicas must not be lower than minimal number of replicas.
2425      * </pre>
2426      *
2427      * <code>optional int32 max_num_replicas = 62327375;</code>
2428      *
2429      * @return Whether the maxNumReplicas field is set.
2430      */
2431     @java.lang.Override
hasMaxNumReplicas()2432     public boolean hasMaxNumReplicas() {
2433       return ((bitField0_ & 0x00000010) != 0);
2434     }
2435     /**
2436      *
2437      *
2438      * <pre>
2439      * The maximum number of instances that the autoscaler can scale out to. This is required when creating or updating an autoscaler. The maximum number of replicas must not be lower than minimal number of replicas.
2440      * </pre>
2441      *
2442      * <code>optional int32 max_num_replicas = 62327375;</code>
2443      *
2444      * @return The maxNumReplicas.
2445      */
2446     @java.lang.Override
getMaxNumReplicas()2447     public int getMaxNumReplicas() {
2448       return maxNumReplicas_;
2449     }
2450     /**
2451      *
2452      *
2453      * <pre>
2454      * The maximum number of instances that the autoscaler can scale out to. This is required when creating or updating an autoscaler. The maximum number of replicas must not be lower than minimal number of replicas.
2455      * </pre>
2456      *
2457      * <code>optional int32 max_num_replicas = 62327375;</code>
2458      *
2459      * @param value The maxNumReplicas to set.
2460      * @return This builder for chaining.
2461      */
setMaxNumReplicas(int value)2462     public Builder setMaxNumReplicas(int value) {
2463 
2464       maxNumReplicas_ = value;
2465       bitField0_ |= 0x00000010;
2466       onChanged();
2467       return this;
2468     }
2469     /**
2470      *
2471      *
2472      * <pre>
2473      * The maximum number of instances that the autoscaler can scale out to. This is required when creating or updating an autoscaler. The maximum number of replicas must not be lower than minimal number of replicas.
2474      * </pre>
2475      *
2476      * <code>optional int32 max_num_replicas = 62327375;</code>
2477      *
2478      * @return This builder for chaining.
2479      */
clearMaxNumReplicas()2480     public Builder clearMaxNumReplicas() {
2481       bitField0_ = (bitField0_ & ~0x00000010);
2482       maxNumReplicas_ = 0;
2483       onChanged();
2484       return this;
2485     }
2486 
2487     private int minNumReplicas_;
2488     /**
2489      *
2490      *
2491      * <pre>
2492      * The minimum number of replicas that the autoscaler can scale in to. This cannot be less than 0. If not provided, autoscaler chooses a default value depending on maximum number of instances allowed.
2493      * </pre>
2494      *
2495      * <code>optional int32 min_num_replicas = 535329825;</code>
2496      *
2497      * @return Whether the minNumReplicas field is set.
2498      */
2499     @java.lang.Override
hasMinNumReplicas()2500     public boolean hasMinNumReplicas() {
2501       return ((bitField0_ & 0x00000020) != 0);
2502     }
2503     /**
2504      *
2505      *
2506      * <pre>
2507      * The minimum number of replicas that the autoscaler can scale in to. This cannot be less than 0. If not provided, autoscaler chooses a default value depending on maximum number of instances allowed.
2508      * </pre>
2509      *
2510      * <code>optional int32 min_num_replicas = 535329825;</code>
2511      *
2512      * @return The minNumReplicas.
2513      */
2514     @java.lang.Override
getMinNumReplicas()2515     public int getMinNumReplicas() {
2516       return minNumReplicas_;
2517     }
2518     /**
2519      *
2520      *
2521      * <pre>
2522      * The minimum number of replicas that the autoscaler can scale in to. This cannot be less than 0. If not provided, autoscaler chooses a default value depending on maximum number of instances allowed.
2523      * </pre>
2524      *
2525      * <code>optional int32 min_num_replicas = 535329825;</code>
2526      *
2527      * @param value The minNumReplicas to set.
2528      * @return This builder for chaining.
2529      */
setMinNumReplicas(int value)2530     public Builder setMinNumReplicas(int value) {
2531 
2532       minNumReplicas_ = value;
2533       bitField0_ |= 0x00000020;
2534       onChanged();
2535       return this;
2536     }
2537     /**
2538      *
2539      *
2540      * <pre>
2541      * The minimum number of replicas that the autoscaler can scale in to. This cannot be less than 0. If not provided, autoscaler chooses a default value depending on maximum number of instances allowed.
2542      * </pre>
2543      *
2544      * <code>optional int32 min_num_replicas = 535329825;</code>
2545      *
2546      * @return This builder for chaining.
2547      */
clearMinNumReplicas()2548     public Builder clearMinNumReplicas() {
2549       bitField0_ = (bitField0_ & ~0x00000020);
2550       minNumReplicas_ = 0;
2551       onChanged();
2552       return this;
2553     }
2554 
2555     private java.lang.Object mode_ = "";
2556     /**
2557      *
2558      *
2559      * <pre>
2560      * Defines operating mode for this policy.
2561      * Check the Mode enum for the list of possible values.
2562      * </pre>
2563      *
2564      * <code>optional string mode = 3357091;</code>
2565      *
2566      * @return Whether the mode field is set.
2567      */
hasMode()2568     public boolean hasMode() {
2569       return ((bitField0_ & 0x00000040) != 0);
2570     }
2571     /**
2572      *
2573      *
2574      * <pre>
2575      * Defines operating mode for this policy.
2576      * Check the Mode enum for the list of possible values.
2577      * </pre>
2578      *
2579      * <code>optional string mode = 3357091;</code>
2580      *
2581      * @return The mode.
2582      */
getMode()2583     public java.lang.String getMode() {
2584       java.lang.Object ref = mode_;
2585       if (!(ref instanceof java.lang.String)) {
2586         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2587         java.lang.String s = bs.toStringUtf8();
2588         mode_ = s;
2589         return s;
2590       } else {
2591         return (java.lang.String) ref;
2592       }
2593     }
2594     /**
2595      *
2596      *
2597      * <pre>
2598      * Defines operating mode for this policy.
2599      * Check the Mode enum for the list of possible values.
2600      * </pre>
2601      *
2602      * <code>optional string mode = 3357091;</code>
2603      *
2604      * @return The bytes for mode.
2605      */
getModeBytes()2606     public com.google.protobuf.ByteString getModeBytes() {
2607       java.lang.Object ref = mode_;
2608       if (ref instanceof String) {
2609         com.google.protobuf.ByteString b =
2610             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2611         mode_ = b;
2612         return b;
2613       } else {
2614         return (com.google.protobuf.ByteString) ref;
2615       }
2616     }
2617     /**
2618      *
2619      *
2620      * <pre>
2621      * Defines operating mode for this policy.
2622      * Check the Mode enum for the list of possible values.
2623      * </pre>
2624      *
2625      * <code>optional string mode = 3357091;</code>
2626      *
2627      * @param value The mode to set.
2628      * @return This builder for chaining.
2629      */
setMode(java.lang.String value)2630     public Builder setMode(java.lang.String value) {
2631       if (value == null) {
2632         throw new NullPointerException();
2633       }
2634       mode_ = value;
2635       bitField0_ |= 0x00000040;
2636       onChanged();
2637       return this;
2638     }
2639     /**
2640      *
2641      *
2642      * <pre>
2643      * Defines operating mode for this policy.
2644      * Check the Mode enum for the list of possible values.
2645      * </pre>
2646      *
2647      * <code>optional string mode = 3357091;</code>
2648      *
2649      * @return This builder for chaining.
2650      */
clearMode()2651     public Builder clearMode() {
2652       mode_ = getDefaultInstance().getMode();
2653       bitField0_ = (bitField0_ & ~0x00000040);
2654       onChanged();
2655       return this;
2656     }
2657     /**
2658      *
2659      *
2660      * <pre>
2661      * Defines operating mode for this policy.
2662      * Check the Mode enum for the list of possible values.
2663      * </pre>
2664      *
2665      * <code>optional string mode = 3357091;</code>
2666      *
2667      * @param value The bytes for mode to set.
2668      * @return This builder for chaining.
2669      */
setModeBytes(com.google.protobuf.ByteString value)2670     public Builder setModeBytes(com.google.protobuf.ByteString value) {
2671       if (value == null) {
2672         throw new NullPointerException();
2673       }
2674       checkByteStringIsUtf8(value);
2675       mode_ = value;
2676       bitField0_ |= 0x00000040;
2677       onChanged();
2678       return this;
2679     }
2680 
2681     private com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl scaleInControl_;
2682     private com.google.protobuf.SingleFieldBuilderV3<
2683             com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl,
2684             com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl.Builder,
2685             com.google.cloud.compute.v1.AutoscalingPolicyScaleInControlOrBuilder>
2686         scaleInControlBuilder_;
2687     /**
2688      * <code>
2689      * optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;
2690      * </code>
2691      *
2692      * @return Whether the scaleInControl field is set.
2693      */
hasScaleInControl()2694     public boolean hasScaleInControl() {
2695       return ((bitField0_ & 0x00000080) != 0);
2696     }
2697     /**
2698      * <code>
2699      * optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;
2700      * </code>
2701      *
2702      * @return The scaleInControl.
2703      */
getScaleInControl()2704     public com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl getScaleInControl() {
2705       if (scaleInControlBuilder_ == null) {
2706         return scaleInControl_ == null
2707             ? com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl.getDefaultInstance()
2708             : scaleInControl_;
2709       } else {
2710         return scaleInControlBuilder_.getMessage();
2711       }
2712     }
2713     /**
2714      * <code>
2715      * optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;
2716      * </code>
2717      */
setScaleInControl( com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl value)2718     public Builder setScaleInControl(
2719         com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl value) {
2720       if (scaleInControlBuilder_ == null) {
2721         if (value == null) {
2722           throw new NullPointerException();
2723         }
2724         scaleInControl_ = value;
2725       } else {
2726         scaleInControlBuilder_.setMessage(value);
2727       }
2728       bitField0_ |= 0x00000080;
2729       onChanged();
2730       return this;
2731     }
2732     /**
2733      * <code>
2734      * optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;
2735      * </code>
2736      */
setScaleInControl( com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl.Builder builderForValue)2737     public Builder setScaleInControl(
2738         com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl.Builder builderForValue) {
2739       if (scaleInControlBuilder_ == null) {
2740         scaleInControl_ = builderForValue.build();
2741       } else {
2742         scaleInControlBuilder_.setMessage(builderForValue.build());
2743       }
2744       bitField0_ |= 0x00000080;
2745       onChanged();
2746       return this;
2747     }
2748     /**
2749      * <code>
2750      * optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;
2751      * </code>
2752      */
mergeScaleInControl( com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl value)2753     public Builder mergeScaleInControl(
2754         com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl value) {
2755       if (scaleInControlBuilder_ == null) {
2756         if (((bitField0_ & 0x00000080) != 0)
2757             && scaleInControl_ != null
2758             && scaleInControl_
2759                 != com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl
2760                     .getDefaultInstance()) {
2761           getScaleInControlBuilder().mergeFrom(value);
2762         } else {
2763           scaleInControl_ = value;
2764         }
2765       } else {
2766         scaleInControlBuilder_.mergeFrom(value);
2767       }
2768       bitField0_ |= 0x00000080;
2769       onChanged();
2770       return this;
2771     }
2772     /**
2773      * <code>
2774      * optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;
2775      * </code>
2776      */
clearScaleInControl()2777     public Builder clearScaleInControl() {
2778       bitField0_ = (bitField0_ & ~0x00000080);
2779       scaleInControl_ = null;
2780       if (scaleInControlBuilder_ != null) {
2781         scaleInControlBuilder_.dispose();
2782         scaleInControlBuilder_ = null;
2783       }
2784       onChanged();
2785       return this;
2786     }
2787     /**
2788      * <code>
2789      * optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;
2790      * </code>
2791      */
2792     public com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl.Builder
getScaleInControlBuilder()2793         getScaleInControlBuilder() {
2794       bitField0_ |= 0x00000080;
2795       onChanged();
2796       return getScaleInControlFieldBuilder().getBuilder();
2797     }
2798     /**
2799      * <code>
2800      * optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;
2801      * </code>
2802      */
2803     public com.google.cloud.compute.v1.AutoscalingPolicyScaleInControlOrBuilder
getScaleInControlOrBuilder()2804         getScaleInControlOrBuilder() {
2805       if (scaleInControlBuilder_ != null) {
2806         return scaleInControlBuilder_.getMessageOrBuilder();
2807       } else {
2808         return scaleInControl_ == null
2809             ? com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl.getDefaultInstance()
2810             : scaleInControl_;
2811       }
2812     }
2813     /**
2814      * <code>
2815      * optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;
2816      * </code>
2817      */
2818     private com.google.protobuf.SingleFieldBuilderV3<
2819             com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl,
2820             com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl.Builder,
2821             com.google.cloud.compute.v1.AutoscalingPolicyScaleInControlOrBuilder>
getScaleInControlFieldBuilder()2822         getScaleInControlFieldBuilder() {
2823       if (scaleInControlBuilder_ == null) {
2824         scaleInControlBuilder_ =
2825             new com.google.protobuf.SingleFieldBuilderV3<
2826                 com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl,
2827                 com.google.cloud.compute.v1.AutoscalingPolicyScaleInControl.Builder,
2828                 com.google.cloud.compute.v1.AutoscalingPolicyScaleInControlOrBuilder>(
2829                 getScaleInControl(), getParentForChildren(), isClean());
2830         scaleInControl_ = null;
2831       }
2832       return scaleInControlBuilder_;
2833     }
2834 
2835     private com.google.protobuf.MapField<
2836             java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
2837         scalingSchedules_;
2838 
2839     private com.google.protobuf.MapField<
2840             java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
internalGetScalingSchedules()2841         internalGetScalingSchedules() {
2842       if (scalingSchedules_ == null) {
2843         return com.google.protobuf.MapField.emptyMapField(
2844             ScalingSchedulesDefaultEntryHolder.defaultEntry);
2845       }
2846       return scalingSchedules_;
2847     }
2848 
2849     private com.google.protobuf.MapField<
2850             java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
internalGetMutableScalingSchedules()2851         internalGetMutableScalingSchedules() {
2852       if (scalingSchedules_ == null) {
2853         scalingSchedules_ =
2854             com.google.protobuf.MapField.newMapField(
2855                 ScalingSchedulesDefaultEntryHolder.defaultEntry);
2856       }
2857       if (!scalingSchedules_.isMutable()) {
2858         scalingSchedules_ = scalingSchedules_.copy();
2859       }
2860       bitField0_ |= 0x00000100;
2861       onChanged();
2862       return scalingSchedules_;
2863     }
2864 
getScalingSchedulesCount()2865     public int getScalingSchedulesCount() {
2866       return internalGetScalingSchedules().getMap().size();
2867     }
2868     /**
2869      *
2870      *
2871      * <pre>
2872      * Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed.
2873      * </pre>
2874      *
2875      * <code>
2876      * map&lt;string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule&gt; scaling_schedules = 355416580;
2877      * </code>
2878      */
2879     @java.lang.Override
containsScalingSchedules(java.lang.String key)2880     public boolean containsScalingSchedules(java.lang.String key) {
2881       if (key == null) {
2882         throw new NullPointerException("map key");
2883       }
2884       return internalGetScalingSchedules().getMap().containsKey(key);
2885     }
2886     /** Use {@link #getScalingSchedulesMap()} instead. */
2887     @java.lang.Override
2888     @java.lang.Deprecated
2889     public java.util.Map<
2890             java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
getScalingSchedules()2891         getScalingSchedules() {
2892       return getScalingSchedulesMap();
2893     }
2894     /**
2895      *
2896      *
2897      * <pre>
2898      * Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed.
2899      * </pre>
2900      *
2901      * <code>
2902      * map&lt;string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule&gt; scaling_schedules = 355416580;
2903      * </code>
2904      */
2905     @java.lang.Override
2906     public java.util.Map<
2907             java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
getScalingSchedulesMap()2908         getScalingSchedulesMap() {
2909       return internalGetScalingSchedules().getMap();
2910     }
2911     /**
2912      *
2913      *
2914      * <pre>
2915      * Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed.
2916      * </pre>
2917      *
2918      * <code>
2919      * map&lt;string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule&gt; scaling_schedules = 355416580;
2920      * </code>
2921      */
2922     @java.lang.Override
2923     public /* nullable */ com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule
getScalingSchedulesOrDefault( java.lang.String key, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule defaultValue)2924         getScalingSchedulesOrDefault(
2925             java.lang.String key,
2926             /* nullable */
2927             com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule defaultValue) {
2928       if (key == null) {
2929         throw new NullPointerException("map key");
2930       }
2931       java.util.Map<java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
2932           map = internalGetScalingSchedules().getMap();
2933       return map.containsKey(key) ? map.get(key) : defaultValue;
2934     }
2935     /**
2936      *
2937      *
2938      * <pre>
2939      * Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed.
2940      * </pre>
2941      *
2942      * <code>
2943      * map&lt;string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule&gt; scaling_schedules = 355416580;
2944      * </code>
2945      */
2946     @java.lang.Override
getScalingSchedulesOrThrow( java.lang.String key)2947     public com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule getScalingSchedulesOrThrow(
2948         java.lang.String key) {
2949       if (key == null) {
2950         throw new NullPointerException("map key");
2951       }
2952       java.util.Map<java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
2953           map = internalGetScalingSchedules().getMap();
2954       if (!map.containsKey(key)) {
2955         throw new java.lang.IllegalArgumentException();
2956       }
2957       return map.get(key);
2958     }
2959 
clearScalingSchedules()2960     public Builder clearScalingSchedules() {
2961       bitField0_ = (bitField0_ & ~0x00000100);
2962       internalGetMutableScalingSchedules().getMutableMap().clear();
2963       return this;
2964     }
2965     /**
2966      *
2967      *
2968      * <pre>
2969      * Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed.
2970      * </pre>
2971      *
2972      * <code>
2973      * map&lt;string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule&gt; scaling_schedules = 355416580;
2974      * </code>
2975      */
removeScalingSchedules(java.lang.String key)2976     public Builder removeScalingSchedules(java.lang.String key) {
2977       if (key == null) {
2978         throw new NullPointerException("map key");
2979       }
2980       internalGetMutableScalingSchedules().getMutableMap().remove(key);
2981       return this;
2982     }
2983     /** Use alternate mutation accessors instead. */
2984     @java.lang.Deprecated
2985     public java.util.Map<
2986             java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
getMutableScalingSchedules()2987         getMutableScalingSchedules() {
2988       bitField0_ |= 0x00000100;
2989       return internalGetMutableScalingSchedules().getMutableMap();
2990     }
2991     /**
2992      *
2993      *
2994      * <pre>
2995      * Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed.
2996      * </pre>
2997      *
2998      * <code>
2999      * map&lt;string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule&gt; scaling_schedules = 355416580;
3000      * </code>
3001      */
putScalingSchedules( java.lang.String key, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule value)3002     public Builder putScalingSchedules(
3003         java.lang.String key, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule value) {
3004       if (key == null) {
3005         throw new NullPointerException("map key");
3006       }
3007       if (value == null) {
3008         throw new NullPointerException("map value");
3009       }
3010       internalGetMutableScalingSchedules().getMutableMap().put(key, value);
3011       bitField0_ |= 0x00000100;
3012       return this;
3013     }
3014     /**
3015      *
3016      *
3017      * <pre>
3018      * Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed.
3019      * </pre>
3020      *
3021      * <code>
3022      * map&lt;string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule&gt; scaling_schedules = 355416580;
3023      * </code>
3024      */
putAllScalingSchedules( java.util.Map< java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule> values)3025     public Builder putAllScalingSchedules(
3026         java.util.Map<
3027                 java.lang.String, com.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule>
3028             values) {
3029       internalGetMutableScalingSchedules().getMutableMap().putAll(values);
3030       bitField0_ |= 0x00000100;
3031       return this;
3032     }
3033 
3034     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)3035     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
3036       return super.setUnknownFields(unknownFields);
3037     }
3038 
3039     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)3040     public final Builder mergeUnknownFields(
3041         final com.google.protobuf.UnknownFieldSet unknownFields) {
3042       return super.mergeUnknownFields(unknownFields);
3043     }
3044 
3045     // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.AutoscalingPolicy)
3046   }
3047 
3048   // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.AutoscalingPolicy)
3049   private static final com.google.cloud.compute.v1.AutoscalingPolicy DEFAULT_INSTANCE;
3050 
3051   static {
3052     DEFAULT_INSTANCE = new com.google.cloud.compute.v1.AutoscalingPolicy();
3053   }
3054 
getDefaultInstance()3055   public static com.google.cloud.compute.v1.AutoscalingPolicy getDefaultInstance() {
3056     return DEFAULT_INSTANCE;
3057   }
3058 
3059   private static final com.google.protobuf.Parser<AutoscalingPolicy> PARSER =
3060       new com.google.protobuf.AbstractParser<AutoscalingPolicy>() {
3061         @java.lang.Override
3062         public AutoscalingPolicy parsePartialFrom(
3063             com.google.protobuf.CodedInputStream input,
3064             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3065             throws com.google.protobuf.InvalidProtocolBufferException {
3066           Builder builder = newBuilder();
3067           try {
3068             builder.mergeFrom(input, extensionRegistry);
3069           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
3070             throw e.setUnfinishedMessage(builder.buildPartial());
3071           } catch (com.google.protobuf.UninitializedMessageException e) {
3072             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
3073           } catch (java.io.IOException e) {
3074             throw new com.google.protobuf.InvalidProtocolBufferException(e)
3075                 .setUnfinishedMessage(builder.buildPartial());
3076           }
3077           return builder.buildPartial();
3078         }
3079       };
3080 
parser()3081   public static com.google.protobuf.Parser<AutoscalingPolicy> parser() {
3082     return PARSER;
3083   }
3084 
3085   @java.lang.Override
getParserForType()3086   public com.google.protobuf.Parser<AutoscalingPolicy> getParserForType() {
3087     return PARSER;
3088   }
3089 
3090   @java.lang.Override
getDefaultInstanceForType()3091   public com.google.cloud.compute.v1.AutoscalingPolicy getDefaultInstanceForType() {
3092     return DEFAULT_INSTANCE;
3093   }
3094 }
3095