Skip to content

Commit a330679

Browse files
Automated Protos Update (#126)
Co-authored-by: viambot <[email protected]>
1 parent 8affa41 commit a330679

File tree

1 file changed

+63
-40
lines changed

1 file changed

+63
-40
lines changed

src/gen/google.api.rs

Lines changed: 63 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub struct Http {
1919
#[prost(bool, tag="2")]
2020
pub fully_decode_reserved_expansion: bool,
2121
}
22-
/// # gRPC Transcoding
22+
/// gRPC Transcoding
2323
///
2424
/// gRPC Transcoding is a feature for mapping between a gRPC method and one or
2525
/// more HTTP REST endpoints. It allows developers to build a single API service
@@ -60,9 +60,8 @@ pub struct Http {
6060
///
6161
/// This enables an HTTP REST to gRPC mapping as below:
6262
///
63-
/// HTTP | gRPC
64-
/// -----|-----
65-
/// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")`
63+
/// - HTTP: `GET /v1/messages/123456`
64+
/// - gRPC: `GetMessage(name: "messages/123456")`
6665
///
6766
/// Any fields in the request message which are not bound by the path template
6867
/// automatically become HTTP query parameters if there is no HTTP request body.
@@ -86,11 +85,9 @@ pub struct Http {
8685
///
8786
/// This enables a HTTP JSON to RPC mapping as below:
8887
///
89-
/// HTTP | gRPC
90-
/// -----|-----
91-
/// `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
92-
/// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
93-
/// "foo"))`
88+
/// - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
89+
/// - gRPC: `GetMessage(message_id: "123456" revision: 2 sub:
90+
/// SubMessage(subfield: "foo"))`
9491
///
9592
/// Note that fields which are mapped to URL query parameters must have a
9693
/// primitive type or a repeated primitive type or a non-repeated message type.
@@ -120,10 +117,8 @@ pub struct Http {
120117
/// representation of the JSON in the request body is determined by
121118
/// protos JSON encoding:
122119
///
123-
/// HTTP | gRPC
124-
/// -----|-----
125-
/// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
126-
/// "123456" message { text: "Hi!" })`
120+
/// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
121+
/// - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
127122
///
128123
/// The special name `*` can be used in the body mapping to define that
129124
/// every field not bound by the path template should be mapped to the
@@ -146,10 +141,8 @@ pub struct Http {
146141
///
147142
/// The following HTTP JSON to RPC mapping is enabled:
148143
///
149-
/// HTTP | gRPC
150-
/// -----|-----
151-
/// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
152-
/// "123456" text: "Hi!")`
144+
/// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
145+
/// - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
153146
///
154147
/// Note that when using `*` in the body mapping, it is not possible to
155148
/// have HTTP parameters, as all fields not bound by the path end in
@@ -177,13 +170,13 @@ pub struct Http {
177170
///
178171
/// This enables the following two alternative HTTP JSON to RPC mappings:
179172
///
180-
/// HTTP | gRPC
181-
/// -----|-----
182-
/// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
183-
/// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
184-
/// "123456")`
173+
/// - HTTP: `GET /v1/messages/123456`
174+
/// - gRPC: `GetMessage(message_id: "123456")`
185175
///
186-
/// ## Rules for HTTP mapping
176+
/// - HTTP: `GET /v1/users/me/messages/123456`
177+
/// - gRPC: `GetMessage(user_id: "me" message_id: "123456")`
178+
///
179+
/// Rules for HTTP mapping
187180
///
188181
/// 1. Leaf request fields (recursive expansion nested messages in the request
189182
/// message) are classified into three categories:
@@ -202,7 +195,7 @@ pub struct Http {
202195
/// request body, all
203196
/// fields are passed via URL path and URL query parameters.
204197
///
205-
/// ### Path template syntax
198+
/// Path template syntax
206199
///
207200
/// Template = "/" Segments [ Verb ] ;
208201
/// Segments = Segment { "/" Segment } ;
@@ -241,7 +234,7 @@ pub struct Http {
241234
/// Document](<https://developers.google.com/discovery/v1/reference/apis>) as
242235
/// `{+var}`.
243236
///
244-
/// ## Using gRPC API Service Configuration
237+
/// Using gRPC API Service Configuration
245238
///
246239
/// gRPC API Service Configuration (service config) is a configuration language
247240
/// for configuring a gRPC service to become a user-facing product. The
@@ -256,15 +249,14 @@ pub struct Http {
256249
/// specified in the service config will override any matching transcoding
257250
/// configuration in the proto.
258251
///
259-
/// Example:
252+
/// The following example selects a gRPC method and applies an `HttpRule` to it:
260253
///
261254
/// http:
262255
/// rules:
263-
/// # Selects a gRPC method and applies HttpRule to it.
264256
/// - selector: example.v1.Messaging.GetMessage
265257
/// get: /v1/messages/{message_id}/{sub.subfield}
266258
///
267-
/// ## Special notes
259+
/// Special notes
268260
///
269261
/// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
270262
/// proto to JSON conversion must follow the [proto3
@@ -679,6 +671,13 @@ pub struct GoSettings {
679671
pub struct MethodSettings {
680672
/// The fully qualified name of the method, for which the options below apply.
681673
/// This is used to find the method to apply the options.
674+
///
675+
/// Example:
676+
///
677+
/// publishing:
678+
/// method_settings:
679+
/// - selector: google.storage.control.v2.StorageControl.CreateFolder
680+
/// # method settings for CreateFolder...
682681
#[prost(string, tag="1")]
683682
pub selector: ::prost::alloc::string::String,
684683
/// Describes settings to use for long-running operations when generating
@@ -687,17 +686,14 @@ pub struct MethodSettings {
687686
///
688687
/// Example of a YAML configuration::
689688
///
690-
/// publishing:
691-
/// method_settings:
689+
/// publishing:
690+
/// method_settings:
692691
/// - selector: google.cloud.speech.v2.Speech.BatchRecognize
693692
/// long_running:
694-
/// initial_poll_delay:
695-
/// seconds: 60 # 1 minute
693+
/// initial_poll_delay: 60s # 1 minute
696694
/// poll_delay_multiplier: 1.5
697-
/// max_poll_delay:
698-
/// seconds: 360 # 6 minutes
699-
/// total_poll_timeout:
700-
/// seconds: 54000 # 90 minutes
695+
/// max_poll_delay: 360s # 6 minutes
696+
/// total_poll_timeout: 54000s # 90 minutes
701697
#[prost(message, optional, tag="2")]
702698
pub long_running: ::core::option::Option<method_settings::LongRunning>,
703699
/// List of top-level fields of the request message, that should be
@@ -706,8 +702,8 @@ pub struct MethodSettings {
706702
///
707703
/// Example of a YAML configuration:
708704
///
709-
/// publishing:
710-
/// method_settings:
705+
/// publishing:
706+
/// method_settings:
711707
/// - selector: google.example.v1.ExampleService.CreateExample
712708
/// auto_populated_fields:
713709
/// - request_id
@@ -931,6 +927,12 @@ pub struct FieldInfo {
931927
/// applied to.
932928
#[prost(enumeration="field_info::Format", tag="1")]
933929
pub format: i32,
930+
/// The type(s) that the annotated, generic field may represent.
931+
///
932+
/// Currently, this must only be used on fields of type `google.protobuf.Any`.
933+
/// Supporting other generic types may be considered in the future.
934+
#[prost(message, repeated, tag="2")]
935+
pub referenced_types: ::prost::alloc::vec::Vec<TypeReference>,
934936
}
935937
/// Nested message and enum types in `FieldInfo`.
936938
pub mod field_info {
@@ -990,6 +992,22 @@ pub mod field_info {
990992
}
991993
}
992994
}
995+
/// A reference to a message type, for use in \[FieldInfo][google.api.FieldInfo\].
996+
#[allow(clippy::derive_partial_eq_without_eq)]
997+
#[derive(Clone, PartialEq, ::prost::Message)]
998+
pub struct TypeReference {
999+
/// The name of the type that the annotated, generic field may represent.
1000+
/// If the type is in the same protobuf package, the value can be the simple
1001+
/// message name e.g., `"MyMessage"`. Otherwise, the value must be the
1002+
/// fully-qualified message name e.g., `"google.library.v1.Book"`.
1003+
///
1004+
/// If the type(s) are unknown to the service (e.g. the field accepts generic
1005+
/// user input), use the wildcard `"*"` to denote this behavior.
1006+
///
1007+
/// See \[AIP-202\](<https://google.aip.dev/202#type-references>) for more details.
1008+
#[prost(string, tag="1")]
1009+
pub type_name: ::prost::alloc::string::String,
1010+
}
9931011
/// Message that represents an arbitrary HTTP body. It should only be used for
9941012
/// payload formats that can't be represented as JSON, such as raw binary or
9951013
/// an HTML page.
@@ -1153,8 +1171,13 @@ pub struct ResourceDescriptor {
11531171
pub history: i32,
11541172
/// The plural name used in the resource name and permission names, such as
11551173
/// 'projects' for the resource name of 'projects/{project}' and the permission
1156-
/// name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
1157-
/// concept of the `plural` field in k8s CRD spec
1174+
/// name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
1175+
/// to this is for Nested Collections that have stuttering names, as defined
1176+
/// in \[AIP-122\](<https://google.aip.dev/122#nested-collections>), where the
1177+
/// collection ID in the resource name pattern does not necessarily directly
1178+
/// match the `plural` value.
1179+
///
1180+
/// It is the same concept of the `plural` field in k8s CRD spec
11581181
/// <https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/>
11591182
///
11601183
/// Note: The plural form is required even for singleton resources. See

0 commit comments

Comments
 (0)