iota_grpc_types/proto/generated/
google.rpc.rs

1// This file is @generated by prost-build.
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#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct Status {
11    /// The status code, which should be an enum value of
12    /// \[google.rpc.Code\]\[google.rpc.Code\].
13    #[prost(int32, tag = "1")]
14    pub code: i32,
15    /// A developer-facing error message, which should be in English. Any
16    /// user-facing error message should be localized and sent in the
17    /// \[google.rpc.Status.details\]\[google.rpc.Status.details\] field, or localized
18    /// by the client.
19    #[prost(string, tag = "2")]
20    pub message: ::prost::alloc::string::String,
21    /// A list of messages that carry the error details.  There is a common set of
22    /// message types for APIs to use.
23    #[prost(message, repeated, tag = "3")]
24    pub details: ::prost::alloc::vec::Vec<::prost_types::Any>,
25}
26/// Describes the cause of the error with structured details.
27///
28/// Example of an error when contacting the "pubsub.googleapis.com" API when it
29/// is not enabled:
30///
31/// ```text
32/// { "reason": "API_DISABLED"
33///    "domain": "googleapis.com"
34///    "metadata": {
35///      "resource": "projects/123",
36///      "service": "pubsub.googleapis.com"
37///    }
38/// }
39/// ```
40///
41/// This response indicates that the pubsub.googleapis.com API is not enabled.
42///
43/// Example of an error that is returned when attempting to create a Spanner
44/// instance in a region that is out of stock:
45///
46/// ```text
47/// { "reason": "STOCKOUT"
48///    "domain": "spanner.googleapis.com",
49///    "metadata": {
50///      "availableRegions": "us-central1,us-east2"
51///    }
52/// }
53/// ```
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct ErrorInfo {
56    /// The reason of the error. This is a constant value that identifies the
57    /// proximate cause of the error. Error reasons are unique within a particular
58    /// domain of errors. This should be at most 63 characters and match a
59    /// regular expression of `[A-Z][A-Z0-9_]+\[A-Z0-9\]`, which represents
60    /// UPPER_SNAKE_CASE.
61    #[prost(string, tag = "1")]
62    pub reason: ::prost::alloc::string::String,
63    /// The logical grouping to which the "reason" belongs. The error domain
64    /// is typically the registered service name of the tool or product that
65    /// generates the error. Example: "pubsub.googleapis.com". If the error is
66    /// generated by some common infrastructure, the error domain must be a
67    /// globally unique value that identifies the infrastructure. For Google API
68    /// infrastructure, the error domain is "googleapis.com".
69    #[prost(string, tag = "2")]
70    pub domain: ::prost::alloc::string::String,
71    /// Additional structured details about this error.
72    ///
73    /// Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
74    /// ideally be lowerCamelCase. Also, they must be limited to 64 characters in
75    /// length. When identifying the current value of an exceeded limit, the units
76    /// should be contained in the key, not the value.  For example, rather than
77    /// `{"instanceLimit": "100/request"}`, should be returned as,
78    /// `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
79    /// instances that can be created in a single (batch) request.
80    #[prost(btree_map = "string, string", tag = "3")]
81    pub metadata: ::prost::alloc::collections::BTreeMap<
82        ::prost::alloc::string::String,
83        ::prost::alloc::string::String,
84    >,
85}
86/// Describes when the clients can retry a failed request. Clients could ignore
87/// the recommendation here or retry when this information is missing from error
88/// responses.
89///
90/// It's always recommended that clients should use exponential backoff when
91/// retrying.
92///
93/// Clients should wait until `retry_delay` amount of time has passed since
94/// receiving the error response before retrying.  If retrying requests also
95/// fail, clients should use an exponential backoff scheme to gradually increase
96/// the delay between retries based on `retry_delay`, until either a maximum
97/// number of retries have been reached or a maximum retry delay cap has been
98/// reached.
99#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
100pub struct RetryInfo {
101    /// Clients should wait at least this long between retrying the same request.
102    #[prost(message, optional, tag = "1")]
103    pub retry_delay: ::core::option::Option<::prost_types::Duration>,
104}
105/// Describes additional debugging info.
106#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
107pub struct DebugInfo {
108    /// The stack trace entries indicating where the error occurred.
109    #[prost(string, repeated, tag = "1")]
110    pub stack_entries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
111    /// Additional debugging information provided by the server.
112    #[prost(string, tag = "2")]
113    pub detail: ::prost::alloc::string::String,
114}
115/// Describes how a quota check failed.
116///
117/// For example if a daily limit was exceeded for the calling project,
118/// a service could respond with a QuotaFailure detail containing the project
119/// id and the description of the quota limit that was exceeded.  If the
120/// calling project hasn't enabled the service in the developer console, then
121/// a service could respond with the project id and set `service_disabled`
122/// to true.
123///
124/// Also see RetryInfo and Help types for other details about handling a
125/// quota failure.
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct QuotaFailure {
128    /// Describes all quota violations.
129    #[prost(message, repeated, tag = "1")]
130    pub violations: ::prost::alloc::vec::Vec<quota_failure::Violation>,
131}
132/// Nested message and enum types in `QuotaFailure`.
133pub mod quota_failure {
134    /// A message type used to describe a single quota violation.  For example, a
135    /// daily quota or a custom quota that was exceeded.
136    #[derive(Clone, PartialEq, ::prost::Message)]
137    pub struct Violation {
138        /// The subject on which the quota check failed.
139        /// For example, "clientip:<ip address of client>" or "project:<Google
140        /// developer project id>".
141        #[prost(string, tag = "1")]
142        pub subject: ::prost::alloc::string::String,
143        /// A description of how the quota check failed. Clients can use this
144        /// description to find more about the quota configuration in the service's
145        /// public documentation, or find the relevant quota limit to adjust through
146        /// developer console.
147        ///
148        /// For example: "Service disabled" or "Daily Limit for read operations
149        /// exceeded".
150        #[prost(string, tag = "2")]
151        pub description: ::prost::alloc::string::String,
152        /// The API Service from which the `QuotaFailure.Violation` originates. In
153        /// some cases, Quota issues originate from an API Service other than the one
154        /// that was called. In other words, a dependency of the called API Service
155        /// could be the cause of the `QuotaFailure`, and this field would have the
156        /// dependency API service name.
157        ///
158        /// For example, if the called API is Kubernetes Engine API
159        /// (container.googleapis.com), and a quota violation occurs in the
160        /// Kubernetes Engine API itself, this field would be
161        /// "container.googleapis.com". On the other hand, if the quota violation
162        /// occurs when the Kubernetes Engine API creates VMs in the Compute Engine
163        /// API (compute.googleapis.com), this field would be
164        /// "compute.googleapis.com".
165        #[prost(string, tag = "3")]
166        pub api_service: ::prost::alloc::string::String,
167        /// The metric of the violated quota. A quota metric is a named counter to
168        /// measure usage, such as API requests or CPUs. When an activity occurs in a
169        /// service, such as Virtual Machine allocation, one or more quota metrics
170        /// may be affected.
171        ///
172        /// For example, "compute.googleapis.com/cpus_per_vm_family",
173        /// "storage.googleapis.com/internet_egress_bandwidth".
174        #[prost(string, tag = "4")]
175        pub quota_metric: ::prost::alloc::string::String,
176        /// The id of the violated quota. Also know as "limit name", this is the
177        /// unique identifier of a quota in the context of an API service.
178        ///
179        /// For example, "CPUS-PER-VM-FAMILY-per-project-region".
180        #[prost(string, tag = "5")]
181        pub quota_id: ::prost::alloc::string::String,
182        /// The dimensions of the violated quota. Every non-global quota is enforced
183        /// on a set of dimensions. While quota metric defines what to count, the
184        /// dimensions specify for what aspects the counter should be increased.
185        ///
186        /// For example, the quota "CPUs per region per VM family" enforces a limit
187        /// on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
188        /// "region" and "vm_family". And if the violation occurred in region
189        /// "us-central1" and for VM family "n1", the quota_dimensions would be,
190        ///
191        /// {
192        /// "region": "us-central1",
193        /// "vm_family": "n1",
194        /// }
195        ///
196        /// When a quota is enforced globally, the quota_dimensions would always be
197        /// empty.
198        #[prost(btree_map = "string, string", tag = "6")]
199        pub quota_dimensions: ::prost::alloc::collections::BTreeMap<
200            ::prost::alloc::string::String,
201            ::prost::alloc::string::String,
202        >,
203        /// The enforced quota value at the time of the `QuotaFailure`.
204        ///
205        /// For example, if the enforced quota value at the time of the
206        /// `QuotaFailure` on the number of CPUs is "10", then the value of this
207        /// field would reflect this quantity.
208        #[prost(int64, tag = "7")]
209        pub quota_value: i64,
210        /// The new quota value being rolled out at the time of the violation. At the
211        /// completion of the rollout, this value will be enforced in place of
212        /// quota_value. If no rollout is in progress at the time of the violation,
213        /// this field is not set.
214        ///
215        /// For example, if at the time of the violation a rollout is in progress
216        /// changing the number of CPUs quota from 10 to 20, 20 would be the value of
217        /// this field.
218        #[prost(int64, optional, tag = "8")]
219        pub future_quota_value: ::core::option::Option<i64>,
220    }
221}
222/// Describes what preconditions have failed.
223///
224/// For example, if an RPC failed because it required the Terms of Service to be
225/// acknowledged, it could list the terms of service violation in the
226/// PreconditionFailure message.
227#[derive(Clone, PartialEq, ::prost::Message)]
228pub struct PreconditionFailure {
229    /// Describes all precondition violations.
230    #[prost(message, repeated, tag = "1")]
231    pub violations: ::prost::alloc::vec::Vec<precondition_failure::Violation>,
232}
233/// Nested message and enum types in `PreconditionFailure`.
234pub mod precondition_failure {
235    /// A message type used to describe a single precondition failure.
236    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
237    pub struct Violation {
238        /// The type of PreconditionFailure. We recommend using a service-specific
239        /// enum type to define the supported precondition violation subjects. For
240        /// example, "TOS" for "Terms of Service violation".
241        #[prost(string, tag = "1")]
242        pub r#type: ::prost::alloc::string::String,
243        /// The subject, relative to the type, that failed.
244        /// For example, "google.com/cloud" relative to the "TOS" type would indicate
245        /// which terms of service is being referenced.
246        #[prost(string, tag = "2")]
247        pub subject: ::prost::alloc::string::String,
248        /// A description of how the precondition failed. Developers can use this
249        /// description to understand how to fix the failure.
250        ///
251        /// For example: "Terms of service not accepted".
252        #[prost(string, tag = "3")]
253        pub description: ::prost::alloc::string::String,
254    }
255}
256/// Describes violations in a client request. This error type focuses on the
257/// syntactic aspects of the request.
258#[derive(Clone, PartialEq, ::prost::Message)]
259pub struct BadRequest {
260    /// Describes all violations in a client request.
261    #[prost(message, repeated, tag = "1")]
262    pub field_violations: ::prost::alloc::vec::Vec<bad_request::FieldViolation>,
263}
264/// Nested message and enum types in `BadRequest`.
265pub mod bad_request {
266    /// A message type used to describe a single bad request field.
267    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
268    pub struct FieldViolation {
269        /// A path that leads to a field in the request body. The value will be a
270        /// sequence of dot-separated identifiers that identify a protocol buffer
271        /// field.
272        ///
273        /// Consider the following:
274        ///
275        /// ```text
276        /// message CreateContactRequest {
277        ///    message EmailAddress {
278        ///      enum Type {
279        ///        TYPE_UNSPECIFIED = 0;
280        ///        HOME = 1;
281        ///        WORK = 2;
282        ///      }
283        ///
284        ///      optional string email = 1;
285        ///      repeated EmailType type = 2;
286        ///    }
287        ///
288        ///    string full_name = 1;
289        ///    repeated EmailAddress email_addresses = 2;
290        /// }
291        /// ```
292        ///
293        /// In this example, in proto `field` could take one of the following values:
294        ///
295        /// * `full_name` for a violation in the `full_name` value
296        /// * `email_addresses\[1\].email` for a violation in the `email` field of the
297        ///   first `email_addresses` message
298        /// * `email_addresses\[3\].type\[2\]` for a violation in the second `type`
299        ///   value in the third `email_addresses` message.
300        ///
301        /// In JSON, the same values are represented as:
302        ///
303        /// * `fullName` for a violation in the `fullName` value
304        /// * `emailAddresses\[1\].email` for a violation in the `email` field of the
305        ///   first `emailAddresses` message
306        /// * `emailAddresses\[3\].type\[2\]` for a violation in the second `type`
307        ///   value in the third `emailAddresses` message.
308        #[prost(string, tag = "1")]
309        pub field: ::prost::alloc::string::String,
310        /// A description of why the request element is bad.
311        #[prost(string, tag = "2")]
312        pub description: ::prost::alloc::string::String,
313        /// The reason of the field-level error. This is a constant value that
314        /// identifies the proximate cause of the field-level error. It should
315        /// uniquely identify the type of the FieldViolation within the scope of the
316        /// google.rpc.ErrorInfo.domain. This should be at most 63
317        /// characters and match a regular expression of `[A-Z][A-Z0-9_]+\[A-Z0-9\]`,
318        /// which represents UPPER_SNAKE_CASE.
319        #[prost(string, tag = "3")]
320        pub reason: ::prost::alloc::string::String,
321        /// Provides a localized error message for field-level errors that is safe to
322        /// return to the API consumer.
323        #[prost(message, optional, tag = "4")]
324        pub localized_message: ::core::option::Option<super::LocalizedMessage>,
325    }
326}
327/// Contains metadata about the request that clients can attach when filing a bug
328/// or providing other forms of feedback.
329#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
330pub struct RequestInfo {
331    /// An opaque string that should only be interpreted by the service generating
332    /// it. For example, it can be used to identify requests in the service's logs.
333    #[prost(string, tag = "1")]
334    pub request_id: ::prost::alloc::string::String,
335    /// Any data that was used to serve this request. For example, an encrypted
336    /// stack trace that can be sent back to the service provider for debugging.
337    #[prost(string, tag = "2")]
338    pub serving_data: ::prost::alloc::string::String,
339}
340/// Describes the resource that is being accessed.
341#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
342pub struct ResourceInfo {
343    /// A name for the type of resource being accessed, e.g. "sql table",
344    /// "cloud storage bucket", "file", "Google calendar"; or the type URL
345    /// of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".
346    #[prost(string, tag = "1")]
347    pub resource_type: ::prost::alloc::string::String,
348    /// The name of the resource being accessed.  For example, a shared calendar
349    /// name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
350    /// error is
351    /// \[google.rpc.Code.PERMISSION_DENIED\]\[google.rpc.Code.PERMISSION_DENIED\].
352    #[prost(string, tag = "2")]
353    pub resource_name: ::prost::alloc::string::String,
354    /// The owner of the resource (optional).
355    /// For example, "user:<owner email>" or "project:<Google developer project
356    /// id>".
357    #[prost(string, tag = "3")]
358    pub owner: ::prost::alloc::string::String,
359    /// Describes what error is encountered when accessing this resource.
360    /// For example, updating a cloud project may require the `writer` permission
361    /// on the developer console project.
362    #[prost(string, tag = "4")]
363    pub description: ::prost::alloc::string::String,
364}
365/// Provides links to documentation or for performing an out of band action.
366///
367/// For example, if a quota check failed with an error indicating the calling
368/// project hasn't enabled the accessed service, this can contain a URL pointing
369/// directly to the right place in the developer console to flip the bit.
370#[derive(Clone, PartialEq, ::prost::Message)]
371pub struct Help {
372    /// URL(s) pointing to additional information on handling the current error.
373    #[prost(message, repeated, tag = "1")]
374    pub links: ::prost::alloc::vec::Vec<help::Link>,
375}
376/// Nested message and enum types in `Help`.
377pub mod help {
378    /// Describes a URL link.
379    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
380    pub struct Link {
381        /// Describes what the link offers.
382        #[prost(string, tag = "1")]
383        pub description: ::prost::alloc::string::String,
384        /// The URL of the link.
385        #[prost(string, tag = "2")]
386        pub url: ::prost::alloc::string::String,
387    }
388}
389/// Provides a localized error message that is safe to return to the user
390/// which can be attached to an RPC error.
391#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
392pub struct LocalizedMessage {
393    /// The locale used following the specification defined at
394    /// <https://www.rfc-editor.org/rfc/bcp/bcp47.txt.>
395    /// Examples are: "en-US", "fr-CH", "es-MX"
396    #[prost(string, tag = "1")]
397    pub locale: ::prost::alloc::string::String,
398    /// The localized error message in the above locale.
399    #[prost(string, tag = "2")]
400    pub message: ::prost::alloc::string::String,
401}