github.com/resonatecoop/user-api@v1.0.0-13.0.20220915120639-05dc9c04014a/third_party/googleapis/google/rpc/error_details.proto (about)

     1  // Copyright 2020 Google LLC
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  syntax = "proto3";
    16  
    17  package google.rpc;
    18  
    19  import "google/protobuf/duration.proto";
    20  
    21  option go_package = "google.golang.org/genproto/googleapis/rpc/errdetails;errdetails";
    22  option java_multiple_files = true;
    23  option java_outer_classname = "ErrorDetailsProto";
    24  option java_package = "com.google.rpc";
    25  option objc_class_prefix = "RPC";
    26  
    27  // Describes when the clients can retry a failed request. Clients could ignore
    28  // the recommendation here or retry when this information is missing from error
    29  // responses.
    30  //
    31  // It's always recommended that clients should use exponential backoff when
    32  // retrying.
    33  //
    34  // Clients should wait until `retry_delay` amount of time has passed since
    35  // receiving the error response before retrying.  If retrying requests also
    36  // fail, clients should use an exponential backoff scheme to gradually increase
    37  // the delay between retries based on `retry_delay`, until either a maximum
    38  // number of retries have been reached or a maximum retry delay cap has been
    39  // reached.
    40  message RetryInfo {
    41    // Clients should wait at least this long between retrying the same request.
    42    google.protobuf.Duration retry_delay = 1;
    43  }
    44  
    45  // Describes additional debugging info.
    46  message DebugInfo {
    47    // The stack trace entries indicating where the error occurred.
    48    repeated string stack_entries = 1;
    49  
    50    // Additional debugging information provided by the server.
    51    string detail = 2;
    52  }
    53  
    54  // Describes how a quota check failed.
    55  //
    56  // For example if a daily limit was exceeded for the calling project,
    57  // a service could respond with a QuotaFailure detail containing the project
    58  // id and the description of the quota limit that was exceeded.  If the
    59  // calling project hasn't enabled the service in the developer console, then
    60  // a service could respond with the project id and set `service_disabled`
    61  // to true.
    62  //
    63  // Also see RetryInfo and Help types for other details about handling a
    64  // quota failure.
    65  message QuotaFailure {
    66    // A message type used to describe a single quota violation.  For example, a
    67    // daily quota or a custom quota that was exceeded.
    68    message Violation {
    69      // The subject on which the quota check failed.
    70      // For example, "clientip:<ip address of client>" or "project:<Google
    71      // developer project id>".
    72      string subject = 1;
    73  
    74      // A description of how the quota check failed. Clients can use this
    75      // description to find more about the quota configuration in the service's
    76      // public documentation, or find the relevant quota limit to adjust through
    77      // developer console.
    78      //
    79      // For example: "Service disabled" or "Daily Limit for read operations
    80      // exceeded".
    81      string description = 2;
    82    }
    83  
    84    // Describes all quota violations.
    85    repeated Violation violations = 1;
    86  }
    87  
    88  // Describes the cause of the error with structured details.
    89  //
    90  // Example of an error when contacting the "pubsub.googleapis.com" API when it
    91  // is not enabled:
    92  //
    93  //     { "reason": "API_DISABLED"
    94  //       "domain": "googleapis.com"
    95  //       "metadata": {
    96  //         "resource": "projects/123",
    97  //         "service": "pubsub.googleapis.com"
    98  //       }
    99  //     }
   100  //
   101  // This response indicates that the pubsub.googleapis.com API is not enabled.
   102  //
   103  // Example of an error that is returned when attempting to create a Spanner
   104  // instance in a region that is out of stock:
   105  //
   106  //     { "reason": "STOCKOUT"
   107  //       "domain": "spanner.googleapis.com",
   108  //       "metadata": {
   109  //         "availableRegions": "us-central1,us-east2"
   110  //       }
   111  //     }
   112  message ErrorInfo {
   113    // The reason of the error. This is a constant value that identifies the
   114    // proximate cause of the error. Error reasons are unique within a particular
   115    // domain of errors. This should be at most 63 characters and match
   116    // /[A-Z0-9_]+/.
   117    string reason = 1;
   118  
   119    // The logical grouping to which the "reason" belongs. The error domain
   120    // is typically the registered service name of the tool or product that
   121    // generates the error. Example: "pubsub.googleapis.com". If the error is
   122    // generated by some common infrastructure, the error domain must be a
   123    // globally unique value that identifies the infrastructure. For Google API
   124    // infrastructure, the error domain is "googleapis.com".
   125    string domain = 2;
   126  
   127    // Additional structured details about this error.
   128    //
   129    // Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
   130    // length. When identifying the current value of an exceeded limit, the units
   131    // should be contained in the key, not the value.  For example, rather than
   132    // {"instanceLimit": "100/request"}, should be returned as,
   133    // {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
   134    // instances that can be created in a single (batch) request.
   135    map<string, string> metadata = 3;
   136  }
   137  
   138  // Describes what preconditions have failed.
   139  //
   140  // For example, if an RPC failed because it required the Terms of Service to be
   141  // acknowledged, it could list the terms of service violation in the
   142  // PreconditionFailure message.
   143  message PreconditionFailure {
   144    // A message type used to describe a single precondition failure.
   145    message 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      string type = 1;
   150  
   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      string subject = 2;
   155  
   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      string description = 3;
   161    }
   162  
   163    // Describes all precondition violations.
   164    repeated Violation violations = 1;
   165  }
   166  
   167  // Describes violations in a client request. This error type focuses on the
   168  // syntactic aspects of the request.
   169  message BadRequest {
   170    // A message type used to describe a single bad request field.
   171    message FieldViolation {
   172      // A path leading to a field in the request body. The value will be a
   173      // sequence of dot-separated identifiers that identify a protocol buffer
   174      // field. E.g., "field_violations.field" would identify this field.
   175      string field = 1;
   176  
   177      // A description of why the request element is bad.
   178      string description = 2;
   179    }
   180  
   181    // Describes all violations in a client request.
   182    repeated FieldViolation field_violations = 1;
   183  }
   184  
   185  // Contains metadata about the request that clients can attach when filing a bug
   186  // or providing other forms of feedback.
   187  message RequestInfo {
   188    // An opaque string that should only be interpreted by the service generating
   189    // it. For example, it can be used to identify requests in the service's logs.
   190    string request_id = 1;
   191  
   192    // Any data that was used to serve this request. For example, an encrypted
   193    // stack trace that can be sent back to the service provider for debugging.
   194    string serving_data = 2;
   195  }
   196  
   197  // Describes the resource that is being accessed.
   198  message ResourceInfo {
   199    // A name for the type of resource being accessed, e.g. "sql table",
   200    // "cloud storage bucket", "file", "Google calendar"; or the type URL
   201    // of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".
   202    string resource_type = 1;
   203  
   204    // The name of the resource being accessed.  For example, a shared calendar
   205    // name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
   206    // error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
   207    string resource_name = 2;
   208  
   209    // The owner of the resource (optional).
   210    // For example, "user:<owner email>" or "project:<Google developer project
   211    // id>".
   212    string owner = 3;
   213  
   214    // Describes what error is encountered when accessing this resource.
   215    // For example, updating a cloud project may require the `writer` permission
   216    // on the developer console project.
   217    string description = 4;
   218  }
   219  
   220  // Provides links to documentation or for performing an out of band action.
   221  //
   222  // For example, if a quota check failed with an error indicating the calling
   223  // project hasn't enabled the accessed service, this can contain a URL pointing
   224  // directly to the right place in the developer console to flip the bit.
   225  message Help {
   226    // Describes a URL link.
   227    message Link {
   228      // Describes what the link offers.
   229      string description = 1;
   230  
   231      // The URL of the link.
   232      string url = 2;
   233    }
   234  
   235    // URL(s) pointing to additional information on handling the current error.
   236    repeated Link links = 1;
   237  }
   238  
   239  // Provides a localized error message that is safe to return to the user
   240  // which can be attached to an RPC error.
   241  message LocalizedMessage {
   242    // The locale used following the specification defined at
   243    // http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
   244    // Examples are: "en-US", "fr-CH", "es-MX"
   245    string locale = 1;
   246  
   247    // The localized error message in the above locale.
   248    string message = 2;
   249  }