googleapis_tonic_google_api/vec_u8_hash_map/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/// A simple descriptor of a resource type.
93///
94/// ResourceDescriptor annotates a resource message (either by means of a
95/// protobuf annotation or use in the service config), and associates the
96/// resource's schema, the resource type, and the pattern of the resource name.
97///
98/// Example:
99///
100/// ```text
101/// message Topic {
102/// // Indicates this message defines a resource schema.
103/// // Declares the resource type in the format of {service}/{kind}.
104/// // For Kubernetes resources, the format is {api group}/{kind}.
105/// option (google.api.resource) = {
106/// type: "pubsub.googleapis.com/Topic"
107/// pattern: "projects/{project}/topics/{topic}"
108/// };
109/// }
110/// ```
111///
112/// The ResourceDescriptor Yaml config will look like:
113///
114/// ```text
115/// resources:
116/// - type: "pubsub.googleapis.com/Topic"
117/// pattern: "projects/{project}/topics/{topic}"
118/// ```
119///
120/// Sometimes, resources have multiple patterns, typically because they can
121/// live under multiple parents.
122///
123/// Example:
124///
125/// ```text
126/// message LogEntry {
127/// option (google.api.resource) = {
128/// type: "logging.googleapis.com/LogEntry"
129/// pattern: "projects/{project}/logs/{log}"
130/// pattern: "folders/{folder}/logs/{log}"
131/// pattern: "organizations/{organization}/logs/{log}"
132/// pattern: "billingAccounts/{billing_account}/logs/{log}"
133/// };
134/// }
135/// ```
136///
137/// The ResourceDescriptor Yaml config will look like:
138///
139/// ```text
140/// resources:
141/// - type: 'logging.googleapis.com/LogEntry'
142/// pattern: "projects/{project}/logs/{log}"
143/// pattern: "folders/{folder}/logs/{log}"
144/// pattern: "organizations/{organization}/logs/{log}"
145/// pattern: "billingAccounts/{billing_account}/logs/{log}"
146/// ```
147#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
148pub struct ResourceDescriptor {
149 /// The resource type. It must be in the format of
150 /// {service_name}/{resource_type_kind}. The `resource_type_kind` must be
151 /// singular and must not include version numbers.
152 ///
153 /// Example: `storage.googleapis.com/Bucket`
154 ///
155 /// The value of the resource_type_kind must follow the regular expression
156 /// /\[A-Za-z\]\[a-zA-Z0-9\]+/. It should start with an upper case character and
157 /// should use PascalCase (UpperCamelCase). The maximum number of
158 /// characters allowed for the `resource_type_kind` is 100.
159 #[prost(string, tag = "1")]
160 pub r#type: ::prost::alloc::string::String,
161 /// Optional. The relative resource name pattern associated with this resource
162 /// type. The DNS prefix of the full resource name shouldn't be specified here.
163 ///
164 /// The path pattern must follow the syntax, which aligns with HTTP binding
165 /// syntax:
166 ///
167 /// ```text
168 /// Template = Segment { "/" Segment } ;
169 /// Segment = LITERAL | Variable ;
170 /// Variable = "{" LITERAL "}" ;
171 /// ```
172 ///
173 /// Examples:
174 ///
175 /// ```text
176 /// - "projects/{project}/topics/{topic}"
177 /// - "projects/{project}/knowledgeBases/{knowledge_base}"
178 /// ```
179 ///
180 /// The components in braces correspond to the IDs for each resource in the
181 /// hierarchy. It is expected that, if multiple patterns are provided,
182 /// the same component name (e.g. "project") refers to IDs of the same
183 /// type of resource.
184 #[prost(string, repeated, tag = "2")]
185 pub pattern: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
186 /// Optional. The field on the resource that designates the resource name
187 /// field. If omitted, this is assumed to be "name".
188 #[prost(string, tag = "3")]
189 pub name_field: ::prost::alloc::string::String,
190 /// Optional. The historical or future-looking state of the resource pattern.
191 ///
192 /// Example:
193 ///
194 /// ```text
195 /// // The InspectTemplate message originally only supported resource
196 /// // names with organization, and project was added later.
197 /// message InspectTemplate {
198 /// option (google.api.resource) = {
199 /// type: "dlp.googleapis.com/InspectTemplate"
200 /// pattern:
201 /// "organizations/{organization}/inspectTemplates/{inspect_template}"
202 /// pattern: "projects/{project}/inspectTemplates/{inspect_template}"
203 /// history: ORIGINALLY_SINGLE_PATTERN
204 /// };
205 /// }
206 /// ```
207 #[prost(enumeration = "resource_descriptor::History", tag = "4")]
208 pub history: i32,
209 /// The plural name used in the resource name and permission names, such as
210 /// 'projects' for the resource name of 'projects/{project}' and the permission
211 /// name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
212 /// to this is for Nested Collections that have stuttering names, as defined
213 /// in [AIP-122](<https://google.aip.dev/122#nested-collections>), where the
214 /// collection ID in the resource name pattern does not necessarily directly
215 /// match the `plural` value.
216 ///
217 /// It is the same concept of the `plural` field in k8s CRD spec
218 /// <https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/>
219 ///
220 /// Note: The plural form is required even for singleton resources. See
221 /// <https://aip.dev/156>
222 #[prost(string, tag = "5")]
223 pub plural: ::prost::alloc::string::String,
224 /// The same concept of the `singular` field in k8s CRD spec
225 /// <https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/>
226 /// Such as "project" for the `resourcemanager.googleapis.com/Project` type.
227 #[prost(string, tag = "6")]
228 pub singular: ::prost::alloc::string::String,
229 /// Style flag(s) for this resource.
230 /// These indicate that a resource is expected to conform to a given
231 /// style. See the specific style flags for additional information.
232 #[prost(enumeration = "resource_descriptor::Style", repeated, tag = "10")]
233 pub style: ::prost::alloc::vec::Vec<i32>,
234}
235/// Nested message and enum types in `ResourceDescriptor`.
236pub mod resource_descriptor {
237 /// A description of the historical or future-looking state of the
238 /// resource pattern.
239 #[derive(
240 Clone,
241 Copy,
242 Debug,
243 PartialEq,
244 Eq,
245 Hash,
246 PartialOrd,
247 Ord,
248 ::prost::Enumeration
249 )]
250 #[repr(i32)]
251 pub enum History {
252 /// The "unset" value.
253 Unspecified = 0,
254 /// The resource originally had one pattern and launched as such, and
255 /// additional patterns were added later.
256 OriginallySinglePattern = 1,
257 /// The resource has one pattern, but the API owner expects to add more
258 /// later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents
259 /// that from being necessary once there are multiple patterns.)
260 FutureMultiPattern = 2,
261 }
262 impl History {
263 /// String value of the enum field names used in the ProtoBuf definition.
264 ///
265 /// The values are not transformed in any way and thus are considered stable
266 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
267 pub fn as_str_name(&self) -> &'static str {
268 match self {
269 Self::Unspecified => "HISTORY_UNSPECIFIED",
270 Self::OriginallySinglePattern => "ORIGINALLY_SINGLE_PATTERN",
271 Self::FutureMultiPattern => "FUTURE_MULTI_PATTERN",
272 }
273 }
274 /// Creates an enum from field names used in the ProtoBuf definition.
275 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
276 match value {
277 "HISTORY_UNSPECIFIED" => Some(Self::Unspecified),
278 "ORIGINALLY_SINGLE_PATTERN" => Some(Self::OriginallySinglePattern),
279 "FUTURE_MULTI_PATTERN" => Some(Self::FutureMultiPattern),
280 _ => None,
281 }
282 }
283 }
284 /// A flag representing a specific style that a resource claims to conform to.
285 #[derive(
286 Clone,
287 Copy,
288 Debug,
289 PartialEq,
290 Eq,
291 Hash,
292 PartialOrd,
293 Ord,
294 ::prost::Enumeration
295 )]
296 #[repr(i32)]
297 pub enum Style {
298 /// The unspecified value. Do not use.
299 Unspecified = 0,
300 /// This resource is intended to be "declarative-friendly".
301 ///
302 /// Declarative-friendly resources must be more strictly consistent, and
303 /// setting this to true communicates to tools that this resource should
304 /// adhere to declarative-friendly expectations.
305 ///
306 /// Note: This is used by the API linter (linter.aip.dev) to enable
307 /// additional checks.
308 DeclarativeFriendly = 1,
309 }
310 impl Style {
311 /// String value of the enum field names used in the ProtoBuf definition.
312 ///
313 /// The values are not transformed in any way and thus are considered stable
314 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
315 pub fn as_str_name(&self) -> &'static str {
316 match self {
317 Self::Unspecified => "STYLE_UNSPECIFIED",
318 Self::DeclarativeFriendly => "DECLARATIVE_FRIENDLY",
319 }
320 }
321 /// Creates an enum from field names used in the ProtoBuf definition.
322 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
323 match value {
324 "STYLE_UNSPECIFIED" => Some(Self::Unspecified),
325 "DECLARATIVE_FRIENDLY" => Some(Self::DeclarativeFriendly),
326 _ => None,
327 }
328 }
329 }
330}
331/// Defines a proto annotation that describes a string field that refers to
332/// an API resource.
333#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
334pub struct ResourceReference {
335 /// The resource type that the annotated field references.
336 ///
337 /// Example:
338 ///
339 /// ```text
340 /// message Subscription {
341 /// string topic = 2 [(google.api.resource_reference) = {
342 /// type: "pubsub.googleapis.com/Topic"
343 /// }];
344 /// }
345 /// ```
346 ///
347 /// Occasionally, a field may reference an arbitrary resource. In this case,
348 /// APIs use the special value * in their resource reference.
349 ///
350 /// Example:
351 ///
352 /// ```text
353 /// message GetIamPolicyRequest {
354 /// string resource = 2 [(google.api.resource_reference) = {
355 /// type: "*"
356 /// }];
357 /// }
358 /// ```
359 #[prost(string, tag = "1")]
360 pub r#type: ::prost::alloc::string::String,
361 /// The resource type of a child collection that the annotated field
362 /// references. This is useful for annotating the `parent` field that
363 /// doesn't have a fixed resource type.
364 ///
365 /// Example:
366 ///
367 /// ```text
368 /// message ListLogEntriesRequest {
369 /// string parent = 1 [(google.api.resource_reference) = {
370 /// child_type: "logging.googleapis.com/LogEntry"
371 /// };
372 /// }
373 /// ```
374 #[prost(string, tag = "2")]
375 pub child_type: ::prost::alloc::string::String,
376}
377/// Defines the HTTP configuration for an API service. It contains a list of
378/// \[HttpRule\]\[google.api.HttpRule\], each specifying the mapping of an RPC method
379/// to one or more HTTP REST API methods.
380#[derive(Clone, PartialEq, ::prost::Message)]
381pub struct Http {
382 /// A list of HTTP configuration rules that apply to individual API methods.
383 ///
384 /// **NOTE:** All service configuration rules follow "last one wins" order.
385 #[prost(message, repeated, tag = "1")]
386 pub rules: ::prost::alloc::vec::Vec<HttpRule>,
387 /// When set to true, URL path parameters will be fully URI-decoded except in
388 /// cases of single segment matches in reserved expansion, where "%2F" will be
389 /// left encoded.
390 ///
391 /// The default behavior is to not decode RFC 6570 reserved characters in multi
392 /// segment matches.
393 #[prost(bool, tag = "2")]
394 pub fully_decode_reserved_expansion: bool,
395}
396/// gRPC Transcoding
397///
398/// gRPC Transcoding is a feature for mapping between a gRPC method and one or
399/// more HTTP REST endpoints. It allows developers to build a single API service
400/// that supports both gRPC APIs and REST APIs. Many systems, including [Google
401/// APIs](<https://github.com/googleapis/googleapis>),
402/// [Cloud Endpoints](<https://cloud.google.com/endpoints>), [gRPC
403/// Gateway](<https://github.com/grpc-ecosystem/grpc-gateway>),
404/// and [Envoy](<https://github.com/envoyproxy/envoy>) proxy support this feature
405/// and use it for large scale production services.
406///
407/// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
408/// how different portions of the gRPC request message are mapped to the URL
409/// path, URL query parameters, and HTTP request body. It also controls how the
410/// gRPC response message is mapped to the HTTP response body. `HttpRule` is
411/// typically specified as an `google.api.http` annotation on the gRPC method.
412///
413/// Each mapping specifies a URL path template and an HTTP method. The path
414/// template may refer to one or more fields in the gRPC request message, as long
415/// as each field is a non-repeated field with a primitive (non-message) type.
416/// The path template controls how fields of the request message are mapped to
417/// the URL path.
418///
419/// Example:
420///
421/// ```text
422/// service Messaging {
423/// rpc GetMessage(GetMessageRequest) returns (Message) {
424/// option (google.api.http) = {
425/// get: "/v1/{name=messages/*}"
426/// };
427/// }
428/// }
429/// message GetMessageRequest {
430/// string name = 1; // Mapped to URL path.
431/// }
432/// message Message {
433/// string text = 1; // The resource content.
434/// }
435/// ```
436///
437/// This enables an HTTP REST to gRPC mapping as below:
438///
439/// * HTTP: `GET /v1/messages/123456`
440/// * gRPC: `GetMessage(name: "messages/123456")`
441///
442/// Any fields in the request message which are not bound by the path template
443/// automatically become HTTP query parameters if there is no HTTP request body.
444/// For example:
445///
446/// ```text
447/// service Messaging {
448/// rpc GetMessage(GetMessageRequest) returns (Message) {
449/// option (google.api.http) = {
450/// get:"/v1/messages/{message_id}"
451/// };
452/// }
453/// }
454/// message GetMessageRequest {
455/// message SubMessage {
456/// string subfield = 1;
457/// }
458/// string message_id = 1; // Mapped to URL path.
459/// int64 revision = 2; // Mapped to URL query parameter `revision`.
460/// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
461/// }
462/// ```
463///
464/// This enables a HTTP JSON to RPC mapping as below:
465///
466/// * HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
467/// * gRPC: `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))`
468///
469/// Note that fields which are mapped to URL query parameters must have a
470/// primitive type or a repeated primitive type or a non-repeated message type.
471/// In the case of a repeated type, the parameter can be repeated in the URL
472/// as `...?param=A¶m=B`. In the case of a message type, each field of the
473/// message is mapped to a separate parameter, such as
474/// `...?foo.a=A&foo.b=B&foo.c=C`.
475///
476/// For HTTP methods that allow a request body, the `body` field
477/// specifies the mapping. Consider a REST update method on the
478/// message resource collection:
479///
480/// ```text
481/// service Messaging {
482/// rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
483/// option (google.api.http) = {
484/// patch: "/v1/messages/{message_id}"
485/// body: "message"
486/// };
487/// }
488/// }
489/// message UpdateMessageRequest {
490/// string message_id = 1; // mapped to the URL
491/// Message message = 2; // mapped to the body
492/// }
493/// ```
494///
495/// The following HTTP JSON to RPC mapping is enabled, where the
496/// representation of the JSON in the request body is determined by
497/// protos JSON encoding:
498///
499/// * HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
500/// * gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
501///
502/// The special name `*` can be used in the body mapping to define that
503/// every field not bound by the path template should be mapped to the
504/// request body. This enables the following alternative definition of
505/// the update method:
506///
507/// ```text
508/// service Messaging {
509/// rpc UpdateMessage(Message) returns (Message) {
510/// option (google.api.http) = {
511/// patch: "/v1/messages/{message_id}"
512/// body: "*"
513/// };
514/// }
515/// }
516/// message Message {
517/// string message_id = 1;
518/// string text = 2;
519/// }
520/// ```
521///
522/// The following HTTP JSON to RPC mapping is enabled:
523///
524/// * HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
525/// * gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
526///
527/// Note that when using `*` in the body mapping, it is not possible to
528/// have HTTP parameters, as all fields not bound by the path end in
529/// the body. This makes this option more rarely used in practice when
530/// defining REST APIs. The common usage of `*` is in custom methods
531/// which don't use the URL at all for transferring data.
532///
533/// It is possible to define multiple HTTP methods for one RPC by using
534/// the `additional_bindings` option. Example:
535///
536/// ```text
537/// service Messaging {
538/// rpc GetMessage(GetMessageRequest) returns (Message) {
539/// option (google.api.http) = {
540/// get: "/v1/messages/{message_id}"
541/// additional_bindings {
542/// get: "/v1/users/{user_id}/messages/{message_id}"
543/// }
544/// };
545/// }
546/// }
547/// message GetMessageRequest {
548/// string message_id = 1;
549/// string user_id = 2;
550/// }
551/// ```
552///
553/// This enables the following two alternative HTTP JSON to RPC mappings:
554///
555/// * HTTP: `GET /v1/messages/123456`
556///
557/// * gRPC: `GetMessage(message_id: "123456")`
558///
559/// * HTTP: `GET /v1/users/me/messages/123456`
560///
561/// * gRPC: `GetMessage(user_id: "me" message_id: "123456")`
562///
563/// Rules for HTTP mapping
564///
565/// 1. Leaf request fields (recursive expansion nested messages in the request
566/// message) are classified into three categories:
567/// * Fields referred by the path template. They are passed via the URL path.
568/// * Fields referred by the \[HttpRule.body\]\[google.api.HttpRule.body\]. They
569/// are passed via the HTTP
570/// request body.
571/// * All other fields are passed via the URL query parameters, and the
572/// parameter name is the field path in the request message. A repeated
573/// field can be represented as multiple query parameters under the same
574/// name.
575/// 1. If \[HttpRule.body\]\[google.api.HttpRule.body\] is "\*", there is no URL
576/// query parameter, all fields
577/// are passed via URL path and HTTP request body.
578/// 1. If \[HttpRule.body\]\[google.api.HttpRule.body\] is omitted, there is no HTTP
579/// request body, all
580/// fields are passed via URL path and URL query parameters.
581///
582/// Path template syntax
583///
584/// ```text
585/// Template = "/" Segments \[ Verb \] ;
586/// Segments = Segment { "/" Segment } ;
587/// Segment = "*" | "**" | LITERAL | Variable ;
588/// Variable = "{" FieldPath \[ "=" Segments \] "}" ;
589/// FieldPath = IDENT { "." IDENT } ;
590/// Verb = ":" LITERAL ;
591/// ```
592///
593/// The syntax `*` matches a single URL path segment. The syntax `**` matches
594/// zero or more URL path segments, which must be the last part of the URL path
595/// except the `Verb`.
596///
597/// The syntax `Variable` matches part of the URL path as specified by its
598/// template. A variable template must not contain other variables. If a variable
599/// matches a single path segment, its template may be omitted, e.g. `{var}`
600/// is equivalent to `{var=*}`.
601///
602/// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
603/// contains any reserved character, such characters should be percent-encoded
604/// before the matching.
605///
606/// If a variable contains exactly one path segment, such as `"{var}"` or
607/// `"{var=*}"`, when such a variable is expanded into a URL path on the client
608/// side, all characters except `\[-_.~0-9a-zA-Z\]` are percent-encoded. The
609/// server side does the reverse decoding. Such variables show up in the
610/// [Discovery
611/// Document](<https://developers.google.com/discovery/v1/reference/apis>) as
612/// `{var}`.
613///
614/// If a variable contains multiple path segments, such as `"{var=foo/*}"`
615/// or `"{var=**}"`, when such a variable is expanded into a URL path on the
616/// client side, all characters except `\[-_.~/0-9a-zA-Z\]` are percent-encoded.
617/// The server side does the reverse decoding, except "%2F" and "%2f" are left
618/// unchanged. Such variables show up in the
619/// [Discovery
620/// Document](<https://developers.google.com/discovery/v1/reference/apis>) as
621/// `{+var}`.
622///
623/// Using gRPC API Service Configuration
624///
625/// gRPC API Service Configuration (service config) is a configuration language
626/// for configuring a gRPC service to become a user-facing product. The
627/// service config is simply the YAML representation of the `google.api.Service`
628/// proto message.
629///
630/// As an alternative to annotating your proto file, you can configure gRPC
631/// transcoding in your service config YAML files. You do this by specifying a
632/// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
633/// effect as the proto annotation. This can be particularly useful if you
634/// have a proto that is reused in multiple services. Note that any transcoding
635/// specified in the service config will override any matching transcoding
636/// configuration in the proto.
637///
638/// The following example selects a gRPC method and applies an `HttpRule` to it:
639///
640/// ```text
641/// http:
642/// rules:
643/// - selector: example.v1.Messaging.GetMessage
644/// get: /v1/messages/{message_id}/{sub.subfield}
645/// ```
646///
647/// Special notes
648///
649/// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
650/// proto to JSON conversion must follow the [proto3
651/// specification](<https://developers.google.com/protocol-buffers/docs/proto3#json>).
652///
653/// While the single segment variable follows the semantics of
654/// [RFC 6570](<https://tools.ietf.org/html/rfc6570>) Section 3.2.2 Simple String
655/// Expansion, the multi segment variable **does not** follow RFC 6570 Section
656/// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
657/// does not expand special characters like `?` and `#`, which would lead
658/// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
659/// for multi segment variables.
660///
661/// The path variables **must not** refer to any repeated or mapped field,
662/// because client libraries are not capable of handling such variable expansion.
663///
664/// The path variables **must not** capture the leading "/" character. The reason
665/// is that the most common use case "{var}" does not capture the leading "/"
666/// character. For consistency, all path variables must share the same behavior.
667///
668/// Repeated message fields must not be mapped to URL query parameters, because
669/// no client library can support such complicated mapping.
670///
671/// If an API needs to use a JSON array for request or response body, it can map
672/// the request or response body to a repeated field. However, some gRPC
673/// Transcoding implementations may not support this feature.
674#[derive(Clone, PartialEq, ::prost::Message)]
675pub struct HttpRule {
676 /// Selects a method to which this rule applies.
677 ///
678 /// Refer to \[selector\]\[google.api.DocumentationRule.selector\] for syntax
679 /// details.
680 #[prost(string, tag = "1")]
681 pub selector: ::prost::alloc::string::String,
682 /// The name of the request field whose value is mapped to the HTTP request
683 /// body, or `*` for mapping all request fields not captured by the path
684 /// pattern to the HTTP body, or omitted for not having any HTTP request body.
685 ///
686 /// NOTE: the referred field must be present at the top-level of the request
687 /// message type.
688 #[prost(string, tag = "7")]
689 pub body: ::prost::alloc::string::String,
690 /// Optional. The name of the response field whose value is mapped to the HTTP
691 /// response body. When omitted, the entire response message will be used
692 /// as the HTTP response body.
693 ///
694 /// NOTE: The referred field must be present at the top-level of the response
695 /// message type.
696 #[prost(string, tag = "12")]
697 pub response_body: ::prost::alloc::string::String,
698 /// Additional HTTP bindings for the selector. Nested bindings must
699 /// not contain an `additional_bindings` field themselves (that is,
700 /// the nesting may only be one level deep).
701 #[prost(message, repeated, tag = "11")]
702 pub additional_bindings: ::prost::alloc::vec::Vec<HttpRule>,
703 /// Determines the URL pattern is matched by this rules. This pattern can be
704 /// used with any of the {get|put|post|delete|patch} methods. A custom method
705 /// can be defined using the 'custom' field.
706 #[prost(oneof = "http_rule::Pattern", tags = "2, 3, 4, 5, 6, 8")]
707 pub pattern: ::core::option::Option<http_rule::Pattern>,
708}
709/// Nested message and enum types in `HttpRule`.
710pub mod http_rule {
711 /// Determines the URL pattern is matched by this rules. This pattern can be
712 /// used with any of the {get|put|post|delete|patch} methods. A custom method
713 /// can be defined using the 'custom' field.
714 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
715 pub enum Pattern {
716 /// Maps to HTTP GET. Used for listing and getting information about
717 /// resources.
718 #[prost(string, tag = "2")]
719 Get(::prost::alloc::string::String),
720 /// Maps to HTTP PUT. Used for replacing a resource.
721 #[prost(string, tag = "3")]
722 Put(::prost::alloc::string::String),
723 /// Maps to HTTP POST. Used for creating a resource or performing an action.
724 #[prost(string, tag = "4")]
725 Post(::prost::alloc::string::String),
726 /// Maps to HTTP DELETE. Used for deleting a resource.
727 #[prost(string, tag = "5")]
728 Delete(::prost::alloc::string::String),
729 /// Maps to HTTP PATCH. Used for updating a resource.
730 #[prost(string, tag = "6")]
731 Patch(::prost::alloc::string::String),
732 /// The custom pattern is used for specifying an HTTP method that is not
733 /// included in the `pattern` field, such as HEAD, or "\*" to leave the
734 /// HTTP method unspecified for this rule. The wild-card rule is useful
735 /// for services that provide content to Web (HTML) clients.
736 #[prost(message, tag = "8")]
737 Custom(super::CustomHttpPattern),
738 }
739}
740/// A custom pattern is used for defining custom HTTP verb.
741#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
742pub struct CustomHttpPattern {
743 /// The name of this custom HTTP verb.
744 #[prost(string, tag = "1")]
745 pub kind: ::prost::alloc::string::String,
746 /// The path matched by this custom verb.
747 #[prost(string, tag = "2")]
748 pub path: ::prost::alloc::string::String,
749}
750/// The launch stage as defined by [Google Cloud Platform
751/// Launch Stages](<https://cloud.google.com/terms/launch-stages>).
752#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
753#[repr(i32)]
754pub enum LaunchStage {
755 /// Do not use this default value.
756 Unspecified = 0,
757 /// The feature is not yet implemented. Users can not use it.
758 Unimplemented = 6,
759 /// Prelaunch features are hidden from users and are only visible internally.
760 Prelaunch = 7,
761 /// Early Access features are limited to a closed group of testers. To use
762 /// these features, you must sign up in advance and sign a Trusted Tester
763 /// agreement (which includes confidentiality provisions). These features may
764 /// be unstable, changed in backward-incompatible ways, and are not
765 /// guaranteed to be released.
766 EarlyAccess = 1,
767 /// Alpha is a limited availability test for releases before they are cleared
768 /// for widespread use. By Alpha, all significant design issues are resolved
769 /// and we are in the process of verifying functionality. Alpha customers
770 /// need to apply for access, agree to applicable terms, and have their
771 /// projects allowlisted. Alpha releases don't have to be feature complete,
772 /// no SLAs are provided, and there are no technical support obligations, but
773 /// they will be far enough along that customers can actually use them in
774 /// test environments or for limited-use tests -- just like they would in
775 /// normal production cases.
776 Alpha = 2,
777 /// Beta is the point at which we are ready to open a release for any
778 /// customer to use. There are no SLA or technical support obligations in a
779 /// Beta release. Products will be complete from a feature perspective, but
780 /// may have some open outstanding issues. Beta releases are suitable for
781 /// limited production use cases.
782 Beta = 3,
783 /// GA features are open to all developers and are considered stable and
784 /// fully qualified for production use.
785 Ga = 4,
786 /// Deprecated features are scheduled to be shut down and removed. For more
787 /// information, see the "Deprecation Policy" section of our [Terms of
788 /// Service](<https://cloud.google.com/terms/>)
789 /// and the [Google Cloud Platform Subject to the Deprecation
790 /// Policy](<https://cloud.google.com/terms/deprecation>) documentation.
791 Deprecated = 5,
792}
793impl LaunchStage {
794 /// String value of the enum field names used in the ProtoBuf definition.
795 ///
796 /// The values are not transformed in any way and thus are considered stable
797 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
798 pub fn as_str_name(&self) -> &'static str {
799 match self {
800 Self::Unspecified => "LAUNCH_STAGE_UNSPECIFIED",
801 Self::Unimplemented => "UNIMPLEMENTED",
802 Self::Prelaunch => "PRELAUNCH",
803 Self::EarlyAccess => "EARLY_ACCESS",
804 Self::Alpha => "ALPHA",
805 Self::Beta => "BETA",
806 Self::Ga => "GA",
807 Self::Deprecated => "DEPRECATED",
808 }
809 }
810 /// Creates an enum from field names used in the ProtoBuf definition.
811 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
812 match value {
813 "LAUNCH_STAGE_UNSPECIFIED" => Some(Self::Unspecified),
814 "UNIMPLEMENTED" => Some(Self::Unimplemented),
815 "PRELAUNCH" => Some(Self::Prelaunch),
816 "EARLY_ACCESS" => Some(Self::EarlyAccess),
817 "ALPHA" => Some(Self::Alpha),
818 "BETA" => Some(Self::Beta),
819 "GA" => Some(Self::Ga),
820 "DEPRECATED" => Some(Self::Deprecated),
821 _ => None,
822 }
823 }
824}
825/// Required information for every language.
826#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
827pub struct CommonLanguageSettings {
828 /// Link to automatically generated reference documentation. Example:
829 /// <https://cloud.google.com/nodejs/docs/reference/asset/latest>
830 #[deprecated]
831 #[prost(string, tag = "1")]
832 pub reference_docs_uri: ::prost::alloc::string::String,
833 /// The destination where API teams want this client library to be published.
834 #[prost(enumeration = "ClientLibraryDestination", repeated, tag = "2")]
835 pub destinations: ::prost::alloc::vec::Vec<i32>,
836 /// Configuration for which RPCs should be generated in the GAPIC client.
837 #[prost(message, optional, tag = "3")]
838 pub selective_gapic_generation: ::core::option::Option<SelectiveGapicGeneration>,
839}
840/// Details about how and where to publish client libraries.
841#[derive(Clone, PartialEq, ::prost::Message)]
842pub struct ClientLibrarySettings {
843 /// Version of the API to apply these settings to. This is the full protobuf
844 /// package for the API, ending in the version element.
845 /// Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
846 #[prost(string, tag = "1")]
847 pub version: ::prost::alloc::string::String,
848 /// Launch stage of this version of the API.
849 #[prost(enumeration = "LaunchStage", tag = "2")]
850 pub launch_stage: i32,
851 /// When using transport=rest, the client request will encode enums as
852 /// numbers rather than strings.
853 #[prost(bool, tag = "3")]
854 pub rest_numeric_enums: bool,
855 /// Settings for legacy Java features, supported in the Service YAML.
856 #[prost(message, optional, tag = "21")]
857 pub java_settings: ::core::option::Option<JavaSettings>,
858 /// Settings for C++ client libraries.
859 #[prost(message, optional, tag = "22")]
860 pub cpp_settings: ::core::option::Option<CppSettings>,
861 /// Settings for PHP client libraries.
862 #[prost(message, optional, tag = "23")]
863 pub php_settings: ::core::option::Option<PhpSettings>,
864 /// Settings for Python client libraries.
865 #[prost(message, optional, tag = "24")]
866 pub python_settings: ::core::option::Option<PythonSettings>,
867 /// Settings for Node client libraries.
868 #[prost(message, optional, tag = "25")]
869 pub node_settings: ::core::option::Option<NodeSettings>,
870 /// Settings for .NET client libraries.
871 #[prost(message, optional, tag = "26")]
872 pub dotnet_settings: ::core::option::Option<DotnetSettings>,
873 /// Settings for Ruby client libraries.
874 #[prost(message, optional, tag = "27")]
875 pub ruby_settings: ::core::option::Option<RubySettings>,
876 /// Settings for Go client libraries.
877 #[prost(message, optional, tag = "28")]
878 pub go_settings: ::core::option::Option<GoSettings>,
879}
880/// This message configures the settings for publishing [Google Cloud Client
881/// libraries](<https://cloud.google.com/apis/docs/cloud-client-libraries>)
882/// generated from the service config.
883#[derive(Clone, PartialEq, ::prost::Message)]
884pub struct Publishing {
885 /// A list of API method settings, e.g. the behavior for methods that use the
886 /// long-running operation pattern.
887 #[prost(message, repeated, tag = "2")]
888 pub method_settings: ::prost::alloc::vec::Vec<MethodSettings>,
889 /// Link to a *public* URI where users can report issues. Example:
890 /// <https://issuetracker.google.com/issues/new?component=190865&template=1161103>
891 #[prost(string, tag = "101")]
892 pub new_issue_uri: ::prost::alloc::string::String,
893 /// Link to product home page. Example:
894 /// <https://cloud.google.com/asset-inventory/docs/overview>
895 #[prost(string, tag = "102")]
896 pub documentation_uri: ::prost::alloc::string::String,
897 /// Used as a tracking tag when collecting data about the APIs developer
898 /// relations artifacts like docs, packages delivered to package managers,
899 /// etc. Example: "speech".
900 #[prost(string, tag = "103")]
901 pub api_short_name: ::prost::alloc::string::String,
902 /// GitHub label to apply to issues and pull requests opened for this API.
903 #[prost(string, tag = "104")]
904 pub github_label: ::prost::alloc::string::String,
905 /// GitHub teams to be added to CODEOWNERS in the directory in GitHub
906 /// containing source code for the client libraries for this API.
907 #[prost(string, repeated, tag = "105")]
908 pub codeowner_github_teams: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
909 /// A prefix used in sample code when demarking regions to be included in
910 /// documentation.
911 #[prost(string, tag = "106")]
912 pub doc_tag_prefix: ::prost::alloc::string::String,
913 /// For whom the client library is being published.
914 #[prost(enumeration = "ClientLibraryOrganization", tag = "107")]
915 pub organization: i32,
916 /// Client library settings. If the same version string appears multiple
917 /// times in this list, then the last one wins. Settings from earlier
918 /// settings with the same version string are discarded.
919 #[prost(message, repeated, tag = "109")]
920 pub library_settings: ::prost::alloc::vec::Vec<ClientLibrarySettings>,
921 /// Optional link to proto reference documentation. Example:
922 /// <https://cloud.google.com/pubsub/lite/docs/reference/rpc>
923 #[prost(string, tag = "110")]
924 pub proto_reference_documentation_uri: ::prost::alloc::string::String,
925 /// Optional link to REST reference documentation. Example:
926 /// <https://cloud.google.com/pubsub/lite/docs/reference/rest>
927 #[prost(string, tag = "111")]
928 pub rest_reference_documentation_uri: ::prost::alloc::string::String,
929}
930/// Settings for Java client libraries.
931#[derive(Clone, PartialEq, ::prost::Message)]
932pub struct JavaSettings {
933 /// The package name to use in Java. Clobbers the java_package option
934 /// set in the protobuf. This should be used **only** by APIs
935 /// who have already set the language_settings.java.package_name" field
936 /// in gapic.yaml. API teams should use the protobuf java_package option
937 /// where possible.
938 ///
939 /// Example of a YAML configuration::
940 ///
941 /// ```text
942 /// publishing:
943 /// library_settings:
944 /// java_settings:
945 /// library_package: com.google.cloud.pubsub.v1
946 /// ```
947 #[prost(string, tag = "1")]
948 pub library_package: ::prost::alloc::string::String,
949 /// Configure the Java class name to use instead of the service's for its
950 /// corresponding generated GAPIC client. Keys are fully-qualified
951 /// service names as they appear in the protobuf (including the full
952 /// the language_settings.java.interface_names" field in gapic.yaml. API
953 /// teams should otherwise use the service name as it appears in the
954 /// protobuf.
955 ///
956 /// Example of a YAML configuration::
957 ///
958 /// ```text
959 /// publishing:
960 /// java_settings:
961 /// service_class_names:
962 /// - google.pubsub.v1.Publisher: TopicAdmin
963 /// - google.pubsub.v1.Subscriber: SubscriptionAdmin
964 /// ```
965 #[prost(map = "string, string", tag = "2")]
966 pub service_class_names: ::std::collections::HashMap<
967 ::prost::alloc::string::String,
968 ::prost::alloc::string::String,
969 >,
970 /// Some settings.
971 #[prost(message, optional, tag = "3")]
972 pub common: ::core::option::Option<CommonLanguageSettings>,
973}
974/// Settings for C++ client libraries.
975#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
976pub struct CppSettings {
977 /// Some settings.
978 #[prost(message, optional, tag = "1")]
979 pub common: ::core::option::Option<CommonLanguageSettings>,
980}
981/// Settings for Php client libraries.
982#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
983pub struct PhpSettings {
984 /// Some settings.
985 #[prost(message, optional, tag = "1")]
986 pub common: ::core::option::Option<CommonLanguageSettings>,
987 /// The package name to use in Php. Clobbers the php_namespace option
988 /// set in the protobuf. This should be used **only** by APIs
989 /// who have already set the language_settings.php.package_name" field
990 /// in gapic.yaml. API teams should use the protobuf php_namespace option
991 /// where possible.
992 ///
993 /// Example of a YAML configuration::
994 ///
995 /// ```text
996 /// publishing:
997 /// library_settings:
998 /// php_settings:
999 /// library_package: Google\Cloud\PubSub\V1
1000 /// ```
1001 #[prost(string, tag = "2")]
1002 pub library_package: ::prost::alloc::string::String,
1003}
1004/// Settings for Python client libraries.
1005#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1006pub struct PythonSettings {
1007 /// Some settings.
1008 #[prost(message, optional, tag = "1")]
1009 pub common: ::core::option::Option<CommonLanguageSettings>,
1010 /// Experimental features to be included during client library generation.
1011 #[prost(message, optional, tag = "2")]
1012 pub experimental_features: ::core::option::Option<
1013 python_settings::ExperimentalFeatures,
1014 >,
1015}
1016/// Nested message and enum types in `PythonSettings`.
1017pub mod python_settings {
1018 /// Experimental features to be included during client library generation.
1019 /// These fields will be deprecated once the feature graduates and is enabled
1020 /// by default.
1021 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1022 pub struct ExperimentalFeatures {
1023 /// Enables generation of asynchronous REST clients if `rest` transport is
1024 /// enabled. By default, asynchronous REST clients will not be generated.
1025 /// This feature will be enabled by default 1 month after launching the
1026 /// feature in preview packages.
1027 #[prost(bool, tag = "1")]
1028 pub rest_async_io_enabled: bool,
1029 /// Enables generation of protobuf code using new types that are more
1030 /// Pythonic which are included in `protobuf>=5.29.x`. This feature will be
1031 /// enabled by default 1 month after launching the feature in preview
1032 /// packages.
1033 #[prost(bool, tag = "2")]
1034 pub protobuf_pythonic_types_enabled: bool,
1035 /// Disables generation of an unversioned Python package for this client
1036 /// library. This means that the module names will need to be versioned in
1037 /// import statements. For example `import google.cloud.library_v2` instead
1038 /// of `import google.cloud.library`.
1039 #[prost(bool, tag = "3")]
1040 pub unversioned_package_disabled: bool,
1041 }
1042}
1043/// Settings for Node client libraries.
1044#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1045pub struct NodeSettings {
1046 /// Some settings.
1047 #[prost(message, optional, tag = "1")]
1048 pub common: ::core::option::Option<CommonLanguageSettings>,
1049}
1050/// Settings for Dotnet client libraries.
1051#[derive(Clone, PartialEq, ::prost::Message)]
1052pub struct DotnetSettings {
1053 /// Some settings.
1054 #[prost(message, optional, tag = "1")]
1055 pub common: ::core::option::Option<CommonLanguageSettings>,
1056 /// Map from original service names to renamed versions.
1057 /// This is used when the default generated types
1058 /// would cause a naming conflict. (Neither name is
1059 /// fully-qualified.)
1060 /// Example: Subscriber to SubscriberServiceApi.
1061 #[prost(map = "string, string", tag = "2")]
1062 pub renamed_services: ::std::collections::HashMap<
1063 ::prost::alloc::string::String,
1064 ::prost::alloc::string::String,
1065 >,
1066 /// Map from full resource types to the effective short name
1067 /// for the resource. This is used when otherwise resource
1068 /// named from different services would cause naming collisions.
1069 /// Example entry:
1070 /// "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
1071 #[prost(map = "string, string", tag = "3")]
1072 pub renamed_resources: ::std::collections::HashMap<
1073 ::prost::alloc::string::String,
1074 ::prost::alloc::string::String,
1075 >,
1076 /// List of full resource types to ignore during generation.
1077 /// This is typically used for API-specific Location resources,
1078 /// which should be handled by the generator as if they were actually
1079 /// the common Location resources.
1080 /// Example entry: "documentai.googleapis.com/Location"
1081 #[prost(string, repeated, tag = "4")]
1082 pub ignored_resources: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1083 /// Namespaces which must be aliased in snippets due to
1084 /// a known (but non-generator-predictable) naming collision
1085 #[prost(string, repeated, tag = "5")]
1086 pub forced_namespace_aliases: ::prost::alloc::vec::Vec<
1087 ::prost::alloc::string::String,
1088 >,
1089 /// Method signatures (in the form "service.method(signature)")
1090 /// which are provided separately, so shouldn't be generated.
1091 /// Snippets *calling* these methods are still generated, however.
1092 #[prost(string, repeated, tag = "6")]
1093 pub handwritten_signatures: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1094}
1095/// Settings for Ruby client libraries.
1096#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1097pub struct RubySettings {
1098 /// Some settings.
1099 #[prost(message, optional, tag = "1")]
1100 pub common: ::core::option::Option<CommonLanguageSettings>,
1101}
1102/// Settings for Go client libraries.
1103#[derive(Clone, PartialEq, ::prost::Message)]
1104pub struct GoSettings {
1105 /// Some settings.
1106 #[prost(message, optional, tag = "1")]
1107 pub common: ::core::option::Option<CommonLanguageSettings>,
1108 /// Map of service names to renamed services. Keys are the package relative
1109 /// service names and values are the name to be used for the service client
1110 /// and call options.
1111 ///
1112 /// Example:
1113 ///
1114 /// ```text
1115 /// publishing:
1116 /// go_settings:
1117 /// renamed_services:
1118 /// Publisher: TopicAdmin
1119 /// ```
1120 #[prost(map = "string, string", tag = "2")]
1121 pub renamed_services: ::std::collections::HashMap<
1122 ::prost::alloc::string::String,
1123 ::prost::alloc::string::String,
1124 >,
1125}
1126/// Describes the generator configuration for a method.
1127#[derive(Clone, PartialEq, ::prost::Message)]
1128pub struct MethodSettings {
1129 /// The fully qualified name of the method, for which the options below apply.
1130 /// This is used to find the method to apply the options.
1131 ///
1132 /// Example:
1133 ///
1134 /// ```text
1135 /// publishing:
1136 /// method_settings:
1137 /// - selector: google.storage.control.v2.StorageControl.CreateFolder
1138 /// # method settings for CreateFolder...
1139 /// ```
1140 #[prost(string, tag = "1")]
1141 pub selector: ::prost::alloc::string::String,
1142 /// Describes settings to use for long-running operations when generating
1143 /// API methods for RPCs. Complements RPCs that use the annotations in
1144 /// google/longrunning/operations.proto.
1145 ///
1146 /// Example of a YAML configuration::
1147 ///
1148 /// ```text
1149 /// publishing:
1150 /// method_settings:
1151 /// - selector: google.cloud.speech.v2.Speech.BatchRecognize
1152 /// long_running:
1153 /// initial_poll_delay: 60s # 1 minute
1154 /// poll_delay_multiplier: 1.5
1155 /// max_poll_delay: 360s # 6 minutes
1156 /// total_poll_timeout: 54000s # 90 minutes
1157 /// ```
1158 #[prost(message, optional, tag = "2")]
1159 pub long_running: ::core::option::Option<method_settings::LongRunning>,
1160 /// List of top-level fields of the request message, that should be
1161 /// automatically populated by the client libraries based on their
1162 /// (google.api.field_info).format. Currently supported format: UUID4.
1163 ///
1164 /// Example of a YAML configuration:
1165 ///
1166 /// ```text
1167 /// publishing:
1168 /// method_settings:
1169 /// - selector: google.example.v1.ExampleService.CreateExample
1170 /// auto_populated_fields:
1171 /// - request_id
1172 /// ```
1173 #[prost(string, repeated, tag = "3")]
1174 pub auto_populated_fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1175 /// Batching configuration for an API method in client libraries.
1176 ///
1177 /// Example of a YAML configuration:
1178 ///
1179 /// ```text
1180 /// publishing:
1181 /// method_settings:
1182 /// - selector: google.example.v1.ExampleService.BatchCreateExample
1183 /// batching:
1184 /// element_count_threshold: 1000
1185 /// request_byte_threshold: 100000000
1186 /// delay_threshold_millis: 10
1187 /// ```
1188 #[prost(message, optional, tag = "4")]
1189 pub batching: ::core::option::Option<BatchingConfigProto>,
1190}
1191/// Nested message and enum types in `MethodSettings`.
1192pub mod method_settings {
1193 /// Describes settings to use when generating API methods that use the
1194 /// long-running operation pattern.
1195 /// All default values below are from those used in the client library
1196 /// generators (e.g.
1197 /// [Java](<https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java>)).
1198 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1199 pub struct LongRunning {
1200 /// Initial delay after which the first poll request will be made.
1201 /// Default value: 5 seconds.
1202 #[prost(message, optional, tag = "1")]
1203 pub initial_poll_delay: ::core::option::Option<::prost_types::Duration>,
1204 /// Multiplier to gradually increase delay between subsequent polls until it
1205 /// reaches max_poll_delay.
1206 /// Default value: 1.5.
1207 #[prost(float, tag = "2")]
1208 pub poll_delay_multiplier: f32,
1209 /// Maximum time between two subsequent poll requests.
1210 /// Default value: 45 seconds.
1211 #[prost(message, optional, tag = "3")]
1212 pub max_poll_delay: ::core::option::Option<::prost_types::Duration>,
1213 /// Total polling timeout.
1214 /// Default value: 5 minutes.
1215 #[prost(message, optional, tag = "4")]
1216 pub total_poll_timeout: ::core::option::Option<::prost_types::Duration>,
1217 }
1218}
1219/// This message is used to configure the generation of a subset of the RPCs in
1220/// a service for client libraries.
1221#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1222pub struct SelectiveGapicGeneration {
1223 /// An allowlist of the fully qualified names of RPCs that should be included
1224 /// on public client surfaces.
1225 #[prost(string, repeated, tag = "1")]
1226 pub methods: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1227 /// Setting this to true indicates to the client generators that methods
1228 /// that would be excluded from the generation should instead be generated
1229 /// in a way that indicates these methods should not be consumed by
1230 /// end users. How this is expressed is up to individual language
1231 /// implementations to decide. Some examples may be: added annotations,
1232 /// obfuscated identifiers, or other language idiomatic patterns.
1233 #[prost(bool, tag = "2")]
1234 pub generate_omitted_as_internal: bool,
1235}
1236/// `BatchingConfigProto` defines the batching configuration for an API method.
1237#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1238pub struct BatchingConfigProto {
1239 /// The thresholds which trigger a batched request to be sent.
1240 #[prost(message, optional, tag = "1")]
1241 pub thresholds: ::core::option::Option<BatchingSettingsProto>,
1242 /// The request and response fields used in batching.
1243 #[prost(message, optional, tag = "2")]
1244 pub batch_descriptor: ::core::option::Option<BatchingDescriptorProto>,
1245}
1246/// `BatchingSettingsProto` specifies a set of batching thresholds, each of
1247/// which acts as a trigger to send a batch of messages as a request. At least
1248/// one threshold must be positive nonzero.
1249#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1250pub struct BatchingSettingsProto {
1251 /// The number of elements of a field collected into a batch which, if
1252 /// exceeded, causes the batch to be sent.
1253 #[prost(int32, tag = "1")]
1254 pub element_count_threshold: i32,
1255 /// The aggregated size of the batched field which, if exceeded, causes the
1256 /// batch to be sent. This size is computed by aggregating the sizes of the
1257 /// request field to be batched, not of the entire request message.
1258 #[prost(int64, tag = "2")]
1259 pub request_byte_threshold: i64,
1260 /// The duration after which a batch should be sent, starting from the addition
1261 /// of the first message to that batch.
1262 #[prost(message, optional, tag = "3")]
1263 pub delay_threshold: ::core::option::Option<::prost_types::Duration>,
1264 /// The maximum number of elements collected in a batch that could be accepted
1265 /// by server.
1266 #[prost(int32, tag = "4")]
1267 pub element_count_limit: i32,
1268 /// The maximum size of the request that could be accepted by server.
1269 #[prost(int32, tag = "5")]
1270 pub request_byte_limit: i32,
1271 /// The maximum number of elements allowed by flow control.
1272 #[prost(int32, tag = "6")]
1273 pub flow_control_element_limit: i32,
1274 /// The maximum size of data allowed by flow control.
1275 #[prost(int32, tag = "7")]
1276 pub flow_control_byte_limit: i32,
1277 /// The behavior to take when the flow control limit is exceeded.
1278 #[prost(enumeration = "FlowControlLimitExceededBehaviorProto", tag = "8")]
1279 pub flow_control_limit_exceeded_behavior: i32,
1280}
1281/// `BatchingDescriptorProto` specifies the fields of the request message to be
1282/// used for batching, and, optionally, the fields of the response message to be
1283/// used for demultiplexing.
1284#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1285pub struct BatchingDescriptorProto {
1286 /// The repeated field in the request message to be aggregated by batching.
1287 #[prost(string, tag = "1")]
1288 pub batched_field: ::prost::alloc::string::String,
1289 /// A list of the fields in the request message. Two requests will be batched
1290 /// together only if the values of every field specified in
1291 /// `request_discriminator_fields` is equal between the two requests.
1292 #[prost(string, repeated, tag = "2")]
1293 pub discriminator_fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1294 /// Optional. When present, indicates the field in the response message to be
1295 /// used to demultiplex the response into multiple response messages, in
1296 /// correspondence with the multiple request messages originally batched
1297 /// together.
1298 #[prost(string, tag = "3")]
1299 pub subresponse_field: ::prost::alloc::string::String,
1300}
1301/// The organization for which the client libraries are being published.
1302/// Affects the url where generated docs are published, etc.
1303#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1304#[repr(i32)]
1305pub enum ClientLibraryOrganization {
1306 /// Not useful.
1307 Unspecified = 0,
1308 /// Google Cloud Platform Org.
1309 Cloud = 1,
1310 /// Ads (Advertising) Org.
1311 Ads = 2,
1312 /// Photos Org.
1313 Photos = 3,
1314 /// Street View Org.
1315 StreetView = 4,
1316 /// Shopping Org.
1317 Shopping = 5,
1318 /// Geo Org.
1319 Geo = 6,
1320 /// Generative AI - <https://developers.generativeai.google>
1321 GenerativeAi = 7,
1322}
1323impl ClientLibraryOrganization {
1324 /// String value of the enum field names used in the ProtoBuf definition.
1325 ///
1326 /// The values are not transformed in any way and thus are considered stable
1327 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1328 pub fn as_str_name(&self) -> &'static str {
1329 match self {
1330 Self::Unspecified => "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED",
1331 Self::Cloud => "CLOUD",
1332 Self::Ads => "ADS",
1333 Self::Photos => "PHOTOS",
1334 Self::StreetView => "STREET_VIEW",
1335 Self::Shopping => "SHOPPING",
1336 Self::Geo => "GEO",
1337 Self::GenerativeAi => "GENERATIVE_AI",
1338 }
1339 }
1340 /// Creates an enum from field names used in the ProtoBuf definition.
1341 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1342 match value {
1343 "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" => Some(Self::Unspecified),
1344 "CLOUD" => Some(Self::Cloud),
1345 "ADS" => Some(Self::Ads),
1346 "PHOTOS" => Some(Self::Photos),
1347 "STREET_VIEW" => Some(Self::StreetView),
1348 "SHOPPING" => Some(Self::Shopping),
1349 "GEO" => Some(Self::Geo),
1350 "GENERATIVE_AI" => Some(Self::GenerativeAi),
1351 _ => None,
1352 }
1353 }
1354}
1355/// To where should client libraries be published?
1356#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1357#[repr(i32)]
1358pub enum ClientLibraryDestination {
1359 /// Client libraries will neither be generated nor published to package
1360 /// managers.
1361 Unspecified = 0,
1362 /// Generate the client library in a repo under github.com/googleapis,
1363 /// but don't publish it to package managers.
1364 Github = 10,
1365 /// Publish the library to package managers like nuget.org and npmjs.com.
1366 PackageManager = 20,
1367}
1368impl ClientLibraryDestination {
1369 /// String value of the enum field names used in the ProtoBuf definition.
1370 ///
1371 /// The values are not transformed in any way and thus are considered stable
1372 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1373 pub fn as_str_name(&self) -> &'static str {
1374 match self {
1375 Self::Unspecified => "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED",
1376 Self::Github => "GITHUB",
1377 Self::PackageManager => "PACKAGE_MANAGER",
1378 }
1379 }
1380 /// Creates an enum from field names used in the ProtoBuf definition.
1381 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1382 match value {
1383 "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED" => Some(Self::Unspecified),
1384 "GITHUB" => Some(Self::Github),
1385 "PACKAGE_MANAGER" => Some(Self::PackageManager),
1386 _ => None,
1387 }
1388 }
1389}
1390/// The behavior to take when the flow control limit is exceeded.
1391#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1392#[repr(i32)]
1393pub enum FlowControlLimitExceededBehaviorProto {
1394 /// Default behavior, system-defined.
1395 UnsetBehavior = 0,
1396 /// Stop operation, raise error.
1397 ThrowException = 1,
1398 /// Pause operation until limit clears.
1399 Block = 2,
1400 /// Continue operation, disregard limit.
1401 Ignore = 3,
1402}
1403impl FlowControlLimitExceededBehaviorProto {
1404 /// String value of the enum field names used in the ProtoBuf definition.
1405 ///
1406 /// The values are not transformed in any way and thus are considered stable
1407 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1408 pub fn as_str_name(&self) -> &'static str {
1409 match self {
1410 Self::UnsetBehavior => "UNSET_BEHAVIOR",
1411 Self::ThrowException => "THROW_EXCEPTION",
1412 Self::Block => "BLOCK",
1413 Self::Ignore => "IGNORE",
1414 }
1415 }
1416 /// Creates an enum from field names used in the ProtoBuf definition.
1417 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1418 match value {
1419 "UNSET_BEHAVIOR" => Some(Self::UnsetBehavior),
1420 "THROW_EXCEPTION" => Some(Self::ThrowException),
1421 "BLOCK" => Some(Self::Block),
1422 "IGNORE" => Some(Self::Ignore),
1423 _ => None,
1424 }
1425 }
1426}
1427/// Rich semantic information of an API field beyond basic typing.
1428#[derive(Clone, PartialEq, ::prost::Message)]
1429pub struct FieldInfo {
1430 /// The standard format of a field value. This does not explicitly configure
1431 /// any API consumer, just documents the API's format for the field it is
1432 /// applied to.
1433 #[prost(enumeration = "field_info::Format", tag = "1")]
1434 pub format: i32,
1435 /// The type(s) that the annotated, generic field may represent.
1436 ///
1437 /// Currently, this must only be used on fields of type `google.protobuf.Any`.
1438 /// Supporting other generic types may be considered in the future.
1439 #[prost(message, repeated, tag = "2")]
1440 pub referenced_types: ::prost::alloc::vec::Vec<TypeReference>,
1441}
1442/// Nested message and enum types in `FieldInfo`.
1443pub mod field_info {
1444 /// The standard format of a field value. The supported formats are all backed
1445 /// by either an RFC defined by the IETF or a Google-defined AIP.
1446 #[derive(
1447 Clone,
1448 Copy,
1449 Debug,
1450 PartialEq,
1451 Eq,
1452 Hash,
1453 PartialOrd,
1454 Ord,
1455 ::prost::Enumeration
1456 )]
1457 #[repr(i32)]
1458 pub enum Format {
1459 /// Default, unspecified value.
1460 Unspecified = 0,
1461 /// Universally Unique Identifier, version 4, value as defined by
1462 /// <https://datatracker.ietf.org/doc/html/rfc4122.> The value may be
1463 /// normalized to entirely lowercase letters. For example, the value
1464 /// `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to
1465 /// `f47ac10b-58cc-0372-8567-0e02b2c3d479`.
1466 Uuid4 = 1,
1467 /// Internet Protocol v4 value as defined by [RFC
1468 /// 791](<https://datatracker.ietf.org/doc/html/rfc791>). The value may be
1469 /// condensed, with leading zeros in each octet stripped. For example,
1470 /// `001.022.233.040` would be condensed to `1.22.233.40`.
1471 Ipv4 = 2,
1472 /// Internet Protocol v6 value as defined by [RFC
1473 /// 2460](<https://datatracker.ietf.org/doc/html/rfc2460>). The value may be
1474 /// normalized to entirely lowercase letters with zeros compressed, following
1475 /// [RFC 5952](<https://datatracker.ietf.org/doc/html/rfc5952>). For example,
1476 /// the value `2001:0DB8:0::0` would be normalized to `2001:db8::`.
1477 Ipv6 = 3,
1478 /// An IP address in either v4 or v6 format as described by the individual
1479 /// values defined herein. See the comments on the IPV4 and IPV6 types for
1480 /// allowed normalizations of each.
1481 Ipv4OrIpv6 = 4,
1482 }
1483 impl Format {
1484 /// String value of the enum field names used in the ProtoBuf definition.
1485 ///
1486 /// The values are not transformed in any way and thus are considered stable
1487 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1488 pub fn as_str_name(&self) -> &'static str {
1489 match self {
1490 Self::Unspecified => "FORMAT_UNSPECIFIED",
1491 Self::Uuid4 => "UUID4",
1492 Self::Ipv4 => "IPV4",
1493 Self::Ipv6 => "IPV6",
1494 Self::Ipv4OrIpv6 => "IPV4_OR_IPV6",
1495 }
1496 }
1497 /// Creates an enum from field names used in the ProtoBuf definition.
1498 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1499 match value {
1500 "FORMAT_UNSPECIFIED" => Some(Self::Unspecified),
1501 "UUID4" => Some(Self::Uuid4),
1502 "IPV4" => Some(Self::Ipv4),
1503 "IPV6" => Some(Self::Ipv6),
1504 "IPV4_OR_IPV6" => Some(Self::Ipv4OrIpv6),
1505 _ => None,
1506 }
1507 }
1508 }
1509}
1510/// A reference to a message type, for use in \[FieldInfo\]\[google.api.FieldInfo\].
1511#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1512pub struct TypeReference {
1513 /// The name of the type that the annotated, generic field may represent.
1514 /// If the type is in the same protobuf package, the value can be the simple
1515 /// message name e.g., `"MyMessage"`. Otherwise, the value must be the
1516 /// fully-qualified message name e.g., `"google.library.v1.Book"`.
1517 ///
1518 /// If the type(s) are unknown to the service (e.g. the field accepts generic
1519 /// user input), use the wildcard `"*"` to denote this behavior.
1520 ///
1521 /// See [AIP-202](<https://google.aip.dev/202#type-references>) for more details.
1522 #[prost(string, tag = "1")]
1523 pub type_name: ::prost::alloc::string::String,
1524}
1525/// `Authentication` defines the authentication configuration for API methods
1526/// provided by an API service.
1527///
1528/// Example:
1529///
1530/// ```text
1531/// name: calendar.googleapis.com
1532/// authentication:
1533/// providers:
1534/// - id: google_calendar_auth
1535/// jwks_uri: <https://www.googleapis.com/oauth2/v1/certs>
1536/// issuer: <https://securetoken.google.com>
1537/// rules:
1538/// - selector: "*"
1539/// requirements:
1540/// provider_id: google_calendar_auth
1541/// - selector: google.calendar.Delegate
1542/// oauth:
1543/// canonical_scopes: <https://www.googleapis.com/auth/calendar.read>
1544/// ```
1545#[derive(Clone, PartialEq, ::prost::Message)]
1546pub struct Authentication {
1547 /// A list of authentication rules that apply to individual API methods.
1548 ///
1549 /// **NOTE:** All service configuration rules follow "last one wins" order.
1550 #[prost(message, repeated, tag = "3")]
1551 pub rules: ::prost::alloc::vec::Vec<AuthenticationRule>,
1552 /// Defines a set of authentication providers that a service supports.
1553 #[prost(message, repeated, tag = "4")]
1554 pub providers: ::prost::alloc::vec::Vec<AuthProvider>,
1555}
1556/// Authentication rules for the service.
1557///
1558/// By default, if a method has any authentication requirements, every request
1559/// must include a valid credential matching one of the requirements.
1560/// It's an error to include more than one kind of credential in a single
1561/// request.
1562///
1563/// If a method doesn't have any auth requirements, request credentials will be
1564/// ignored.
1565#[derive(Clone, PartialEq, ::prost::Message)]
1566pub struct AuthenticationRule {
1567 /// Selects the methods to which this rule applies.
1568 ///
1569 /// Refer to \[selector\]\[google.api.DocumentationRule.selector\] for syntax
1570 /// details.
1571 #[prost(string, tag = "1")]
1572 pub selector: ::prost::alloc::string::String,
1573 /// The requirements for OAuth credentials.
1574 #[prost(message, optional, tag = "2")]
1575 pub oauth: ::core::option::Option<OAuthRequirements>,
1576 /// If true, the service accepts API keys without any other credential.
1577 /// This flag only applies to HTTP and gRPC requests.
1578 #[prost(bool, tag = "5")]
1579 pub allow_without_credential: bool,
1580 /// Requirements for additional authentication providers.
1581 #[prost(message, repeated, tag = "7")]
1582 pub requirements: ::prost::alloc::vec::Vec<AuthRequirement>,
1583}
1584/// Specifies a location to extract JWT from an API request.
1585#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1586pub struct JwtLocation {
1587 /// The value prefix. The value format is "value_prefix{token}"
1588 /// Only applies to "in" header type. Must be empty for "in" query type.
1589 /// If not empty, the header value has to match (case sensitive) this prefix.
1590 /// If not matched, JWT will not be extracted. If matched, JWT will be
1591 /// extracted after the prefix is removed.
1592 ///
1593 /// For example, for "Authorization: Bearer {JWT}",
1594 /// value_prefix="Bearer " with a space at the end.
1595 #[prost(string, tag = "3")]
1596 pub value_prefix: ::prost::alloc::string::String,
1597 #[prost(oneof = "jwt_location::In", tags = "1, 2, 4")]
1598 pub r#in: ::core::option::Option<jwt_location::In>,
1599}
1600/// Nested message and enum types in `JwtLocation`.
1601pub mod jwt_location {
1602 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1603 pub enum In {
1604 /// Specifies HTTP header name to extract JWT token.
1605 #[prost(string, tag = "1")]
1606 Header(::prost::alloc::string::String),
1607 /// Specifies URL query parameter name to extract JWT token.
1608 #[prost(string, tag = "2")]
1609 Query(::prost::alloc::string::String),
1610 /// Specifies cookie name to extract JWT token.
1611 #[prost(string, tag = "4")]
1612 Cookie(::prost::alloc::string::String),
1613 }
1614}
1615/// Configuration for an authentication provider, including support for
1616/// [JSON Web Token
1617/// (JWT)](<https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32>).
1618#[derive(Clone, PartialEq, ::prost::Message)]
1619pub struct AuthProvider {
1620 /// The unique identifier of the auth provider. It will be referred to by
1621 /// `AuthRequirement.provider_id`.
1622 ///
1623 /// Example: "bookstore_auth".
1624 #[prost(string, tag = "1")]
1625 pub id: ::prost::alloc::string::String,
1626 /// Identifies the principal that issued the JWT. See
1627 /// <https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1>
1628 /// Usually a URL or an email address.
1629 ///
1630 /// Example: <https://securetoken.google.com>
1631 /// Example: 1234567-compute@developer.gserviceaccount.com
1632 #[prost(string, tag = "2")]
1633 pub issuer: ::prost::alloc::string::String,
1634 /// URL of the provider's public key set to validate signature of the JWT. See
1635 /// [OpenID
1636 /// Discovery](<https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata>).
1637 /// Optional if the key set document:
1638 ///
1639 /// * can be retrieved from
1640 /// [OpenID
1641 /// Discovery](<https://openid.net/specs/openid-connect-discovery-1_0.html>)
1642 /// of the issuer.
1643 /// * can be inferred from the email domain of the issuer (e.g. a Google
1644 /// service account).
1645 ///
1646 /// Example: <https://www.googleapis.com/oauth2/v1/certs>
1647 #[prost(string, tag = "3")]
1648 pub jwks_uri: ::prost::alloc::string::String,
1649 /// The list of JWT
1650 /// [audiences](<https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3>).
1651 /// that are allowed to access. A JWT containing any of these audiences will
1652 /// be accepted. When this setting is absent, JWTs with audiences:
1653 ///
1654 /// * "<https://\[service.name\]/\[google.protobuf.Api.name\]">
1655 /// * "<https://\[service.name\]/">
1656 /// will be accepted.
1657 /// For example, if no audiences are in the setting, LibraryService API will
1658 /// accept JWTs with the following audiences:
1659 /// *
1660 ///
1661 /// <https://library-example.googleapis.com/google.example.library.v1.LibraryService>
1662 ///
1663 /// * <https://library-example.googleapis.com/>
1664 ///
1665 /// Example:
1666 ///
1667 /// ```text
1668 /// audiences: bookstore_android.apps.googleusercontent.com,
1669 /// bookstore_web.apps.googleusercontent.com
1670 /// ```
1671 #[prost(string, tag = "4")]
1672 pub audiences: ::prost::alloc::string::String,
1673 /// Redirect URL if JWT token is required but not present or is expired.
1674 /// Implement authorizationUrl of securityDefinitions in OpenAPI spec.
1675 #[prost(string, tag = "5")]
1676 pub authorization_url: ::prost::alloc::string::String,
1677 /// Defines the locations to extract the JWT. For now it is only used by the
1678 /// Cloud Endpoints to store the OpenAPI extension \[x-google-jwt-locations\]
1679 /// (<https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations>)
1680 ///
1681 /// JWT locations can be one of HTTP headers, URL query parameters or
1682 /// cookies. The rule is that the first match wins.
1683 ///
1684 /// If not specified, default to use following 3 locations:
1685 /// 1) Authorization: Bearer
1686 /// 2) x-goog-iap-jwt-assertion
1687 /// 3) access_token query parameter
1688 ///
1689 /// Default locations can be specified as followings:
1690 /// jwt_locations:
1691 /// - header: Authorization
1692 /// value_prefix: "Bearer "
1693 /// - header: x-goog-iap-jwt-assertion
1694 /// - query: access_token
1695 #[prost(message, repeated, tag = "6")]
1696 pub jwt_locations: ::prost::alloc::vec::Vec<JwtLocation>,
1697}
1698/// OAuth scopes are a way to define data and permissions on data. For example,
1699/// there are scopes defined for "Read-only access to Google Calendar" and
1700/// "Access to Cloud Platform". Users can consent to a scope for an application,
1701/// giving it permission to access that data on their behalf.
1702///
1703/// OAuth scope specifications should be fairly coarse grained; a user will need
1704/// to see and understand the text description of what your scope means.
1705///
1706/// In most cases: use one or at most two OAuth scopes for an entire family of
1707/// products. If your product has multiple APIs, you should probably be sharing
1708/// the OAuth scope across all of those APIs.
1709///
1710/// When you need finer grained OAuth consent screens: talk with your product
1711/// management about how developers will use them in practice.
1712///
1713/// Please note that even though each of the canonical scopes is enough for a
1714/// request to be accepted and passed to the backend, a request can still fail
1715/// due to the backend requiring additional scopes or permissions.
1716#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1717pub struct OAuthRequirements {
1718 /// The list of publicly documented OAuth scopes that are allowed access. An
1719 /// OAuth token containing any of these scopes will be accepted.
1720 ///
1721 /// Example:
1722 ///
1723 /// ```text
1724 /// canonical_scopes: <https://www.googleapis.com/auth/calendar,>
1725 /// <https://www.googleapis.com/auth/calendar.read>
1726 /// ```
1727 #[prost(string, tag = "1")]
1728 pub canonical_scopes: ::prost::alloc::string::String,
1729}
1730/// User-defined authentication requirements, including support for
1731/// [JSON Web Token
1732/// (JWT)](<https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32>).
1733#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1734pub struct AuthRequirement {
1735 /// \[id\]\[google.api.AuthProvider.id\] from authentication provider.
1736 ///
1737 /// Example:
1738 ///
1739 /// ```text
1740 /// provider_id: bookstore_auth
1741 /// ```
1742 #[prost(string, tag = "1")]
1743 pub provider_id: ::prost::alloc::string::String,
1744 /// NOTE: This will be deprecated soon, once AuthProvider.audiences is
1745 /// implemented and accepted in all the runtime components.
1746 ///
1747 /// The list of JWT
1748 /// [audiences](<https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3>).
1749 /// that are allowed to access. A JWT containing any of these audiences will
1750 /// be accepted. When this setting is absent, only JWTs with audience
1751 /// "<https://\[Service_name\]\[google.api.Service.name\]/\[API_name\]\[google.protobuf.Api.name\]">
1752 /// will be accepted. For example, if no audiences are in the setting,
1753 /// LibraryService API will only accept JWTs with the following audience
1754 /// "<https://library-example.googleapis.com/google.example.library.v1.LibraryService".>
1755 ///
1756 /// Example:
1757 ///
1758 /// ```text
1759 /// audiences: bookstore_android.apps.googleusercontent.com,
1760 /// bookstore_web.apps.googleusercontent.com
1761 /// ```
1762 #[prost(string, tag = "2")]
1763 pub audiences: ::prost::alloc::string::String,
1764}
1765/// `Backend` defines the backend configuration for a service.
1766#[derive(Clone, PartialEq, ::prost::Message)]
1767pub struct Backend {
1768 /// A list of API backend rules that apply to individual API methods.
1769 ///
1770 /// **NOTE:** All service configuration rules follow "last one wins" order.
1771 #[prost(message, repeated, tag = "1")]
1772 pub rules: ::prost::alloc::vec::Vec<BackendRule>,
1773}
1774/// A backend rule provides configuration for an individual API element.
1775#[derive(Clone, PartialEq, ::prost::Message)]
1776pub struct BackendRule {
1777 /// Selects the methods to which this rule applies.
1778 ///
1779 /// Refer to \[selector\]\[google.api.DocumentationRule.selector\] for syntax
1780 /// details.
1781 #[prost(string, tag = "1")]
1782 pub selector: ::prost::alloc::string::String,
1783 /// The address of the API backend.
1784 ///
1785 /// The scheme is used to determine the backend protocol and security.
1786 /// The following schemes are accepted:
1787 ///
1788 /// ```text
1789 /// SCHEME PROTOCOL SECURITY
1790 /// http:// HTTP None
1791 /// https:// HTTP TLS
1792 /// grpc:// gRPC None
1793 /// grpcs:// gRPC TLS
1794 /// ```
1795 ///
1796 /// It is recommended to explicitly include a scheme. Leaving out the scheme
1797 /// may cause constrasting behaviors across platforms.
1798 ///
1799 /// If the port is unspecified, the default is:
1800 ///
1801 /// * 80 for schemes without TLS
1802 /// * 443 for schemes with TLS
1803 ///
1804 /// For HTTP backends, use \[protocol\]\[google.api.BackendRule.protocol\]
1805 /// to specify the protocol version.
1806 #[prost(string, tag = "2")]
1807 pub address: ::prost::alloc::string::String,
1808 /// The number of seconds to wait for a response from a request. The default
1809 /// varies based on the request protocol and deployment environment.
1810 #[prost(double, tag = "3")]
1811 pub deadline: f64,
1812 /// Deprecated, do not use.
1813 #[deprecated]
1814 #[prost(double, tag = "4")]
1815 pub min_deadline: f64,
1816 /// The number of seconds to wait for the completion of a long running
1817 /// operation. The default is no deadline.
1818 #[prost(double, tag = "5")]
1819 pub operation_deadline: f64,
1820 /// Path translation specifies how to combine the backend address with the
1821 /// request path in order to produce the appropriate forwarding URL for the
1822 /// request. See \[PathTranslation\]\[google.api.BackendRule.PathTranslation\] for
1823 /// more details.
1824 #[prost(enumeration = "backend_rule::PathTranslation", tag = "6")]
1825 pub path_translation: i32,
1826 /// The protocol used for sending a request to the backend.
1827 /// The supported values are "http/1.1" and "h2".
1828 ///
1829 /// The default value is inferred from the scheme in the
1830 /// \[address\]\[google.api.BackendRule.address\] field:
1831 ///
1832 /// ```text
1833 /// SCHEME PROTOCOL
1834 /// http:// http/1.1
1835 /// https:// http/1.1
1836 /// grpc:// h2
1837 /// grpcs:// h2
1838 /// ```
1839 ///
1840 /// For secure HTTP backends (https://) that support HTTP/2, set this field
1841 /// to "h2" for improved performance.
1842 ///
1843 /// Configuring this field to non-default values is only supported for secure
1844 /// HTTP backends. This field will be ignored for all other backends.
1845 ///
1846 /// See
1847 /// <https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids>
1848 /// for more details on the supported values.
1849 #[prost(string, tag = "9")]
1850 pub protocol: ::prost::alloc::string::String,
1851 /// The map between request protocol and the backend address.
1852 #[prost(map = "string, message", tag = "10")]
1853 pub overrides_by_request_protocol: ::std::collections::HashMap<
1854 ::prost::alloc::string::String,
1855 BackendRule,
1856 >,
1857 /// The load balancing policy used for connection to the application backend.
1858 ///
1859 /// Defined as an arbitrary string to accomondate custom load balancing
1860 /// policies supported by the underlying channel, but suggest most users use
1861 /// one of the standard policies, such as the default, "RoundRobin".
1862 #[prost(string, tag = "11")]
1863 pub load_balancing_policy: ::prost::alloc::string::String,
1864 /// Authentication settings used by the backend.
1865 ///
1866 /// These are typically used to provide service management functionality to
1867 /// a backend served on a publicly-routable URL. The `authentication`
1868 /// details should match the authentication behavior used by the backend.
1869 ///
1870 /// For example, specifying `jwt_audience` implies that the backend expects
1871 /// authentication via a JWT.
1872 ///
1873 /// When authentication is unspecified, the resulting behavior is the same
1874 /// as `disable_auth` set to `true`.
1875 ///
1876 /// Refer to <https://developers.google.com/identity/protocols/OpenIDConnect> for
1877 /// JWT ID token.
1878 #[prost(oneof = "backend_rule::Authentication", tags = "7, 8")]
1879 pub authentication: ::core::option::Option<backend_rule::Authentication>,
1880}
1881/// Nested message and enum types in `BackendRule`.
1882pub mod backend_rule {
1883 /// Path Translation specifies how to combine the backend address with the
1884 /// request path in order to produce the appropriate forwarding URL for the
1885 /// request.
1886 ///
1887 /// Path Translation is applicable only to HTTP-based backends. Backends which
1888 /// do not accept requests over HTTP/HTTPS should leave `path_translation`
1889 /// unspecified.
1890 #[derive(
1891 Clone,
1892 Copy,
1893 Debug,
1894 PartialEq,
1895 Eq,
1896 Hash,
1897 PartialOrd,
1898 Ord,
1899 ::prost::Enumeration
1900 )]
1901 #[repr(i32)]
1902 pub enum PathTranslation {
1903 Unspecified = 0,
1904 /// Use the backend address as-is, with no modification to the path. If the
1905 /// URL pattern contains variables, the variable names and values will be
1906 /// appended to the query string. If a query string parameter and a URL
1907 /// pattern variable have the same name, this may result in duplicate keys in
1908 /// the query string.
1909 ///
1910 /// # Examples
1911 ///
1912 /// Given the following operation config:
1913 ///
1914 /// ```text
1915 /// Method path: /api/company/{cid}/user/{uid}
1916 /// Backend address: <https://example.cloudfunctions.net/getUser>
1917 /// ```
1918 ///
1919 /// Requests to the following request paths will call the backend at the
1920 /// translated path:
1921 ///
1922 /// ```text
1923 /// Request path: /api/company/widgetworks/user/johndoe
1924 /// Translated:
1925 /// <https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe>
1926 ///
1927 /// Request path: /api/company/widgetworks/user/johndoe?timezone=EST
1928 /// Translated:
1929 /// <https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe>
1930 /// ```
1931 ConstantAddress = 1,
1932 /// The request path will be appended to the backend address.
1933 ///
1934 /// # Examples
1935 ///
1936 /// Given the following operation config:
1937 ///
1938 /// ```text
1939 /// Method path: /api/company/{cid}/user/{uid}
1940 /// Backend address: <https://example.appspot.com>
1941 /// ```
1942 ///
1943 /// Requests to the following request paths will call the backend at the
1944 /// translated path:
1945 ///
1946 /// ```text
1947 /// Request path: /api/company/widgetworks/user/johndoe
1948 /// Translated:
1949 /// <https://example.appspot.com/api/company/widgetworks/user/johndoe>
1950 ///
1951 /// Request path: /api/company/widgetworks/user/johndoe?timezone=EST
1952 /// Translated:
1953 /// <https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST>
1954 /// ```
1955 AppendPathToAddress = 2,
1956 }
1957 impl PathTranslation {
1958 /// String value of the enum field names used in the ProtoBuf definition.
1959 ///
1960 /// The values are not transformed in any way and thus are considered stable
1961 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1962 pub fn as_str_name(&self) -> &'static str {
1963 match self {
1964 Self::Unspecified => "PATH_TRANSLATION_UNSPECIFIED",
1965 Self::ConstantAddress => "CONSTANT_ADDRESS",
1966 Self::AppendPathToAddress => "APPEND_PATH_TO_ADDRESS",
1967 }
1968 }
1969 /// Creates an enum from field names used in the ProtoBuf definition.
1970 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1971 match value {
1972 "PATH_TRANSLATION_UNSPECIFIED" => Some(Self::Unspecified),
1973 "CONSTANT_ADDRESS" => Some(Self::ConstantAddress),
1974 "APPEND_PATH_TO_ADDRESS" => Some(Self::AppendPathToAddress),
1975 _ => None,
1976 }
1977 }
1978 }
1979 /// Authentication settings used by the backend.
1980 ///
1981 /// These are typically used to provide service management functionality to
1982 /// a backend served on a publicly-routable URL. The `authentication`
1983 /// details should match the authentication behavior used by the backend.
1984 ///
1985 /// For example, specifying `jwt_audience` implies that the backend expects
1986 /// authentication via a JWT.
1987 ///
1988 /// When authentication is unspecified, the resulting behavior is the same
1989 /// as `disable_auth` set to `true`.
1990 ///
1991 /// Refer to <https://developers.google.com/identity/protocols/OpenIDConnect> for
1992 /// JWT ID token.
1993 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1994 pub enum Authentication {
1995 /// The JWT audience is used when generating a JWT ID token for the backend.
1996 /// This ID token will be added in the HTTP "authorization" header, and sent
1997 /// to the backend.
1998 #[prost(string, tag = "7")]
1999 JwtAudience(::prost::alloc::string::String),
2000 /// When disable_auth is true, a JWT ID token won't be generated and the
2001 /// original "Authorization" HTTP header will be preserved. If the header is
2002 /// used to carry the original token and is expected by the backend, this
2003 /// field must be set to true to preserve the header.
2004 #[prost(bool, tag = "8")]
2005 DisableAuth(bool),
2006 }
2007}
2008/// Billing related configuration of the service.
2009///
2010/// The following example shows how to configure monitored resources and metrics
2011/// for billing, `consumer_destinations` is the only supported destination and
2012/// the monitored resources need at least one label key
2013/// `cloud.googleapis.com/location` to indicate the location of the billing
2014/// usage, using different monitored resources between monitoring and billing is
2015/// recommended so they can be evolved independently:
2016///
2017/// ```text
2018/// monitored_resources:
2019/// - type: library.googleapis.com/billing_branch
2020/// labels:
2021/// - key: cloud.googleapis.com/location
2022/// description: |
2023/// Predefined label to support billing location restriction.
2024/// - key: city
2025/// description: |
2026/// Custom label to define the city where the library branch is located
2027/// in.
2028/// - key: name
2029/// description: Custom label to define the name of the library branch.
2030/// metrics:
2031/// - name: library.googleapis.com/book/borrowed_count
2032/// metric_kind: DELTA
2033/// value_type: INT64
2034/// unit: "1"
2035/// billing:
2036/// consumer_destinations:
2037/// - monitored_resource: library.googleapis.com/billing_branch
2038/// metrics:
2039/// - library.googleapis.com/book/borrowed_count
2040/// ```
2041#[derive(Clone, PartialEq, ::prost::Message)]
2042pub struct Billing {
2043 /// Billing configurations for sending metrics to the consumer project.
2044 /// There can be multiple consumer destinations per service, each one must have
2045 /// a different monitored resource type. A metric can be used in at most
2046 /// one consumer destination.
2047 #[prost(message, repeated, tag = "8")]
2048 pub consumer_destinations: ::prost::alloc::vec::Vec<billing::BillingDestination>,
2049}
2050/// Nested message and enum types in `Billing`.
2051pub mod billing {
2052 /// Configuration of a specific billing destination (Currently only support
2053 /// bill against consumer project).
2054 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2055 pub struct BillingDestination {
2056 /// The monitored resource type. The type must be defined in
2057 /// \[Service.monitored_resources\]\[google.api.Service.monitored_resources\]
2058 /// section.
2059 #[prost(string, tag = "1")]
2060 pub monitored_resource: ::prost::alloc::string::String,
2061 /// Names of the metrics to report to this billing destination.
2062 /// Each name must be defined in
2063 /// \[Service.metrics\]\[google.api.Service.metrics\] section.
2064 #[prost(string, repeated, tag = "2")]
2065 pub metrics: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2066 }
2067}
2068/// Output generated from semantically comparing two versions of a service
2069/// configuration.
2070///
2071/// Includes detailed information about a field that have changed with
2072/// applicable advice about potential consequences for the change, such as
2073/// backwards-incompatibility.
2074#[derive(Clone, PartialEq, ::prost::Message)]
2075pub struct ConfigChange {
2076 /// Object hierarchy path to the change, with levels separated by a '.'
2077 /// character. For repeated fields, an applicable unique identifier field is
2078 /// used for the index (usually selector, name, or id). For maps, the term
2079 /// 'key' is used. If the field has no unique identifier, the numeric index
2080 /// is used.
2081 /// Examples:
2082 ///
2083 /// * visibility.rules\[selector=="google.LibraryService.ListBooks"\].restriction
2084 /// * quota.metric_rules\[selector=="google"\].metric_costs\[key=="reads"\].value
2085 /// * logging.producer_destinations\[0\]
2086 #[prost(string, tag = "1")]
2087 pub element: ::prost::alloc::string::String,
2088 /// Value of the changed object in the old Service configuration,
2089 /// in JSON format. This field will not be populated if ChangeType == ADDED.
2090 #[prost(string, tag = "2")]
2091 pub old_value: ::prost::alloc::string::String,
2092 /// Value of the changed object in the new Service configuration,
2093 /// in JSON format. This field will not be populated if ChangeType == REMOVED.
2094 #[prost(string, tag = "3")]
2095 pub new_value: ::prost::alloc::string::String,
2096 /// The type for this change, either ADDED, REMOVED, or MODIFIED.
2097 #[prost(enumeration = "ChangeType", tag = "4")]
2098 pub change_type: i32,
2099 /// Collection of advice provided for this change, useful for determining the
2100 /// possible impact of this change.
2101 #[prost(message, repeated, tag = "5")]
2102 pub advices: ::prost::alloc::vec::Vec<Advice>,
2103}
2104/// Generated advice about this change, used for providing more
2105/// information about how a change will affect the existing service.
2106#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2107pub struct Advice {
2108 /// Useful description for why this advice was applied and what actions should
2109 /// be taken to mitigate any implied risks.
2110 #[prost(string, tag = "2")]
2111 pub description: ::prost::alloc::string::String,
2112}
2113/// Classifies set of possible modifications to an object in the service
2114/// configuration.
2115#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2116#[repr(i32)]
2117pub enum ChangeType {
2118 /// No value was provided.
2119 Unspecified = 0,
2120 /// The changed object exists in the 'new' service configuration, but not
2121 /// in the 'old' service configuration.
2122 Added = 1,
2123 /// The changed object exists in the 'old' service configuration, but not
2124 /// in the 'new' service configuration.
2125 Removed = 2,
2126 /// The changed object exists in both service configurations, but its value
2127 /// is different.
2128 Modified = 3,
2129}
2130impl ChangeType {
2131 /// String value of the enum field names used in the ProtoBuf definition.
2132 ///
2133 /// The values are not transformed in any way and thus are considered stable
2134 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2135 pub fn as_str_name(&self) -> &'static str {
2136 match self {
2137 Self::Unspecified => "CHANGE_TYPE_UNSPECIFIED",
2138 Self::Added => "ADDED",
2139 Self::Removed => "REMOVED",
2140 Self::Modified => "MODIFIED",
2141 }
2142 }
2143 /// Creates an enum from field names used in the ProtoBuf definition.
2144 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2145 match value {
2146 "CHANGE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
2147 "ADDED" => Some(Self::Added),
2148 "REMOVED" => Some(Self::Removed),
2149 "MODIFIED" => Some(Self::Modified),
2150 _ => None,
2151 }
2152 }
2153}
2154/// A descriptor for defining project properties for a service. One service may
2155/// have many consumer projects, and the service may want to behave differently
2156/// depending on some properties on the project. For example, a project may be
2157/// associated with a school, or a business, or a government agency, a business
2158/// type property on the project may affect how a service responds to the client.
2159/// This descriptor defines which properties are allowed to be set on a project.
2160///
2161/// Example:
2162///
2163/// ```text
2164/// project_properties:
2165/// properties:
2166/// - name: NO_WATERMARK
2167/// type: BOOL
2168/// description: Allows usage of the API without watermarks.
2169/// - name: EXTENDED_TILE_CACHE_PERIOD
2170/// type: INT64
2171/// ```
2172#[derive(Clone, PartialEq, ::prost::Message)]
2173pub struct ProjectProperties {
2174 /// List of per consumer project-specific properties.
2175 #[prost(message, repeated, tag = "1")]
2176 pub properties: ::prost::alloc::vec::Vec<Property>,
2177}
2178/// Defines project properties.
2179///
2180/// API services can define properties that can be assigned to consumer projects
2181/// so that backends can perform response customization without having to make
2182/// additional calls or maintain additional storage. For example, Maps API
2183/// defines properties that controls map tile cache period, or whether to embed a
2184/// watermark in a result.
2185///
2186/// These values can be set via API producer console. Only API providers can
2187/// define and set these properties.
2188#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2189pub struct Property {
2190 /// The name of the property (a.k.a key).
2191 #[prost(string, tag = "1")]
2192 pub name: ::prost::alloc::string::String,
2193 /// The type of this property.
2194 #[prost(enumeration = "property::PropertyType", tag = "2")]
2195 pub r#type: i32,
2196 /// The description of the property
2197 #[prost(string, tag = "3")]
2198 pub description: ::prost::alloc::string::String,
2199}
2200/// Nested message and enum types in `Property`.
2201pub mod property {
2202 /// Supported data type of the property values
2203 #[derive(
2204 Clone,
2205 Copy,
2206 Debug,
2207 PartialEq,
2208 Eq,
2209 Hash,
2210 PartialOrd,
2211 Ord,
2212 ::prost::Enumeration
2213 )]
2214 #[repr(i32)]
2215 pub enum PropertyType {
2216 /// The type is unspecified, and will result in an error.
2217 Unspecified = 0,
2218 /// The type is `int64`.
2219 Int64 = 1,
2220 /// The type is `bool`.
2221 Bool = 2,
2222 /// The type is `string`.
2223 String = 3,
2224 /// The type is 'double'.
2225 Double = 4,
2226 }
2227 impl PropertyType {
2228 /// String value of the enum field names used in the ProtoBuf definition.
2229 ///
2230 /// The values are not transformed in any way and thus are considered stable
2231 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2232 pub fn as_str_name(&self) -> &'static str {
2233 match self {
2234 Self::Unspecified => "UNSPECIFIED",
2235 Self::Int64 => "INT64",
2236 Self::Bool => "BOOL",
2237 Self::String => "STRING",
2238 Self::Double => "DOUBLE",
2239 }
2240 }
2241 /// Creates an enum from field names used in the ProtoBuf definition.
2242 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2243 match value {
2244 "UNSPECIFIED" => Some(Self::Unspecified),
2245 "INT64" => Some(Self::Int64),
2246 "BOOL" => Some(Self::Bool),
2247 "STRING" => Some(Self::String),
2248 "DOUBLE" => Some(Self::Double),
2249 _ => None,
2250 }
2251 }
2252 }
2253}
2254/// `Context` defines which contexts an API requests.
2255///
2256/// Example:
2257///
2258/// ```text
2259/// context:
2260/// rules:
2261/// - selector: "*"
2262/// requested:
2263/// - google.rpc.context.ProjectContext
2264/// - google.rpc.context.OriginContext
2265/// ```
2266///
2267/// The above specifies that all methods in the API request
2268/// `google.rpc.context.ProjectContext` and
2269/// `google.rpc.context.OriginContext`.
2270///
2271/// Available context types are defined in package
2272/// `google.rpc.context`.
2273///
2274/// This also provides mechanism to allowlist any protobuf message extension that
2275/// can be sent in grpc metadata using “x-goog-ext-\<extension_id>-bin” and
2276/// “x-goog-ext-\<extension_id>-jspb” format. For example, list any service
2277/// specific protobuf types that can appear in grpc metadata as follows in your
2278/// yaml file:
2279///
2280/// Example:
2281///
2282/// ```text
2283/// context:
2284/// rules:
2285/// - selector: "google.example.library.v1.LibraryService.CreateBook"
2286/// allowed_request_extensions:
2287/// - google.foo.v1.NewExtension
2288/// allowed_response_extensions:
2289/// - google.foo.v1.NewExtension
2290/// ```
2291///
2292/// You can also specify extension ID instead of fully qualified extension name
2293/// here.
2294#[derive(Clone, PartialEq, ::prost::Message)]
2295pub struct Context {
2296 /// A list of RPC context rules that apply to individual API methods.
2297 ///
2298 /// **NOTE:** All service configuration rules follow "last one wins" order.
2299 #[prost(message, repeated, tag = "1")]
2300 pub rules: ::prost::alloc::vec::Vec<ContextRule>,
2301}
2302/// A context rule provides information about the context for an individual API
2303/// element.
2304#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2305pub struct ContextRule {
2306 /// Selects the methods to which this rule applies.
2307 ///
2308 /// Refer to \[selector\]\[google.api.DocumentationRule.selector\] for syntax
2309 /// details.
2310 #[prost(string, tag = "1")]
2311 pub selector: ::prost::alloc::string::String,
2312 /// A list of full type names of requested contexts, only the requested context
2313 /// will be made available to the backend.
2314 #[prost(string, repeated, tag = "2")]
2315 pub requested: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2316 /// A list of full type names of provided contexts. It is used to support
2317 /// propagating HTTP headers and ETags from the response extension.
2318 #[prost(string, repeated, tag = "3")]
2319 pub provided: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2320 /// A list of full type names or extension IDs of extensions allowed in grpc
2321 /// side channel from client to backend.
2322 #[prost(string, repeated, tag = "4")]
2323 pub allowed_request_extensions: ::prost::alloc::vec::Vec<
2324 ::prost::alloc::string::String,
2325 >,
2326 /// A list of full type names or extension IDs of extensions allowed in grpc
2327 /// side channel from backend to client.
2328 #[prost(string, repeated, tag = "5")]
2329 pub allowed_response_extensions: ::prost::alloc::vec::Vec<
2330 ::prost::alloc::string::String,
2331 >,
2332}
2333/// Google API Policy Annotation
2334///
2335/// This message defines a simple API policy annotation that can be used to
2336/// annotate API request and response message fields with applicable policies.
2337/// One field may have multiple applicable policies that must all be satisfied
2338/// before a request can be processed. This policy annotation is used to
2339/// generate the overall policy that will be used for automatic runtime
2340/// policy enforcement and documentation generation.
2341#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2342pub struct FieldPolicy {
2343 /// Selects one or more request or response message fields to apply this
2344 /// `FieldPolicy`.
2345 ///
2346 /// When a `FieldPolicy` is used in proto annotation, the selector must
2347 /// be left as empty. The service config generator will automatically fill
2348 /// the correct value.
2349 ///
2350 /// When a `FieldPolicy` is used in service config, the selector must be a
2351 /// comma-separated string with valid request or response field paths,
2352 /// such as "foo.bar" or "foo.bar,foo.baz".
2353 #[prost(string, tag = "1")]
2354 pub selector: ::prost::alloc::string::String,
2355 /// Specifies the required permission(s) for the resource referred to by the
2356 /// field. It requires the field contains a valid resource reference, and
2357 /// the request must pass the permission checks to proceed. For example,
2358 /// "resourcemanager.projects.get".
2359 #[prost(string, tag = "2")]
2360 pub resource_permission: ::prost::alloc::string::String,
2361 /// Specifies the resource type for the resource referred to by the field.
2362 #[prost(string, tag = "3")]
2363 pub resource_type: ::prost::alloc::string::String,
2364}
2365/// Defines policies applying to an RPC method.
2366#[derive(Clone, PartialEq, ::prost::Message)]
2367pub struct MethodPolicy {
2368 /// Selects a method to which these policies should be enforced, for example,
2369 /// "google.pubsub.v1.Subscriber.CreateSubscription".
2370 ///
2371 /// Refer to \[selector\]\[google.api.DocumentationRule.selector\] for syntax
2372 /// details.
2373 ///
2374 /// NOTE: This field must not be set in the proto annotation. It will be
2375 /// automatically filled by the service config compiler .
2376 #[prost(string, tag = "9")]
2377 pub selector: ::prost::alloc::string::String,
2378 /// Policies that are applicable to the request message.
2379 #[prost(message, repeated, tag = "2")]
2380 pub request_policies: ::prost::alloc::vec::Vec<FieldPolicy>,
2381}
2382/// Selects and configures the service controller used by the service.
2383///
2384/// Example:
2385///
2386/// ```text
2387/// control:
2388/// environment: servicecontrol.googleapis.com
2389/// ```
2390#[derive(Clone, PartialEq, ::prost::Message)]
2391pub struct Control {
2392 /// The service controller environment to use. If empty, no control plane
2393 /// features (like quota and billing) will be enabled. The recommended value
2394 /// for most services is servicecontrol.googleapis.com.
2395 #[prost(string, tag = "1")]
2396 pub environment: ::prost::alloc::string::String,
2397 /// Defines policies applying to the API methods of the service.
2398 #[prost(message, repeated, tag = "4")]
2399 pub method_policies: ::prost::alloc::vec::Vec<MethodPolicy>,
2400}
2401/// `Distribution` contains summary statistics for a population of values. It
2402/// optionally contains a histogram representing the distribution of those values
2403/// across a set of buckets.
2404///
2405/// The summary statistics are the count, mean, sum of the squared deviation from
2406/// the mean, the minimum, and the maximum of the set of population of values.
2407/// The histogram is based on a sequence of buckets and gives a count of values
2408/// that fall into each bucket. The boundaries of the buckets are given either
2409/// explicitly or by formulas for buckets of fixed or exponentially increasing
2410/// widths.
2411///
2412/// Although it is not forbidden, it is generally a bad idea to include
2413/// non-finite values (infinities or NaNs) in the population of values, as this
2414/// will render the `mean` and `sum_of_squared_deviation` fields meaningless.
2415#[derive(Clone, PartialEq, ::prost::Message)]
2416pub struct Distribution {
2417 /// The number of values in the population. Must be non-negative. This value
2418 /// must equal the sum of the values in `bucket_counts` if a histogram is
2419 /// provided.
2420 #[prost(int64, tag = "1")]
2421 pub count: i64,
2422 /// The arithmetic mean of the values in the population. If `count` is zero
2423 /// then this field must be zero.
2424 #[prost(double, tag = "2")]
2425 pub mean: f64,
2426 /// The sum of squared deviations from the mean of the values in the
2427 /// population. For values x_i this is:
2428 ///
2429 /// ```text
2430 /// Sum[i=1..n]((x_i - mean)^2)
2431 /// ```
2432 ///
2433 /// Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition
2434 /// describes Welford's method for accumulating this sum in one pass.
2435 ///
2436 /// If `count` is zero then this field must be zero.
2437 #[prost(double, tag = "3")]
2438 pub sum_of_squared_deviation: f64,
2439 /// If specified, contains the range of the population values. The field
2440 /// must not be present if the `count` is zero.
2441 #[prost(message, optional, tag = "4")]
2442 pub range: ::core::option::Option<distribution::Range>,
2443 /// Defines the histogram bucket boundaries. If the distribution does not
2444 /// contain a histogram, then omit this field.
2445 #[prost(message, optional, tag = "6")]
2446 pub bucket_options: ::core::option::Option<distribution::BucketOptions>,
2447 /// The number of values in each bucket of the histogram, as described in
2448 /// `bucket_options`. If the distribution does not have a histogram, then omit
2449 /// this field. If there is a histogram, then the sum of the values in
2450 /// `bucket_counts` must equal the value in the `count` field of the
2451 /// distribution.
2452 ///
2453 /// If present, `bucket_counts` should contain N values, where N is the number
2454 /// of buckets specified in `bucket_options`. If you supply fewer than N
2455 /// values, the remaining values are assumed to be 0.
2456 ///
2457 /// The order of the values in `bucket_counts` follows the bucket numbering
2458 /// schemes described for the three bucket types. The first value must be the
2459 /// count for the underflow bucket (number 0). The next N-2 values are the
2460 /// counts for the finite buckets (number 1 through N-2). The N'th value in
2461 /// `bucket_counts` is the count for the overflow bucket (number N-1).
2462 #[prost(int64, repeated, tag = "7")]
2463 pub bucket_counts: ::prost::alloc::vec::Vec<i64>,
2464 /// Must be in increasing order of `value` field.
2465 #[prost(message, repeated, tag = "10")]
2466 pub exemplars: ::prost::alloc::vec::Vec<distribution::Exemplar>,
2467}
2468/// Nested message and enum types in `Distribution`.
2469pub mod distribution {
2470 /// The range of the population values.
2471 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2472 pub struct Range {
2473 /// The minimum of the population values.
2474 #[prost(double, tag = "1")]
2475 pub min: f64,
2476 /// The maximum of the population values.
2477 #[prost(double, tag = "2")]
2478 pub max: f64,
2479 }
2480 /// `BucketOptions` describes the bucket boundaries used to create a histogram
2481 /// for the distribution. The buckets can be in a linear sequence, an
2482 /// exponential sequence, or each bucket can be specified explicitly.
2483 /// `BucketOptions` does not include the number of values in each bucket.
2484 ///
2485 /// A bucket has an inclusive lower bound and exclusive upper bound for the
2486 /// values that are counted for that bucket. The upper bound of a bucket must
2487 /// be strictly greater than the lower bound. The sequence of N buckets for a
2488 /// distribution consists of an underflow bucket (number 0), zero or more
2489 /// finite buckets (number 1 through N - 2) and an overflow bucket (number N -
2490 /// 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the
2491 /// same as the upper bound of bucket i - 1. The buckets span the whole range
2492 /// of finite values: lower bound of the underflow bucket is -infinity and the
2493 /// upper bound of the overflow bucket is +infinity. The finite buckets are
2494 /// so-called because both bounds are finite.
2495 #[derive(Clone, PartialEq, ::prost::Message)]
2496 pub struct BucketOptions {
2497 /// Exactly one of these three fields must be set.
2498 #[prost(oneof = "bucket_options::Options", tags = "1, 2, 3")]
2499 pub options: ::core::option::Option<bucket_options::Options>,
2500 }
2501 /// Nested message and enum types in `BucketOptions`.
2502 pub mod bucket_options {
2503 /// Specifies a linear sequence of buckets that all have the same width
2504 /// (except overflow and underflow). Each bucket represents a constant
2505 /// absolute uncertainty on the specific value in the bucket.
2506 ///
2507 /// There are `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the
2508 /// following boundaries:
2509 ///
2510 /// ```text
2511 /// Upper bound (0 <= i < N-1): offset + (width * i).
2512 ///
2513 /// Lower bound (1 <= i < N): offset + (width * (i - 1)).
2514 /// ```
2515 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2516 pub struct Linear {
2517 /// Must be greater than 0.
2518 #[prost(int32, tag = "1")]
2519 pub num_finite_buckets: i32,
2520 /// Must be greater than 0.
2521 #[prost(double, tag = "2")]
2522 pub width: f64,
2523 /// Lower bound of the first bucket.
2524 #[prost(double, tag = "3")]
2525 pub offset: f64,
2526 }
2527 /// Specifies an exponential sequence of buckets that have a width that is
2528 /// proportional to the value of the lower bound. Each bucket represents a
2529 /// constant relative uncertainty on a specific value in the bucket.
2530 ///
2531 /// There are `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the
2532 /// following boundaries:
2533 ///
2534 /// ```text
2535 /// Upper bound (0 <= i < N-1): scale * (growth_factor ^ i).
2536 ///
2537 /// Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)).
2538 /// ```
2539 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2540 pub struct Exponential {
2541 /// Must be greater than 0.
2542 #[prost(int32, tag = "1")]
2543 pub num_finite_buckets: i32,
2544 /// Must be greater than 1.
2545 #[prost(double, tag = "2")]
2546 pub growth_factor: f64,
2547 /// Must be greater than 0.
2548 #[prost(double, tag = "3")]
2549 pub scale: f64,
2550 }
2551 /// Specifies a set of buckets with arbitrary widths.
2552 ///
2553 /// There are `size(bounds) + 1` (= N) buckets. Bucket `i` has the following
2554 /// boundaries:
2555 ///
2556 /// ```text
2557 /// Upper bound (0 <= i < N-1): bounds\[i\]
2558 /// Lower bound (1 <= i < N); bounds\[i - 1\]
2559 /// ```
2560 ///
2561 /// The `bounds` field must contain at least one element. If `bounds` has
2562 /// only one element, then there are no finite buckets, and that single
2563 /// element is the common boundary of the overflow and underflow buckets.
2564 #[derive(Clone, PartialEq, ::prost::Message)]
2565 pub struct Explicit {
2566 /// The values must be monotonically increasing.
2567 #[prost(double, repeated, tag = "1")]
2568 pub bounds: ::prost::alloc::vec::Vec<f64>,
2569 }
2570 /// Exactly one of these three fields must be set.
2571 #[derive(Clone, PartialEq, ::prost::Oneof)]
2572 pub enum Options {
2573 /// The linear bucket.
2574 #[prost(message, tag = "1")]
2575 LinearBuckets(Linear),
2576 /// The exponential buckets.
2577 #[prost(message, tag = "2")]
2578 ExponentialBuckets(Exponential),
2579 /// The explicit buckets.
2580 #[prost(message, tag = "3")]
2581 ExplicitBuckets(Explicit),
2582 }
2583 }
2584 /// Exemplars are example points that may be used to annotate aggregated
2585 /// distribution values. They are metadata that gives information about a
2586 /// particular value added to a Distribution bucket, such as a trace ID that
2587 /// was active when a value was added. They may contain further information,
2588 /// such as a example values and timestamps, origin, etc.
2589 #[derive(Clone, PartialEq, ::prost::Message)]
2590 pub struct Exemplar {
2591 /// Value of the exemplar point. This value determines to which bucket the
2592 /// exemplar belongs.
2593 #[prost(double, tag = "1")]
2594 pub value: f64,
2595 /// The observation (sampling) time of the above value.
2596 #[prost(message, optional, tag = "2")]
2597 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
2598 /// Contextual information about the example value. Examples are:
2599 ///
2600 /// Trace: type.googleapis.com/google.monitoring.v3.SpanContext
2601 ///
2602 /// Literal string: type.googleapis.com/google.protobuf.StringValue
2603 ///
2604 /// Labels dropped during aggregation:
2605 /// type.googleapis.com/google.monitoring.v3.DroppedLabels
2606 ///
2607 /// There may be only a single attachment of any given message type in a
2608 /// single exemplar, and this is enforced by the system.
2609 #[prost(message, repeated, tag = "3")]
2610 pub attachments: ::prost::alloc::vec::Vec<::prost_types::Any>,
2611 }
2612}
2613/// `Documentation` provides the information for describing a service.
2614///
2615/// Example:
2616///
2617/// <pre><code>documentation:
2618/// summary: >
2619/// The Google Calendar API gives access
2620/// to most calendar features.
2621/// pages:
2622/// - name: Overview
2623/// content: (== include google/foo/overview.md ==)
2624/// - name: Tutorial
2625/// content: (== include google/foo/tutorial.md ==)
2626/// subpages:
2627/// - name: Java
2628/// content: (== include google/foo/tutorial_java.md ==)
2629/// rules:
2630/// - selector: google.calendar.Calendar.Get
2631/// description: >
2632/// ...
2633/// - selector: google.calendar.Calendar.Put
2634/// description: >
2635/// ...
2636/// </code></pre>
2637///
2638/// Documentation is provided in markdown syntax. In addition to
2639/// standard markdown features, definition lists, tables and fenced
2640/// code blocks are supported. Section headers can be provided and are
2641/// interpreted relative to the section nesting of the context where
2642/// a documentation fragment is embedded.
2643///
2644/// Documentation from the IDL is merged with documentation defined
2645/// via the config at normalization time, where documentation provided
2646/// by config rules overrides IDL provided.
2647///
2648/// A number of constructs specific to the API platform are supported
2649/// in documentation text.
2650///
2651/// In order to reference a proto element, the following
2652/// notation can be used:
2653///
2654/// <pre><code>[fully.qualified.proto.name][]</code></pre>
2655///
2656/// To override the display text used for the link, this can be used:
2657///
2658/// <pre><code>[display text][fully.qualified.proto.name]</code></pre>
2659///
2660/// Text can be excluded from doc using the following notation:
2661///
2662/// <pre><code>(-- internal comment --)</code></pre>
2663///
2664/// A few directives are available in documentation. Note that
2665/// directives must appear on a single line to be properly
2666/// identified. The `include` directive includes a markdown file from
2667/// an external source:
2668///
2669/// <pre><code>(== include path/to/file ==)</code></pre>
2670///
2671/// The `resource_for` directive marks a message to be the resource of
2672/// a collection in REST view. If it is not specified, tools attempt
2673/// to infer the resource from the operations in a collection:
2674///
2675/// <pre><code>(== resource_for v1.shelves.books ==)</code></pre>
2676///
2677/// The directive `suppress_warning` does not directly affect documentation
2678/// and is documented together with service config validation.
2679#[derive(Clone, PartialEq, ::prost::Message)]
2680pub struct Documentation {
2681 /// A short description of what the service does. The summary must be plain
2682 /// text. It becomes the overview of the service displayed in Google Cloud
2683 /// Console.
2684 /// NOTE: This field is equivalent to the standard field `description`.
2685 #[prost(string, tag = "1")]
2686 pub summary: ::prost::alloc::string::String,
2687 /// The top level pages for the documentation set.
2688 #[prost(message, repeated, tag = "5")]
2689 pub pages: ::prost::alloc::vec::Vec<Page>,
2690 /// A list of documentation rules that apply to individual API elements.
2691 ///
2692 /// **NOTE:** All service configuration rules follow "last one wins" order.
2693 #[prost(message, repeated, tag = "3")]
2694 pub rules: ::prost::alloc::vec::Vec<DocumentationRule>,
2695 /// The URL to the root of documentation.
2696 #[prost(string, tag = "4")]
2697 pub documentation_root_url: ::prost::alloc::string::String,
2698 /// Specifies the service root url if the default one (the service name
2699 /// from the yaml file) is not suitable. This can be seen in any fully
2700 /// specified service urls as well as sections that show a base that other
2701 /// urls are relative to.
2702 #[prost(string, tag = "6")]
2703 pub service_root_url: ::prost::alloc::string::String,
2704 /// Declares a single overview page. For example:
2705 ///
2706 /// <pre><code>documentation:
2707 /// summary: ...
2708 /// overview: (== include overview.md ==)
2709 /// </code></pre>
2710 ///
2711 /// This is a shortcut for the following declaration (using pages style):
2712 ///
2713 /// <pre><code>documentation:
2714 /// summary: ...
2715 /// pages:
2716 /// - name: Overview
2717 /// content: (== include overview.md ==)
2718 /// </code></pre>
2719 ///
2720 /// Note: you cannot specify both `overview` field and `pages` field.
2721 #[prost(string, tag = "2")]
2722 pub overview: ::prost::alloc::string::String,
2723}
2724/// A documentation rule provides information about individual API elements.
2725#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2726pub struct DocumentationRule {
2727 /// The selector is a comma-separated list of patterns for any element such as
2728 /// a method, a field, an enum value. Each pattern is a qualified name of the
2729 /// element which may end in "*", indicating a wildcard. Wildcards are only
2730 /// allowed at the end and for a whole component of the qualified name,
2731 /// i.e. "foo.*" is ok, but not "foo.b\*" or "foo.*.bar". A wildcard will match
2732 /// one or more components. To specify a default for all applicable elements,
2733 /// the whole pattern "*" is used.
2734 #[prost(string, tag = "1")]
2735 pub selector: ::prost::alloc::string::String,
2736 /// Description of the selected proto element (e.g. a message, a method, a
2737 /// 'service' definition, or a field). Defaults to leading & trailing comments
2738 /// taken from the proto source definition of the proto element.
2739 #[prost(string, tag = "2")]
2740 pub description: ::prost::alloc::string::String,
2741 /// Deprecation description of the selected element(s). It can be provided if
2742 /// an element is marked as `deprecated`.
2743 #[prost(string, tag = "3")]
2744 pub deprecation_description: ::prost::alloc::string::String,
2745}
2746/// Represents a documentation page. A page can contain subpages to represent
2747/// nested documentation set structure.
2748#[derive(Clone, PartialEq, ::prost::Message)]
2749pub struct Page {
2750 /// The name of the page. It will be used as an identity of the page to
2751 /// generate URI of the page, text of the link to this page in navigation,
2752 /// etc. The full page name (start from the root page name to this page
2753 /// concatenated with `.`) can be used as reference to the page in your
2754 /// documentation. For example:
2755 ///
2756 /// <pre><code>pages:
2757 /// - name: Tutorial
2758 /// content: (== include tutorial.md ==)
2759 /// subpages:
2760 /// - name: Java
2761 /// content: (== include tutorial_java.md ==)
2762 /// </code></pre>
2763 ///
2764 /// You can reference `Java` page using Markdown reference link syntax:
2765 /// `[Java][Tutorial.Java]`.
2766 #[prost(string, tag = "1")]
2767 pub name: ::prost::alloc::string::String,
2768 /// The Markdown content of the page. You can use `(== include {path} ==)` to include content from a Markdown file. The content can be used
2769 /// to produce the documentation page such as HTML format page.
2770 #[prost(string, tag = "2")]
2771 pub content: ::prost::alloc::string::String,
2772 /// Subpages of this page. The order of subpages specified here will be
2773 /// honored in the generated docset.
2774 #[prost(message, repeated, tag = "3")]
2775 pub subpages: ::prost::alloc::vec::Vec<Page>,
2776}
2777/// `Endpoint` describes a network address of a service that serves a set of
2778/// APIs. It is commonly known as a service endpoint. A service may expose
2779/// any number of service endpoints, and all service endpoints share the same
2780/// service definition, such as quota limits and monitoring metrics.
2781///
2782/// Example:
2783///
2784/// ```text
2785/// type: google.api.Service
2786/// name: library-example.googleapis.com
2787/// endpoints:
2788/// # Declares network address `<https://library-example.googleapis.com`>
2789/// # for service `library-example.googleapis.com`. The `https` scheme
2790/// # is implicit for all service endpoints. Other schemes may be
2791/// # supported in the future.
2792/// - name: library-example.googleapis.com
2793/// allow_cors: false
2794/// - name: content-staging-library-example.googleapis.com
2795/// # Allows HTTP OPTIONS calls to be passed to the API frontend, for it
2796/// # to decide whether the subsequent cross-origin request is allowed
2797/// # to proceed.
2798/// allow_cors: true
2799/// ```
2800#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2801pub struct Endpoint {
2802 /// The canonical name of this endpoint.
2803 #[prost(string, tag = "1")]
2804 pub name: ::prost::alloc::string::String,
2805 /// Aliases for this endpoint, these will be served by the same UrlMap as the
2806 /// parent endpoint, and will be provisioned in the GCP stack for the Regional
2807 /// Endpoints.
2808 #[prost(string, repeated, tag = "2")]
2809 pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2810 /// The specification of an Internet routable address of API frontend that will
2811 /// handle requests to this [API
2812 /// Endpoint](<https://cloud.google.com/apis/design/glossary>). It should be
2813 /// either a valid IPv4 address or a fully-qualified domain name. For example,
2814 /// "8.8.8.8" or "myservice.appspot.com".
2815 #[prost(string, tag = "101")]
2816 pub target: ::prost::alloc::string::String,
2817 /// Allowing
2818 /// [CORS](<https://en.wikipedia.org/wiki/Cross-origin_resource_sharing>), aka
2819 /// cross-domain traffic, would allow the backends served from this endpoint to
2820 /// receive and respond to HTTP OPTIONS requests. The response will be used by
2821 /// the browser to determine whether the subsequent cross-origin request is
2822 /// allowed to proceed.
2823 #[prost(bool, tag = "5")]
2824 pub allow_cors: bool,
2825}
2826/// Defines the supported values for `google.rpc.ErrorInfo.reason` for the
2827/// `googleapis.com` error domain. This error domain is reserved for [Service
2828/// Infrastructure](<https://cloud.google.com/service-infrastructure/docs/overview>).
2829/// For each error info of this domain, the metadata key "service" refers to the
2830/// logical identifier of an API service, such as "pubsub.googleapis.com". The
2831/// "consumer" refers to the entity that consumes an API Service. It typically is
2832/// a Google project that owns the client application or the server resource,
2833/// such as "projects/123". Other metadata keys are specific to each error
2834/// reason. For more information, see the definition of the specific error
2835/// reason.
2836#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2837#[repr(i32)]
2838pub enum ErrorReason {
2839 /// Do not use this default value.
2840 Unspecified = 0,
2841 /// The request is calling a disabled service for a consumer.
2842 ///
2843 /// Example of an ErrorInfo when the consumer "projects/123" contacting
2844 /// "pubsub.googleapis.com" service which is disabled:
2845 ///
2846 /// ```text
2847 /// { "reason": "SERVICE_DISABLED",
2848 /// "domain": "googleapis.com",
2849 /// "metadata": {
2850 /// "consumer": "projects/123",
2851 /// "service": "pubsub.googleapis.com"
2852 /// }
2853 /// }
2854 /// ```
2855 ///
2856 /// This response indicates the "pubsub.googleapis.com" has been disabled in
2857 /// "projects/123".
2858 ServiceDisabled = 1,
2859 /// The request whose associated billing account is disabled.
2860 ///
2861 /// Example of an ErrorInfo when the consumer "projects/123" fails to contact
2862 /// "pubsub.googleapis.com" service because the associated billing account is
2863 /// disabled:
2864 ///
2865 /// ```text
2866 /// { "reason": "BILLING_DISABLED",
2867 /// "domain": "googleapis.com",
2868 /// "metadata": {
2869 /// "consumer": "projects/123",
2870 /// "service": "pubsub.googleapis.com"
2871 /// }
2872 /// }
2873 /// ```
2874 ///
2875 /// This response indicates the billing account associated has been disabled.
2876 BillingDisabled = 2,
2877 /// The request is denied because the provided [API
2878 /// key](<https://cloud.google.com/docs/authentication/api-keys>) is invalid. It
2879 /// may be in a bad format, cannot be found, or has been expired).
2880 ///
2881 /// Example of an ErrorInfo when the request is contacting
2882 /// "storage.googleapis.com" service with an invalid API key:
2883 ///
2884 /// ```text
2885 /// { "reason": "API_KEY_INVALID",
2886 /// "domain": "googleapis.com",
2887 /// "metadata": {
2888 /// "service": "storage.googleapis.com",
2889 /// }
2890 /// }
2891 /// ```
2892 ApiKeyInvalid = 3,
2893 /// The request is denied because it violates [API key API
2894 /// restrictions](<https://cloud.google.com/docs/authentication/api-keys#adding_api_restrictions>).
2895 ///
2896 /// Example of an ErrorInfo when the consumer "projects/123" fails to call the
2897 /// "storage.googleapis.com" service because this service is restricted in the
2898 /// API key:
2899 ///
2900 /// ```text
2901 /// { "reason": "API_KEY_SERVICE_BLOCKED",
2902 /// "domain": "googleapis.com",
2903 /// "metadata": {
2904 /// "consumer": "projects/123",
2905 /// "service": "storage.googleapis.com"
2906 /// }
2907 /// }
2908 /// ```
2909 ApiKeyServiceBlocked = 4,
2910 /// The request is denied because it violates [API key HTTP
2911 /// restrictions](<https://cloud.google.com/docs/authentication/api-keys#adding_http_restrictions>).
2912 ///
2913 /// Example of an ErrorInfo when the consumer "projects/123" fails to call
2914 /// "storage.googleapis.com" service because the http referrer of the request
2915 /// violates API key HTTP restrictions:
2916 ///
2917 /// ```text
2918 /// { "reason": "API_KEY_HTTP_REFERRER_BLOCKED",
2919 /// "domain": "googleapis.com",
2920 /// "metadata": {
2921 /// "consumer": "projects/123",
2922 /// "service": "storage.googleapis.com",
2923 /// }
2924 /// }
2925 /// ```
2926 ApiKeyHttpReferrerBlocked = 7,
2927 /// The request is denied because it violates [API key IP address
2928 /// restrictions](<https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions>).
2929 ///
2930 /// Example of an ErrorInfo when the consumer "projects/123" fails to call
2931 /// "storage.googleapis.com" service because the caller IP of the request
2932 /// violates API key IP address restrictions:
2933 ///
2934 /// ```text
2935 /// { "reason": "API_KEY_IP_ADDRESS_BLOCKED",
2936 /// "domain": "googleapis.com",
2937 /// "metadata": {
2938 /// "consumer": "projects/123",
2939 /// "service": "storage.googleapis.com",
2940 /// }
2941 /// }
2942 /// ```
2943 ApiKeyIpAddressBlocked = 8,
2944 /// The request is denied because it violates [API key Android application
2945 /// restrictions](<https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions>).
2946 ///
2947 /// Example of an ErrorInfo when the consumer "projects/123" fails to call
2948 /// "storage.googleapis.com" service because the request from the Android apps
2949 /// violates the API key Android application restrictions:
2950 ///
2951 /// ```text
2952 /// { "reason": "API_KEY_ANDROID_APP_BLOCKED",
2953 /// "domain": "googleapis.com",
2954 /// "metadata": {
2955 /// "consumer": "projects/123",
2956 /// "service": "storage.googleapis.com"
2957 /// }
2958 /// }
2959 /// ```
2960 ApiKeyAndroidAppBlocked = 9,
2961 /// The request is denied because it violates [API key iOS application
2962 /// restrictions](<https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions>).
2963 ///
2964 /// Example of an ErrorInfo when the consumer "projects/123" fails to call
2965 /// "storage.googleapis.com" service because the request from the iOS apps
2966 /// violates the API key iOS application restrictions:
2967 ///
2968 /// ```text
2969 /// { "reason": "API_KEY_IOS_APP_BLOCKED",
2970 /// "domain": "googleapis.com",
2971 /// "metadata": {
2972 /// "consumer": "projects/123",
2973 /// "service": "storage.googleapis.com"
2974 /// }
2975 /// }
2976 /// ```
2977 ApiKeyIosAppBlocked = 13,
2978 /// The request is denied because there is not enough rate quota for the
2979 /// consumer.
2980 ///
2981 /// Example of an ErrorInfo when the consumer "projects/123" fails to contact
2982 /// "pubsub.googleapis.com" service because consumer's rate quota usage has
2983 /// reached the maximum value set for the quota limit
2984 /// "ReadsPerMinutePerProject" on the quota metric
2985 /// "pubsub.googleapis.com/read_requests":
2986 ///
2987 /// ```text
2988 /// { "reason": "RATE_LIMIT_EXCEEDED",
2989 /// "domain": "googleapis.com",
2990 /// "metadata": {
2991 /// "consumer": "projects/123",
2992 /// "service": "pubsub.googleapis.com",
2993 /// "quota_metric": "pubsub.googleapis.com/read_requests",
2994 /// "quota_limit": "ReadsPerMinutePerProject"
2995 /// }
2996 /// }
2997 /// ```
2998 ///
2999 /// Example of an ErrorInfo when the consumer "projects/123" checks quota on
3000 /// the service "dataflow.googleapis.com" and hits the organization quota
3001 /// limit "DefaultRequestsPerMinutePerOrganization" on the metric
3002 /// "dataflow.googleapis.com/default_requests".
3003 ///
3004 /// ```text
3005 /// { "reason": "RATE_LIMIT_EXCEEDED",
3006 /// "domain": "googleapis.com",
3007 /// "metadata": {
3008 /// "consumer": "projects/123",
3009 /// "service": "dataflow.googleapis.com",
3010 /// "quota_metric": "dataflow.googleapis.com/default_requests",
3011 /// "quota_limit": "DefaultRequestsPerMinutePerOrganization"
3012 /// }
3013 /// }
3014 /// ```
3015 RateLimitExceeded = 5,
3016 /// The request is denied because there is not enough resource quota for the
3017 /// consumer.
3018 ///
3019 /// Example of an ErrorInfo when the consumer "projects/123" fails to contact
3020 /// "compute.googleapis.com" service because consumer's resource quota usage
3021 /// has reached the maximum value set for the quota limit "VMsPerProject"
3022 /// on the quota metric "compute.googleapis.com/vms":
3023 ///
3024 /// ```text
3025 /// { "reason": "RESOURCE_QUOTA_EXCEEDED",
3026 /// "domain": "googleapis.com",
3027 /// "metadata": {
3028 /// "consumer": "projects/123",
3029 /// "service": "compute.googleapis.com",
3030 /// "quota_metric": "compute.googleapis.com/vms",
3031 /// "quota_limit": "VMsPerProject"
3032 /// }
3033 /// }
3034 /// ```
3035 ///
3036 /// Example of an ErrorInfo when the consumer "projects/123" checks resource
3037 /// quota on the service "dataflow.googleapis.com" and hits the organization
3038 /// quota limit "jobs-per-organization" on the metric
3039 /// "dataflow.googleapis.com/job_count".
3040 ///
3041 /// ```text
3042 /// { "reason": "RESOURCE_QUOTA_EXCEEDED",
3043 /// "domain": "googleapis.com",
3044 /// "metadata": {
3045 /// "consumer": "projects/123",
3046 /// "service": "dataflow.googleapis.com",
3047 /// "quota_metric": "dataflow.googleapis.com/job_count",
3048 /// "quota_limit": "jobs-per-organization"
3049 /// }
3050 /// }
3051 /// ```
3052 ResourceQuotaExceeded = 6,
3053 /// The request whose associated billing account address is in a tax restricted
3054 /// location, violates the local tax restrictions when creating resources in
3055 /// the restricted region.
3056 ///
3057 /// Example of an ErrorInfo when creating the Cloud Storage Bucket in the
3058 /// container "projects/123" under a tax restricted region
3059 /// "locations/asia-northeast3":
3060 ///
3061 /// ```text
3062 /// { "reason": "LOCATION_TAX_POLICY_VIOLATED",
3063 /// "domain": "googleapis.com",
3064 /// "metadata": {
3065 /// "consumer": "projects/123",
3066 /// "service": "storage.googleapis.com",
3067 /// "location": "locations/asia-northeast3"
3068 /// }
3069 /// }
3070 /// ```
3071 ///
3072 /// This response indicates creating the Cloud Storage Bucket in
3073 /// "locations/asia-northeast3" violates the location tax restriction.
3074 LocationTaxPolicyViolated = 10,
3075 /// The request is denied because the caller does not have required permission
3076 /// on the user project "projects/123" or the user project is invalid. For more
3077 /// information, check the [userProject System
3078 /// Parameters](<https://cloud.google.com/apis/docs/system-parameters>).
3079 ///
3080 /// Example of an ErrorInfo when the caller is calling Cloud Storage service
3081 /// with insufficient permissions on the user project:
3082 ///
3083 /// ```text
3084 /// { "reason": "USER_PROJECT_DENIED",
3085 /// "domain": "googleapis.com",
3086 /// "metadata": {
3087 /// "consumer": "projects/123",
3088 /// "service": "storage.googleapis.com"
3089 /// }
3090 /// }
3091 /// ```
3092 UserProjectDenied = 11,
3093 /// The request is denied because the consumer "projects/123" is suspended due
3094 /// to Terms of Service(Tos) violations. Check [Project suspension
3095 /// guidelines](<https://cloud.google.com/resource-manager/docs/project-suspension-guidelines>)
3096 /// for more information.
3097 ///
3098 /// Example of an ErrorInfo when calling Cloud Storage service with the
3099 /// suspended consumer "projects/123":
3100 ///
3101 /// ```text
3102 /// { "reason": "CONSUMER_SUSPENDED",
3103 /// "domain": "googleapis.com",
3104 /// "metadata": {
3105 /// "consumer": "projects/123",
3106 /// "service": "storage.googleapis.com"
3107 /// }
3108 /// }
3109 /// ```
3110 ConsumerSuspended = 12,
3111 /// The request is denied because the associated consumer is invalid. It may be
3112 /// in a bad format, cannot be found, or have been deleted.
3113 ///
3114 /// Example of an ErrorInfo when calling Cloud Storage service with the
3115 /// invalid consumer "projects/123":
3116 ///
3117 /// ```text
3118 /// { "reason": "CONSUMER_INVALID",
3119 /// "domain": "googleapis.com",
3120 /// "metadata": {
3121 /// "consumer": "projects/123",
3122 /// "service": "storage.googleapis.com"
3123 /// }
3124 /// }
3125 /// ```
3126 ConsumerInvalid = 14,
3127 /// The request is denied because it violates [VPC Service
3128 /// Controls](<https://cloud.google.com/vpc-service-controls/docs/overview>).
3129 /// The 'uid' field is a random generated identifier that customer can use it
3130 /// to search the audit log for a request rejected by VPC Service Controls. For
3131 /// more information, please refer [VPC Service Controls
3132 /// Troubleshooting](<https://cloud.google.com/vpc-service-controls/docs/troubleshooting#unique-id>)
3133 ///
3134 /// Example of an ErrorInfo when the consumer "projects/123" fails to call
3135 /// Cloud Storage service because the request is prohibited by the VPC Service
3136 /// Controls.
3137 ///
3138 /// ```text
3139 /// { "reason": "SECURITY_POLICY_VIOLATED",
3140 /// "domain": "googleapis.com",
3141 /// "metadata": {
3142 /// "uid": "123456789abcde",
3143 /// "consumer": "projects/123",
3144 /// "service": "storage.googleapis.com"
3145 /// }
3146 /// }
3147 /// ```
3148 SecurityPolicyViolated = 15,
3149 /// The request is denied because the provided access token has expired.
3150 ///
3151 /// Example of an ErrorInfo when the request is calling Cloud Storage service
3152 /// with an expired access token:
3153 ///
3154 /// ```text
3155 /// { "reason": "ACCESS_TOKEN_EXPIRED",
3156 /// "domain": "googleapis.com",
3157 /// "metadata": {
3158 /// "service": "storage.googleapis.com",
3159 /// "method": "google.storage.v1.Storage.GetObject"
3160 /// }
3161 /// }
3162 /// ```
3163 AccessTokenExpired = 16,
3164 /// The request is denied because the provided access token doesn't have at
3165 /// least one of the acceptable scopes required for the API. Please check
3166 /// [OAuth 2.0 Scopes for Google
3167 /// APIs](<https://developers.google.com/identity/protocols/oauth2/scopes>) for
3168 /// the list of the OAuth 2.0 scopes that you might need to request to access
3169 /// the API.
3170 ///
3171 /// Example of an ErrorInfo when the request is calling Cloud Storage service
3172 /// with an access token that is missing required scopes:
3173 ///
3174 /// ```text
3175 /// { "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
3176 /// "domain": "googleapis.com",
3177 /// "metadata": {
3178 /// "service": "storage.googleapis.com",
3179 /// "method": "google.storage.v1.Storage.GetObject"
3180 /// }
3181 /// }
3182 /// ```
3183 AccessTokenScopeInsufficient = 17,
3184 /// The request is denied because the account associated with the provided
3185 /// access token is in an invalid state, such as disabled or deleted.
3186 /// For more information, see <https://cloud.google.com/docs/authentication.>
3187 ///
3188 /// Warning: For privacy reasons, the server may not be able to disclose the
3189 /// email address for some accounts. The client MUST NOT depend on the
3190 /// availability of the `email` attribute.
3191 ///
3192 /// Example of an ErrorInfo when the request is to the Cloud Storage API with
3193 /// an access token that is associated with a disabled or deleted [service
3194 /// account](<http://cloud/iam/docs/service-accounts>):
3195 ///
3196 /// ```text
3197 /// { "reason": "ACCOUNT_STATE_INVALID",
3198 /// "domain": "googleapis.com",
3199 /// "metadata": {
3200 /// "service": "storage.googleapis.com",
3201 /// "method": "google.storage.v1.Storage.GetObject",
3202 /// "email": "user@123.iam.gserviceaccount.com"
3203 /// }
3204 /// }
3205 /// ```
3206 AccountStateInvalid = 18,
3207 /// The request is denied because the type of the provided access token is not
3208 /// supported by the API being called.
3209 ///
3210 /// Example of an ErrorInfo when the request is to the Cloud Storage API with
3211 /// an unsupported token type.
3212 ///
3213 /// ```text
3214 /// { "reason": "ACCESS_TOKEN_TYPE_UNSUPPORTED",
3215 /// "domain": "googleapis.com",
3216 /// "metadata": {
3217 /// "service": "storage.googleapis.com",
3218 /// "method": "google.storage.v1.Storage.GetObject"
3219 /// }
3220 /// }
3221 /// ```
3222 AccessTokenTypeUnsupported = 19,
3223 /// The request is denied because the request doesn't have any authentication
3224 /// credentials. For more information regarding the supported authentication
3225 /// strategies for Google Cloud APIs, see
3226 /// <https://cloud.google.com/docs/authentication.>
3227 ///
3228 /// Example of an ErrorInfo when the request is to the Cloud Storage API
3229 /// without any authentication credentials.
3230 ///
3231 /// ```text
3232 /// { "reason": "CREDENTIALS_MISSING",
3233 /// "domain": "googleapis.com",
3234 /// "metadata": {
3235 /// "service": "storage.googleapis.com",
3236 /// "method": "google.storage.v1.Storage.GetObject"
3237 /// }
3238 /// }
3239 /// ```
3240 CredentialsMissing = 20,
3241 /// The request is denied because the provided project owning the resource
3242 /// which acts as the [API
3243 /// consumer](<https://cloud.google.com/apis/design/glossary#api_consumer>) is
3244 /// invalid. It may be in a bad format or empty.
3245 ///
3246 /// Example of an ErrorInfo when the request is to the Cloud Functions API,
3247 /// but the offered resource project in the request in a bad format which can't
3248 /// perform the ListFunctions method.
3249 ///
3250 /// ```text
3251 /// { "reason": "RESOURCE_PROJECT_INVALID",
3252 /// "domain": "googleapis.com",
3253 /// "metadata": {
3254 /// "service": "cloudfunctions.googleapis.com",
3255 /// "method":
3256 /// "google.cloud.functions.v1.CloudFunctionsService.ListFunctions"
3257 /// }
3258 /// }
3259 /// ```
3260 ResourceProjectInvalid = 21,
3261 /// The request is denied because the provided session cookie is missing,
3262 /// invalid or failed to decode.
3263 ///
3264 /// Example of an ErrorInfo when the request is calling Cloud Storage service
3265 /// with a SID cookie which can't be decoded.
3266 ///
3267 /// ```text
3268 /// { "reason": "SESSION_COOKIE_INVALID",
3269 /// "domain": "googleapis.com",
3270 /// "metadata": {
3271 /// "service": "storage.googleapis.com",
3272 /// "method": "google.storage.v1.Storage.GetObject",
3273 /// "cookie": "SID"
3274 /// }
3275 /// }
3276 /// ```
3277 SessionCookieInvalid = 23,
3278 /// The request is denied because the user is from a Google Workspace customer
3279 /// that blocks their users from accessing a particular service.
3280 ///
3281 /// Example scenario: <https://support.google.com/a/answer/9197205?hl=en>
3282 ///
3283 /// Example of an ErrorInfo when access to Google Cloud Storage service is
3284 /// blocked by the Google Workspace administrator:
3285 ///
3286 /// ```text
3287 /// { "reason": "USER_BLOCKED_BY_ADMIN",
3288 /// "domain": "googleapis.com",
3289 /// "metadata": {
3290 /// "service": "storage.googleapis.com",
3291 /// "method": "google.storage.v1.Storage.GetObject",
3292 /// }
3293 /// }
3294 /// ```
3295 UserBlockedByAdmin = 24,
3296 /// The request is denied because the resource service usage is restricted
3297 /// by administrators according to the organization policy constraint.
3298 /// For more information see
3299 /// <https://cloud.google.com/resource-manager/docs/organization-policy/restricting-services.>
3300 ///
3301 /// Example of an ErrorInfo when access to Google Cloud Storage service is
3302 /// restricted by Resource Usage Restriction policy:
3303 ///
3304 /// ```text
3305 /// { "reason": "RESOURCE_USAGE_RESTRICTION_VIOLATED",
3306 /// "domain": "googleapis.com",
3307 /// "metadata": {
3308 /// "consumer": "projects/project-123",
3309 /// "service": "storage.googleapis.com"
3310 /// }
3311 /// }
3312 /// ```
3313 ResourceUsageRestrictionViolated = 25,
3314 /// Unimplemented. Do not use.
3315 ///
3316 /// The request is denied because it contains unsupported system parameters in
3317 /// URL query parameters or HTTP headers. For more information,
3318 /// see <https://cloud.google.com/apis/docs/system-parameters>
3319 ///
3320 /// Example of an ErrorInfo when access "pubsub.googleapis.com" service with
3321 /// a request header of "x-goog-user-ip":
3322 ///
3323 /// ```text
3324 /// { "reason": "SYSTEM_PARAMETER_UNSUPPORTED",
3325 /// "domain": "googleapis.com",
3326 /// "metadata": {
3327 /// "service": "pubsub.googleapis.com"
3328 /// "parameter": "x-goog-user-ip"
3329 /// }
3330 /// }
3331 /// ```
3332 SystemParameterUnsupported = 26,
3333 /// The request is denied because it violates Org Restriction: the requested
3334 /// resource does not belong to allowed organizations specified in
3335 /// "X-Goog-Allowed-Resources" header.
3336 ///
3337 /// Example of an ErrorInfo when accessing a GCP resource that is restricted by
3338 /// Org Restriction for "pubsub.googleapis.com" service.
3339 ///
3340 /// {
3341 /// reason: "ORG_RESTRICTION_VIOLATION"
3342 /// domain: "googleapis.com"
3343 /// metadata {
3344 /// "consumer":"projects/123456"
3345 /// "service": "pubsub.googleapis.com"
3346 /// }
3347 /// }
3348 OrgRestrictionViolation = 27,
3349 /// The request is denied because "X-Goog-Allowed-Resources" header is in a bad
3350 /// format.
3351 ///
3352 /// Example of an ErrorInfo when
3353 /// accessing "pubsub.googleapis.com" service with an invalid
3354 /// "X-Goog-Allowed-Resources" request header.
3355 ///
3356 /// {
3357 /// reason: "ORG_RESTRICTION_HEADER_INVALID"
3358 /// domain: "googleapis.com"
3359 /// metadata {
3360 /// "consumer":"projects/123456"
3361 /// "service": "pubsub.googleapis.com"
3362 /// }
3363 /// }
3364 OrgRestrictionHeaderInvalid = 28,
3365 /// Unimplemented. Do not use.
3366 ///
3367 /// The request is calling a service that is not visible to the consumer.
3368 ///
3369 /// Example of an ErrorInfo when the consumer "projects/123" contacting
3370 /// "pubsub.googleapis.com" service which is not visible to the consumer.
3371 ///
3372 /// ```text
3373 /// { "reason": "SERVICE_NOT_VISIBLE",
3374 /// "domain": "googleapis.com",
3375 /// "metadata": {
3376 /// "consumer": "projects/123",
3377 /// "service": "pubsub.googleapis.com"
3378 /// }
3379 /// }
3380 /// ```
3381 ///
3382 /// This response indicates the "pubsub.googleapis.com" is not visible to
3383 /// "projects/123" (or it may not exist).
3384 ServiceNotVisible = 29,
3385 /// The request is related to a project for which GCP access is suspended.
3386 ///
3387 /// Example of an ErrorInfo when the consumer "projects/123" fails to contact
3388 /// "pubsub.googleapis.com" service because GCP access is suspended:
3389 ///
3390 /// ```text
3391 /// { "reason": "GCP_SUSPENDED",
3392 /// "domain": "googleapis.com",
3393 /// "metadata": {
3394 /// "consumer": "projects/123",
3395 /// "service": "pubsub.googleapis.com"
3396 /// }
3397 /// }
3398 /// ```
3399 ///
3400 /// This response indicates the associated GCP account has been suspended.
3401 GcpSuspended = 30,
3402 /// The request violates the location policies when creating resources in
3403 /// the restricted region.
3404 ///
3405 /// Example of an ErrorInfo when creating the Cloud Storage Bucket by
3406 /// "projects/123" for service storage.googleapis.com:
3407 ///
3408 /// ```text
3409 /// { "reason": "LOCATION_POLICY_VIOLATED",
3410 /// "domain": "googleapis.com",
3411 /// "metadata": {
3412 /// "consumer": "projects/123",
3413 /// "service": "storage.googleapis.com",
3414 /// }
3415 /// }
3416 /// ```
3417 ///
3418 /// This response indicates creating the Cloud Storage Bucket in
3419 /// "locations/asia-northeast3" violates at least one location policy.
3420 /// The troubleshooting guidance is provided in the Help links.
3421 LocationPolicyViolated = 31,
3422 /// The request is denied because origin request header is missing.
3423 ///
3424 /// Example of an ErrorInfo when
3425 /// accessing "pubsub.googleapis.com" service with an empty "Origin" request
3426 /// header.
3427 ///
3428 /// {
3429 /// reason: "MISSING_ORIGIN"
3430 /// domain: "googleapis.com"
3431 /// metadata {
3432 /// "consumer":"projects/123456"
3433 /// "service": "pubsub.googleapis.com"
3434 /// }
3435 /// }
3436 MissingOrigin = 33,
3437 /// The request is denied because the request contains more than one credential
3438 /// type that are individually acceptable, but not together. The customer
3439 /// should retry their request with only one set of credentials.
3440 ///
3441 /// Example of an ErrorInfo when
3442 /// accessing "pubsub.googleapis.com" service with overloaded credentials.
3443 ///
3444 /// {
3445 /// reason: "OVERLOADED_CREDENTIALS"
3446 /// domain: "googleapis.com"
3447 /// metadata {
3448 /// "consumer":"projects/123456"
3449 /// "service": "pubsub.googleapis.com"
3450 /// }
3451 /// }
3452 OverloadedCredentials = 34,
3453 /// The request whose associated location violates the location org policy
3454 /// restrictions when creating resources in the restricted region.
3455 ///
3456 /// Example of an ErrorInfo when creating the Cloud Storage Bucket in the
3457 /// container "projects/123" under a restricted region
3458 /// "locations/asia-northeast3":
3459 ///
3460 /// ```text
3461 /// {
3462 /// "reason": "LOCATION_ORG_POLICY_VIOLATED",
3463 /// "domain": "googleapis.com",
3464 /// "metadata": {
3465 /// "resource": "projects/123",
3466 /// "location": "locations/asia-northeast3"
3467 /// }
3468 /// }
3469 /// ```
3470 ///
3471 /// This response indicates creating the Cloud Storage Bucket in
3472 /// "locations/asia-northeast3" violates the location org policy restriction.
3473 LocationOrgPolicyViolated = 35,
3474 /// The request is denied because it access data of regulated customers using
3475 /// TLS 1.0 and 1.1.
3476 ///
3477 /// Example of an ErrorInfo when accessing a GCP resource "projects/123" that
3478 /// is restricted by TLS Version Restriction for "pubsub.googleapis.com"
3479 /// service.
3480 ///
3481 /// ```text
3482 /// {
3483 /// "reason": "TLS_ORG_POLICY_VIOLATED",
3484 /// "domain": "googleapis.com",
3485 /// "metadata": {
3486 /// "service": "pubsub.googleapis.com"
3487 /// "resource": "projects/123",
3488 /// "policyName": "constraints/gcp.restrictTLSVersion",
3489 /// "tlsVersion": "TLS_VERSION_1"
3490 /// }
3491 /// }
3492 /// ```
3493 TlsOrgPolicyViolated = 36,
3494 /// The request is denied because the associated project has exceeded the
3495 /// emulator quota limit.
3496 ///
3497 /// Example of an ErrorInfo when the associated "projects/123" has exceeded the
3498 /// emulator quota limit.
3499 ///
3500 /// ```text
3501 /// {
3502 /// "reason": "EMULATOR_QUOTA_EXCEEDED",
3503 /// "domain": "googleapis.com",
3504 /// "metadata": {
3505 /// "service": "pubsub.googleapis.com"
3506 /// "consumer": "projects/123"
3507 /// }
3508 /// }
3509 /// ```
3510 EmulatorQuotaExceeded = 38,
3511 /// The request is denied because the associated application credential header
3512 /// is invalid for an Android applications.
3513 ///
3514 /// Example of an ErrorInfo when the request from an Android application to the
3515 /// "pubsub.googleapis.com" with an invalid application credential header.
3516 ///
3517 /// ```text
3518 /// {
3519 /// "reason": "CREDENTIAL_ANDROID_APP_INVALID",
3520 /// "domain": "googleapis.com",
3521 /// "metadata": {
3522 /// "service": "pubsub.googleapis.com"
3523 /// }
3524 /// }
3525 /// ```
3526 CredentialAndroidAppInvalid = 39,
3527 /// The request is denied because IAM permission on resource is denied.
3528 ///
3529 /// Example of an ErrorInfo when the IAM permission `aiplatform.datasets.list`
3530 /// is denied on resource `projects/123`.
3531 ///
3532 /// ```text
3533 /// {
3534 /// "reason": "IAM_PERMISSION_DENIED",
3535 /// "domain": "googleapis.com",
3536 /// "metadata": {
3537 /// "resource": "projects/123"
3538 /// "permission": "aiplatform.datasets.list"
3539 /// }
3540 /// }
3541 /// ```
3542 IamPermissionDenied = 41,
3543 /// The request is denied because it contains the invalid JWT token.
3544 ///
3545 /// Example of an ErrorInfo when the request contains an invalid JWT token for
3546 /// service `storage.googleapis.com`.
3547 ///
3548 /// ```text
3549 /// {
3550 /// "reason": "JWT_TOKEN_INVALID",
3551 /// "domain": "googleapis.com",
3552 /// "metadata": {
3553 /// "service": "storage.googleapis.com"
3554 /// }
3555 /// }
3556 /// ```
3557 JwtTokenInvalid = 42,
3558 /// The request is denied because it contains credential with type that is
3559 /// unsupported.
3560 ///
3561 /// Example of an ErrorInfo when the request contains an unsupported credential
3562 /// type for service `storage.googleapis.com`.
3563 ///
3564 /// ```text
3565 /// {
3566 /// "reason": "CREDENTIAL_TYPE_UNSUPPORTED",
3567 /// "domain": "googleapis.com",
3568 /// "metadata": {
3569 /// "service": "storage.googleapis.com"
3570 /// }
3571 /// }
3572 /// ```
3573 CredentialTypeUnsupported = 43,
3574 /// The request is denied because it contains unsupported account type.
3575 ///
3576 /// Example of an ErrorInfo when the request contains an unsupported account
3577 /// type for service `storage.googleapis.com`.
3578 ///
3579 /// ```text
3580 /// {
3581 /// "reason": "ACCOUNT_TYPE_UNSUPPORTED",
3582 /// "domain": "googleapis.com",
3583 /// "metadata": {
3584 /// "service": "storage.googleapis.com"
3585 /// }
3586 /// }
3587 /// ```
3588 AccountTypeUnsupported = 44,
3589 /// The request is denied because the API endpoint is restricted by
3590 /// administrators according to the organization policy constraint.
3591 /// For more information see
3592 /// <https://cloud.google.com/assured-workloads/docs/restrict-endpoint-usage.>
3593 ///
3594 /// Example of an ErrorInfo when access to Google Cloud Storage service is
3595 /// restricted by Restrict Endpoint Usage policy:
3596 ///
3597 /// ```text
3598 /// {
3599 /// "reason": "ENDPOINT_USAGE_RESTRICTION_VIOLATED",
3600 /// "domain": "googleapis.com/policies/endpointUsageRestriction",
3601 /// "metadata": {
3602 /// "policy_name": "constraints/gcp.restrictEndpointUsage",
3603 /// "checked_value": "storage.googleapis.com"
3604 /// "consumer": "organization/123"
3605 /// "service": "storage.googleapis.com"
3606 /// }
3607 /// }
3608 /// ```
3609 EndpointUsageRestrictionViolated = 45,
3610 /// The request is denied because the TLS Cipher Suite is restricted by
3611 /// administrators according to the organization policy constraint.
3612 /// For more information see
3613 /// <https://cloud.google.com/assured-workloads/docs/restrict-tls-cipher-suites>
3614 ///
3615 /// Example of an ErrorInfo when access to Google Cloud BigQuery service is
3616 /// restricted by Restrict TLS Cipher Suites policy:
3617 ///
3618 /// ```text
3619 /// {
3620 /// "reason": "TLS_CIPHER_RESTRICTION_VIOLATED",
3621 /// "domain": "googleapis.com/policies/tlsCipherRestriction",
3622 /// "metadata": {
3623 /// "policy_name": "constraints/gcp.restrictTLSCipherSuites",
3624 /// "checked_value": "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
3625 /// "consumer": "organization/123"
3626 /// "service": "bigquery.googleapis.com"
3627 /// }
3628 /// }
3629 /// ```
3630 TlsCipherRestrictionViolated = 46,
3631 /// The request is denied because the MCP activation check fails.
3632 ///
3633 /// Example of an ErrorInfo when the container "projects/123" contacting
3634 /// "pubsub.googleapis.com" service which is disabled by MCP:
3635 ///
3636 /// ```text
3637 /// { "reason": "MCP_SERVER_DISABLED",
3638 /// "domain": "googleapis.com",
3639 /// "metadata": {
3640 /// "consumer": "projects/123",
3641 /// "service": "pubsub.googleapis.com"
3642 /// }
3643 /// }
3644 /// ```
3645 ///
3646 /// This response indicates the "pubsub.googleapis.com" has been disabled in
3647 /// "projects/123" for MCP.
3648 McpServerDisabled = 47,
3649}
3650impl ErrorReason {
3651 /// String value of the enum field names used in the ProtoBuf definition.
3652 ///
3653 /// The values are not transformed in any way and thus are considered stable
3654 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3655 pub fn as_str_name(&self) -> &'static str {
3656 match self {
3657 Self::Unspecified => "ERROR_REASON_UNSPECIFIED",
3658 Self::ServiceDisabled => "SERVICE_DISABLED",
3659 Self::BillingDisabled => "BILLING_DISABLED",
3660 Self::ApiKeyInvalid => "API_KEY_INVALID",
3661 Self::ApiKeyServiceBlocked => "API_KEY_SERVICE_BLOCKED",
3662 Self::ApiKeyHttpReferrerBlocked => "API_KEY_HTTP_REFERRER_BLOCKED",
3663 Self::ApiKeyIpAddressBlocked => "API_KEY_IP_ADDRESS_BLOCKED",
3664 Self::ApiKeyAndroidAppBlocked => "API_KEY_ANDROID_APP_BLOCKED",
3665 Self::ApiKeyIosAppBlocked => "API_KEY_IOS_APP_BLOCKED",
3666 Self::RateLimitExceeded => "RATE_LIMIT_EXCEEDED",
3667 Self::ResourceQuotaExceeded => "RESOURCE_QUOTA_EXCEEDED",
3668 Self::LocationTaxPolicyViolated => "LOCATION_TAX_POLICY_VIOLATED",
3669 Self::UserProjectDenied => "USER_PROJECT_DENIED",
3670 Self::ConsumerSuspended => "CONSUMER_SUSPENDED",
3671 Self::ConsumerInvalid => "CONSUMER_INVALID",
3672 Self::SecurityPolicyViolated => "SECURITY_POLICY_VIOLATED",
3673 Self::AccessTokenExpired => "ACCESS_TOKEN_EXPIRED",
3674 Self::AccessTokenScopeInsufficient => "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
3675 Self::AccountStateInvalid => "ACCOUNT_STATE_INVALID",
3676 Self::AccessTokenTypeUnsupported => "ACCESS_TOKEN_TYPE_UNSUPPORTED",
3677 Self::CredentialsMissing => "CREDENTIALS_MISSING",
3678 Self::ResourceProjectInvalid => "RESOURCE_PROJECT_INVALID",
3679 Self::SessionCookieInvalid => "SESSION_COOKIE_INVALID",
3680 Self::UserBlockedByAdmin => "USER_BLOCKED_BY_ADMIN",
3681 Self::ResourceUsageRestrictionViolated => {
3682 "RESOURCE_USAGE_RESTRICTION_VIOLATED"
3683 }
3684 Self::SystemParameterUnsupported => "SYSTEM_PARAMETER_UNSUPPORTED",
3685 Self::OrgRestrictionViolation => "ORG_RESTRICTION_VIOLATION",
3686 Self::OrgRestrictionHeaderInvalid => "ORG_RESTRICTION_HEADER_INVALID",
3687 Self::ServiceNotVisible => "SERVICE_NOT_VISIBLE",
3688 Self::GcpSuspended => "GCP_SUSPENDED",
3689 Self::LocationPolicyViolated => "LOCATION_POLICY_VIOLATED",
3690 Self::MissingOrigin => "MISSING_ORIGIN",
3691 Self::OverloadedCredentials => "OVERLOADED_CREDENTIALS",
3692 Self::LocationOrgPolicyViolated => "LOCATION_ORG_POLICY_VIOLATED",
3693 Self::TlsOrgPolicyViolated => "TLS_ORG_POLICY_VIOLATED",
3694 Self::EmulatorQuotaExceeded => "EMULATOR_QUOTA_EXCEEDED",
3695 Self::CredentialAndroidAppInvalid => "CREDENTIAL_ANDROID_APP_INVALID",
3696 Self::IamPermissionDenied => "IAM_PERMISSION_DENIED",
3697 Self::JwtTokenInvalid => "JWT_TOKEN_INVALID",
3698 Self::CredentialTypeUnsupported => "CREDENTIAL_TYPE_UNSUPPORTED",
3699 Self::AccountTypeUnsupported => "ACCOUNT_TYPE_UNSUPPORTED",
3700 Self::EndpointUsageRestrictionViolated => {
3701 "ENDPOINT_USAGE_RESTRICTION_VIOLATED"
3702 }
3703 Self::TlsCipherRestrictionViolated => "TLS_CIPHER_RESTRICTION_VIOLATED",
3704 Self::McpServerDisabled => "MCP_SERVER_DISABLED",
3705 }
3706 }
3707 /// Creates an enum from field names used in the ProtoBuf definition.
3708 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3709 match value {
3710 "ERROR_REASON_UNSPECIFIED" => Some(Self::Unspecified),
3711 "SERVICE_DISABLED" => Some(Self::ServiceDisabled),
3712 "BILLING_DISABLED" => Some(Self::BillingDisabled),
3713 "API_KEY_INVALID" => Some(Self::ApiKeyInvalid),
3714 "API_KEY_SERVICE_BLOCKED" => Some(Self::ApiKeyServiceBlocked),
3715 "API_KEY_HTTP_REFERRER_BLOCKED" => Some(Self::ApiKeyHttpReferrerBlocked),
3716 "API_KEY_IP_ADDRESS_BLOCKED" => Some(Self::ApiKeyIpAddressBlocked),
3717 "API_KEY_ANDROID_APP_BLOCKED" => Some(Self::ApiKeyAndroidAppBlocked),
3718 "API_KEY_IOS_APP_BLOCKED" => Some(Self::ApiKeyIosAppBlocked),
3719 "RATE_LIMIT_EXCEEDED" => Some(Self::RateLimitExceeded),
3720 "RESOURCE_QUOTA_EXCEEDED" => Some(Self::ResourceQuotaExceeded),
3721 "LOCATION_TAX_POLICY_VIOLATED" => Some(Self::LocationTaxPolicyViolated),
3722 "USER_PROJECT_DENIED" => Some(Self::UserProjectDenied),
3723 "CONSUMER_SUSPENDED" => Some(Self::ConsumerSuspended),
3724 "CONSUMER_INVALID" => Some(Self::ConsumerInvalid),
3725 "SECURITY_POLICY_VIOLATED" => Some(Self::SecurityPolicyViolated),
3726 "ACCESS_TOKEN_EXPIRED" => Some(Self::AccessTokenExpired),
3727 "ACCESS_TOKEN_SCOPE_INSUFFICIENT" => Some(Self::AccessTokenScopeInsufficient),
3728 "ACCOUNT_STATE_INVALID" => Some(Self::AccountStateInvalid),
3729 "ACCESS_TOKEN_TYPE_UNSUPPORTED" => Some(Self::AccessTokenTypeUnsupported),
3730 "CREDENTIALS_MISSING" => Some(Self::CredentialsMissing),
3731 "RESOURCE_PROJECT_INVALID" => Some(Self::ResourceProjectInvalid),
3732 "SESSION_COOKIE_INVALID" => Some(Self::SessionCookieInvalid),
3733 "USER_BLOCKED_BY_ADMIN" => Some(Self::UserBlockedByAdmin),
3734 "RESOURCE_USAGE_RESTRICTION_VIOLATED" => {
3735 Some(Self::ResourceUsageRestrictionViolated)
3736 }
3737 "SYSTEM_PARAMETER_UNSUPPORTED" => Some(Self::SystemParameterUnsupported),
3738 "ORG_RESTRICTION_VIOLATION" => Some(Self::OrgRestrictionViolation),
3739 "ORG_RESTRICTION_HEADER_INVALID" => Some(Self::OrgRestrictionHeaderInvalid),
3740 "SERVICE_NOT_VISIBLE" => Some(Self::ServiceNotVisible),
3741 "GCP_SUSPENDED" => Some(Self::GcpSuspended),
3742 "LOCATION_POLICY_VIOLATED" => Some(Self::LocationPolicyViolated),
3743 "MISSING_ORIGIN" => Some(Self::MissingOrigin),
3744 "OVERLOADED_CREDENTIALS" => Some(Self::OverloadedCredentials),
3745 "LOCATION_ORG_POLICY_VIOLATED" => Some(Self::LocationOrgPolicyViolated),
3746 "TLS_ORG_POLICY_VIOLATED" => Some(Self::TlsOrgPolicyViolated),
3747 "EMULATOR_QUOTA_EXCEEDED" => Some(Self::EmulatorQuotaExceeded),
3748 "CREDENTIAL_ANDROID_APP_INVALID" => Some(Self::CredentialAndroidAppInvalid),
3749 "IAM_PERMISSION_DENIED" => Some(Self::IamPermissionDenied),
3750 "JWT_TOKEN_INVALID" => Some(Self::JwtTokenInvalid),
3751 "CREDENTIAL_TYPE_UNSUPPORTED" => Some(Self::CredentialTypeUnsupported),
3752 "ACCOUNT_TYPE_UNSUPPORTED" => Some(Self::AccountTypeUnsupported),
3753 "ENDPOINT_USAGE_RESTRICTION_VIOLATED" => {
3754 Some(Self::EndpointUsageRestrictionViolated)
3755 }
3756 "TLS_CIPHER_RESTRICTION_VIOLATED" => Some(Self::TlsCipherRestrictionViolated),
3757 "MCP_SERVER_DISABLED" => Some(Self::McpServerDisabled),
3758 _ => None,
3759 }
3760 }
3761}
3762/// Message that represents an arbitrary HTTP body. It should only be used for
3763/// payload formats that can't be represented as JSON, such as raw binary or
3764/// an HTML page.
3765///
3766/// This message can be used both in streaming and non-streaming API methods in
3767/// the request as well as the response.
3768///
3769/// It can be used as a top-level request field, which is convenient if one
3770/// wants to extract parameters from either the URL or HTTP template into the
3771/// request fields and also want access to the raw HTTP body.
3772///
3773/// Example:
3774///
3775/// ```text
3776/// message GetResourceRequest {
3777/// // A unique request id.
3778/// string request_id = 1;
3779///
3780/// // The raw HTTP body is bound to this field.
3781/// google.api.HttpBody http_body = 2;
3782///
3783/// }
3784///
3785/// service ResourceService {
3786/// rpc GetResource(GetResourceRequest)
3787/// returns (google.api.HttpBody);
3788/// rpc UpdateResource(google.api.HttpBody)
3789/// returns (google.protobuf.Empty);
3790///
3791/// }
3792/// ```
3793///
3794/// Example with streaming methods:
3795///
3796/// ```text
3797/// service CaldavService {
3798/// rpc GetCalendar(stream google.api.HttpBody)
3799/// returns (stream google.api.HttpBody);
3800/// rpc UpdateCalendar(stream google.api.HttpBody)
3801/// returns (stream google.api.HttpBody);
3802///
3803/// }
3804/// ```
3805///
3806/// Use of this type only changes how the request and response bodies are
3807/// handled, all other features will continue to work unchanged.
3808#[derive(Clone, PartialEq, ::prost::Message)]
3809pub struct HttpBody {
3810 /// The HTTP Content-Type header value specifying the content type of the body.
3811 #[prost(string, tag = "1")]
3812 pub content_type: ::prost::alloc::string::String,
3813 /// The HTTP request/response body as raw binary.
3814 #[prost(bytes = "vec", tag = "2")]
3815 pub data: ::prost::alloc::vec::Vec<u8>,
3816 /// Application specific response metadata. Must be set in the first response
3817 /// for streaming APIs.
3818 #[prost(message, repeated, tag = "3")]
3819 pub extensions: ::prost::alloc::vec::Vec<::prost_types::Any>,
3820}
3821/// A description of a label.
3822#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3823pub struct LabelDescriptor {
3824 /// The label key.
3825 #[prost(string, tag = "1")]
3826 pub key: ::prost::alloc::string::String,
3827 /// The type of data that can be assigned to the label.
3828 #[prost(enumeration = "label_descriptor::ValueType", tag = "2")]
3829 pub value_type: i32,
3830 /// A human-readable description for the label.
3831 #[prost(string, tag = "3")]
3832 pub description: ::prost::alloc::string::String,
3833}
3834/// Nested message and enum types in `LabelDescriptor`.
3835pub mod label_descriptor {
3836 /// Value types that can be used as label values.
3837 #[derive(
3838 Clone,
3839 Copy,
3840 Debug,
3841 PartialEq,
3842 Eq,
3843 Hash,
3844 PartialOrd,
3845 Ord,
3846 ::prost::Enumeration
3847 )]
3848 #[repr(i32)]
3849 pub enum ValueType {
3850 /// A variable-length string. This is the default.
3851 String = 0,
3852 /// Boolean; true or false.
3853 Bool = 1,
3854 /// A 64-bit signed integer.
3855 Int64 = 2,
3856 }
3857 impl ValueType {
3858 /// String value of the enum field names used in the ProtoBuf definition.
3859 ///
3860 /// The values are not transformed in any way and thus are considered stable
3861 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3862 pub fn as_str_name(&self) -> &'static str {
3863 match self {
3864 Self::String => "STRING",
3865 Self::Bool => "BOOL",
3866 Self::Int64 => "INT64",
3867 }
3868 }
3869 /// Creates an enum from field names used in the ProtoBuf definition.
3870 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3871 match value {
3872 "STRING" => Some(Self::String),
3873 "BOOL" => Some(Self::Bool),
3874 "INT64" => Some(Self::Int64),
3875 _ => None,
3876 }
3877 }
3878 }
3879}
3880/// A description of a log type. Example in YAML format:
3881///
3882/// ```text
3883/// - name: library.googleapis.com/activity_history
3884/// description: The history of borrowing and returning library items.
3885/// display_name: Activity
3886/// labels:
3887/// - key: /customer_id
3888/// description: Identifier of a library customer
3889/// ```
3890#[derive(Clone, PartialEq, ::prost::Message)]
3891pub struct LogDescriptor {
3892 /// The name of the log. It must be less than 512 characters long and can
3893 /// include the following characters: upper- and lower-case alphanumeric
3894 /// characters \[A-Za-z0-9\], and punctuation characters including
3895 /// slash, underscore, hyphen, period \[/\_-.\].
3896 #[prost(string, tag = "1")]
3897 pub name: ::prost::alloc::string::String,
3898 /// The set of labels that are available to describe a specific log entry.
3899 /// Runtime requests that contain labels not specified here are
3900 /// considered invalid.
3901 #[prost(message, repeated, tag = "2")]
3902 pub labels: ::prost::alloc::vec::Vec<LabelDescriptor>,
3903 /// A human-readable description of this log. This information appears in
3904 /// the documentation and can contain details.
3905 #[prost(string, tag = "3")]
3906 pub description: ::prost::alloc::string::String,
3907 /// The human-readable name for this log. This information appears on
3908 /// the user interface and should be concise.
3909 #[prost(string, tag = "4")]
3910 pub display_name: ::prost::alloc::string::String,
3911}
3912/// Logging configuration of the service.
3913///
3914/// The following example shows how to configure logs to be sent to the
3915/// producer and consumer projects. In the example, the `activity_history`
3916/// log is sent to both the producer and consumer projects, whereas the
3917/// `purchase_history` log is only sent to the producer project.
3918///
3919/// ```text
3920/// monitored_resources:
3921/// - type: library.googleapis.com/branch
3922/// labels:
3923/// - key: /city
3924/// description: The city where the library branch is located in.
3925/// - key: /name
3926/// description: The name of the branch.
3927/// logs:
3928/// - name: activity_history
3929/// labels:
3930/// - key: /customer_id
3931/// - name: purchase_history
3932/// logging:
3933/// producer_destinations:
3934/// - monitored_resource: library.googleapis.com/branch
3935/// logs:
3936/// - activity_history
3937/// - purchase_history
3938/// consumer_destinations:
3939/// - monitored_resource: library.googleapis.com/branch
3940/// logs:
3941/// - activity_history
3942/// ```
3943#[derive(Clone, PartialEq, ::prost::Message)]
3944pub struct Logging {
3945 /// Logging configurations for sending logs to the producer project.
3946 /// There can be multiple producer destinations, each one must have a
3947 /// different monitored resource type. A log can be used in at most
3948 /// one producer destination.
3949 #[prost(message, repeated, tag = "1")]
3950 pub producer_destinations: ::prost::alloc::vec::Vec<logging::LoggingDestination>,
3951 /// Logging configurations for sending logs to the consumer project.
3952 /// There can be multiple consumer destinations, each one must have a
3953 /// different monitored resource type. A log can be used in at most
3954 /// one consumer destination.
3955 #[prost(message, repeated, tag = "2")]
3956 pub consumer_destinations: ::prost::alloc::vec::Vec<logging::LoggingDestination>,
3957}
3958/// Nested message and enum types in `Logging`.
3959pub mod logging {
3960 /// Configuration of a specific logging destination (the producer project
3961 /// or the consumer project).
3962 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3963 pub struct LoggingDestination {
3964 /// The monitored resource type. The type must be defined in the
3965 /// \[Service.monitored_resources\]\[google.api.Service.monitored_resources\]
3966 /// section.
3967 #[prost(string, tag = "3")]
3968 pub monitored_resource: ::prost::alloc::string::String,
3969 /// Names of the logs to be sent to this destination. Each name must
3970 /// be defined in the \[Service.logs\]\[google.api.Service.logs\] section. If the
3971 /// log name is not a domain scoped name, it will be automatically prefixed
3972 /// with the service name followed by "/".
3973 #[prost(string, repeated, tag = "1")]
3974 pub logs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3975 }
3976}
3977/// Defines a metric type and its schema. Once a metric descriptor is created,
3978/// deleting or altering it stops data collection and makes the metric type's
3979/// existing data unusable.
3980#[derive(Clone, PartialEq, ::prost::Message)]
3981pub struct MetricDescriptor {
3982 /// The resource name of the metric descriptor.
3983 #[prost(string, tag = "1")]
3984 pub name: ::prost::alloc::string::String,
3985 /// The metric type, including its DNS name prefix. The type is not
3986 /// URL-encoded. All user-defined metric types have the DNS name
3987 /// `custom.googleapis.com` or `external.googleapis.com`. Metric types should
3988 /// use a natural hierarchical grouping. For example:
3989 ///
3990 /// ```text
3991 /// "custom.googleapis.com/invoice/paid/amount"
3992 /// "external.googleapis.com/prometheus/up"
3993 /// "appengine.googleapis.com/http/server/response_latencies"
3994 /// ```
3995 #[prost(string, tag = "8")]
3996 pub r#type: ::prost::alloc::string::String,
3997 /// The set of labels that can be used to describe a specific
3998 /// instance of this metric type. For example, the
3999 /// `appengine.googleapis.com/http/server/response_latencies` metric
4000 /// type has a label for the HTTP response code, `response_code`, so
4001 /// you can look at latencies for successful responses or just
4002 /// for responses that failed.
4003 #[prost(message, repeated, tag = "2")]
4004 pub labels: ::prost::alloc::vec::Vec<LabelDescriptor>,
4005 /// Whether the metric records instantaneous values, changes to a value, etc.
4006 /// Some combinations of `metric_kind` and `value_type` might not be supported.
4007 #[prost(enumeration = "metric_descriptor::MetricKind", tag = "3")]
4008 pub metric_kind: i32,
4009 /// Whether the measurement is an integer, a floating-point number, etc.
4010 /// Some combinations of `metric_kind` and `value_type` might not be supported.
4011 #[prost(enumeration = "metric_descriptor::ValueType", tag = "4")]
4012 pub value_type: i32,
4013 /// The units in which the metric value is reported. It is only applicable
4014 /// if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
4015 /// defines the representation of the stored metric values.
4016 ///
4017 /// Different systems might scale the values to be more easily displayed (so a
4018 /// value of `0.02kBy` *might* be displayed as `20By`, and a value of
4019 /// `3523kBy` *might* be displayed as `3.5MBy`). However, if the `unit` is
4020 /// `kBy`, then the value of the metric is always in thousands of bytes, no
4021 /// matter how it might be displayed.
4022 ///
4023 /// If you want a custom metric to record the exact number of CPU-seconds used
4024 /// by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
4025 /// `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
4026 /// CPU-seconds, then the value is written as `12005`.
4027 ///
4028 /// Alternatively, if you want a custom metric to record data in a more
4029 /// granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
4030 /// `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
4031 /// or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
4032 ///
4033 /// The supported units are a subset of [The Unified Code for Units of
4034 /// Measure](<https://unitsofmeasure.org/ucum.html>) standard:
4035 ///
4036 /// **Basic units (UNIT)**
4037 ///
4038 /// * `bit` bit
4039 /// * `By` byte
4040 /// * `s` second
4041 /// * `min` minute
4042 /// * `h` hour
4043 /// * `d` day
4044 /// * `1` dimensionless
4045 ///
4046 /// **Prefixes (PREFIX)**
4047 ///
4048 /// * `k` kilo (10^3)
4049 ///
4050 /// * `M` mega (10^6)
4051 ///
4052 /// * `G` giga (10^9)
4053 ///
4054 /// * `T` tera (10^12)
4055 ///
4056 /// * `P` peta (10^15)
4057 ///
4058 /// * `E` exa (10^18)
4059 ///
4060 /// * `Z` zetta (10^21)
4061 ///
4062 /// * `Y` yotta (10^24)
4063 ///
4064 /// * `m` milli (10^-3)
4065 ///
4066 /// * `u` micro (10^-6)
4067 ///
4068 /// * `n` nano (10^-9)
4069 ///
4070 /// * `p` pico (10^-12)
4071 ///
4072 /// * `f` femto (10^-15)
4073 ///
4074 /// * `a` atto (10^-18)
4075 ///
4076 /// * `z` zepto (10^-21)
4077 ///
4078 /// * `y` yocto (10^-24)
4079 ///
4080 /// * `Ki` kibi (2^10)
4081 ///
4082 /// * `Mi` mebi (2^20)
4083 ///
4084 /// * `Gi` gibi (2^30)
4085 ///
4086 /// * `Ti` tebi (2^40)
4087 ///
4088 /// * `Pi` pebi (2^50)
4089 ///
4090 /// **Grammar**
4091 ///
4092 /// The grammar also includes these connectors:
4093 ///
4094 /// * `/` division or ratio (as an infix operator). For examples,
4095 /// `kBy/{email}` or `MiBy/10ms` (although you should almost never
4096 /// have `/s` in a metric `unit`; rates should always be computed at
4097 /// query time from the underlying cumulative or delta value).
4098 /// * `.` multiplication or composition (as an infix operator). For
4099 /// examples, `GBy.d` or `k{watt}.h`.
4100 ///
4101 /// The grammar for a unit is as follows:
4102 ///
4103 /// ```text
4104 /// Expression = Component { "." Component } { "/" Component } ;
4105 ///
4106 /// Component = ( \[ PREFIX \] UNIT | "%" ) \[ Annotation \]
4107 /// | Annotation
4108 /// | "1"
4109 /// ;
4110 ///
4111 /// Annotation = "{" NAME "}" ;
4112 /// ```
4113 ///
4114 /// Notes:
4115 ///
4116 /// * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
4117 /// is used alone, then the unit is equivalent to `1`. For examples,
4118 /// `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
4119 /// * `NAME` is a sequence of non-blank printable ASCII characters not
4120 /// containing `{` or `}`.
4121 /// * `1` represents a unitary [dimensionless
4122 /// unit](<https://en.wikipedia.org/wiki/Dimensionless_quantity>) of 1, such
4123 /// as in `1/s`. It is typically used when none of the basic units are
4124 /// appropriate. For example, "new users per day" can be represented as
4125 /// `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
4126 /// users). Alternatively, "thousands of page views per day" would be
4127 /// represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
4128 /// value of `5.3` would mean "5300 page views per day").
4129 /// * `%` represents dimensionless value of 1/100, and annotates values giving
4130 /// a percentage (so the metric values are typically in the range of 0..100,
4131 /// and a metric value `3` means "3 percent").
4132 /// * `10^2.%` indicates a metric contains a ratio, typically in the range
4133 /// 0..1, that will be multiplied by 100 and displayed as a percentage
4134 /// (so a metric value `0.03` means "3 percent").
4135 #[prost(string, tag = "5")]
4136 pub unit: ::prost::alloc::string::String,
4137 /// A detailed description of the metric, which can be used in documentation.
4138 #[prost(string, tag = "6")]
4139 pub description: ::prost::alloc::string::String,
4140 /// A concise name for the metric, which can be displayed in user interfaces.
4141 /// Use sentence case without an ending period, for example "Request count".
4142 /// This field is optional but it is recommended to be set for any metrics
4143 /// associated with user-visible concepts, such as Quota.
4144 #[prost(string, tag = "7")]
4145 pub display_name: ::prost::alloc::string::String,
4146 /// Optional. Metadata which can be used to guide usage of the metric.
4147 #[prost(message, optional, tag = "10")]
4148 pub metadata: ::core::option::Option<metric_descriptor::MetricDescriptorMetadata>,
4149 /// Optional. The launch stage of the metric definition.
4150 #[prost(enumeration = "LaunchStage", tag = "12")]
4151 pub launch_stage: i32,
4152 /// Read-only. If present, then a \[time
4153 /// series\]\[google.monitoring.v3.TimeSeries\], which is identified partially by
4154 /// a metric type and a
4155 /// \[MonitoredResourceDescriptor\]\[google.api.MonitoredResourceDescriptor\], that
4156 /// is associated with this metric type can only be associated with one of the
4157 /// monitored resource types listed here.
4158 #[prost(string, repeated, tag = "13")]
4159 pub monitored_resource_types: ::prost::alloc::vec::Vec<
4160 ::prost::alloc::string::String,
4161 >,
4162}
4163/// Nested message and enum types in `MetricDescriptor`.
4164pub mod metric_descriptor {
4165 /// Additional annotations that can be used to guide the usage of a metric.
4166 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4167 pub struct MetricDescriptorMetadata {
4168 /// Deprecated. Must use the
4169 /// \[MetricDescriptor.launch_stage\]\[google.api.MetricDescriptor.launch_stage\]
4170 /// instead.
4171 #[deprecated]
4172 #[prost(enumeration = "super::LaunchStage", tag = "1")]
4173 pub launch_stage: i32,
4174 /// The sampling period of metric data points. For metrics which are written
4175 /// periodically, consecutive data points are stored at this time interval,
4176 /// excluding data loss due to errors. Metrics with a higher granularity have
4177 /// a smaller sampling period.
4178 #[prost(message, optional, tag = "2")]
4179 pub sample_period: ::core::option::Option<::prost_types::Duration>,
4180 /// The delay of data points caused by ingestion. Data points older than this
4181 /// age are guaranteed to be ingested and available to be read, excluding
4182 /// data loss due to errors.
4183 #[prost(message, optional, tag = "3")]
4184 pub ingest_delay: ::core::option::Option<::prost_types::Duration>,
4185 /// The scope of the timeseries data of the metric.
4186 #[prost(
4187 enumeration = "metric_descriptor_metadata::TimeSeriesResourceHierarchyLevel",
4188 repeated,
4189 tag = "4"
4190 )]
4191 pub time_series_resource_hierarchy_level: ::prost::alloc::vec::Vec<i32>,
4192 }
4193 /// Nested message and enum types in `MetricDescriptorMetadata`.
4194 pub mod metric_descriptor_metadata {
4195 /// The resource hierarchy level of the timeseries data of a metric.
4196 #[derive(
4197 Clone,
4198 Copy,
4199 Debug,
4200 PartialEq,
4201 Eq,
4202 Hash,
4203 PartialOrd,
4204 Ord,
4205 ::prost::Enumeration
4206 )]
4207 #[repr(i32)]
4208 pub enum TimeSeriesResourceHierarchyLevel {
4209 /// Do not use this default value.
4210 Unspecified = 0,
4211 /// Scopes a metric to a project.
4212 Project = 1,
4213 /// Scopes a metric to an organization.
4214 Organization = 2,
4215 /// Scopes a metric to a folder.
4216 Folder = 3,
4217 }
4218 impl TimeSeriesResourceHierarchyLevel {
4219 /// String value of the enum field names used in the ProtoBuf definition.
4220 ///
4221 /// The values are not transformed in any way and thus are considered stable
4222 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4223 pub fn as_str_name(&self) -> &'static str {
4224 match self {
4225 Self::Unspecified => {
4226 "TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED"
4227 }
4228 Self::Project => "PROJECT",
4229 Self::Organization => "ORGANIZATION",
4230 Self::Folder => "FOLDER",
4231 }
4232 }
4233 /// Creates an enum from field names used in the ProtoBuf definition.
4234 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4235 match value {
4236 "TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED" => {
4237 Some(Self::Unspecified)
4238 }
4239 "PROJECT" => Some(Self::Project),
4240 "ORGANIZATION" => Some(Self::Organization),
4241 "FOLDER" => Some(Self::Folder),
4242 _ => None,
4243 }
4244 }
4245 }
4246 }
4247 /// The kind of measurement. It describes how the data is reported.
4248 /// For information on setting the start time and end time based on
4249 /// the MetricKind, see \[TimeInterval\]\[google.monitoring.v3.TimeInterval\].
4250 #[derive(
4251 Clone,
4252 Copy,
4253 Debug,
4254 PartialEq,
4255 Eq,
4256 Hash,
4257 PartialOrd,
4258 Ord,
4259 ::prost::Enumeration
4260 )]
4261 #[repr(i32)]
4262 pub enum MetricKind {
4263 /// Do not use this default value.
4264 Unspecified = 0,
4265 /// An instantaneous measurement of a value.
4266 Gauge = 1,
4267 /// The change in a value during a time interval.
4268 Delta = 2,
4269 /// A value accumulated over a time interval. Cumulative
4270 /// measurements in a time series should have the same start time
4271 /// and increasing end times, until an event resets the cumulative
4272 /// value to zero and sets a new start time for the following
4273 /// points.
4274 Cumulative = 3,
4275 }
4276 impl MetricKind {
4277 /// String value of the enum field names used in the ProtoBuf definition.
4278 ///
4279 /// The values are not transformed in any way and thus are considered stable
4280 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4281 pub fn as_str_name(&self) -> &'static str {
4282 match self {
4283 Self::Unspecified => "METRIC_KIND_UNSPECIFIED",
4284 Self::Gauge => "GAUGE",
4285 Self::Delta => "DELTA",
4286 Self::Cumulative => "CUMULATIVE",
4287 }
4288 }
4289 /// Creates an enum from field names used in the ProtoBuf definition.
4290 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4291 match value {
4292 "METRIC_KIND_UNSPECIFIED" => Some(Self::Unspecified),
4293 "GAUGE" => Some(Self::Gauge),
4294 "DELTA" => Some(Self::Delta),
4295 "CUMULATIVE" => Some(Self::Cumulative),
4296 _ => None,
4297 }
4298 }
4299 }
4300 /// The value type of a metric.
4301 #[derive(
4302 Clone,
4303 Copy,
4304 Debug,
4305 PartialEq,
4306 Eq,
4307 Hash,
4308 PartialOrd,
4309 Ord,
4310 ::prost::Enumeration
4311 )]
4312 #[repr(i32)]
4313 pub enum ValueType {
4314 /// Do not use this default value.
4315 Unspecified = 0,
4316 /// The value is a boolean.
4317 /// This value type can be used only if the metric kind is `GAUGE`.
4318 Bool = 1,
4319 /// The value is a signed 64-bit integer.
4320 Int64 = 2,
4321 /// The value is a double precision floating point number.
4322 Double = 3,
4323 /// The value is a text string.
4324 /// This value type can be used only if the metric kind is `GAUGE`.
4325 String = 4,
4326 /// The value is a \[`Distribution`\]\[google.api.Distribution\].
4327 Distribution = 5,
4328 /// The value is money.
4329 Money = 6,
4330 }
4331 impl ValueType {
4332 /// String value of the enum field names used in the ProtoBuf definition.
4333 ///
4334 /// The values are not transformed in any way and thus are considered stable
4335 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4336 pub fn as_str_name(&self) -> &'static str {
4337 match self {
4338 Self::Unspecified => "VALUE_TYPE_UNSPECIFIED",
4339 Self::Bool => "BOOL",
4340 Self::Int64 => "INT64",
4341 Self::Double => "DOUBLE",
4342 Self::String => "STRING",
4343 Self::Distribution => "DISTRIBUTION",
4344 Self::Money => "MONEY",
4345 }
4346 }
4347 /// Creates an enum from field names used in the ProtoBuf definition.
4348 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4349 match value {
4350 "VALUE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
4351 "BOOL" => Some(Self::Bool),
4352 "INT64" => Some(Self::Int64),
4353 "DOUBLE" => Some(Self::Double),
4354 "STRING" => Some(Self::String),
4355 "DISTRIBUTION" => Some(Self::Distribution),
4356 "MONEY" => Some(Self::Money),
4357 _ => None,
4358 }
4359 }
4360 }
4361}
4362/// A specific metric, identified by specifying values for all of the
4363/// labels of a \[`MetricDescriptor`\]\[google.api.MetricDescriptor\].
4364#[derive(Clone, PartialEq, ::prost::Message)]
4365pub struct Metric {
4366 /// An existing metric type, see
4367 /// \[google.api.MetricDescriptor\]\[google.api.MetricDescriptor\]. For example,
4368 /// `custom.googleapis.com/invoice/paid/amount`.
4369 #[prost(string, tag = "3")]
4370 pub r#type: ::prost::alloc::string::String,
4371 /// The set of label values that uniquely identify this metric. All
4372 /// labels listed in the `MetricDescriptor` must be assigned values.
4373 #[prost(map = "string, string", tag = "2")]
4374 pub labels: ::std::collections::HashMap<
4375 ::prost::alloc::string::String,
4376 ::prost::alloc::string::String,
4377 >,
4378}
4379/// An object that describes the schema of a
4380/// \[MonitoredResource\]\[google.api.MonitoredResource\] object using a type name
4381/// and a set of labels. For example, the monitored resource descriptor for
4382/// Google Compute Engine VM instances has a type of
4383/// `"gce_instance"` and specifies the use of the labels `"instance_id"` and
4384/// `"zone"` to identify particular VM instances.
4385///
4386/// Different APIs can support different monitored resource types. APIs generally
4387/// provide a `list` method that returns the monitored resource descriptors used
4388/// by the API.
4389#[derive(Clone, PartialEq, ::prost::Message)]
4390pub struct MonitoredResourceDescriptor {
4391 /// Optional. The resource name of the monitored resource descriptor:
4392 /// `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where
4393 /// {type} is the value of the `type` field in this object and
4394 /// {project_id} is a project ID that provides API-specific context for
4395 /// accessing the type. APIs that do not use project information can use the
4396 /// resource name format `"monitoredResourceDescriptors/{type}"`.
4397 #[prost(string, tag = "5")]
4398 pub name: ::prost::alloc::string::String,
4399 /// Required. The monitored resource type. For example, the type
4400 /// `"cloudsql_database"` represents databases in Google Cloud SQL.
4401 /// For a list of types, see [Monitored resource
4402 /// types](<https://cloud.google.com/monitoring/api/resources>)
4403 /// and [Logging resource
4404 /// types](<https://cloud.google.com/logging/docs/api/v2/resource-list>).
4405 #[prost(string, tag = "1")]
4406 pub r#type: ::prost::alloc::string::String,
4407 /// Optional. A concise name for the monitored resource type that might be
4408 /// displayed in user interfaces. It should be a Title Cased Noun Phrase,
4409 /// without any article or other determiners. For example,
4410 /// `"Google Cloud SQL Database"`.
4411 #[prost(string, tag = "2")]
4412 pub display_name: ::prost::alloc::string::String,
4413 /// Optional. A detailed description of the monitored resource type that might
4414 /// be used in documentation.
4415 #[prost(string, tag = "3")]
4416 pub description: ::prost::alloc::string::String,
4417 /// Required. A set of labels used to describe instances of this monitored
4418 /// resource type. For example, an individual Google Cloud SQL database is
4419 /// identified by values for the labels `"database_id"` and `"zone"`.
4420 #[prost(message, repeated, tag = "4")]
4421 pub labels: ::prost::alloc::vec::Vec<LabelDescriptor>,
4422 /// Optional. The launch stage of the monitored resource definition.
4423 #[prost(enumeration = "LaunchStage", tag = "7")]
4424 pub launch_stage: i32,
4425}
4426/// An object representing a resource that can be used for monitoring, logging,
4427/// billing, or other purposes. Examples include virtual machine instances,
4428/// databases, and storage devices such as disks. The `type` field identifies a
4429/// \[MonitoredResourceDescriptor\]\[google.api.MonitoredResourceDescriptor\] object
4430/// that describes the resource's schema. Information in the `labels` field
4431/// identifies the actual resource and its attributes according to the schema.
4432/// For example, a particular Compute Engine VM instance could be represented by
4433/// the following object, because the
4434/// \[MonitoredResourceDescriptor\]\[google.api.MonitoredResourceDescriptor\] for
4435/// `"gce_instance"` has labels
4436/// `"project_id"`, `"instance_id"` and `"zone"`:
4437///
4438/// ```text
4439/// { "type": "gce_instance",
4440/// "labels": { "project_id": "my-project",
4441/// "instance_id": "12345678901234",
4442/// "zone": "us-central1-a" }}
4443/// ```
4444#[derive(Clone, PartialEq, ::prost::Message)]
4445pub struct MonitoredResource {
4446 /// Required. The monitored resource type. This field must match
4447 /// the `type` field of a
4448 /// \[MonitoredResourceDescriptor\]\[google.api.MonitoredResourceDescriptor\]
4449 /// object. For example, the type of a Compute Engine VM instance is
4450 /// `gce_instance`. Some descriptors include the service name in the type; for
4451 /// example, the type of a Datastream stream is
4452 /// `datastream.googleapis.com/Stream`.
4453 #[prost(string, tag = "1")]
4454 pub r#type: ::prost::alloc::string::String,
4455 /// Required. Values for all of the labels listed in the associated monitored
4456 /// resource descriptor. For example, Compute Engine VM instances use the
4457 /// labels `"project_id"`, `"instance_id"`, and `"zone"`.
4458 #[prost(map = "string, string", tag = "2")]
4459 pub labels: ::std::collections::HashMap<
4460 ::prost::alloc::string::String,
4461 ::prost::alloc::string::String,
4462 >,
4463}
4464/// Auxiliary metadata for a \[MonitoredResource\]\[google.api.MonitoredResource\]
4465/// object. \[MonitoredResource\]\[google.api.MonitoredResource\] objects contain the
4466/// minimum set of information to uniquely identify a monitored resource
4467/// instance. There is some other useful auxiliary metadata. Monitoring and
4468/// Logging use an ingestion pipeline to extract metadata for cloud resources of
4469/// all types, and store the metadata in this message.
4470#[derive(Clone, PartialEq, ::prost::Message)]
4471pub struct MonitoredResourceMetadata {
4472 /// Output only. Values for predefined system metadata labels.
4473 /// System labels are a kind of metadata extracted by Google, including
4474 /// "machine_image", "vpc", "subnet_id",
4475 /// "security_group", "name", etc.
4476 /// System label values can be only strings, Boolean values, or a list of
4477 /// strings. For example:
4478 ///
4479 /// ```text
4480 /// { "name": "my-test-instance",
4481 /// "security_group": \["a", "b", "c"\],
4482 /// "spot_instance": false }
4483 /// ```
4484 #[prost(message, optional, tag = "1")]
4485 pub system_labels: ::core::option::Option<::prost_types::Struct>,
4486 /// Output only. A map of user-defined metadata labels.
4487 #[prost(map = "string, string", tag = "2")]
4488 pub user_labels: ::std::collections::HashMap<
4489 ::prost::alloc::string::String,
4490 ::prost::alloc::string::String,
4491 >,
4492}
4493/// Monitoring configuration of the service.
4494///
4495/// The example below shows how to configure monitored resources and metrics
4496/// for monitoring. In the example, a monitored resource and two metrics are
4497/// defined. The `library.googleapis.com/book/returned_count` metric is sent
4498/// to both producer and consumer projects, whereas the
4499/// `library.googleapis.com/book/num_overdue` metric is only sent to the
4500/// consumer project.
4501///
4502/// ```text
4503/// monitored_resources:
4504/// - type: library.googleapis.com/Branch
4505/// display_name: "Library Branch"
4506/// description: "A branch of a library."
4507/// launch_stage: GA
4508/// labels:
4509/// - key: resource_container
4510/// description: "The Cloud container (ie. project id) for the Branch."
4511/// - key: location
4512/// description: "The location of the library branch."
4513/// - key: branch_id
4514/// description: "The id of the branch."
4515/// metrics:
4516/// - name: library.googleapis.com/book/returned_count
4517/// display_name: "Books Returned"
4518/// description: "The count of books that have been returned."
4519/// launch_stage: GA
4520/// metric_kind: DELTA
4521/// value_type: INT64
4522/// unit: "1"
4523/// labels:
4524/// - key: customer_id
4525/// description: "The id of the customer."
4526/// - name: library.googleapis.com/book/num_overdue
4527/// display_name: "Books Overdue"
4528/// description: "The current number of overdue books."
4529/// launch_stage: GA
4530/// metric_kind: GAUGE
4531/// value_type: INT64
4532/// unit: "1"
4533/// labels:
4534/// - key: customer_id
4535/// description: "The id of the customer."
4536/// monitoring:
4537/// producer_destinations:
4538/// - monitored_resource: library.googleapis.com/Branch
4539/// metrics:
4540/// - library.googleapis.com/book/returned_count
4541/// consumer_destinations:
4542/// - monitored_resource: library.googleapis.com/Branch
4543/// metrics:
4544/// - library.googleapis.com/book/returned_count
4545/// - library.googleapis.com/book/num_overdue
4546/// ```
4547#[derive(Clone, PartialEq, ::prost::Message)]
4548pub struct Monitoring {
4549 /// Monitoring configurations for sending metrics to the producer project.
4550 /// There can be multiple producer destinations. A monitored resource type may
4551 /// appear in multiple monitoring destinations if different aggregations are
4552 /// needed for different sets of metrics associated with that monitored
4553 /// resource type. A monitored resource and metric pair may only be used once
4554 /// in the Monitoring configuration.
4555 #[prost(message, repeated, tag = "1")]
4556 pub producer_destinations: ::prost::alloc::vec::Vec<
4557 monitoring::MonitoringDestination,
4558 >,
4559 /// Monitoring configurations for sending metrics to the consumer project.
4560 /// There can be multiple consumer destinations. A monitored resource type may
4561 /// appear in multiple monitoring destinations if different aggregations are
4562 /// needed for different sets of metrics associated with that monitored
4563 /// resource type. A monitored resource and metric pair may only be used once
4564 /// in the Monitoring configuration.
4565 #[prost(message, repeated, tag = "2")]
4566 pub consumer_destinations: ::prost::alloc::vec::Vec<
4567 monitoring::MonitoringDestination,
4568 >,
4569}
4570/// Nested message and enum types in `Monitoring`.
4571pub mod monitoring {
4572 /// Configuration of a specific monitoring destination (the producer project
4573 /// or the consumer project).
4574 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4575 pub struct MonitoringDestination {
4576 /// The monitored resource type. The type must be defined in
4577 /// \[Service.monitored_resources\]\[google.api.Service.monitored_resources\]
4578 /// section.
4579 #[prost(string, tag = "1")]
4580 pub monitored_resource: ::prost::alloc::string::String,
4581 /// Types of the metrics to report to this monitoring destination.
4582 /// Each type must be defined in
4583 /// \[Service.metrics\]\[google.api.Service.metrics\] section.
4584 #[prost(string, repeated, tag = "2")]
4585 pub metrics: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
4586 }
4587}
4588/// Quota configuration helps to achieve fairness and budgeting in service
4589/// usage.
4590///
4591/// The metric based quota configuration works this way:
4592///
4593/// * The service configuration defines a set of metrics.
4594/// * For API calls, the quota.metric_rules maps methods to metrics with
4595/// corresponding costs.
4596/// * The quota.limits defines limits on the metrics, which will be used for
4597/// quota checks at runtime.
4598///
4599/// An example quota configuration in yaml format:
4600///
4601/// ```text
4602/// quota:
4603/// limits:
4604///
4605/// - name: apiWriteQpsPerProject
4606/// metric: library.googleapis.com/write_calls
4607/// unit: "1/min/{project}" # rate limit for consumer projects
4608/// values:
4609/// STANDARD: 10000
4610///
4611///
4612/// (The metric rules bind all methods to the read_calls metric,
4613/// except for the UpdateBook and DeleteBook methods. These two methods
4614/// are mapped to the write_calls metric, with the UpdateBook method
4615/// consuming at twice rate as the DeleteBook method.)
4616/// metric_rules:
4617/// - selector: "*"
4618/// metric_costs:
4619/// library.googleapis.com/read_calls: 1
4620/// - selector: google.example.library.v1.LibraryService.UpdateBook
4621/// metric_costs:
4622/// library.googleapis.com/write_calls: 2
4623/// - selector: google.example.library.v1.LibraryService.DeleteBook
4624/// metric_costs:
4625/// library.googleapis.com/write_calls: 1
4626/// ```
4627///
4628/// Corresponding Metric definition:
4629///
4630/// ```text
4631/// metrics:
4632/// - name: library.googleapis.com/read_calls
4633/// display_name: Read requests
4634/// metric_kind: DELTA
4635/// value_type: INT64
4636///
4637/// - name: library.googleapis.com/write_calls
4638/// display_name: Write requests
4639/// metric_kind: DELTA
4640/// value_type: INT64
4641/// ```
4642#[derive(Clone, PartialEq, ::prost::Message)]
4643pub struct Quota {
4644 /// List of QuotaLimit definitions for the service.
4645 #[prost(message, repeated, tag = "3")]
4646 pub limits: ::prost::alloc::vec::Vec<QuotaLimit>,
4647 /// List of MetricRule definitions, each one mapping a selected method to one
4648 /// or more metrics.
4649 #[prost(message, repeated, tag = "4")]
4650 pub metric_rules: ::prost::alloc::vec::Vec<MetricRule>,
4651}
4652/// Bind API methods to metrics. Binding a method to a metric causes that
4653/// metric's configured quota behaviors to apply to the method call.
4654#[derive(Clone, PartialEq, ::prost::Message)]
4655pub struct MetricRule {
4656 /// Selects the methods to which this rule applies.
4657 ///
4658 /// Refer to \[selector\]\[google.api.DocumentationRule.selector\] for syntax
4659 /// details.
4660 #[prost(string, tag = "1")]
4661 pub selector: ::prost::alloc::string::String,
4662 /// Metrics to update when the selected methods are called, and the associated
4663 /// cost applied to each metric.
4664 ///
4665 /// The key of the map is the metric name, and the values are the amount
4666 /// increased for the metric against which the quota limits are defined.
4667 /// The value must not be negative.
4668 #[prost(map = "string, int64", tag = "2")]
4669 pub metric_costs: ::std::collections::HashMap<::prost::alloc::string::String, i64>,
4670}
4671/// `QuotaLimit` defines a specific limit that applies over a specified duration
4672/// for a limit type. There can be at most one limit for a duration and limit
4673/// type combination defined within a `QuotaGroup`.
4674#[derive(Clone, PartialEq, ::prost::Message)]
4675pub struct QuotaLimit {
4676 /// Name of the quota limit.
4677 ///
4678 /// The name must be provided, and it must be unique within the service. The
4679 /// name can only include alphanumeric characters as well as '-'.
4680 ///
4681 /// The maximum length of the limit name is 64 characters.
4682 #[prost(string, tag = "6")]
4683 pub name: ::prost::alloc::string::String,
4684 /// Optional. User-visible, extended description for this quota limit.
4685 /// Should be used only when more context is needed to understand this limit
4686 /// than provided by the limit's display name (see: `display_name`).
4687 #[prost(string, tag = "2")]
4688 pub description: ::prost::alloc::string::String,
4689 /// Default number of tokens that can be consumed during the specified
4690 /// duration. This is the number of tokens assigned when a client
4691 /// application developer activates the service for his/her project.
4692 ///
4693 /// Specifying a value of 0 will block all requests. This can be used if you
4694 /// are provisioning quota to selected consumers and blocking others.
4695 /// Similarly, a value of -1 will indicate an unlimited quota. No other
4696 /// negative values are allowed.
4697 ///
4698 /// Used by group-based quotas only.
4699 #[prost(int64, tag = "3")]
4700 pub default_limit: i64,
4701 /// Maximum number of tokens that can be consumed during the specified
4702 /// duration. Client application developers can override the default limit up
4703 /// to this maximum. If specified, this value cannot be set to a value less
4704 /// than the default limit. If not specified, it is set to the default limit.
4705 ///
4706 /// To allow clients to apply overrides with no upper bound, set this to -1,
4707 /// indicating unlimited maximum quota.
4708 ///
4709 /// Used by group-based quotas only.
4710 #[prost(int64, tag = "4")]
4711 pub max_limit: i64,
4712 /// Free tier value displayed in the Developers Console for this limit.
4713 /// The free tier is the number of tokens that will be subtracted from the
4714 /// billed amount when billing is enabled.
4715 /// This field can only be set on a limit with duration "1d", in a billable
4716 /// group; it is invalid on any other limit. If this field is not set, it
4717 /// defaults to 0, indicating that there is no free tier for this service.
4718 ///
4719 /// Used by group-based quotas only.
4720 #[prost(int64, tag = "7")]
4721 pub free_tier: i64,
4722 /// Duration of this limit in textual notation. Must be "100s" or "1d".
4723 ///
4724 /// Used by group-based quotas only.
4725 #[prost(string, tag = "5")]
4726 pub duration: ::prost::alloc::string::String,
4727 /// The name of the metric this quota limit applies to. The quota limits with
4728 /// the same metric will be checked together during runtime. The metric must be
4729 /// defined within the service config.
4730 #[prost(string, tag = "8")]
4731 pub metric: ::prost::alloc::string::String,
4732 /// Specify the unit of the quota limit. It uses the same syntax as
4733 /// \[MetricDescriptor.unit\]\[google.api.MetricDescriptor.unit\]. The supported
4734 /// unit kinds are determined by the quota backend system.
4735 ///
4736 /// Here are some examples:
4737 ///
4738 /// * "1/min/{project}" for quota per minute per project.
4739 ///
4740 /// Note: the order of unit components is insignificant.
4741 /// The "1" at the beginning is required to follow the metric unit syntax.
4742 #[prost(string, tag = "9")]
4743 pub unit: ::prost::alloc::string::String,
4744 /// Tiered limit values. You must specify this as a key:value pair, with an
4745 /// integer value that is the maximum number of requests allowed for the
4746 /// specified unit. Currently only STANDARD is supported.
4747 #[prost(map = "string, int64", tag = "10")]
4748 pub values: ::std::collections::HashMap<::prost::alloc::string::String, i64>,
4749 /// User-visible display name for this limit.
4750 /// Optional. If not set, the UI will provide a default display name based on
4751 /// the quota configuration. This field can be used to override the default
4752 /// display name generated from the configuration.
4753 #[prost(string, tag = "12")]
4754 pub display_name: ::prost::alloc::string::String,
4755}
4756/// Specifies the routing information that should be sent along with the request
4757/// in the form of routing header.
4758/// **NOTE:** All service configuration rules follow the "last one wins" order.
4759///
4760/// The examples below will apply to an RPC which has the following request type:
4761///
4762/// Message Definition:
4763///
4764/// ```text
4765/// message Request {
4766/// // The name of the Table
4767/// // Values can be of the following formats:
4768/// // - `projects/<project>/tables/<table>`
4769/// // - `projects/<project>/instances/<instance>/tables/<table>`
4770/// // - `region/<region>/zones/<zone>/tables/<table>`
4771/// string table_name = 1;
4772///
4773/// // This value specifies routing for replication.
4774/// // It can be in the following formats:
4775/// // - `profiles/<profile_id>`
4776/// // - a legacy `profile_id` that can be any string
4777/// string app_profile_id = 2;
4778/// }
4779/// ```
4780///
4781/// Example message:
4782///
4783/// ```text
4784/// {
4785/// table_name: projects/proj_foo/instances/instance_bar/table/table_baz,
4786/// app_profile_id: profiles/prof_qux
4787/// }
4788/// ```
4789///
4790/// The routing header consists of one or multiple key-value pairs. The order of
4791/// the key-value pairs is undefined, the order of the `routing_parameters` in
4792/// the `RoutingRule` only matters for the evaluation order of the path
4793/// templates when `field` is the same. See the examples below for more details.
4794///
4795/// Every key and value in the routing header must be percent-encoded,
4796/// and joined together in the following format: `key1=value1&key2=value2`.
4797/// The examples below skip the percent-encoding for readability.
4798///
4799/// Example 1
4800///
4801/// Extracting a field from the request to put into the routing header
4802/// unchanged, with the key equal to the field name.
4803///
4804/// annotation:
4805///
4806/// ```text
4807/// option (google.api.routing) = {
4808/// // Take the `app_profile_id`.
4809/// routing_parameters {
4810/// field: "app_profile_id"
4811/// }
4812/// };
4813/// ```
4814///
4815/// result:
4816///
4817/// ```text
4818/// x-goog-request-params: app_profile_id=profiles/prof_qux
4819/// ```
4820///
4821/// Example 2
4822///
4823/// Extracting a field from the request to put into the routing header
4824/// unchanged, with the key different from the field name.
4825///
4826/// annotation:
4827///
4828/// ```text
4829/// option (google.api.routing) = {
4830/// // Take the `app_profile_id`, but name it `routing_id` in the header.
4831/// routing_parameters {
4832/// field: "app_profile_id"
4833/// path_template: "{routing_id=**}"
4834/// }
4835/// };
4836/// ```
4837///
4838/// result:
4839///
4840/// ```text
4841/// x-goog-request-params: routing_id=profiles/prof_qux
4842/// ```
4843///
4844/// Example 3
4845///
4846/// Extracting a field from the request to put into the routing
4847/// header, while matching a path template syntax on the field's value.
4848///
4849/// NB: it is more useful to send nothing than to send garbage for the purpose
4850/// of dynamic routing, since garbage pollutes cache. Thus the matching.
4851///
4852/// Sub-example 3a
4853///
4854/// The field matches the template.
4855///
4856/// annotation:
4857///
4858/// ```text
4859/// option (google.api.routing) = {
4860/// // Take the `table_name`, if it's well-formed (with project-based
4861/// // syntax).
4862/// routing_parameters {
4863/// field: "table_name"
4864/// path_template: "{table_name=projects/*/instances/*/**}"
4865/// }
4866/// };
4867/// ```
4868///
4869/// result:
4870///
4871/// ```text
4872/// x-goog-request-params:
4873/// table_name=projects/proj_foo/instances/instance_bar/table/table_baz
4874/// ```
4875///
4876/// Sub-example 3b
4877///
4878/// The field does not match the template.
4879///
4880/// annotation:
4881///
4882/// ```text
4883/// option (google.api.routing) = {
4884/// // Take the `table_name`, if it's well-formed (with region-based
4885/// // syntax).
4886/// routing_parameters {
4887/// field: "table_name"
4888/// path_template: "{table_name=regions/*/zones/*/**}"
4889/// }
4890/// };
4891/// ```
4892///
4893/// result:
4894///
4895/// ```text
4896/// <no routing header will be sent>
4897/// ```
4898///
4899/// Sub-example 3c
4900///
4901/// Multiple alternative conflictingly named path templates are
4902/// specified. The one that matches is used to construct the header.
4903///
4904/// annotation:
4905///
4906/// ```text
4907/// option (google.api.routing) = {
4908/// // Take the `table_name`, if it's well-formed, whether
4909/// // using the region- or projects-based syntax.
4910///
4911/// routing_parameters {
4912/// field: "table_name"
4913/// path_template: "{table_name=regions/*/zones/*/**}"
4914/// }
4915/// routing_parameters {
4916/// field: "table_name"
4917/// path_template: "{table_name=projects/*/instances/*/**}"
4918/// }
4919/// };
4920/// ```
4921///
4922/// result:
4923///
4924/// ```text
4925/// x-goog-request-params:
4926/// table_name=projects/proj_foo/instances/instance_bar/table/table_baz
4927/// ```
4928///
4929/// Example 4
4930///
4931/// Extracting a single routing header key-value pair by matching a
4932/// template syntax on (a part of) a single request field.
4933///
4934/// annotation:
4935///
4936/// ```text
4937/// option (google.api.routing) = {
4938/// // Take just the project id from the `table_name` field.
4939/// routing_parameters {
4940/// field: "table_name"
4941/// path_template: "{routing_id=projects/*}/**"
4942/// }
4943/// };
4944/// ```
4945///
4946/// result:
4947///
4948/// ```text
4949/// x-goog-request-params: routing_id=projects/proj_foo
4950/// ```
4951///
4952/// Example 5
4953///
4954/// Extracting a single routing header key-value pair by matching
4955/// several conflictingly named path templates on (parts of) a single request
4956/// field. The last template to match "wins" the conflict.
4957///
4958/// annotation:
4959///
4960/// ```text
4961/// option (google.api.routing) = {
4962/// // If the `table_name` does not have instances information,
4963/// // take just the project id for routing.
4964/// // Otherwise take project + instance.
4965///
4966/// routing_parameters {
4967/// field: "table_name"
4968/// path_template: "{routing_id=projects/*}/**"
4969/// }
4970/// routing_parameters {
4971/// field: "table_name"
4972/// path_template: "{routing_id=projects/*/instances/*}/**"
4973/// }
4974/// };
4975/// ```
4976///
4977/// result:
4978///
4979/// ```text
4980/// x-goog-request-params:
4981/// routing_id=projects/proj_foo/instances/instance_bar
4982/// ```
4983///
4984/// Example 6
4985///
4986/// Extracting multiple routing header key-value pairs by matching
4987/// several non-conflicting path templates on (parts of) a single request field.
4988///
4989/// Sub-example 6a
4990///
4991/// Make the templates strict, so that if the `table_name` does not
4992/// have an instance information, nothing is sent.
4993///
4994/// annotation:
4995///
4996/// ```text
4997/// option (google.api.routing) = {
4998/// // The routing code needs two keys instead of one composite
4999/// // but works only for the tables with the "project-instance" name
5000/// // syntax.
5001///
5002/// routing_parameters {
5003/// field: "table_name"
5004/// path_template: "{project_id=projects/*}/instances/*/**"
5005/// }
5006/// routing_parameters {
5007/// field: "table_name"
5008/// path_template: "projects/*/{instance_id=instances/*}/**"
5009/// }
5010/// };
5011/// ```
5012///
5013/// result:
5014///
5015/// ```text
5016/// x-goog-request-params:
5017/// project_id=projects/proj_foo&instance_id=instances/instance_bar
5018/// ```
5019///
5020/// Sub-example 6b
5021///
5022/// Make the templates loose, so that if the `table_name` does not
5023/// have an instance information, just the project id part is sent.
5024///
5025/// annotation:
5026///
5027/// ```text
5028/// option (google.api.routing) = {
5029/// // The routing code wants two keys instead of one composite
5030/// // but will work with just the `project_id` for tables without
5031/// // an instance in the `table_name`.
5032///
5033/// routing_parameters {
5034/// field: "table_name"
5035/// path_template: "{project_id=projects/*}/**"
5036/// }
5037/// routing_parameters {
5038/// field: "table_name"
5039/// path_template: "projects/*/{instance_id=instances/*}/**"
5040/// }
5041/// };
5042/// ```
5043///
5044/// result (is the same as 6a for our example message because it has the instance
5045/// information):
5046///
5047/// ```text
5048/// x-goog-request-params:
5049/// project_id=projects/proj_foo&instance_id=instances/instance_bar
5050/// ```
5051///
5052/// Example 7
5053///
5054/// Extracting multiple routing header key-value pairs by matching
5055/// several path templates on multiple request fields.
5056///
5057/// NB: note that here there is no way to specify sending nothing if one of the
5058/// fields does not match its template. E.g. if the `table_name` is in the wrong
5059/// format, the `project_id` will not be sent, but the `routing_id` will be.
5060/// The backend routing code has to be aware of that and be prepared to not
5061/// receive a full complement of keys if it expects multiple.
5062///
5063/// annotation:
5064///
5065/// ```text
5066/// option (google.api.routing) = {
5067/// // The routing needs both `project_id` and `routing_id`
5068/// // (from the `app_profile_id` field) for routing.
5069///
5070/// routing_parameters {
5071/// field: "table_name"
5072/// path_template: "{project_id=projects/*}/**"
5073/// }
5074/// routing_parameters {
5075/// field: "app_profile_id"
5076/// path_template: "{routing_id=**}"
5077/// }
5078/// };
5079/// ```
5080///
5081/// result:
5082///
5083/// ```text
5084/// x-goog-request-params:
5085/// project_id=projects/proj_foo&routing_id=profiles/prof_qux
5086/// ```
5087///
5088/// Example 8
5089///
5090/// Extracting a single routing header key-value pair by matching
5091/// several conflictingly named path templates on several request fields. The
5092/// last template to match "wins" the conflict.
5093///
5094/// annotation:
5095///
5096/// ```text
5097/// option (google.api.routing) = {
5098/// // The `routing_id` can be a project id or a region id depending on
5099/// // the table name format, but only if the `app_profile_id` is not set.
5100/// // If `app_profile_id` is set it should be used instead.
5101///
5102/// routing_parameters {
5103/// field: "table_name"
5104/// path_template: "{routing_id=projects/*}/**"
5105/// }
5106/// routing_parameters {
5107/// field: "table_name"
5108/// path_template: "{routing_id=regions/*}/**"
5109/// }
5110/// routing_parameters {
5111/// field: "app_profile_id"
5112/// path_template: "{routing_id=**}"
5113/// }
5114/// };
5115/// ```
5116///
5117/// result:
5118///
5119/// ```text
5120/// x-goog-request-params: routing_id=profiles/prof_qux
5121/// ```
5122///
5123/// Example 9
5124///
5125/// Bringing it all together.
5126///
5127/// annotation:
5128///
5129/// ```text
5130/// option (google.api.routing) = {
5131/// // For routing both `table_location` and a `routing_id` are needed.
5132/// //
5133/// // table_location can be either an instance id or a region+zone id.
5134/// //
5135/// // For `routing_id`, take the value of `app_profile_id`
5136/// // - If it's in the format `profiles/<profile_id>`, send
5137/// // just the `<profile_id>` part.
5138/// // - If it's any other literal, send it as is.
5139/// // If the `app_profile_id` is empty, and the `table_name` starts with
5140/// // the project_id, send that instead.
5141///
5142/// routing_parameters {
5143/// field: "table_name"
5144/// path_template: "projects/*/{table_location=instances/*}/tables/*"
5145/// }
5146/// routing_parameters {
5147/// field: "table_name"
5148/// path_template: "{table_location=regions/*/zones/*}/tables/*"
5149/// }
5150/// routing_parameters {
5151/// field: "table_name"
5152/// path_template: "{routing_id=projects/*}/**"
5153/// }
5154/// routing_parameters {
5155/// field: "app_profile_id"
5156/// path_template: "{routing_id=**}"
5157/// }
5158/// routing_parameters {
5159/// field: "app_profile_id"
5160/// path_template: "profiles/{routing_id=*}"
5161/// }
5162/// };
5163/// ```
5164///
5165/// result:
5166///
5167/// ```text
5168/// x-goog-request-params:
5169/// table_location=instances/instance_bar&routing_id=prof_qux
5170/// ```
5171#[derive(Clone, PartialEq, ::prost::Message)]
5172pub struct RoutingRule {
5173 /// A collection of Routing Parameter specifications.
5174 /// **NOTE:** If multiple Routing Parameters describe the same key
5175 /// (via the `path_template` field or via the `field` field when
5176 /// `path_template` is not provided), "last one wins" rule
5177 /// determines which Parameter gets used.
5178 /// See the examples for more details.
5179 #[prost(message, repeated, tag = "2")]
5180 pub routing_parameters: ::prost::alloc::vec::Vec<RoutingParameter>,
5181}
5182/// A projection from an input message to the GRPC or REST header.
5183#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5184pub struct RoutingParameter {
5185 /// A request field to extract the header key-value pair from.
5186 #[prost(string, tag = "1")]
5187 pub field: ::prost::alloc::string::String,
5188 /// A pattern matching the key-value field. Optional.
5189 /// If not specified, the whole field specified in the `field` field will be
5190 /// taken as value, and its name used as key. If specified, it MUST contain
5191 /// exactly one named segment (along with any number of unnamed segments) The
5192 /// pattern will be matched over the field specified in the `field` field, then
5193 /// if the match is successful:
5194 ///
5195 /// * the name of the single named segment will be used as a header name,
5196 /// * the match value of the segment will be used as a header value;
5197 /// if the match is NOT successful, nothing will be sent.
5198 ///
5199 /// Example:
5200 ///
5201 /// ```text
5202 /// -- This is a field in the request message
5203 /// | that the header value will be extracted from.
5204 /// |
5205 /// | -- This is the key name in the
5206 /// | | routing header.
5207 /// V |
5208 /// field: "table_name" v
5209 /// path_template: "projects/*/{table_location=instances/*}/tables/*"
5210 /// ^ ^
5211 /// | |
5212 /// In the {} brackets is the pattern that -- |
5213 /// specifies what to extract from the |
5214 /// field as a value to be sent. |
5215 /// |
5216 /// The string in the field must match the whole pattern --
5217 /// before brackets, inside brackets, after brackets.
5218 /// ```
5219 ///
5220 /// When looking at this specific example, we can see that:
5221 ///
5222 /// * A key-value pair with the key `table_location`
5223 /// and the value matching `instances/*` should be added
5224 /// to the x-goog-request-params routing header.
5225 /// * The value is extracted from the request message's `table_name` field
5226 /// if it matches the full pattern specified:
5227 /// `projects/*/instances/*/tables/*`.
5228 ///
5229 /// **NB:** If the `path_template` field is not provided, the key name is
5230 /// equal to the field name, and the whole field should be sent as a value.
5231 /// This makes the pattern for the field and the value functionally equivalent
5232 /// to `**`, and the configuration
5233 ///
5234 /// ```text
5235 /// {
5236 /// field: "table_name"
5237 /// }
5238 /// ```
5239 ///
5240 /// is a functionally equivalent shorthand to:
5241 ///
5242 /// ```text
5243 /// {
5244 /// field: "table_name"
5245 /// path_template: "{table_name=**}"
5246 /// }
5247 /// ```
5248 ///
5249 /// See Example 1 for more details.
5250 #[prost(string, tag = "2")]
5251 pub path_template: ::prost::alloc::string::String,
5252}
5253/// Source information used to create a Service Config
5254#[derive(Clone, PartialEq, ::prost::Message)]
5255pub struct SourceInfo {
5256 /// All files used during config generation.
5257 #[prost(message, repeated, tag = "1")]
5258 pub source_files: ::prost::alloc::vec::Vec<::prost_types::Any>,
5259}
5260/// ### System parameter configuration
5261///
5262/// A system parameter is a special kind of parameter defined by the API
5263/// system, not by an individual API. It is typically mapped to an HTTP header
5264/// and/or a URL query parameter. This configuration specifies which methods
5265/// change the names of the system parameters.
5266#[derive(Clone, PartialEq, ::prost::Message)]
5267pub struct SystemParameters {
5268 /// Define system parameters.
5269 ///
5270 /// The parameters defined here will override the default parameters
5271 /// implemented by the system. If this field is missing from the service
5272 /// config, default system parameters will be used. Default system parameters
5273 /// and names is implementation-dependent.
5274 ///
5275 /// Example: define api key for all methods
5276 ///
5277 /// ```text
5278 /// system_parameters
5279 /// rules:
5280 /// - selector: "*"
5281 /// parameters:
5282 /// - name: api_key
5283 /// url_query_parameter: api_key
5284 /// ```
5285 ///
5286 /// Example: define 2 api key names for a specific method.
5287 ///
5288 /// ```text
5289 /// system_parameters
5290 /// rules:
5291 /// - selector: "/ListShelves"
5292 /// parameters:
5293 /// - name: api_key
5294 /// http_header: Api-Key1
5295 /// - name: api_key
5296 /// http_header: Api-Key2
5297 /// ```
5298 ///
5299 /// **NOTE:** All service configuration rules follow "last one wins" order.
5300 #[prost(message, repeated, tag = "1")]
5301 pub rules: ::prost::alloc::vec::Vec<SystemParameterRule>,
5302}
5303/// Define a system parameter rule mapping system parameter definitions to
5304/// methods.
5305#[derive(Clone, PartialEq, ::prost::Message)]
5306pub struct SystemParameterRule {
5307 /// Selects the methods to which this rule applies. Use '\*' to indicate all
5308 /// methods in all APIs.
5309 ///
5310 /// Refer to \[selector\]\[google.api.DocumentationRule.selector\] for syntax
5311 /// details.
5312 #[prost(string, tag = "1")]
5313 pub selector: ::prost::alloc::string::String,
5314 /// Define parameters. Multiple names may be defined for a parameter.
5315 /// For a given method call, only one of them should be used. If multiple
5316 /// names are used the behavior is implementation-dependent.
5317 /// If none of the specified names are present the behavior is
5318 /// parameter-dependent.
5319 #[prost(message, repeated, tag = "2")]
5320 pub parameters: ::prost::alloc::vec::Vec<SystemParameter>,
5321}
5322/// Define a parameter's name and location. The parameter may be passed as either
5323/// an HTTP header or a URL query parameter, and if both are passed the behavior
5324/// is implementation-dependent.
5325#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5326pub struct SystemParameter {
5327 /// Define the name of the parameter, such as "api_key" . It is case sensitive.
5328 #[prost(string, tag = "1")]
5329 pub name: ::prost::alloc::string::String,
5330 /// Define the HTTP header name to use for the parameter. It is case
5331 /// insensitive.
5332 #[prost(string, tag = "2")]
5333 pub http_header: ::prost::alloc::string::String,
5334 /// Define the URL query parameter name to use for the parameter. It is case
5335 /// sensitive.
5336 #[prost(string, tag = "3")]
5337 pub url_query_parameter: ::prost::alloc::string::String,
5338}
5339/// Configuration controlling usage of a service.
5340#[derive(Clone, PartialEq, ::prost::Message)]
5341pub struct Usage {
5342 /// Requirements that must be satisfied before a consumer project can use the
5343 /// service. Each requirement is of the form \<service.name>/<requirement-id>;
5344 /// for example 'serviceusage.googleapis.com/billing-enabled'.
5345 ///
5346 /// For Google APIs, a Terms of Service requirement must be included here.
5347 /// Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
5348 /// Other Google APIs should include
5349 /// "serviceusage.googleapis.com/tos/universal". Additional ToS can be
5350 /// included based on the business needs.
5351 #[prost(string, repeated, tag = "1")]
5352 pub requirements: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
5353 /// A list of usage rules that apply to individual API methods.
5354 ///
5355 /// **NOTE:** All service configuration rules follow "last one wins" order.
5356 #[prost(message, repeated, tag = "6")]
5357 pub rules: ::prost::alloc::vec::Vec<UsageRule>,
5358 /// The full resource name of a channel used for sending notifications to the
5359 /// service producer.
5360 ///
5361 /// Google Service Management currently only supports
5362 /// [Google Cloud Pub/Sub](<https://cloud.google.com/pubsub>) as a notification
5363 /// channel. To use Google Cloud Pub/Sub as the channel, this must be the name
5364 /// of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format
5365 /// documented in <https://cloud.google.com/pubsub/docs/overview.>
5366 #[prost(string, tag = "7")]
5367 pub producer_notification_channel: ::prost::alloc::string::String,
5368}
5369/// Usage configuration rules for the service.
5370#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5371pub struct UsageRule {
5372 /// Selects the methods to which this rule applies. Use '\*' to indicate all
5373 /// methods in all APIs.
5374 ///
5375 /// Refer to \[selector\]\[google.api.DocumentationRule.selector\] for syntax
5376 /// details.
5377 #[prost(string, tag = "1")]
5378 pub selector: ::prost::alloc::string::String,
5379 /// Use this rule to configure unregistered calls for the service. Unregistered
5380 /// calls are calls that do not contain consumer project identity.
5381 /// (Example: calls that do not contain an API key).
5382 ///
5383 /// WARNING: By default, API methods do not allow unregistered calls, and each
5384 /// method call must be identified by a consumer project identity.
5385 #[prost(bool, tag = "2")]
5386 pub allow_unregistered_calls: bool,
5387 /// If true, the selected method should skip service control and the control
5388 /// plane features, such as quota and billing, will not be available.
5389 /// This flag is used by Google Cloud Endpoints to bypass checks for internal
5390 /// methods, such as service health check methods.
5391 #[prost(bool, tag = "3")]
5392 pub skip_service_control: bool,
5393}
5394/// `Service` is the root object of Google API service configuration (service
5395/// config). It describes the basic information about a logical service,
5396/// such as the service name and the user-facing title, and delegates other
5397/// aspects to sub-sections. Each sub-section is either a proto message or a
5398/// repeated proto message that configures a specific aspect, such as auth.
5399/// For more information, see each proto message definition.
5400///
5401/// Example:
5402///
5403/// ```text
5404/// type: google.api.Service
5405/// name: calendar.googleapis.com
5406/// title: Google Calendar API
5407/// apis:
5408/// - name: google.calendar.v3.Calendar
5409///
5410/// visibility:
5411/// rules:
5412/// - selector: "google.calendar.v3.*"
5413/// restriction: PREVIEW
5414/// backend:
5415/// rules:
5416/// - selector: "google.calendar.v3.*"
5417/// address: calendar.example.com
5418///
5419/// authentication:
5420/// providers:
5421/// - id: google_calendar_auth
5422/// jwks_uri: <https://www.googleapis.com/oauth2/v1/certs>
5423/// issuer: <https://securetoken.google.com>
5424/// rules:
5425/// - selector: "*"
5426/// requirements:
5427/// provider_id: google_calendar_auth
5428/// ```
5429#[derive(Clone, PartialEq, ::prost::Message)]
5430pub struct Service {
5431 /// The service name, which is a DNS-like logical identifier for the
5432 /// service, such as `calendar.googleapis.com`. The service name
5433 /// typically goes through DNS verification to make sure the owner
5434 /// of the service also owns the DNS name.
5435 #[prost(string, tag = "1")]
5436 pub name: ::prost::alloc::string::String,
5437 /// The product title for this service, it is the name displayed in Google
5438 /// Cloud Console.
5439 #[prost(string, tag = "2")]
5440 pub title: ::prost::alloc::string::String,
5441 /// The Google project that owns this service.
5442 #[prost(string, tag = "22")]
5443 pub producer_project_id: ::prost::alloc::string::String,
5444 /// A unique ID for a specific instance of this message, typically assigned
5445 /// by the client for tracking purpose. Must be no longer than 63 characters
5446 /// and only lower case letters, digits, '.', '\_' and '-' are allowed. If
5447 /// empty, the server may choose to generate one instead.
5448 #[prost(string, tag = "33")]
5449 pub id: ::prost::alloc::string::String,
5450 /// A list of API interfaces exported by this service. Only the `name` field
5451 /// of the \[google.protobuf.Api\]\[google.protobuf.Api\] needs to be provided by
5452 /// the configuration author, as the remaining fields will be derived from the
5453 /// IDL during the normalization process. It is an error to specify an API
5454 /// interface here which cannot be resolved against the associated IDL files.
5455 #[prost(message, repeated, tag = "3")]
5456 pub apis: ::prost::alloc::vec::Vec<::prost_types::Api>,
5457 /// A list of all proto message types included in this API service.
5458 /// Types referenced directly or indirectly by the `apis` are automatically
5459 /// included. Messages which are not referenced but shall be included, such as
5460 /// types used by the `google.protobuf.Any` type, should be listed here by
5461 /// name by the configuration author. Example:
5462 ///
5463 /// ```text
5464 /// types:
5465 /// - name: google.protobuf.Int32
5466 /// ```
5467 #[prost(message, repeated, tag = "4")]
5468 pub types: ::prost::alloc::vec::Vec<::prost_types::Type>,
5469 /// A list of all enum types included in this API service. Enums referenced
5470 /// directly or indirectly by the `apis` are automatically included. Enums
5471 /// which are not referenced but shall be included should be listed here by
5472 /// name by the configuration author. Example:
5473 ///
5474 /// ```text
5475 /// enums:
5476 /// - name: google.someapi.v1.SomeEnum
5477 /// ```
5478 #[prost(message, repeated, tag = "5")]
5479 pub enums: ::prost::alloc::vec::Vec<::prost_types::Enum>,
5480 /// Additional API documentation.
5481 #[prost(message, optional, tag = "6")]
5482 pub documentation: ::core::option::Option<Documentation>,
5483 /// API backend configuration.
5484 #[prost(message, optional, tag = "8")]
5485 pub backend: ::core::option::Option<Backend>,
5486 /// HTTP configuration.
5487 #[prost(message, optional, tag = "9")]
5488 pub http: ::core::option::Option<Http>,
5489 /// Quota configuration.
5490 #[prost(message, optional, tag = "10")]
5491 pub quota: ::core::option::Option<Quota>,
5492 /// Auth configuration.
5493 #[prost(message, optional, tag = "11")]
5494 pub authentication: ::core::option::Option<Authentication>,
5495 /// Context configuration.
5496 #[prost(message, optional, tag = "12")]
5497 pub context: ::core::option::Option<Context>,
5498 /// Configuration controlling usage of this service.
5499 #[prost(message, optional, tag = "15")]
5500 pub usage: ::core::option::Option<Usage>,
5501 /// Configuration for network endpoints. If this is empty, then an endpoint
5502 /// with the same name as the service is automatically generated to service all
5503 /// defined APIs.
5504 #[prost(message, repeated, tag = "18")]
5505 pub endpoints: ::prost::alloc::vec::Vec<Endpoint>,
5506 /// Configuration for the service control plane.
5507 #[prost(message, optional, tag = "21")]
5508 pub control: ::core::option::Option<Control>,
5509 /// Defines the logs used by this service.
5510 #[prost(message, repeated, tag = "23")]
5511 pub logs: ::prost::alloc::vec::Vec<LogDescriptor>,
5512 /// Defines the metrics used by this service.
5513 #[prost(message, repeated, tag = "24")]
5514 pub metrics: ::prost::alloc::vec::Vec<MetricDescriptor>,
5515 /// Defines the monitored resources used by this service. This is required
5516 /// by the `Service.monitoring` and `Service.logging` configurations.
5517 #[prost(message, repeated, tag = "25")]
5518 pub monitored_resources: ::prost::alloc::vec::Vec<MonitoredResourceDescriptor>,
5519 /// Billing configuration.
5520 #[prost(message, optional, tag = "26")]
5521 pub billing: ::core::option::Option<Billing>,
5522 /// Logging configuration.
5523 #[prost(message, optional, tag = "27")]
5524 pub logging: ::core::option::Option<Logging>,
5525 /// Monitoring configuration.
5526 #[prost(message, optional, tag = "28")]
5527 pub monitoring: ::core::option::Option<Monitoring>,
5528 /// System parameter configuration.
5529 #[prost(message, optional, tag = "29")]
5530 pub system_parameters: ::core::option::Option<SystemParameters>,
5531 /// Output only. The source information for this configuration if available.
5532 #[prost(message, optional, tag = "37")]
5533 pub source_info: ::core::option::Option<SourceInfo>,
5534 /// Settings for [Google Cloud Client
5535 /// libraries](<https://cloud.google.com/apis/docs/cloud-client-libraries>)
5536 /// generated from APIs defined as protocol buffers.
5537 #[prost(message, optional, tag = "45")]
5538 pub publishing: ::core::option::Option<Publishing>,
5539 /// Obsolete. Do not use.
5540 ///
5541 /// This field has no semantic meaning. The service config compiler always
5542 /// sets this field to `3`.
5543 #[prost(message, optional, tag = "20")]
5544 pub config_version: ::core::option::Option<u32>,
5545}
5546/// `Visibility` restricts service consumer's access to service elements,
5547/// such as whether an application can call a visibility-restricted method.
5548/// The restriction is expressed by applying visibility labels on service
5549/// elements. The visibility labels are elsewhere linked to service consumers.
5550///
5551/// A service can define multiple visibility labels, but a service consumer
5552/// should be granted at most one visibility label. Multiple visibility
5553/// labels for a single service consumer are not supported.
5554///
5555/// If an element and all its parents have no visibility label, its visibility
5556/// is unconditionally granted.
5557///
5558/// Example:
5559///
5560/// ```text
5561/// visibility:
5562/// rules:
5563/// - selector: google.calendar.Calendar.EnhancedSearch
5564/// restriction: PREVIEW
5565/// - selector: google.calendar.Calendar.Delegate
5566/// restriction: INTERNAL
5567/// ```
5568///
5569/// Here, all methods are publicly visible except for the restricted methods
5570/// EnhancedSearch and Delegate.
5571#[derive(Clone, PartialEq, ::prost::Message)]
5572pub struct Visibility {
5573 /// A list of visibility rules that apply to individual API elements.
5574 ///
5575 /// **NOTE:** All service configuration rules follow "last one wins" order.
5576 #[prost(message, repeated, tag = "1")]
5577 pub rules: ::prost::alloc::vec::Vec<VisibilityRule>,
5578}
5579/// A visibility rule provides visibility configuration for an individual API
5580/// element.
5581#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5582pub struct VisibilityRule {
5583 /// Selects methods, messages, fields, enums, etc. to which this rule applies.
5584 ///
5585 /// Refer to \[selector\]\[google.api.DocumentationRule.selector\] for syntax
5586 /// details.
5587 #[prost(string, tag = "1")]
5588 pub selector: ::prost::alloc::string::String,
5589 /// A comma-separated list of visibility labels that apply to the `selector`.
5590 /// Any of the listed labels can be used to grant the visibility.
5591 ///
5592 /// If a rule has multiple labels, removing one of the labels but not all of
5593 /// them can break clients.
5594 ///
5595 /// Example:
5596 ///
5597 /// ```text
5598 /// visibility:
5599 /// rules:
5600 /// - selector: google.calendar.Calendar.EnhancedSearch
5601 /// restriction: INTERNAL, PREVIEW
5602 /// ```
5603 ///
5604 /// Removing INTERNAL from this restriction will break clients that rely on
5605 /// this method and only had access to it through INTERNAL.
5606 #[prost(string, tag = "2")]
5607 pub restriction: ::prost::alloc::string::String,
5608}