• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 // Generated by the protocol buffer compiler.  DO NOT EDIT!
17 // source: google/cloud/compute/v1/compute.proto
18 
19 package com.google.cloud.compute.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny).
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.compute.v1.SecurityPolicyRule}
29  */
30 public final class SecurityPolicyRule extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.SecurityPolicyRule)
33     SecurityPolicyRuleOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use SecurityPolicyRule.newBuilder() to construct.
SecurityPolicyRule(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private SecurityPolicyRule(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
SecurityPolicyRule()40   private SecurityPolicyRule() {
41     action_ = "";
42     description_ = "";
43     kind_ = "";
44   }
45 
46   @java.lang.Override
47   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)48   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
49     return new SecurityPolicyRule();
50   }
51 
52   @java.lang.Override
getUnknownFields()53   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
54     return this.unknownFields;
55   }
56 
getDescriptor()57   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
58     return com.google.cloud.compute.v1.Compute
59         .internal_static_google_cloud_compute_v1_SecurityPolicyRule_descriptor;
60   }
61 
62   @java.lang.Override
63   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()64       internalGetFieldAccessorTable() {
65     return com.google.cloud.compute.v1.Compute
66         .internal_static_google_cloud_compute_v1_SecurityPolicyRule_fieldAccessorTable
67         .ensureFieldAccessorsInitialized(
68             com.google.cloud.compute.v1.SecurityPolicyRule.class,
69             com.google.cloud.compute.v1.SecurityPolicyRule.Builder.class);
70   }
71 
72   private int bitField0_;
73   public static final int ACTION_FIELD_NUMBER = 187661878;
74 
75   @SuppressWarnings("serial")
76   private volatile java.lang.Object action_ = "";
77   /**
78    *
79    *
80    * <pre>
81    * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for `STATUS` are 403, 404, and 502. - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this.
82    * </pre>
83    *
84    * <code>optional string action = 187661878;</code>
85    *
86    * @return Whether the action field is set.
87    */
88   @java.lang.Override
hasAction()89   public boolean hasAction() {
90     return ((bitField0_ & 0x00000001) != 0);
91   }
92   /**
93    *
94    *
95    * <pre>
96    * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for `STATUS` are 403, 404, and 502. - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this.
97    * </pre>
98    *
99    * <code>optional string action = 187661878;</code>
100    *
101    * @return The action.
102    */
103   @java.lang.Override
getAction()104   public java.lang.String getAction() {
105     java.lang.Object ref = action_;
106     if (ref instanceof java.lang.String) {
107       return (java.lang.String) ref;
108     } else {
109       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
110       java.lang.String s = bs.toStringUtf8();
111       action_ = s;
112       return s;
113     }
114   }
115   /**
116    *
117    *
118    * <pre>
119    * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for `STATUS` are 403, 404, and 502. - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this.
120    * </pre>
121    *
122    * <code>optional string action = 187661878;</code>
123    *
124    * @return The bytes for action.
125    */
126   @java.lang.Override
getActionBytes()127   public com.google.protobuf.ByteString getActionBytes() {
128     java.lang.Object ref = action_;
129     if (ref instanceof java.lang.String) {
130       com.google.protobuf.ByteString b =
131           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
132       action_ = b;
133       return b;
134     } else {
135       return (com.google.protobuf.ByteString) ref;
136     }
137   }
138 
139   public static final int DESCRIPTION_FIELD_NUMBER = 422937596;
140 
141   @SuppressWarnings("serial")
142   private volatile java.lang.Object description_ = "";
143   /**
144    *
145    *
146    * <pre>
147    * An optional description of this resource. Provide this property when you create the resource.
148    * </pre>
149    *
150    * <code>optional string description = 422937596;</code>
151    *
152    * @return Whether the description field is set.
153    */
154   @java.lang.Override
hasDescription()155   public boolean hasDescription() {
156     return ((bitField0_ & 0x00000002) != 0);
157   }
158   /**
159    *
160    *
161    * <pre>
162    * An optional description of this resource. Provide this property when you create the resource.
163    * </pre>
164    *
165    * <code>optional string description = 422937596;</code>
166    *
167    * @return The description.
168    */
169   @java.lang.Override
getDescription()170   public java.lang.String getDescription() {
171     java.lang.Object ref = description_;
172     if (ref instanceof java.lang.String) {
173       return (java.lang.String) ref;
174     } else {
175       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
176       java.lang.String s = bs.toStringUtf8();
177       description_ = s;
178       return s;
179     }
180   }
181   /**
182    *
183    *
184    * <pre>
185    * An optional description of this resource. Provide this property when you create the resource.
186    * </pre>
187    *
188    * <code>optional string description = 422937596;</code>
189    *
190    * @return The bytes for description.
191    */
192   @java.lang.Override
getDescriptionBytes()193   public com.google.protobuf.ByteString getDescriptionBytes() {
194     java.lang.Object ref = description_;
195     if (ref instanceof java.lang.String) {
196       com.google.protobuf.ByteString b =
197           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
198       description_ = b;
199       return b;
200     } else {
201       return (com.google.protobuf.ByteString) ref;
202     }
203   }
204 
205   public static final int HEADER_ACTION_FIELD_NUMBER = 328077352;
206   private com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction headerAction_;
207   /**
208    *
209    *
210    * <pre>
211    * Optional, additional actions that are performed on headers.
212    * </pre>
213    *
214    * <code>
215    * optional .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction header_action = 328077352;
216    * </code>
217    *
218    * @return Whether the headerAction field is set.
219    */
220   @java.lang.Override
hasHeaderAction()221   public boolean hasHeaderAction() {
222     return ((bitField0_ & 0x00000004) != 0);
223   }
224   /**
225    *
226    *
227    * <pre>
228    * Optional, additional actions that are performed on headers.
229    * </pre>
230    *
231    * <code>
232    * optional .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction header_action = 328077352;
233    * </code>
234    *
235    * @return The headerAction.
236    */
237   @java.lang.Override
getHeaderAction()238   public com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction getHeaderAction() {
239     return headerAction_ == null
240         ? com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction.getDefaultInstance()
241         : headerAction_;
242   }
243   /**
244    *
245    *
246    * <pre>
247    * Optional, additional actions that are performed on headers.
248    * </pre>
249    *
250    * <code>
251    * optional .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction header_action = 328077352;
252    * </code>
253    */
254   @java.lang.Override
255   public com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderActionOrBuilder
getHeaderActionOrBuilder()256       getHeaderActionOrBuilder() {
257     return headerAction_ == null
258         ? com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction.getDefaultInstance()
259         : headerAction_;
260   }
261 
262   public static final int KIND_FIELD_NUMBER = 3292052;
263 
264   @SuppressWarnings("serial")
265   private volatile java.lang.Object kind_ = "";
266   /**
267    *
268    *
269    * <pre>
270    * [Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules
271    * </pre>
272    *
273    * <code>optional string kind = 3292052;</code>
274    *
275    * @return Whether the kind field is set.
276    */
277   @java.lang.Override
hasKind()278   public boolean hasKind() {
279     return ((bitField0_ & 0x00000008) != 0);
280   }
281   /**
282    *
283    *
284    * <pre>
285    * [Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules
286    * </pre>
287    *
288    * <code>optional string kind = 3292052;</code>
289    *
290    * @return The kind.
291    */
292   @java.lang.Override
getKind()293   public java.lang.String getKind() {
294     java.lang.Object ref = kind_;
295     if (ref instanceof java.lang.String) {
296       return (java.lang.String) ref;
297     } else {
298       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
299       java.lang.String s = bs.toStringUtf8();
300       kind_ = s;
301       return s;
302     }
303   }
304   /**
305    *
306    *
307    * <pre>
308    * [Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules
309    * </pre>
310    *
311    * <code>optional string kind = 3292052;</code>
312    *
313    * @return The bytes for kind.
314    */
315   @java.lang.Override
getKindBytes()316   public com.google.protobuf.ByteString getKindBytes() {
317     java.lang.Object ref = kind_;
318     if (ref instanceof java.lang.String) {
319       com.google.protobuf.ByteString b =
320           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
321       kind_ = b;
322       return b;
323     } else {
324       return (com.google.protobuf.ByteString) ref;
325     }
326   }
327 
328   public static final int MATCH_FIELD_NUMBER = 103668165;
329   private com.google.cloud.compute.v1.SecurityPolicyRuleMatcher match_;
330   /**
331    *
332    *
333    * <pre>
334    * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
335    * </pre>
336    *
337    * <code>optional .google.cloud.compute.v1.SecurityPolicyRuleMatcher match = 103668165;</code>
338    *
339    * @return Whether the match field is set.
340    */
341   @java.lang.Override
hasMatch()342   public boolean hasMatch() {
343     return ((bitField0_ & 0x00000010) != 0);
344   }
345   /**
346    *
347    *
348    * <pre>
349    * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
350    * </pre>
351    *
352    * <code>optional .google.cloud.compute.v1.SecurityPolicyRuleMatcher match = 103668165;</code>
353    *
354    * @return The match.
355    */
356   @java.lang.Override
getMatch()357   public com.google.cloud.compute.v1.SecurityPolicyRuleMatcher getMatch() {
358     return match_ == null
359         ? com.google.cloud.compute.v1.SecurityPolicyRuleMatcher.getDefaultInstance()
360         : match_;
361   }
362   /**
363    *
364    *
365    * <pre>
366    * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
367    * </pre>
368    *
369    * <code>optional .google.cloud.compute.v1.SecurityPolicyRuleMatcher match = 103668165;</code>
370    */
371   @java.lang.Override
getMatchOrBuilder()372   public com.google.cloud.compute.v1.SecurityPolicyRuleMatcherOrBuilder getMatchOrBuilder() {
373     return match_ == null
374         ? com.google.cloud.compute.v1.SecurityPolicyRuleMatcher.getDefaultInstance()
375         : match_;
376   }
377 
378   public static final int PRECONFIGURED_WAF_CONFIG_FIELD_NUMBER = 117805027;
379   private com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig
380       preconfiguredWafConfig_;
381   /**
382    *
383    *
384    * <pre>
385    * Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect.
386    * </pre>
387    *
388    * <code>
389    * optional .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig preconfigured_waf_config = 117805027;
390    * </code>
391    *
392    * @return Whether the preconfiguredWafConfig field is set.
393    */
394   @java.lang.Override
hasPreconfiguredWafConfig()395   public boolean hasPreconfiguredWafConfig() {
396     return ((bitField0_ & 0x00000020) != 0);
397   }
398   /**
399    *
400    *
401    * <pre>
402    * Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect.
403    * </pre>
404    *
405    * <code>
406    * optional .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig preconfigured_waf_config = 117805027;
407    * </code>
408    *
409    * @return The preconfiguredWafConfig.
410    */
411   @java.lang.Override
412   public com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig
getPreconfiguredWafConfig()413       getPreconfiguredWafConfig() {
414     return preconfiguredWafConfig_ == null
415         ? com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig.getDefaultInstance()
416         : preconfiguredWafConfig_;
417   }
418   /**
419    *
420    *
421    * <pre>
422    * Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect.
423    * </pre>
424    *
425    * <code>
426    * optional .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig preconfigured_waf_config = 117805027;
427    * </code>
428    */
429   @java.lang.Override
430   public com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigOrBuilder
getPreconfiguredWafConfigOrBuilder()431       getPreconfiguredWafConfigOrBuilder() {
432     return preconfiguredWafConfig_ == null
433         ? com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig.getDefaultInstance()
434         : preconfiguredWafConfig_;
435   }
436 
437   public static final int PREVIEW_FIELD_NUMBER = 218686408;
438   private boolean preview_ = false;
439   /**
440    *
441    *
442    * <pre>
443    * If set to true, the specified action is not enforced.
444    * </pre>
445    *
446    * <code>optional bool preview = 218686408;</code>
447    *
448    * @return Whether the preview field is set.
449    */
450   @java.lang.Override
hasPreview()451   public boolean hasPreview() {
452     return ((bitField0_ & 0x00000040) != 0);
453   }
454   /**
455    *
456    *
457    * <pre>
458    * If set to true, the specified action is not enforced.
459    * </pre>
460    *
461    * <code>optional bool preview = 218686408;</code>
462    *
463    * @return The preview.
464    */
465   @java.lang.Override
getPreview()466   public boolean getPreview() {
467     return preview_;
468   }
469 
470   public static final int PRIORITY_FIELD_NUMBER = 445151652;
471   private int priority_ = 0;
472   /**
473    *
474    *
475    * <pre>
476    * An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
477    * </pre>
478    *
479    * <code>optional int32 priority = 445151652;</code>
480    *
481    * @return Whether the priority field is set.
482    */
483   @java.lang.Override
hasPriority()484   public boolean hasPriority() {
485     return ((bitField0_ & 0x00000080) != 0);
486   }
487   /**
488    *
489    *
490    * <pre>
491    * An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
492    * </pre>
493    *
494    * <code>optional int32 priority = 445151652;</code>
495    *
496    * @return The priority.
497    */
498   @java.lang.Override
getPriority()499   public int getPriority() {
500     return priority_;
501   }
502 
503   public static final int RATE_LIMIT_OPTIONS_FIELD_NUMBER = 67544315;
504   private com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rateLimitOptions_;
505   /**
506    *
507    *
508    * <pre>
509    * Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions.
510    * </pre>
511    *
512    * <code>
513    * optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rate_limit_options = 67544315;
514    * </code>
515    *
516    * @return Whether the rateLimitOptions field is set.
517    */
518   @java.lang.Override
hasRateLimitOptions()519   public boolean hasRateLimitOptions() {
520     return ((bitField0_ & 0x00000100) != 0);
521   }
522   /**
523    *
524    *
525    * <pre>
526    * Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions.
527    * </pre>
528    *
529    * <code>
530    * optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rate_limit_options = 67544315;
531    * </code>
532    *
533    * @return The rateLimitOptions.
534    */
535   @java.lang.Override
getRateLimitOptions()536   public com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions getRateLimitOptions() {
537     return rateLimitOptions_ == null
538         ? com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions.getDefaultInstance()
539         : rateLimitOptions_;
540   }
541   /**
542    *
543    *
544    * <pre>
545    * Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions.
546    * </pre>
547    *
548    * <code>
549    * optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rate_limit_options = 67544315;
550    * </code>
551    */
552   @java.lang.Override
553   public com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsOrBuilder
getRateLimitOptionsOrBuilder()554       getRateLimitOptionsOrBuilder() {
555     return rateLimitOptions_ == null
556         ? com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions.getDefaultInstance()
557         : rateLimitOptions_;
558   }
559 
560   public static final int REDIRECT_OPTIONS_FIELD_NUMBER = 163285307;
561   private com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirectOptions_;
562   /**
563    *
564    *
565    * <pre>
566    * Parameters defining the redirect action. Cannot be specified for any other actions.
567    * </pre>
568    *
569    * <code>
570    * optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirect_options = 163285307;
571    * </code>
572    *
573    * @return Whether the redirectOptions field is set.
574    */
575   @java.lang.Override
hasRedirectOptions()576   public boolean hasRedirectOptions() {
577     return ((bitField0_ & 0x00000200) != 0);
578   }
579   /**
580    *
581    *
582    * <pre>
583    * Parameters defining the redirect action. Cannot be specified for any other actions.
584    * </pre>
585    *
586    * <code>
587    * optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirect_options = 163285307;
588    * </code>
589    *
590    * @return The redirectOptions.
591    */
592   @java.lang.Override
getRedirectOptions()593   public com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions getRedirectOptions() {
594     return redirectOptions_ == null
595         ? com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions.getDefaultInstance()
596         : redirectOptions_;
597   }
598   /**
599    *
600    *
601    * <pre>
602    * Parameters defining the redirect action. Cannot be specified for any other actions.
603    * </pre>
604    *
605    * <code>
606    * optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirect_options = 163285307;
607    * </code>
608    */
609   @java.lang.Override
610   public com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptionsOrBuilder
getRedirectOptionsOrBuilder()611       getRedirectOptionsOrBuilder() {
612     return redirectOptions_ == null
613         ? com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions.getDefaultInstance()
614         : redirectOptions_;
615   }
616 
617   private byte memoizedIsInitialized = -1;
618 
619   @java.lang.Override
isInitialized()620   public final boolean isInitialized() {
621     byte isInitialized = memoizedIsInitialized;
622     if (isInitialized == 1) return true;
623     if (isInitialized == 0) return false;
624 
625     memoizedIsInitialized = 1;
626     return true;
627   }
628 
629   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)630   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
631     if (((bitField0_ & 0x00000008) != 0)) {
632       com.google.protobuf.GeneratedMessageV3.writeString(output, 3292052, kind_);
633     }
634     if (((bitField0_ & 0x00000100) != 0)) {
635       output.writeMessage(67544315, getRateLimitOptions());
636     }
637     if (((bitField0_ & 0x00000010) != 0)) {
638       output.writeMessage(103668165, getMatch());
639     }
640     if (((bitField0_ & 0x00000020) != 0)) {
641       output.writeMessage(117805027, getPreconfiguredWafConfig());
642     }
643     if (((bitField0_ & 0x00000200) != 0)) {
644       output.writeMessage(163285307, getRedirectOptions());
645     }
646     if (((bitField0_ & 0x00000001) != 0)) {
647       com.google.protobuf.GeneratedMessageV3.writeString(output, 187661878, action_);
648     }
649     if (((bitField0_ & 0x00000040) != 0)) {
650       output.writeBool(218686408, preview_);
651     }
652     if (((bitField0_ & 0x00000004) != 0)) {
653       output.writeMessage(328077352, getHeaderAction());
654     }
655     if (((bitField0_ & 0x00000002) != 0)) {
656       com.google.protobuf.GeneratedMessageV3.writeString(output, 422937596, description_);
657     }
658     if (((bitField0_ & 0x00000080) != 0)) {
659       output.writeInt32(445151652, priority_);
660     }
661     getUnknownFields().writeTo(output);
662   }
663 
664   @java.lang.Override
getSerializedSize()665   public int getSerializedSize() {
666     int size = memoizedSize;
667     if (size != -1) return size;
668 
669     size = 0;
670     if (((bitField0_ & 0x00000008) != 0)) {
671       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3292052, kind_);
672     }
673     if (((bitField0_ & 0x00000100) != 0)) {
674       size +=
675           com.google.protobuf.CodedOutputStream.computeMessageSize(67544315, getRateLimitOptions());
676     }
677     if (((bitField0_ & 0x00000010) != 0)) {
678       size += com.google.protobuf.CodedOutputStream.computeMessageSize(103668165, getMatch());
679     }
680     if (((bitField0_ & 0x00000020) != 0)) {
681       size +=
682           com.google.protobuf.CodedOutputStream.computeMessageSize(
683               117805027, getPreconfiguredWafConfig());
684     }
685     if (((bitField0_ & 0x00000200) != 0)) {
686       size +=
687           com.google.protobuf.CodedOutputStream.computeMessageSize(163285307, getRedirectOptions());
688     }
689     if (((bitField0_ & 0x00000001) != 0)) {
690       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(187661878, action_);
691     }
692     if (((bitField0_ & 0x00000040) != 0)) {
693       size += com.google.protobuf.CodedOutputStream.computeBoolSize(218686408, preview_);
694     }
695     if (((bitField0_ & 0x00000004) != 0)) {
696       size +=
697           com.google.protobuf.CodedOutputStream.computeMessageSize(328077352, getHeaderAction());
698     }
699     if (((bitField0_ & 0x00000002) != 0)) {
700       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(422937596, description_);
701     }
702     if (((bitField0_ & 0x00000080) != 0)) {
703       size += com.google.protobuf.CodedOutputStream.computeInt32Size(445151652, priority_);
704     }
705     size += getUnknownFields().getSerializedSize();
706     memoizedSize = size;
707     return size;
708   }
709 
710   @java.lang.Override
equals(final java.lang.Object obj)711   public boolean equals(final java.lang.Object obj) {
712     if (obj == this) {
713       return true;
714     }
715     if (!(obj instanceof com.google.cloud.compute.v1.SecurityPolicyRule)) {
716       return super.equals(obj);
717     }
718     com.google.cloud.compute.v1.SecurityPolicyRule other =
719         (com.google.cloud.compute.v1.SecurityPolicyRule) obj;
720 
721     if (hasAction() != other.hasAction()) return false;
722     if (hasAction()) {
723       if (!getAction().equals(other.getAction())) return false;
724     }
725     if (hasDescription() != other.hasDescription()) return false;
726     if (hasDescription()) {
727       if (!getDescription().equals(other.getDescription())) return false;
728     }
729     if (hasHeaderAction() != other.hasHeaderAction()) return false;
730     if (hasHeaderAction()) {
731       if (!getHeaderAction().equals(other.getHeaderAction())) return false;
732     }
733     if (hasKind() != other.hasKind()) return false;
734     if (hasKind()) {
735       if (!getKind().equals(other.getKind())) return false;
736     }
737     if (hasMatch() != other.hasMatch()) return false;
738     if (hasMatch()) {
739       if (!getMatch().equals(other.getMatch())) return false;
740     }
741     if (hasPreconfiguredWafConfig() != other.hasPreconfiguredWafConfig()) return false;
742     if (hasPreconfiguredWafConfig()) {
743       if (!getPreconfiguredWafConfig().equals(other.getPreconfiguredWafConfig())) return false;
744     }
745     if (hasPreview() != other.hasPreview()) return false;
746     if (hasPreview()) {
747       if (getPreview() != other.getPreview()) return false;
748     }
749     if (hasPriority() != other.hasPriority()) return false;
750     if (hasPriority()) {
751       if (getPriority() != other.getPriority()) return false;
752     }
753     if (hasRateLimitOptions() != other.hasRateLimitOptions()) return false;
754     if (hasRateLimitOptions()) {
755       if (!getRateLimitOptions().equals(other.getRateLimitOptions())) return false;
756     }
757     if (hasRedirectOptions() != other.hasRedirectOptions()) return false;
758     if (hasRedirectOptions()) {
759       if (!getRedirectOptions().equals(other.getRedirectOptions())) return false;
760     }
761     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
762     return true;
763   }
764 
765   @java.lang.Override
hashCode()766   public int hashCode() {
767     if (memoizedHashCode != 0) {
768       return memoizedHashCode;
769     }
770     int hash = 41;
771     hash = (19 * hash) + getDescriptor().hashCode();
772     if (hasAction()) {
773       hash = (37 * hash) + ACTION_FIELD_NUMBER;
774       hash = (53 * hash) + getAction().hashCode();
775     }
776     if (hasDescription()) {
777       hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER;
778       hash = (53 * hash) + getDescription().hashCode();
779     }
780     if (hasHeaderAction()) {
781       hash = (37 * hash) + HEADER_ACTION_FIELD_NUMBER;
782       hash = (53 * hash) + getHeaderAction().hashCode();
783     }
784     if (hasKind()) {
785       hash = (37 * hash) + KIND_FIELD_NUMBER;
786       hash = (53 * hash) + getKind().hashCode();
787     }
788     if (hasMatch()) {
789       hash = (37 * hash) + MATCH_FIELD_NUMBER;
790       hash = (53 * hash) + getMatch().hashCode();
791     }
792     if (hasPreconfiguredWafConfig()) {
793       hash = (37 * hash) + PRECONFIGURED_WAF_CONFIG_FIELD_NUMBER;
794       hash = (53 * hash) + getPreconfiguredWafConfig().hashCode();
795     }
796     if (hasPreview()) {
797       hash = (37 * hash) + PREVIEW_FIELD_NUMBER;
798       hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPreview());
799     }
800     if (hasPriority()) {
801       hash = (37 * hash) + PRIORITY_FIELD_NUMBER;
802       hash = (53 * hash) + getPriority();
803     }
804     if (hasRateLimitOptions()) {
805       hash = (37 * hash) + RATE_LIMIT_OPTIONS_FIELD_NUMBER;
806       hash = (53 * hash) + getRateLimitOptions().hashCode();
807     }
808     if (hasRedirectOptions()) {
809       hash = (37 * hash) + REDIRECT_OPTIONS_FIELD_NUMBER;
810       hash = (53 * hash) + getRedirectOptions().hashCode();
811     }
812     hash = (29 * hash) + getUnknownFields().hashCode();
813     memoizedHashCode = hash;
814     return hash;
815   }
816 
parseFrom(java.nio.ByteBuffer data)817   public static com.google.cloud.compute.v1.SecurityPolicyRule parseFrom(java.nio.ByteBuffer data)
818       throws com.google.protobuf.InvalidProtocolBufferException {
819     return PARSER.parseFrom(data);
820   }
821 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)822   public static com.google.cloud.compute.v1.SecurityPolicyRule parseFrom(
823       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
824       throws com.google.protobuf.InvalidProtocolBufferException {
825     return PARSER.parseFrom(data, extensionRegistry);
826   }
827 
parseFrom( com.google.protobuf.ByteString data)828   public static com.google.cloud.compute.v1.SecurityPolicyRule parseFrom(
829       com.google.protobuf.ByteString data)
830       throws com.google.protobuf.InvalidProtocolBufferException {
831     return PARSER.parseFrom(data);
832   }
833 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)834   public static com.google.cloud.compute.v1.SecurityPolicyRule parseFrom(
835       com.google.protobuf.ByteString data,
836       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
837       throws com.google.protobuf.InvalidProtocolBufferException {
838     return PARSER.parseFrom(data, extensionRegistry);
839   }
840 
parseFrom(byte[] data)841   public static com.google.cloud.compute.v1.SecurityPolicyRule parseFrom(byte[] data)
842       throws com.google.protobuf.InvalidProtocolBufferException {
843     return PARSER.parseFrom(data);
844   }
845 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)846   public static com.google.cloud.compute.v1.SecurityPolicyRule parseFrom(
847       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
848       throws com.google.protobuf.InvalidProtocolBufferException {
849     return PARSER.parseFrom(data, extensionRegistry);
850   }
851 
parseFrom(java.io.InputStream input)852   public static com.google.cloud.compute.v1.SecurityPolicyRule parseFrom(java.io.InputStream input)
853       throws java.io.IOException {
854     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
855   }
856 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)857   public static com.google.cloud.compute.v1.SecurityPolicyRule parseFrom(
858       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
859       throws java.io.IOException {
860     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
861         PARSER, input, extensionRegistry);
862   }
863 
parseDelimitedFrom( java.io.InputStream input)864   public static com.google.cloud.compute.v1.SecurityPolicyRule parseDelimitedFrom(
865       java.io.InputStream input) throws java.io.IOException {
866     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
867   }
868 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)869   public static com.google.cloud.compute.v1.SecurityPolicyRule parseDelimitedFrom(
870       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
871       throws java.io.IOException {
872     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
873         PARSER, input, extensionRegistry);
874   }
875 
parseFrom( com.google.protobuf.CodedInputStream input)876   public static com.google.cloud.compute.v1.SecurityPolicyRule parseFrom(
877       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
878     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
879   }
880 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)881   public static com.google.cloud.compute.v1.SecurityPolicyRule parseFrom(
882       com.google.protobuf.CodedInputStream input,
883       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
884       throws java.io.IOException {
885     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
886         PARSER, input, extensionRegistry);
887   }
888 
889   @java.lang.Override
newBuilderForType()890   public Builder newBuilderForType() {
891     return newBuilder();
892   }
893 
newBuilder()894   public static Builder newBuilder() {
895     return DEFAULT_INSTANCE.toBuilder();
896   }
897 
newBuilder(com.google.cloud.compute.v1.SecurityPolicyRule prototype)898   public static Builder newBuilder(com.google.cloud.compute.v1.SecurityPolicyRule prototype) {
899     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
900   }
901 
902   @java.lang.Override
toBuilder()903   public Builder toBuilder() {
904     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
905   }
906 
907   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)908   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
909     Builder builder = new Builder(parent);
910     return builder;
911   }
912   /**
913    *
914    *
915    * <pre>
916    * Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny).
917    * </pre>
918    *
919    * Protobuf type {@code google.cloud.compute.v1.SecurityPolicyRule}
920    */
921   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
922       implements
923       // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.SecurityPolicyRule)
924       com.google.cloud.compute.v1.SecurityPolicyRuleOrBuilder {
getDescriptor()925     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
926       return com.google.cloud.compute.v1.Compute
927           .internal_static_google_cloud_compute_v1_SecurityPolicyRule_descriptor;
928     }
929 
930     @java.lang.Override
931     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()932         internalGetFieldAccessorTable() {
933       return com.google.cloud.compute.v1.Compute
934           .internal_static_google_cloud_compute_v1_SecurityPolicyRule_fieldAccessorTable
935           .ensureFieldAccessorsInitialized(
936               com.google.cloud.compute.v1.SecurityPolicyRule.class,
937               com.google.cloud.compute.v1.SecurityPolicyRule.Builder.class);
938     }
939 
940     // Construct using com.google.cloud.compute.v1.SecurityPolicyRule.newBuilder()
Builder()941     private Builder() {
942       maybeForceBuilderInitialization();
943     }
944 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)945     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
946       super(parent);
947       maybeForceBuilderInitialization();
948     }
949 
maybeForceBuilderInitialization()950     private void maybeForceBuilderInitialization() {
951       if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
952         getHeaderActionFieldBuilder();
953         getMatchFieldBuilder();
954         getPreconfiguredWafConfigFieldBuilder();
955         getRateLimitOptionsFieldBuilder();
956         getRedirectOptionsFieldBuilder();
957       }
958     }
959 
960     @java.lang.Override
clear()961     public Builder clear() {
962       super.clear();
963       bitField0_ = 0;
964       action_ = "";
965       description_ = "";
966       headerAction_ = null;
967       if (headerActionBuilder_ != null) {
968         headerActionBuilder_.dispose();
969         headerActionBuilder_ = null;
970       }
971       kind_ = "";
972       match_ = null;
973       if (matchBuilder_ != null) {
974         matchBuilder_.dispose();
975         matchBuilder_ = null;
976       }
977       preconfiguredWafConfig_ = null;
978       if (preconfiguredWafConfigBuilder_ != null) {
979         preconfiguredWafConfigBuilder_.dispose();
980         preconfiguredWafConfigBuilder_ = null;
981       }
982       preview_ = false;
983       priority_ = 0;
984       rateLimitOptions_ = null;
985       if (rateLimitOptionsBuilder_ != null) {
986         rateLimitOptionsBuilder_.dispose();
987         rateLimitOptionsBuilder_ = null;
988       }
989       redirectOptions_ = null;
990       if (redirectOptionsBuilder_ != null) {
991         redirectOptionsBuilder_.dispose();
992         redirectOptionsBuilder_ = null;
993       }
994       return this;
995     }
996 
997     @java.lang.Override
getDescriptorForType()998     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
999       return com.google.cloud.compute.v1.Compute
1000           .internal_static_google_cloud_compute_v1_SecurityPolicyRule_descriptor;
1001     }
1002 
1003     @java.lang.Override
getDefaultInstanceForType()1004     public com.google.cloud.compute.v1.SecurityPolicyRule getDefaultInstanceForType() {
1005       return com.google.cloud.compute.v1.SecurityPolicyRule.getDefaultInstance();
1006     }
1007 
1008     @java.lang.Override
build()1009     public com.google.cloud.compute.v1.SecurityPolicyRule build() {
1010       com.google.cloud.compute.v1.SecurityPolicyRule result = buildPartial();
1011       if (!result.isInitialized()) {
1012         throw newUninitializedMessageException(result);
1013       }
1014       return result;
1015     }
1016 
1017     @java.lang.Override
buildPartial()1018     public com.google.cloud.compute.v1.SecurityPolicyRule buildPartial() {
1019       com.google.cloud.compute.v1.SecurityPolicyRule result =
1020           new com.google.cloud.compute.v1.SecurityPolicyRule(this);
1021       if (bitField0_ != 0) {
1022         buildPartial0(result);
1023       }
1024       onBuilt();
1025       return result;
1026     }
1027 
buildPartial0(com.google.cloud.compute.v1.SecurityPolicyRule result)1028     private void buildPartial0(com.google.cloud.compute.v1.SecurityPolicyRule result) {
1029       int from_bitField0_ = bitField0_;
1030       int to_bitField0_ = 0;
1031       if (((from_bitField0_ & 0x00000001) != 0)) {
1032         result.action_ = action_;
1033         to_bitField0_ |= 0x00000001;
1034       }
1035       if (((from_bitField0_ & 0x00000002) != 0)) {
1036         result.description_ = description_;
1037         to_bitField0_ |= 0x00000002;
1038       }
1039       if (((from_bitField0_ & 0x00000004) != 0)) {
1040         result.headerAction_ =
1041             headerActionBuilder_ == null ? headerAction_ : headerActionBuilder_.build();
1042         to_bitField0_ |= 0x00000004;
1043       }
1044       if (((from_bitField0_ & 0x00000008) != 0)) {
1045         result.kind_ = kind_;
1046         to_bitField0_ |= 0x00000008;
1047       }
1048       if (((from_bitField0_ & 0x00000010) != 0)) {
1049         result.match_ = matchBuilder_ == null ? match_ : matchBuilder_.build();
1050         to_bitField0_ |= 0x00000010;
1051       }
1052       if (((from_bitField0_ & 0x00000020) != 0)) {
1053         result.preconfiguredWafConfig_ =
1054             preconfiguredWafConfigBuilder_ == null
1055                 ? preconfiguredWafConfig_
1056                 : preconfiguredWafConfigBuilder_.build();
1057         to_bitField0_ |= 0x00000020;
1058       }
1059       if (((from_bitField0_ & 0x00000040) != 0)) {
1060         result.preview_ = preview_;
1061         to_bitField0_ |= 0x00000040;
1062       }
1063       if (((from_bitField0_ & 0x00000080) != 0)) {
1064         result.priority_ = priority_;
1065         to_bitField0_ |= 0x00000080;
1066       }
1067       if (((from_bitField0_ & 0x00000100) != 0)) {
1068         result.rateLimitOptions_ =
1069             rateLimitOptionsBuilder_ == null ? rateLimitOptions_ : rateLimitOptionsBuilder_.build();
1070         to_bitField0_ |= 0x00000100;
1071       }
1072       if (((from_bitField0_ & 0x00000200) != 0)) {
1073         result.redirectOptions_ =
1074             redirectOptionsBuilder_ == null ? redirectOptions_ : redirectOptionsBuilder_.build();
1075         to_bitField0_ |= 0x00000200;
1076       }
1077       result.bitField0_ |= to_bitField0_;
1078     }
1079 
1080     @java.lang.Override
clone()1081     public Builder clone() {
1082       return super.clone();
1083     }
1084 
1085     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1086     public Builder setField(
1087         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
1088       return super.setField(field, value);
1089     }
1090 
1091     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1092     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
1093       return super.clearField(field);
1094     }
1095 
1096     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1097     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
1098       return super.clearOneof(oneof);
1099     }
1100 
1101     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1102     public Builder setRepeatedField(
1103         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
1104       return super.setRepeatedField(field, index, value);
1105     }
1106 
1107     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1108     public Builder addRepeatedField(
1109         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
1110       return super.addRepeatedField(field, value);
1111     }
1112 
1113     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)1114     public Builder mergeFrom(com.google.protobuf.Message other) {
1115       if (other instanceof com.google.cloud.compute.v1.SecurityPolicyRule) {
1116         return mergeFrom((com.google.cloud.compute.v1.SecurityPolicyRule) other);
1117       } else {
1118         super.mergeFrom(other);
1119         return this;
1120       }
1121     }
1122 
mergeFrom(com.google.cloud.compute.v1.SecurityPolicyRule other)1123     public Builder mergeFrom(com.google.cloud.compute.v1.SecurityPolicyRule other) {
1124       if (other == com.google.cloud.compute.v1.SecurityPolicyRule.getDefaultInstance()) return this;
1125       if (other.hasAction()) {
1126         action_ = other.action_;
1127         bitField0_ |= 0x00000001;
1128         onChanged();
1129       }
1130       if (other.hasDescription()) {
1131         description_ = other.description_;
1132         bitField0_ |= 0x00000002;
1133         onChanged();
1134       }
1135       if (other.hasHeaderAction()) {
1136         mergeHeaderAction(other.getHeaderAction());
1137       }
1138       if (other.hasKind()) {
1139         kind_ = other.kind_;
1140         bitField0_ |= 0x00000008;
1141         onChanged();
1142       }
1143       if (other.hasMatch()) {
1144         mergeMatch(other.getMatch());
1145       }
1146       if (other.hasPreconfiguredWafConfig()) {
1147         mergePreconfiguredWafConfig(other.getPreconfiguredWafConfig());
1148       }
1149       if (other.hasPreview()) {
1150         setPreview(other.getPreview());
1151       }
1152       if (other.hasPriority()) {
1153         setPriority(other.getPriority());
1154       }
1155       if (other.hasRateLimitOptions()) {
1156         mergeRateLimitOptions(other.getRateLimitOptions());
1157       }
1158       if (other.hasRedirectOptions()) {
1159         mergeRedirectOptions(other.getRedirectOptions());
1160       }
1161       this.mergeUnknownFields(other.getUnknownFields());
1162       onChanged();
1163       return this;
1164     }
1165 
1166     @java.lang.Override
isInitialized()1167     public final boolean isInitialized() {
1168       return true;
1169     }
1170 
1171     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1172     public Builder mergeFrom(
1173         com.google.protobuf.CodedInputStream input,
1174         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1175         throws java.io.IOException {
1176       if (extensionRegistry == null) {
1177         throw new java.lang.NullPointerException();
1178       }
1179       try {
1180         boolean done = false;
1181         while (!done) {
1182           int tag = input.readTag();
1183           switch (tag) {
1184             case 0:
1185               done = true;
1186               break;
1187             case 26336418:
1188               {
1189                 kind_ = input.readStringRequireUtf8();
1190                 bitField0_ |= 0x00000008;
1191                 break;
1192               } // case 26336418
1193             case 540354522:
1194               {
1195                 input.readMessage(
1196                     getRateLimitOptionsFieldBuilder().getBuilder(), extensionRegistry);
1197                 bitField0_ |= 0x00000100;
1198                 break;
1199               } // case 540354522
1200             case 829345322:
1201               {
1202                 input.readMessage(getMatchFieldBuilder().getBuilder(), extensionRegistry);
1203                 bitField0_ |= 0x00000010;
1204                 break;
1205               } // case 829345322
1206             case 942440218:
1207               {
1208                 input.readMessage(
1209                     getPreconfiguredWafConfigFieldBuilder().getBuilder(), extensionRegistry);
1210                 bitField0_ |= 0x00000020;
1211                 break;
1212               } // case 942440218
1213             case 1306282458:
1214               {
1215                 input.readMessage(getRedirectOptionsFieldBuilder().getBuilder(), extensionRegistry);
1216                 bitField0_ |= 0x00000200;
1217                 break;
1218               } // case 1306282458
1219             case 1501295026:
1220               {
1221                 action_ = input.readStringRequireUtf8();
1222                 bitField0_ |= 0x00000001;
1223                 break;
1224               } // case 1501295026
1225             case 1749491264:
1226               {
1227                 preview_ = input.readBool();
1228                 bitField0_ |= 0x00000040;
1229                 break;
1230               } // case 1749491264
1231             case -1670348478:
1232               {
1233                 input.readMessage(getHeaderActionFieldBuilder().getBuilder(), extensionRegistry);
1234                 bitField0_ |= 0x00000004;
1235                 break;
1236               } // case -1670348478
1237             case -911466526:
1238               {
1239                 description_ = input.readStringRequireUtf8();
1240                 bitField0_ |= 0x00000002;
1241                 break;
1242               } // case -911466526
1243             case -733754080:
1244               {
1245                 priority_ = input.readInt32();
1246                 bitField0_ |= 0x00000080;
1247                 break;
1248               } // case -733754080
1249             default:
1250               {
1251                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
1252                   done = true; // was an endgroup tag
1253                 }
1254                 break;
1255               } // default:
1256           } // switch (tag)
1257         } // while (!done)
1258       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1259         throw e.unwrapIOException();
1260       } finally {
1261         onChanged();
1262       } // finally
1263       return this;
1264     }
1265 
1266     private int bitField0_;
1267 
1268     private java.lang.Object action_ = "";
1269     /**
1270      *
1271      *
1272      * <pre>
1273      * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for `STATUS` are 403, 404, and 502. - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this.
1274      * </pre>
1275      *
1276      * <code>optional string action = 187661878;</code>
1277      *
1278      * @return Whether the action field is set.
1279      */
hasAction()1280     public boolean hasAction() {
1281       return ((bitField0_ & 0x00000001) != 0);
1282     }
1283     /**
1284      *
1285      *
1286      * <pre>
1287      * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for `STATUS` are 403, 404, and 502. - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this.
1288      * </pre>
1289      *
1290      * <code>optional string action = 187661878;</code>
1291      *
1292      * @return The action.
1293      */
getAction()1294     public java.lang.String getAction() {
1295       java.lang.Object ref = action_;
1296       if (!(ref instanceof java.lang.String)) {
1297         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1298         java.lang.String s = bs.toStringUtf8();
1299         action_ = s;
1300         return s;
1301       } else {
1302         return (java.lang.String) ref;
1303       }
1304     }
1305     /**
1306      *
1307      *
1308      * <pre>
1309      * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for `STATUS` are 403, 404, and 502. - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this.
1310      * </pre>
1311      *
1312      * <code>optional string action = 187661878;</code>
1313      *
1314      * @return The bytes for action.
1315      */
getActionBytes()1316     public com.google.protobuf.ByteString getActionBytes() {
1317       java.lang.Object ref = action_;
1318       if (ref instanceof String) {
1319         com.google.protobuf.ByteString b =
1320             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1321         action_ = b;
1322         return b;
1323       } else {
1324         return (com.google.protobuf.ByteString) ref;
1325       }
1326     }
1327     /**
1328      *
1329      *
1330      * <pre>
1331      * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for `STATUS` are 403, 404, and 502. - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this.
1332      * </pre>
1333      *
1334      * <code>optional string action = 187661878;</code>
1335      *
1336      * @param value The action to set.
1337      * @return This builder for chaining.
1338      */
setAction(java.lang.String value)1339     public Builder setAction(java.lang.String value) {
1340       if (value == null) {
1341         throw new NullPointerException();
1342       }
1343       action_ = value;
1344       bitField0_ |= 0x00000001;
1345       onChanged();
1346       return this;
1347     }
1348     /**
1349      *
1350      *
1351      * <pre>
1352      * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for `STATUS` are 403, 404, and 502. - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this.
1353      * </pre>
1354      *
1355      * <code>optional string action = 187661878;</code>
1356      *
1357      * @return This builder for chaining.
1358      */
clearAction()1359     public Builder clearAction() {
1360       action_ = getDefaultInstance().getAction();
1361       bitField0_ = (bitField0_ & ~0x00000001);
1362       onChanged();
1363       return this;
1364     }
1365     /**
1366      *
1367      *
1368      * <pre>
1369      * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for `STATUS` are 403, 404, and 502. - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this.
1370      * </pre>
1371      *
1372      * <code>optional string action = 187661878;</code>
1373      *
1374      * @param value The bytes for action to set.
1375      * @return This builder for chaining.
1376      */
setActionBytes(com.google.protobuf.ByteString value)1377     public Builder setActionBytes(com.google.protobuf.ByteString value) {
1378       if (value == null) {
1379         throw new NullPointerException();
1380       }
1381       checkByteStringIsUtf8(value);
1382       action_ = value;
1383       bitField0_ |= 0x00000001;
1384       onChanged();
1385       return this;
1386     }
1387 
1388     private java.lang.Object description_ = "";
1389     /**
1390      *
1391      *
1392      * <pre>
1393      * An optional description of this resource. Provide this property when you create the resource.
1394      * </pre>
1395      *
1396      * <code>optional string description = 422937596;</code>
1397      *
1398      * @return Whether the description field is set.
1399      */
hasDescription()1400     public boolean hasDescription() {
1401       return ((bitField0_ & 0x00000002) != 0);
1402     }
1403     /**
1404      *
1405      *
1406      * <pre>
1407      * An optional description of this resource. Provide this property when you create the resource.
1408      * </pre>
1409      *
1410      * <code>optional string description = 422937596;</code>
1411      *
1412      * @return The description.
1413      */
getDescription()1414     public java.lang.String getDescription() {
1415       java.lang.Object ref = description_;
1416       if (!(ref instanceof java.lang.String)) {
1417         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1418         java.lang.String s = bs.toStringUtf8();
1419         description_ = s;
1420         return s;
1421       } else {
1422         return (java.lang.String) ref;
1423       }
1424     }
1425     /**
1426      *
1427      *
1428      * <pre>
1429      * An optional description of this resource. Provide this property when you create the resource.
1430      * </pre>
1431      *
1432      * <code>optional string description = 422937596;</code>
1433      *
1434      * @return The bytes for description.
1435      */
getDescriptionBytes()1436     public com.google.protobuf.ByteString getDescriptionBytes() {
1437       java.lang.Object ref = description_;
1438       if (ref instanceof String) {
1439         com.google.protobuf.ByteString b =
1440             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1441         description_ = b;
1442         return b;
1443       } else {
1444         return (com.google.protobuf.ByteString) ref;
1445       }
1446     }
1447     /**
1448      *
1449      *
1450      * <pre>
1451      * An optional description of this resource. Provide this property when you create the resource.
1452      * </pre>
1453      *
1454      * <code>optional string description = 422937596;</code>
1455      *
1456      * @param value The description to set.
1457      * @return This builder for chaining.
1458      */
setDescription(java.lang.String value)1459     public Builder setDescription(java.lang.String value) {
1460       if (value == null) {
1461         throw new NullPointerException();
1462       }
1463       description_ = value;
1464       bitField0_ |= 0x00000002;
1465       onChanged();
1466       return this;
1467     }
1468     /**
1469      *
1470      *
1471      * <pre>
1472      * An optional description of this resource. Provide this property when you create the resource.
1473      * </pre>
1474      *
1475      * <code>optional string description = 422937596;</code>
1476      *
1477      * @return This builder for chaining.
1478      */
clearDescription()1479     public Builder clearDescription() {
1480       description_ = getDefaultInstance().getDescription();
1481       bitField0_ = (bitField0_ & ~0x00000002);
1482       onChanged();
1483       return this;
1484     }
1485     /**
1486      *
1487      *
1488      * <pre>
1489      * An optional description of this resource. Provide this property when you create the resource.
1490      * </pre>
1491      *
1492      * <code>optional string description = 422937596;</code>
1493      *
1494      * @param value The bytes for description to set.
1495      * @return This builder for chaining.
1496      */
setDescriptionBytes(com.google.protobuf.ByteString value)1497     public Builder setDescriptionBytes(com.google.protobuf.ByteString value) {
1498       if (value == null) {
1499         throw new NullPointerException();
1500       }
1501       checkByteStringIsUtf8(value);
1502       description_ = value;
1503       bitField0_ |= 0x00000002;
1504       onChanged();
1505       return this;
1506     }
1507 
1508     private com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction headerAction_;
1509     private com.google.protobuf.SingleFieldBuilderV3<
1510             com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction,
1511             com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction.Builder,
1512             com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderActionOrBuilder>
1513         headerActionBuilder_;
1514     /**
1515      *
1516      *
1517      * <pre>
1518      * Optional, additional actions that are performed on headers.
1519      * </pre>
1520      *
1521      * <code>
1522      * optional .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction header_action = 328077352;
1523      * </code>
1524      *
1525      * @return Whether the headerAction field is set.
1526      */
hasHeaderAction()1527     public boolean hasHeaderAction() {
1528       return ((bitField0_ & 0x00000004) != 0);
1529     }
1530     /**
1531      *
1532      *
1533      * <pre>
1534      * Optional, additional actions that are performed on headers.
1535      * </pre>
1536      *
1537      * <code>
1538      * optional .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction header_action = 328077352;
1539      * </code>
1540      *
1541      * @return The headerAction.
1542      */
getHeaderAction()1543     public com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction getHeaderAction() {
1544       if (headerActionBuilder_ == null) {
1545         return headerAction_ == null
1546             ? com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction.getDefaultInstance()
1547             : headerAction_;
1548       } else {
1549         return headerActionBuilder_.getMessage();
1550       }
1551     }
1552     /**
1553      *
1554      *
1555      * <pre>
1556      * Optional, additional actions that are performed on headers.
1557      * </pre>
1558      *
1559      * <code>
1560      * optional .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction header_action = 328077352;
1561      * </code>
1562      */
setHeaderAction( com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction value)1563     public Builder setHeaderAction(
1564         com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction value) {
1565       if (headerActionBuilder_ == null) {
1566         if (value == null) {
1567           throw new NullPointerException();
1568         }
1569         headerAction_ = value;
1570       } else {
1571         headerActionBuilder_.setMessage(value);
1572       }
1573       bitField0_ |= 0x00000004;
1574       onChanged();
1575       return this;
1576     }
1577     /**
1578      *
1579      *
1580      * <pre>
1581      * Optional, additional actions that are performed on headers.
1582      * </pre>
1583      *
1584      * <code>
1585      * optional .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction header_action = 328077352;
1586      * </code>
1587      */
setHeaderAction( com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction.Builder builderForValue)1588     public Builder setHeaderAction(
1589         com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction.Builder builderForValue) {
1590       if (headerActionBuilder_ == null) {
1591         headerAction_ = builderForValue.build();
1592       } else {
1593         headerActionBuilder_.setMessage(builderForValue.build());
1594       }
1595       bitField0_ |= 0x00000004;
1596       onChanged();
1597       return this;
1598     }
1599     /**
1600      *
1601      *
1602      * <pre>
1603      * Optional, additional actions that are performed on headers.
1604      * </pre>
1605      *
1606      * <code>
1607      * optional .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction header_action = 328077352;
1608      * </code>
1609      */
mergeHeaderAction( com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction value)1610     public Builder mergeHeaderAction(
1611         com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction value) {
1612       if (headerActionBuilder_ == null) {
1613         if (((bitField0_ & 0x00000004) != 0)
1614             && headerAction_ != null
1615             && headerAction_
1616                 != com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction
1617                     .getDefaultInstance()) {
1618           getHeaderActionBuilder().mergeFrom(value);
1619         } else {
1620           headerAction_ = value;
1621         }
1622       } else {
1623         headerActionBuilder_.mergeFrom(value);
1624       }
1625       bitField0_ |= 0x00000004;
1626       onChanged();
1627       return this;
1628     }
1629     /**
1630      *
1631      *
1632      * <pre>
1633      * Optional, additional actions that are performed on headers.
1634      * </pre>
1635      *
1636      * <code>
1637      * optional .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction header_action = 328077352;
1638      * </code>
1639      */
clearHeaderAction()1640     public Builder clearHeaderAction() {
1641       bitField0_ = (bitField0_ & ~0x00000004);
1642       headerAction_ = null;
1643       if (headerActionBuilder_ != null) {
1644         headerActionBuilder_.dispose();
1645         headerActionBuilder_ = null;
1646       }
1647       onChanged();
1648       return this;
1649     }
1650     /**
1651      *
1652      *
1653      * <pre>
1654      * Optional, additional actions that are performed on headers.
1655      * </pre>
1656      *
1657      * <code>
1658      * optional .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction header_action = 328077352;
1659      * </code>
1660      */
1661     public com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction.Builder
getHeaderActionBuilder()1662         getHeaderActionBuilder() {
1663       bitField0_ |= 0x00000004;
1664       onChanged();
1665       return getHeaderActionFieldBuilder().getBuilder();
1666     }
1667     /**
1668      *
1669      *
1670      * <pre>
1671      * Optional, additional actions that are performed on headers.
1672      * </pre>
1673      *
1674      * <code>
1675      * optional .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction header_action = 328077352;
1676      * </code>
1677      */
1678     public com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderActionOrBuilder
getHeaderActionOrBuilder()1679         getHeaderActionOrBuilder() {
1680       if (headerActionBuilder_ != null) {
1681         return headerActionBuilder_.getMessageOrBuilder();
1682       } else {
1683         return headerAction_ == null
1684             ? com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction.getDefaultInstance()
1685             : headerAction_;
1686       }
1687     }
1688     /**
1689      *
1690      *
1691      * <pre>
1692      * Optional, additional actions that are performed on headers.
1693      * </pre>
1694      *
1695      * <code>
1696      * optional .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction header_action = 328077352;
1697      * </code>
1698      */
1699     private com.google.protobuf.SingleFieldBuilderV3<
1700             com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction,
1701             com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction.Builder,
1702             com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderActionOrBuilder>
getHeaderActionFieldBuilder()1703         getHeaderActionFieldBuilder() {
1704       if (headerActionBuilder_ == null) {
1705         headerActionBuilder_ =
1706             new com.google.protobuf.SingleFieldBuilderV3<
1707                 com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction,
1708                 com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction.Builder,
1709                 com.google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderActionOrBuilder>(
1710                 getHeaderAction(), getParentForChildren(), isClean());
1711         headerAction_ = null;
1712       }
1713       return headerActionBuilder_;
1714     }
1715 
1716     private java.lang.Object kind_ = "";
1717     /**
1718      *
1719      *
1720      * <pre>
1721      * [Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules
1722      * </pre>
1723      *
1724      * <code>optional string kind = 3292052;</code>
1725      *
1726      * @return Whether the kind field is set.
1727      */
hasKind()1728     public boolean hasKind() {
1729       return ((bitField0_ & 0x00000008) != 0);
1730     }
1731     /**
1732      *
1733      *
1734      * <pre>
1735      * [Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules
1736      * </pre>
1737      *
1738      * <code>optional string kind = 3292052;</code>
1739      *
1740      * @return The kind.
1741      */
getKind()1742     public java.lang.String getKind() {
1743       java.lang.Object ref = kind_;
1744       if (!(ref instanceof java.lang.String)) {
1745         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1746         java.lang.String s = bs.toStringUtf8();
1747         kind_ = s;
1748         return s;
1749       } else {
1750         return (java.lang.String) ref;
1751       }
1752     }
1753     /**
1754      *
1755      *
1756      * <pre>
1757      * [Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules
1758      * </pre>
1759      *
1760      * <code>optional string kind = 3292052;</code>
1761      *
1762      * @return The bytes for kind.
1763      */
getKindBytes()1764     public com.google.protobuf.ByteString getKindBytes() {
1765       java.lang.Object ref = kind_;
1766       if (ref instanceof String) {
1767         com.google.protobuf.ByteString b =
1768             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1769         kind_ = b;
1770         return b;
1771       } else {
1772         return (com.google.protobuf.ByteString) ref;
1773       }
1774     }
1775     /**
1776      *
1777      *
1778      * <pre>
1779      * [Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules
1780      * </pre>
1781      *
1782      * <code>optional string kind = 3292052;</code>
1783      *
1784      * @param value The kind to set.
1785      * @return This builder for chaining.
1786      */
setKind(java.lang.String value)1787     public Builder setKind(java.lang.String value) {
1788       if (value == null) {
1789         throw new NullPointerException();
1790       }
1791       kind_ = value;
1792       bitField0_ |= 0x00000008;
1793       onChanged();
1794       return this;
1795     }
1796     /**
1797      *
1798      *
1799      * <pre>
1800      * [Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules
1801      * </pre>
1802      *
1803      * <code>optional string kind = 3292052;</code>
1804      *
1805      * @return This builder for chaining.
1806      */
clearKind()1807     public Builder clearKind() {
1808       kind_ = getDefaultInstance().getKind();
1809       bitField0_ = (bitField0_ & ~0x00000008);
1810       onChanged();
1811       return this;
1812     }
1813     /**
1814      *
1815      *
1816      * <pre>
1817      * [Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules
1818      * </pre>
1819      *
1820      * <code>optional string kind = 3292052;</code>
1821      *
1822      * @param value The bytes for kind to set.
1823      * @return This builder for chaining.
1824      */
setKindBytes(com.google.protobuf.ByteString value)1825     public Builder setKindBytes(com.google.protobuf.ByteString value) {
1826       if (value == null) {
1827         throw new NullPointerException();
1828       }
1829       checkByteStringIsUtf8(value);
1830       kind_ = value;
1831       bitField0_ |= 0x00000008;
1832       onChanged();
1833       return this;
1834     }
1835 
1836     private com.google.cloud.compute.v1.SecurityPolicyRuleMatcher match_;
1837     private com.google.protobuf.SingleFieldBuilderV3<
1838             com.google.cloud.compute.v1.SecurityPolicyRuleMatcher,
1839             com.google.cloud.compute.v1.SecurityPolicyRuleMatcher.Builder,
1840             com.google.cloud.compute.v1.SecurityPolicyRuleMatcherOrBuilder>
1841         matchBuilder_;
1842     /**
1843      *
1844      *
1845      * <pre>
1846      * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
1847      * </pre>
1848      *
1849      * <code>optional .google.cloud.compute.v1.SecurityPolicyRuleMatcher match = 103668165;</code>
1850      *
1851      * @return Whether the match field is set.
1852      */
hasMatch()1853     public boolean hasMatch() {
1854       return ((bitField0_ & 0x00000010) != 0);
1855     }
1856     /**
1857      *
1858      *
1859      * <pre>
1860      * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
1861      * </pre>
1862      *
1863      * <code>optional .google.cloud.compute.v1.SecurityPolicyRuleMatcher match = 103668165;</code>
1864      *
1865      * @return The match.
1866      */
getMatch()1867     public com.google.cloud.compute.v1.SecurityPolicyRuleMatcher getMatch() {
1868       if (matchBuilder_ == null) {
1869         return match_ == null
1870             ? com.google.cloud.compute.v1.SecurityPolicyRuleMatcher.getDefaultInstance()
1871             : match_;
1872       } else {
1873         return matchBuilder_.getMessage();
1874       }
1875     }
1876     /**
1877      *
1878      *
1879      * <pre>
1880      * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
1881      * </pre>
1882      *
1883      * <code>optional .google.cloud.compute.v1.SecurityPolicyRuleMatcher match = 103668165;</code>
1884      */
setMatch(com.google.cloud.compute.v1.SecurityPolicyRuleMatcher value)1885     public Builder setMatch(com.google.cloud.compute.v1.SecurityPolicyRuleMatcher value) {
1886       if (matchBuilder_ == null) {
1887         if (value == null) {
1888           throw new NullPointerException();
1889         }
1890         match_ = value;
1891       } else {
1892         matchBuilder_.setMessage(value);
1893       }
1894       bitField0_ |= 0x00000010;
1895       onChanged();
1896       return this;
1897     }
1898     /**
1899      *
1900      *
1901      * <pre>
1902      * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
1903      * </pre>
1904      *
1905      * <code>optional .google.cloud.compute.v1.SecurityPolicyRuleMatcher match = 103668165;</code>
1906      */
setMatch( com.google.cloud.compute.v1.SecurityPolicyRuleMatcher.Builder builderForValue)1907     public Builder setMatch(
1908         com.google.cloud.compute.v1.SecurityPolicyRuleMatcher.Builder builderForValue) {
1909       if (matchBuilder_ == null) {
1910         match_ = builderForValue.build();
1911       } else {
1912         matchBuilder_.setMessage(builderForValue.build());
1913       }
1914       bitField0_ |= 0x00000010;
1915       onChanged();
1916       return this;
1917     }
1918     /**
1919      *
1920      *
1921      * <pre>
1922      * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
1923      * </pre>
1924      *
1925      * <code>optional .google.cloud.compute.v1.SecurityPolicyRuleMatcher match = 103668165;</code>
1926      */
mergeMatch(com.google.cloud.compute.v1.SecurityPolicyRuleMatcher value)1927     public Builder mergeMatch(com.google.cloud.compute.v1.SecurityPolicyRuleMatcher value) {
1928       if (matchBuilder_ == null) {
1929         if (((bitField0_ & 0x00000010) != 0)
1930             && match_ != null
1931             && match_
1932                 != com.google.cloud.compute.v1.SecurityPolicyRuleMatcher.getDefaultInstance()) {
1933           getMatchBuilder().mergeFrom(value);
1934         } else {
1935           match_ = value;
1936         }
1937       } else {
1938         matchBuilder_.mergeFrom(value);
1939       }
1940       bitField0_ |= 0x00000010;
1941       onChanged();
1942       return this;
1943     }
1944     /**
1945      *
1946      *
1947      * <pre>
1948      * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
1949      * </pre>
1950      *
1951      * <code>optional .google.cloud.compute.v1.SecurityPolicyRuleMatcher match = 103668165;</code>
1952      */
clearMatch()1953     public Builder clearMatch() {
1954       bitField0_ = (bitField0_ & ~0x00000010);
1955       match_ = null;
1956       if (matchBuilder_ != null) {
1957         matchBuilder_.dispose();
1958         matchBuilder_ = null;
1959       }
1960       onChanged();
1961       return this;
1962     }
1963     /**
1964      *
1965      *
1966      * <pre>
1967      * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
1968      * </pre>
1969      *
1970      * <code>optional .google.cloud.compute.v1.SecurityPolicyRuleMatcher match = 103668165;</code>
1971      */
getMatchBuilder()1972     public com.google.cloud.compute.v1.SecurityPolicyRuleMatcher.Builder getMatchBuilder() {
1973       bitField0_ |= 0x00000010;
1974       onChanged();
1975       return getMatchFieldBuilder().getBuilder();
1976     }
1977     /**
1978      *
1979      *
1980      * <pre>
1981      * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
1982      * </pre>
1983      *
1984      * <code>optional .google.cloud.compute.v1.SecurityPolicyRuleMatcher match = 103668165;</code>
1985      */
getMatchOrBuilder()1986     public com.google.cloud.compute.v1.SecurityPolicyRuleMatcherOrBuilder getMatchOrBuilder() {
1987       if (matchBuilder_ != null) {
1988         return matchBuilder_.getMessageOrBuilder();
1989       } else {
1990         return match_ == null
1991             ? com.google.cloud.compute.v1.SecurityPolicyRuleMatcher.getDefaultInstance()
1992             : match_;
1993       }
1994     }
1995     /**
1996      *
1997      *
1998      * <pre>
1999      * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
2000      * </pre>
2001      *
2002      * <code>optional .google.cloud.compute.v1.SecurityPolicyRuleMatcher match = 103668165;</code>
2003      */
2004     private com.google.protobuf.SingleFieldBuilderV3<
2005             com.google.cloud.compute.v1.SecurityPolicyRuleMatcher,
2006             com.google.cloud.compute.v1.SecurityPolicyRuleMatcher.Builder,
2007             com.google.cloud.compute.v1.SecurityPolicyRuleMatcherOrBuilder>
getMatchFieldBuilder()2008         getMatchFieldBuilder() {
2009       if (matchBuilder_ == null) {
2010         matchBuilder_ =
2011             new com.google.protobuf.SingleFieldBuilderV3<
2012                 com.google.cloud.compute.v1.SecurityPolicyRuleMatcher,
2013                 com.google.cloud.compute.v1.SecurityPolicyRuleMatcher.Builder,
2014                 com.google.cloud.compute.v1.SecurityPolicyRuleMatcherOrBuilder>(
2015                 getMatch(), getParentForChildren(), isClean());
2016         match_ = null;
2017       }
2018       return matchBuilder_;
2019     }
2020 
2021     private com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig
2022         preconfiguredWafConfig_;
2023     private com.google.protobuf.SingleFieldBuilderV3<
2024             com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig,
2025             com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig.Builder,
2026             com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigOrBuilder>
2027         preconfiguredWafConfigBuilder_;
2028     /**
2029      *
2030      *
2031      * <pre>
2032      * Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect.
2033      * </pre>
2034      *
2035      * <code>
2036      * optional .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig preconfigured_waf_config = 117805027;
2037      * </code>
2038      *
2039      * @return Whether the preconfiguredWafConfig field is set.
2040      */
hasPreconfiguredWafConfig()2041     public boolean hasPreconfiguredWafConfig() {
2042       return ((bitField0_ & 0x00000020) != 0);
2043     }
2044     /**
2045      *
2046      *
2047      * <pre>
2048      * Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect.
2049      * </pre>
2050      *
2051      * <code>
2052      * optional .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig preconfigured_waf_config = 117805027;
2053      * </code>
2054      *
2055      * @return The preconfiguredWafConfig.
2056      */
2057     public com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig
getPreconfiguredWafConfig()2058         getPreconfiguredWafConfig() {
2059       if (preconfiguredWafConfigBuilder_ == null) {
2060         return preconfiguredWafConfig_ == null
2061             ? com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig
2062                 .getDefaultInstance()
2063             : preconfiguredWafConfig_;
2064       } else {
2065         return preconfiguredWafConfigBuilder_.getMessage();
2066       }
2067     }
2068     /**
2069      *
2070      *
2071      * <pre>
2072      * Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect.
2073      * </pre>
2074      *
2075      * <code>
2076      * optional .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig preconfigured_waf_config = 117805027;
2077      * </code>
2078      */
setPreconfiguredWafConfig( com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig value)2079     public Builder setPreconfiguredWafConfig(
2080         com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig value) {
2081       if (preconfiguredWafConfigBuilder_ == null) {
2082         if (value == null) {
2083           throw new NullPointerException();
2084         }
2085         preconfiguredWafConfig_ = value;
2086       } else {
2087         preconfiguredWafConfigBuilder_.setMessage(value);
2088       }
2089       bitField0_ |= 0x00000020;
2090       onChanged();
2091       return this;
2092     }
2093     /**
2094      *
2095      *
2096      * <pre>
2097      * Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect.
2098      * </pre>
2099      *
2100      * <code>
2101      * optional .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig preconfigured_waf_config = 117805027;
2102      * </code>
2103      */
setPreconfiguredWafConfig( com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig.Builder builderForValue)2104     public Builder setPreconfiguredWafConfig(
2105         com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig.Builder
2106             builderForValue) {
2107       if (preconfiguredWafConfigBuilder_ == null) {
2108         preconfiguredWafConfig_ = builderForValue.build();
2109       } else {
2110         preconfiguredWafConfigBuilder_.setMessage(builderForValue.build());
2111       }
2112       bitField0_ |= 0x00000020;
2113       onChanged();
2114       return this;
2115     }
2116     /**
2117      *
2118      *
2119      * <pre>
2120      * Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect.
2121      * </pre>
2122      *
2123      * <code>
2124      * optional .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig preconfigured_waf_config = 117805027;
2125      * </code>
2126      */
mergePreconfiguredWafConfig( com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig value)2127     public Builder mergePreconfiguredWafConfig(
2128         com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig value) {
2129       if (preconfiguredWafConfigBuilder_ == null) {
2130         if (((bitField0_ & 0x00000020) != 0)
2131             && preconfiguredWafConfig_ != null
2132             && preconfiguredWafConfig_
2133                 != com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig
2134                     .getDefaultInstance()) {
2135           getPreconfiguredWafConfigBuilder().mergeFrom(value);
2136         } else {
2137           preconfiguredWafConfig_ = value;
2138         }
2139       } else {
2140         preconfiguredWafConfigBuilder_.mergeFrom(value);
2141       }
2142       bitField0_ |= 0x00000020;
2143       onChanged();
2144       return this;
2145     }
2146     /**
2147      *
2148      *
2149      * <pre>
2150      * Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect.
2151      * </pre>
2152      *
2153      * <code>
2154      * optional .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig preconfigured_waf_config = 117805027;
2155      * </code>
2156      */
clearPreconfiguredWafConfig()2157     public Builder clearPreconfiguredWafConfig() {
2158       bitField0_ = (bitField0_ & ~0x00000020);
2159       preconfiguredWafConfig_ = null;
2160       if (preconfiguredWafConfigBuilder_ != null) {
2161         preconfiguredWafConfigBuilder_.dispose();
2162         preconfiguredWafConfigBuilder_ = null;
2163       }
2164       onChanged();
2165       return this;
2166     }
2167     /**
2168      *
2169      *
2170      * <pre>
2171      * Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect.
2172      * </pre>
2173      *
2174      * <code>
2175      * optional .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig preconfigured_waf_config = 117805027;
2176      * </code>
2177      */
2178     public com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig.Builder
getPreconfiguredWafConfigBuilder()2179         getPreconfiguredWafConfigBuilder() {
2180       bitField0_ |= 0x00000020;
2181       onChanged();
2182       return getPreconfiguredWafConfigFieldBuilder().getBuilder();
2183     }
2184     /**
2185      *
2186      *
2187      * <pre>
2188      * Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect.
2189      * </pre>
2190      *
2191      * <code>
2192      * optional .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig preconfigured_waf_config = 117805027;
2193      * </code>
2194      */
2195     public com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigOrBuilder
getPreconfiguredWafConfigOrBuilder()2196         getPreconfiguredWafConfigOrBuilder() {
2197       if (preconfiguredWafConfigBuilder_ != null) {
2198         return preconfiguredWafConfigBuilder_.getMessageOrBuilder();
2199       } else {
2200         return preconfiguredWafConfig_ == null
2201             ? com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig
2202                 .getDefaultInstance()
2203             : preconfiguredWafConfig_;
2204       }
2205     }
2206     /**
2207      *
2208      *
2209      * <pre>
2210      * Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect.
2211      * </pre>
2212      *
2213      * <code>
2214      * optional .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig preconfigured_waf_config = 117805027;
2215      * </code>
2216      */
2217     private com.google.protobuf.SingleFieldBuilderV3<
2218             com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig,
2219             com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig.Builder,
2220             com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigOrBuilder>
getPreconfiguredWafConfigFieldBuilder()2221         getPreconfiguredWafConfigFieldBuilder() {
2222       if (preconfiguredWafConfigBuilder_ == null) {
2223         preconfiguredWafConfigBuilder_ =
2224             new com.google.protobuf.SingleFieldBuilderV3<
2225                 com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig,
2226                 com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig.Builder,
2227                 com.google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigOrBuilder>(
2228                 getPreconfiguredWafConfig(), getParentForChildren(), isClean());
2229         preconfiguredWafConfig_ = null;
2230       }
2231       return preconfiguredWafConfigBuilder_;
2232     }
2233 
2234     private boolean preview_;
2235     /**
2236      *
2237      *
2238      * <pre>
2239      * If set to true, the specified action is not enforced.
2240      * </pre>
2241      *
2242      * <code>optional bool preview = 218686408;</code>
2243      *
2244      * @return Whether the preview field is set.
2245      */
2246     @java.lang.Override
hasPreview()2247     public boolean hasPreview() {
2248       return ((bitField0_ & 0x00000040) != 0);
2249     }
2250     /**
2251      *
2252      *
2253      * <pre>
2254      * If set to true, the specified action is not enforced.
2255      * </pre>
2256      *
2257      * <code>optional bool preview = 218686408;</code>
2258      *
2259      * @return The preview.
2260      */
2261     @java.lang.Override
getPreview()2262     public boolean getPreview() {
2263       return preview_;
2264     }
2265     /**
2266      *
2267      *
2268      * <pre>
2269      * If set to true, the specified action is not enforced.
2270      * </pre>
2271      *
2272      * <code>optional bool preview = 218686408;</code>
2273      *
2274      * @param value The preview to set.
2275      * @return This builder for chaining.
2276      */
setPreview(boolean value)2277     public Builder setPreview(boolean value) {
2278 
2279       preview_ = value;
2280       bitField0_ |= 0x00000040;
2281       onChanged();
2282       return this;
2283     }
2284     /**
2285      *
2286      *
2287      * <pre>
2288      * If set to true, the specified action is not enforced.
2289      * </pre>
2290      *
2291      * <code>optional bool preview = 218686408;</code>
2292      *
2293      * @return This builder for chaining.
2294      */
clearPreview()2295     public Builder clearPreview() {
2296       bitField0_ = (bitField0_ & ~0x00000040);
2297       preview_ = false;
2298       onChanged();
2299       return this;
2300     }
2301 
2302     private int priority_;
2303     /**
2304      *
2305      *
2306      * <pre>
2307      * An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
2308      * </pre>
2309      *
2310      * <code>optional int32 priority = 445151652;</code>
2311      *
2312      * @return Whether the priority field is set.
2313      */
2314     @java.lang.Override
hasPriority()2315     public boolean hasPriority() {
2316       return ((bitField0_ & 0x00000080) != 0);
2317     }
2318     /**
2319      *
2320      *
2321      * <pre>
2322      * An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
2323      * </pre>
2324      *
2325      * <code>optional int32 priority = 445151652;</code>
2326      *
2327      * @return The priority.
2328      */
2329     @java.lang.Override
getPriority()2330     public int getPriority() {
2331       return priority_;
2332     }
2333     /**
2334      *
2335      *
2336      * <pre>
2337      * An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
2338      * </pre>
2339      *
2340      * <code>optional int32 priority = 445151652;</code>
2341      *
2342      * @param value The priority to set.
2343      * @return This builder for chaining.
2344      */
setPriority(int value)2345     public Builder setPriority(int value) {
2346 
2347       priority_ = value;
2348       bitField0_ |= 0x00000080;
2349       onChanged();
2350       return this;
2351     }
2352     /**
2353      *
2354      *
2355      * <pre>
2356      * An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
2357      * </pre>
2358      *
2359      * <code>optional int32 priority = 445151652;</code>
2360      *
2361      * @return This builder for chaining.
2362      */
clearPriority()2363     public Builder clearPriority() {
2364       bitField0_ = (bitField0_ & ~0x00000080);
2365       priority_ = 0;
2366       onChanged();
2367       return this;
2368     }
2369 
2370     private com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rateLimitOptions_;
2371     private com.google.protobuf.SingleFieldBuilderV3<
2372             com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions,
2373             com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions.Builder,
2374             com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsOrBuilder>
2375         rateLimitOptionsBuilder_;
2376     /**
2377      *
2378      *
2379      * <pre>
2380      * Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions.
2381      * </pre>
2382      *
2383      * <code>
2384      * optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rate_limit_options = 67544315;
2385      * </code>
2386      *
2387      * @return Whether the rateLimitOptions field is set.
2388      */
hasRateLimitOptions()2389     public boolean hasRateLimitOptions() {
2390       return ((bitField0_ & 0x00000100) != 0);
2391     }
2392     /**
2393      *
2394      *
2395      * <pre>
2396      * Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions.
2397      * </pre>
2398      *
2399      * <code>
2400      * optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rate_limit_options = 67544315;
2401      * </code>
2402      *
2403      * @return The rateLimitOptions.
2404      */
getRateLimitOptions()2405     public com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions getRateLimitOptions() {
2406       if (rateLimitOptionsBuilder_ == null) {
2407         return rateLimitOptions_ == null
2408             ? com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions.getDefaultInstance()
2409             : rateLimitOptions_;
2410       } else {
2411         return rateLimitOptionsBuilder_.getMessage();
2412       }
2413     }
2414     /**
2415      *
2416      *
2417      * <pre>
2418      * Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions.
2419      * </pre>
2420      *
2421      * <code>
2422      * optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rate_limit_options = 67544315;
2423      * </code>
2424      */
setRateLimitOptions( com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions value)2425     public Builder setRateLimitOptions(
2426         com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions value) {
2427       if (rateLimitOptionsBuilder_ == null) {
2428         if (value == null) {
2429           throw new NullPointerException();
2430         }
2431         rateLimitOptions_ = value;
2432       } else {
2433         rateLimitOptionsBuilder_.setMessage(value);
2434       }
2435       bitField0_ |= 0x00000100;
2436       onChanged();
2437       return this;
2438     }
2439     /**
2440      *
2441      *
2442      * <pre>
2443      * Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions.
2444      * </pre>
2445      *
2446      * <code>
2447      * optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rate_limit_options = 67544315;
2448      * </code>
2449      */
setRateLimitOptions( com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions.Builder builderForValue)2450     public Builder setRateLimitOptions(
2451         com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions.Builder builderForValue) {
2452       if (rateLimitOptionsBuilder_ == null) {
2453         rateLimitOptions_ = builderForValue.build();
2454       } else {
2455         rateLimitOptionsBuilder_.setMessage(builderForValue.build());
2456       }
2457       bitField0_ |= 0x00000100;
2458       onChanged();
2459       return this;
2460     }
2461     /**
2462      *
2463      *
2464      * <pre>
2465      * Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions.
2466      * </pre>
2467      *
2468      * <code>
2469      * optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rate_limit_options = 67544315;
2470      * </code>
2471      */
mergeRateLimitOptions( com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions value)2472     public Builder mergeRateLimitOptions(
2473         com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions value) {
2474       if (rateLimitOptionsBuilder_ == null) {
2475         if (((bitField0_ & 0x00000100) != 0)
2476             && rateLimitOptions_ != null
2477             && rateLimitOptions_
2478                 != com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions
2479                     .getDefaultInstance()) {
2480           getRateLimitOptionsBuilder().mergeFrom(value);
2481         } else {
2482           rateLimitOptions_ = value;
2483         }
2484       } else {
2485         rateLimitOptionsBuilder_.mergeFrom(value);
2486       }
2487       bitField0_ |= 0x00000100;
2488       onChanged();
2489       return this;
2490     }
2491     /**
2492      *
2493      *
2494      * <pre>
2495      * Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions.
2496      * </pre>
2497      *
2498      * <code>
2499      * optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rate_limit_options = 67544315;
2500      * </code>
2501      */
clearRateLimitOptions()2502     public Builder clearRateLimitOptions() {
2503       bitField0_ = (bitField0_ & ~0x00000100);
2504       rateLimitOptions_ = null;
2505       if (rateLimitOptionsBuilder_ != null) {
2506         rateLimitOptionsBuilder_.dispose();
2507         rateLimitOptionsBuilder_ = null;
2508       }
2509       onChanged();
2510       return this;
2511     }
2512     /**
2513      *
2514      *
2515      * <pre>
2516      * Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions.
2517      * </pre>
2518      *
2519      * <code>
2520      * optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rate_limit_options = 67544315;
2521      * </code>
2522      */
2523     public com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions.Builder
getRateLimitOptionsBuilder()2524         getRateLimitOptionsBuilder() {
2525       bitField0_ |= 0x00000100;
2526       onChanged();
2527       return getRateLimitOptionsFieldBuilder().getBuilder();
2528     }
2529     /**
2530      *
2531      *
2532      * <pre>
2533      * Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions.
2534      * </pre>
2535      *
2536      * <code>
2537      * optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rate_limit_options = 67544315;
2538      * </code>
2539      */
2540     public com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsOrBuilder
getRateLimitOptionsOrBuilder()2541         getRateLimitOptionsOrBuilder() {
2542       if (rateLimitOptionsBuilder_ != null) {
2543         return rateLimitOptionsBuilder_.getMessageOrBuilder();
2544       } else {
2545         return rateLimitOptions_ == null
2546             ? com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions.getDefaultInstance()
2547             : rateLimitOptions_;
2548       }
2549     }
2550     /**
2551      *
2552      *
2553      * <pre>
2554      * Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions.
2555      * </pre>
2556      *
2557      * <code>
2558      * optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rate_limit_options = 67544315;
2559      * </code>
2560      */
2561     private com.google.protobuf.SingleFieldBuilderV3<
2562             com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions,
2563             com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions.Builder,
2564             com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsOrBuilder>
getRateLimitOptionsFieldBuilder()2565         getRateLimitOptionsFieldBuilder() {
2566       if (rateLimitOptionsBuilder_ == null) {
2567         rateLimitOptionsBuilder_ =
2568             new com.google.protobuf.SingleFieldBuilderV3<
2569                 com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions,
2570                 com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions.Builder,
2571                 com.google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsOrBuilder>(
2572                 getRateLimitOptions(), getParentForChildren(), isClean());
2573         rateLimitOptions_ = null;
2574       }
2575       return rateLimitOptionsBuilder_;
2576     }
2577 
2578     private com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirectOptions_;
2579     private com.google.protobuf.SingleFieldBuilderV3<
2580             com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions,
2581             com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions.Builder,
2582             com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptionsOrBuilder>
2583         redirectOptionsBuilder_;
2584     /**
2585      *
2586      *
2587      * <pre>
2588      * Parameters defining the redirect action. Cannot be specified for any other actions.
2589      * </pre>
2590      *
2591      * <code>
2592      * optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirect_options = 163285307;
2593      * </code>
2594      *
2595      * @return Whether the redirectOptions field is set.
2596      */
hasRedirectOptions()2597     public boolean hasRedirectOptions() {
2598       return ((bitField0_ & 0x00000200) != 0);
2599     }
2600     /**
2601      *
2602      *
2603      * <pre>
2604      * Parameters defining the redirect action. Cannot be specified for any other actions.
2605      * </pre>
2606      *
2607      * <code>
2608      * optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirect_options = 163285307;
2609      * </code>
2610      *
2611      * @return The redirectOptions.
2612      */
getRedirectOptions()2613     public com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions getRedirectOptions() {
2614       if (redirectOptionsBuilder_ == null) {
2615         return redirectOptions_ == null
2616             ? com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions.getDefaultInstance()
2617             : redirectOptions_;
2618       } else {
2619         return redirectOptionsBuilder_.getMessage();
2620       }
2621     }
2622     /**
2623      *
2624      *
2625      * <pre>
2626      * Parameters defining the redirect action. Cannot be specified for any other actions.
2627      * </pre>
2628      *
2629      * <code>
2630      * optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirect_options = 163285307;
2631      * </code>
2632      */
setRedirectOptions( com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions value)2633     public Builder setRedirectOptions(
2634         com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions value) {
2635       if (redirectOptionsBuilder_ == null) {
2636         if (value == null) {
2637           throw new NullPointerException();
2638         }
2639         redirectOptions_ = value;
2640       } else {
2641         redirectOptionsBuilder_.setMessage(value);
2642       }
2643       bitField0_ |= 0x00000200;
2644       onChanged();
2645       return this;
2646     }
2647     /**
2648      *
2649      *
2650      * <pre>
2651      * Parameters defining the redirect action. Cannot be specified for any other actions.
2652      * </pre>
2653      *
2654      * <code>
2655      * optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirect_options = 163285307;
2656      * </code>
2657      */
setRedirectOptions( com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions.Builder builderForValue)2658     public Builder setRedirectOptions(
2659         com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions.Builder builderForValue) {
2660       if (redirectOptionsBuilder_ == null) {
2661         redirectOptions_ = builderForValue.build();
2662       } else {
2663         redirectOptionsBuilder_.setMessage(builderForValue.build());
2664       }
2665       bitField0_ |= 0x00000200;
2666       onChanged();
2667       return this;
2668     }
2669     /**
2670      *
2671      *
2672      * <pre>
2673      * Parameters defining the redirect action. Cannot be specified for any other actions.
2674      * </pre>
2675      *
2676      * <code>
2677      * optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirect_options = 163285307;
2678      * </code>
2679      */
mergeRedirectOptions( com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions value)2680     public Builder mergeRedirectOptions(
2681         com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions value) {
2682       if (redirectOptionsBuilder_ == null) {
2683         if (((bitField0_ & 0x00000200) != 0)
2684             && redirectOptions_ != null
2685             && redirectOptions_
2686                 != com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions
2687                     .getDefaultInstance()) {
2688           getRedirectOptionsBuilder().mergeFrom(value);
2689         } else {
2690           redirectOptions_ = value;
2691         }
2692       } else {
2693         redirectOptionsBuilder_.mergeFrom(value);
2694       }
2695       bitField0_ |= 0x00000200;
2696       onChanged();
2697       return this;
2698     }
2699     /**
2700      *
2701      *
2702      * <pre>
2703      * Parameters defining the redirect action. Cannot be specified for any other actions.
2704      * </pre>
2705      *
2706      * <code>
2707      * optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirect_options = 163285307;
2708      * </code>
2709      */
clearRedirectOptions()2710     public Builder clearRedirectOptions() {
2711       bitField0_ = (bitField0_ & ~0x00000200);
2712       redirectOptions_ = null;
2713       if (redirectOptionsBuilder_ != null) {
2714         redirectOptionsBuilder_.dispose();
2715         redirectOptionsBuilder_ = null;
2716       }
2717       onChanged();
2718       return this;
2719     }
2720     /**
2721      *
2722      *
2723      * <pre>
2724      * Parameters defining the redirect action. Cannot be specified for any other actions.
2725      * </pre>
2726      *
2727      * <code>
2728      * optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirect_options = 163285307;
2729      * </code>
2730      */
2731     public com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions.Builder
getRedirectOptionsBuilder()2732         getRedirectOptionsBuilder() {
2733       bitField0_ |= 0x00000200;
2734       onChanged();
2735       return getRedirectOptionsFieldBuilder().getBuilder();
2736     }
2737     /**
2738      *
2739      *
2740      * <pre>
2741      * Parameters defining the redirect action. Cannot be specified for any other actions.
2742      * </pre>
2743      *
2744      * <code>
2745      * optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirect_options = 163285307;
2746      * </code>
2747      */
2748     public com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptionsOrBuilder
getRedirectOptionsOrBuilder()2749         getRedirectOptionsOrBuilder() {
2750       if (redirectOptionsBuilder_ != null) {
2751         return redirectOptionsBuilder_.getMessageOrBuilder();
2752       } else {
2753         return redirectOptions_ == null
2754             ? com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions.getDefaultInstance()
2755             : redirectOptions_;
2756       }
2757     }
2758     /**
2759      *
2760      *
2761      * <pre>
2762      * Parameters defining the redirect action. Cannot be specified for any other actions.
2763      * </pre>
2764      *
2765      * <code>
2766      * optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirect_options = 163285307;
2767      * </code>
2768      */
2769     private com.google.protobuf.SingleFieldBuilderV3<
2770             com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions,
2771             com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions.Builder,
2772             com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptionsOrBuilder>
getRedirectOptionsFieldBuilder()2773         getRedirectOptionsFieldBuilder() {
2774       if (redirectOptionsBuilder_ == null) {
2775         redirectOptionsBuilder_ =
2776             new com.google.protobuf.SingleFieldBuilderV3<
2777                 com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions,
2778                 com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions.Builder,
2779                 com.google.cloud.compute.v1.SecurityPolicyRuleRedirectOptionsOrBuilder>(
2780                 getRedirectOptions(), getParentForChildren(), isClean());
2781         redirectOptions_ = null;
2782       }
2783       return redirectOptionsBuilder_;
2784     }
2785 
2786     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)2787     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
2788       return super.setUnknownFields(unknownFields);
2789     }
2790 
2791     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2792     public final Builder mergeUnknownFields(
2793         final com.google.protobuf.UnknownFieldSet unknownFields) {
2794       return super.mergeUnknownFields(unknownFields);
2795     }
2796 
2797     // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.SecurityPolicyRule)
2798   }
2799 
2800   // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.SecurityPolicyRule)
2801   private static final com.google.cloud.compute.v1.SecurityPolicyRule DEFAULT_INSTANCE;
2802 
2803   static {
2804     DEFAULT_INSTANCE = new com.google.cloud.compute.v1.SecurityPolicyRule();
2805   }
2806 
getDefaultInstance()2807   public static com.google.cloud.compute.v1.SecurityPolicyRule getDefaultInstance() {
2808     return DEFAULT_INSTANCE;
2809   }
2810 
2811   private static final com.google.protobuf.Parser<SecurityPolicyRule> PARSER =
2812       new com.google.protobuf.AbstractParser<SecurityPolicyRule>() {
2813         @java.lang.Override
2814         public SecurityPolicyRule parsePartialFrom(
2815             com.google.protobuf.CodedInputStream input,
2816             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2817             throws com.google.protobuf.InvalidProtocolBufferException {
2818           Builder builder = newBuilder();
2819           try {
2820             builder.mergeFrom(input, extensionRegistry);
2821           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
2822             throw e.setUnfinishedMessage(builder.buildPartial());
2823           } catch (com.google.protobuf.UninitializedMessageException e) {
2824             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
2825           } catch (java.io.IOException e) {
2826             throw new com.google.protobuf.InvalidProtocolBufferException(e)
2827                 .setUnfinishedMessage(builder.buildPartial());
2828           }
2829           return builder.buildPartial();
2830         }
2831       };
2832 
parser()2833   public static com.google.protobuf.Parser<SecurityPolicyRule> parser() {
2834     return PARSER;
2835   }
2836 
2837   @java.lang.Override
getParserForType()2838   public com.google.protobuf.Parser<SecurityPolicyRule> getParserForType() {
2839     return PARSER;
2840   }
2841 
2842   @java.lang.Override
getDefaultInstanceForType()2843   public com.google.cloud.compute.v1.SecurityPolicyRule getDefaultInstanceForType() {
2844     return DEFAULT_INSTANCE;
2845   }
2846 }
2847