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,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,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, ::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, ::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, ::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
116 /// developer project id>`.
117 #[prost(string, tag = "1")]
118 pub subject: ::prost::alloc::string::String,
119 /// A description of how the quota check failed. Clients can use this
120 /// description to find more about the quota configuration in the service's
121 /// public documentation, or find the relevant quota limit to adjust through
122 /// developer console.
123 ///
124 /// For example: "Service disabled" or "Daily Limit for read operations
125 /// exceeded".
126 #[prost(string, tag = "2")]
127 pub description: ::prost::alloc::string::String,
128 }
129}
130/// Describes what preconditions have failed.
131///
132/// For example, if an RPC failed because it required the Terms of Service to be
133/// acknowledged, it could list the terms of service violation in the
134/// PreconditionFailure message.
135#[derive(Clone, PartialEq, ::prost::Message)]
136pub struct PreconditionFailure {
137 /// Describes all precondition violations.
138 #[prost(message, repeated, tag = "1")]
139 pub violations: ::prost::alloc::vec::Vec<precondition_failure::Violation>,
140}
141/// Nested message and enum types in `PreconditionFailure`.
142pub mod precondition_failure {
143 /// A message type used to describe a single precondition failure.
144 #[derive(Clone, PartialEq, ::prost::Message)]
145 pub struct Violation {
146 /// The type of PreconditionFailure. We recommend using a service-specific
147 /// enum type to define the supported precondition violation subjects. For
148 /// example, "TOS" for "Terms of Service violation".
149 #[prost(string, tag = "1")]
150 pub r#type: ::prost::alloc::string::String,
151 /// The subject, relative to the type, that failed.
152 /// For example, "google.com/cloud" relative to the "TOS" type would indicate
153 /// which terms of service is being referenced.
154 #[prost(string, tag = "2")]
155 pub subject: ::prost::alloc::string::String,
156 /// A description of how the precondition failed. Developers can use this
157 /// description to understand how to fix the failure.
158 ///
159 /// For example: "Terms of service not accepted".
160 #[prost(string, tag = "3")]
161 pub description: ::prost::alloc::string::String,
162 }
163}
164/// Describes violations in a client request. This error type focuses on the
165/// syntactic aspects of the request.
166#[derive(Clone, PartialEq, ::prost::Message)]
167pub struct BadRequest {
168 /// Describes all violations in a client request.
169 #[prost(message, repeated, tag = "1")]
170 pub field_violations: ::prost::alloc::vec::Vec<bad_request::FieldViolation>,
171}
172/// Nested message and enum types in `BadRequest`.
173pub mod bad_request {
174 /// A message type used to describe a single bad request field.
175 #[derive(Clone, PartialEq, ::prost::Message)]
176 pub struct FieldViolation {
177 /// A path that leads to a field in the request body. The value will be a
178 /// sequence of dot-separated identifiers that identify a protocol buffer
179 /// field.
180 ///
181 /// Consider the following:
182 ///
183 /// ```text,json
184 /// message CreateContactRequest {
185 /// message EmailAddress {
186 /// enum Type {
187 /// TYPE_UNSPECIFIED = 0;
188 /// HOME = 1;
189 /// WORK = 2;
190 /// }
191 ///
192 /// optional string email = 1;
193 /// repeated EmailType type = 2;
194 /// }
195 ///
196 /// string full_name = 1;
197 /// repeated EmailAddress email_addresses = 2;
198 /// }
199 /// ```
200 ///
201 /// In this example, in proto `field` could take one of the following values:
202 ///
203 /// * `full_name` for a violation in the `full_name` value
204 /// * `email_addresses\[1\].email` for a violation in the `email` field of the
205 /// first `email_addresses` message
206 /// * `email_addresses\[3\].type\[2\]` for a violation in the second `type`
207 /// value in the third `email_addresses` message.
208 ///
209 /// In JSON, the same values are represented as:
210 ///
211 /// * `fullName` for a violation in the `fullName` value
212 /// * `emailAddresses\[1\].email` for a violation in the `email` field of the
213 /// first `emailAddresses` message
214 /// * `emailAddresses\[3\].type\[2\]` for a violation in the second `type`
215 /// value in the third `emailAddresses` message.
216 #[prost(string, tag = "1")]
217 pub field: ::prost::alloc::string::String,
218 /// A description of why the request element is bad.
219 #[prost(string, tag = "2")]
220 pub description: ::prost::alloc::string::String,
221 /// The reason of the field-level error. This is a constant value that
222 /// identifies the proximate cause of the field-level error. It should
223 /// uniquely identify the type of the FieldViolation within the scope of the
224 /// google.rpc.ErrorInfo.domain. This should be at most 63
225 /// characters and match a regular expression of `[A-Z][A-Z0-9_]+\[A-Z0-9\]`,
226 /// which represents UPPER_SNAKE_CASE.
227 #[prost(string, tag = "3")]
228 pub reason: ::prost::alloc::string::String,
229 /// Provides a localized error message for field-level errors that is safe to
230 /// return to the API consumer.
231 #[prost(message, optional, tag = "4")]
232 pub localized_message: ::core::option::Option<super::LocalizedMessage>,
233 }
234}
235/// Contains metadata about the request that clients can attach when filing a bug
236/// or providing other forms of feedback.
237#[derive(Clone, PartialEq, ::prost::Message)]
238pub struct RequestInfo {
239 /// An opaque string that should only be interpreted by the service generating
240 /// it. For example, it can be used to identify requests in the service's logs.
241 #[prost(string, tag = "1")]
242 pub request_id: ::prost::alloc::string::String,
243 /// Any data that was used to serve this request. For example, an encrypted
244 /// stack trace that can be sent back to the service provider for debugging.
245 #[prost(string, tag = "2")]
246 pub serving_data: ::prost::alloc::string::String,
247}
248/// Describes the resource that is being accessed.
249#[derive(Clone, PartialEq, ::prost::Message)]
250pub struct ResourceInfo {
251 /// A name for the type of resource being accessed, e.g. "sql table",
252 /// "cloud storage bucket", "file", "Google calendar"; or the type URL
253 /// of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".
254 #[prost(string, tag = "1")]
255 pub resource_type: ::prost::alloc::string::String,
256 /// The name of the resource being accessed. For example, a shared calendar
257 /// name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
258 /// error is
259 /// [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
260 #[prost(string, tag = "2")]
261 pub resource_name: ::prost::alloc::string::String,
262 /// The owner of the resource (optional).
263 /// For example, `user:<owner email>` or `project:<Google developer project
264 /// id>`.
265 #[prost(string, tag = "3")]
266 pub owner: ::prost::alloc::string::String,
267 /// Describes what error is encountered when accessing this resource.
268 /// For example, updating a cloud project may require the `writer` permission
269 /// on the developer console project.
270 #[prost(string, tag = "4")]
271 pub description: ::prost::alloc::string::String,
272}
273/// Provides links to documentation or for performing an out of band action.
274///
275/// For example, if a quota check failed with an error indicating the calling
276/// project hasn't enabled the accessed service, this can contain a URL pointing
277/// directly to the right place in the developer console to flip the bit.
278#[derive(Clone, PartialEq, ::prost::Message)]
279pub struct Help {
280 /// URL(s) pointing to additional information on handling the current error.
281 #[prost(message, repeated, tag = "1")]
282 pub links: ::prost::alloc::vec::Vec<help::Link>,
283}
284/// Nested message and enum types in `Help`.
285pub mod help {
286 /// Describes a URL link.
287 #[derive(Clone, PartialEq, ::prost::Message)]
288 pub struct Link {
289 /// Describes what the link offers.
290 #[prost(string, tag = "1")]
291 pub description: ::prost::alloc::string::String,
292 /// The URL of the link.
293 #[prost(string, tag = "2")]
294 pub url: ::prost::alloc::string::String,
295 }
296}
297/// Provides a localized error message that is safe to return to the user
298/// which can be attached to an RPC error.
299#[derive(Clone, PartialEq, ::prost::Message)]
300pub struct LocalizedMessage {
301 /// The locale used following the specification defined at
302 /// <https://www.rfc-editor.org/rfc/bcp/bcp47.txt.>
303 /// Examples are: "en-US", "fr-CH", "es-MX"
304 #[prost(string, tag = "1")]
305 pub locale: ::prost::alloc::string::String,
306 /// The localized error message in the above locale.
307 #[prost(string, tag = "2")]
308 pub message: ::prost::alloc::string::String,
309}
310/// The `Status` type defines a logical error model that is suitable for
311/// different programming environments, including REST APIs and RPC APIs. It is
312/// used by [gRPC](<https://github.com/grpc>). Each `Status` message contains
313/// three pieces of data: error code, error message, and error details.
314///
315/// You can find out more about this error model and how to work with it in the
316/// [API Design Guide](<https://cloud.google.com/apis/design/errors>).
317#[derive(Clone, PartialEq, ::prost::Message)]
318pub struct Status {
319 /// The status code, which should be an enum value of
320 /// [google.rpc.Code][google.rpc.Code].
321 #[prost(int32, tag = "1")]
322 pub code: i32,
323 /// A developer-facing error message, which should be in English. Any
324 /// user-facing error message should be localized and sent in the
325 /// [google.rpc.Status.details][google.rpc.Status.details] field, or localized
326 /// by the client.
327 #[prost(string, tag = "2")]
328 pub message: ::prost::alloc::string::String,
329 /// A list of messages that carry the error details. There is a common set of
330 /// message types for APIs to use.
331 #[prost(message, repeated, tag = "3")]
332 pub details: ::prost::alloc::vec::Vec<::prost_types::Any>,
333}