PluginProbe ʕ •ᴥ•ʔ
ShareThis Dashboard for Google Analytics / trunk
ShareThis Dashboard for Google Analytics vtrunk
3.3.2 trunk 1.0.7 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.5 2.3.5 2.3.6 2.3.7 2.3.8 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 3.0.0 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.3.0 3.3.1
googleanalytics / lib / analytics-admin / vendor / google / common-protos / src / Api / HttpRule.php
googleanalytics / lib / analytics-admin / vendor / google / common-protos / src / Api Last commit date
BackendRule 3 years ago Billing 3 years ago Distribution 3 years ago Expr 3 years ago LabelDescriptor 3 years ago Logging 3 years ago MetricDescriptor 3 years ago Monitoring 3 years ago Property 3 years ago ResourceDescriptor 3 years ago Advice.php 3 years ago AuthProvider.php 3 years ago AuthRequirement.php 3 years ago Authentication.php 3 years ago AuthenticationRule.php 3 years ago Backend.php 3 years ago BackendRule.php 3 years ago BackendRule_PathTranslation.php 3 years ago Billing.php 3 years ago Billing_BillingDestination.php 3 years ago ChangeType.php 3 years ago ConfigChange.php 3 years ago Context.php 3 years ago ContextRule.php 3 years ago Control.php 3 years ago CustomHttpPattern.php 3 years ago Distribution.php 3 years ago Distribution_BucketOptions.php 3 years ago Distribution_BucketOptions_Explicit.php 3 years ago Distribution_BucketOptions_Exponential.php 3 years ago Distribution_BucketOptions_Linear.php 3 years ago Distribution_Exemplar.php 3 years ago Distribution_Range.php 3 years ago Documentation.php 3 years ago DocumentationRule.php 3 years ago Endpoint.php 3 years ago FieldBehavior.php 3 years ago Http.php 3 years ago HttpBody.php 3 years ago HttpRule.php 3 years ago LabelDescriptor.php 3 years ago LabelDescriptor_ValueType.php 3 years ago LaunchStage.php 3 years ago LogDescriptor.php 3 years ago Logging.php 3 years ago Logging_LoggingDestination.php 3 years ago Metric.php 3 years ago MetricDescriptor.php 3 years ago MetricDescriptor_MetricDescriptorMetadata.php 3 years ago MetricDescriptor_MetricKind.php 3 years ago MetricDescriptor_ValueType.php 3 years ago MetricRule.php 3 years ago MonitoredResource.php 3 years ago MonitoredResourceDescriptor.php 3 years ago MonitoredResourceMetadata.php 3 years ago Monitoring.php 3 years ago Monitoring_MonitoringDestination.php 3 years ago OAuthRequirements.php 3 years ago Page.php 3 years ago ProjectProperties.php 3 years ago Property.php 3 years ago Property_PropertyType.php 3 years ago Quota.php 3 years ago QuotaLimit.php 3 years ago ResourceDescriptor.php 3 years ago ResourceDescriptor_History.php 3 years ago ResourceReference.php 3 years ago RoutingParameter.php 3 years ago RoutingRule.php 3 years ago Service.php 3 years ago SourceInfo.php 3 years ago SystemParameter.php 3 years ago SystemParameterRule.php 3 years ago SystemParameters.php 3 years ago Usage.php 3 years ago UsageRule.php 3 years ago
HttpRule.php
561 lines
1 <?php
2 # Generated by the protocol buffer compiler. DO NOT EDIT!
3 # source: google/api/http.proto
4
5 namespace Google\Api;
6
7 use Google\Protobuf\Internal\GPBType;
8 use Google\Protobuf\Internal\RepeatedField;
9 use Google\Protobuf\Internal\GPBUtil;
10
11 /**
12 * `HttpRule` defines the mapping of an RPC method to one or more HTTP
13 * REST API methods. The mapping specifies how different portions of the RPC
14 * request message are mapped to URL path, URL query parameters, and
15 * HTTP request body. The mapping is typically specified as an
16 * `google.api.http` annotation on the RPC method,
17 * see "google/api/annotations.proto" for details.
18 * The mapping consists of a field specifying the path template and
19 * method kind. The path template can refer to fields in the request
20 * message, as in the example below which describes a REST GET
21 * operation on a resource collection of messages:
22 * service Messaging {
23 * rpc GetMessage(GetMessageRequest) returns (Message) {
24 * option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}";
25 * }
26 * }
27 * message GetMessageRequest {
28 * message SubMessage {
29 * string subfield = 1;
30 * }
31 * string message_id = 1; // mapped to the URL
32 * SubMessage sub = 2; // `sub.subfield` is url-mapped
33 * }
34 * message Message {
35 * string text = 1; // content of the resource
36 * }
37 * The same http annotation can alternatively be expressed inside the
38 * `GRPC API Configuration` YAML file.
39 * http:
40 * rules:
41 * - selector: <proto_package_name>.Messaging.GetMessage
42 * get: /v1/messages/{message_id}/{sub.subfield}
43 * This definition enables an automatic, bidrectional mapping of HTTP
44 * JSON to RPC. Example:
45 * HTTP | RPC
46 * -----|-----
47 * `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))`
48 * In general, not only fields but also field paths can be referenced
49 * from a path pattern. Fields mapped to the path pattern cannot be
50 * repeated and must have a primitive (non-message) type.
51 * Any fields in the request message which are not bound by the path
52 * pattern automatically become (optional) HTTP query
53 * parameters. Assume the following definition of the request message:
54 * service Messaging {
55 * rpc GetMessage(GetMessageRequest) returns (Message) {
56 * option (google.api.http).get = "/v1/messages/{message_id}";
57 * }
58 * }
59 * message GetMessageRequest {
60 * message SubMessage {
61 * string subfield = 1;
62 * }
63 * string message_id = 1; // mapped to the URL
64 * int64 revision = 2; // becomes a parameter
65 * SubMessage sub = 3; // `sub.subfield` becomes a parameter
66 * }
67 * This enables a HTTP JSON to RPC mapping as below:
68 * HTTP | RPC
69 * -----|-----
70 * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))`
71 * Note that fields which are mapped to HTTP parameters must have a
72 * primitive type or a repeated primitive type. Message types are not
73 * allowed. In the case of a repeated type, the parameter can be
74 * repeated in the URL, as in `...?param=A&param=B`.
75 * For HTTP method kinds which allow a request body, the `body` field
76 * specifies the mapping. Consider a REST update method on the
77 * message resource collection:
78 * service Messaging {
79 * rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
80 * option (google.api.http) = {
81 * put: "/v1/messages/{message_id}"
82 * body: "message"
83 * };
84 * }
85 * }
86 * message UpdateMessageRequest {
87 * string message_id = 1; // mapped to the URL
88 * Message message = 2; // mapped to the body
89 * }
90 * The following HTTP JSON to RPC mapping is enabled, where the
91 * representation of the JSON in the request body is determined by
92 * protos JSON encoding:
93 * HTTP | RPC
94 * -----|-----
95 * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
96 * The special name `*` can be used in the body mapping to define that
97 * every field not bound by the path template should be mapped to the
98 * request body. This enables the following alternative definition of
99 * the update method:
100 * service Messaging {
101 * rpc UpdateMessage(Message) returns (Message) {
102 * option (google.api.http) = {
103 * put: "/v1/messages/{message_id}"
104 * body: "*"
105 * };
106 * }
107 * }
108 * message Message {
109 * string message_id = 1;
110 * string text = 2;
111 * }
112 * The following HTTP JSON to RPC mapping is enabled:
113 * HTTP | RPC
114 * -----|-----
115 * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")`
116 * Note that when using `*` in the body mapping, it is not possible to
117 * have HTTP parameters, as all fields not bound by the path end in
118 * the body. This makes this option more rarely used in practice of
119 * defining REST APIs. The common usage of `*` is in custom methods
120 * which don't use the URL at all for transferring data.
121 * It is possible to define multiple HTTP methods for one RPC by using
122 * the `additional_bindings` option. Example:
123 * service Messaging {
124 * rpc GetMessage(GetMessageRequest) returns (Message) {
125 * option (google.api.http) = {
126 * get: "/v1/messages/{message_id}"
127 * additional_bindings {
128 * get: "/v1/users/{user_id}/messages/{message_id}"
129 * }
130 * };
131 * }
132 * }
133 * message GetMessageRequest {
134 * string message_id = 1;
135 * string user_id = 2;
136 * }
137 * This enables the following two alternative HTTP JSON to RPC
138 * mappings:
139 * HTTP | RPC
140 * -----|-----
141 * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
142 * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")`
143 * # Rules for HTTP mapping
144 * The rules for mapping HTTP path, query parameters, and body fields
145 * to the request message are as follows:
146 * 1. The `body` field specifies either `*` or a field path, or is
147 * omitted. If omitted, it indicates there is no HTTP request body.
148 * 2. Leaf fields (recursive expansion of nested messages in the
149 * request) can be classified into three types:
150 * (a) Matched in the URL template.
151 * (b) Covered by body (if body is `*`, everything except (a) fields;
152 * else everything under the body field)
153 * (c) All other fields.
154 * 3. URL query parameters found in the HTTP request are mapped to (c) fields.
155 * 4. Any body sent with an HTTP request can contain only (b) fields.
156 * The syntax of the path template is as follows:
157 * Template = "/" Segments [ Verb ] ;
158 * Segments = Segment { "/" Segment } ;
159 * Segment = "*" | "**" | LITERAL | Variable ;
160 * Variable = "{" FieldPath [ "=" Segments ] "}" ;
161 * FieldPath = IDENT { "." IDENT } ;
162 * Verb = ":" LITERAL ;
163 * The syntax `*` matches a single path segment. The syntax `**` matches zero
164 * or more path segments, which must be the last part of the path except the
165 * `Verb`. The syntax `LITERAL` matches literal text in the path.
166 * The syntax `Variable` matches part of the URL path as specified by its
167 * template. A variable template must not contain other variables. If a variable
168 * matches a single path segment, its template may be omitted, e.g. `{var}`
169 * is equivalent to `{var=*}`.
170 * If a variable contains exactly one path segment, such as `"{var}"` or
171 * `"{var=*}"`, when such a variable is expanded into a URL path, all characters
172 * except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the
173 * Discovery Document as `{var}`.
174 * If a variable contains one or more path segments, such as `"{var=foo/&#42;}"`
175 * or `"{var=**}"`, when such a variable is expanded into a URL path, all
176 * characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables
177 * show up in the Discovery Document as `{+var}`.
178 * NOTE: While the single segment variable matches the semantics of
179 * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2
180 * Simple String Expansion, the multi segment variable **does not** match
181 * RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion
182 * does not expand special characters like `?` and `#`, which would lead
183 * to invalid URLs.
184 * NOTE: the field paths in variables and in the `body` must not refer to
185 * repeated fields or map fields.
186 *
187 * Generated from protobuf message <code>google.api.HttpRule</code>
188 */
189 class HttpRule extends \Google\Protobuf\Internal\Message
190 {
191 /**
192 * Selects methods to which this rule applies.
193 * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
194 *
195 * Generated from protobuf field <code>string selector = 1;</code>
196 */
197 private $selector = '';
198 /**
199 * The name of the request field whose value is mapped to the HTTP body, or
200 * `*` for mapping all fields not captured by the path pattern to the HTTP
201 * body. NOTE: the referred field must not be a repeated field and must be
202 * present at the top-level of request message type.
203 *
204 * Generated from protobuf field <code>string body = 7;</code>
205 */
206 private $body = '';
207 /**
208 * Optional. The name of the response field whose value is mapped to the HTTP
209 * body of response. Other response fields are ignored. When
210 * not set, the response message will be used as HTTP body of response.
211 *
212 * Generated from protobuf field <code>string response_body = 12;</code>
213 */
214 private $response_body = '';
215 /**
216 * Additional HTTP bindings for the selector. Nested bindings must
217 * not contain an `additional_bindings` field themselves (that is,
218 * the nesting may only be one level deep).
219 *
220 * Generated from protobuf field <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
221 */
222 private $additional_bindings;
223 protected $pattern;
224
225 /**
226 * Constructor.
227 *
228 * @param array $data {
229 * Optional. Data for populating the Message object.
230 *
231 * @type string $selector
232 * Selects methods to which this rule applies.
233 * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
234 * @type string $get
235 * Used for listing and getting information about resources.
236 * @type string $put
237 * Used for updating a resource.
238 * @type string $post
239 * Used for creating a resource.
240 * @type string $delete
241 * Used for deleting a resource.
242 * @type string $patch
243 * Used for updating a resource.
244 * @type \Google\Api\CustomHttpPattern $custom
245 * The custom pattern is used for specifying an HTTP method that is not
246 * included in the `pattern` field, such as HEAD, or "*" to leave the
247 * HTTP method unspecified for this rule. The wild-card rule is useful
248 * for services that provide content to Web (HTML) clients.
249 * @type string $body
250 * The name of the request field whose value is mapped to the HTTP body, or
251 * `*` for mapping all fields not captured by the path pattern to the HTTP
252 * body. NOTE: the referred field must not be a repeated field and must be
253 * present at the top-level of request message type.
254 * @type string $response_body
255 * Optional. The name of the response field whose value is mapped to the HTTP
256 * body of response. Other response fields are ignored. When
257 * not set, the response message will be used as HTTP body of response.
258 * @type \Google\Api\HttpRule[]|\Google\Protobuf\Internal\RepeatedField $additional_bindings
259 * Additional HTTP bindings for the selector. Nested bindings must
260 * not contain an `additional_bindings` field themselves (that is,
261 * the nesting may only be one level deep).
262 * }
263 */
264 public function __construct($data = NULL) {
265 \GPBMetadata\Google\Api\Http::initOnce();
266 parent::__construct($data);
267 }
268
269 /**
270 * Selects methods to which this rule applies.
271 * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
272 *
273 * Generated from protobuf field <code>string selector = 1;</code>
274 * @return string
275 */
276 public function getSelector()
277 {
278 return $this->selector;
279 }
280
281 /**
282 * Selects methods to which this rule applies.
283 * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
284 *
285 * Generated from protobuf field <code>string selector = 1;</code>
286 * @param string $var
287 * @return $this
288 */
289 public function setSelector($var)
290 {
291 GPBUtil::checkString($var, True);
292 $this->selector = $var;
293
294 return $this;
295 }
296
297 /**
298 * Used for listing and getting information about resources.
299 *
300 * Generated from protobuf field <code>string get = 2;</code>
301 * @return string
302 */
303 public function getGet()
304 {
305 return $this->readOneof(2);
306 }
307
308 /**
309 * Used for listing and getting information about resources.
310 *
311 * Generated from protobuf field <code>string get = 2;</code>
312 * @param string $var
313 * @return $this
314 */
315 public function setGet($var)
316 {
317 GPBUtil::checkString($var, True);
318 $this->writeOneof(2, $var);
319
320 return $this;
321 }
322
323 /**
324 * Used for updating a resource.
325 *
326 * Generated from protobuf field <code>string put = 3;</code>
327 * @return string
328 */
329 public function getPut()
330 {
331 return $this->readOneof(3);
332 }
333
334 /**
335 * Used for updating a resource.
336 *
337 * Generated from protobuf field <code>string put = 3;</code>
338 * @param string $var
339 * @return $this
340 */
341 public function setPut($var)
342 {
343 GPBUtil::checkString($var, True);
344 $this->writeOneof(3, $var);
345
346 return $this;
347 }
348
349 /**
350 * Used for creating a resource.
351 *
352 * Generated from protobuf field <code>string post = 4;</code>
353 * @return string
354 */
355 public function getPost()
356 {
357 return $this->readOneof(4);
358 }
359
360 /**
361 * Used for creating a resource.
362 *
363 * Generated from protobuf field <code>string post = 4;</code>
364 * @param string $var
365 * @return $this
366 */
367 public function setPost($var)
368 {
369 GPBUtil::checkString($var, True);
370 $this->writeOneof(4, $var);
371
372 return $this;
373 }
374
375 /**
376 * Used for deleting a resource.
377 *
378 * Generated from protobuf field <code>string delete = 5;</code>
379 * @return string
380 */
381 public function getDelete()
382 {
383 return $this->readOneof(5);
384 }
385
386 /**
387 * Used for deleting a resource.
388 *
389 * Generated from protobuf field <code>string delete = 5;</code>
390 * @param string $var
391 * @return $this
392 */
393 public function setDelete($var)
394 {
395 GPBUtil::checkString($var, True);
396 $this->writeOneof(5, $var);
397
398 return $this;
399 }
400
401 /**
402 * Used for updating a resource.
403 *
404 * Generated from protobuf field <code>string patch = 6;</code>
405 * @return string
406 */
407 public function getPatch()
408 {
409 return $this->readOneof(6);
410 }
411
412 /**
413 * Used for updating a resource.
414 *
415 * Generated from protobuf field <code>string patch = 6;</code>
416 * @param string $var
417 * @return $this
418 */
419 public function setPatch($var)
420 {
421 GPBUtil::checkString($var, True);
422 $this->writeOneof(6, $var);
423
424 return $this;
425 }
426
427 /**
428 * The custom pattern is used for specifying an HTTP method that is not
429 * included in the `pattern` field, such as HEAD, or "*" to leave the
430 * HTTP method unspecified for this rule. The wild-card rule is useful
431 * for services that provide content to Web (HTML) clients.
432 *
433 * Generated from protobuf field <code>.google.api.CustomHttpPattern custom = 8;</code>
434 * @return \Google\Api\CustomHttpPattern
435 */
436 public function getCustom()
437 {
438 return $this->readOneof(8);
439 }
440
441 /**
442 * The custom pattern is used for specifying an HTTP method that is not
443 * included in the `pattern` field, such as HEAD, or "*" to leave the
444 * HTTP method unspecified for this rule. The wild-card rule is useful
445 * for services that provide content to Web (HTML) clients.
446 *
447 * Generated from protobuf field <code>.google.api.CustomHttpPattern custom = 8;</code>
448 * @param \Google\Api\CustomHttpPattern $var
449 * @return $this
450 */
451 public function setCustom($var)
452 {
453 GPBUtil::checkMessage($var, \Google\Api\CustomHttpPattern::class);
454 $this->writeOneof(8, $var);
455
456 return $this;
457 }
458
459 /**
460 * The name of the request field whose value is mapped to the HTTP body, or
461 * `*` for mapping all fields not captured by the path pattern to the HTTP
462 * body. NOTE: the referred field must not be a repeated field and must be
463 * present at the top-level of request message type.
464 *
465 * Generated from protobuf field <code>string body = 7;</code>
466 * @return string
467 */
468 public function getBody()
469 {
470 return $this->body;
471 }
472
473 /**
474 * The name of the request field whose value is mapped to the HTTP body, or
475 * `*` for mapping all fields not captured by the path pattern to the HTTP
476 * body. NOTE: the referred field must not be a repeated field and must be
477 * present at the top-level of request message type.
478 *
479 * Generated from protobuf field <code>string body = 7;</code>
480 * @param string $var
481 * @return $this
482 */
483 public function setBody($var)
484 {
485 GPBUtil::checkString($var, True);
486 $this->body = $var;
487
488 return $this;
489 }
490
491 /**
492 * Optional. The name of the response field whose value is mapped to the HTTP
493 * body of response. Other response fields are ignored. When
494 * not set, the response message will be used as HTTP body of response.
495 *
496 * Generated from protobuf field <code>string response_body = 12;</code>
497 * @return string
498 */
499 public function getResponseBody()
500 {
501 return $this->response_body;
502 }
503
504 /**
505 * Optional. The name of the response field whose value is mapped to the HTTP
506 * body of response. Other response fields are ignored. When
507 * not set, the response message will be used as HTTP body of response.
508 *
509 * Generated from protobuf field <code>string response_body = 12;</code>
510 * @param string $var
511 * @return $this
512 */
513 public function setResponseBody($var)
514 {
515 GPBUtil::checkString($var, True);
516 $this->response_body = $var;
517
518 return $this;
519 }
520
521 /**
522 * Additional HTTP bindings for the selector. Nested bindings must
523 * not contain an `additional_bindings` field themselves (that is,
524 * the nesting may only be one level deep).
525 *
526 * Generated from protobuf field <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
527 * @return \Google\Protobuf\Internal\RepeatedField
528 */
529 public function getAdditionalBindings()
530 {
531 return $this->additional_bindings;
532 }
533
534 /**
535 * Additional HTTP bindings for the selector. Nested bindings must
536 * not contain an `additional_bindings` field themselves (that is,
537 * the nesting may only be one level deep).
538 *
539 * Generated from protobuf field <code>repeated .google.api.HttpRule additional_bindings = 11;</code>
540 * @param \Google\Api\HttpRule[]|\Google\Protobuf\Internal\RepeatedField $var
541 * @return $this
542 */
543 public function setAdditionalBindings($var)
544 {
545 $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\HttpRule::class);
546 $this->additional_bindings = $arr;
547
548 return $this;
549 }
550
551 /**
552 * @return string
553 */
554 public function getPattern()
555 {
556 return $this->whichOneof("pattern");
557 }
558
559 }
560
561