viam_rust_utils/gen/google.api.rs
1// @generated
2/// Defines the HTTP configuration for an API service. It contains a list of
3/// \[HttpRule][google.api.HttpRule\], each specifying the mapping of an RPC method
4/// to one or more HTTP REST API methods.
5#[allow(clippy::derive_partial_eq_without_eq)]
6#[derive(Clone, PartialEq, ::prost::Message)]
7pub struct Http {
8 /// A list of HTTP configuration rules that apply to individual API methods.
9 ///
10 /// **NOTE:** All service configuration rules follow "last one wins" order.
11 #[prost(message, repeated, tag="1")]
12 pub rules: ::prost::alloc::vec::Vec<HttpRule>,
13 /// When set to true, URL path parameters will be fully URI-decoded except in
14 /// cases of single segment matches in reserved expansion, where "%2F" will be
15 /// left encoded.
16 ///
17 /// The default behavior is to not decode RFC 6570 reserved characters in multi
18 /// segment matches.
19 #[prost(bool, tag="2")]
20 pub fully_decode_reserved_expansion: bool,
21}
22/// gRPC Transcoding
23///
24/// gRPC Transcoding is a feature for mapping between a gRPC method and one or
25/// more HTTP REST endpoints. It allows developers to build a single API service
26/// that supports both gRPC APIs and REST APIs. Many systems, including [Google
27/// APIs](<https://github.com/googleapis/googleapis>),
28/// [Cloud Endpoints](<https://cloud.google.com/endpoints>), [gRPC
29/// Gateway](<https://github.com/grpc-ecosystem/grpc-gateway>),
30/// and \[Envoy\](<https://github.com/envoyproxy/envoy>) proxy support this feature
31/// and use it for large scale production services.
32///
33/// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
34/// how different portions of the gRPC request message are mapped to the URL
35/// path, URL query parameters, and HTTP request body. It also controls how the
36/// gRPC response message is mapped to the HTTP response body. `HttpRule` is
37/// typically specified as an `google.api.http` annotation on the gRPC method.
38///
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///
45/// Example:
46///
47/// service Messaging {
48/// rpc GetMessage(GetMessageRequest) returns (Message) {
49/// option (google.api.http) = {
50/// get: "/v1/{name=messages/*}"
51/// };
52/// }
53/// }
54/// message GetMessageRequest {
55/// string name = 1; // Mapped to URL path.
56/// }
57/// message Message {
58/// string text = 1; // The resource content.
59/// }
60///
61/// This enables an HTTP REST to gRPC mapping as below:
62///
63/// - HTTP: `GET /v1/messages/123456`
64/// - gRPC: `GetMessage(name: "messages/123456")`
65///
66/// Any fields in the request message which are not bound by the path template
67/// automatically become HTTP query parameters if there is no HTTP request body.
68/// For example:
69///
70/// service Messaging {
71/// rpc GetMessage(GetMessageRequest) returns (Message) {
72/// option (google.api.http) = {
73/// get:"/v1/messages/{message_id}"
74/// };
75/// }
76/// }
77/// message GetMessageRequest {
78/// message SubMessage {
79/// string subfield = 1;
80/// }
81/// string message_id = 1; // Mapped to URL path.
82/// int64 revision = 2; // Mapped to URL query parameter `revision`.
83/// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
84/// }
85///
86/// This enables a HTTP JSON to RPC mapping as below:
87///
88/// - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
89/// - gRPC: `GetMessage(message_id: "123456" revision: 2 sub:
90/// SubMessage(subfield: "foo"))`
91///
92/// Note that fields which are mapped to URL query parameters must have a
93/// primitive type or a repeated primitive type or a non-repeated message type.
94/// In the case of a repeated type, the parameter can be repeated in the URL
95/// as `...?param=A¶m=B`. In the case of a message type, each field of the
96/// message is mapped to a separate parameter, such as
97/// `...?foo.a=A&foo.b=B&foo.c=C`.
98///
99/// For HTTP methods that allow a request body, the `body` field
100/// specifies the mapping. Consider a REST update method on the
101/// message resource collection:
102///
103/// service Messaging {
104/// rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
105/// option (google.api.http) = {
106/// patch: "/v1/messages/{message_id}"
107/// body: "message"
108/// };
109/// }
110/// }
111/// message UpdateMessageRequest {
112/// string message_id = 1; // mapped to the URL
113/// Message message = 2; // mapped to the body
114/// }
115///
116/// The following HTTP JSON to RPC mapping is enabled, where the
117/// representation of the JSON in the request body is determined by
118/// protos JSON encoding:
119///
120/// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
121/// - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
122///
123/// The special name `*` can be used in the body mapping to define that
124/// every field not bound by the path template should be mapped to the
125/// request body. This enables the following alternative definition of
126/// the update method:
127///
128/// service Messaging {
129/// rpc UpdateMessage(Message) returns (Message) {
130/// option (google.api.http) = {
131/// patch: "/v1/messages/{message_id}"
132/// body: "*"
133/// };
134/// }
135/// }
136/// message Message {
137/// string message_id = 1;
138/// string text = 2;
139/// }
140///
141///
142/// The following HTTP JSON to RPC mapping is enabled:
143///
144/// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
145/// - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
146///
147/// Note that when using `*` in the body mapping, it is not possible to
148/// have HTTP parameters, as all fields not bound by the path end in
149/// the body. This makes this option more rarely used in practice when
150/// defining REST APIs. The common usage of `*` is in custom methods
151/// which don't use the URL at all for transferring data.
152///
153/// It is possible to define multiple HTTP methods for one RPC by using
154/// the `additional_bindings` option. Example:
155///
156/// service Messaging {
157/// rpc GetMessage(GetMessageRequest) returns (Message) {
158/// option (google.api.http) = {
159/// get: "/v1/messages/{message_id}"
160/// additional_bindings {
161/// get: "/v1/users/{user_id}/messages/{message_id}"
162/// }
163/// };
164/// }
165/// }
166/// message GetMessageRequest {
167/// string message_id = 1;
168/// string user_id = 2;
169/// }
170///
171/// This enables the following two alternative HTTP JSON to RPC mappings:
172///
173/// - HTTP: `GET /v1/messages/123456`
174/// - gRPC: `GetMessage(message_id: "123456")`
175///
176/// - HTTP: `GET /v1/users/me/messages/123456`
177/// - gRPC: `GetMessage(user_id: "me" message_id: "123456")`
178///
179/// Rules for HTTP mapping
180///
181/// 1. Leaf request fields (recursive expansion nested messages in the request
182/// message) are classified into three categories:
183/// - Fields referred by the path template. They are passed via the URL path.
184/// - Fields referred by the \[HttpRule.body][google.api.HttpRule.body\]. They
185/// are passed via the HTTP
186/// request body.
187/// - All other fields are passed via the URL query parameters, and the
188/// parameter name is the field path in the request message. A repeated
189/// field can be represented as multiple query parameters under the same
190/// name.
191/// 2. If \[HttpRule.body][google.api.HttpRule.body\] is "*", there is no URL
192/// query parameter, all fields
193/// are passed via URL path and HTTP request body.
194/// 3. If \[HttpRule.body][google.api.HttpRule.body\] is omitted, there is no HTTP
195/// request body, all
196/// fields are passed via URL path and URL query parameters.
197///
198/// Path template syntax
199///
200/// Template = "/" Segments [ Verb ] ;
201/// Segments = Segment { "/" Segment } ;
202/// Segment = "*" | "**" | LITERAL | Variable ;
203/// Variable = "{" FieldPath [ "=" Segments ] "}" ;
204/// FieldPath = IDENT { "." IDENT } ;
205/// Verb = ":" LITERAL ;
206///
207/// The syntax `*` matches a single URL path segment. The syntax `**` matches
208/// zero or more URL path segments, which must be the last part of the URL path
209/// except the `Verb`.
210///
211/// The syntax `Variable` matches part of the URL path as specified by its
212/// template. A variable template must not contain other variables. If a variable
213/// matches a single path segment, its template may be omitted, e.g. `{var}`
214/// is equivalent to `{var=*}`.
215///
216/// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
217/// contains any reserved character, such characters should be percent-encoded
218/// before the matching.
219///
220/// If a variable contains exactly one path segment, such as `"{var}"` or
221/// `"{var=*}"`, when such a variable is expanded into a URL path on the client
222/// side, all characters except `\[-_.~0-9a-zA-Z\]` are percent-encoded. The
223/// server side does the reverse decoding. Such variables show up in the
224/// [Discovery
225/// Document](<https://developers.google.com/discovery/v1/reference/apis>) as
226/// `{var}`.
227///
228/// If a variable contains multiple path segments, such as `"{var=foo/*}"`
229/// or `"{var=**}"`, when such a variable is expanded into a URL path on the
230/// client side, all characters except `\[-_.~/0-9a-zA-Z\]` are percent-encoded.
231/// The server side does the reverse decoding, except "%2F" and "%2f" are left
232/// unchanged. Such variables show up in the
233/// [Discovery
234/// Document](<https://developers.google.com/discovery/v1/reference/apis>) as
235/// `{+var}`.
236///
237/// Using gRPC API Service Configuration
238///
239/// gRPC API Service Configuration (service config) is a configuration language
240/// for configuring a gRPC service to become a user-facing product. The
241/// service config is simply the YAML representation of the `google.api.Service`
242/// proto message.
243///
244/// As an alternative to annotating your proto file, you can configure gRPC
245/// transcoding in your service config YAML files. You do this by specifying a
246/// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
247/// effect as the proto annotation. This can be particularly useful if you
248/// have a proto that is reused in multiple services. Note that any transcoding
249/// specified in the service config will override any matching transcoding
250/// configuration in the proto.
251///
252/// The following example selects a gRPC method and applies an `HttpRule` to it:
253///
254/// http:
255/// rules:
256/// - selector: example.v1.Messaging.GetMessage
257/// get: /v1/messages/{message_id}/{sub.subfield}
258///
259/// Special notes
260///
261/// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
262/// proto to JSON conversion must follow the [proto3
263/// specification](<https://developers.google.com/protocol-buffers/docs/proto3#json>).
264///
265/// While the single segment variable follows the semantics of
266/// [RFC 6570](<https://tools.ietf.org/html/rfc6570>) Section 3.2.2 Simple String
267/// Expansion, the multi segment variable **does not** follow RFC 6570 Section
268/// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
269/// does not expand special characters like `?` and `#`, which would lead
270/// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
271/// for multi segment variables.
272///
273/// The path variables **must not** refer to any repeated or mapped field,
274/// because client libraries are not capable of handling such variable expansion.
275///
276/// The path variables **must not** capture the leading "/" character. The reason
277/// is that the most common use case "{var}" does not capture the leading "/"
278/// character. For consistency, all path variables must share the same behavior.
279///
280/// Repeated message fields must not be mapped to URL query parameters, because
281/// no client library can support such complicated mapping.
282///
283/// If an API needs to use a JSON array for request or response body, it can map
284/// the request or response body to a repeated field. However, some gRPC
285/// Transcoding implementations may not support this feature.
286#[allow(clippy::derive_partial_eq_without_eq)]
287#[derive(Clone, PartialEq, ::prost::Message)]
288pub struct HttpRule {
289 /// Selects a method to which this rule applies.
290 ///
291 /// Refer to \[selector][google.api.DocumentationRule.selector\] for syntax
292 /// details.
293 #[prost(string, tag="1")]
294 pub selector: ::prost::alloc::string::String,
295 /// The name of the request field whose value is mapped to the HTTP request
296 /// body, or `*` for mapping all request fields not captured by the path
297 /// pattern to the HTTP body, or omitted for not having any HTTP request body.
298 ///
299 /// NOTE: the referred field must be present at the top-level of the request
300 /// message type.
301 #[prost(string, tag="7")]
302 pub body: ::prost::alloc::string::String,
303 /// Optional. The name of the response field whose value is mapped to the HTTP
304 /// response body. When omitted, the entire response message will be used
305 /// as the HTTP response body.
306 ///
307 /// NOTE: The referred field must be present at the top-level of the response
308 /// message type.
309 #[prost(string, tag="12")]
310 pub response_body: ::prost::alloc::string::String,
311 /// Additional HTTP bindings for the selector. Nested bindings must
312 /// not contain an `additional_bindings` field themselves (that is,
313 /// the nesting may only be one level deep).
314 #[prost(message, repeated, tag="11")]
315 pub additional_bindings: ::prost::alloc::vec::Vec<HttpRule>,
316 /// Determines the URL pattern is matched by this rules. This pattern can be
317 /// used with any of the {get|put|post|delete|patch} methods. A custom method
318 /// can be defined using the 'custom' field.
319 #[prost(oneof="http_rule::Pattern", tags="2, 3, 4, 5, 6, 8")]
320 pub pattern: ::core::option::Option<http_rule::Pattern>,
321}
322/// Nested message and enum types in `HttpRule`.
323pub mod http_rule {
324 /// Determines the URL pattern is matched by this rules. This pattern can be
325 /// used with any of the {get|put|post|delete|patch} methods. A custom method
326 /// can be defined using the 'custom' field.
327 #[allow(clippy::derive_partial_eq_without_eq)]
328#[derive(Clone, PartialEq, ::prost::Oneof)]
329 pub enum Pattern {
330 /// Maps to HTTP GET. Used for listing and getting information about
331 /// resources.
332 #[prost(string, tag="2")]
333 Get(::prost::alloc::string::String),
334 /// Maps to HTTP PUT. Used for replacing a resource.
335 #[prost(string, tag="3")]
336 Put(::prost::alloc::string::String),
337 /// Maps to HTTP POST. Used for creating a resource or performing an action.
338 #[prost(string, tag="4")]
339 Post(::prost::alloc::string::String),
340 /// Maps to HTTP DELETE. Used for deleting a resource.
341 #[prost(string, tag="5")]
342 Delete(::prost::alloc::string::String),
343 /// Maps to HTTP PATCH. Used for updating a resource.
344 #[prost(string, tag="6")]
345 Patch(::prost::alloc::string::String),
346 /// The custom pattern is used for specifying an HTTP method that is not
347 /// included in the `pattern` field, such as HEAD, or "*" to leave the
348 /// HTTP method unspecified for this rule. The wild-card rule is useful
349 /// for services that provide content to Web (HTML) clients.
350 #[prost(message, tag="8")]
351 Custom(super::CustomHttpPattern),
352 }
353}
354/// A custom pattern is used for defining custom HTTP verb.
355#[allow(clippy::derive_partial_eq_without_eq)]
356#[derive(Clone, PartialEq, ::prost::Message)]
357pub struct CustomHttpPattern {
358 /// The name of this custom HTTP verb.
359 #[prost(string, tag="1")]
360 pub kind: ::prost::alloc::string::String,
361 /// The path matched by this custom verb.
362 #[prost(string, tag="2")]
363 pub path: ::prost::alloc::string::String,
364}
365/// The launch stage as defined by [Google Cloud Platform
366/// Launch Stages](<https://cloud.google.com/terms/launch-stages>).
367#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
368#[repr(i32)]
369pub enum LaunchStage {
370 /// Do not use this default value.
371 Unspecified = 0,
372 /// The feature is not yet implemented. Users can not use it.
373 Unimplemented = 6,
374 /// Prelaunch features are hidden from users and are only visible internally.
375 Prelaunch = 7,
376 /// Early Access features are limited to a closed group of testers. To use
377 /// these features, you must sign up in advance and sign a Trusted Tester
378 /// agreement (which includes confidentiality provisions). These features may
379 /// be unstable, changed in backward-incompatible ways, and are not
380 /// guaranteed to be released.
381 EarlyAccess = 1,
382 /// Alpha is a limited availability test for releases before they are cleared
383 /// for widespread use. By Alpha, all significant design issues are resolved
384 /// and we are in the process of verifying functionality. Alpha customers
385 /// need to apply for access, agree to applicable terms, and have their
386 /// projects allowlisted. Alpha releases don't have to be feature complete,
387 /// no SLAs are provided, and there are no technical support obligations, but
388 /// they will be far enough along that customers can actually use them in
389 /// test environments or for limited-use tests -- just like they would in
390 /// normal production cases.
391 Alpha = 2,
392 /// Beta is the point at which we are ready to open a release for any
393 /// customer to use. There are no SLA or technical support obligations in a
394 /// Beta release. Products will be complete from a feature perspective, but
395 /// may have some open outstanding issues. Beta releases are suitable for
396 /// limited production use cases.
397 Beta = 3,
398 /// GA features are open to all developers and are considered stable and
399 /// fully qualified for production use.
400 Ga = 4,
401 /// Deprecated features are scheduled to be shut down and removed. For more
402 /// information, see the "Deprecation Policy" section of our [Terms of
403 /// Service](<https://cloud.google.com/terms/>)
404 /// and the [Google Cloud Platform Subject to the Deprecation
405 /// Policy](<https://cloud.google.com/terms/deprecation>) documentation.
406 Deprecated = 5,
407}
408impl LaunchStage {
409 /// String value of the enum field names used in the ProtoBuf definition.
410 ///
411 /// The values are not transformed in any way and thus are considered stable
412 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
413 pub fn as_str_name(&self) -> &'static str {
414 match self {
415 LaunchStage::Unspecified => "LAUNCH_STAGE_UNSPECIFIED",
416 LaunchStage::Unimplemented => "UNIMPLEMENTED",
417 LaunchStage::Prelaunch => "PRELAUNCH",
418 LaunchStage::EarlyAccess => "EARLY_ACCESS",
419 LaunchStage::Alpha => "ALPHA",
420 LaunchStage::Beta => "BETA",
421 LaunchStage::Ga => "GA",
422 LaunchStage::Deprecated => "DEPRECATED",
423 }
424 }
425 /// Creates an enum from field names used in the ProtoBuf definition.
426 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
427 match value {
428 "LAUNCH_STAGE_UNSPECIFIED" => Some(Self::Unspecified),
429 "UNIMPLEMENTED" => Some(Self::Unimplemented),
430 "PRELAUNCH" => Some(Self::Prelaunch),
431 "EARLY_ACCESS" => Some(Self::EarlyAccess),
432 "ALPHA" => Some(Self::Alpha),
433 "BETA" => Some(Self::Beta),
434 "GA" => Some(Self::Ga),
435 "DEPRECATED" => Some(Self::Deprecated),
436 _ => None,
437 }
438 }
439}
440/// Required information for every language.
441#[allow(clippy::derive_partial_eq_without_eq)]
442#[derive(Clone, PartialEq, ::prost::Message)]
443pub struct CommonLanguageSettings {
444 /// Link to automatically generated reference documentation. Example:
445 /// <https://cloud.google.com/nodejs/docs/reference/asset/latest>
446 #[deprecated]
447 #[prost(string, tag="1")]
448 pub reference_docs_uri: ::prost::alloc::string::String,
449 /// The destination where API teams want this client library to be published.
450 #[prost(enumeration="ClientLibraryDestination", repeated, tag="2")]
451 pub destinations: ::prost::alloc::vec::Vec<i32>,
452 /// Configuration for which RPCs should be generated in the GAPIC client.
453 #[prost(message, optional, tag="3")]
454 pub selective_gapic_generation: ::core::option::Option<SelectiveGapicGeneration>,
455}
456/// Details about how and where to publish client libraries.
457#[allow(clippy::derive_partial_eq_without_eq)]
458#[derive(Clone, PartialEq, ::prost::Message)]
459pub struct ClientLibrarySettings {
460 /// Version of the API to apply these settings to. This is the full protobuf
461 /// package for the API, ending in the version element.
462 /// Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
463 #[prost(string, tag="1")]
464 pub version: ::prost::alloc::string::String,
465 /// Launch stage of this version of the API.
466 #[prost(enumeration="LaunchStage", tag="2")]
467 pub launch_stage: i32,
468 /// When using transport=rest, the client request will encode enums as
469 /// numbers rather than strings.
470 #[prost(bool, tag="3")]
471 pub rest_numeric_enums: bool,
472 /// Settings for legacy Java features, supported in the Service YAML.
473 #[prost(message, optional, tag="21")]
474 pub java_settings: ::core::option::Option<JavaSettings>,
475 /// Settings for C++ client libraries.
476 #[prost(message, optional, tag="22")]
477 pub cpp_settings: ::core::option::Option<CppSettings>,
478 /// Settings for PHP client libraries.
479 #[prost(message, optional, tag="23")]
480 pub php_settings: ::core::option::Option<PhpSettings>,
481 /// Settings for Python client libraries.
482 #[prost(message, optional, tag="24")]
483 pub python_settings: ::core::option::Option<PythonSettings>,
484 /// Settings for Node client libraries.
485 #[prost(message, optional, tag="25")]
486 pub node_settings: ::core::option::Option<NodeSettings>,
487 /// Settings for .NET client libraries.
488 #[prost(message, optional, tag="26")]
489 pub dotnet_settings: ::core::option::Option<DotnetSettings>,
490 /// Settings for Ruby client libraries.
491 #[prost(message, optional, tag="27")]
492 pub ruby_settings: ::core::option::Option<RubySettings>,
493 /// Settings for Go client libraries.
494 #[prost(message, optional, tag="28")]
495 pub go_settings: ::core::option::Option<GoSettings>,
496}
497/// This message configures the settings for publishing [Google Cloud Client
498/// libraries](<https://cloud.google.com/apis/docs/cloud-client-libraries>)
499/// generated from the service config.
500#[allow(clippy::derive_partial_eq_without_eq)]
501#[derive(Clone, PartialEq, ::prost::Message)]
502pub struct Publishing {
503 /// A list of API method settings, e.g. the behavior for methods that use the
504 /// long-running operation pattern.
505 #[prost(message, repeated, tag="2")]
506 pub method_settings: ::prost::alloc::vec::Vec<MethodSettings>,
507 /// Link to a *public* URI where users can report issues. Example:
508 /// <https://issuetracker.google.com/issues/new?component=190865&template=1161103>
509 #[prost(string, tag="101")]
510 pub new_issue_uri: ::prost::alloc::string::String,
511 /// Link to product home page. Example:
512 /// <https://cloud.google.com/asset-inventory/docs/overview>
513 #[prost(string, tag="102")]
514 pub documentation_uri: ::prost::alloc::string::String,
515 /// Used as a tracking tag when collecting data about the APIs developer
516 /// relations artifacts like docs, packages delivered to package managers,
517 /// etc. Example: "speech".
518 #[prost(string, tag="103")]
519 pub api_short_name: ::prost::alloc::string::String,
520 /// GitHub label to apply to issues and pull requests opened for this API.
521 #[prost(string, tag="104")]
522 pub github_label: ::prost::alloc::string::String,
523 /// GitHub teams to be added to CODEOWNERS in the directory in GitHub
524 /// containing source code for the client libraries for this API.
525 #[prost(string, repeated, tag="105")]
526 pub codeowner_github_teams: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
527 /// A prefix used in sample code when demarking regions to be included in
528 /// documentation.
529 #[prost(string, tag="106")]
530 pub doc_tag_prefix: ::prost::alloc::string::String,
531 /// For whom the client library is being published.
532 #[prost(enumeration="ClientLibraryOrganization", tag="107")]
533 pub organization: i32,
534 /// Client library settings. If the same version string appears multiple
535 /// times in this list, then the last one wins. Settings from earlier
536 /// settings with the same version string are discarded.
537 #[prost(message, repeated, tag="109")]
538 pub library_settings: ::prost::alloc::vec::Vec<ClientLibrarySettings>,
539 /// Optional link to proto reference documentation. Example:
540 /// <https://cloud.google.com/pubsub/lite/docs/reference/rpc>
541 #[prost(string, tag="110")]
542 pub proto_reference_documentation_uri: ::prost::alloc::string::String,
543 /// Optional link to REST reference documentation. Example:
544 /// <https://cloud.google.com/pubsub/lite/docs/reference/rest>
545 #[prost(string, tag="111")]
546 pub rest_reference_documentation_uri: ::prost::alloc::string::String,
547}
548/// Settings for Java client libraries.
549#[allow(clippy::derive_partial_eq_without_eq)]
550#[derive(Clone, PartialEq, ::prost::Message)]
551pub struct JavaSettings {
552 /// The package name to use in Java. Clobbers the java_package option
553 /// set in the protobuf. This should be used **only** by APIs
554 /// who have already set the language_settings.java.package_name" field
555 /// in gapic.yaml. API teams should use the protobuf java_package option
556 /// where possible.
557 ///
558 /// Example of a YAML configuration::
559 ///
560 /// publishing:
561 /// java_settings:
562 /// library_package: com.google.cloud.pubsub.v1
563 #[prost(string, tag="1")]
564 pub library_package: ::prost::alloc::string::String,
565 /// Configure the Java class name to use instead of the service's for its
566 /// corresponding generated GAPIC client. Keys are fully-qualified
567 /// service names as they appear in the protobuf (including the full
568 /// the language_settings.java.interface_names" field in gapic.yaml. API
569 /// teams should otherwise use the service name as it appears in the
570 /// protobuf.
571 ///
572 /// Example of a YAML configuration::
573 ///
574 /// publishing:
575 /// java_settings:
576 /// service_class_names:
577 /// - google.pubsub.v1.Publisher: TopicAdmin
578 /// - google.pubsub.v1.Subscriber: SubscriptionAdmin
579 #[prost(map="string, string", tag="2")]
580 pub service_class_names: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
581 /// Some settings.
582 #[prost(message, optional, tag="3")]
583 pub common: ::core::option::Option<CommonLanguageSettings>,
584}
585/// Settings for C++ client libraries.
586#[allow(clippy::derive_partial_eq_without_eq)]
587#[derive(Clone, PartialEq, ::prost::Message)]
588pub struct CppSettings {
589 /// Some settings.
590 #[prost(message, optional, tag="1")]
591 pub common: ::core::option::Option<CommonLanguageSettings>,
592}
593/// Settings for Php client libraries.
594#[allow(clippy::derive_partial_eq_without_eq)]
595#[derive(Clone, PartialEq, ::prost::Message)]
596pub struct PhpSettings {
597 /// Some settings.
598 #[prost(message, optional, tag="1")]
599 pub common: ::core::option::Option<CommonLanguageSettings>,
600}
601/// Settings for Python client libraries.
602#[allow(clippy::derive_partial_eq_without_eq)]
603#[derive(Clone, PartialEq, ::prost::Message)]
604pub struct PythonSettings {
605 /// Some settings.
606 #[prost(message, optional, tag="1")]
607 pub common: ::core::option::Option<CommonLanguageSettings>,
608 /// Experimental features to be included during client library generation.
609 #[prost(message, optional, tag="2")]
610 pub experimental_features: ::core::option::Option<python_settings::ExperimentalFeatures>,
611}
612/// Nested message and enum types in `PythonSettings`.
613pub mod python_settings {
614 /// Experimental features to be included during client library generation.
615 /// These fields will be deprecated once the feature graduates and is enabled
616 /// by default.
617 #[allow(clippy::derive_partial_eq_without_eq)]
618#[derive(Clone, PartialEq, ::prost::Message)]
619 pub struct ExperimentalFeatures {
620 /// Enables generation of asynchronous REST clients if `rest` transport is
621 /// enabled. By default, asynchronous REST clients will not be generated.
622 /// This feature will be enabled by default 1 month after launching the
623 /// feature in preview packages.
624 #[prost(bool, tag="1")]
625 pub rest_async_io_enabled: bool,
626 /// Enables generation of protobuf code using new types that are more
627 /// Pythonic which are included in `protobuf>=5.29.x`. This feature will be
628 /// enabled by default 1 month after launching the feature in preview
629 /// packages.
630 #[prost(bool, tag="2")]
631 pub protobuf_pythonic_types_enabled: bool,
632 /// Disables generation of an unversioned Python package for this client
633 /// library. This means that the module names will need to be versioned in
634 /// import statements. For example `import google.cloud.library_v2` instead
635 /// of `import google.cloud.library`.
636 #[prost(bool, tag="3")]
637 pub unversioned_package_disabled: bool,
638 }
639}
640/// Settings for Node client libraries.
641#[allow(clippy::derive_partial_eq_without_eq)]
642#[derive(Clone, PartialEq, ::prost::Message)]
643pub struct NodeSettings {
644 /// Some settings.
645 #[prost(message, optional, tag="1")]
646 pub common: ::core::option::Option<CommonLanguageSettings>,
647}
648/// Settings for Dotnet client libraries.
649#[allow(clippy::derive_partial_eq_without_eq)]
650#[derive(Clone, PartialEq, ::prost::Message)]
651pub struct DotnetSettings {
652 /// Some settings.
653 #[prost(message, optional, tag="1")]
654 pub common: ::core::option::Option<CommonLanguageSettings>,
655 /// Map from original service names to renamed versions.
656 /// This is used when the default generated types
657 /// would cause a naming conflict. (Neither name is
658 /// fully-qualified.)
659 /// Example: Subscriber to SubscriberServiceApi.
660 #[prost(map="string, string", tag="2")]
661 pub renamed_services: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
662 /// Map from full resource types to the effective short name
663 /// for the resource. This is used when otherwise resource
664 /// named from different services would cause naming collisions.
665 /// Example entry:
666 /// "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
667 #[prost(map="string, string", tag="3")]
668 pub renamed_resources: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
669 /// List of full resource types to ignore during generation.
670 /// This is typically used for API-specific Location resources,
671 /// which should be handled by the generator as if they were actually
672 /// the common Location resources.
673 /// Example entry: "documentai.googleapis.com/Location"
674 #[prost(string, repeated, tag="4")]
675 pub ignored_resources: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
676 /// Namespaces which must be aliased in snippets due to
677 /// a known (but non-generator-predictable) naming collision
678 #[prost(string, repeated, tag="5")]
679 pub forced_namespace_aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
680 /// Method signatures (in the form "service.method(signature)")
681 /// which are provided separately, so shouldn't be generated.
682 /// Snippets *calling* these methods are still generated, however.
683 #[prost(string, repeated, tag="6")]
684 pub handwritten_signatures: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
685}
686/// Settings for Ruby client libraries.
687#[allow(clippy::derive_partial_eq_without_eq)]
688#[derive(Clone, PartialEq, ::prost::Message)]
689pub struct RubySettings {
690 /// Some settings.
691 #[prost(message, optional, tag="1")]
692 pub common: ::core::option::Option<CommonLanguageSettings>,
693}
694/// Settings for Go client libraries.
695#[allow(clippy::derive_partial_eq_without_eq)]
696#[derive(Clone, PartialEq, ::prost::Message)]
697pub struct GoSettings {
698 /// Some settings.
699 #[prost(message, optional, tag="1")]
700 pub common: ::core::option::Option<CommonLanguageSettings>,
701 /// Map of service names to renamed services. Keys are the package relative
702 /// service names and values are the name to be used for the service client
703 /// and call options.
704 ///
705 /// publishing:
706 /// go_settings:
707 /// renamed_services:
708 /// Publisher: TopicAdmin
709 #[prost(map="string, string", tag="2")]
710 pub renamed_services: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
711}
712/// Describes the generator configuration for a method.
713#[allow(clippy::derive_partial_eq_without_eq)]
714#[derive(Clone, PartialEq, ::prost::Message)]
715pub struct MethodSettings {
716 /// The fully qualified name of the method, for which the options below apply.
717 /// This is used to find the method to apply the options.
718 ///
719 /// Example:
720 ///
721 /// publishing:
722 /// method_settings:
723 /// - selector: google.storage.control.v2.StorageControl.CreateFolder
724 /// # method settings for CreateFolder...
725 #[prost(string, tag="1")]
726 pub selector: ::prost::alloc::string::String,
727 /// Describes settings to use for long-running operations when generating
728 /// API methods for RPCs. Complements RPCs that use the annotations in
729 /// google/longrunning/operations.proto.
730 ///
731 /// Example of a YAML configuration::
732 ///
733 /// publishing:
734 /// method_settings:
735 /// - selector: google.cloud.speech.v2.Speech.BatchRecognize
736 /// long_running:
737 /// initial_poll_delay: 60s # 1 minute
738 /// poll_delay_multiplier: 1.5
739 /// max_poll_delay: 360s # 6 minutes
740 /// total_poll_timeout: 54000s # 90 minutes
741 #[prost(message, optional, tag="2")]
742 pub long_running: ::core::option::Option<method_settings::LongRunning>,
743 /// List of top-level fields of the request message, that should be
744 /// automatically populated by the client libraries based on their
745 /// (google.api.field_info).format. Currently supported format: UUID4.
746 ///
747 /// Example of a YAML configuration:
748 ///
749 /// publishing:
750 /// method_settings:
751 /// - selector: google.example.v1.ExampleService.CreateExample
752 /// auto_populated_fields:
753 /// - request_id
754 #[prost(string, repeated, tag="3")]
755 pub auto_populated_fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
756}
757/// Nested message and enum types in `MethodSettings`.
758pub mod method_settings {
759 /// Describes settings to use when generating API methods that use the
760 /// long-running operation pattern.
761 /// All default values below are from those used in the client library
762 /// generators (e.g.
763 /// \[Java\](<https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java>)).
764 #[allow(clippy::derive_partial_eq_without_eq)]
765#[derive(Clone, PartialEq, ::prost::Message)]
766 pub struct LongRunning {
767 /// Initial delay after which the first poll request will be made.
768 /// Default value: 5 seconds.
769 #[prost(message, optional, tag="1")]
770 pub initial_poll_delay: ::core::option::Option<::prost_types::Duration>,
771 /// Multiplier to gradually increase delay between subsequent polls until it
772 /// reaches max_poll_delay.
773 /// Default value: 1.5.
774 #[prost(float, tag="2")]
775 pub poll_delay_multiplier: f32,
776 /// Maximum time between two subsequent poll requests.
777 /// Default value: 45 seconds.
778 #[prost(message, optional, tag="3")]
779 pub max_poll_delay: ::core::option::Option<::prost_types::Duration>,
780 /// Total polling timeout.
781 /// Default value: 5 minutes.
782 #[prost(message, optional, tag="4")]
783 pub total_poll_timeout: ::core::option::Option<::prost_types::Duration>,
784 }
785}
786/// This message is used to configure the generation of a subset of the RPCs in
787/// a service for client libraries.
788#[allow(clippy::derive_partial_eq_without_eq)]
789#[derive(Clone, PartialEq, ::prost::Message)]
790pub struct SelectiveGapicGeneration {
791 /// An allowlist of the fully qualified names of RPCs that should be included
792 /// on public client surfaces.
793 #[prost(string, repeated, tag="1")]
794 pub methods: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
795 /// Setting this to true indicates to the client generators that methods
796 /// that would be excluded from the generation should instead be generated
797 /// in a way that indicates these methods should not be consumed by
798 /// end users. How this is expressed is up to individual language
799 /// implementations to decide. Some examples may be: added annotations,
800 /// obfuscated identifiers, or other language idiomatic patterns.
801 #[prost(bool, tag="2")]
802 pub generate_omitted_as_internal: bool,
803}
804/// The organization for which the client libraries are being published.
805/// Affects the url where generated docs are published, etc.
806#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
807#[repr(i32)]
808pub enum ClientLibraryOrganization {
809 /// Not useful.
810 Unspecified = 0,
811 /// Google Cloud Platform Org.
812 Cloud = 1,
813 /// Ads (Advertising) Org.
814 Ads = 2,
815 /// Photos Org.
816 Photos = 3,
817 /// Street View Org.
818 StreetView = 4,
819 /// Shopping Org.
820 Shopping = 5,
821 /// Geo Org.
822 Geo = 6,
823 /// Generative AI - <https://developers.generativeai.google>
824 GenerativeAi = 7,
825}
826impl ClientLibraryOrganization {
827 /// String value of the enum field names used in the ProtoBuf definition.
828 ///
829 /// The values are not transformed in any way and thus are considered stable
830 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
831 pub fn as_str_name(&self) -> &'static str {
832 match self {
833 ClientLibraryOrganization::Unspecified => "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED",
834 ClientLibraryOrganization::Cloud => "CLOUD",
835 ClientLibraryOrganization::Ads => "ADS",
836 ClientLibraryOrganization::Photos => "PHOTOS",
837 ClientLibraryOrganization::StreetView => "STREET_VIEW",
838 ClientLibraryOrganization::Shopping => "SHOPPING",
839 ClientLibraryOrganization::Geo => "GEO",
840 ClientLibraryOrganization::GenerativeAi => "GENERATIVE_AI",
841 }
842 }
843 /// Creates an enum from field names used in the ProtoBuf definition.
844 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
845 match value {
846 "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" => Some(Self::Unspecified),
847 "CLOUD" => Some(Self::Cloud),
848 "ADS" => Some(Self::Ads),
849 "PHOTOS" => Some(Self::Photos),
850 "STREET_VIEW" => Some(Self::StreetView),
851 "SHOPPING" => Some(Self::Shopping),
852 "GEO" => Some(Self::Geo),
853 "GENERATIVE_AI" => Some(Self::GenerativeAi),
854 _ => None,
855 }
856 }
857}
858/// To where should client libraries be published?
859#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
860#[repr(i32)]
861pub enum ClientLibraryDestination {
862 /// Client libraries will neither be generated nor published to package
863 /// managers.
864 Unspecified = 0,
865 /// Generate the client library in a repo under github.com/googleapis,
866 /// but don't publish it to package managers.
867 Github = 10,
868 /// Publish the library to package managers like nuget.org and npmjs.com.
869 PackageManager = 20,
870}
871impl ClientLibraryDestination {
872 /// String value of the enum field names used in the ProtoBuf definition.
873 ///
874 /// The values are not transformed in any way and thus are considered stable
875 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
876 pub fn as_str_name(&self) -> &'static str {
877 match self {
878 ClientLibraryDestination::Unspecified => "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED",
879 ClientLibraryDestination::Github => "GITHUB",
880 ClientLibraryDestination::PackageManager => "PACKAGE_MANAGER",
881 }
882 }
883 /// Creates an enum from field names used in the ProtoBuf definition.
884 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
885 match value {
886 "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED" => Some(Self::Unspecified),
887 "GITHUB" => Some(Self::Github),
888 "PACKAGE_MANAGER" => Some(Self::PackageManager),
889 _ => None,
890 }
891 }
892}
893/// An indicator of the behavior of a given field (for example, that a field
894/// is required in requests, or given as output but ignored as input).
895/// This **does not** change the behavior in protocol buffers itself; it only
896/// denotes the behavior and may affect how API tooling handles the field.
897///
898/// Note: This enum **may** receive new values in the future.
899#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
900#[repr(i32)]
901pub enum FieldBehavior {
902 /// Conventional default for enums. Do not use this.
903 Unspecified = 0,
904 /// Specifically denotes a field as optional.
905 /// While all fields in protocol buffers are optional, this may be specified
906 /// for emphasis if appropriate.
907 Optional = 1,
908 /// Denotes a field as required.
909 /// This indicates that the field **must** be provided as part of the request,
910 /// and failure to do so will cause an error (usually `INVALID_ARGUMENT`).
911 Required = 2,
912 /// Denotes a field as output only.
913 /// This indicates that the field is provided in responses, but including the
914 /// field in a request does nothing (the server *must* ignore it and
915 /// *must not* throw an error as a result of the field's presence).
916 OutputOnly = 3,
917 /// Denotes a field as input only.
918 /// This indicates that the field is provided in requests, and the
919 /// corresponding field is not included in output.
920 InputOnly = 4,
921 /// Denotes a field as immutable.
922 /// This indicates that the field may be set once in a request to create a
923 /// resource, but may not be changed thereafter.
924 Immutable = 5,
925 /// Denotes that a (repeated) field is an unordered list.
926 /// This indicates that the service may provide the elements of the list
927 /// in any arbitrary order, rather than the order the user originally
928 /// provided. Additionally, the list's order may or may not be stable.
929 UnorderedList = 6,
930 /// Denotes that this field returns a non-empty default value if not set.
931 /// This indicates that if the user provides the empty value in a request,
932 /// a non-empty value will be returned. The user will not be aware of what
933 /// non-empty value to expect.
934 NonEmptyDefault = 7,
935 /// Denotes that the field in a resource (a message annotated with
936 /// google.api.resource) is used in the resource name to uniquely identify the
937 /// resource. For AIP-compliant APIs, this should only be applied to the
938 /// `name` field on the resource.
939 ///
940 /// This behavior should not be applied to references to other resources within
941 /// the message.
942 ///
943 /// The identifier field of resources often have different field behavior
944 /// depending on the request it is embedded in (e.g. for Create methods name
945 /// is optional and unused, while for Update methods it is required). Instead
946 /// of method-specific annotations, only `IDENTIFIER` is required.
947 Identifier = 8,
948}
949impl FieldBehavior {
950 /// String value of the enum field names used in the ProtoBuf definition.
951 ///
952 /// The values are not transformed in any way and thus are considered stable
953 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
954 pub fn as_str_name(&self) -> &'static str {
955 match self {
956 FieldBehavior::Unspecified => "FIELD_BEHAVIOR_UNSPECIFIED",
957 FieldBehavior::Optional => "OPTIONAL",
958 FieldBehavior::Required => "REQUIRED",
959 FieldBehavior::OutputOnly => "OUTPUT_ONLY",
960 FieldBehavior::InputOnly => "INPUT_ONLY",
961 FieldBehavior::Immutable => "IMMUTABLE",
962 FieldBehavior::UnorderedList => "UNORDERED_LIST",
963 FieldBehavior::NonEmptyDefault => "NON_EMPTY_DEFAULT",
964 FieldBehavior::Identifier => "IDENTIFIER",
965 }
966 }
967 /// Creates an enum from field names used in the ProtoBuf definition.
968 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
969 match value {
970 "FIELD_BEHAVIOR_UNSPECIFIED" => Some(Self::Unspecified),
971 "OPTIONAL" => Some(Self::Optional),
972 "REQUIRED" => Some(Self::Required),
973 "OUTPUT_ONLY" => Some(Self::OutputOnly),
974 "INPUT_ONLY" => Some(Self::InputOnly),
975 "IMMUTABLE" => Some(Self::Immutable),
976 "UNORDERED_LIST" => Some(Self::UnorderedList),
977 "NON_EMPTY_DEFAULT" => Some(Self::NonEmptyDefault),
978 "IDENTIFIER" => Some(Self::Identifier),
979 _ => None,
980 }
981 }
982}
983/// Rich semantic information of an API field beyond basic typing.
984#[allow(clippy::derive_partial_eq_without_eq)]
985#[derive(Clone, PartialEq, ::prost::Message)]
986pub struct FieldInfo {
987 /// The standard format of a field value. This does not explicitly configure
988 /// any API consumer, just documents the API's format for the field it is
989 /// applied to.
990 #[prost(enumeration="field_info::Format", tag="1")]
991 pub format: i32,
992 /// The type(s) that the annotated, generic field may represent.
993 ///
994 /// Currently, this must only be used on fields of type `google.protobuf.Any`.
995 /// Supporting other generic types may be considered in the future.
996 #[prost(message, repeated, tag="2")]
997 pub referenced_types: ::prost::alloc::vec::Vec<TypeReference>,
998}
999/// Nested message and enum types in `FieldInfo`.
1000pub mod field_info {
1001 /// The standard format of a field value. The supported formats are all backed
1002 /// by either an RFC defined by the IETF or a Google-defined AIP.
1003 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1004 #[repr(i32)]
1005 pub enum Format {
1006 /// Default, unspecified value.
1007 Unspecified = 0,
1008 /// Universally Unique Identifier, version 4, value as defined by
1009 /// <https://datatracker.ietf.org/doc/html/rfc4122.> The value may be
1010 /// normalized to entirely lowercase letters. For example, the value
1011 /// `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to
1012 /// `f47ac10b-58cc-0372-8567-0e02b2c3d479`.
1013 Uuid4 = 1,
1014 /// Internet Protocol v4 value as defined by [RFC
1015 /// 791](<https://datatracker.ietf.org/doc/html/rfc791>). The value may be
1016 /// condensed, with leading zeros in each octet stripped. For example,
1017 /// `001.022.233.040` would be condensed to `1.22.233.40`.
1018 Ipv4 = 2,
1019 /// Internet Protocol v6 value as defined by [RFC
1020 /// 2460](<https://datatracker.ietf.org/doc/html/rfc2460>). The value may be
1021 /// normalized to entirely lowercase letters with zeros compressed, following
1022 /// [RFC 5952](<https://datatracker.ietf.org/doc/html/rfc5952>). For example,
1023 /// the value `2001:0DB8:0::0` would be normalized to `2001:db8::`.
1024 Ipv6 = 3,
1025 /// An IP address in either v4 or v6 format as described by the individual
1026 /// values defined herein. See the comments on the IPV4 and IPV6 types for
1027 /// allowed normalizations of each.
1028 Ipv4OrIpv6 = 4,
1029 }
1030 impl Format {
1031 /// String value of the enum field names used in the ProtoBuf definition.
1032 ///
1033 /// The values are not transformed in any way and thus are considered stable
1034 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1035 pub fn as_str_name(&self) -> &'static str {
1036 match self {
1037 Format::Unspecified => "FORMAT_UNSPECIFIED",
1038 Format::Uuid4 => "UUID4",
1039 Format::Ipv4 => "IPV4",
1040 Format::Ipv6 => "IPV6",
1041 Format::Ipv4OrIpv6 => "IPV4_OR_IPV6",
1042 }
1043 }
1044 /// Creates an enum from field names used in the ProtoBuf definition.
1045 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1046 match value {
1047 "FORMAT_UNSPECIFIED" => Some(Self::Unspecified),
1048 "UUID4" => Some(Self::Uuid4),
1049 "IPV4" => Some(Self::Ipv4),
1050 "IPV6" => Some(Self::Ipv6),
1051 "IPV4_OR_IPV6" => Some(Self::Ipv4OrIpv6),
1052 _ => None,
1053 }
1054 }
1055 }
1056}
1057/// A reference to a message type, for use in \[FieldInfo][google.api.FieldInfo\].
1058#[allow(clippy::derive_partial_eq_without_eq)]
1059#[derive(Clone, PartialEq, ::prost::Message)]
1060pub struct TypeReference {
1061 /// The name of the type that the annotated, generic field may represent.
1062 /// If the type is in the same protobuf package, the value can be the simple
1063 /// message name e.g., `"MyMessage"`. Otherwise, the value must be the
1064 /// fully-qualified message name e.g., `"google.library.v1.Book"`.
1065 ///
1066 /// If the type(s) are unknown to the service (e.g. the field accepts generic
1067 /// user input), use the wildcard `"*"` to denote this behavior.
1068 ///
1069 /// See \[AIP-202\](<https://google.aip.dev/202#type-references>) for more details.
1070 #[prost(string, tag="1")]
1071 pub type_name: ::prost::alloc::string::String,
1072}
1073/// Message that represents an arbitrary HTTP body. It should only be used for
1074/// payload formats that can't be represented as JSON, such as raw binary or
1075/// an HTML page.
1076///
1077///
1078/// This message can be used both in streaming and non-streaming API methods in
1079/// the request as well as the response.
1080///
1081/// It can be used as a top-level request field, which is convenient if one
1082/// wants to extract parameters from either the URL or HTTP template into the
1083/// request fields and also want access to the raw HTTP body.
1084///
1085/// Example:
1086///
1087/// message GetResourceRequest {
1088/// // A unique request id.
1089/// string request_id = 1;
1090///
1091/// // The raw HTTP body is bound to this field.
1092/// google.api.HttpBody http_body = 2;
1093///
1094/// }
1095///
1096/// service ResourceService {
1097/// rpc GetResource(GetResourceRequest)
1098/// returns (google.api.HttpBody);
1099/// rpc UpdateResource(google.api.HttpBody)
1100/// returns (google.protobuf.Empty);
1101///
1102/// }
1103///
1104/// Example with streaming methods:
1105///
1106/// service CaldavService {
1107/// rpc GetCalendar(stream google.api.HttpBody)
1108/// returns (stream google.api.HttpBody);
1109/// rpc UpdateCalendar(stream google.api.HttpBody)
1110/// returns (stream google.api.HttpBody);
1111///
1112/// }
1113///
1114/// Use of this type only changes how the request and response bodies are
1115/// handled, all other features will continue to work unchanged.
1116#[allow(clippy::derive_partial_eq_without_eq)]
1117#[derive(Clone, PartialEq, ::prost::Message)]
1118pub struct HttpBody {
1119 /// The HTTP Content-Type header value specifying the content type of the body.
1120 #[prost(string, tag="1")]
1121 pub content_type: ::prost::alloc::string::String,
1122 /// The HTTP request/response body as raw binary.
1123 #[prost(bytes="vec", tag="2")]
1124 pub data: ::prost::alloc::vec::Vec<u8>,
1125 /// Application specific response metadata. Must be set in the first response
1126 /// for streaming APIs.
1127 #[prost(message, repeated, tag="3")]
1128 pub extensions: ::prost::alloc::vec::Vec<::prost_types::Any>,
1129}
1130/// A simple descriptor of a resource type.
1131///
1132/// ResourceDescriptor annotates a resource message (either by means of a
1133/// protobuf annotation or use in the service config), and associates the
1134/// resource's schema, the resource type, and the pattern of the resource name.
1135///
1136/// Example:
1137///
1138/// message Topic {
1139/// // Indicates this message defines a resource schema.
1140/// // Declares the resource type in the format of {service}/{kind}.
1141/// // For Kubernetes resources, the format is {api group}/{kind}.
1142/// option (google.api.resource) = {
1143/// type: "pubsub.googleapis.com/Topic"
1144/// pattern: "projects/{project}/topics/{topic}"
1145/// };
1146/// }
1147///
1148/// The ResourceDescriptor Yaml config will look like:
1149///
1150/// resources:
1151/// - type: "pubsub.googleapis.com/Topic"
1152/// pattern: "projects/{project}/topics/{topic}"
1153///
1154/// Sometimes, resources have multiple patterns, typically because they can
1155/// live under multiple parents.
1156///
1157/// Example:
1158///
1159/// message LogEntry {
1160/// option (google.api.resource) = {
1161/// type: "logging.googleapis.com/LogEntry"
1162/// pattern: "projects/{project}/logs/{log}"
1163/// pattern: "folders/{folder}/logs/{log}"
1164/// pattern: "organizations/{organization}/logs/{log}"
1165/// pattern: "billingAccounts/{billing_account}/logs/{log}"
1166/// };
1167/// }
1168///
1169/// The ResourceDescriptor Yaml config will look like:
1170///
1171/// resources:
1172/// - type: 'logging.googleapis.com/LogEntry'
1173/// pattern: "projects/{project}/logs/{log}"
1174/// pattern: "folders/{folder}/logs/{log}"
1175/// pattern: "organizations/{organization}/logs/{log}"
1176/// pattern: "billingAccounts/{billing_account}/logs/{log}"
1177#[allow(clippy::derive_partial_eq_without_eq)]
1178#[derive(Clone, PartialEq, ::prost::Message)]
1179pub struct ResourceDescriptor {
1180 /// The resource type. It must be in the format of
1181 /// {service_name}/{resource_type_kind}. The `resource_type_kind` must be
1182 /// singular and must not include version numbers.
1183 ///
1184 /// Example: `storage.googleapis.com/Bucket`
1185 ///
1186 /// The value of the resource_type_kind must follow the regular expression
1187 /// /\[A-Za-z][a-zA-Z0-9\]+/. It should start with an upper case character and
1188 /// should use PascalCase (UpperCamelCase). The maximum number of
1189 /// characters allowed for the `resource_type_kind` is 100.
1190 #[prost(string, tag="1")]
1191 pub r#type: ::prost::alloc::string::String,
1192 /// Optional. The relative resource name pattern associated with this resource
1193 /// type. The DNS prefix of the full resource name shouldn't be specified here.
1194 ///
1195 /// The path pattern must follow the syntax, which aligns with HTTP binding
1196 /// syntax:
1197 ///
1198 /// Template = Segment { "/" Segment } ;
1199 /// Segment = LITERAL | Variable ;
1200 /// Variable = "{" LITERAL "}" ;
1201 ///
1202 /// Examples:
1203 ///
1204 /// - "projects/{project}/topics/{topic}"
1205 /// - "projects/{project}/knowledgeBases/{knowledge_base}"
1206 ///
1207 /// The components in braces correspond to the IDs for each resource in the
1208 /// hierarchy. It is expected that, if multiple patterns are provided,
1209 /// the same component name (e.g. "project") refers to IDs of the same
1210 /// type of resource.
1211 #[prost(string, repeated, tag="2")]
1212 pub pattern: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1213 /// Optional. The field on the resource that designates the resource name
1214 /// field. If omitted, this is assumed to be "name".
1215 #[prost(string, tag="3")]
1216 pub name_field: ::prost::alloc::string::String,
1217 /// Optional. The historical or future-looking state of the resource pattern.
1218 ///
1219 /// Example:
1220 ///
1221 /// // The InspectTemplate message originally only supported resource
1222 /// // names with organization, and project was added later.
1223 /// message InspectTemplate {
1224 /// option (google.api.resource) = {
1225 /// type: "dlp.googleapis.com/InspectTemplate"
1226 /// pattern:
1227 /// "organizations/{organization}/inspectTemplates/{inspect_template}"
1228 /// pattern: "projects/{project}/inspectTemplates/{inspect_template}"
1229 /// history: ORIGINALLY_SINGLE_PATTERN
1230 /// };
1231 /// }
1232 #[prost(enumeration="resource_descriptor::History", tag="4")]
1233 pub history: i32,
1234 /// The plural name used in the resource name and permission names, such as
1235 /// 'projects' for the resource name of 'projects/{project}' and the permission
1236 /// name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
1237 /// to this is for Nested Collections that have stuttering names, as defined
1238 /// in \[AIP-122\](<https://google.aip.dev/122#nested-collections>), where the
1239 /// collection ID in the resource name pattern does not necessarily directly
1240 /// match the `plural` value.
1241 ///
1242 /// It is the same concept of the `plural` field in k8s CRD spec
1243 /// <https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/>
1244 ///
1245 /// Note: The plural form is required even for singleton resources. See
1246 /// <https://aip.dev/156>
1247 #[prost(string, tag="5")]
1248 pub plural: ::prost::alloc::string::String,
1249 /// The same concept of the `singular` field in k8s CRD spec
1250 /// <https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/>
1251 /// Such as "project" for the `resourcemanager.googleapis.com/Project` type.
1252 #[prost(string, tag="6")]
1253 pub singular: ::prost::alloc::string::String,
1254 /// Style flag(s) for this resource.
1255 /// These indicate that a resource is expected to conform to a given
1256 /// style. See the specific style flags for additional information.
1257 #[prost(enumeration="resource_descriptor::Style", repeated, tag="10")]
1258 pub style: ::prost::alloc::vec::Vec<i32>,
1259}
1260/// Nested message and enum types in `ResourceDescriptor`.
1261pub mod resource_descriptor {
1262 /// A description of the historical or future-looking state of the
1263 /// resource pattern.
1264 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1265 #[repr(i32)]
1266 pub enum History {
1267 /// The "unset" value.
1268 Unspecified = 0,
1269 /// The resource originally had one pattern and launched as such, and
1270 /// additional patterns were added later.
1271 OriginallySinglePattern = 1,
1272 /// The resource has one pattern, but the API owner expects to add more
1273 /// later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents
1274 /// that from being necessary once there are multiple patterns.)
1275 FutureMultiPattern = 2,
1276 }
1277 impl History {
1278 /// String value of the enum field names used in the ProtoBuf definition.
1279 ///
1280 /// The values are not transformed in any way and thus are considered stable
1281 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1282 pub fn as_str_name(&self) -> &'static str {
1283 match self {
1284 History::Unspecified => "HISTORY_UNSPECIFIED",
1285 History::OriginallySinglePattern => "ORIGINALLY_SINGLE_PATTERN",
1286 History::FutureMultiPattern => "FUTURE_MULTI_PATTERN",
1287 }
1288 }
1289 /// Creates an enum from field names used in the ProtoBuf definition.
1290 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1291 match value {
1292 "HISTORY_UNSPECIFIED" => Some(Self::Unspecified),
1293 "ORIGINALLY_SINGLE_PATTERN" => Some(Self::OriginallySinglePattern),
1294 "FUTURE_MULTI_PATTERN" => Some(Self::FutureMultiPattern),
1295 _ => None,
1296 }
1297 }
1298 }
1299 /// A flag representing a specific style that a resource claims to conform to.
1300 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1301 #[repr(i32)]
1302 pub enum Style {
1303 /// The unspecified value. Do not use.
1304 Unspecified = 0,
1305 /// This resource is intended to be "declarative-friendly".
1306 ///
1307 /// Declarative-friendly resources must be more strictly consistent, and
1308 /// setting this to true communicates to tools that this resource should
1309 /// adhere to declarative-friendly expectations.
1310 ///
1311 /// Note: This is used by the API linter (linter.aip.dev) to enable
1312 /// additional checks.
1313 DeclarativeFriendly = 1,
1314 }
1315 impl Style {
1316 /// String value of the enum field names used in the ProtoBuf definition.
1317 ///
1318 /// The values are not transformed in any way and thus are considered stable
1319 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1320 pub fn as_str_name(&self) -> &'static str {
1321 match self {
1322 Style::Unspecified => "STYLE_UNSPECIFIED",
1323 Style::DeclarativeFriendly => "DECLARATIVE_FRIENDLY",
1324 }
1325 }
1326 /// Creates an enum from field names used in the ProtoBuf definition.
1327 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1328 match value {
1329 "STYLE_UNSPECIFIED" => Some(Self::Unspecified),
1330 "DECLARATIVE_FRIENDLY" => Some(Self::DeclarativeFriendly),
1331 _ => None,
1332 }
1333 }
1334 }
1335}
1336/// Defines a proto annotation that describes a string field that refers to
1337/// an API resource.
1338#[allow(clippy::derive_partial_eq_without_eq)]
1339#[derive(Clone, PartialEq, ::prost::Message)]
1340pub struct ResourceReference {
1341 /// The resource type that the annotated field references.
1342 ///
1343 /// Example:
1344 ///
1345 /// message Subscription {
1346 /// string topic = 2 [(google.api.resource_reference) = {
1347 /// type: "pubsub.googleapis.com/Topic"
1348 /// }];
1349 /// }
1350 ///
1351 /// Occasionally, a field may reference an arbitrary resource. In this case,
1352 /// APIs use the special value * in their resource reference.
1353 ///
1354 /// Example:
1355 ///
1356 /// message GetIamPolicyRequest {
1357 /// string resource = 2 [(google.api.resource_reference) = {
1358 /// type: "*"
1359 /// }];
1360 /// }
1361 #[prost(string, tag="1")]
1362 pub r#type: ::prost::alloc::string::String,
1363 /// The resource type of a child collection that the annotated field
1364 /// references. This is useful for annotating the `parent` field that
1365 /// doesn't have a fixed resource type.
1366 ///
1367 /// Example:
1368 ///
1369 /// message ListLogEntriesRequest {
1370 /// string parent = 1 [(google.api.resource_reference) = {
1371 /// child_type: "logging.googleapis.com/LogEntry"
1372 /// };
1373 /// }
1374 #[prost(string, tag="2")]
1375 pub child_type: ::prost::alloc::string::String,
1376}
1377/// Specifies the routing information that should be sent along with the request
1378/// in the form of routing header.
1379/// **NOTE:** All service configuration rules follow the "last one wins" order.
1380///
1381/// The examples below will apply to an RPC which has the following request type:
1382///
1383/// Message Definition:
1384///
1385/// message Request {
1386/// // The name of the Table
1387/// // Values can be of the following formats:
1388/// // - `projects/<project>/tables/<table>`
1389/// // - `projects/<project>/instances/<instance>/tables/<table>`
1390/// // - `region/<region>/zones/<zone>/tables/<table>`
1391/// string table_name = 1;
1392///
1393/// // This value specifies routing for replication.
1394/// // It can be in the following formats:
1395/// // - `profiles/<profile_id>`
1396/// // - a legacy `profile_id` that can be any string
1397/// string app_profile_id = 2;
1398/// }
1399///
1400/// Example message:
1401///
1402/// {
1403/// table_name: projects/proj_foo/instances/instance_bar/table/table_baz,
1404/// app_profile_id: profiles/prof_qux
1405/// }
1406///
1407/// The routing header consists of one or multiple key-value pairs. Every key
1408/// and value must be percent-encoded, and joined together in the format of
1409/// `key1=value1&key2=value2`.
1410/// The examples below skip the percent-encoding for readability.
1411///
1412/// Example 1
1413///
1414/// Extracting a field from the request to put into the routing header
1415/// unchanged, with the key equal to the field name.
1416///
1417/// annotation:
1418///
1419/// option (google.api.routing) = {
1420/// // Take the `app_profile_id`.
1421/// routing_parameters {
1422/// field: "app_profile_id"
1423/// }
1424/// };
1425///
1426/// result:
1427///
1428/// x-goog-request-params: app_profile_id=profiles/prof_qux
1429///
1430/// Example 2
1431///
1432/// Extracting a field from the request to put into the routing header
1433/// unchanged, with the key different from the field name.
1434///
1435/// annotation:
1436///
1437/// option (google.api.routing) = {
1438/// // Take the `app_profile_id`, but name it `routing_id` in the header.
1439/// routing_parameters {
1440/// field: "app_profile_id"
1441/// path_template: "{routing_id=**}"
1442/// }
1443/// };
1444///
1445/// result:
1446///
1447/// x-goog-request-params: routing_id=profiles/prof_qux
1448///
1449/// Example 3
1450///
1451/// Extracting a field from the request to put into the routing
1452/// header, while matching a path template syntax on the field's value.
1453///
1454/// NB: it is more useful to send nothing than to send garbage for the purpose
1455/// of dynamic routing, since garbage pollutes cache. Thus the matching.
1456///
1457/// Sub-example 3a
1458///
1459/// The field matches the template.
1460///
1461/// annotation:
1462///
1463/// option (google.api.routing) = {
1464/// // Take the `table_name`, if it's well-formed (with project-based
1465/// // syntax).
1466/// routing_parameters {
1467/// field: "table_name"
1468/// path_template: "{table_name=projects/*/instances/*/**}"
1469/// }
1470/// };
1471///
1472/// result:
1473///
1474/// x-goog-request-params:
1475/// table_name=projects/proj_foo/instances/instance_bar/table/table_baz
1476///
1477/// Sub-example 3b
1478///
1479/// The field does not match the template.
1480///
1481/// annotation:
1482///
1483/// option (google.api.routing) = {
1484/// // Take the `table_name`, if it's well-formed (with region-based
1485/// // syntax).
1486/// routing_parameters {
1487/// field: "table_name"
1488/// path_template: "{table_name=regions/*/zones/*/**}"
1489/// }
1490/// };
1491///
1492/// result:
1493///
1494/// <no routing header will be sent>
1495///
1496/// Sub-example 3c
1497///
1498/// Multiple alternative conflictingly named path templates are
1499/// specified. The one that matches is used to construct the header.
1500///
1501/// annotation:
1502///
1503/// option (google.api.routing) = {
1504/// // Take the `table_name`, if it's well-formed, whether
1505/// // using the region- or projects-based syntax.
1506///
1507/// routing_parameters {
1508/// field: "table_name"
1509/// path_template: "{table_name=regions/*/zones/*/**}"
1510/// }
1511/// routing_parameters {
1512/// field: "table_name"
1513/// path_template: "{table_name=projects/*/instances/*/**}"
1514/// }
1515/// };
1516///
1517/// result:
1518///
1519/// x-goog-request-params:
1520/// table_name=projects/proj_foo/instances/instance_bar/table/table_baz
1521///
1522/// Example 4
1523///
1524/// Extracting a single routing header key-value pair by matching a
1525/// template syntax on (a part of) a single request field.
1526///
1527/// annotation:
1528///
1529/// option (google.api.routing) = {
1530/// // Take just the project id from the `table_name` field.
1531/// routing_parameters {
1532/// field: "table_name"
1533/// path_template: "{routing_id=projects/*}/**"
1534/// }
1535/// };
1536///
1537/// result:
1538///
1539/// x-goog-request-params: routing_id=projects/proj_foo
1540///
1541/// Example 5
1542///
1543/// Extracting a single routing header key-value pair by matching
1544/// several conflictingly named path templates on (parts of) a single request
1545/// field. The last template to match "wins" the conflict.
1546///
1547/// annotation:
1548///
1549/// option (google.api.routing) = {
1550/// // If the `table_name` does not have instances information,
1551/// // take just the project id for routing.
1552/// // Otherwise take project + instance.
1553///
1554/// routing_parameters {
1555/// field: "table_name"
1556/// path_template: "{routing_id=projects/*}/**"
1557/// }
1558/// routing_parameters {
1559/// field: "table_name"
1560/// path_template: "{routing_id=projects/*/instances/*}/**"
1561/// }
1562/// };
1563///
1564/// result:
1565///
1566/// x-goog-request-params:
1567/// routing_id=projects/proj_foo/instances/instance_bar
1568///
1569/// Example 6
1570///
1571/// Extracting multiple routing header key-value pairs by matching
1572/// several non-conflicting path templates on (parts of) a single request field.
1573///
1574/// Sub-example 6a
1575///
1576/// Make the templates strict, so that if the `table_name` does not
1577/// have an instance information, nothing is sent.
1578///
1579/// annotation:
1580///
1581/// option (google.api.routing) = {
1582/// // The routing code needs two keys instead of one composite
1583/// // but works only for the tables with the "project-instance" name
1584/// // syntax.
1585///
1586/// routing_parameters {
1587/// field: "table_name"
1588/// path_template: "{project_id=projects/*}/instances/*/**"
1589/// }
1590/// routing_parameters {
1591/// field: "table_name"
1592/// path_template: "projects/*/{instance_id=instances/*}/**"
1593/// }
1594/// };
1595///
1596/// result:
1597///
1598/// x-goog-request-params:
1599/// project_id=projects/proj_foo&instance_id=instances/instance_bar
1600///
1601/// Sub-example 6b
1602///
1603/// Make the templates loose, so that if the `table_name` does not
1604/// have an instance information, just the project id part is sent.
1605///
1606/// annotation:
1607///
1608/// option (google.api.routing) = {
1609/// // The routing code wants two keys instead of one composite
1610/// // but will work with just the `project_id` for tables without
1611/// // an instance in the `table_name`.
1612///
1613/// routing_parameters {
1614/// field: "table_name"
1615/// path_template: "{project_id=projects/*}/**"
1616/// }
1617/// routing_parameters {
1618/// field: "table_name"
1619/// path_template: "projects/*/{instance_id=instances/*}/**"
1620/// }
1621/// };
1622///
1623/// result (is the same as 6a for our example message because it has the instance
1624/// information):
1625///
1626/// x-goog-request-params:
1627/// project_id=projects/proj_foo&instance_id=instances/instance_bar
1628///
1629/// Example 7
1630///
1631/// Extracting multiple routing header key-value pairs by matching
1632/// several path templates on multiple request fields.
1633///
1634/// NB: note that here there is no way to specify sending nothing if one of the
1635/// fields does not match its template. E.g. if the `table_name` is in the wrong
1636/// format, the `project_id` will not be sent, but the `routing_id` will be.
1637/// The backend routing code has to be aware of that and be prepared to not
1638/// receive a full complement of keys if it expects multiple.
1639///
1640/// annotation:
1641///
1642/// option (google.api.routing) = {
1643/// // The routing needs both `project_id` and `routing_id`
1644/// // (from the `app_profile_id` field) for routing.
1645///
1646/// routing_parameters {
1647/// field: "table_name"
1648/// path_template: "{project_id=projects/*}/**"
1649/// }
1650/// routing_parameters {
1651/// field: "app_profile_id"
1652/// path_template: "{routing_id=**}"
1653/// }
1654/// };
1655///
1656/// result:
1657///
1658/// x-goog-request-params:
1659/// project_id=projects/proj_foo&routing_id=profiles/prof_qux
1660///
1661/// Example 8
1662///
1663/// Extracting a single routing header key-value pair by matching
1664/// several conflictingly named path templates on several request fields. The
1665/// last template to match "wins" the conflict.
1666///
1667/// annotation:
1668///
1669/// option (google.api.routing) = {
1670/// // The `routing_id` can be a project id or a region id depending on
1671/// // the table name format, but only if the `app_profile_id` is not set.
1672/// // If `app_profile_id` is set it should be used instead.
1673///
1674/// routing_parameters {
1675/// field: "table_name"
1676/// path_template: "{routing_id=projects/*}/**"
1677/// }
1678/// routing_parameters {
1679/// field: "table_name"
1680/// path_template: "{routing_id=regions/*}/**"
1681/// }
1682/// routing_parameters {
1683/// field: "app_profile_id"
1684/// path_template: "{routing_id=**}"
1685/// }
1686/// };
1687///
1688/// result:
1689///
1690/// x-goog-request-params: routing_id=profiles/prof_qux
1691///
1692/// Example 9
1693///
1694/// Bringing it all together.
1695///
1696/// annotation:
1697///
1698/// option (google.api.routing) = {
1699/// // For routing both `table_location` and a `routing_id` are needed.
1700/// //
1701/// // table_location can be either an instance id or a region+zone id.
1702/// //
1703/// // For `routing_id`, take the value of `app_profile_id`
1704/// // - If it's in the format `profiles/<profile_id>`, send
1705/// // just the `<profile_id>` part.
1706/// // - If it's any other literal, send it as is.
1707/// // If the `app_profile_id` is empty, and the `table_name` starts with
1708/// // the project_id, send that instead.
1709///
1710/// routing_parameters {
1711/// field: "table_name"
1712/// path_template: "projects/*/{table_location=instances/*}/tables/*"
1713/// }
1714/// routing_parameters {
1715/// field: "table_name"
1716/// path_template: "{table_location=regions/*/zones/*}/tables/*"
1717/// }
1718/// routing_parameters {
1719/// field: "table_name"
1720/// path_template: "{routing_id=projects/*}/**"
1721/// }
1722/// routing_parameters {
1723/// field: "app_profile_id"
1724/// path_template: "{routing_id=**}"
1725/// }
1726/// routing_parameters {
1727/// field: "app_profile_id"
1728/// path_template: "profiles/{routing_id=*}"
1729/// }
1730/// };
1731///
1732/// result:
1733///
1734/// x-goog-request-params:
1735/// table_location=instances/instance_bar&routing_id=prof_qux
1736#[allow(clippy::derive_partial_eq_without_eq)]
1737#[derive(Clone, PartialEq, ::prost::Message)]
1738pub struct RoutingRule {
1739 /// A collection of Routing Parameter specifications.
1740 /// **NOTE:** If multiple Routing Parameters describe the same key
1741 /// (via the `path_template` field or via the `field` field when
1742 /// `path_template` is not provided), "last one wins" rule
1743 /// determines which Parameter gets used.
1744 /// See the examples for more details.
1745 #[prost(message, repeated, tag="2")]
1746 pub routing_parameters: ::prost::alloc::vec::Vec<RoutingParameter>,
1747}
1748/// A projection from an input message to the GRPC or REST header.
1749#[allow(clippy::derive_partial_eq_without_eq)]
1750#[derive(Clone, PartialEq, ::prost::Message)]
1751pub struct RoutingParameter {
1752 /// A request field to extract the header key-value pair from.
1753 #[prost(string, tag="1")]
1754 pub field: ::prost::alloc::string::String,
1755 /// A pattern matching the key-value field. Optional.
1756 /// If not specified, the whole field specified in the `field` field will be
1757 /// taken as value, and its name used as key. If specified, it MUST contain
1758 /// exactly one named segment (along with any number of unnamed segments) The
1759 /// pattern will be matched over the field specified in the `field` field, then
1760 /// if the match is successful:
1761 /// - the name of the single named segment will be used as a header name,
1762 /// - the match value of the segment will be used as a header value;
1763 /// if the match is NOT successful, nothing will be sent.
1764 ///
1765 /// Example:
1766 ///
1767 /// -- This is a field in the request message
1768 /// | that the header value will be extracted from.
1769 /// |
1770 /// | -- This is the key name in the
1771 /// | | routing header.
1772 /// V |
1773 /// field: "table_name" v
1774 /// path_template: "projects/*/{table_location=instances/*}/tables/*"
1775 /// ^ ^
1776 /// | |
1777 /// In the {} brackets is the pattern that -- |
1778 /// specifies what to extract from the |
1779 /// field as a value to be sent. |
1780 /// |
1781 /// The string in the field must match the whole pattern --
1782 /// before brackets, inside brackets, after brackets.
1783 ///
1784 /// When looking at this specific example, we can see that:
1785 /// - A key-value pair with the key `table_location`
1786 /// and the value matching `instances/*` should be added
1787 /// to the x-goog-request-params routing header.
1788 /// - The value is extracted from the request message's `table_name` field
1789 /// if it matches the full pattern specified:
1790 /// `projects/*/instances/*/tables/*`.
1791 ///
1792 /// **NB:** If the `path_template` field is not provided, the key name is
1793 /// equal to the field name, and the whole field should be sent as a value.
1794 /// This makes the pattern for the field and the value functionally equivalent
1795 /// to `**`, and the configuration
1796 ///
1797 /// {
1798 /// field: "table_name"
1799 /// }
1800 ///
1801 /// is a functionally equivalent shorthand to:
1802 ///
1803 /// {
1804 /// field: "table_name"
1805 /// path_template: "{table_name=**}"
1806 /// }
1807 ///
1808 /// See Example 1 for more details.
1809 #[prost(string, tag="2")]
1810 pub path_template: ::prost::alloc::string::String,
1811}
1812/// `Visibility` restricts service consumer's access to service elements,
1813/// such as whether an application can call a visibility-restricted method.
1814/// The restriction is expressed by applying visibility labels on service
1815/// elements. The visibility labels are elsewhere linked to service consumers.
1816///
1817/// A service can define multiple visibility labels, but a service consumer
1818/// should be granted at most one visibility label. Multiple visibility
1819/// labels for a single service consumer are not supported.
1820///
1821/// If an element and all its parents have no visibility label, its visibility
1822/// is unconditionally granted.
1823///
1824/// Example:
1825///
1826/// visibility:
1827/// rules:
1828/// - selector: google.calendar.Calendar.EnhancedSearch
1829/// restriction: PREVIEW
1830/// - selector: google.calendar.Calendar.Delegate
1831/// restriction: INTERNAL
1832///
1833/// Here, all methods are publicly visible except for the restricted methods
1834/// EnhancedSearch and Delegate.
1835#[allow(clippy::derive_partial_eq_without_eq)]
1836#[derive(Clone, PartialEq, ::prost::Message)]
1837pub struct Visibility {
1838 /// A list of visibility rules that apply to individual API elements.
1839 ///
1840 /// **NOTE:** All service configuration rules follow "last one wins" order.
1841 #[prost(message, repeated, tag="1")]
1842 pub rules: ::prost::alloc::vec::Vec<VisibilityRule>,
1843}
1844/// A visibility rule provides visibility configuration for an individual API
1845/// element.
1846#[allow(clippy::derive_partial_eq_without_eq)]
1847#[derive(Clone, PartialEq, ::prost::Message)]
1848pub struct VisibilityRule {
1849 /// Selects methods, messages, fields, enums, etc. to which this rule applies.
1850 ///
1851 /// Refer to \[selector][google.api.DocumentationRule.selector\] for syntax
1852 /// details.
1853 #[prost(string, tag="1")]
1854 pub selector: ::prost::alloc::string::String,
1855 /// A comma-separated list of visibility labels that apply to the `selector`.
1856 /// Any of the listed labels can be used to grant the visibility.
1857 ///
1858 /// If a rule has multiple labels, removing one of the labels but not all of
1859 /// them can break clients.
1860 ///
1861 /// Example:
1862 ///
1863 /// visibility:
1864 /// rules:
1865 /// - selector: google.calendar.Calendar.EnhancedSearch
1866 /// restriction: INTERNAL, PREVIEW
1867 ///
1868 /// Removing INTERNAL from this restriction will break clients that rely on
1869 /// this method and only had access to it through INTERNAL.
1870 #[prost(string, tag="2")]
1871 pub restriction: ::prost::alloc::string::String,
1872}
1873// @@protoc_insertion_point(module)