• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2023 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
15syntax = "proto3";
16
17package google.ads.searchads360.v0.errors;
18
19import "google/ads/searchads360/v0/common/value.proto";
20import "google/ads/searchads360/v0/errors/authentication_error.proto";
21import "google/ads/searchads360/v0/errors/authorization_error.proto";
22import "google/ads/searchads360/v0/errors/custom_column_error.proto";
23import "google/ads/searchads360/v0/errors/date_error.proto";
24import "google/ads/searchads360/v0/errors/date_range_error.proto";
25import "google/ads/searchads360/v0/errors/distinct_error.proto";
26import "google/ads/searchads360/v0/errors/header_error.proto";
27import "google/ads/searchads360/v0/errors/internal_error.proto";
28import "google/ads/searchads360/v0/errors/invalid_parameter_error.proto";
29import "google/ads/searchads360/v0/errors/query_error.proto";
30import "google/ads/searchads360/v0/errors/quota_error.proto";
31import "google/ads/searchads360/v0/errors/request_error.proto";
32import "google/ads/searchads360/v0/errors/size_limit_error.proto";
33import "google/protobuf/duration.proto";
34
35option csharp_namespace = "Google.Ads.SearchAds360.V0.Errors";
36option go_package = "google.golang.org/genproto/googleapis/ads/searchads360/v0/errors;errors";
37option java_multiple_files = true;
38option java_outer_classname = "ErrorsProto";
39option java_package = "com.google.ads.searchads360.v0.errors";
40option objc_class_prefix = "GASA360";
41option php_namespace = "Google\\Ads\\SearchAds360\\V0\\Errors";
42option ruby_package = "Google::Ads::SearchAds360::V0::Errors";
43
44// Proto file describing the common error protos
45
46// Describes how a Search Ads 360 API call failed. It's returned inside
47// google.rpc.Status.details when a call fails.
48message SearchAds360Failure {
49  // The list of errors that occurred.
50  repeated SearchAds360Error errors = 1;
51
52  // The unique ID of the request that is used for debugging purposes.
53  string request_id = 2;
54}
55
56// SearchAds360-specific error.
57message SearchAds360Error {
58  // An enum value that indicates which error occurred.
59  ErrorCode error_code = 1;
60
61  // A human-readable description of the error.
62  string message = 2;
63
64  // The value that triggered the error.
65  google.ads.searchads360.v0.common.Value trigger = 3;
66
67  // Describes the part of the request proto that caused the error.
68  ErrorLocation location = 4;
69
70  // Additional error details, which are returned by certain error codes. Most
71  // error codes do not include details.
72  ErrorDetails details = 5;
73}
74
75// The error reason represented by type and enum.
76message ErrorCode {
77  // The list of error enums
78  oneof error_code {
79    // An error caused by the request
80    RequestErrorEnum.RequestError request_error = 1;
81
82    // An error with the query
83    QueryErrorEnum.QueryError query_error = 5;
84
85    // An error encountered when trying to authorize a user.
86    AuthorizationErrorEnum.AuthorizationError authorization_error = 9;
87
88    // An unexpected server-side error.
89    InternalErrorEnum.InternalError internal_error = 10;
90
91    // An error with the amount of quota remaining.
92    QuotaErrorEnum.QuotaError quota_error = 11;
93
94    // Indicates failure to properly authenticate user.
95    AuthenticationErrorEnum.AuthenticationError authentication_error = 17;
96
97    // The reasons for the date error
98    DateErrorEnum.DateError date_error = 33;
99
100    // The reasons for the date range error
101    DateRangeErrorEnum.DateRangeError date_range_error = 34;
102
103    // The reasons for the distinct error
104    DistinctErrorEnum.DistinctError distinct_error = 35;
105
106    // The reasons for the header error.
107    HeaderErrorEnum.HeaderError header_error = 66;
108
109    // The reasons for the size limit error
110    SizeLimitErrorEnum.SizeLimitError size_limit_error = 118;
111
112    // The reasons for the custom column error
113    CustomColumnErrorEnum.CustomColumnError custom_column_error = 144;
114
115    // The reasons for invalid parameter errors.
116    InvalidParameterErrorEnum.InvalidParameterError invalid_parameter_error =
117        175;
118  }
119}
120
121// Describes the part of the request proto that caused the error.
122message ErrorLocation {
123  // A part of a field path.
124  message FieldPathElement {
125    // The name of a field or a oneof
126    string field_name = 1;
127
128    // If field_name is a repeated field, this is the element that failed
129    optional int32 index = 3;
130  }
131
132  // A field path that indicates which field was invalid in the request.
133  repeated FieldPathElement field_path_elements = 2;
134}
135
136// Additional error details.
137message ErrorDetails {
138  // The error code that should have been returned, but wasn't. This is used
139  // when the error code is not published in the client specified version.
140  string unpublished_error_code = 1;
141
142  // Details on the quota error, including the scope (account or developer), the
143  // rate bucket name and the retry delay.
144  QuotaErrorDetails quota_error_details = 4;
145}
146
147// Additional quota error details when there is QuotaError.
148message QuotaErrorDetails {
149  // Enum of possible scopes that quota buckets belong to.
150  enum QuotaRateScope {
151    // Unspecified enum
152    UNSPECIFIED = 0;
153
154    // Used for return value only. Represents value unknown in this version.
155    UNKNOWN = 1;
156
157    // Per customer account quota
158    ACCOUNT = 2;
159
160    // Per project quota
161    DEVELOPER = 3;
162  }
163
164  // The rate scope of the quota limit.
165  QuotaRateScope rate_scope = 1;
166
167  // The high level description of the quota bucket.
168  // Examples are "Get requests for standard access" or "Requests per account".
169  string rate_name = 2;
170
171  // Backoff period that customers should wait before sending next request.
172  google.protobuf.Duration retry_delay = 3;
173}
174