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