Skip to content

Commit

Permalink
Automated Protos Update (#126)
Browse files Browse the repository at this point in the history
Co-authored-by: viambot <[email protected]>
  • Loading branch information
github-actions[bot] and viambot authored Jul 22, 2024
1 parent 8affa41 commit a330679
Showing 1 changed file with 63 additions and 40 deletions.
103 changes: 63 additions & 40 deletions src/gen/google.api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct Http {
#[prost(bool, tag="2")]
pub fully_decode_reserved_expansion: bool,
}
/// # gRPC Transcoding
/// gRPC Transcoding
///
/// gRPC Transcoding is a feature for mapping between a gRPC method and one or
/// more HTTP REST endpoints. It allows developers to build a single API service
Expand Down Expand Up @@ -60,9 +60,8 @@ pub struct Http {
///
/// This enables an HTTP REST to gRPC mapping as below:
///
/// HTTP | gRPC
/// -----|-----
/// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")`
/// - HTTP: `GET /v1/messages/123456`
/// - gRPC: `GetMessage(name: "messages/123456")`
///
/// Any fields in the request message which are not bound by the path template
/// automatically become HTTP query parameters if there is no HTTP request body.
Expand All @@ -86,11 +85,9 @@ pub struct Http {
///
/// This enables a HTTP JSON to RPC mapping as below:
///
/// HTTP | gRPC
/// -----|-----
/// `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
/// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
/// "foo"))`
/// - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
/// - gRPC: `GetMessage(message_id: "123456" revision: 2 sub:
/// SubMessage(subfield: "foo"))`
///
/// Note that fields which are mapped to URL query parameters must have a
/// primitive type or a repeated primitive type or a non-repeated message type.
Expand Down Expand Up @@ -120,10 +117,8 @@ pub struct Http {
/// representation of the JSON in the request body is determined by
/// protos JSON encoding:
///
/// HTTP | gRPC
/// -----|-----
/// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
/// "123456" message { text: "Hi!" })`
/// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
/// - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
///
/// The special name `*` can be used in the body mapping to define that
/// every field not bound by the path template should be mapped to the
Expand All @@ -146,10 +141,8 @@ pub struct Http {
///
/// The following HTTP JSON to RPC mapping is enabled:
///
/// HTTP | gRPC
/// -----|-----
/// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
/// "123456" text: "Hi!")`
/// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
/// - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
///
/// Note that when using `*` in the body mapping, it is not possible to
/// have HTTP parameters, as all fields not bound by the path end in
Expand Down Expand Up @@ -177,13 +170,13 @@ pub struct Http {
///
/// This enables the following two alternative HTTP JSON to RPC mappings:
///
/// HTTP | gRPC
/// -----|-----
/// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
/// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
/// "123456")`
/// - HTTP: `GET /v1/messages/123456`
/// - gRPC: `GetMessage(message_id: "123456")`
///
/// ## Rules for HTTP mapping
/// - HTTP: `GET /v1/users/me/messages/123456`
/// - gRPC: `GetMessage(user_id: "me" message_id: "123456")`
///
/// Rules for HTTP mapping
///
/// 1. Leaf request fields (recursive expansion nested messages in the request
/// message) are classified into three categories:
Expand All @@ -202,7 +195,7 @@ pub struct Http {
/// request body, all
/// fields are passed via URL path and URL query parameters.
///
/// ### Path template syntax
/// Path template syntax
///
/// Template = "/" Segments [ Verb ] ;
/// Segments = Segment { "/" Segment } ;
Expand Down Expand Up @@ -241,7 +234,7 @@ pub struct Http {
/// Document](<https://developers.google.com/discovery/v1/reference/apis>) as
/// `{+var}`.
///
/// ## Using gRPC API Service Configuration
/// Using gRPC API Service Configuration
///
/// gRPC API Service Configuration (service config) is a configuration language
/// for configuring a gRPC service to become a user-facing product. The
Expand All @@ -256,15 +249,14 @@ pub struct Http {
/// specified in the service config will override any matching transcoding
/// configuration in the proto.
///
/// Example:
/// The following example selects a gRPC method and applies an `HttpRule` to it:
///
/// http:
/// rules:
/// # Selects a gRPC method and applies HttpRule to it.
/// - selector: example.v1.Messaging.GetMessage
/// get: /v1/messages/{message_id}/{sub.subfield}
///
/// ## Special notes
/// Special notes
///
/// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
/// proto to JSON conversion must follow the [proto3
Expand Down Expand Up @@ -679,6 +671,13 @@ pub struct GoSettings {
pub struct MethodSettings {
/// The fully qualified name of the method, for which the options below apply.
/// This is used to find the method to apply the options.
///
/// Example:
///
/// publishing:
/// method_settings:
/// - selector: google.storage.control.v2.StorageControl.CreateFolder
/// # method settings for CreateFolder...
#[prost(string, tag="1")]
pub selector: ::prost::alloc::string::String,
/// Describes settings to use for long-running operations when generating
Expand All @@ -687,17 +686,14 @@ pub struct MethodSettings {
///
/// Example of a YAML configuration::
///
/// publishing:
/// method_settings:
/// publishing:
/// method_settings:
/// - selector: google.cloud.speech.v2.Speech.BatchRecognize
/// long_running:
/// initial_poll_delay:
/// seconds: 60 # 1 minute
/// initial_poll_delay: 60s # 1 minute
/// poll_delay_multiplier: 1.5
/// max_poll_delay:
/// seconds: 360 # 6 minutes
/// total_poll_timeout:
/// seconds: 54000 # 90 minutes
/// max_poll_delay: 360s # 6 minutes
/// total_poll_timeout: 54000s # 90 minutes
#[prost(message, optional, tag="2")]
pub long_running: ::core::option::Option<method_settings::LongRunning>,
/// List of top-level fields of the request message, that should be
Expand All @@ -706,8 +702,8 @@ pub struct MethodSettings {
///
/// Example of a YAML configuration:
///
/// publishing:
/// method_settings:
/// publishing:
/// method_settings:
/// - selector: google.example.v1.ExampleService.CreateExample
/// auto_populated_fields:
/// - request_id
Expand Down Expand Up @@ -931,6 +927,12 @@ pub struct FieldInfo {
/// applied to.
#[prost(enumeration="field_info::Format", tag="1")]
pub format: i32,
/// The type(s) that the annotated, generic field may represent.
///
/// Currently, this must only be used on fields of type `google.protobuf.Any`.
/// Supporting other generic types may be considered in the future.
#[prost(message, repeated, tag="2")]
pub referenced_types: ::prost::alloc::vec::Vec<TypeReference>,
}
/// Nested message and enum types in `FieldInfo`.
pub mod field_info {
Expand Down Expand Up @@ -990,6 +992,22 @@ pub mod field_info {
}
}
}
/// A reference to a message type, for use in \[FieldInfo][google.api.FieldInfo\].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TypeReference {
/// The name of the type that the annotated, generic field may represent.
/// If the type is in the same protobuf package, the value can be the simple
/// message name e.g., `"MyMessage"`. Otherwise, the value must be the
/// fully-qualified message name e.g., `"google.library.v1.Book"`.
///
/// If the type(s) are unknown to the service (e.g. the field accepts generic
/// user input), use the wildcard `"*"` to denote this behavior.
///
/// See \[AIP-202\](<https://google.aip.dev/202#type-references>) for more details.
#[prost(string, tag="1")]
pub type_name: ::prost::alloc::string::String,
}
/// Message that represents an arbitrary HTTP body. It should only be used for
/// payload formats that can't be represented as JSON, such as raw binary or
/// an HTML page.
Expand Down Expand Up @@ -1153,8 +1171,13 @@ pub struct ResourceDescriptor {
pub history: i32,
/// The plural name used in the resource name and permission names, such as
/// 'projects' for the resource name of 'projects/{project}' and the permission
/// name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
/// concept of the `plural` field in k8s CRD spec
/// name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
/// to this is for Nested Collections that have stuttering names, as defined
/// in \[AIP-122\](<https://google.aip.dev/122#nested-collections>), where the
/// collection ID in the resource name pattern does not necessarily directly
/// match the `plural` value.
///
/// It is the same concept of the `plural` field in k8s CRD spec
/// <https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/>
///
/// Note: The plural form is required even for singleton resources. See
Expand Down

0 comments on commit a330679

Please sign in to comment.