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