OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis.runtimeconfig.v1; | 3 library googleapis.runtimeconfig.v1; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
11 | 11 |
12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' |
13 ApiRequestError, DetailedApiRequestError; | 13 show ApiRequestError, DetailedApiRequestError; |
14 | 14 |
15 const core.String USER_AGENT = 'dart-api-client runtimeconfig/v1'; | 15 const core.String USER_AGENT = 'dart-api-client runtimeconfig/v1'; |
16 | 16 |
17 /** | 17 /// The Runtime Configurator allows you to dynamically configure and expose |
18 * The Runtime Configurator allows you to dynamically configure and expose | 18 /// variables through Google Cloud Platform. In addition, you can also set |
19 * variables through Google Cloud Platform. In addition, you can also set | 19 /// Watchers and Waiters that will watch for changes to your data and return |
20 * Watchers and Waiters that will watch for changes to your data and return | 20 /// based on certain conditions. |
21 * based on certain conditions. | |
22 */ | |
23 class RuntimeconfigApi { | 21 class RuntimeconfigApi { |
24 /** View and manage your data across Google Cloud Platform services */ | 22 /// View and manage your data across Google Cloud Platform services |
25 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; | 23 static const CloudPlatformScope = |
| 24 "https://www.googleapis.com/auth/cloud-platform"; |
26 | 25 |
27 /** Manage your Google Cloud Platform services' runtime configuration */ | 26 /// Manage your Google Cloud Platform services' runtime configuration |
28 static const CloudruntimeconfigScope = "https://www.googleapis.com/auth/cloudr
untimeconfig"; | 27 static const CloudruntimeconfigScope = |
29 | 28 "https://www.googleapis.com/auth/cloudruntimeconfig"; |
30 | 29 |
31 final commons.ApiRequester _requester; | 30 final commons.ApiRequester _requester; |
32 | 31 |
33 OperationsResourceApi get operations => new OperationsResourceApi(_requester); | 32 OperationsResourceApi get operations => new OperationsResourceApi(_requester); |
34 | 33 |
35 RuntimeconfigApi(http.Client client, {core.String rootUrl: "https://runtimecon
fig.googleapis.com/", core.String servicePath: ""}) : | 34 RuntimeconfigApi(http.Client client, |
36 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 35 {core.String rootUrl: "https://runtimeconfig.googleapis.com/", |
| 36 core.String servicePath: ""}) |
| 37 : _requester = |
| 38 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT); |
37 } | 39 } |
38 | 40 |
39 | |
40 class OperationsResourceApi { | 41 class OperationsResourceApi { |
41 final commons.ApiRequester _requester; | 42 final commons.ApiRequester _requester; |
42 | 43 |
43 OperationsResourceApi(commons.ApiRequester client) : | 44 OperationsResourceApi(commons.ApiRequester client) : _requester = client; |
44 _requester = client; | |
45 | 45 |
46 /** | 46 /// Starts asynchronous cancellation on a long-running operation. The server |
47 * Starts asynchronous cancellation on a long-running operation. The server | 47 /// makes a best effort to cancel the operation, but success is not |
48 * makes a best effort to cancel the operation, but success is not | 48 /// guaranteed. If the server doesn't support this method, it returns |
49 * guaranteed. If the server doesn't support this method, it returns | 49 /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use |
50 * `google.rpc.Code.UNIMPLEMENTED`. Clients can use | 50 /// Operations.GetOperation or |
51 * Operations.GetOperation or | 51 /// other methods to check whether the cancellation succeeded or whether the |
52 * other methods to check whether the cancellation succeeded or whether the | 52 /// operation completed despite cancellation. On successful cancellation, |
53 * operation completed despite cancellation. On successful cancellation, | 53 /// the operation is not deleted; instead, it becomes an operation with |
54 * the operation is not deleted; instead, it becomes an operation with | 54 /// an Operation.error value with a google.rpc.Status.code of 1, |
55 * an Operation.error value with a google.rpc.Status.code of 1, | 55 /// corresponding to `Code.CANCELLED`. |
56 * corresponding to `Code.CANCELLED`. | 56 /// |
57 * | 57 /// [request] - The metadata request object. |
58 * [request] - The metadata request object. | 58 /// |
59 * | 59 /// Request parameters: |
60 * Request parameters: | 60 /// |
61 * | 61 /// [name] - The name of the operation resource to be cancelled. |
62 * [name] - The name of the operation resource to be cancelled. | 62 /// Value must have pattern "^operations/.+$". |
63 * Value must have pattern "^operations/.+$". | 63 /// |
64 * | 64 /// Completes with a [Empty]. |
65 * Completes with a [Empty]. | 65 /// |
66 * | 66 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
67 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 67 /// an error. |
68 * error. | 68 /// |
69 * | 69 /// If the used [http.Client] completes with an error when making a REST |
70 * If the used [http.Client] completes with an error when making a REST call, | 70 /// call, this method will complete with the same error. |
71 * this method will complete with the same error. | |
72 */ | |
73 async.Future<Empty> cancel(CancelOperationRequest request, core.String name) { | 71 async.Future<Empty> cancel(CancelOperationRequest request, core.String name) { |
74 var _url = null; | 72 var _url = null; |
75 var _queryParams = new core.Map(); | 73 var _queryParams = new core.Map(); |
76 var _uploadMedia = null; | 74 var _uploadMedia = null; |
77 var _uploadOptions = null; | 75 var _uploadOptions = null; |
78 var _downloadOptions = commons.DownloadOptions.Metadata; | 76 var _downloadOptions = commons.DownloadOptions.Metadata; |
79 var _body = null; | 77 var _body = null; |
80 | 78 |
81 if (request != null) { | 79 if (request != null) { |
82 _body = convert.JSON.encode((request).toJson()); | 80 _body = convert.JSON.encode((request).toJson()); |
83 } | 81 } |
84 if (name == null) { | 82 if (name == null) { |
85 throw new core.ArgumentError("Parameter name is required."); | 83 throw new core.ArgumentError("Parameter name is required."); |
86 } | 84 } |
87 | 85 |
88 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name') + ':cancel'; | 86 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name') + ':cancel'; |
89 | 87 |
90 var _response = _requester.request(_url, | 88 var _response = _requester.request(_url, "POST", |
91 "POST", | 89 body: _body, |
92 body: _body, | 90 queryParams: _queryParams, |
93 queryParams: _queryParams, | 91 uploadOptions: _uploadOptions, |
94 uploadOptions: _uploadOptions, | 92 uploadMedia: _uploadMedia, |
95 uploadMedia: _uploadMedia, | 93 downloadOptions: _downloadOptions); |
96 downloadOptions: _downloadOptions); | |
97 return _response.then((data) => new Empty.fromJson(data)); | 94 return _response.then((data) => new Empty.fromJson(data)); |
98 } | 95 } |
99 | 96 |
100 /** | 97 /// Deletes a long-running operation. This method indicates that the client |
101 * Deletes a long-running operation. This method indicates that the client is | 98 /// is |
102 * no longer interested in the operation result. It does not cancel the | 99 /// no longer interested in the operation result. It does not cancel the |
103 * operation. If the server doesn't support this method, it returns | 100 /// operation. If the server doesn't support this method, it returns |
104 * `google.rpc.Code.UNIMPLEMENTED`. | 101 /// `google.rpc.Code.UNIMPLEMENTED`. |
105 * | 102 /// |
106 * Request parameters: | 103 /// Request parameters: |
107 * | 104 /// |
108 * [name] - The name of the operation resource to be deleted. | 105 /// [name] - The name of the operation resource to be deleted. |
109 * Value must have pattern "^operations/.+$". | 106 /// Value must have pattern "^operations/.+$". |
110 * | 107 /// |
111 * Completes with a [Empty]. | 108 /// Completes with a [Empty]. |
112 * | 109 /// |
113 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 110 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
114 * error. | 111 /// an error. |
115 * | 112 /// |
116 * If the used [http.Client] completes with an error when making a REST call, | 113 /// If the used [http.Client] completes with an error when making a REST |
117 * this method will complete with the same error. | 114 /// call, this method will complete with the same error. |
118 */ | |
119 async.Future<Empty> delete(core.String name) { | 115 async.Future<Empty> delete(core.String name) { |
120 var _url = null; | 116 var _url = null; |
121 var _queryParams = new core.Map(); | 117 var _queryParams = new core.Map(); |
122 var _uploadMedia = null; | 118 var _uploadMedia = null; |
123 var _uploadOptions = null; | 119 var _uploadOptions = null; |
124 var _downloadOptions = commons.DownloadOptions.Metadata; | 120 var _downloadOptions = commons.DownloadOptions.Metadata; |
125 var _body = null; | 121 var _body = null; |
126 | 122 |
127 if (name == null) { | 123 if (name == null) { |
128 throw new core.ArgumentError("Parameter name is required."); | 124 throw new core.ArgumentError("Parameter name is required."); |
129 } | 125 } |
130 | 126 |
131 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 127 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
132 | 128 |
133 var _response = _requester.request(_url, | 129 var _response = _requester.request(_url, "DELETE", |
134 "DELETE", | 130 body: _body, |
135 body: _body, | 131 queryParams: _queryParams, |
136 queryParams: _queryParams, | 132 uploadOptions: _uploadOptions, |
137 uploadOptions: _uploadOptions, | 133 uploadMedia: _uploadMedia, |
138 uploadMedia: _uploadMedia, | 134 downloadOptions: _downloadOptions); |
139 downloadOptions: _downloadOptions); | |
140 return _response.then((data) => new Empty.fromJson(data)); | 135 return _response.then((data) => new Empty.fromJson(data)); |
141 } | 136 } |
142 | 137 |
143 /** | 138 /// Lists operations that match the specified filter in the request. If the |
144 * Lists operations that match the specified filter in the request. If the | 139 /// server doesn't support this method, it returns `UNIMPLEMENTED`. |
145 * server doesn't support this method, it returns `UNIMPLEMENTED`. | 140 /// |
146 * | 141 /// NOTE: the `name` binding allows API services to override the binding |
147 * NOTE: the `name` binding allows API services to override the binding | 142 /// to use different resource name schemes, such as `users / * /operations`. |
148 * to use different resource name schemes, such as `users / * /operations`. To | 143 /// To |
149 * override the binding, API services can add a binding such as | 144 /// override the binding, API services can add a binding such as |
150 * `"/v1/{name=users / * }/operations"` to their service configuration. | 145 /// `"/v1/{name=users / * }/operations"` to their service configuration. |
151 * For backwards compatibility, the default name includes the operations | 146 /// For backwards compatibility, the default name includes the operations |
152 * collection id, however overriding users must ensure the name binding | 147 /// collection id, however overriding users must ensure the name binding |
153 * is the parent resource, without the operations collection id. | 148 /// is the parent resource, without the operations collection id. |
154 * | 149 /// |
155 * Request parameters: | 150 /// Request parameters: |
156 * | 151 /// |
157 * [name] - The name of the operation's parent resource. | 152 /// [name] - The name of the operation's parent resource. |
158 * Value must have pattern "^operations$". | 153 /// Value must have pattern "^operations$". |
159 * | 154 /// |
160 * [pageToken] - The standard list page token. | 155 /// [filter] - The standard list filter. |
161 * | 156 /// |
162 * [pageSize] - The standard list page size. | 157 /// [pageToken] - The standard list page token. |
163 * | 158 /// |
164 * [filter] - The standard list filter. | 159 /// [pageSize] - The standard list page size. |
165 * | 160 /// |
166 * Completes with a [ListOperationsResponse]. | 161 /// Completes with a [ListOperationsResponse]. |
167 * | 162 /// |
168 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 163 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
169 * error. | 164 /// an error. |
170 * | 165 /// |
171 * If the used [http.Client] completes with an error when making a REST call, | 166 /// If the used [http.Client] completes with an error when making a REST |
172 * this method will complete with the same error. | 167 /// call, this method will complete with the same error. |
173 */ | 168 async.Future<ListOperationsResponse> list(core.String name, |
174 async.Future<ListOperationsResponse> list(core.String name, {core.String pageT
oken, core.int pageSize, core.String filter}) { | 169 {core.String filter, core.String pageToken, core.int pageSize}) { |
175 var _url = null; | 170 var _url = null; |
176 var _queryParams = new core.Map(); | 171 var _queryParams = new core.Map(); |
177 var _uploadMedia = null; | 172 var _uploadMedia = null; |
178 var _uploadOptions = null; | 173 var _uploadOptions = null; |
179 var _downloadOptions = commons.DownloadOptions.Metadata; | 174 var _downloadOptions = commons.DownloadOptions.Metadata; |
180 var _body = null; | 175 var _body = null; |
181 | 176 |
182 if (name == null) { | 177 if (name == null) { |
183 throw new core.ArgumentError("Parameter name is required."); | 178 throw new core.ArgumentError("Parameter name is required."); |
184 } | 179 } |
| 180 if (filter != null) { |
| 181 _queryParams["filter"] = [filter]; |
| 182 } |
185 if (pageToken != null) { | 183 if (pageToken != null) { |
186 _queryParams["pageToken"] = [pageToken]; | 184 _queryParams["pageToken"] = [pageToken]; |
187 } | 185 } |
188 if (pageSize != null) { | 186 if (pageSize != null) { |
189 _queryParams["pageSize"] = ["${pageSize}"]; | 187 _queryParams["pageSize"] = ["${pageSize}"]; |
190 } | 188 } |
191 if (filter != null) { | |
192 _queryParams["filter"] = [filter]; | |
193 } | |
194 | 189 |
195 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 190 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
196 | 191 |
197 var _response = _requester.request(_url, | 192 var _response = _requester.request(_url, "GET", |
198 "GET", | 193 body: _body, |
199 body: _body, | 194 queryParams: _queryParams, |
200 queryParams: _queryParams, | 195 uploadOptions: _uploadOptions, |
201 uploadOptions: _uploadOptions, | 196 uploadMedia: _uploadMedia, |
202 uploadMedia: _uploadMedia, | 197 downloadOptions: _downloadOptions); |
203 downloadOptions: _downloadOptions); | |
204 return _response.then((data) => new ListOperationsResponse.fromJson(data)); | 198 return _response.then((data) => new ListOperationsResponse.fromJson(data)); |
205 } | 199 } |
206 | |
207 } | 200 } |
208 | 201 |
209 | 202 /// The request message for Operations.CancelOperation. |
210 | |
211 /** The request message for Operations.CancelOperation. */ | |
212 class CancelOperationRequest { | 203 class CancelOperationRequest { |
213 | |
214 CancelOperationRequest(); | 204 CancelOperationRequest(); |
215 | 205 |
216 CancelOperationRequest.fromJson(core.Map _json) { | 206 CancelOperationRequest.fromJson(core.Map _json) {} |
217 } | |
218 | 207 |
219 core.Map<core.String, core.Object> toJson() { | 208 core.Map<core.String, core.Object> toJson() { |
220 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 209 final core.Map<core.String, core.Object> _json = |
| 210 new core.Map<core.String, core.Object>(); |
221 return _json; | 211 return _json; |
222 } | 212 } |
223 } | 213 } |
224 | 214 |
225 /** | 215 /// A generic empty message that you can re-use to avoid defining duplicated |
226 * A generic empty message that you can re-use to avoid defining duplicated | 216 /// empty messages in your APIs. A typical example is to use it as the request |
227 * empty messages in your APIs. A typical example is to use it as the request | 217 /// or the response type of an API method. For instance: |
228 * or the response type of an API method. For instance: | 218 /// |
229 * | 219 /// service Foo { |
230 * service Foo { | 220 /// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
231 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); | 221 /// } |
232 * } | 222 /// |
233 * | 223 /// The JSON representation for `Empty` is empty JSON object `{}`. |
234 * The JSON representation for `Empty` is empty JSON object `{}`. | |
235 */ | |
236 class Empty { | 224 class Empty { |
237 | |
238 Empty(); | 225 Empty(); |
239 | 226 |
240 Empty.fromJson(core.Map _json) { | 227 Empty.fromJson(core.Map _json) {} |
241 } | |
242 | 228 |
243 core.Map<core.String, core.Object> toJson() { | 229 core.Map<core.String, core.Object> toJson() { |
244 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 230 final core.Map<core.String, core.Object> _json = |
| 231 new core.Map<core.String, core.Object>(); |
245 return _json; | 232 return _json; |
246 } | 233 } |
247 } | 234 } |
248 | 235 |
249 /** The response message for Operations.ListOperations. */ | 236 /// The response message for Operations.ListOperations. |
250 class ListOperationsResponse { | 237 class ListOperationsResponse { |
251 /** The standard List next-page token. */ | 238 /// The standard List next-page token. |
252 core.String nextPageToken; | 239 core.String nextPageToken; |
253 /** A list of operations that matches the specified filter in the request. */ | 240 |
| 241 /// A list of operations that matches the specified filter in the request. |
254 core.List<Operation> operations; | 242 core.List<Operation> operations; |
255 | 243 |
256 ListOperationsResponse(); | 244 ListOperationsResponse(); |
257 | 245 |
258 ListOperationsResponse.fromJson(core.Map _json) { | 246 ListOperationsResponse.fromJson(core.Map _json) { |
259 if (_json.containsKey("nextPageToken")) { | 247 if (_json.containsKey("nextPageToken")) { |
260 nextPageToken = _json["nextPageToken"]; | 248 nextPageToken = _json["nextPageToken"]; |
261 } | 249 } |
262 if (_json.containsKey("operations")) { | 250 if (_json.containsKey("operations")) { |
263 operations = _json["operations"].map((value) => new Operation.fromJson(val
ue)).toList(); | 251 operations = _json["operations"] |
| 252 .map((value) => new Operation.fromJson(value)) |
| 253 .toList(); |
264 } | 254 } |
265 } | 255 } |
266 | 256 |
267 core.Map<core.String, core.Object> toJson() { | 257 core.Map<core.String, core.Object> toJson() { |
268 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 258 final core.Map<core.String, core.Object> _json = |
| 259 new core.Map<core.String, core.Object>(); |
269 if (nextPageToken != null) { | 260 if (nextPageToken != null) { |
270 _json["nextPageToken"] = nextPageToken; | 261 _json["nextPageToken"] = nextPageToken; |
271 } | 262 } |
272 if (operations != null) { | 263 if (operations != null) { |
273 _json["operations"] = operations.map((value) => (value).toJson()).toList()
; | 264 _json["operations"] = |
| 265 operations.map((value) => (value).toJson()).toList(); |
274 } | 266 } |
275 return _json; | 267 return _json; |
276 } | 268 } |
277 } | 269 } |
278 | 270 |
279 /** | 271 /// This resource represents a long-running operation that is the result of a |
280 * This resource represents a long-running operation that is the result of a | 272 /// network API call. |
281 * network API call. | |
282 */ | |
283 class Operation { | 273 class Operation { |
284 /** | 274 /// If the value is `false`, it means the operation is still in progress. |
285 * If the value is `false`, it means the operation is still in progress. | 275 /// If `true`, the operation is completed, and either `error` or `response` |
286 * If true, the operation is completed, and either `error` or `response` is | 276 /// is |
287 * available. | 277 /// available. |
288 */ | |
289 core.bool done; | 278 core.bool done; |
290 /** The error result of the operation in case of failure or cancellation. */ | 279 |
| 280 /// The error result of the operation in case of failure or cancellation. |
291 Status error; | 281 Status error; |
292 /** | 282 |
293 * Service-specific metadata associated with the operation. It typically | 283 /// Service-specific metadata associated with the operation. It typically |
294 * contains progress information and common metadata such as create time. | 284 /// contains progress information and common metadata such as create time. |
295 * Some services might not provide such metadata. Any method that returns a | 285 /// Some services might not provide such metadata. Any method that returns a |
296 * long-running operation should document the metadata type, if any. | 286 /// long-running operation should document the metadata type, if any. |
297 * | 287 /// |
298 * The values for Object must be JSON objects. It can consist of `num`, | 288 /// The values for Object must be JSON objects. It can consist of `num`, |
299 * `String`, `bool` and `null` as well as `Map` and `List` values. | 289 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
300 */ | |
301 core.Map<core.String, core.Object> metadata; | 290 core.Map<core.String, core.Object> metadata; |
302 /** | 291 |
303 * The server-assigned name, which is only unique within the same service that | 292 /// The server-assigned name, which is only unique within the same service |
304 * originally returns it. If you use the default HTTP mapping, the | 293 /// that |
305 * `name` should have the format of `operations/some/unique/name`. | 294 /// originally returns it. If you use the default HTTP mapping, the |
306 */ | 295 /// `name` should have the format of `operations/some/unique/name`. |
307 core.String name; | 296 core.String name; |
308 /** | 297 |
309 * The normal response of the operation in case of success. If the original | 298 /// The normal response of the operation in case of success. If the original |
310 * method returns no data on success, such as `Delete`, the response is | 299 /// method returns no data on success, such as `Delete`, the response is |
311 * `google.protobuf.Empty`. If the original method is standard | 300 /// `google.protobuf.Empty`. If the original method is standard |
312 * `Get`/`Create`/`Update`, the response should be the resource. For other | 301 /// `Get`/`Create`/`Update`, the response should be the resource. For other |
313 * methods, the response should have the type `XxxResponse`, where `Xxx` | 302 /// methods, the response should have the type `XxxResponse`, where `Xxx` |
314 * is the original method name. For example, if the original method name | 303 /// is the original method name. For example, if the original method name |
315 * is `TakeSnapshot()`, the inferred response type is | 304 /// is `TakeSnapshot()`, the inferred response type is |
316 * `TakeSnapshotResponse`. | 305 /// `TakeSnapshotResponse`. |
317 * | 306 /// |
318 * The values for Object must be JSON objects. It can consist of `num`, | 307 /// The values for Object must be JSON objects. It can consist of `num`, |
319 * `String`, `bool` and `null` as well as `Map` and `List` values. | 308 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
320 */ | |
321 core.Map<core.String, core.Object> response; | 309 core.Map<core.String, core.Object> response; |
322 | 310 |
323 Operation(); | 311 Operation(); |
324 | 312 |
325 Operation.fromJson(core.Map _json) { | 313 Operation.fromJson(core.Map _json) { |
326 if (_json.containsKey("done")) { | 314 if (_json.containsKey("done")) { |
327 done = _json["done"]; | 315 done = _json["done"]; |
328 } | 316 } |
329 if (_json.containsKey("error")) { | 317 if (_json.containsKey("error")) { |
330 error = new Status.fromJson(_json["error"]); | 318 error = new Status.fromJson(_json["error"]); |
331 } | 319 } |
332 if (_json.containsKey("metadata")) { | 320 if (_json.containsKey("metadata")) { |
333 metadata = _json["metadata"]; | 321 metadata = _json["metadata"]; |
334 } | 322 } |
335 if (_json.containsKey("name")) { | 323 if (_json.containsKey("name")) { |
336 name = _json["name"]; | 324 name = _json["name"]; |
337 } | 325 } |
338 if (_json.containsKey("response")) { | 326 if (_json.containsKey("response")) { |
339 response = _json["response"]; | 327 response = _json["response"]; |
340 } | 328 } |
341 } | 329 } |
342 | 330 |
343 core.Map<core.String, core.Object> toJson() { | 331 core.Map<core.String, core.Object> toJson() { |
344 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 332 final core.Map<core.String, core.Object> _json = |
| 333 new core.Map<core.String, core.Object>(); |
345 if (done != null) { | 334 if (done != null) { |
346 _json["done"] = done; | 335 _json["done"] = done; |
347 } | 336 } |
348 if (error != null) { | 337 if (error != null) { |
349 _json["error"] = (error).toJson(); | 338 _json["error"] = (error).toJson(); |
350 } | 339 } |
351 if (metadata != null) { | 340 if (metadata != null) { |
352 _json["metadata"] = metadata; | 341 _json["metadata"] = metadata; |
353 } | 342 } |
354 if (name != null) { | 343 if (name != null) { |
355 _json["name"] = name; | 344 _json["name"] = name; |
356 } | 345 } |
357 if (response != null) { | 346 if (response != null) { |
358 _json["response"] = response; | 347 _json["response"] = response; |
359 } | 348 } |
360 return _json; | 349 return _json; |
361 } | 350 } |
362 } | 351 } |
363 | 352 |
364 /** | 353 /// The `Status` type defines a logical error model that is suitable for |
365 * The `Status` type defines a logical error model that is suitable for | 354 /// different |
366 * different | 355 /// programming environments, including REST APIs and RPC APIs. It is used by |
367 * programming environments, including REST APIs and RPC APIs. It is used by | 356 /// [gRPC](https://github.com/grpc). The error model is designed to be: |
368 * [gRPC](https://github.com/grpc). The error model is designed to be: | 357 /// |
369 * | 358 /// - Simple to use and understand for most users |
370 * - Simple to use and understand for most users | 359 /// - Flexible enough to meet unexpected needs |
371 * - Flexible enough to meet unexpected needs | 360 /// |
372 * | 361 /// # Overview |
373 * # Overview | 362 /// |
374 * | 363 /// The `Status` message contains three pieces of data: error code, error |
375 * The `Status` message contains three pieces of data: error code, error | 364 /// message, |
376 * message, | 365 /// and error details. The error code should be an enum value of |
377 * and error details. The error code should be an enum value of | 366 /// google.rpc.Code, but it may accept additional error codes if needed. The |
378 * google.rpc.Code, but it may accept additional error codes if needed. The | 367 /// error message should be a developer-facing English message that helps |
379 * error message should be a developer-facing English message that helps | 368 /// developers *understand* and *resolve* the error. If a localized user-facing |
380 * developers *understand* and *resolve* the error. If a localized user-facing | 369 /// error message is needed, put the localized message in the error details or |
381 * error message is needed, put the localized message in the error details or | 370 /// localize it in the client. The optional error details may contain arbitrary |
382 * localize it in the client. The optional error details may contain arbitrary | 371 /// information about the error. There is a predefined set of error detail |
383 * information about the error. There is a predefined set of error detail types | 372 /// types |
384 * in the package `google.rpc` that can be used for common error conditions. | 373 /// in the package `google.rpc` that can be used for common error conditions. |
385 * | 374 /// |
386 * # Language mapping | 375 /// # Language mapping |
387 * | 376 /// |
388 * The `Status` message is the logical representation of the error model, but it | 377 /// The `Status` message is the logical representation of the error model, but |
389 * is not necessarily the actual wire format. When the `Status` message is | 378 /// it |
390 * exposed in different client libraries and different wire protocols, it can be | 379 /// is not necessarily the actual wire format. When the `Status` message is |
391 * mapped differently. For example, it will likely be mapped to some exceptions | 380 /// exposed in different client libraries and different wire protocols, it can |
392 * in Java, but more likely mapped to some error codes in C. | 381 /// be |
393 * | 382 /// mapped differently. For example, it will likely be mapped to some |
394 * # Other uses | 383 /// exceptions |
395 * | 384 /// in Java, but more likely mapped to some error codes in C. |
396 * The error model and the `Status` message can be used in a variety of | 385 /// |
397 * environments, either with or without APIs, to provide a | 386 /// # Other uses |
398 * consistent developer experience across different environments. | 387 /// |
399 * | 388 /// The error model and the `Status` message can be used in a variety of |
400 * Example uses of this error model include: | 389 /// environments, either with or without APIs, to provide a |
401 * | 390 /// consistent developer experience across different environments. |
402 * - Partial errors. If a service needs to return partial errors to the client, | 391 /// |
403 * it may embed the `Status` in the normal response to indicate the partial | 392 /// Example uses of this error model include: |
404 * errors. | 393 /// |
405 * | 394 /// - Partial errors. If a service needs to return partial errors to the |
406 * - Workflow errors. A typical workflow has multiple steps. Each step may | 395 /// client, |
407 * have a `Status` message for error reporting. | 396 /// it may embed the `Status` in the normal response to indicate the partial |
408 * | 397 /// errors. |
409 * - Batch operations. If a client uses batch request and batch response, the | 398 /// |
410 * `Status` message should be used directly inside batch response, one for | 399 /// - Workflow errors. A typical workflow has multiple steps. Each step may |
411 * each error sub-response. | 400 /// have a `Status` message for error reporting. |
412 * | 401 /// |
413 * - Asynchronous operations. If an API call embeds asynchronous operation | 402 /// - Batch operations. If a client uses batch request and batch response, the |
414 * results in its response, the status of those operations should be | 403 /// `Status` message should be used directly inside batch response, one for |
415 * represented directly using the `Status` message. | 404 /// each error sub-response. |
416 * | 405 /// |
417 * - Logging. If some API errors are stored in logs, the message `Status` could | 406 /// - Asynchronous operations. If an API call embeds asynchronous operation |
418 * be used directly after any stripping needed for security/privacy reasons. | 407 /// results in its response, the status of those operations should be |
419 */ | 408 /// represented directly using the `Status` message. |
| 409 /// |
| 410 /// - Logging. If some API errors are stored in logs, the message `Status` |
| 411 /// could |
| 412 /// be used directly after any stripping needed for security/privacy reasons. |
420 class Status { | 413 class Status { |
421 /** The status code, which should be an enum value of google.rpc.Code. */ | 414 /// The status code, which should be an enum value of google.rpc.Code. |
422 core.int code; | 415 core.int code; |
423 /** | 416 |
424 * A list of messages that carry the error details. There is a common set of | 417 /// A list of messages that carry the error details. There is a common set |
425 * message types for APIs to use. | 418 /// of |
426 * | 419 /// message types for APIs to use. |
427 * The values for Object must be JSON objects. It can consist of `num`, | 420 /// |
428 * `String`, `bool` and `null` as well as `Map` and `List` values. | 421 /// The values for Object must be JSON objects. It can consist of `num`, |
429 */ | 422 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
430 core.List<core.Map<core.String, core.Object>> details; | 423 core.List<core.Map<core.String, core.Object>> details; |
431 /** | 424 |
432 * A developer-facing error message, which should be in English. Any | 425 /// A developer-facing error message, which should be in English. Any |
433 * user-facing error message should be localized and sent in the | 426 /// user-facing error message should be localized and sent in the |
434 * google.rpc.Status.details field, or localized by the client. | 427 /// google.rpc.Status.details field, or localized by the client. |
435 */ | |
436 core.String message; | 428 core.String message; |
437 | 429 |
438 Status(); | 430 Status(); |
439 | 431 |
440 Status.fromJson(core.Map _json) { | 432 Status.fromJson(core.Map _json) { |
441 if (_json.containsKey("code")) { | 433 if (_json.containsKey("code")) { |
442 code = _json["code"]; | 434 code = _json["code"]; |
443 } | 435 } |
444 if (_json.containsKey("details")) { | 436 if (_json.containsKey("details")) { |
445 details = _json["details"]; | 437 details = _json["details"]; |
446 } | 438 } |
447 if (_json.containsKey("message")) { | 439 if (_json.containsKey("message")) { |
448 message = _json["message"]; | 440 message = _json["message"]; |
449 } | 441 } |
450 } | 442 } |
451 | 443 |
452 core.Map<core.String, core.Object> toJson() { | 444 core.Map<core.String, core.Object> toJson() { |
453 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 445 final core.Map<core.String, core.Object> _json = |
| 446 new core.Map<core.String, core.Object>(); |
454 if (code != null) { | 447 if (code != null) { |
455 _json["code"] = code; | 448 _json["code"] = code; |
456 } | 449 } |
457 if (details != null) { | 450 if (details != null) { |
458 _json["details"] = details; | 451 _json["details"] = details; |
459 } | 452 } |
460 if (message != null) { | 453 if (message != null) { |
461 _json["message"] = message; | 454 _json["message"] = message; |
462 } | 455 } |
463 return _json; | 456 return _json; |
464 } | 457 } |
465 } | 458 } |
OLD | NEW |