@@ -1487,7 +1487,7 @@ def update!(**args)
1487
1487
end
1488
1488
end
1489
1489
1490
- # # gRPC Transcoding gRPC Transcoding is a feature for mapping between a gRPC
1490
+ # gRPC Transcoding gRPC Transcoding is a feature for mapping between a gRPC
1491
1491
# method and one or more HTTP REST endpoints. It allows developers to build a
1492
1492
# single API service that supports both gRPC APIs and REST APIs. Many systems,
1493
1493
# including [Google APIs](https://github.com/googleapis/googleapis), [Cloud
@@ -1507,70 +1507,69 @@ def update!(**args)
1507
1507
# Message) ` option (google.api.http) = ` get: "/v1/`name=messages/*`" `; ` `
1508
1508
# message GetMessageRequest ` string name = 1; // Mapped to URL path. ` message
1509
1509
# Message ` string text = 1; // The resource content. ` This enables an HTTP
1510
- # REST to gRPC mapping as below: HTTP | gRPC -----|----- `GET /v1/messages/
1511
- # 123456` | `GetMessage(name: "messages/123456")` Any fields in the request
1512
- # message which are not bound by the path template automatically become HTTP
1513
- # query parameters if there is no HTTP request body. For example: service
1514
- # Messaging ` rpc GetMessage(GetMessageRequest) returns (Message) ` option (
1515
- # google.api.http) = ` get:"/v1/messages/`message_id`" `; ` ` message
1516
- # GetMessageRequest ` message SubMessage ` string subfield = 1; ` string
1517
- # message_id = 1; // Mapped to URL path. int64 revision = 2; // Mapped to URL
1518
- # query parameter `revision`. SubMessage sub = 3; // Mapped to URL query
1519
- # parameter `sub.subfield`. ` This enables a HTTP JSON to RPC mapping as below:
1520
- # HTTP | gRPC -----|----- `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
1521
- # `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))
1522
- # ` Note that fields which are mapped to URL query parameters must have a
1523
- # primitive type or a repeated primitive type or a non-repeated message type. In
1524
- # the case of a repeated type, the parameter can be repeated in the URL as `...?
1525
- # param=A¶m=B`. In the case of a message type, each field of the message is
1526
- # mapped to a separate parameter, such as `...?foo.a=A&foo.b=B&foo.c=C`. For
1527
- # HTTP methods that allow a request body, the `body` field specifies the mapping.
1528
- # Consider a REST update method on the message resource collection: service
1529
- # Messaging ` rpc UpdateMessage(UpdateMessageRequest) returns (Message) ` option
1530
- # (google.api.http) = ` patch: "/v1/messages/`message_id`" body: "message" `; ` `
1531
- # message UpdateMessageRequest ` string message_id = 1; // mapped to the URL
1532
- # Message message = 2; // mapped to the body ` The following HTTP JSON to RPC
1533
- # mapping is enabled, where the representation of the JSON in the request body
1534
- # is determined by protos JSON encoding: HTTP | gRPC -----|----- `PATCH /v1/
1535
- # messages/123456 ` "text": "Hi!" `` | `UpdateMessage(message_id: "123456"
1536
- # message ` text: "Hi!" `)` The special name `*` can be used in the body mapping
1537
- # to define that every field not bound by the path template should be mapped to
1538
- # the request body. This enables the following alternative definition of the
1539
- # update method: service Messaging ` rpc UpdateMessage(Message) returns (Message)
1540
- # ` option (google.api.http) = ` patch: "/v1/messages/`message_id`" body: "*" `;
1541
- # ` ` message Message ` string message_id = 1; string text = 2; ` The following
1542
- # HTTP JSON to RPC mapping is enabled: HTTP | gRPC -----|----- `PATCH /v1/
1543
- # messages/123456 ` "text": "Hi!" `` | `UpdateMessage(message_id: "123456" text:
1544
- # "Hi!")` Note that when using `*` in the body mapping, it is not possible to
1545
- # have HTTP parameters, as all fields not bound by the path end in the body.
1546
- # This makes this option more rarely used in practice when defining REST APIs.
1547
- # The common usage of `*` is in custom methods which don't use the URL at all
1548
- # for transferring data. It is possible to define multiple HTTP methods for one
1549
- # RPC by using the `additional_bindings` option. Example: service Messaging `
1550
- # rpc GetMessage(GetMessageRequest) returns (Message) ` option (google.api.http)
1551
- # = ` get: "/v1/messages/`message_id`" additional_bindings ` get: "/v1/users/`
1552
- # user_id`/messages/`message_id`" ` `; ` ` message GetMessageRequest ` string
1553
- # message_id = 1; string user_id = 2; ` This enables the following two
1554
- # alternative HTTP JSON to RPC mappings: HTTP | gRPC -----|----- `GET /v1/
1555
- # messages/123456` | `GetMessage(message_id: "123456")` `GET /v1/users/me/
1556
- # messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` ## Rules
1557
- # for HTTP mapping 1. Leaf request fields (recursive expansion nested messages
1558
- # in the request message) are classified into three categories: - Fields
1559
- # referred by the path template. They are passed via the URL path. - Fields
1560
- # referred by the HttpRule.body. They are passed via the HTTP request body. -
1561
- # All other fields are passed via the URL query parameters, and the parameter
1562
- # name is the field path in the request message. A repeated field can be
1563
- # represented as multiple query parameters under the same name. 2. If HttpRule.
1564
- # body is "*", there is no URL query parameter, all fields are passed via URL
1565
- # path and HTTP request body. 3. If HttpRule.body is omitted, there is no HTTP
1566
- # request body, all fields are passed via URL path and URL query parameters. ###
1567
- # Path template syntax Template = "/" Segments [ Verb ] ; Segments = Segment ` "/
1568
- # " Segment ` ; Segment = "*" | "**" | LITERAL | Variable ; Variable = "`"
1569
- # FieldPath [ "=" Segments ] "`" ; FieldPath = IDENT ` "." IDENT ` ; Verb = ":"
1570
- # LITERAL ; The syntax `*` matches a single URL path segment. The syntax `**`
1571
- # matches zero or more URL path segments, which must be the last part of the URL
1572
- # path except the `Verb`. The syntax `Variable` matches part of the URL path as
1573
- # specified by its template. A variable template must not contain other
1510
+ # REST to gRPC mapping as below: - HTTP: `GET /v1/messages/123456` - gRPC: `
1511
+ # GetMessage(name: "messages/123456")` Any fields in the request message which
1512
+ # are not bound by the path template automatically become HTTP query parameters
1513
+ # if there is no HTTP request body. For example: service Messaging ` rpc
1514
+ # GetMessage(GetMessageRequest) returns (Message) ` option (google.api.http) = `
1515
+ # get:"/v1/messages/`message_id`" `; ` ` message GetMessageRequest ` message
1516
+ # SubMessage ` string subfield = 1; ` string message_id = 1; // Mapped to URL
1517
+ # path. int64 revision = 2; // Mapped to URL query parameter `revision`.
1518
+ # SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. ` This
1519
+ # enables a HTTP JSON to RPC mapping as below: - HTTP: `GET /v1/messages/123456?
1520
+ # revision=2&sub.subfield=foo` - gRPC: `GetMessage(message_id: "123456" revision:
1521
+ # 2 sub: SubMessage(subfield: "foo"))` Note that fields which are mapped to URL
1522
+ # query parameters must have a primitive type or a repeated primitive type or a
1523
+ # non-repeated message type. In the case of a repeated type, the parameter can
1524
+ # be repeated in the URL as `...?param=A¶m=B`. In the case of a message type,
1525
+ # each field of the message is mapped to a separate parameter, such as `...?foo.
1526
+ # a=A&foo.b=B&foo.c=C`. For HTTP methods that allow a request body, the `body`
1527
+ # field specifies the mapping. Consider a REST update method on the message
1528
+ # resource collection: service Messaging ` rpc UpdateMessage(
1529
+ # UpdateMessageRequest) returns (Message) ` option (google.api.http) = ` patch: "
1530
+ # /v1/messages/`message_id`" body: "message" `; ` ` message UpdateMessageRequest
1531
+ # ` string message_id = 1; // mapped to the URL Message message = 2; // mapped
1532
+ # to the body ` The following HTTP JSON to RPC mapping is enabled, where the
1533
+ # representation of the JSON in the request body is determined by protos JSON
1534
+ # encoding: - HTTP: `PATCH /v1/messages/123456 ` "text": "Hi!" `` - gRPC: `
1535
+ # UpdateMessage(message_id: "123456" message ` text: "Hi!" `)` The special name `
1536
+ # *` can be used in the body mapping to define that every field not bound by the
1537
+ # path template should be mapped to the request body. This enables the following
1538
+ # alternative definition of the update method: service Messaging ` rpc
1539
+ # UpdateMessage(Message) returns (Message) ` option (google.api.http) = ` patch:
1540
+ # "/v1/messages/`message_id`" body: "*" `; ` ` message Message ` string
1541
+ # message_id = 1; string text = 2; ` The following HTTP JSON to RPC mapping is
1542
+ # enabled: - HTTP: `PATCH /v1/messages/123456 ` "text": "Hi!" `` - gRPC: `
1543
+ # UpdateMessage(message_id: "123456" text: "Hi!")` Note that when using `*` in
1544
+ # the body mapping, it is not possible to have HTTP parameters, as all fields
1545
+ # not bound by the path end in the body. This makes this option more rarely used
1546
+ # in practice when defining REST APIs. The common usage of `*` is in custom
1547
+ # methods which don't use the URL at all for transferring data. It is possible
1548
+ # to define multiple HTTP methods for one RPC by using the `additional_bindings`
1549
+ # option. Example: service Messaging ` rpc GetMessage(GetMessageRequest) returns
1550
+ # (Message) ` option (google.api.http) = ` get: "/v1/messages/`message_id`"
1551
+ # additional_bindings ` get: "/v1/users/`user_id`/messages/`message_id`" ` `; ` `
1552
+ # message GetMessageRequest ` string message_id = 1; string user_id = 2; ` This
1553
+ # enables the following two alternative HTTP JSON to RPC mappings: - HTTP: `GET /
1554
+ # v1/messages/123456` - gRPC: `GetMessage(message_id: "123456")` - HTTP: `GET /
1555
+ # v1/users/me/messages/123456` - gRPC: `GetMessage(user_id: "me" message_id: "
1556
+ # 123456")` Rules for HTTP mapping 1. Leaf request fields (recursive expansion
1557
+ # nested messages in the request message) are classified into three categories: -
1558
+ # Fields referred by the path template. They are passed via the URL path. -
1559
+ # Fields referred by the HttpRule.body. They are passed via the HTTP request
1560
+ # body. - All other fields are passed via the URL query parameters, and the
1561
+ # parameter name is the field path in the request message. A repeated field can
1562
+ # be represented as multiple query parameters under the same name. 2. If
1563
+ # HttpRule.body is "*", there is no URL query parameter, all fields are passed
1564
+ # via URL path and HTTP request body. 3. If HttpRule.body is omitted, there is
1565
+ # no HTTP request body, all fields are passed via URL path and URL query
1566
+ # parameters. Path template syntax Template = "/" Segments [ Verb ] ; Segments =
1567
+ # Segment ` "/" Segment ` ; Segment = "*" | "**" | LITERAL | Variable ; Variable
1568
+ # = "`" FieldPath [ "=" Segments ] "`" ; FieldPath = IDENT ` "." IDENT ` ; Verb =
1569
+ # ":" LITERAL ; The syntax `*` matches a single URL path segment. The syntax `**
1570
+ # ` matches zero or more URL path segments, which must be the last part of the
1571
+ # URL path except the `Verb`. The syntax `Variable` matches part of the URL path
1572
+ # as specified by its template. A variable template must not contain other
1574
1573
# variables. If a variable matches a single path segment, its template may be
1575
1574
# omitted, e.g. ``var`` is equivalent to ``var=*``. The syntax `LITERAL` matches
1576
1575
# literal text in the URL path. If the `LITERAL` contains any reserved character,
@@ -1585,7 +1584,7 @@ def update!(**args)
1585
1584
# except `[-_.~/0-9a-zA-Z]` are percent-encoded. The server side does the
1586
1585
# reverse decoding, except "%2F" and "%2f" are left unchanged. Such variables
1587
1586
# show up in the [Discovery Document](https://developers.google.com/discovery/v1/
1588
- # reference/apis) as ``+var``. ## Using gRPC API Service Configuration gRPC API
1587
+ # reference/apis) as ``+var``. Using gRPC API Service Configuration gRPC API
1589
1588
# Service Configuration (service config) is a configuration language for
1590
1589
# configuring a gRPC service to become a user-facing product. The service config
1591
1590
# is simply the YAML representation of the `google.api.Service` proto message.
@@ -1595,11 +1594,11 @@ def update!(**args)
1595
1594
# effect as the proto annotation. This can be particularly useful if you have a
1596
1595
# proto that is reused in multiple services. Note that any transcoding specified
1597
1596
# in the service config will override any matching transcoding configuration in
1598
- # the proto. Example: http: rules: # Selects a gRPC method and applies HttpRule
1599
- # to it. - selector: example.v1.Messaging.GetMessage get: /v1/messages/`
1600
- # message_id`/`sub.subfield` ## Special notes When gRPC Transcoding is used to
1601
- # map a gRPC to JSON REST endpoints, the proto to JSON conversion must follow
1602
- # the [ proto3 specification](https://developers.google.com/protocol-buffers/docs/
1597
+ # the proto. Example below selects a gRPC method and applies HttpRule to it.
1598
+ # http: rules: - selector: example.v1.Messaging.GetMessage get: /v1/messages/`
1599
+ # message_id`/`sub.subfield` Special notes When gRPC Transcoding is used to map
1600
+ # a gRPC to JSON REST endpoints, the proto to JSON conversion must follow the [
1601
+ # proto3 specification](https://developers.google.com/protocol-buffers/docs/
1603
1602
# proto3#json). While the single segment variable follows the semantics of [RFC
1604
1603
# 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
1605
1604
# Expansion, the multi segment variable **does not** follow RFC 6570 Section 3.2.
0 commit comments