• 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/api/http.proto
18 
19 package com.google.api;
20 
21 /**
22  *
23  *
24  * <pre>
25  * # gRPC Transcoding
26  * gRPC Transcoding is a feature for mapping between a gRPC method and one or
27  * more HTTP REST endpoints. It allows developers to build a single API service
28  * that supports both gRPC APIs and REST APIs. Many systems, including [Google
29  * APIs](https://github.com/googleapis/googleapis),
30  * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
31  * Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
32  * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
33  * and use it for large scale production services.
34  * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
35  * how different portions of the gRPC request message are mapped to the URL
36  * path, URL query parameters, and HTTP request body. It also controls how the
37  * gRPC response message is mapped to the HTTP response body. `HttpRule` is
38  * typically specified as an `google.api.http` annotation on the gRPC method.
39  * Each mapping specifies a URL path template and an HTTP method. The path
40  * template may refer to one or more fields in the gRPC request message, as long
41  * as each field is a non-repeated field with a primitive (non-message) type.
42  * The path template controls how fields of the request message are mapped to
43  * the URL path.
44  * Example:
45  *     service Messaging {
46  *       rpc GetMessage(GetMessageRequest) returns (Message) {
47  *         option (google.api.http) = {
48  *             get: "/v1/{name=messages/&#42;}"
49  *         };
50  *       }
51  *     }
52  *     message GetMessageRequest {
53  *       string name = 1; // Mapped to URL path.
54  *     }
55  *     message Message {
56  *       string text = 1; // The resource content.
57  *     }
58  * This enables an HTTP REST to gRPC mapping as below:
59  * HTTP | gRPC
60  * -----|-----
61  * `GET /v1/messages/123456`  | `GetMessage(name: "messages/123456")`
62  * Any fields in the request message which are not bound by the path template
63  * automatically become HTTP query parameters if there is no HTTP request body.
64  * For example:
65  *     service Messaging {
66  *       rpc GetMessage(GetMessageRequest) returns (Message) {
67  *         option (google.api.http) = {
68  *             get:"/v1/messages/{message_id}"
69  *         };
70  *       }
71  *     }
72  *     message GetMessageRequest {
73  *       message SubMessage {
74  *         string subfield = 1;
75  *       }
76  *       string message_id = 1; // Mapped to URL path.
77  *       int64 revision = 2;    // Mapped to URL query parameter `revision`.
78  *       SubMessage sub = 3;    // Mapped to URL query parameter `sub.subfield`.
79  *     }
80  * This enables a HTTP JSON to RPC mapping as below:
81  * HTTP | gRPC
82  * -----|-----
83  * `GET /v1/messages/123456?revision=2&amp;sub.subfield=foo` |
84  * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
85  * "foo"))`
86  * Note that fields which are mapped to URL query parameters must have a
87  * primitive type or a repeated primitive type or a non-repeated message type.
88  * In the case of a repeated type, the parameter can be repeated in the URL
89  * as `...?param=A&amp;param=B`. In the case of a message type, each field of the
90  * message is mapped to a separate parameter, such as
91  * `...?foo.a=A&amp;foo.b=B&amp;foo.c=C`.
92  * For HTTP methods that allow a request body, the `body` field
93  * specifies the mapping. Consider a REST update method on the
94  * message resource collection:
95  *     service Messaging {
96  *       rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
97  *         option (google.api.http) = {
98  *           patch: "/v1/messages/{message_id}"
99  *           body: "message"
100  *         };
101  *       }
102  *     }
103  *     message UpdateMessageRequest {
104  *       string message_id = 1; // mapped to the URL
105  *       Message message = 2;   // mapped to the body
106  *     }
107  * The following HTTP JSON to RPC mapping is enabled, where the
108  * representation of the JSON in the request body is determined by
109  * protos JSON encoding:
110  * HTTP | gRPC
111  * -----|-----
112  * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
113  * "123456" message { text: "Hi!" })`
114  * The special name `*` can be used in the body mapping to define that
115  * every field not bound by the path template should be mapped to the
116  * request body.  This enables the following alternative definition of
117  * the update method:
118  *     service Messaging {
119  *       rpc UpdateMessage(Message) returns (Message) {
120  *         option (google.api.http) = {
121  *           patch: "/v1/messages/{message_id}"
122  *           body: "*"
123  *         };
124  *       }
125  *     }
126  *     message Message {
127  *       string message_id = 1;
128  *       string text = 2;
129  *     }
130  * The following HTTP JSON to RPC mapping is enabled:
131  * HTTP | gRPC
132  * -----|-----
133  * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
134  * "123456" text: "Hi!")`
135  * Note that when using `*` in the body mapping, it is not possible to
136  * have HTTP parameters, as all fields not bound by the path end in
137  * the body. This makes this option more rarely used in practice when
138  * defining REST APIs. The common usage of `*` is in custom methods
139  * which don't use the URL at all for transferring data.
140  * It is possible to define multiple HTTP methods for one RPC by using
141  * the `additional_bindings` option. Example:
142  *     service Messaging {
143  *       rpc GetMessage(GetMessageRequest) returns (Message) {
144  *         option (google.api.http) = {
145  *           get: "/v1/messages/{message_id}"
146  *           additional_bindings {
147  *             get: "/v1/users/{user_id}/messages/{message_id}"
148  *           }
149  *         };
150  *       }
151  *     }
152  *     message GetMessageRequest {
153  *       string message_id = 1;
154  *       string user_id = 2;
155  *     }
156  * This enables the following two alternative HTTP JSON to RPC mappings:
157  * HTTP | gRPC
158  * -----|-----
159  * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
160  * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
161  * "123456")`
162  * ## Rules for HTTP mapping
163  * 1. Leaf request fields (recursive expansion nested messages in the request
164  *    message) are classified into three categories:
165  *    - Fields referred by the path template. They are passed via the URL path.
166  *    - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
167  *    are passed via the HTTP
168  *      request body.
169  *    - All other fields are passed via the URL query parameters, and the
170  *      parameter name is the field path in the request message. A repeated
171  *      field can be represented as multiple query parameters under the same
172  *      name.
173  *  2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
174  *  query parameter, all fields
175  *     are passed via URL path and HTTP request body.
176  *  3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
177  *  request body, all
178  *     fields are passed via URL path and URL query parameters.
179  * ### Path template syntax
180  *     Template = "/" Segments [ Verb ] ;
181  *     Segments = Segment { "/" Segment } ;
182  *     Segment  = "*" | "**" | LITERAL | Variable ;
183  *     Variable = "{" FieldPath [ "=" Segments ] "}" ;
184  *     FieldPath = IDENT { "." IDENT } ;
185  *     Verb     = ":" LITERAL ;
186  * The syntax `*` matches a single URL path segment. The syntax `**` matches
187  * zero or more URL path segments, which must be the last part of the URL path
188  * except the `Verb`.
189  * The syntax `Variable` matches part of the URL path as specified by its
190  * template. A variable template must not contain other variables. If a variable
191  * matches a single path segment, its template may be omitted, e.g. `{var}`
192  * is equivalent to `{var=*}`.
193  * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
194  * contains any reserved character, such characters should be percent-encoded
195  * before the matching.
196  * If a variable contains exactly one path segment, such as `"{var}"` or
197  * `"{var=*}"`, when such a variable is expanded into a URL path on the client
198  * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
199  * server side does the reverse decoding. Such variables show up in the
200  * [Discovery
201  * Document](https://developers.google.com/discovery/v1/reference/apis) as
202  * `{var}`.
203  * If a variable contains multiple path segments, such as `"{var=foo/&#42;}"`
204  * or `"{var=**}"`, when such a variable is expanded into a URL path on the
205  * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
206  * The server side does the reverse decoding, except "%2F" and "%2f" are left
207  * unchanged. Such variables show up in the
208  * [Discovery
209  * Document](https://developers.google.com/discovery/v1/reference/apis) as
210  * `{+var}`.
211  * ## Using gRPC API Service Configuration
212  * gRPC API Service Configuration (service config) is a configuration language
213  * for configuring a gRPC service to become a user-facing product. The
214  * service config is simply the YAML representation of the `google.api.Service`
215  * proto message.
216  * As an alternative to annotating your proto file, you can configure gRPC
217  * transcoding in your service config YAML files. You do this by specifying a
218  * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
219  * effect as the proto annotation. This can be particularly useful if you
220  * have a proto that is reused in multiple services. Note that any transcoding
221  * specified in the service config will override any matching transcoding
222  * configuration in the proto.
223  * Example:
224  *     http:
225  *       rules:
226  *         # Selects a gRPC method and applies HttpRule to it.
227  *         - selector: example.v1.Messaging.GetMessage
228  *           get: /v1/messages/{message_id}/{sub.subfield}
229  * ## Special notes
230  * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
231  * proto to JSON conversion must follow the [proto3
232  * specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
233  * While the single segment variable follows the semantics of
234  * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
235  * Expansion, the multi segment variable **does not** follow RFC 6570 Section
236  * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
237  * does not expand special characters like `?` and `#`, which would lead
238  * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
239  * for multi segment variables.
240  * The path variables **must not** refer to any repeated or mapped field,
241  * because client libraries are not capable of handling such variable expansion.
242  * The path variables **must not** capture the leading "/" character. The reason
243  * is that the most common use case "{var}" does not capture the leading "/"
244  * character. For consistency, all path variables must share the same behavior.
245  * Repeated message fields must not be mapped to URL query parameters, because
246  * no client library can support such complicated mapping.
247  * If an API needs to use a JSON array for request or response body, it can map
248  * the request or response body to a repeated field. However, some gRPC
249  * Transcoding implementations may not support this feature.
250  * </pre>
251  *
252  * Protobuf type {@code google.api.HttpRule}
253  */
254 public final class HttpRule extends com.google.protobuf.GeneratedMessageV3
255     implements
256     // @@protoc_insertion_point(message_implements:google.api.HttpRule)
257     HttpRuleOrBuilder {
258   private static final long serialVersionUID = 0L;
259   // Use HttpRule.newBuilder() to construct.
HttpRule(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)260   private HttpRule(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
261     super(builder);
262   }
263 
HttpRule()264   private HttpRule() {
265     selector_ = "";
266     body_ = "";
267     responseBody_ = "";
268     additionalBindings_ = java.util.Collections.emptyList();
269   }
270 
271   @java.lang.Override
272   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)273   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
274     return new HttpRule();
275   }
276 
277   @java.lang.Override
getUnknownFields()278   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
279     return this.unknownFields;
280   }
281 
getDescriptor()282   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
283     return com.google.api.HttpProto.internal_static_google_api_HttpRule_descriptor;
284   }
285 
286   @java.lang.Override
287   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()288       internalGetFieldAccessorTable() {
289     return com.google.api.HttpProto.internal_static_google_api_HttpRule_fieldAccessorTable
290         .ensureFieldAccessorsInitialized(
291             com.google.api.HttpRule.class, com.google.api.HttpRule.Builder.class);
292   }
293 
294   private int patternCase_ = 0;
295   private java.lang.Object pattern_;
296 
297   public enum PatternCase
298       implements
299           com.google.protobuf.Internal.EnumLite,
300           com.google.protobuf.AbstractMessage.InternalOneOfEnum {
301     GET(2),
302     PUT(3),
303     POST(4),
304     DELETE(5),
305     PATCH(6),
306     CUSTOM(8),
307     PATTERN_NOT_SET(0);
308     private final int value;
309 
PatternCase(int value)310     private PatternCase(int value) {
311       this.value = value;
312     }
313     /**
314      * @param value The number of the enum to look for.
315      * @return The enum associated with the given number.
316      * @deprecated Use {@link #forNumber(int)} instead.
317      */
318     @java.lang.Deprecated
valueOf(int value)319     public static PatternCase valueOf(int value) {
320       return forNumber(value);
321     }
322 
forNumber(int value)323     public static PatternCase forNumber(int value) {
324       switch (value) {
325         case 2:
326           return GET;
327         case 3:
328           return PUT;
329         case 4:
330           return POST;
331         case 5:
332           return DELETE;
333         case 6:
334           return PATCH;
335         case 8:
336           return CUSTOM;
337         case 0:
338           return PATTERN_NOT_SET;
339         default:
340           return null;
341       }
342     }
343 
getNumber()344     public int getNumber() {
345       return this.value;
346     }
347   };
348 
getPatternCase()349   public PatternCase getPatternCase() {
350     return PatternCase.forNumber(patternCase_);
351   }
352 
353   public static final int SELECTOR_FIELD_NUMBER = 1;
354 
355   @SuppressWarnings("serial")
356   private volatile java.lang.Object selector_ = "";
357   /**
358    *
359    *
360    * <pre>
361    * Selects a method to which this rule applies.
362    * Refer to [selector][google.api.DocumentationRule.selector] for syntax
363    * details.
364    * </pre>
365    *
366    * <code>string selector = 1;</code>
367    *
368    * @return The selector.
369    */
370   @java.lang.Override
getSelector()371   public java.lang.String getSelector() {
372     java.lang.Object ref = selector_;
373     if (ref instanceof java.lang.String) {
374       return (java.lang.String) ref;
375     } else {
376       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
377       java.lang.String s = bs.toStringUtf8();
378       selector_ = s;
379       return s;
380     }
381   }
382   /**
383    *
384    *
385    * <pre>
386    * Selects a method to which this rule applies.
387    * Refer to [selector][google.api.DocumentationRule.selector] for syntax
388    * details.
389    * </pre>
390    *
391    * <code>string selector = 1;</code>
392    *
393    * @return The bytes for selector.
394    */
395   @java.lang.Override
getSelectorBytes()396   public com.google.protobuf.ByteString getSelectorBytes() {
397     java.lang.Object ref = selector_;
398     if (ref instanceof java.lang.String) {
399       com.google.protobuf.ByteString b =
400           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
401       selector_ = b;
402       return b;
403     } else {
404       return (com.google.protobuf.ByteString) ref;
405     }
406   }
407 
408   public static final int GET_FIELD_NUMBER = 2;
409   /**
410    *
411    *
412    * <pre>
413    * Maps to HTTP GET. Used for listing and getting information about
414    * resources.
415    * </pre>
416    *
417    * <code>string get = 2;</code>
418    *
419    * @return Whether the get field is set.
420    */
hasGet()421   public boolean hasGet() {
422     return patternCase_ == 2;
423   }
424   /**
425    *
426    *
427    * <pre>
428    * Maps to HTTP GET. Used for listing and getting information about
429    * resources.
430    * </pre>
431    *
432    * <code>string get = 2;</code>
433    *
434    * @return The get.
435    */
getGet()436   public java.lang.String getGet() {
437     java.lang.Object ref = "";
438     if (patternCase_ == 2) {
439       ref = pattern_;
440     }
441     if (ref instanceof java.lang.String) {
442       return (java.lang.String) ref;
443     } else {
444       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
445       java.lang.String s = bs.toStringUtf8();
446       if (patternCase_ == 2) {
447         pattern_ = s;
448       }
449       return s;
450     }
451   }
452   /**
453    *
454    *
455    * <pre>
456    * Maps to HTTP GET. Used for listing and getting information about
457    * resources.
458    * </pre>
459    *
460    * <code>string get = 2;</code>
461    *
462    * @return The bytes for get.
463    */
getGetBytes()464   public com.google.protobuf.ByteString getGetBytes() {
465     java.lang.Object ref = "";
466     if (patternCase_ == 2) {
467       ref = pattern_;
468     }
469     if (ref instanceof java.lang.String) {
470       com.google.protobuf.ByteString b =
471           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
472       if (patternCase_ == 2) {
473         pattern_ = b;
474       }
475       return b;
476     } else {
477       return (com.google.protobuf.ByteString) ref;
478     }
479   }
480 
481   public static final int PUT_FIELD_NUMBER = 3;
482   /**
483    *
484    *
485    * <pre>
486    * Maps to HTTP PUT. Used for replacing a resource.
487    * </pre>
488    *
489    * <code>string put = 3;</code>
490    *
491    * @return Whether the put field is set.
492    */
hasPut()493   public boolean hasPut() {
494     return patternCase_ == 3;
495   }
496   /**
497    *
498    *
499    * <pre>
500    * Maps to HTTP PUT. Used for replacing a resource.
501    * </pre>
502    *
503    * <code>string put = 3;</code>
504    *
505    * @return The put.
506    */
getPut()507   public java.lang.String getPut() {
508     java.lang.Object ref = "";
509     if (patternCase_ == 3) {
510       ref = pattern_;
511     }
512     if (ref instanceof java.lang.String) {
513       return (java.lang.String) ref;
514     } else {
515       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
516       java.lang.String s = bs.toStringUtf8();
517       if (patternCase_ == 3) {
518         pattern_ = s;
519       }
520       return s;
521     }
522   }
523   /**
524    *
525    *
526    * <pre>
527    * Maps to HTTP PUT. Used for replacing a resource.
528    * </pre>
529    *
530    * <code>string put = 3;</code>
531    *
532    * @return The bytes for put.
533    */
getPutBytes()534   public com.google.protobuf.ByteString getPutBytes() {
535     java.lang.Object ref = "";
536     if (patternCase_ == 3) {
537       ref = pattern_;
538     }
539     if (ref instanceof java.lang.String) {
540       com.google.protobuf.ByteString b =
541           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
542       if (patternCase_ == 3) {
543         pattern_ = b;
544       }
545       return b;
546     } else {
547       return (com.google.protobuf.ByteString) ref;
548     }
549   }
550 
551   public static final int POST_FIELD_NUMBER = 4;
552   /**
553    *
554    *
555    * <pre>
556    * Maps to HTTP POST. Used for creating a resource or performing an action.
557    * </pre>
558    *
559    * <code>string post = 4;</code>
560    *
561    * @return Whether the post field is set.
562    */
hasPost()563   public boolean hasPost() {
564     return patternCase_ == 4;
565   }
566   /**
567    *
568    *
569    * <pre>
570    * Maps to HTTP POST. Used for creating a resource or performing an action.
571    * </pre>
572    *
573    * <code>string post = 4;</code>
574    *
575    * @return The post.
576    */
getPost()577   public java.lang.String getPost() {
578     java.lang.Object ref = "";
579     if (patternCase_ == 4) {
580       ref = pattern_;
581     }
582     if (ref instanceof java.lang.String) {
583       return (java.lang.String) ref;
584     } else {
585       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
586       java.lang.String s = bs.toStringUtf8();
587       if (patternCase_ == 4) {
588         pattern_ = s;
589       }
590       return s;
591     }
592   }
593   /**
594    *
595    *
596    * <pre>
597    * Maps to HTTP POST. Used for creating a resource or performing an action.
598    * </pre>
599    *
600    * <code>string post = 4;</code>
601    *
602    * @return The bytes for post.
603    */
getPostBytes()604   public com.google.protobuf.ByteString getPostBytes() {
605     java.lang.Object ref = "";
606     if (patternCase_ == 4) {
607       ref = pattern_;
608     }
609     if (ref instanceof java.lang.String) {
610       com.google.protobuf.ByteString b =
611           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
612       if (patternCase_ == 4) {
613         pattern_ = b;
614       }
615       return b;
616     } else {
617       return (com.google.protobuf.ByteString) ref;
618     }
619   }
620 
621   public static final int DELETE_FIELD_NUMBER = 5;
622   /**
623    *
624    *
625    * <pre>
626    * Maps to HTTP DELETE. Used for deleting a resource.
627    * </pre>
628    *
629    * <code>string delete = 5;</code>
630    *
631    * @return Whether the delete field is set.
632    */
hasDelete()633   public boolean hasDelete() {
634     return patternCase_ == 5;
635   }
636   /**
637    *
638    *
639    * <pre>
640    * Maps to HTTP DELETE. Used for deleting a resource.
641    * </pre>
642    *
643    * <code>string delete = 5;</code>
644    *
645    * @return The delete.
646    */
getDelete()647   public java.lang.String getDelete() {
648     java.lang.Object ref = "";
649     if (patternCase_ == 5) {
650       ref = pattern_;
651     }
652     if (ref instanceof java.lang.String) {
653       return (java.lang.String) ref;
654     } else {
655       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
656       java.lang.String s = bs.toStringUtf8();
657       if (patternCase_ == 5) {
658         pattern_ = s;
659       }
660       return s;
661     }
662   }
663   /**
664    *
665    *
666    * <pre>
667    * Maps to HTTP DELETE. Used for deleting a resource.
668    * </pre>
669    *
670    * <code>string delete = 5;</code>
671    *
672    * @return The bytes for delete.
673    */
getDeleteBytes()674   public com.google.protobuf.ByteString getDeleteBytes() {
675     java.lang.Object ref = "";
676     if (patternCase_ == 5) {
677       ref = pattern_;
678     }
679     if (ref instanceof java.lang.String) {
680       com.google.protobuf.ByteString b =
681           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
682       if (patternCase_ == 5) {
683         pattern_ = b;
684       }
685       return b;
686     } else {
687       return (com.google.protobuf.ByteString) ref;
688     }
689   }
690 
691   public static final int PATCH_FIELD_NUMBER = 6;
692   /**
693    *
694    *
695    * <pre>
696    * Maps to HTTP PATCH. Used for updating a resource.
697    * </pre>
698    *
699    * <code>string patch = 6;</code>
700    *
701    * @return Whether the patch field is set.
702    */
hasPatch()703   public boolean hasPatch() {
704     return patternCase_ == 6;
705   }
706   /**
707    *
708    *
709    * <pre>
710    * Maps to HTTP PATCH. Used for updating a resource.
711    * </pre>
712    *
713    * <code>string patch = 6;</code>
714    *
715    * @return The patch.
716    */
getPatch()717   public java.lang.String getPatch() {
718     java.lang.Object ref = "";
719     if (patternCase_ == 6) {
720       ref = pattern_;
721     }
722     if (ref instanceof java.lang.String) {
723       return (java.lang.String) ref;
724     } else {
725       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
726       java.lang.String s = bs.toStringUtf8();
727       if (patternCase_ == 6) {
728         pattern_ = s;
729       }
730       return s;
731     }
732   }
733   /**
734    *
735    *
736    * <pre>
737    * Maps to HTTP PATCH. Used for updating a resource.
738    * </pre>
739    *
740    * <code>string patch = 6;</code>
741    *
742    * @return The bytes for patch.
743    */
getPatchBytes()744   public com.google.protobuf.ByteString getPatchBytes() {
745     java.lang.Object ref = "";
746     if (patternCase_ == 6) {
747       ref = pattern_;
748     }
749     if (ref instanceof java.lang.String) {
750       com.google.protobuf.ByteString b =
751           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
752       if (patternCase_ == 6) {
753         pattern_ = b;
754       }
755       return b;
756     } else {
757       return (com.google.protobuf.ByteString) ref;
758     }
759   }
760 
761   public static final int CUSTOM_FIELD_NUMBER = 8;
762   /**
763    *
764    *
765    * <pre>
766    * The custom pattern is used for specifying an HTTP method that is not
767    * included in the `pattern` field, such as HEAD, or "*" to leave the
768    * HTTP method unspecified for this rule. The wild-card rule is useful
769    * for services that provide content to Web (HTML) clients.
770    * </pre>
771    *
772    * <code>.google.api.CustomHttpPattern custom = 8;</code>
773    *
774    * @return Whether the custom field is set.
775    */
776   @java.lang.Override
hasCustom()777   public boolean hasCustom() {
778     return patternCase_ == 8;
779   }
780   /**
781    *
782    *
783    * <pre>
784    * The custom pattern is used for specifying an HTTP method that is not
785    * included in the `pattern` field, such as HEAD, or "*" to leave the
786    * HTTP method unspecified for this rule. The wild-card rule is useful
787    * for services that provide content to Web (HTML) clients.
788    * </pre>
789    *
790    * <code>.google.api.CustomHttpPattern custom = 8;</code>
791    *
792    * @return The custom.
793    */
794   @java.lang.Override
getCustom()795   public com.google.api.CustomHttpPattern getCustom() {
796     if (patternCase_ == 8) {
797       return (com.google.api.CustomHttpPattern) pattern_;
798     }
799     return com.google.api.CustomHttpPattern.getDefaultInstance();
800   }
801   /**
802    *
803    *
804    * <pre>
805    * The custom pattern is used for specifying an HTTP method that is not
806    * included in the `pattern` field, such as HEAD, or "*" to leave the
807    * HTTP method unspecified for this rule. The wild-card rule is useful
808    * for services that provide content to Web (HTML) clients.
809    * </pre>
810    *
811    * <code>.google.api.CustomHttpPattern custom = 8;</code>
812    */
813   @java.lang.Override
getCustomOrBuilder()814   public com.google.api.CustomHttpPatternOrBuilder getCustomOrBuilder() {
815     if (patternCase_ == 8) {
816       return (com.google.api.CustomHttpPattern) pattern_;
817     }
818     return com.google.api.CustomHttpPattern.getDefaultInstance();
819   }
820 
821   public static final int BODY_FIELD_NUMBER = 7;
822 
823   @SuppressWarnings("serial")
824   private volatile java.lang.Object body_ = "";
825   /**
826    *
827    *
828    * <pre>
829    * The name of the request field whose value is mapped to the HTTP request
830    * body, or `*` for mapping all request fields not captured by the path
831    * pattern to the HTTP body, or omitted for not having any HTTP request body.
832    * NOTE: the referred field must be present at the top-level of the request
833    * message type.
834    * </pre>
835    *
836    * <code>string body = 7;</code>
837    *
838    * @return The body.
839    */
840   @java.lang.Override
getBody()841   public java.lang.String getBody() {
842     java.lang.Object ref = body_;
843     if (ref instanceof java.lang.String) {
844       return (java.lang.String) ref;
845     } else {
846       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
847       java.lang.String s = bs.toStringUtf8();
848       body_ = s;
849       return s;
850     }
851   }
852   /**
853    *
854    *
855    * <pre>
856    * The name of the request field whose value is mapped to the HTTP request
857    * body, or `*` for mapping all request fields not captured by the path
858    * pattern to the HTTP body, or omitted for not having any HTTP request body.
859    * NOTE: the referred field must be present at the top-level of the request
860    * message type.
861    * </pre>
862    *
863    * <code>string body = 7;</code>
864    *
865    * @return The bytes for body.
866    */
867   @java.lang.Override
getBodyBytes()868   public com.google.protobuf.ByteString getBodyBytes() {
869     java.lang.Object ref = body_;
870     if (ref instanceof java.lang.String) {
871       com.google.protobuf.ByteString b =
872           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
873       body_ = b;
874       return b;
875     } else {
876       return (com.google.protobuf.ByteString) ref;
877     }
878   }
879 
880   public static final int RESPONSE_BODY_FIELD_NUMBER = 12;
881 
882   @SuppressWarnings("serial")
883   private volatile java.lang.Object responseBody_ = "";
884   /**
885    *
886    *
887    * <pre>
888    * Optional. The name of the response field whose value is mapped to the HTTP
889    * response body. When omitted, the entire response message will be used
890    * as the HTTP response body.
891    * NOTE: The referred field must be present at the top-level of the response
892    * message type.
893    * </pre>
894    *
895    * <code>string response_body = 12;</code>
896    *
897    * @return The responseBody.
898    */
899   @java.lang.Override
getResponseBody()900   public java.lang.String getResponseBody() {
901     java.lang.Object ref = responseBody_;
902     if (ref instanceof java.lang.String) {
903       return (java.lang.String) ref;
904     } else {
905       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
906       java.lang.String s = bs.toStringUtf8();
907       responseBody_ = s;
908       return s;
909     }
910   }
911   /**
912    *
913    *
914    * <pre>
915    * Optional. The name of the response field whose value is mapped to the HTTP
916    * response body. When omitted, the entire response message will be used
917    * as the HTTP response body.
918    * NOTE: The referred field must be present at the top-level of the response
919    * message type.
920    * </pre>
921    *
922    * <code>string response_body = 12;</code>
923    *
924    * @return The bytes for responseBody.
925    */
926   @java.lang.Override
getResponseBodyBytes()927   public com.google.protobuf.ByteString getResponseBodyBytes() {
928     java.lang.Object ref = responseBody_;
929     if (ref instanceof java.lang.String) {
930       com.google.protobuf.ByteString b =
931           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
932       responseBody_ = b;
933       return b;
934     } else {
935       return (com.google.protobuf.ByteString) ref;
936     }
937   }
938 
939   public static final int ADDITIONAL_BINDINGS_FIELD_NUMBER = 11;
940 
941   @SuppressWarnings("serial")
942   private java.util.List<com.google.api.HttpRule> additionalBindings_;
943   /**
944    *
945    *
946    * <pre>
947    * Additional HTTP bindings for the selector. Nested bindings must
948    * not contain an `additional_bindings` field themselves (that is,
949    * the nesting may only be one level deep).
950    * </pre>
951    *
952    * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
953    */
954   @java.lang.Override
getAdditionalBindingsList()955   public java.util.List<com.google.api.HttpRule> getAdditionalBindingsList() {
956     return additionalBindings_;
957   }
958   /**
959    *
960    *
961    * <pre>
962    * Additional HTTP bindings for the selector. Nested bindings must
963    * not contain an `additional_bindings` field themselves (that is,
964    * the nesting may only be one level deep).
965    * </pre>
966    *
967    * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
968    */
969   @java.lang.Override
970   public java.util.List<? extends com.google.api.HttpRuleOrBuilder>
getAdditionalBindingsOrBuilderList()971       getAdditionalBindingsOrBuilderList() {
972     return additionalBindings_;
973   }
974   /**
975    *
976    *
977    * <pre>
978    * Additional HTTP bindings for the selector. Nested bindings must
979    * not contain an `additional_bindings` field themselves (that is,
980    * the nesting may only be one level deep).
981    * </pre>
982    *
983    * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
984    */
985   @java.lang.Override
getAdditionalBindingsCount()986   public int getAdditionalBindingsCount() {
987     return additionalBindings_.size();
988   }
989   /**
990    *
991    *
992    * <pre>
993    * Additional HTTP bindings for the selector. Nested bindings must
994    * not contain an `additional_bindings` field themselves (that is,
995    * the nesting may only be one level deep).
996    * </pre>
997    *
998    * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
999    */
1000   @java.lang.Override
getAdditionalBindings(int index)1001   public com.google.api.HttpRule getAdditionalBindings(int index) {
1002     return additionalBindings_.get(index);
1003   }
1004   /**
1005    *
1006    *
1007    * <pre>
1008    * Additional HTTP bindings for the selector. Nested bindings must
1009    * not contain an `additional_bindings` field themselves (that is,
1010    * the nesting may only be one level deep).
1011    * </pre>
1012    *
1013    * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
1014    */
1015   @java.lang.Override
getAdditionalBindingsOrBuilder(int index)1016   public com.google.api.HttpRuleOrBuilder getAdditionalBindingsOrBuilder(int index) {
1017     return additionalBindings_.get(index);
1018   }
1019 
1020   private byte memoizedIsInitialized = -1;
1021 
1022   @java.lang.Override
isInitialized()1023   public final boolean isInitialized() {
1024     byte isInitialized = memoizedIsInitialized;
1025     if (isInitialized == 1) return true;
1026     if (isInitialized == 0) return false;
1027 
1028     memoizedIsInitialized = 1;
1029     return true;
1030   }
1031 
1032   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)1033   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
1034     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) {
1035       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, selector_);
1036     }
1037     if (patternCase_ == 2) {
1038       com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pattern_);
1039     }
1040     if (patternCase_ == 3) {
1041       com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pattern_);
1042     }
1043     if (patternCase_ == 4) {
1044       com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pattern_);
1045     }
1046     if (patternCase_ == 5) {
1047       com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pattern_);
1048     }
1049     if (patternCase_ == 6) {
1050       com.google.protobuf.GeneratedMessageV3.writeString(output, 6, pattern_);
1051     }
1052     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(body_)) {
1053       com.google.protobuf.GeneratedMessageV3.writeString(output, 7, body_);
1054     }
1055     if (patternCase_ == 8) {
1056       output.writeMessage(8, (com.google.api.CustomHttpPattern) pattern_);
1057     }
1058     for (int i = 0; i < additionalBindings_.size(); i++) {
1059       output.writeMessage(11, additionalBindings_.get(i));
1060     }
1061     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(responseBody_)) {
1062       com.google.protobuf.GeneratedMessageV3.writeString(output, 12, responseBody_);
1063     }
1064     getUnknownFields().writeTo(output);
1065   }
1066 
1067   @java.lang.Override
getSerializedSize()1068   public int getSerializedSize() {
1069     int size = memoizedSize;
1070     if (size != -1) return size;
1071 
1072     size = 0;
1073     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) {
1074       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, selector_);
1075     }
1076     if (patternCase_ == 2) {
1077       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pattern_);
1078     }
1079     if (patternCase_ == 3) {
1080       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pattern_);
1081     }
1082     if (patternCase_ == 4) {
1083       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pattern_);
1084     }
1085     if (patternCase_ == 5) {
1086       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pattern_);
1087     }
1088     if (patternCase_ == 6) {
1089       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, pattern_);
1090     }
1091     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(body_)) {
1092       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, body_);
1093     }
1094     if (patternCase_ == 8) {
1095       size +=
1096           com.google.protobuf.CodedOutputStream.computeMessageSize(
1097               8, (com.google.api.CustomHttpPattern) pattern_);
1098     }
1099     for (int i = 0; i < additionalBindings_.size(); i++) {
1100       size +=
1101           com.google.protobuf.CodedOutputStream.computeMessageSize(11, additionalBindings_.get(i));
1102     }
1103     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(responseBody_)) {
1104       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, responseBody_);
1105     }
1106     size += getUnknownFields().getSerializedSize();
1107     memoizedSize = size;
1108     return size;
1109   }
1110 
1111   @java.lang.Override
equals(final java.lang.Object obj)1112   public boolean equals(final java.lang.Object obj) {
1113     if (obj == this) {
1114       return true;
1115     }
1116     if (!(obj instanceof com.google.api.HttpRule)) {
1117       return super.equals(obj);
1118     }
1119     com.google.api.HttpRule other = (com.google.api.HttpRule) obj;
1120 
1121     if (!getSelector().equals(other.getSelector())) return false;
1122     if (!getBody().equals(other.getBody())) return false;
1123     if (!getResponseBody().equals(other.getResponseBody())) return false;
1124     if (!getAdditionalBindingsList().equals(other.getAdditionalBindingsList())) return false;
1125     if (!getPatternCase().equals(other.getPatternCase())) return false;
1126     switch (patternCase_) {
1127       case 2:
1128         if (!getGet().equals(other.getGet())) return false;
1129         break;
1130       case 3:
1131         if (!getPut().equals(other.getPut())) return false;
1132         break;
1133       case 4:
1134         if (!getPost().equals(other.getPost())) return false;
1135         break;
1136       case 5:
1137         if (!getDelete().equals(other.getDelete())) return false;
1138         break;
1139       case 6:
1140         if (!getPatch().equals(other.getPatch())) return false;
1141         break;
1142       case 8:
1143         if (!getCustom().equals(other.getCustom())) return false;
1144         break;
1145       case 0:
1146       default:
1147     }
1148     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
1149     return true;
1150   }
1151 
1152   @java.lang.Override
hashCode()1153   public int hashCode() {
1154     if (memoizedHashCode != 0) {
1155       return memoizedHashCode;
1156     }
1157     int hash = 41;
1158     hash = (19 * hash) + getDescriptor().hashCode();
1159     hash = (37 * hash) + SELECTOR_FIELD_NUMBER;
1160     hash = (53 * hash) + getSelector().hashCode();
1161     hash = (37 * hash) + BODY_FIELD_NUMBER;
1162     hash = (53 * hash) + getBody().hashCode();
1163     hash = (37 * hash) + RESPONSE_BODY_FIELD_NUMBER;
1164     hash = (53 * hash) + getResponseBody().hashCode();
1165     if (getAdditionalBindingsCount() > 0) {
1166       hash = (37 * hash) + ADDITIONAL_BINDINGS_FIELD_NUMBER;
1167       hash = (53 * hash) + getAdditionalBindingsList().hashCode();
1168     }
1169     switch (patternCase_) {
1170       case 2:
1171         hash = (37 * hash) + GET_FIELD_NUMBER;
1172         hash = (53 * hash) + getGet().hashCode();
1173         break;
1174       case 3:
1175         hash = (37 * hash) + PUT_FIELD_NUMBER;
1176         hash = (53 * hash) + getPut().hashCode();
1177         break;
1178       case 4:
1179         hash = (37 * hash) + POST_FIELD_NUMBER;
1180         hash = (53 * hash) + getPost().hashCode();
1181         break;
1182       case 5:
1183         hash = (37 * hash) + DELETE_FIELD_NUMBER;
1184         hash = (53 * hash) + getDelete().hashCode();
1185         break;
1186       case 6:
1187         hash = (37 * hash) + PATCH_FIELD_NUMBER;
1188         hash = (53 * hash) + getPatch().hashCode();
1189         break;
1190       case 8:
1191         hash = (37 * hash) + CUSTOM_FIELD_NUMBER;
1192         hash = (53 * hash) + getCustom().hashCode();
1193         break;
1194       case 0:
1195       default:
1196     }
1197     hash = (29 * hash) + getUnknownFields().hashCode();
1198     memoizedHashCode = hash;
1199     return hash;
1200   }
1201 
parseFrom(java.nio.ByteBuffer data)1202   public static com.google.api.HttpRule parseFrom(java.nio.ByteBuffer data)
1203       throws com.google.protobuf.InvalidProtocolBufferException {
1204     return PARSER.parseFrom(data);
1205   }
1206 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1207   public static com.google.api.HttpRule parseFrom(
1208       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1209       throws com.google.protobuf.InvalidProtocolBufferException {
1210     return PARSER.parseFrom(data, extensionRegistry);
1211   }
1212 
parseFrom(com.google.protobuf.ByteString data)1213   public static com.google.api.HttpRule parseFrom(com.google.protobuf.ByteString data)
1214       throws com.google.protobuf.InvalidProtocolBufferException {
1215     return PARSER.parseFrom(data);
1216   }
1217 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1218   public static com.google.api.HttpRule parseFrom(
1219       com.google.protobuf.ByteString data,
1220       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1221       throws com.google.protobuf.InvalidProtocolBufferException {
1222     return PARSER.parseFrom(data, extensionRegistry);
1223   }
1224 
parseFrom(byte[] data)1225   public static com.google.api.HttpRule parseFrom(byte[] data)
1226       throws com.google.protobuf.InvalidProtocolBufferException {
1227     return PARSER.parseFrom(data);
1228   }
1229 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1230   public static com.google.api.HttpRule parseFrom(
1231       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1232       throws com.google.protobuf.InvalidProtocolBufferException {
1233     return PARSER.parseFrom(data, extensionRegistry);
1234   }
1235 
parseFrom(java.io.InputStream input)1236   public static com.google.api.HttpRule parseFrom(java.io.InputStream input)
1237       throws java.io.IOException {
1238     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
1239   }
1240 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1241   public static com.google.api.HttpRule parseFrom(
1242       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1243       throws java.io.IOException {
1244     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
1245         PARSER, input, extensionRegistry);
1246   }
1247 
parseDelimitedFrom(java.io.InputStream input)1248   public static com.google.api.HttpRule parseDelimitedFrom(java.io.InputStream input)
1249       throws java.io.IOException {
1250     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
1251   }
1252 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1253   public static com.google.api.HttpRule parseDelimitedFrom(
1254       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1255       throws java.io.IOException {
1256     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
1257         PARSER, input, extensionRegistry);
1258   }
1259 
parseFrom(com.google.protobuf.CodedInputStream input)1260   public static com.google.api.HttpRule parseFrom(com.google.protobuf.CodedInputStream input)
1261       throws java.io.IOException {
1262     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
1263   }
1264 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1265   public static com.google.api.HttpRule parseFrom(
1266       com.google.protobuf.CodedInputStream input,
1267       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1268       throws java.io.IOException {
1269     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
1270         PARSER, input, extensionRegistry);
1271   }
1272 
1273   @java.lang.Override
newBuilderForType()1274   public Builder newBuilderForType() {
1275     return newBuilder();
1276   }
1277 
newBuilder()1278   public static Builder newBuilder() {
1279     return DEFAULT_INSTANCE.toBuilder();
1280   }
1281 
newBuilder(com.google.api.HttpRule prototype)1282   public static Builder newBuilder(com.google.api.HttpRule prototype) {
1283     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
1284   }
1285 
1286   @java.lang.Override
toBuilder()1287   public Builder toBuilder() {
1288     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
1289   }
1290 
1291   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1292   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
1293     Builder builder = new Builder(parent);
1294     return builder;
1295   }
1296   /**
1297    *
1298    *
1299    * <pre>
1300    * # gRPC Transcoding
1301    * gRPC Transcoding is a feature for mapping between a gRPC method and one or
1302    * more HTTP REST endpoints. It allows developers to build a single API service
1303    * that supports both gRPC APIs and REST APIs. Many systems, including [Google
1304    * APIs](https://github.com/googleapis/googleapis),
1305    * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
1306    * Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
1307    * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
1308    * and use it for large scale production services.
1309    * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
1310    * how different portions of the gRPC request message are mapped to the URL
1311    * path, URL query parameters, and HTTP request body. It also controls how the
1312    * gRPC response message is mapped to the HTTP response body. `HttpRule` is
1313    * typically specified as an `google.api.http` annotation on the gRPC method.
1314    * Each mapping specifies a URL path template and an HTTP method. The path
1315    * template may refer to one or more fields in the gRPC request message, as long
1316    * as each field is a non-repeated field with a primitive (non-message) type.
1317    * The path template controls how fields of the request message are mapped to
1318    * the URL path.
1319    * Example:
1320    *     service Messaging {
1321    *       rpc GetMessage(GetMessageRequest) returns (Message) {
1322    *         option (google.api.http) = {
1323    *             get: "/v1/{name=messages/&#42;}"
1324    *         };
1325    *       }
1326    *     }
1327    *     message GetMessageRequest {
1328    *       string name = 1; // Mapped to URL path.
1329    *     }
1330    *     message Message {
1331    *       string text = 1; // The resource content.
1332    *     }
1333    * This enables an HTTP REST to gRPC mapping as below:
1334    * HTTP | gRPC
1335    * -----|-----
1336    * `GET /v1/messages/123456`  | `GetMessage(name: "messages/123456")`
1337    * Any fields in the request message which are not bound by the path template
1338    * automatically become HTTP query parameters if there is no HTTP request body.
1339    * For example:
1340    *     service Messaging {
1341    *       rpc GetMessage(GetMessageRequest) returns (Message) {
1342    *         option (google.api.http) = {
1343    *             get:"/v1/messages/{message_id}"
1344    *         };
1345    *       }
1346    *     }
1347    *     message GetMessageRequest {
1348    *       message SubMessage {
1349    *         string subfield = 1;
1350    *       }
1351    *       string message_id = 1; // Mapped to URL path.
1352    *       int64 revision = 2;    // Mapped to URL query parameter `revision`.
1353    *       SubMessage sub = 3;    // Mapped to URL query parameter `sub.subfield`.
1354    *     }
1355    * This enables a HTTP JSON to RPC mapping as below:
1356    * HTTP | gRPC
1357    * -----|-----
1358    * `GET /v1/messages/123456?revision=2&amp;sub.subfield=foo` |
1359    * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
1360    * "foo"))`
1361    * Note that fields which are mapped to URL query parameters must have a
1362    * primitive type or a repeated primitive type or a non-repeated message type.
1363    * In the case of a repeated type, the parameter can be repeated in the URL
1364    * as `...?param=A&amp;param=B`. In the case of a message type, each field of the
1365    * message is mapped to a separate parameter, such as
1366    * `...?foo.a=A&amp;foo.b=B&amp;foo.c=C`.
1367    * For HTTP methods that allow a request body, the `body` field
1368    * specifies the mapping. Consider a REST update method on the
1369    * message resource collection:
1370    *     service Messaging {
1371    *       rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
1372    *         option (google.api.http) = {
1373    *           patch: "/v1/messages/{message_id}"
1374    *           body: "message"
1375    *         };
1376    *       }
1377    *     }
1378    *     message UpdateMessageRequest {
1379    *       string message_id = 1; // mapped to the URL
1380    *       Message message = 2;   // mapped to the body
1381    *     }
1382    * The following HTTP JSON to RPC mapping is enabled, where the
1383    * representation of the JSON in the request body is determined by
1384    * protos JSON encoding:
1385    * HTTP | gRPC
1386    * -----|-----
1387    * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
1388    * "123456" message { text: "Hi!" })`
1389    * The special name `*` can be used in the body mapping to define that
1390    * every field not bound by the path template should be mapped to the
1391    * request body.  This enables the following alternative definition of
1392    * the update method:
1393    *     service Messaging {
1394    *       rpc UpdateMessage(Message) returns (Message) {
1395    *         option (google.api.http) = {
1396    *           patch: "/v1/messages/{message_id}"
1397    *           body: "*"
1398    *         };
1399    *       }
1400    *     }
1401    *     message Message {
1402    *       string message_id = 1;
1403    *       string text = 2;
1404    *     }
1405    * The following HTTP JSON to RPC mapping is enabled:
1406    * HTTP | gRPC
1407    * -----|-----
1408    * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
1409    * "123456" text: "Hi!")`
1410    * Note that when using `*` in the body mapping, it is not possible to
1411    * have HTTP parameters, as all fields not bound by the path end in
1412    * the body. This makes this option more rarely used in practice when
1413    * defining REST APIs. The common usage of `*` is in custom methods
1414    * which don't use the URL at all for transferring data.
1415    * It is possible to define multiple HTTP methods for one RPC by using
1416    * the `additional_bindings` option. Example:
1417    *     service Messaging {
1418    *       rpc GetMessage(GetMessageRequest) returns (Message) {
1419    *         option (google.api.http) = {
1420    *           get: "/v1/messages/{message_id}"
1421    *           additional_bindings {
1422    *             get: "/v1/users/{user_id}/messages/{message_id}"
1423    *           }
1424    *         };
1425    *       }
1426    *     }
1427    *     message GetMessageRequest {
1428    *       string message_id = 1;
1429    *       string user_id = 2;
1430    *     }
1431    * This enables the following two alternative HTTP JSON to RPC mappings:
1432    * HTTP | gRPC
1433    * -----|-----
1434    * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
1435    * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
1436    * "123456")`
1437    * ## Rules for HTTP mapping
1438    * 1. Leaf request fields (recursive expansion nested messages in the request
1439    *    message) are classified into three categories:
1440    *    - Fields referred by the path template. They are passed via the URL path.
1441    *    - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
1442    *    are passed via the HTTP
1443    *      request body.
1444    *    - All other fields are passed via the URL query parameters, and the
1445    *      parameter name is the field path in the request message. A repeated
1446    *      field can be represented as multiple query parameters under the same
1447    *      name.
1448    *  2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
1449    *  query parameter, all fields
1450    *     are passed via URL path and HTTP request body.
1451    *  3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
1452    *  request body, all
1453    *     fields are passed via URL path and URL query parameters.
1454    * ### Path template syntax
1455    *     Template = "/" Segments [ Verb ] ;
1456    *     Segments = Segment { "/" Segment } ;
1457    *     Segment  = "*" | "**" | LITERAL | Variable ;
1458    *     Variable = "{" FieldPath [ "=" Segments ] "}" ;
1459    *     FieldPath = IDENT { "." IDENT } ;
1460    *     Verb     = ":" LITERAL ;
1461    * The syntax `*` matches a single URL path segment. The syntax `**` matches
1462    * zero or more URL path segments, which must be the last part of the URL path
1463    * except the `Verb`.
1464    * The syntax `Variable` matches part of the URL path as specified by its
1465    * template. A variable template must not contain other variables. If a variable
1466    * matches a single path segment, its template may be omitted, e.g. `{var}`
1467    * is equivalent to `{var=*}`.
1468    * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
1469    * contains any reserved character, such characters should be percent-encoded
1470    * before the matching.
1471    * If a variable contains exactly one path segment, such as `"{var}"` or
1472    * `"{var=*}"`, when such a variable is expanded into a URL path on the client
1473    * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
1474    * server side does the reverse decoding. Such variables show up in the
1475    * [Discovery
1476    * Document](https://developers.google.com/discovery/v1/reference/apis) as
1477    * `{var}`.
1478    * If a variable contains multiple path segments, such as `"{var=foo/&#42;}"`
1479    * or `"{var=**}"`, when such a variable is expanded into a URL path on the
1480    * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
1481    * The server side does the reverse decoding, except "%2F" and "%2f" are left
1482    * unchanged. Such variables show up in the
1483    * [Discovery
1484    * Document](https://developers.google.com/discovery/v1/reference/apis) as
1485    * `{+var}`.
1486    * ## Using gRPC API Service Configuration
1487    * gRPC API Service Configuration (service config) is a configuration language
1488    * for configuring a gRPC service to become a user-facing product. The
1489    * service config is simply the YAML representation of the `google.api.Service`
1490    * proto message.
1491    * As an alternative to annotating your proto file, you can configure gRPC
1492    * transcoding in your service config YAML files. You do this by specifying a
1493    * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
1494    * effect as the proto annotation. This can be particularly useful if you
1495    * have a proto that is reused in multiple services. Note that any transcoding
1496    * specified in the service config will override any matching transcoding
1497    * configuration in the proto.
1498    * Example:
1499    *     http:
1500    *       rules:
1501    *         # Selects a gRPC method and applies HttpRule to it.
1502    *         - selector: example.v1.Messaging.GetMessage
1503    *           get: /v1/messages/{message_id}/{sub.subfield}
1504    * ## Special notes
1505    * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
1506    * proto to JSON conversion must follow the [proto3
1507    * specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
1508    * While the single segment variable follows the semantics of
1509    * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
1510    * Expansion, the multi segment variable **does not** follow RFC 6570 Section
1511    * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
1512    * does not expand special characters like `?` and `#`, which would lead
1513    * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
1514    * for multi segment variables.
1515    * The path variables **must not** refer to any repeated or mapped field,
1516    * because client libraries are not capable of handling such variable expansion.
1517    * The path variables **must not** capture the leading "/" character. The reason
1518    * is that the most common use case "{var}" does not capture the leading "/"
1519    * character. For consistency, all path variables must share the same behavior.
1520    * Repeated message fields must not be mapped to URL query parameters, because
1521    * no client library can support such complicated mapping.
1522    * If an API needs to use a JSON array for request or response body, it can map
1523    * the request or response body to a repeated field. However, some gRPC
1524    * Transcoding implementations may not support this feature.
1525    * </pre>
1526    *
1527    * Protobuf type {@code google.api.HttpRule}
1528    */
1529   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
1530       implements
1531       // @@protoc_insertion_point(builder_implements:google.api.HttpRule)
1532       com.google.api.HttpRuleOrBuilder {
getDescriptor()1533     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
1534       return com.google.api.HttpProto.internal_static_google_api_HttpRule_descriptor;
1535     }
1536 
1537     @java.lang.Override
1538     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()1539         internalGetFieldAccessorTable() {
1540       return com.google.api.HttpProto.internal_static_google_api_HttpRule_fieldAccessorTable
1541           .ensureFieldAccessorsInitialized(
1542               com.google.api.HttpRule.class, com.google.api.HttpRule.Builder.class);
1543     }
1544 
1545     // Construct using com.google.api.HttpRule.newBuilder()
Builder()1546     private Builder() {}
1547 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1548     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
1549       super(parent);
1550     }
1551 
1552     @java.lang.Override
clear()1553     public Builder clear() {
1554       super.clear();
1555       bitField0_ = 0;
1556       selector_ = "";
1557       if (customBuilder_ != null) {
1558         customBuilder_.clear();
1559       }
1560       body_ = "";
1561       responseBody_ = "";
1562       if (additionalBindingsBuilder_ == null) {
1563         additionalBindings_ = java.util.Collections.emptyList();
1564       } else {
1565         additionalBindings_ = null;
1566         additionalBindingsBuilder_.clear();
1567       }
1568       bitField0_ = (bitField0_ & ~0x00000200);
1569       patternCase_ = 0;
1570       pattern_ = null;
1571       return this;
1572     }
1573 
1574     @java.lang.Override
getDescriptorForType()1575     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
1576       return com.google.api.HttpProto.internal_static_google_api_HttpRule_descriptor;
1577     }
1578 
1579     @java.lang.Override
getDefaultInstanceForType()1580     public com.google.api.HttpRule getDefaultInstanceForType() {
1581       return com.google.api.HttpRule.getDefaultInstance();
1582     }
1583 
1584     @java.lang.Override
build()1585     public com.google.api.HttpRule build() {
1586       com.google.api.HttpRule result = buildPartial();
1587       if (!result.isInitialized()) {
1588         throw newUninitializedMessageException(result);
1589       }
1590       return result;
1591     }
1592 
1593     @java.lang.Override
buildPartial()1594     public com.google.api.HttpRule buildPartial() {
1595       com.google.api.HttpRule result = new com.google.api.HttpRule(this);
1596       buildPartialRepeatedFields(result);
1597       if (bitField0_ != 0) {
1598         buildPartial0(result);
1599       }
1600       buildPartialOneofs(result);
1601       onBuilt();
1602       return result;
1603     }
1604 
buildPartialRepeatedFields(com.google.api.HttpRule result)1605     private void buildPartialRepeatedFields(com.google.api.HttpRule result) {
1606       if (additionalBindingsBuilder_ == null) {
1607         if (((bitField0_ & 0x00000200) != 0)) {
1608           additionalBindings_ = java.util.Collections.unmodifiableList(additionalBindings_);
1609           bitField0_ = (bitField0_ & ~0x00000200);
1610         }
1611         result.additionalBindings_ = additionalBindings_;
1612       } else {
1613         result.additionalBindings_ = additionalBindingsBuilder_.build();
1614       }
1615     }
1616 
buildPartial0(com.google.api.HttpRule result)1617     private void buildPartial0(com.google.api.HttpRule result) {
1618       int from_bitField0_ = bitField0_;
1619       if (((from_bitField0_ & 0x00000001) != 0)) {
1620         result.selector_ = selector_;
1621       }
1622       if (((from_bitField0_ & 0x00000080) != 0)) {
1623         result.body_ = body_;
1624       }
1625       if (((from_bitField0_ & 0x00000100) != 0)) {
1626         result.responseBody_ = responseBody_;
1627       }
1628     }
1629 
buildPartialOneofs(com.google.api.HttpRule result)1630     private void buildPartialOneofs(com.google.api.HttpRule result) {
1631       result.patternCase_ = patternCase_;
1632       result.pattern_ = this.pattern_;
1633       if (patternCase_ == 8 && customBuilder_ != null) {
1634         result.pattern_ = customBuilder_.build();
1635       }
1636     }
1637 
1638     @java.lang.Override
clone()1639     public Builder clone() {
1640       return super.clone();
1641     }
1642 
1643     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1644     public Builder setField(
1645         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
1646       return super.setField(field, value);
1647     }
1648 
1649     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1650     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
1651       return super.clearField(field);
1652     }
1653 
1654     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1655     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
1656       return super.clearOneof(oneof);
1657     }
1658 
1659     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1660     public Builder setRepeatedField(
1661         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
1662       return super.setRepeatedField(field, index, value);
1663     }
1664 
1665     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1666     public Builder addRepeatedField(
1667         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
1668       return super.addRepeatedField(field, value);
1669     }
1670 
1671     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)1672     public Builder mergeFrom(com.google.protobuf.Message other) {
1673       if (other instanceof com.google.api.HttpRule) {
1674         return mergeFrom((com.google.api.HttpRule) other);
1675       } else {
1676         super.mergeFrom(other);
1677         return this;
1678       }
1679     }
1680 
mergeFrom(com.google.api.HttpRule other)1681     public Builder mergeFrom(com.google.api.HttpRule other) {
1682       if (other == com.google.api.HttpRule.getDefaultInstance()) return this;
1683       if (!other.getSelector().isEmpty()) {
1684         selector_ = other.selector_;
1685         bitField0_ |= 0x00000001;
1686         onChanged();
1687       }
1688       if (!other.getBody().isEmpty()) {
1689         body_ = other.body_;
1690         bitField0_ |= 0x00000080;
1691         onChanged();
1692       }
1693       if (!other.getResponseBody().isEmpty()) {
1694         responseBody_ = other.responseBody_;
1695         bitField0_ |= 0x00000100;
1696         onChanged();
1697       }
1698       if (additionalBindingsBuilder_ == null) {
1699         if (!other.additionalBindings_.isEmpty()) {
1700           if (additionalBindings_.isEmpty()) {
1701             additionalBindings_ = other.additionalBindings_;
1702             bitField0_ = (bitField0_ & ~0x00000200);
1703           } else {
1704             ensureAdditionalBindingsIsMutable();
1705             additionalBindings_.addAll(other.additionalBindings_);
1706           }
1707           onChanged();
1708         }
1709       } else {
1710         if (!other.additionalBindings_.isEmpty()) {
1711           if (additionalBindingsBuilder_.isEmpty()) {
1712             additionalBindingsBuilder_.dispose();
1713             additionalBindingsBuilder_ = null;
1714             additionalBindings_ = other.additionalBindings_;
1715             bitField0_ = (bitField0_ & ~0x00000200);
1716             additionalBindingsBuilder_ =
1717                 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
1718                     ? getAdditionalBindingsFieldBuilder()
1719                     : null;
1720           } else {
1721             additionalBindingsBuilder_.addAllMessages(other.additionalBindings_);
1722           }
1723         }
1724       }
1725       switch (other.getPatternCase()) {
1726         case GET:
1727           {
1728             patternCase_ = 2;
1729             pattern_ = other.pattern_;
1730             onChanged();
1731             break;
1732           }
1733         case PUT:
1734           {
1735             patternCase_ = 3;
1736             pattern_ = other.pattern_;
1737             onChanged();
1738             break;
1739           }
1740         case POST:
1741           {
1742             patternCase_ = 4;
1743             pattern_ = other.pattern_;
1744             onChanged();
1745             break;
1746           }
1747         case DELETE:
1748           {
1749             patternCase_ = 5;
1750             pattern_ = other.pattern_;
1751             onChanged();
1752             break;
1753           }
1754         case PATCH:
1755           {
1756             patternCase_ = 6;
1757             pattern_ = other.pattern_;
1758             onChanged();
1759             break;
1760           }
1761         case CUSTOM:
1762           {
1763             mergeCustom(other.getCustom());
1764             break;
1765           }
1766         case PATTERN_NOT_SET:
1767           {
1768             break;
1769           }
1770       }
1771       this.mergeUnknownFields(other.getUnknownFields());
1772       onChanged();
1773       return this;
1774     }
1775 
1776     @java.lang.Override
isInitialized()1777     public final boolean isInitialized() {
1778       return true;
1779     }
1780 
1781     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1782     public Builder mergeFrom(
1783         com.google.protobuf.CodedInputStream input,
1784         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1785         throws java.io.IOException {
1786       if (extensionRegistry == null) {
1787         throw new java.lang.NullPointerException();
1788       }
1789       try {
1790         boolean done = false;
1791         while (!done) {
1792           int tag = input.readTag();
1793           switch (tag) {
1794             case 0:
1795               done = true;
1796               break;
1797             case 10:
1798               {
1799                 selector_ = input.readStringRequireUtf8();
1800                 bitField0_ |= 0x00000001;
1801                 break;
1802               } // case 10
1803             case 18:
1804               {
1805                 java.lang.String s = input.readStringRequireUtf8();
1806                 patternCase_ = 2;
1807                 pattern_ = s;
1808                 break;
1809               } // case 18
1810             case 26:
1811               {
1812                 java.lang.String s = input.readStringRequireUtf8();
1813                 patternCase_ = 3;
1814                 pattern_ = s;
1815                 break;
1816               } // case 26
1817             case 34:
1818               {
1819                 java.lang.String s = input.readStringRequireUtf8();
1820                 patternCase_ = 4;
1821                 pattern_ = s;
1822                 break;
1823               } // case 34
1824             case 42:
1825               {
1826                 java.lang.String s = input.readStringRequireUtf8();
1827                 patternCase_ = 5;
1828                 pattern_ = s;
1829                 break;
1830               } // case 42
1831             case 50:
1832               {
1833                 java.lang.String s = input.readStringRequireUtf8();
1834                 patternCase_ = 6;
1835                 pattern_ = s;
1836                 break;
1837               } // case 50
1838             case 58:
1839               {
1840                 body_ = input.readStringRequireUtf8();
1841                 bitField0_ |= 0x00000080;
1842                 break;
1843               } // case 58
1844             case 66:
1845               {
1846                 input.readMessage(getCustomFieldBuilder().getBuilder(), extensionRegistry);
1847                 patternCase_ = 8;
1848                 break;
1849               } // case 66
1850             case 90:
1851               {
1852                 com.google.api.HttpRule m =
1853                     input.readMessage(com.google.api.HttpRule.parser(), extensionRegistry);
1854                 if (additionalBindingsBuilder_ == null) {
1855                   ensureAdditionalBindingsIsMutable();
1856                   additionalBindings_.add(m);
1857                 } else {
1858                   additionalBindingsBuilder_.addMessage(m);
1859                 }
1860                 break;
1861               } // case 90
1862             case 98:
1863               {
1864                 responseBody_ = input.readStringRequireUtf8();
1865                 bitField0_ |= 0x00000100;
1866                 break;
1867               } // case 98
1868             default:
1869               {
1870                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
1871                   done = true; // was an endgroup tag
1872                 }
1873                 break;
1874               } // default:
1875           } // switch (tag)
1876         } // while (!done)
1877       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1878         throw e.unwrapIOException();
1879       } finally {
1880         onChanged();
1881       } // finally
1882       return this;
1883     }
1884 
1885     private int patternCase_ = 0;
1886     private java.lang.Object pattern_;
1887 
getPatternCase()1888     public PatternCase getPatternCase() {
1889       return PatternCase.forNumber(patternCase_);
1890     }
1891 
clearPattern()1892     public Builder clearPattern() {
1893       patternCase_ = 0;
1894       pattern_ = null;
1895       onChanged();
1896       return this;
1897     }
1898 
1899     private int bitField0_;
1900 
1901     private java.lang.Object selector_ = "";
1902     /**
1903      *
1904      *
1905      * <pre>
1906      * Selects a method to which this rule applies.
1907      * Refer to [selector][google.api.DocumentationRule.selector] for syntax
1908      * details.
1909      * </pre>
1910      *
1911      * <code>string selector = 1;</code>
1912      *
1913      * @return The selector.
1914      */
getSelector()1915     public java.lang.String getSelector() {
1916       java.lang.Object ref = selector_;
1917       if (!(ref instanceof java.lang.String)) {
1918         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1919         java.lang.String s = bs.toStringUtf8();
1920         selector_ = s;
1921         return s;
1922       } else {
1923         return (java.lang.String) ref;
1924       }
1925     }
1926     /**
1927      *
1928      *
1929      * <pre>
1930      * Selects a method to which this rule applies.
1931      * Refer to [selector][google.api.DocumentationRule.selector] for syntax
1932      * details.
1933      * </pre>
1934      *
1935      * <code>string selector = 1;</code>
1936      *
1937      * @return The bytes for selector.
1938      */
getSelectorBytes()1939     public com.google.protobuf.ByteString getSelectorBytes() {
1940       java.lang.Object ref = selector_;
1941       if (ref instanceof String) {
1942         com.google.protobuf.ByteString b =
1943             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1944         selector_ = b;
1945         return b;
1946       } else {
1947         return (com.google.protobuf.ByteString) ref;
1948       }
1949     }
1950     /**
1951      *
1952      *
1953      * <pre>
1954      * Selects a method to which this rule applies.
1955      * Refer to [selector][google.api.DocumentationRule.selector] for syntax
1956      * details.
1957      * </pre>
1958      *
1959      * <code>string selector = 1;</code>
1960      *
1961      * @param value The selector to set.
1962      * @return This builder for chaining.
1963      */
setSelector(java.lang.String value)1964     public Builder setSelector(java.lang.String value) {
1965       if (value == null) {
1966         throw new NullPointerException();
1967       }
1968       selector_ = value;
1969       bitField0_ |= 0x00000001;
1970       onChanged();
1971       return this;
1972     }
1973     /**
1974      *
1975      *
1976      * <pre>
1977      * Selects a method to which this rule applies.
1978      * Refer to [selector][google.api.DocumentationRule.selector] for syntax
1979      * details.
1980      * </pre>
1981      *
1982      * <code>string selector = 1;</code>
1983      *
1984      * @return This builder for chaining.
1985      */
clearSelector()1986     public Builder clearSelector() {
1987       selector_ = getDefaultInstance().getSelector();
1988       bitField0_ = (bitField0_ & ~0x00000001);
1989       onChanged();
1990       return this;
1991     }
1992     /**
1993      *
1994      *
1995      * <pre>
1996      * Selects a method to which this rule applies.
1997      * Refer to [selector][google.api.DocumentationRule.selector] for syntax
1998      * details.
1999      * </pre>
2000      *
2001      * <code>string selector = 1;</code>
2002      *
2003      * @param value The bytes for selector to set.
2004      * @return This builder for chaining.
2005      */
setSelectorBytes(com.google.protobuf.ByteString value)2006     public Builder setSelectorBytes(com.google.protobuf.ByteString value) {
2007       if (value == null) {
2008         throw new NullPointerException();
2009       }
2010       checkByteStringIsUtf8(value);
2011       selector_ = value;
2012       bitField0_ |= 0x00000001;
2013       onChanged();
2014       return this;
2015     }
2016 
2017     /**
2018      *
2019      *
2020      * <pre>
2021      * Maps to HTTP GET. Used for listing and getting information about
2022      * resources.
2023      * </pre>
2024      *
2025      * <code>string get = 2;</code>
2026      *
2027      * @return Whether the get field is set.
2028      */
2029     @java.lang.Override
hasGet()2030     public boolean hasGet() {
2031       return patternCase_ == 2;
2032     }
2033     /**
2034      *
2035      *
2036      * <pre>
2037      * Maps to HTTP GET. Used for listing and getting information about
2038      * resources.
2039      * </pre>
2040      *
2041      * <code>string get = 2;</code>
2042      *
2043      * @return The get.
2044      */
2045     @java.lang.Override
getGet()2046     public java.lang.String getGet() {
2047       java.lang.Object ref = "";
2048       if (patternCase_ == 2) {
2049         ref = pattern_;
2050       }
2051       if (!(ref instanceof java.lang.String)) {
2052         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2053         java.lang.String s = bs.toStringUtf8();
2054         if (patternCase_ == 2) {
2055           pattern_ = s;
2056         }
2057         return s;
2058       } else {
2059         return (java.lang.String) ref;
2060       }
2061     }
2062     /**
2063      *
2064      *
2065      * <pre>
2066      * Maps to HTTP GET. Used for listing and getting information about
2067      * resources.
2068      * </pre>
2069      *
2070      * <code>string get = 2;</code>
2071      *
2072      * @return The bytes for get.
2073      */
2074     @java.lang.Override
getGetBytes()2075     public com.google.protobuf.ByteString getGetBytes() {
2076       java.lang.Object ref = "";
2077       if (patternCase_ == 2) {
2078         ref = pattern_;
2079       }
2080       if (ref instanceof String) {
2081         com.google.protobuf.ByteString b =
2082             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2083         if (patternCase_ == 2) {
2084           pattern_ = b;
2085         }
2086         return b;
2087       } else {
2088         return (com.google.protobuf.ByteString) ref;
2089       }
2090     }
2091     /**
2092      *
2093      *
2094      * <pre>
2095      * Maps to HTTP GET. Used for listing and getting information about
2096      * resources.
2097      * </pre>
2098      *
2099      * <code>string get = 2;</code>
2100      *
2101      * @param value The get to set.
2102      * @return This builder for chaining.
2103      */
setGet(java.lang.String value)2104     public Builder setGet(java.lang.String value) {
2105       if (value == null) {
2106         throw new NullPointerException();
2107       }
2108       patternCase_ = 2;
2109       pattern_ = value;
2110       onChanged();
2111       return this;
2112     }
2113     /**
2114      *
2115      *
2116      * <pre>
2117      * Maps to HTTP GET. Used for listing and getting information about
2118      * resources.
2119      * </pre>
2120      *
2121      * <code>string get = 2;</code>
2122      *
2123      * @return This builder for chaining.
2124      */
clearGet()2125     public Builder clearGet() {
2126       if (patternCase_ == 2) {
2127         patternCase_ = 0;
2128         pattern_ = null;
2129         onChanged();
2130       }
2131       return this;
2132     }
2133     /**
2134      *
2135      *
2136      * <pre>
2137      * Maps to HTTP GET. Used for listing and getting information about
2138      * resources.
2139      * </pre>
2140      *
2141      * <code>string get = 2;</code>
2142      *
2143      * @param value The bytes for get to set.
2144      * @return This builder for chaining.
2145      */
setGetBytes(com.google.protobuf.ByteString value)2146     public Builder setGetBytes(com.google.protobuf.ByteString value) {
2147       if (value == null) {
2148         throw new NullPointerException();
2149       }
2150       checkByteStringIsUtf8(value);
2151       patternCase_ = 2;
2152       pattern_ = value;
2153       onChanged();
2154       return this;
2155     }
2156 
2157     /**
2158      *
2159      *
2160      * <pre>
2161      * Maps to HTTP PUT. Used for replacing a resource.
2162      * </pre>
2163      *
2164      * <code>string put = 3;</code>
2165      *
2166      * @return Whether the put field is set.
2167      */
2168     @java.lang.Override
hasPut()2169     public boolean hasPut() {
2170       return patternCase_ == 3;
2171     }
2172     /**
2173      *
2174      *
2175      * <pre>
2176      * Maps to HTTP PUT. Used for replacing a resource.
2177      * </pre>
2178      *
2179      * <code>string put = 3;</code>
2180      *
2181      * @return The put.
2182      */
2183     @java.lang.Override
getPut()2184     public java.lang.String getPut() {
2185       java.lang.Object ref = "";
2186       if (patternCase_ == 3) {
2187         ref = pattern_;
2188       }
2189       if (!(ref instanceof java.lang.String)) {
2190         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2191         java.lang.String s = bs.toStringUtf8();
2192         if (patternCase_ == 3) {
2193           pattern_ = s;
2194         }
2195         return s;
2196       } else {
2197         return (java.lang.String) ref;
2198       }
2199     }
2200     /**
2201      *
2202      *
2203      * <pre>
2204      * Maps to HTTP PUT. Used for replacing a resource.
2205      * </pre>
2206      *
2207      * <code>string put = 3;</code>
2208      *
2209      * @return The bytes for put.
2210      */
2211     @java.lang.Override
getPutBytes()2212     public com.google.protobuf.ByteString getPutBytes() {
2213       java.lang.Object ref = "";
2214       if (patternCase_ == 3) {
2215         ref = pattern_;
2216       }
2217       if (ref instanceof String) {
2218         com.google.protobuf.ByteString b =
2219             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2220         if (patternCase_ == 3) {
2221           pattern_ = b;
2222         }
2223         return b;
2224       } else {
2225         return (com.google.protobuf.ByteString) ref;
2226       }
2227     }
2228     /**
2229      *
2230      *
2231      * <pre>
2232      * Maps to HTTP PUT. Used for replacing a resource.
2233      * </pre>
2234      *
2235      * <code>string put = 3;</code>
2236      *
2237      * @param value The put to set.
2238      * @return This builder for chaining.
2239      */
setPut(java.lang.String value)2240     public Builder setPut(java.lang.String value) {
2241       if (value == null) {
2242         throw new NullPointerException();
2243       }
2244       patternCase_ = 3;
2245       pattern_ = value;
2246       onChanged();
2247       return this;
2248     }
2249     /**
2250      *
2251      *
2252      * <pre>
2253      * Maps to HTTP PUT. Used for replacing a resource.
2254      * </pre>
2255      *
2256      * <code>string put = 3;</code>
2257      *
2258      * @return This builder for chaining.
2259      */
clearPut()2260     public Builder clearPut() {
2261       if (patternCase_ == 3) {
2262         patternCase_ = 0;
2263         pattern_ = null;
2264         onChanged();
2265       }
2266       return this;
2267     }
2268     /**
2269      *
2270      *
2271      * <pre>
2272      * Maps to HTTP PUT. Used for replacing a resource.
2273      * </pre>
2274      *
2275      * <code>string put = 3;</code>
2276      *
2277      * @param value The bytes for put to set.
2278      * @return This builder for chaining.
2279      */
setPutBytes(com.google.protobuf.ByteString value)2280     public Builder setPutBytes(com.google.protobuf.ByteString value) {
2281       if (value == null) {
2282         throw new NullPointerException();
2283       }
2284       checkByteStringIsUtf8(value);
2285       patternCase_ = 3;
2286       pattern_ = value;
2287       onChanged();
2288       return this;
2289     }
2290 
2291     /**
2292      *
2293      *
2294      * <pre>
2295      * Maps to HTTP POST. Used for creating a resource or performing an action.
2296      * </pre>
2297      *
2298      * <code>string post = 4;</code>
2299      *
2300      * @return Whether the post field is set.
2301      */
2302     @java.lang.Override
hasPost()2303     public boolean hasPost() {
2304       return patternCase_ == 4;
2305     }
2306     /**
2307      *
2308      *
2309      * <pre>
2310      * Maps to HTTP POST. Used for creating a resource or performing an action.
2311      * </pre>
2312      *
2313      * <code>string post = 4;</code>
2314      *
2315      * @return The post.
2316      */
2317     @java.lang.Override
getPost()2318     public java.lang.String getPost() {
2319       java.lang.Object ref = "";
2320       if (patternCase_ == 4) {
2321         ref = pattern_;
2322       }
2323       if (!(ref instanceof java.lang.String)) {
2324         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2325         java.lang.String s = bs.toStringUtf8();
2326         if (patternCase_ == 4) {
2327           pattern_ = s;
2328         }
2329         return s;
2330       } else {
2331         return (java.lang.String) ref;
2332       }
2333     }
2334     /**
2335      *
2336      *
2337      * <pre>
2338      * Maps to HTTP POST. Used for creating a resource or performing an action.
2339      * </pre>
2340      *
2341      * <code>string post = 4;</code>
2342      *
2343      * @return The bytes for post.
2344      */
2345     @java.lang.Override
getPostBytes()2346     public com.google.protobuf.ByteString getPostBytes() {
2347       java.lang.Object ref = "";
2348       if (patternCase_ == 4) {
2349         ref = pattern_;
2350       }
2351       if (ref instanceof String) {
2352         com.google.protobuf.ByteString b =
2353             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2354         if (patternCase_ == 4) {
2355           pattern_ = b;
2356         }
2357         return b;
2358       } else {
2359         return (com.google.protobuf.ByteString) ref;
2360       }
2361     }
2362     /**
2363      *
2364      *
2365      * <pre>
2366      * Maps to HTTP POST. Used for creating a resource or performing an action.
2367      * </pre>
2368      *
2369      * <code>string post = 4;</code>
2370      *
2371      * @param value The post to set.
2372      * @return This builder for chaining.
2373      */
setPost(java.lang.String value)2374     public Builder setPost(java.lang.String value) {
2375       if (value == null) {
2376         throw new NullPointerException();
2377       }
2378       patternCase_ = 4;
2379       pattern_ = value;
2380       onChanged();
2381       return this;
2382     }
2383     /**
2384      *
2385      *
2386      * <pre>
2387      * Maps to HTTP POST. Used for creating a resource or performing an action.
2388      * </pre>
2389      *
2390      * <code>string post = 4;</code>
2391      *
2392      * @return This builder for chaining.
2393      */
clearPost()2394     public Builder clearPost() {
2395       if (patternCase_ == 4) {
2396         patternCase_ = 0;
2397         pattern_ = null;
2398         onChanged();
2399       }
2400       return this;
2401     }
2402     /**
2403      *
2404      *
2405      * <pre>
2406      * Maps to HTTP POST. Used for creating a resource or performing an action.
2407      * </pre>
2408      *
2409      * <code>string post = 4;</code>
2410      *
2411      * @param value The bytes for post to set.
2412      * @return This builder for chaining.
2413      */
setPostBytes(com.google.protobuf.ByteString value)2414     public Builder setPostBytes(com.google.protobuf.ByteString value) {
2415       if (value == null) {
2416         throw new NullPointerException();
2417       }
2418       checkByteStringIsUtf8(value);
2419       patternCase_ = 4;
2420       pattern_ = value;
2421       onChanged();
2422       return this;
2423     }
2424 
2425     /**
2426      *
2427      *
2428      * <pre>
2429      * Maps to HTTP DELETE. Used for deleting a resource.
2430      * </pre>
2431      *
2432      * <code>string delete = 5;</code>
2433      *
2434      * @return Whether the delete field is set.
2435      */
2436     @java.lang.Override
hasDelete()2437     public boolean hasDelete() {
2438       return patternCase_ == 5;
2439     }
2440     /**
2441      *
2442      *
2443      * <pre>
2444      * Maps to HTTP DELETE. Used for deleting a resource.
2445      * </pre>
2446      *
2447      * <code>string delete = 5;</code>
2448      *
2449      * @return The delete.
2450      */
2451     @java.lang.Override
getDelete()2452     public java.lang.String getDelete() {
2453       java.lang.Object ref = "";
2454       if (patternCase_ == 5) {
2455         ref = pattern_;
2456       }
2457       if (!(ref instanceof java.lang.String)) {
2458         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2459         java.lang.String s = bs.toStringUtf8();
2460         if (patternCase_ == 5) {
2461           pattern_ = s;
2462         }
2463         return s;
2464       } else {
2465         return (java.lang.String) ref;
2466       }
2467     }
2468     /**
2469      *
2470      *
2471      * <pre>
2472      * Maps to HTTP DELETE. Used for deleting a resource.
2473      * </pre>
2474      *
2475      * <code>string delete = 5;</code>
2476      *
2477      * @return The bytes for delete.
2478      */
2479     @java.lang.Override
getDeleteBytes()2480     public com.google.protobuf.ByteString getDeleteBytes() {
2481       java.lang.Object ref = "";
2482       if (patternCase_ == 5) {
2483         ref = pattern_;
2484       }
2485       if (ref instanceof String) {
2486         com.google.protobuf.ByteString b =
2487             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2488         if (patternCase_ == 5) {
2489           pattern_ = b;
2490         }
2491         return b;
2492       } else {
2493         return (com.google.protobuf.ByteString) ref;
2494       }
2495     }
2496     /**
2497      *
2498      *
2499      * <pre>
2500      * Maps to HTTP DELETE. Used for deleting a resource.
2501      * </pre>
2502      *
2503      * <code>string delete = 5;</code>
2504      *
2505      * @param value The delete to set.
2506      * @return This builder for chaining.
2507      */
setDelete(java.lang.String value)2508     public Builder setDelete(java.lang.String value) {
2509       if (value == null) {
2510         throw new NullPointerException();
2511       }
2512       patternCase_ = 5;
2513       pattern_ = value;
2514       onChanged();
2515       return this;
2516     }
2517     /**
2518      *
2519      *
2520      * <pre>
2521      * Maps to HTTP DELETE. Used for deleting a resource.
2522      * </pre>
2523      *
2524      * <code>string delete = 5;</code>
2525      *
2526      * @return This builder for chaining.
2527      */
clearDelete()2528     public Builder clearDelete() {
2529       if (patternCase_ == 5) {
2530         patternCase_ = 0;
2531         pattern_ = null;
2532         onChanged();
2533       }
2534       return this;
2535     }
2536     /**
2537      *
2538      *
2539      * <pre>
2540      * Maps to HTTP DELETE. Used for deleting a resource.
2541      * </pre>
2542      *
2543      * <code>string delete = 5;</code>
2544      *
2545      * @param value The bytes for delete to set.
2546      * @return This builder for chaining.
2547      */
setDeleteBytes(com.google.protobuf.ByteString value)2548     public Builder setDeleteBytes(com.google.protobuf.ByteString value) {
2549       if (value == null) {
2550         throw new NullPointerException();
2551       }
2552       checkByteStringIsUtf8(value);
2553       patternCase_ = 5;
2554       pattern_ = value;
2555       onChanged();
2556       return this;
2557     }
2558 
2559     /**
2560      *
2561      *
2562      * <pre>
2563      * Maps to HTTP PATCH. Used for updating a resource.
2564      * </pre>
2565      *
2566      * <code>string patch = 6;</code>
2567      *
2568      * @return Whether the patch field is set.
2569      */
2570     @java.lang.Override
hasPatch()2571     public boolean hasPatch() {
2572       return patternCase_ == 6;
2573     }
2574     /**
2575      *
2576      *
2577      * <pre>
2578      * Maps to HTTP PATCH. Used for updating a resource.
2579      * </pre>
2580      *
2581      * <code>string patch = 6;</code>
2582      *
2583      * @return The patch.
2584      */
2585     @java.lang.Override
getPatch()2586     public java.lang.String getPatch() {
2587       java.lang.Object ref = "";
2588       if (patternCase_ == 6) {
2589         ref = pattern_;
2590       }
2591       if (!(ref instanceof java.lang.String)) {
2592         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2593         java.lang.String s = bs.toStringUtf8();
2594         if (patternCase_ == 6) {
2595           pattern_ = s;
2596         }
2597         return s;
2598       } else {
2599         return (java.lang.String) ref;
2600       }
2601     }
2602     /**
2603      *
2604      *
2605      * <pre>
2606      * Maps to HTTP PATCH. Used for updating a resource.
2607      * </pre>
2608      *
2609      * <code>string patch = 6;</code>
2610      *
2611      * @return The bytes for patch.
2612      */
2613     @java.lang.Override
getPatchBytes()2614     public com.google.protobuf.ByteString getPatchBytes() {
2615       java.lang.Object ref = "";
2616       if (patternCase_ == 6) {
2617         ref = pattern_;
2618       }
2619       if (ref instanceof String) {
2620         com.google.protobuf.ByteString b =
2621             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2622         if (patternCase_ == 6) {
2623           pattern_ = b;
2624         }
2625         return b;
2626       } else {
2627         return (com.google.protobuf.ByteString) ref;
2628       }
2629     }
2630     /**
2631      *
2632      *
2633      * <pre>
2634      * Maps to HTTP PATCH. Used for updating a resource.
2635      * </pre>
2636      *
2637      * <code>string patch = 6;</code>
2638      *
2639      * @param value The patch to set.
2640      * @return This builder for chaining.
2641      */
setPatch(java.lang.String value)2642     public Builder setPatch(java.lang.String value) {
2643       if (value == null) {
2644         throw new NullPointerException();
2645       }
2646       patternCase_ = 6;
2647       pattern_ = value;
2648       onChanged();
2649       return this;
2650     }
2651     /**
2652      *
2653      *
2654      * <pre>
2655      * Maps to HTTP PATCH. Used for updating a resource.
2656      * </pre>
2657      *
2658      * <code>string patch = 6;</code>
2659      *
2660      * @return This builder for chaining.
2661      */
clearPatch()2662     public Builder clearPatch() {
2663       if (patternCase_ == 6) {
2664         patternCase_ = 0;
2665         pattern_ = null;
2666         onChanged();
2667       }
2668       return this;
2669     }
2670     /**
2671      *
2672      *
2673      * <pre>
2674      * Maps to HTTP PATCH. Used for updating a resource.
2675      * </pre>
2676      *
2677      * <code>string patch = 6;</code>
2678      *
2679      * @param value The bytes for patch to set.
2680      * @return This builder for chaining.
2681      */
setPatchBytes(com.google.protobuf.ByteString value)2682     public Builder setPatchBytes(com.google.protobuf.ByteString value) {
2683       if (value == null) {
2684         throw new NullPointerException();
2685       }
2686       checkByteStringIsUtf8(value);
2687       patternCase_ = 6;
2688       pattern_ = value;
2689       onChanged();
2690       return this;
2691     }
2692 
2693     private com.google.protobuf.SingleFieldBuilderV3<
2694             com.google.api.CustomHttpPattern,
2695             com.google.api.CustomHttpPattern.Builder,
2696             com.google.api.CustomHttpPatternOrBuilder>
2697         customBuilder_;
2698     /**
2699      *
2700      *
2701      * <pre>
2702      * The custom pattern is used for specifying an HTTP method that is not
2703      * included in the `pattern` field, such as HEAD, or "*" to leave the
2704      * HTTP method unspecified for this rule. The wild-card rule is useful
2705      * for services that provide content to Web (HTML) clients.
2706      * </pre>
2707      *
2708      * <code>.google.api.CustomHttpPattern custom = 8;</code>
2709      *
2710      * @return Whether the custom field is set.
2711      */
2712     @java.lang.Override
hasCustom()2713     public boolean hasCustom() {
2714       return patternCase_ == 8;
2715     }
2716     /**
2717      *
2718      *
2719      * <pre>
2720      * The custom pattern is used for specifying an HTTP method that is not
2721      * included in the `pattern` field, such as HEAD, or "*" to leave the
2722      * HTTP method unspecified for this rule. The wild-card rule is useful
2723      * for services that provide content to Web (HTML) clients.
2724      * </pre>
2725      *
2726      * <code>.google.api.CustomHttpPattern custom = 8;</code>
2727      *
2728      * @return The custom.
2729      */
2730     @java.lang.Override
getCustom()2731     public com.google.api.CustomHttpPattern getCustom() {
2732       if (customBuilder_ == null) {
2733         if (patternCase_ == 8) {
2734           return (com.google.api.CustomHttpPattern) pattern_;
2735         }
2736         return com.google.api.CustomHttpPattern.getDefaultInstance();
2737       } else {
2738         if (patternCase_ == 8) {
2739           return customBuilder_.getMessage();
2740         }
2741         return com.google.api.CustomHttpPattern.getDefaultInstance();
2742       }
2743     }
2744     /**
2745      *
2746      *
2747      * <pre>
2748      * The custom pattern is used for specifying an HTTP method that is not
2749      * included in the `pattern` field, such as HEAD, or "*" to leave the
2750      * HTTP method unspecified for this rule. The wild-card rule is useful
2751      * for services that provide content to Web (HTML) clients.
2752      * </pre>
2753      *
2754      * <code>.google.api.CustomHttpPattern custom = 8;</code>
2755      */
setCustom(com.google.api.CustomHttpPattern value)2756     public Builder setCustom(com.google.api.CustomHttpPattern value) {
2757       if (customBuilder_ == null) {
2758         if (value == null) {
2759           throw new NullPointerException();
2760         }
2761         pattern_ = value;
2762         onChanged();
2763       } else {
2764         customBuilder_.setMessage(value);
2765       }
2766       patternCase_ = 8;
2767       return this;
2768     }
2769     /**
2770      *
2771      *
2772      * <pre>
2773      * The custom pattern is used for specifying an HTTP method that is not
2774      * included in the `pattern` field, such as HEAD, or "*" to leave the
2775      * HTTP method unspecified for this rule. The wild-card rule is useful
2776      * for services that provide content to Web (HTML) clients.
2777      * </pre>
2778      *
2779      * <code>.google.api.CustomHttpPattern custom = 8;</code>
2780      */
setCustom(com.google.api.CustomHttpPattern.Builder builderForValue)2781     public Builder setCustom(com.google.api.CustomHttpPattern.Builder builderForValue) {
2782       if (customBuilder_ == null) {
2783         pattern_ = builderForValue.build();
2784         onChanged();
2785       } else {
2786         customBuilder_.setMessage(builderForValue.build());
2787       }
2788       patternCase_ = 8;
2789       return this;
2790     }
2791     /**
2792      *
2793      *
2794      * <pre>
2795      * The custom pattern is used for specifying an HTTP method that is not
2796      * included in the `pattern` field, such as HEAD, or "*" to leave the
2797      * HTTP method unspecified for this rule. The wild-card rule is useful
2798      * for services that provide content to Web (HTML) clients.
2799      * </pre>
2800      *
2801      * <code>.google.api.CustomHttpPattern custom = 8;</code>
2802      */
mergeCustom(com.google.api.CustomHttpPattern value)2803     public Builder mergeCustom(com.google.api.CustomHttpPattern value) {
2804       if (customBuilder_ == null) {
2805         if (patternCase_ == 8
2806             && pattern_ != com.google.api.CustomHttpPattern.getDefaultInstance()) {
2807           pattern_ =
2808               com.google.api.CustomHttpPattern.newBuilder(
2809                       (com.google.api.CustomHttpPattern) pattern_)
2810                   .mergeFrom(value)
2811                   .buildPartial();
2812         } else {
2813           pattern_ = value;
2814         }
2815         onChanged();
2816       } else {
2817         if (patternCase_ == 8) {
2818           customBuilder_.mergeFrom(value);
2819         } else {
2820           customBuilder_.setMessage(value);
2821         }
2822       }
2823       patternCase_ = 8;
2824       return this;
2825     }
2826     /**
2827      *
2828      *
2829      * <pre>
2830      * The custom pattern is used for specifying an HTTP method that is not
2831      * included in the `pattern` field, such as HEAD, or "*" to leave the
2832      * HTTP method unspecified for this rule. The wild-card rule is useful
2833      * for services that provide content to Web (HTML) clients.
2834      * </pre>
2835      *
2836      * <code>.google.api.CustomHttpPattern custom = 8;</code>
2837      */
clearCustom()2838     public Builder clearCustom() {
2839       if (customBuilder_ == null) {
2840         if (patternCase_ == 8) {
2841           patternCase_ = 0;
2842           pattern_ = null;
2843           onChanged();
2844         }
2845       } else {
2846         if (patternCase_ == 8) {
2847           patternCase_ = 0;
2848           pattern_ = null;
2849         }
2850         customBuilder_.clear();
2851       }
2852       return this;
2853     }
2854     /**
2855      *
2856      *
2857      * <pre>
2858      * The custom pattern is used for specifying an HTTP method that is not
2859      * included in the `pattern` field, such as HEAD, or "*" to leave the
2860      * HTTP method unspecified for this rule. The wild-card rule is useful
2861      * for services that provide content to Web (HTML) clients.
2862      * </pre>
2863      *
2864      * <code>.google.api.CustomHttpPattern custom = 8;</code>
2865      */
getCustomBuilder()2866     public com.google.api.CustomHttpPattern.Builder getCustomBuilder() {
2867       return getCustomFieldBuilder().getBuilder();
2868     }
2869     /**
2870      *
2871      *
2872      * <pre>
2873      * The custom pattern is used for specifying an HTTP method that is not
2874      * included in the `pattern` field, such as HEAD, or "*" to leave the
2875      * HTTP method unspecified for this rule. The wild-card rule is useful
2876      * for services that provide content to Web (HTML) clients.
2877      * </pre>
2878      *
2879      * <code>.google.api.CustomHttpPattern custom = 8;</code>
2880      */
2881     @java.lang.Override
getCustomOrBuilder()2882     public com.google.api.CustomHttpPatternOrBuilder getCustomOrBuilder() {
2883       if ((patternCase_ == 8) && (customBuilder_ != null)) {
2884         return customBuilder_.getMessageOrBuilder();
2885       } else {
2886         if (patternCase_ == 8) {
2887           return (com.google.api.CustomHttpPattern) pattern_;
2888         }
2889         return com.google.api.CustomHttpPattern.getDefaultInstance();
2890       }
2891     }
2892     /**
2893      *
2894      *
2895      * <pre>
2896      * The custom pattern is used for specifying an HTTP method that is not
2897      * included in the `pattern` field, such as HEAD, or "*" to leave the
2898      * HTTP method unspecified for this rule. The wild-card rule is useful
2899      * for services that provide content to Web (HTML) clients.
2900      * </pre>
2901      *
2902      * <code>.google.api.CustomHttpPattern custom = 8;</code>
2903      */
2904     private com.google.protobuf.SingleFieldBuilderV3<
2905             com.google.api.CustomHttpPattern,
2906             com.google.api.CustomHttpPattern.Builder,
2907             com.google.api.CustomHttpPatternOrBuilder>
getCustomFieldBuilder()2908         getCustomFieldBuilder() {
2909       if (customBuilder_ == null) {
2910         if (!(patternCase_ == 8)) {
2911           pattern_ = com.google.api.CustomHttpPattern.getDefaultInstance();
2912         }
2913         customBuilder_ =
2914             new com.google.protobuf.SingleFieldBuilderV3<
2915                 com.google.api.CustomHttpPattern,
2916                 com.google.api.CustomHttpPattern.Builder,
2917                 com.google.api.CustomHttpPatternOrBuilder>(
2918                 (com.google.api.CustomHttpPattern) pattern_, getParentForChildren(), isClean());
2919         pattern_ = null;
2920       }
2921       patternCase_ = 8;
2922       onChanged();
2923       return customBuilder_;
2924     }
2925 
2926     private java.lang.Object body_ = "";
2927     /**
2928      *
2929      *
2930      * <pre>
2931      * The name of the request field whose value is mapped to the HTTP request
2932      * body, or `*` for mapping all request fields not captured by the path
2933      * pattern to the HTTP body, or omitted for not having any HTTP request body.
2934      * NOTE: the referred field must be present at the top-level of the request
2935      * message type.
2936      * </pre>
2937      *
2938      * <code>string body = 7;</code>
2939      *
2940      * @return The body.
2941      */
getBody()2942     public java.lang.String getBody() {
2943       java.lang.Object ref = body_;
2944       if (!(ref instanceof java.lang.String)) {
2945         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2946         java.lang.String s = bs.toStringUtf8();
2947         body_ = s;
2948         return s;
2949       } else {
2950         return (java.lang.String) ref;
2951       }
2952     }
2953     /**
2954      *
2955      *
2956      * <pre>
2957      * The name of the request field whose value is mapped to the HTTP request
2958      * body, or `*` for mapping all request fields not captured by the path
2959      * pattern to the HTTP body, or omitted for not having any HTTP request body.
2960      * NOTE: the referred field must be present at the top-level of the request
2961      * message type.
2962      * </pre>
2963      *
2964      * <code>string body = 7;</code>
2965      *
2966      * @return The bytes for body.
2967      */
getBodyBytes()2968     public com.google.protobuf.ByteString getBodyBytes() {
2969       java.lang.Object ref = body_;
2970       if (ref instanceof String) {
2971         com.google.protobuf.ByteString b =
2972             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2973         body_ = b;
2974         return b;
2975       } else {
2976         return (com.google.protobuf.ByteString) ref;
2977       }
2978     }
2979     /**
2980      *
2981      *
2982      * <pre>
2983      * The name of the request field whose value is mapped to the HTTP request
2984      * body, or `*` for mapping all request fields not captured by the path
2985      * pattern to the HTTP body, or omitted for not having any HTTP request body.
2986      * NOTE: the referred field must be present at the top-level of the request
2987      * message type.
2988      * </pre>
2989      *
2990      * <code>string body = 7;</code>
2991      *
2992      * @param value The body to set.
2993      * @return This builder for chaining.
2994      */
setBody(java.lang.String value)2995     public Builder setBody(java.lang.String value) {
2996       if (value == null) {
2997         throw new NullPointerException();
2998       }
2999       body_ = value;
3000       bitField0_ |= 0x00000080;
3001       onChanged();
3002       return this;
3003     }
3004     /**
3005      *
3006      *
3007      * <pre>
3008      * The name of the request field whose value is mapped to the HTTP request
3009      * body, or `*` for mapping all request fields not captured by the path
3010      * pattern to the HTTP body, or omitted for not having any HTTP request body.
3011      * NOTE: the referred field must be present at the top-level of the request
3012      * message type.
3013      * </pre>
3014      *
3015      * <code>string body = 7;</code>
3016      *
3017      * @return This builder for chaining.
3018      */
clearBody()3019     public Builder clearBody() {
3020       body_ = getDefaultInstance().getBody();
3021       bitField0_ = (bitField0_ & ~0x00000080);
3022       onChanged();
3023       return this;
3024     }
3025     /**
3026      *
3027      *
3028      * <pre>
3029      * The name of the request field whose value is mapped to the HTTP request
3030      * body, or `*` for mapping all request fields not captured by the path
3031      * pattern to the HTTP body, or omitted for not having any HTTP request body.
3032      * NOTE: the referred field must be present at the top-level of the request
3033      * message type.
3034      * </pre>
3035      *
3036      * <code>string body = 7;</code>
3037      *
3038      * @param value The bytes for body to set.
3039      * @return This builder for chaining.
3040      */
setBodyBytes(com.google.protobuf.ByteString value)3041     public Builder setBodyBytes(com.google.protobuf.ByteString value) {
3042       if (value == null) {
3043         throw new NullPointerException();
3044       }
3045       checkByteStringIsUtf8(value);
3046       body_ = value;
3047       bitField0_ |= 0x00000080;
3048       onChanged();
3049       return this;
3050     }
3051 
3052     private java.lang.Object responseBody_ = "";
3053     /**
3054      *
3055      *
3056      * <pre>
3057      * Optional. The name of the response field whose value is mapped to the HTTP
3058      * response body. When omitted, the entire response message will be used
3059      * as the HTTP response body.
3060      * NOTE: The referred field must be present at the top-level of the response
3061      * message type.
3062      * </pre>
3063      *
3064      * <code>string response_body = 12;</code>
3065      *
3066      * @return The responseBody.
3067      */
getResponseBody()3068     public java.lang.String getResponseBody() {
3069       java.lang.Object ref = responseBody_;
3070       if (!(ref instanceof java.lang.String)) {
3071         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
3072         java.lang.String s = bs.toStringUtf8();
3073         responseBody_ = s;
3074         return s;
3075       } else {
3076         return (java.lang.String) ref;
3077       }
3078     }
3079     /**
3080      *
3081      *
3082      * <pre>
3083      * Optional. The name of the response field whose value is mapped to the HTTP
3084      * response body. When omitted, the entire response message will be used
3085      * as the HTTP response body.
3086      * NOTE: The referred field must be present at the top-level of the response
3087      * message type.
3088      * </pre>
3089      *
3090      * <code>string response_body = 12;</code>
3091      *
3092      * @return The bytes for responseBody.
3093      */
getResponseBodyBytes()3094     public com.google.protobuf.ByteString getResponseBodyBytes() {
3095       java.lang.Object ref = responseBody_;
3096       if (ref instanceof String) {
3097         com.google.protobuf.ByteString b =
3098             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
3099         responseBody_ = b;
3100         return b;
3101       } else {
3102         return (com.google.protobuf.ByteString) ref;
3103       }
3104     }
3105     /**
3106      *
3107      *
3108      * <pre>
3109      * Optional. The name of the response field whose value is mapped to the HTTP
3110      * response body. When omitted, the entire response message will be used
3111      * as the HTTP response body.
3112      * NOTE: The referred field must be present at the top-level of the response
3113      * message type.
3114      * </pre>
3115      *
3116      * <code>string response_body = 12;</code>
3117      *
3118      * @param value The responseBody to set.
3119      * @return This builder for chaining.
3120      */
setResponseBody(java.lang.String value)3121     public Builder setResponseBody(java.lang.String value) {
3122       if (value == null) {
3123         throw new NullPointerException();
3124       }
3125       responseBody_ = value;
3126       bitField0_ |= 0x00000100;
3127       onChanged();
3128       return this;
3129     }
3130     /**
3131      *
3132      *
3133      * <pre>
3134      * Optional. The name of the response field whose value is mapped to the HTTP
3135      * response body. When omitted, the entire response message will be used
3136      * as the HTTP response body.
3137      * NOTE: The referred field must be present at the top-level of the response
3138      * message type.
3139      * </pre>
3140      *
3141      * <code>string response_body = 12;</code>
3142      *
3143      * @return This builder for chaining.
3144      */
clearResponseBody()3145     public Builder clearResponseBody() {
3146       responseBody_ = getDefaultInstance().getResponseBody();
3147       bitField0_ = (bitField0_ & ~0x00000100);
3148       onChanged();
3149       return this;
3150     }
3151     /**
3152      *
3153      *
3154      * <pre>
3155      * Optional. The name of the response field whose value is mapped to the HTTP
3156      * response body. When omitted, the entire response message will be used
3157      * as the HTTP response body.
3158      * NOTE: The referred field must be present at the top-level of the response
3159      * message type.
3160      * </pre>
3161      *
3162      * <code>string response_body = 12;</code>
3163      *
3164      * @param value The bytes for responseBody to set.
3165      * @return This builder for chaining.
3166      */
setResponseBodyBytes(com.google.protobuf.ByteString value)3167     public Builder setResponseBodyBytes(com.google.protobuf.ByteString value) {
3168       if (value == null) {
3169         throw new NullPointerException();
3170       }
3171       checkByteStringIsUtf8(value);
3172       responseBody_ = value;
3173       bitField0_ |= 0x00000100;
3174       onChanged();
3175       return this;
3176     }
3177 
3178     private java.util.List<com.google.api.HttpRule> additionalBindings_ =
3179         java.util.Collections.emptyList();
3180 
ensureAdditionalBindingsIsMutable()3181     private void ensureAdditionalBindingsIsMutable() {
3182       if (!((bitField0_ & 0x00000200) != 0)) {
3183         additionalBindings_ = new java.util.ArrayList<com.google.api.HttpRule>(additionalBindings_);
3184         bitField0_ |= 0x00000200;
3185       }
3186     }
3187 
3188     private com.google.protobuf.RepeatedFieldBuilderV3<
3189             com.google.api.HttpRule,
3190             com.google.api.HttpRule.Builder,
3191             com.google.api.HttpRuleOrBuilder>
3192         additionalBindingsBuilder_;
3193 
3194     /**
3195      *
3196      *
3197      * <pre>
3198      * Additional HTTP bindings for the selector. Nested bindings must
3199      * not contain an `additional_bindings` field themselves (that is,
3200      * the nesting may only be one level deep).
3201      * </pre>
3202      *
3203      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3204      */
getAdditionalBindingsList()3205     public java.util.List<com.google.api.HttpRule> getAdditionalBindingsList() {
3206       if (additionalBindingsBuilder_ == null) {
3207         return java.util.Collections.unmodifiableList(additionalBindings_);
3208       } else {
3209         return additionalBindingsBuilder_.getMessageList();
3210       }
3211     }
3212     /**
3213      *
3214      *
3215      * <pre>
3216      * Additional HTTP bindings for the selector. Nested bindings must
3217      * not contain an `additional_bindings` field themselves (that is,
3218      * the nesting may only be one level deep).
3219      * </pre>
3220      *
3221      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3222      */
getAdditionalBindingsCount()3223     public int getAdditionalBindingsCount() {
3224       if (additionalBindingsBuilder_ == null) {
3225         return additionalBindings_.size();
3226       } else {
3227         return additionalBindingsBuilder_.getCount();
3228       }
3229     }
3230     /**
3231      *
3232      *
3233      * <pre>
3234      * Additional HTTP bindings for the selector. Nested bindings must
3235      * not contain an `additional_bindings` field themselves (that is,
3236      * the nesting may only be one level deep).
3237      * </pre>
3238      *
3239      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3240      */
getAdditionalBindings(int index)3241     public com.google.api.HttpRule getAdditionalBindings(int index) {
3242       if (additionalBindingsBuilder_ == null) {
3243         return additionalBindings_.get(index);
3244       } else {
3245         return additionalBindingsBuilder_.getMessage(index);
3246       }
3247     }
3248     /**
3249      *
3250      *
3251      * <pre>
3252      * Additional HTTP bindings for the selector. Nested bindings must
3253      * not contain an `additional_bindings` field themselves (that is,
3254      * the nesting may only be one level deep).
3255      * </pre>
3256      *
3257      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3258      */
setAdditionalBindings(int index, com.google.api.HttpRule value)3259     public Builder setAdditionalBindings(int index, com.google.api.HttpRule value) {
3260       if (additionalBindingsBuilder_ == null) {
3261         if (value == null) {
3262           throw new NullPointerException();
3263         }
3264         ensureAdditionalBindingsIsMutable();
3265         additionalBindings_.set(index, value);
3266         onChanged();
3267       } else {
3268         additionalBindingsBuilder_.setMessage(index, value);
3269       }
3270       return this;
3271     }
3272     /**
3273      *
3274      *
3275      * <pre>
3276      * Additional HTTP bindings for the selector. Nested bindings must
3277      * not contain an `additional_bindings` field themselves (that is,
3278      * the nesting may only be one level deep).
3279      * </pre>
3280      *
3281      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3282      */
setAdditionalBindings( int index, com.google.api.HttpRule.Builder builderForValue)3283     public Builder setAdditionalBindings(
3284         int index, com.google.api.HttpRule.Builder builderForValue) {
3285       if (additionalBindingsBuilder_ == null) {
3286         ensureAdditionalBindingsIsMutable();
3287         additionalBindings_.set(index, builderForValue.build());
3288         onChanged();
3289       } else {
3290         additionalBindingsBuilder_.setMessage(index, builderForValue.build());
3291       }
3292       return this;
3293     }
3294     /**
3295      *
3296      *
3297      * <pre>
3298      * Additional HTTP bindings for the selector. Nested bindings must
3299      * not contain an `additional_bindings` field themselves (that is,
3300      * the nesting may only be one level deep).
3301      * </pre>
3302      *
3303      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3304      */
addAdditionalBindings(com.google.api.HttpRule value)3305     public Builder addAdditionalBindings(com.google.api.HttpRule value) {
3306       if (additionalBindingsBuilder_ == null) {
3307         if (value == null) {
3308           throw new NullPointerException();
3309         }
3310         ensureAdditionalBindingsIsMutable();
3311         additionalBindings_.add(value);
3312         onChanged();
3313       } else {
3314         additionalBindingsBuilder_.addMessage(value);
3315       }
3316       return this;
3317     }
3318     /**
3319      *
3320      *
3321      * <pre>
3322      * Additional HTTP bindings for the selector. Nested bindings must
3323      * not contain an `additional_bindings` field themselves (that is,
3324      * the nesting may only be one level deep).
3325      * </pre>
3326      *
3327      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3328      */
addAdditionalBindings(int index, com.google.api.HttpRule value)3329     public Builder addAdditionalBindings(int index, com.google.api.HttpRule value) {
3330       if (additionalBindingsBuilder_ == null) {
3331         if (value == null) {
3332           throw new NullPointerException();
3333         }
3334         ensureAdditionalBindingsIsMutable();
3335         additionalBindings_.add(index, value);
3336         onChanged();
3337       } else {
3338         additionalBindingsBuilder_.addMessage(index, value);
3339       }
3340       return this;
3341     }
3342     /**
3343      *
3344      *
3345      * <pre>
3346      * Additional HTTP bindings for the selector. Nested bindings must
3347      * not contain an `additional_bindings` field themselves (that is,
3348      * the nesting may only be one level deep).
3349      * </pre>
3350      *
3351      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3352      */
addAdditionalBindings(com.google.api.HttpRule.Builder builderForValue)3353     public Builder addAdditionalBindings(com.google.api.HttpRule.Builder builderForValue) {
3354       if (additionalBindingsBuilder_ == null) {
3355         ensureAdditionalBindingsIsMutable();
3356         additionalBindings_.add(builderForValue.build());
3357         onChanged();
3358       } else {
3359         additionalBindingsBuilder_.addMessage(builderForValue.build());
3360       }
3361       return this;
3362     }
3363     /**
3364      *
3365      *
3366      * <pre>
3367      * Additional HTTP bindings for the selector. Nested bindings must
3368      * not contain an `additional_bindings` field themselves (that is,
3369      * the nesting may only be one level deep).
3370      * </pre>
3371      *
3372      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3373      */
addAdditionalBindings( int index, com.google.api.HttpRule.Builder builderForValue)3374     public Builder addAdditionalBindings(
3375         int index, com.google.api.HttpRule.Builder builderForValue) {
3376       if (additionalBindingsBuilder_ == null) {
3377         ensureAdditionalBindingsIsMutable();
3378         additionalBindings_.add(index, builderForValue.build());
3379         onChanged();
3380       } else {
3381         additionalBindingsBuilder_.addMessage(index, builderForValue.build());
3382       }
3383       return this;
3384     }
3385     /**
3386      *
3387      *
3388      * <pre>
3389      * Additional HTTP bindings for the selector. Nested bindings must
3390      * not contain an `additional_bindings` field themselves (that is,
3391      * the nesting may only be one level deep).
3392      * </pre>
3393      *
3394      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3395      */
addAllAdditionalBindings( java.lang.Iterable<? extends com.google.api.HttpRule> values)3396     public Builder addAllAdditionalBindings(
3397         java.lang.Iterable<? extends com.google.api.HttpRule> values) {
3398       if (additionalBindingsBuilder_ == null) {
3399         ensureAdditionalBindingsIsMutable();
3400         com.google.protobuf.AbstractMessageLite.Builder.addAll(values, additionalBindings_);
3401         onChanged();
3402       } else {
3403         additionalBindingsBuilder_.addAllMessages(values);
3404       }
3405       return this;
3406     }
3407     /**
3408      *
3409      *
3410      * <pre>
3411      * Additional HTTP bindings for the selector. Nested bindings must
3412      * not contain an `additional_bindings` field themselves (that is,
3413      * the nesting may only be one level deep).
3414      * </pre>
3415      *
3416      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3417      */
clearAdditionalBindings()3418     public Builder clearAdditionalBindings() {
3419       if (additionalBindingsBuilder_ == null) {
3420         additionalBindings_ = java.util.Collections.emptyList();
3421         bitField0_ = (bitField0_ & ~0x00000200);
3422         onChanged();
3423       } else {
3424         additionalBindingsBuilder_.clear();
3425       }
3426       return this;
3427     }
3428     /**
3429      *
3430      *
3431      * <pre>
3432      * Additional HTTP bindings for the selector. Nested bindings must
3433      * not contain an `additional_bindings` field themselves (that is,
3434      * the nesting may only be one level deep).
3435      * </pre>
3436      *
3437      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3438      */
removeAdditionalBindings(int index)3439     public Builder removeAdditionalBindings(int index) {
3440       if (additionalBindingsBuilder_ == null) {
3441         ensureAdditionalBindingsIsMutable();
3442         additionalBindings_.remove(index);
3443         onChanged();
3444       } else {
3445         additionalBindingsBuilder_.remove(index);
3446       }
3447       return this;
3448     }
3449     /**
3450      *
3451      *
3452      * <pre>
3453      * Additional HTTP bindings for the selector. Nested bindings must
3454      * not contain an `additional_bindings` field themselves (that is,
3455      * the nesting may only be one level deep).
3456      * </pre>
3457      *
3458      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3459      */
getAdditionalBindingsBuilder(int index)3460     public com.google.api.HttpRule.Builder getAdditionalBindingsBuilder(int index) {
3461       return getAdditionalBindingsFieldBuilder().getBuilder(index);
3462     }
3463     /**
3464      *
3465      *
3466      * <pre>
3467      * Additional HTTP bindings for the selector. Nested bindings must
3468      * not contain an `additional_bindings` field themselves (that is,
3469      * the nesting may only be one level deep).
3470      * </pre>
3471      *
3472      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3473      */
getAdditionalBindingsOrBuilder(int index)3474     public com.google.api.HttpRuleOrBuilder getAdditionalBindingsOrBuilder(int index) {
3475       if (additionalBindingsBuilder_ == null) {
3476         return additionalBindings_.get(index);
3477       } else {
3478         return additionalBindingsBuilder_.getMessageOrBuilder(index);
3479       }
3480     }
3481     /**
3482      *
3483      *
3484      * <pre>
3485      * Additional HTTP bindings for the selector. Nested bindings must
3486      * not contain an `additional_bindings` field themselves (that is,
3487      * the nesting may only be one level deep).
3488      * </pre>
3489      *
3490      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3491      */
3492     public java.util.List<? extends com.google.api.HttpRuleOrBuilder>
getAdditionalBindingsOrBuilderList()3493         getAdditionalBindingsOrBuilderList() {
3494       if (additionalBindingsBuilder_ != null) {
3495         return additionalBindingsBuilder_.getMessageOrBuilderList();
3496       } else {
3497         return java.util.Collections.unmodifiableList(additionalBindings_);
3498       }
3499     }
3500     /**
3501      *
3502      *
3503      * <pre>
3504      * Additional HTTP bindings for the selector. Nested bindings must
3505      * not contain an `additional_bindings` field themselves (that is,
3506      * the nesting may only be one level deep).
3507      * </pre>
3508      *
3509      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3510      */
addAdditionalBindingsBuilder()3511     public com.google.api.HttpRule.Builder addAdditionalBindingsBuilder() {
3512       return getAdditionalBindingsFieldBuilder()
3513           .addBuilder(com.google.api.HttpRule.getDefaultInstance());
3514     }
3515     /**
3516      *
3517      *
3518      * <pre>
3519      * Additional HTTP bindings for the selector. Nested bindings must
3520      * not contain an `additional_bindings` field themselves (that is,
3521      * the nesting may only be one level deep).
3522      * </pre>
3523      *
3524      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3525      */
addAdditionalBindingsBuilder(int index)3526     public com.google.api.HttpRule.Builder addAdditionalBindingsBuilder(int index) {
3527       return getAdditionalBindingsFieldBuilder()
3528           .addBuilder(index, com.google.api.HttpRule.getDefaultInstance());
3529     }
3530     /**
3531      *
3532      *
3533      * <pre>
3534      * Additional HTTP bindings for the selector. Nested bindings must
3535      * not contain an `additional_bindings` field themselves (that is,
3536      * the nesting may only be one level deep).
3537      * </pre>
3538      *
3539      * <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
3540      */
getAdditionalBindingsBuilderList()3541     public java.util.List<com.google.api.HttpRule.Builder> getAdditionalBindingsBuilderList() {
3542       return getAdditionalBindingsFieldBuilder().getBuilderList();
3543     }
3544 
3545     private com.google.protobuf.RepeatedFieldBuilderV3<
3546             com.google.api.HttpRule,
3547             com.google.api.HttpRule.Builder,
3548             com.google.api.HttpRuleOrBuilder>
getAdditionalBindingsFieldBuilder()3549         getAdditionalBindingsFieldBuilder() {
3550       if (additionalBindingsBuilder_ == null) {
3551         additionalBindingsBuilder_ =
3552             new com.google.protobuf.RepeatedFieldBuilderV3<
3553                 com.google.api.HttpRule,
3554                 com.google.api.HttpRule.Builder,
3555                 com.google.api.HttpRuleOrBuilder>(
3556                 additionalBindings_,
3557                 ((bitField0_ & 0x00000200) != 0),
3558                 getParentForChildren(),
3559                 isClean());
3560         additionalBindings_ = null;
3561       }
3562       return additionalBindingsBuilder_;
3563     }
3564 
3565     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)3566     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
3567       return super.setUnknownFields(unknownFields);
3568     }
3569 
3570     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)3571     public final Builder mergeUnknownFields(
3572         final com.google.protobuf.UnknownFieldSet unknownFields) {
3573       return super.mergeUnknownFields(unknownFields);
3574     }
3575 
3576     // @@protoc_insertion_point(builder_scope:google.api.HttpRule)
3577   }
3578 
3579   // @@protoc_insertion_point(class_scope:google.api.HttpRule)
3580   private static final com.google.api.HttpRule DEFAULT_INSTANCE;
3581 
3582   static {
3583     DEFAULT_INSTANCE = new com.google.api.HttpRule();
3584   }
3585 
getDefaultInstance()3586   public static com.google.api.HttpRule getDefaultInstance() {
3587     return DEFAULT_INSTANCE;
3588   }
3589 
3590   private static final com.google.protobuf.Parser<HttpRule> PARSER =
3591       new com.google.protobuf.AbstractParser<HttpRule>() {
3592         @java.lang.Override
3593         public HttpRule parsePartialFrom(
3594             com.google.protobuf.CodedInputStream input,
3595             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3596             throws com.google.protobuf.InvalidProtocolBufferException {
3597           Builder builder = newBuilder();
3598           try {
3599             builder.mergeFrom(input, extensionRegistry);
3600           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
3601             throw e.setUnfinishedMessage(builder.buildPartial());
3602           } catch (com.google.protobuf.UninitializedMessageException e) {
3603             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
3604           } catch (java.io.IOException e) {
3605             throw new com.google.protobuf.InvalidProtocolBufferException(e)
3606                 .setUnfinishedMessage(builder.buildPartial());
3607           }
3608           return builder.buildPartial();
3609         }
3610       };
3611 
parser()3612   public static com.google.protobuf.Parser<HttpRule> parser() {
3613     return PARSER;
3614   }
3615 
3616   @java.lang.Override
getParserForType()3617   public com.google.protobuf.Parser<HttpRule> getParserForType() {
3618     return PARSER;
3619   }
3620 
3621   @java.lang.Override
getDefaultInstanceForType()3622   public com.google.api.HttpRule getDefaultInstanceForType() {
3623     return DEFAULT_INSTANCE;
3624   }
3625 }
3626