viam_rust_utils/gen/google.rpc.rs
1// @generated
2/// The `Status` type defines a logical error model that is suitable for
3/// different programming environments, including REST APIs and RPC APIs. It is
4/// used by \[gRPC\](<https://github.com/grpc>). Each `Status` message contains
5/// three pieces of data: error code, error message, and error details.
6///
7/// You can find out more about this error model and how to work with it in the
8/// [API Design Guide](<https://cloud.google.com/apis/design/errors>).
9#[allow(clippy::derive_partial_eq_without_eq)]
10#[derive(Clone, PartialEq, ::prost::Message)]
11pub struct Status {
12 /// The status code, which should be an enum value of
13 /// \[google.rpc.Code][google.rpc.Code\].
14 #[prost(int32, tag="1")]
15 pub code: i32,
16 /// A developer-facing error message, which should be in English. Any
17 /// user-facing error message should be localized and sent in the
18 /// \[google.rpc.Status.details][google.rpc.Status.details\] field, or localized
19 /// by the client.
20 #[prost(string, tag="2")]
21 pub message: ::prost::alloc::string::String,
22 /// A list of messages that carry the error details. There is a common set of
23 /// message types for APIs to use.
24 #[prost(message, repeated, tag="3")]
25 pub details: ::prost::alloc::vec::Vec<::prost_types::Any>,
26}
27/// The canonical error codes for gRPC APIs.
28///
29///
30/// Sometimes multiple error codes may apply. Services should return
31/// the most specific error code that applies. For example, prefer
32/// `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply.
33/// Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`.
34#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
35#[repr(i32)]
36pub enum Code {
37 /// Not an error; returned on success.
38 ///
39 /// HTTP Mapping: 200 OK
40 Ok = 0,
41 /// The operation was cancelled, typically by the caller.
42 ///
43 /// HTTP Mapping: 499 Client Closed Request
44 Cancelled = 1,
45 /// Unknown error. For example, this error may be returned when
46 /// a `Status` value received from another address space belongs to
47 /// an error space that is not known in this address space. Also
48 /// errors raised by APIs that do not return enough error information
49 /// may be converted to this error.
50 ///
51 /// HTTP Mapping: 500 Internal Server Error
52 Unknown = 2,
53 /// The client specified an invalid argument. Note that this differs
54 /// from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments
55 /// that are problematic regardless of the state of the system
56 /// (e.g., a malformed file name).
57 ///
58 /// HTTP Mapping: 400 Bad Request
59 InvalidArgument = 3,
60 /// The deadline expired before the operation could complete. For operations
61 /// that change the state of the system, this error may be returned
62 /// even if the operation has completed successfully. For example, a
63 /// successful response from a server could have been delayed long
64 /// enough for the deadline to expire.
65 ///
66 /// HTTP Mapping: 504 Gateway Timeout
67 DeadlineExceeded = 4,
68 /// Some requested entity (e.g., file or directory) was not found.
69 ///
70 /// Note to server developers: if a request is denied for an entire class
71 /// of users, such as gradual feature rollout or undocumented allowlist,
72 /// `NOT_FOUND` may be used. If a request is denied for some users within
73 /// a class of users, such as user-based access control, `PERMISSION_DENIED`
74 /// must be used.
75 ///
76 /// HTTP Mapping: 404 Not Found
77 NotFound = 5,
78 /// The entity that a client attempted to create (e.g., file or directory)
79 /// already exists.
80 ///
81 /// HTTP Mapping: 409 Conflict
82 AlreadyExists = 6,
83 /// The caller does not have permission to execute the specified
84 /// operation. `PERMISSION_DENIED` must not be used for rejections
85 /// caused by exhausting some resource (use `RESOURCE_EXHAUSTED`
86 /// instead for those errors). `PERMISSION_DENIED` must not be
87 /// used if the caller can not be identified (use `UNAUTHENTICATED`
88 /// instead for those errors). This error code does not imply the
89 /// request is valid or the requested entity exists or satisfies
90 /// other pre-conditions.
91 ///
92 /// HTTP Mapping: 403 Forbidden
93 PermissionDenied = 7,
94 /// The request does not have valid authentication credentials for the
95 /// operation.
96 ///
97 /// HTTP Mapping: 401 Unauthorized
98 Unauthenticated = 16,
99 /// Some resource has been exhausted, perhaps a per-user quota, or
100 /// perhaps the entire file system is out of space.
101 ///
102 /// HTTP Mapping: 429 Too Many Requests
103 ResourceExhausted = 8,
104 /// The operation was rejected because the system is not in a state
105 /// required for the operation's execution. For example, the directory
106 /// to be deleted is non-empty, an rmdir operation is applied to
107 /// a non-directory, etc.
108 ///
109 /// Service implementors can use the following guidelines to decide
110 /// between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`:
111 /// (a) Use `UNAVAILABLE` if the client can retry just the failing call.
112 /// (b) Use `ABORTED` if the client should retry at a higher level. For
113 /// example, when a client-specified test-and-set fails, indicating the
114 /// client should restart a read-modify-write sequence.
115 /// (c) Use `FAILED_PRECONDITION` if the client should not retry until
116 /// the system state has been explicitly fixed. For example, if an "rmdir"
117 /// fails because the directory is non-empty, `FAILED_PRECONDITION`
118 /// should be returned since the client should not retry unless
119 /// the files are deleted from the directory.
120 ///
121 /// HTTP Mapping: 400 Bad Request
122 FailedPrecondition = 9,
123 /// The operation was aborted, typically due to a concurrency issue such as
124 /// a sequencer check failure or transaction abort.
125 ///
126 /// See the guidelines above for deciding between `FAILED_PRECONDITION`,
127 /// `ABORTED`, and `UNAVAILABLE`.
128 ///
129 /// HTTP Mapping: 409 Conflict
130 Aborted = 10,
131 /// The operation was attempted past the valid range. E.g., seeking or
132 /// reading past end-of-file.
133 ///
134 /// Unlike `INVALID_ARGUMENT`, this error indicates a problem that may
135 /// be fixed if the system state changes. For example, a 32-bit file
136 /// system will generate `INVALID_ARGUMENT` if asked to read at an
137 /// offset that is not in the range \[0,2^32-1\], but it will generate
138 /// `OUT_OF_RANGE` if asked to read from an offset past the current
139 /// file size.
140 ///
141 /// There is a fair bit of overlap between `FAILED_PRECONDITION` and
142 /// `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific
143 /// error) when it applies so that callers who are iterating through
144 /// a space can easily look for an `OUT_OF_RANGE` error to detect when
145 /// they are done.
146 ///
147 /// HTTP Mapping: 400 Bad Request
148 OutOfRange = 11,
149 /// The operation is not implemented or is not supported/enabled in this
150 /// service.
151 ///
152 /// HTTP Mapping: 501 Not Implemented
153 Unimplemented = 12,
154 /// Internal errors. This means that some invariants expected by the
155 /// underlying system have been broken. This error code is reserved
156 /// for serious errors.
157 ///
158 /// HTTP Mapping: 500 Internal Server Error
159 Internal = 13,
160 /// The service is currently unavailable. This is most likely a
161 /// transient condition, which can be corrected by retrying with
162 /// a backoff. Note that it is not always safe to retry
163 /// non-idempotent operations.
164 ///
165 /// See the guidelines above for deciding between `FAILED_PRECONDITION`,
166 /// `ABORTED`, and `UNAVAILABLE`.
167 ///
168 /// HTTP Mapping: 503 Service Unavailable
169 Unavailable = 14,
170 /// Unrecoverable data loss or corruption.
171 ///
172 /// HTTP Mapping: 500 Internal Server Error
173 DataLoss = 15,
174}
175impl Code {
176 /// String value of the enum field names used in the ProtoBuf definition.
177 ///
178 /// The values are not transformed in any way and thus are considered stable
179 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
180 pub fn as_str_name(&self) -> &'static str {
181 match self {
182 Code::Ok => "OK",
183 Code::Cancelled => "CANCELLED",
184 Code::Unknown => "UNKNOWN",
185 Code::InvalidArgument => "INVALID_ARGUMENT",
186 Code::DeadlineExceeded => "DEADLINE_EXCEEDED",
187 Code::NotFound => "NOT_FOUND",
188 Code::AlreadyExists => "ALREADY_EXISTS",
189 Code::PermissionDenied => "PERMISSION_DENIED",
190 Code::Unauthenticated => "UNAUTHENTICATED",
191 Code::ResourceExhausted => "RESOURCE_EXHAUSTED",
192 Code::FailedPrecondition => "FAILED_PRECONDITION",
193 Code::Aborted => "ABORTED",
194 Code::OutOfRange => "OUT_OF_RANGE",
195 Code::Unimplemented => "UNIMPLEMENTED",
196 Code::Internal => "INTERNAL",
197 Code::Unavailable => "UNAVAILABLE",
198 Code::DataLoss => "DATA_LOSS",
199 }
200 }
201 /// Creates an enum from field names used in the ProtoBuf definition.
202 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
203 match value {
204 "OK" => Some(Self::Ok),
205 "CANCELLED" => Some(Self::Cancelled),
206 "UNKNOWN" => Some(Self::Unknown),
207 "INVALID_ARGUMENT" => Some(Self::InvalidArgument),
208 "DEADLINE_EXCEEDED" => Some(Self::DeadlineExceeded),
209 "NOT_FOUND" => Some(Self::NotFound),
210 "ALREADY_EXISTS" => Some(Self::AlreadyExists),
211 "PERMISSION_DENIED" => Some(Self::PermissionDenied),
212 "UNAUTHENTICATED" => Some(Self::Unauthenticated),
213 "RESOURCE_EXHAUSTED" => Some(Self::ResourceExhausted),
214 "FAILED_PRECONDITION" => Some(Self::FailedPrecondition),
215 "ABORTED" => Some(Self::Aborted),
216 "OUT_OF_RANGE" => Some(Self::OutOfRange),
217 "UNIMPLEMENTED" => Some(Self::Unimplemented),
218 "INTERNAL" => Some(Self::Internal),
219 "UNAVAILABLE" => Some(Self::Unavailable),
220 "DATA_LOSS" => Some(Self::DataLoss),
221 _ => None,
222 }
223 }
224}
225/// Describes the cause of the error with structured details.
226///
227/// Example of an error when contacting the "pubsub.googleapis.com" API when it
228/// is not enabled:
229///
230/// { "reason": "API_DISABLED"
231/// "domain": "googleapis.com"
232/// "metadata": {
233/// "resource": "projects/123",
234/// "service": "pubsub.googleapis.com"
235/// }
236/// }
237///
238/// This response indicates that the pubsub.googleapis.com API is not enabled.
239///
240/// Example of an error that is returned when attempting to create a Spanner
241/// instance in a region that is out of stock:
242///
243/// { "reason": "STOCKOUT"
244/// "domain": "spanner.googleapis.com",
245/// "metadata": {
246/// "availableRegions": "us-central1,us-east2"
247/// }
248/// }
249#[allow(clippy::derive_partial_eq_without_eq)]
250#[derive(Clone, PartialEq, ::prost::Message)]
251pub struct ErrorInfo {
252 /// The reason of the error. This is a constant value that identifies the
253 /// proximate cause of the error. Error reasons are unique within a particular
254 /// domain of errors. This should be at most 63 characters and match a
255 /// regular expression of `\[A-Z][A-Z0-9_]+[A-Z0-9\]`, which represents
256 /// UPPER_SNAKE_CASE.
257 #[prost(string, tag="1")]
258 pub reason: ::prost::alloc::string::String,
259 /// The logical grouping to which the "reason" belongs. The error domain
260 /// is typically the registered service name of the tool or product that
261 /// generates the error. Example: "pubsub.googleapis.com". If the error is
262 /// generated by some common infrastructure, the error domain must be a
263 /// globally unique value that identifies the infrastructure. For Google API
264 /// infrastructure, the error domain is "googleapis.com".
265 #[prost(string, tag="2")]
266 pub domain: ::prost::alloc::string::String,
267 /// Additional structured details about this error.
268 ///
269 /// Keys must match a regular expression of `\[a-z][a-zA-Z0-9-_\]+` but should
270 /// ideally be lowerCamelCase. Also, they must be limited to 64 characters in
271 /// length. When identifying the current value of an exceeded limit, the units
272 /// should be contained in the key, not the value. For example, rather than
273 /// `{"instanceLimit": "100/request"}`, should be returned as,
274 /// `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
275 /// instances that can be created in a single (batch) request.
276 #[prost(map="string, string", tag="3")]
277 pub metadata: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
278}
279/// Describes when the clients can retry a failed request. Clients could ignore
280/// the recommendation here or retry when this information is missing from error
281/// responses.
282///
283/// It's always recommended that clients should use exponential backoff when
284/// retrying.
285///
286/// Clients should wait until `retry_delay` amount of time has passed since
287/// receiving the error response before retrying. If retrying requests also
288/// fail, clients should use an exponential backoff scheme to gradually increase
289/// the delay between retries based on `retry_delay`, until either a maximum
290/// number of retries have been reached or a maximum retry delay cap has been
291/// reached.
292#[allow(clippy::derive_partial_eq_without_eq)]
293#[derive(Clone, PartialEq, ::prost::Message)]
294pub struct RetryInfo {
295 /// Clients should wait at least this long between retrying the same request.
296 #[prost(message, optional, tag="1")]
297 pub retry_delay: ::core::option::Option<::prost_types::Duration>,
298}
299/// Describes additional debugging info.
300#[allow(clippy::derive_partial_eq_without_eq)]
301#[derive(Clone, PartialEq, ::prost::Message)]
302pub struct DebugInfo {
303 /// The stack trace entries indicating where the error occurred.
304 #[prost(string, repeated, tag="1")]
305 pub stack_entries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
306 /// Additional debugging information provided by the server.
307 #[prost(string, tag="2")]
308 pub detail: ::prost::alloc::string::String,
309}
310/// Describes how a quota check failed.
311///
312/// For example if a daily limit was exceeded for the calling project,
313/// a service could respond with a QuotaFailure detail containing the project
314/// id and the description of the quota limit that was exceeded. If the
315/// calling project hasn't enabled the service in the developer console, then
316/// a service could respond with the project id and set `service_disabled`
317/// to true.
318///
319/// Also see RetryInfo and Help types for other details about handling a
320/// quota failure.
321#[allow(clippy::derive_partial_eq_without_eq)]
322#[derive(Clone, PartialEq, ::prost::Message)]
323pub struct QuotaFailure {
324 /// Describes all quota violations.
325 #[prost(message, repeated, tag="1")]
326 pub violations: ::prost::alloc::vec::Vec<quota_failure::Violation>,
327}
328/// Nested message and enum types in `QuotaFailure`.
329pub mod quota_failure {
330 /// A message type used to describe a single quota violation. For example, a
331 /// daily quota or a custom quota that was exceeded.
332 #[allow(clippy::derive_partial_eq_without_eq)]
333#[derive(Clone, PartialEq, ::prost::Message)]
334 pub struct Violation {
335 /// The subject on which the quota check failed.
336 /// For example, "clientip:<ip address of client>" or "project:<Google
337 /// developer project id>".
338 #[prost(string, tag="1")]
339 pub subject: ::prost::alloc::string::String,
340 /// A description of how the quota check failed. Clients can use this
341 /// description to find more about the quota configuration in the service's
342 /// public documentation, or find the relevant quota limit to adjust through
343 /// developer console.
344 ///
345 /// For example: "Service disabled" or "Daily Limit for read operations
346 /// exceeded".
347 #[prost(string, tag="2")]
348 pub description: ::prost::alloc::string::String,
349 }
350}
351/// Describes what preconditions have failed.
352///
353/// For example, if an RPC failed because it required the Terms of Service to be
354/// acknowledged, it could list the terms of service violation in the
355/// PreconditionFailure message.
356#[allow(clippy::derive_partial_eq_without_eq)]
357#[derive(Clone, PartialEq, ::prost::Message)]
358pub struct PreconditionFailure {
359 /// Describes all precondition violations.
360 #[prost(message, repeated, tag="1")]
361 pub violations: ::prost::alloc::vec::Vec<precondition_failure::Violation>,
362}
363/// Nested message and enum types in `PreconditionFailure`.
364pub mod precondition_failure {
365 /// A message type used to describe a single precondition failure.
366 #[allow(clippy::derive_partial_eq_without_eq)]
367#[derive(Clone, PartialEq, ::prost::Message)]
368 pub struct Violation {
369 /// The type of PreconditionFailure. We recommend using a service-specific
370 /// enum type to define the supported precondition violation subjects. For
371 /// example, "TOS" for "Terms of Service violation".
372 #[prost(string, tag="1")]
373 pub r#type: ::prost::alloc::string::String,
374 /// The subject, relative to the type, that failed.
375 /// For example, "google.com/cloud" relative to the "TOS" type would indicate
376 /// which terms of service is being referenced.
377 #[prost(string, tag="2")]
378 pub subject: ::prost::alloc::string::String,
379 /// A description of how the precondition failed. Developers can use this
380 /// description to understand how to fix the failure.
381 ///
382 /// For example: "Terms of service not accepted".
383 #[prost(string, tag="3")]
384 pub description: ::prost::alloc::string::String,
385 }
386}
387/// Describes violations in a client request. This error type focuses on the
388/// syntactic aspects of the request.
389#[allow(clippy::derive_partial_eq_without_eq)]
390#[derive(Clone, PartialEq, ::prost::Message)]
391pub struct BadRequest {
392 /// Describes all violations in a client request.
393 #[prost(message, repeated, tag="1")]
394 pub field_violations: ::prost::alloc::vec::Vec<bad_request::FieldViolation>,
395}
396/// Nested message and enum types in `BadRequest`.
397pub mod bad_request {
398 /// A message type used to describe a single bad request field.
399 #[allow(clippy::derive_partial_eq_without_eq)]
400#[derive(Clone, PartialEq, ::prost::Message)]
401 pub struct FieldViolation {
402 /// A path that leads to a field in the request body. The value will be a
403 /// sequence of dot-separated identifiers that identify a protocol buffer
404 /// field.
405 ///
406 /// Consider the following:
407 ///
408 /// message CreateContactRequest {
409 /// message EmailAddress {
410 /// enum Type {
411 /// TYPE_UNSPECIFIED = 0;
412 /// HOME = 1;
413 /// WORK = 2;
414 /// }
415 ///
416 /// optional string email = 1;
417 /// repeated EmailType type = 2;
418 /// }
419 ///
420 /// string full_name = 1;
421 /// repeated EmailAddress email_addresses = 2;
422 /// }
423 ///
424 /// In this example, in proto `field` could take one of the following values:
425 ///
426 /// * `full_name` for a violation in the `full_name` value
427 /// * `email_addresses\[1\].email` for a violation in the `email` field of the
428 /// first `email_addresses` message
429 /// * `email_addresses\[3].type[2\]` for a violation in the second `type`
430 /// value in the third `email_addresses` message.
431 ///
432 /// In JSON, the same values are represented as:
433 ///
434 /// * `fullName` for a violation in the `fullName` value
435 /// * `emailAddresses\[1\].email` for a violation in the `email` field of the
436 /// first `emailAddresses` message
437 /// * `emailAddresses\[3].type[2\]` for a violation in the second `type`
438 /// value in the third `emailAddresses` message.
439 #[prost(string, tag="1")]
440 pub field: ::prost::alloc::string::String,
441 /// A description of why the request element is bad.
442 #[prost(string, tag="2")]
443 pub description: ::prost::alloc::string::String,
444 /// The reason of the field-level error. This is a constant value that
445 /// identifies the proximate cause of the field-level error. It should
446 /// uniquely identify the type of the FieldViolation within the scope of the
447 /// google.rpc.ErrorInfo.domain. This should be at most 63
448 /// characters and match a regular expression of `\[A-Z][A-Z0-9_]+[A-Z0-9\]`,
449 /// which represents UPPER_SNAKE_CASE.
450 #[prost(string, tag="3")]
451 pub reason: ::prost::alloc::string::String,
452 /// Provides a localized error message for field-level errors that is safe to
453 /// return to the API consumer.
454 #[prost(message, optional, tag="4")]
455 pub localized_message: ::core::option::Option<super::LocalizedMessage>,
456 }
457}
458/// Contains metadata about the request that clients can attach when filing a bug
459/// or providing other forms of feedback.
460#[allow(clippy::derive_partial_eq_without_eq)]
461#[derive(Clone, PartialEq, ::prost::Message)]
462pub struct RequestInfo {
463 /// An opaque string that should only be interpreted by the service generating
464 /// it. For example, it can be used to identify requests in the service's logs.
465 #[prost(string, tag="1")]
466 pub request_id: ::prost::alloc::string::String,
467 /// Any data that was used to serve this request. For example, an encrypted
468 /// stack trace that can be sent back to the service provider for debugging.
469 #[prost(string, tag="2")]
470 pub serving_data: ::prost::alloc::string::String,
471}
472/// Describes the resource that is being accessed.
473#[allow(clippy::derive_partial_eq_without_eq)]
474#[derive(Clone, PartialEq, ::prost::Message)]
475pub struct ResourceInfo {
476 /// A name for the type of resource being accessed, e.g. "sql table",
477 /// "cloud storage bucket", "file", "Google calendar"; or the type URL
478 /// of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".
479 #[prost(string, tag="1")]
480 pub resource_type: ::prost::alloc::string::String,
481 /// The name of the resource being accessed. For example, a shared calendar
482 /// name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
483 /// error is
484 /// \[google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED\].
485 #[prost(string, tag="2")]
486 pub resource_name: ::prost::alloc::string::String,
487 /// The owner of the resource (optional).
488 /// For example, "user:<owner email>" or "project:<Google developer project
489 /// id>".
490 #[prost(string, tag="3")]
491 pub owner: ::prost::alloc::string::String,
492 /// Describes what error is encountered when accessing this resource.
493 /// For example, updating a cloud project may require the `writer` permission
494 /// on the developer console project.
495 #[prost(string, tag="4")]
496 pub description: ::prost::alloc::string::String,
497}
498/// Provides links to documentation or for performing an out of band action.
499///
500/// For example, if a quota check failed with an error indicating the calling
501/// project hasn't enabled the accessed service, this can contain a URL pointing
502/// directly to the right place in the developer console to flip the bit.
503#[allow(clippy::derive_partial_eq_without_eq)]
504#[derive(Clone, PartialEq, ::prost::Message)]
505pub struct Help {
506 /// URL(s) pointing to additional information on handling the current error.
507 #[prost(message, repeated, tag="1")]
508 pub links: ::prost::alloc::vec::Vec<help::Link>,
509}
510/// Nested message and enum types in `Help`.
511pub mod help {
512 /// Describes a URL link.
513 #[allow(clippy::derive_partial_eq_without_eq)]
514#[derive(Clone, PartialEq, ::prost::Message)]
515 pub struct Link {
516 /// Describes what the link offers.
517 #[prost(string, tag="1")]
518 pub description: ::prost::alloc::string::String,
519 /// The URL of the link.
520 #[prost(string, tag="2")]
521 pub url: ::prost::alloc::string::String,
522 }
523}
524/// Provides a localized error message that is safe to return to the user
525/// which can be attached to an RPC error.
526#[allow(clippy::derive_partial_eq_without_eq)]
527#[derive(Clone, PartialEq, ::prost::Message)]
528pub struct LocalizedMessage {
529 /// The locale used following the specification defined at
530 /// <https://www.rfc-editor.org/rfc/bcp/bcp47.txt.>
531 /// Examples are: "en-US", "fr-CH", "es-MX"
532 #[prost(string, tag="1")]
533 pub locale: ::prost::alloc::string::String,
534 /// The localized error message in the above locale.
535 #[prost(string, tag="2")]
536 pub message: ::prost::alloc::string::String,
537}
538// @@protoc_insertion_point(module)