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