sui_rpc/proto/generated/
google.rpc.rs

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