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.spanner.v1; | 3 library googleapis.spanner.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 spanner/v1'; | 15 const core.String USER_AGENT = 'dart-api-client spanner/v1'; |
16 | 16 |
17 /** | 17 /// Cloud Spanner is a managed, mission-critical, globally consistent and |
18 * Cloud Spanner is a managed, mission-critical, globally consistent and | 18 /// scalable relational database service. |
19 * scalable relational database service. | |
20 */ | |
21 class SpannerApi { | 19 class SpannerApi { |
22 /** View and manage your data across Google Cloud Platform services */ | 20 /// View and manage your data across Google Cloud Platform services |
23 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; | 21 static const CloudPlatformScope = |
| 22 "https://www.googleapis.com/auth/cloud-platform"; |
24 | 23 |
25 /** Administer your Spanner databases */ | 24 /// Administer your Spanner databases |
26 static const SpannerAdminScope = "https://www.googleapis.com/auth/spanner.admi
n"; | 25 static const SpannerAdminScope = |
| 26 "https://www.googleapis.com/auth/spanner.admin"; |
27 | 27 |
28 /** View and manage the contents of your Spanner databases */ | 28 /// View and manage the contents of your Spanner databases |
29 static const SpannerDataScope = "https://www.googleapis.com/auth/spanner.data"
; | 29 static const SpannerDataScope = |
30 | 30 "https://www.googleapis.com/auth/spanner.data"; |
31 | 31 |
32 final commons.ApiRequester _requester; | 32 final commons.ApiRequester _requester; |
33 | 33 |
34 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); | 34 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); |
35 | 35 |
36 SpannerApi(http.Client client, {core.String rootUrl: "https://spanner.googleap
is.com/", core.String servicePath: ""}) : | 36 SpannerApi(http.Client client, |
37 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 37 {core.String rootUrl: "https://spanner.googleapis.com/", |
| 38 core.String servicePath: ""}) |
| 39 : _requester = |
| 40 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT); |
38 } | 41 } |
39 | 42 |
40 | |
41 class ProjectsResourceApi { | 43 class ProjectsResourceApi { |
42 final commons.ApiRequester _requester; | 44 final commons.ApiRequester _requester; |
43 | 45 |
44 ProjectsInstanceConfigsResourceApi get instanceConfigs => new ProjectsInstance
ConfigsResourceApi(_requester); | 46 ProjectsInstanceConfigsResourceApi get instanceConfigs => |
45 ProjectsInstancesResourceApi get instances => new ProjectsInstancesResourceApi
(_requester); | 47 new ProjectsInstanceConfigsResourceApi(_requester); |
| 48 ProjectsInstancesResourceApi get instances => |
| 49 new ProjectsInstancesResourceApi(_requester); |
46 | 50 |
47 ProjectsResourceApi(commons.ApiRequester client) : | 51 ProjectsResourceApi(commons.ApiRequester client) : _requester = client; |
48 _requester = client; | |
49 } | 52 } |
50 | 53 |
51 | |
52 class ProjectsInstanceConfigsResourceApi { | 54 class ProjectsInstanceConfigsResourceApi { |
53 final commons.ApiRequester _requester; | 55 final commons.ApiRequester _requester; |
54 | 56 |
55 ProjectsInstanceConfigsResourceApi(commons.ApiRequester client) : | 57 ProjectsInstanceConfigsResourceApi(commons.ApiRequester client) |
56 _requester = client; | 58 : _requester = client; |
57 | 59 |
58 /** | 60 /// Gets information about a particular instance configuration. |
59 * Gets information about a particular instance configuration. | 61 /// |
60 * | 62 /// Request parameters: |
61 * Request parameters: | 63 /// |
62 * | 64 /// [name] - Required. The name of the requested instance configuration. |
63 * [name] - Required. The name of the requested instance configuration. Values | 65 /// Values are of |
64 * are of | 66 /// the form `projects/<project>/instanceConfigs/<config>`. |
65 * the form `projects/<project>/instanceConfigs/<config>`. | 67 /// Value must have pattern "^projects/[^/]+/instanceConfigs/[^/]+$". |
66 * Value must have pattern "^projects/[^/]+/instanceConfigs/[^/]+$". | 68 /// |
67 * | 69 /// Completes with a [InstanceConfig]. |
68 * Completes with a [InstanceConfig]. | 70 /// |
69 * | 71 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
70 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 72 /// an error. |
71 * error. | 73 /// |
72 * | 74 /// If the used [http.Client] completes with an error when making a REST |
73 * If the used [http.Client] completes with an error when making a REST call, | 75 /// call, this method will complete with the same error. |
74 * this method will complete with the same error. | |
75 */ | |
76 async.Future<InstanceConfig> get(core.String name) { | 76 async.Future<InstanceConfig> get(core.String name) { |
77 var _url = null; | 77 var _url = null; |
78 var _queryParams = new core.Map(); | 78 var _queryParams = new core.Map(); |
79 var _uploadMedia = null; | 79 var _uploadMedia = null; |
80 var _uploadOptions = null; | 80 var _uploadOptions = null; |
81 var _downloadOptions = commons.DownloadOptions.Metadata; | 81 var _downloadOptions = commons.DownloadOptions.Metadata; |
82 var _body = null; | 82 var _body = null; |
83 | 83 |
84 if (name == null) { | 84 if (name == null) { |
85 throw new core.ArgumentError("Parameter name is required."); | 85 throw new core.ArgumentError("Parameter name is required."); |
86 } | 86 } |
87 | 87 |
88 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 88 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
89 | 89 |
90 var _response = _requester.request(_url, | 90 var _response = _requester.request(_url, "GET", |
91 "GET", | 91 body: _body, |
92 body: _body, | 92 queryParams: _queryParams, |
93 queryParams: _queryParams, | 93 uploadOptions: _uploadOptions, |
94 uploadOptions: _uploadOptions, | 94 uploadMedia: _uploadMedia, |
95 uploadMedia: _uploadMedia, | 95 downloadOptions: _downloadOptions); |
96 downloadOptions: _downloadOptions); | |
97 return _response.then((data) => new InstanceConfig.fromJson(data)); | 96 return _response.then((data) => new InstanceConfig.fromJson(data)); |
98 } | 97 } |
99 | 98 |
100 /** | 99 /// Lists the supported instance configurations for a given project. |
101 * Lists the supported instance configurations for a given project. | 100 /// |
102 * | 101 /// Request parameters: |
103 * Request parameters: | 102 /// |
104 * | 103 /// [parent] - Required. The name of the project for which a list of |
105 * [parent] - Required. The name of the project for which a list of supported | 104 /// supported instance |
106 * instance | 105 /// configurations is requested. Values are of the form |
107 * configurations is requested. Values are of the form | 106 /// `projects/<project>`. |
108 * `projects/<project>`. | 107 /// Value must have pattern "^projects/[^/]+$". |
109 * Value must have pattern "^projects/[^/]+$". | 108 /// |
110 * | 109 /// [pageToken] - If non-empty, `page_token` should contain a |
111 * [pageToken] - If non-empty, `page_token` should contain a | 110 /// next_page_token |
112 * next_page_token | 111 /// from a previous ListInstanceConfigsResponse. |
113 * from a previous ListInstanceConfigsResponse. | 112 /// |
114 * | 113 /// [pageSize] - Number of instance configurations to be returned in the |
115 * [pageSize] - Number of instance configurations to be returned in the | 114 /// response. If 0 or |
116 * response. If 0 or | 115 /// less, defaults to the server's maximum allowed page size. |
117 * less, defaults to the server's maximum allowed page size. | 116 /// |
118 * | 117 /// Completes with a [ListInstanceConfigsResponse]. |
119 * Completes with a [ListInstanceConfigsResponse]. | 118 /// |
120 * | 119 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
121 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 120 /// an error. |
122 * error. | 121 /// |
123 * | 122 /// If the used [http.Client] completes with an error when making a REST |
124 * If the used [http.Client] completes with an error when making a REST call, | 123 /// call, this method will complete with the same error. |
125 * this method will complete with the same error. | 124 async.Future<ListInstanceConfigsResponse> list(core.String parent, |
126 */ | 125 {core.String pageToken, core.int pageSize}) { |
127 async.Future<ListInstanceConfigsResponse> list(core.String parent, {core.Strin
g pageToken, core.int pageSize}) { | |
128 var _url = null; | 126 var _url = null; |
129 var _queryParams = new core.Map(); | 127 var _queryParams = new core.Map(); |
130 var _uploadMedia = null; | 128 var _uploadMedia = null; |
131 var _uploadOptions = null; | 129 var _uploadOptions = null; |
132 var _downloadOptions = commons.DownloadOptions.Metadata; | 130 var _downloadOptions = commons.DownloadOptions.Metadata; |
133 var _body = null; | 131 var _body = null; |
134 | 132 |
135 if (parent == null) { | 133 if (parent == null) { |
136 throw new core.ArgumentError("Parameter parent is required."); | 134 throw new core.ArgumentError("Parameter parent is required."); |
137 } | 135 } |
138 if (pageToken != null) { | 136 if (pageToken != null) { |
139 _queryParams["pageToken"] = [pageToken]; | 137 _queryParams["pageToken"] = [pageToken]; |
140 } | 138 } |
141 if (pageSize != null) { | 139 if (pageSize != null) { |
142 _queryParams["pageSize"] = ["${pageSize}"]; | 140 _queryParams["pageSize"] = ["${pageSize}"]; |
143 } | 141 } |
144 | 142 |
145 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/instance
Configs'; | 143 _url = 'v1/' + |
| 144 commons.Escaper.ecapeVariableReserved('$parent') + |
| 145 '/instanceConfigs'; |
146 | 146 |
147 var _response = _requester.request(_url, | 147 var _response = _requester.request(_url, "GET", |
148 "GET", | 148 body: _body, |
149 body: _body, | 149 queryParams: _queryParams, |
150 queryParams: _queryParams, | 150 uploadOptions: _uploadOptions, |
151 uploadOptions: _uploadOptions, | 151 uploadMedia: _uploadMedia, |
152 uploadMedia: _uploadMedia, | 152 downloadOptions: _downloadOptions); |
153 downloadOptions: _downloadOptions); | 153 return _response |
154 return _response.then((data) => new ListInstanceConfigsResponse.fromJson(dat
a)); | 154 .then((data) => new ListInstanceConfigsResponse.fromJson(data)); |
155 } | 155 } |
156 | |
157 } | 156 } |
158 | 157 |
159 | |
160 class ProjectsInstancesResourceApi { | 158 class ProjectsInstancesResourceApi { |
161 final commons.ApiRequester _requester; | 159 final commons.ApiRequester _requester; |
162 | 160 |
163 ProjectsInstancesDatabasesResourceApi get databases => new ProjectsInstancesDa
tabasesResourceApi(_requester); | 161 ProjectsInstancesDatabasesResourceApi get databases => |
164 ProjectsInstancesOperationsResourceApi get operations => new ProjectsInstances
OperationsResourceApi(_requester); | 162 new ProjectsInstancesDatabasesResourceApi(_requester); |
| 163 ProjectsInstancesOperationsResourceApi get operations => |
| 164 new ProjectsInstancesOperationsResourceApi(_requester); |
165 | 165 |
166 ProjectsInstancesResourceApi(commons.ApiRequester client) : | 166 ProjectsInstancesResourceApi(commons.ApiRequester client) |
167 _requester = client; | 167 : _requester = client; |
168 | 168 |
169 /** | 169 /// Creates an instance and begins preparing it to begin serving. The |
170 * Creates an instance and begins preparing it to begin serving. The | 170 /// returned long-running operation |
171 * returned long-running operation | 171 /// can be used to track the progress of preparing the new |
172 * can be used to track the progress of preparing the new | 172 /// instance. The instance name is assigned by the caller. If the |
173 * instance. The instance name is assigned by the caller. If the | 173 /// named instance already exists, `CreateInstance` returns |
174 * named instance already exists, `CreateInstance` returns | 174 /// `ALREADY_EXISTS`. |
175 * `ALREADY_EXISTS`. | 175 /// |
176 * | 176 /// Immediately upon completion of this request: |
177 * Immediately upon completion of this request: | 177 /// |
178 * | 178 /// * The instance is readable via the API, with all requested attributes |
179 * * The instance is readable via the API, with all requested attributes | 179 /// but no allocated resources. Its state is `CREATING`. |
180 * but no allocated resources. Its state is `CREATING`. | 180 /// |
181 * | 181 /// Until completion of the returned operation: |
182 * Until completion of the returned operation: | 182 /// |
183 * | 183 /// * Cancelling the operation renders the instance immediately unreadable |
184 * * Cancelling the operation renders the instance immediately unreadable | 184 /// via the API. |
185 * via the API. | 185 /// * The instance can be deleted. |
186 * * The instance can be deleted. | 186 /// * All other attempts to modify the instance are rejected. |
187 * * All other attempts to modify the instance are rejected. | 187 /// |
188 * | 188 /// Upon completion of the returned operation: |
189 * Upon completion of the returned operation: | 189 /// |
190 * | 190 /// * Billing for all successfully-allocated resources begins (some types |
191 * * Billing for all successfully-allocated resources begins (some types | 191 /// may have lower than the requested levels). |
192 * may have lower than the requested levels). | 192 /// * Databases can be created in the instance. |
193 * * Databases can be created in the instance. | 193 /// * The instance's allocated resource levels are readable via the API. |
194 * * The instance's allocated resource levels are readable via the API. | 194 /// * The instance's state becomes `READY`. |
195 * * The instance's state becomes `READY`. | 195 /// |
196 * | 196 /// The returned long-running operation will |
197 * The returned long-running operation will | 197 /// have a name of the format `<instance_name>/operations/<operation_id>` and |
198 * have a name of the format `<instance_name>/operations/<operation_id>` and | 198 /// can be used to track creation of the instance. The |
199 * can be used to track creation of the instance. The | 199 /// metadata field type is |
200 * metadata field type is | 200 /// CreateInstanceMetadata. |
201 * CreateInstanceMetadata. | 201 /// The response field type is |
202 * The response field type is | 202 /// Instance, if successful. |
203 * Instance, if successful. | 203 /// |
204 * | 204 /// [request] - The metadata request object. |
205 * [request] - The metadata request object. | 205 /// |
206 * | 206 /// Request parameters: |
207 * Request parameters: | 207 /// |
208 * | 208 /// [parent] - Required. The name of the project in which to create the |
209 * [parent] - Required. The name of the project in which to create the | 209 /// instance. Values |
210 * instance. Values | 210 /// are of the form `projects/<project>`. |
211 * are of the form `projects/<project>`. | 211 /// Value must have pattern "^projects/[^/]+$". |
212 * Value must have pattern "^projects/[^/]+$". | 212 /// |
213 * | 213 /// Completes with a [Operation]. |
214 * Completes with a [Operation]. | 214 /// |
215 * | 215 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
216 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 216 /// an error. |
217 * error. | 217 /// |
218 * | 218 /// If the used [http.Client] completes with an error when making a REST |
219 * If the used [http.Client] completes with an error when making a REST call, | 219 /// call, this method will complete with the same error. |
220 * this method will complete with the same error. | 220 async.Future<Operation> create( |
221 */ | 221 CreateInstanceRequest request, core.String parent) { |
222 async.Future<Operation> create(CreateInstanceRequest request, core.String pare
nt) { | |
223 var _url = null; | 222 var _url = null; |
224 var _queryParams = new core.Map(); | 223 var _queryParams = new core.Map(); |
225 var _uploadMedia = null; | 224 var _uploadMedia = null; |
226 var _uploadOptions = null; | 225 var _uploadOptions = null; |
227 var _downloadOptions = commons.DownloadOptions.Metadata; | 226 var _downloadOptions = commons.DownloadOptions.Metadata; |
228 var _body = null; | 227 var _body = null; |
229 | 228 |
230 if (request != null) { | 229 if (request != null) { |
231 _body = convert.JSON.encode((request).toJson()); | 230 _body = convert.JSON.encode((request).toJson()); |
232 } | 231 } |
233 if (parent == null) { | 232 if (parent == null) { |
234 throw new core.ArgumentError("Parameter parent is required."); | 233 throw new core.ArgumentError("Parameter parent is required."); |
235 } | 234 } |
236 | 235 |
237 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/instance
s'; | 236 _url = |
| 237 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/instances'; |
238 | 238 |
239 var _response = _requester.request(_url, | 239 var _response = _requester.request(_url, "POST", |
240 "POST", | 240 body: _body, |
241 body: _body, | 241 queryParams: _queryParams, |
242 queryParams: _queryParams, | 242 uploadOptions: _uploadOptions, |
243 uploadOptions: _uploadOptions, | 243 uploadMedia: _uploadMedia, |
244 uploadMedia: _uploadMedia, | 244 downloadOptions: _downloadOptions); |
245 downloadOptions: _downloadOptions); | |
246 return _response.then((data) => new Operation.fromJson(data)); | 245 return _response.then((data) => new Operation.fromJson(data)); |
247 } | 246 } |
248 | 247 |
249 /** | 248 /// Deletes an instance. |
250 * Deletes an instance. | 249 /// |
251 * | 250 /// Immediately upon completion of the request: |
252 * Immediately upon completion of the request: | 251 /// |
253 * | 252 /// * Billing ceases for all of the instance's reserved resources. |
254 * * Billing ceases for all of the instance's reserved resources. | 253 /// |
255 * | 254 /// Soon afterward: |
256 * Soon afterward: | 255 /// |
257 * | 256 /// * The instance and *all of its databases* immediately and |
258 * * The instance and *all of its databases* immediately and | 257 /// irrevocably disappear from the API. All data in the databases |
259 * irrevocably disappear from the API. All data in the databases | 258 /// is permanently deleted. |
260 * is permanently deleted. | 259 /// |
261 * | 260 /// Request parameters: |
262 * Request parameters: | 261 /// |
263 * | 262 /// [name] - Required. The name of the instance to be deleted. Values are of |
264 * [name] - Required. The name of the instance to be deleted. Values are of | 263 /// the form |
265 * the form | 264 /// `projects/<project>/instances/<instance>` |
266 * `projects/<project>/instances/<instance>` | 265 /// Value must have pattern "^projects/[^/]+/instances/[^/]+$". |
267 * Value must have pattern "^projects/[^/]+/instances/[^/]+$". | 266 /// |
268 * | 267 /// Completes with a [Empty]. |
269 * Completes with a [Empty]. | 268 /// |
270 * | 269 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
271 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 270 /// an error. |
272 * error. | 271 /// |
273 * | 272 /// If the used [http.Client] completes with an error when making a REST |
274 * If the used [http.Client] completes with an error when making a REST call, | 273 /// call, this method will complete with the same error. |
275 * this method will complete with the same error. | |
276 */ | |
277 async.Future<Empty> delete(core.String name) { | 274 async.Future<Empty> delete(core.String name) { |
278 var _url = null; | 275 var _url = null; |
279 var _queryParams = new core.Map(); | 276 var _queryParams = new core.Map(); |
280 var _uploadMedia = null; | 277 var _uploadMedia = null; |
281 var _uploadOptions = null; | 278 var _uploadOptions = null; |
282 var _downloadOptions = commons.DownloadOptions.Metadata; | 279 var _downloadOptions = commons.DownloadOptions.Metadata; |
283 var _body = null; | 280 var _body = null; |
284 | 281 |
285 if (name == null) { | 282 if (name == null) { |
286 throw new core.ArgumentError("Parameter name is required."); | 283 throw new core.ArgumentError("Parameter name is required."); |
287 } | 284 } |
288 | 285 |
289 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 286 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
290 | 287 |
291 var _response = _requester.request(_url, | 288 var _response = _requester.request(_url, "DELETE", |
292 "DELETE", | 289 body: _body, |
293 body: _body, | 290 queryParams: _queryParams, |
294 queryParams: _queryParams, | 291 uploadOptions: _uploadOptions, |
295 uploadOptions: _uploadOptions, | 292 uploadMedia: _uploadMedia, |
296 uploadMedia: _uploadMedia, | 293 downloadOptions: _downloadOptions); |
297 downloadOptions: _downloadOptions); | |
298 return _response.then((data) => new Empty.fromJson(data)); | 294 return _response.then((data) => new Empty.fromJson(data)); |
299 } | 295 } |
300 | 296 |
301 /** | 297 /// Gets information about a particular instance. |
302 * Gets information about a particular instance. | 298 /// |
303 * | 299 /// Request parameters: |
304 * Request parameters: | 300 /// |
305 * | 301 /// [name] - Required. The name of the requested instance. Values are of the |
306 * [name] - Required. The name of the requested instance. Values are of the | 302 /// form |
307 * form | 303 /// `projects/<project>/instances/<instance>`. |
308 * `projects/<project>/instances/<instance>`. | 304 /// Value must have pattern "^projects/[^/]+/instances/[^/]+$". |
309 * Value must have pattern "^projects/[^/]+/instances/[^/]+$". | 305 /// |
310 * | 306 /// Completes with a [Instance]. |
311 * Completes with a [Instance]. | 307 /// |
312 * | 308 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
313 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 309 /// an error. |
314 * error. | 310 /// |
315 * | 311 /// If the used [http.Client] completes with an error when making a REST |
316 * If the used [http.Client] completes with an error when making a REST call, | 312 /// call, this method will complete with the same error. |
317 * this method will complete with the same error. | |
318 */ | |
319 async.Future<Instance> get(core.String name) { | 313 async.Future<Instance> get(core.String name) { |
320 var _url = null; | 314 var _url = null; |
321 var _queryParams = new core.Map(); | 315 var _queryParams = new core.Map(); |
322 var _uploadMedia = null; | 316 var _uploadMedia = null; |
323 var _uploadOptions = null; | 317 var _uploadOptions = null; |
324 var _downloadOptions = commons.DownloadOptions.Metadata; | 318 var _downloadOptions = commons.DownloadOptions.Metadata; |
325 var _body = null; | 319 var _body = null; |
326 | 320 |
327 if (name == null) { | 321 if (name == null) { |
328 throw new core.ArgumentError("Parameter name is required."); | 322 throw new core.ArgumentError("Parameter name is required."); |
329 } | 323 } |
330 | 324 |
331 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 325 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
332 | 326 |
333 var _response = _requester.request(_url, | 327 var _response = _requester.request(_url, "GET", |
334 "GET", | 328 body: _body, |
335 body: _body, | 329 queryParams: _queryParams, |
336 queryParams: _queryParams, | 330 uploadOptions: _uploadOptions, |
337 uploadOptions: _uploadOptions, | 331 uploadMedia: _uploadMedia, |
338 uploadMedia: _uploadMedia, | 332 downloadOptions: _downloadOptions); |
339 downloadOptions: _downloadOptions); | |
340 return _response.then((data) => new Instance.fromJson(data)); | 333 return _response.then((data) => new Instance.fromJson(data)); |
341 } | 334 } |
342 | 335 |
343 /** | 336 /// Gets the access control policy for an instance resource. Returns an empty |
344 * Gets the access control policy for an instance resource. Returns an empty | 337 /// policy if an instance exists but does not have a policy set. |
345 * policy if an instance exists but does not have a policy set. | 338 /// |
346 * | 339 /// Authorization requires `spanner.instances.getIamPolicy` on |
347 * Authorization requires `spanner.instances.getIamPolicy` on | 340 /// resource. |
348 * resource. | 341 /// |
349 * | 342 /// [request] - The metadata request object. |
350 * [request] - The metadata request object. | 343 /// |
351 * | 344 /// Request parameters: |
352 * Request parameters: | 345 /// |
353 * | 346 /// [resource] - REQUIRED: The Cloud Spanner resource for which the policy is |
354 * [resource] - REQUIRED: The Cloud Spanner resource for which the policy is | 347 /// being retrieved. The format is `projects/<project ID>/instances/<instance |
355 * being retrieved. The format is `projects/<project ID>/instances/<instance | 348 /// ID>` for instance resources and `projects/<project |
356 * ID>` for instance resources and `projects/<project ID>/instances/<instance | 349 /// ID>/instances/<instance ID>/databases/<database ID>` for database |
357 * ID>/databases/<database ID>` for database resources. | 350 /// resources. |
358 * Value must have pattern "^projects/[^/]+/instances/[^/]+$". | 351 /// Value must have pattern "^projects/[^/]+/instances/[^/]+$". |
359 * | 352 /// |
360 * Completes with a [Policy]. | 353 /// Completes with a [Policy]. |
361 * | 354 /// |
362 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 355 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
363 * error. | 356 /// an error. |
364 * | 357 /// |
365 * If the used [http.Client] completes with an error when making a REST call, | 358 /// If the used [http.Client] completes with an error when making a REST |
366 * this method will complete with the same error. | 359 /// call, this method will complete with the same error. |
367 */ | 360 async.Future<Policy> getIamPolicy( |
368 async.Future<Policy> getIamPolicy(GetIamPolicyRequest request, core.String res
ource) { | 361 GetIamPolicyRequest request, core.String resource) { |
369 var _url = null; | 362 var _url = null; |
370 var _queryParams = new core.Map(); | 363 var _queryParams = new core.Map(); |
371 var _uploadMedia = null; | 364 var _uploadMedia = null; |
372 var _uploadOptions = null; | 365 var _uploadOptions = null; |
373 var _downloadOptions = commons.DownloadOptions.Metadata; | 366 var _downloadOptions = commons.DownloadOptions.Metadata; |
374 var _body = null; | 367 var _body = null; |
375 | 368 |
376 if (request != null) { | 369 if (request != null) { |
377 _body = convert.JSON.encode((request).toJson()); | 370 _body = convert.JSON.encode((request).toJson()); |
378 } | 371 } |
379 if (resource == null) { | 372 if (resource == null) { |
380 throw new core.ArgumentError("Parameter resource is required."); | 373 throw new core.ArgumentError("Parameter resource is required."); |
381 } | 374 } |
382 | 375 |
383 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getIam
Policy'; | 376 _url = 'v1/' + |
| 377 commons.Escaper.ecapeVariableReserved('$resource') + |
| 378 ':getIamPolicy'; |
384 | 379 |
385 var _response = _requester.request(_url, | 380 var _response = _requester.request(_url, "POST", |
386 "POST", | 381 body: _body, |
387 body: _body, | 382 queryParams: _queryParams, |
388 queryParams: _queryParams, | 383 uploadOptions: _uploadOptions, |
389 uploadOptions: _uploadOptions, | 384 uploadMedia: _uploadMedia, |
390 uploadMedia: _uploadMedia, | 385 downloadOptions: _downloadOptions); |
391 downloadOptions: _downloadOptions); | |
392 return _response.then((data) => new Policy.fromJson(data)); | 386 return _response.then((data) => new Policy.fromJson(data)); |
393 } | 387 } |
394 | 388 |
395 /** | 389 /// Lists all instances in the given project. |
396 * Lists all instances in the given project. | 390 /// |
397 * | 391 /// Request parameters: |
398 * Request parameters: | 392 /// |
399 * | 393 /// [parent] - Required. The name of the project for which a list of |
400 * [parent] - Required. The name of the project for which a list of instances | 394 /// instances is |
401 * is | 395 /// requested. Values are of the form `projects/<project>`. |
402 * requested. Values are of the form `projects/<project>`. | 396 /// Value must have pattern "^projects/[^/]+$". |
403 * Value must have pattern "^projects/[^/]+$". | 397 /// |
404 * | 398 /// [pageToken] - If non-empty, `page_token` should contain a |
405 * [pageToken] - If non-empty, `page_token` should contain a | 399 /// next_page_token from a |
406 * next_page_token from a | 400 /// previous ListInstancesResponse. |
407 * previous ListInstancesResponse. | 401 /// |
408 * | 402 /// [pageSize] - Number of instances to be returned in the response. If 0 or |
409 * [pageSize] - Number of instances to be returned in the response. If 0 or | 403 /// less, defaults |
410 * less, defaults | 404 /// to the server's maximum allowed page size. |
411 * to the server's maximum allowed page size. | 405 /// |
412 * | 406 /// [filter] - An expression for filtering the results of the request. Filter |
413 * [filter] - An expression for filtering the results of the request. Filter | 407 /// rules are |
414 * rules are | 408 /// case insensitive. The fields eligible for filtering are: |
415 * case insensitive. The fields eligible for filtering are: | 409 /// |
416 * | 410 /// * name |
417 * * name | 411 /// * display_name |
418 * * display_name | 412 /// * labels.key where key is the name of a label |
419 * * labels.key where key is the name of a label | 413 /// |
420 * | 414 /// Some examples of using filters are: |
421 * Some examples of using filters are: | 415 /// |
422 * | 416 /// * name:* --> The instance has a name. |
423 * * name:* --> The instance has a name. | 417 /// * name:Howl --> The instance's name contains the string "howl". |
424 * * name:Howl --> The instance's name contains the string "howl". | 418 /// * name:HOWL --> Equivalent to above. |
425 * * name:HOWL --> Equivalent to above. | 419 /// * NAME:howl --> Equivalent to above. |
426 * * NAME:howl --> Equivalent to above. | 420 /// * labels.env:* --> The instance has the label "env". |
427 * * labels.env:* --> The instance has the label "env". | 421 /// * labels.env:dev --> The instance has the label "env" and the value of |
428 * * labels.env:dev --> The instance has the label "env" and the value of | 422 /// the label contains the string "dev". |
429 * the label contains the string "dev". | 423 /// * name:howl labels.env:dev --> The instance's name contains "howl" and |
430 * * name:howl labels.env:dev --> The instance's name contains "howl" and | 424 /// it has the label "env" with its value |
431 * it has the label "env" with its value | 425 /// containing "dev". |
432 * containing "dev". | 426 /// |
433 * | 427 /// Completes with a [ListInstancesResponse]. |
434 * Completes with a [ListInstancesResponse]. | 428 /// |
435 * | 429 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
436 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 430 /// an error. |
437 * error. | 431 /// |
438 * | 432 /// If the used [http.Client] completes with an error when making a REST |
439 * If the used [http.Client] completes with an error when making a REST call, | 433 /// call, this method will complete with the same error. |
440 * this method will complete with the same error. | 434 async.Future<ListInstancesResponse> list(core.String parent, |
441 */ | 435 {core.String pageToken, core.int pageSize, core.String filter}) { |
442 async.Future<ListInstancesResponse> list(core.String parent, {core.String page
Token, core.int pageSize, core.String filter}) { | |
443 var _url = null; | 436 var _url = null; |
444 var _queryParams = new core.Map(); | 437 var _queryParams = new core.Map(); |
445 var _uploadMedia = null; | 438 var _uploadMedia = null; |
446 var _uploadOptions = null; | 439 var _uploadOptions = null; |
447 var _downloadOptions = commons.DownloadOptions.Metadata; | 440 var _downloadOptions = commons.DownloadOptions.Metadata; |
448 var _body = null; | 441 var _body = null; |
449 | 442 |
450 if (parent == null) { | 443 if (parent == null) { |
451 throw new core.ArgumentError("Parameter parent is required."); | 444 throw new core.ArgumentError("Parameter parent is required."); |
452 } | 445 } |
453 if (pageToken != null) { | 446 if (pageToken != null) { |
454 _queryParams["pageToken"] = [pageToken]; | 447 _queryParams["pageToken"] = [pageToken]; |
455 } | 448 } |
456 if (pageSize != null) { | 449 if (pageSize != null) { |
457 _queryParams["pageSize"] = ["${pageSize}"]; | 450 _queryParams["pageSize"] = ["${pageSize}"]; |
458 } | 451 } |
459 if (filter != null) { | 452 if (filter != null) { |
460 _queryParams["filter"] = [filter]; | 453 _queryParams["filter"] = [filter]; |
461 } | 454 } |
462 | 455 |
463 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/instance
s'; | 456 _url = |
| 457 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/instances'; |
464 | 458 |
465 var _response = _requester.request(_url, | 459 var _response = _requester.request(_url, "GET", |
466 "GET", | 460 body: _body, |
467 body: _body, | 461 queryParams: _queryParams, |
468 queryParams: _queryParams, | 462 uploadOptions: _uploadOptions, |
469 uploadOptions: _uploadOptions, | 463 uploadMedia: _uploadMedia, |
470 uploadMedia: _uploadMedia, | 464 downloadOptions: _downloadOptions); |
471 downloadOptions: _downloadOptions); | |
472 return _response.then((data) => new ListInstancesResponse.fromJson(data)); | 465 return _response.then((data) => new ListInstancesResponse.fromJson(data)); |
473 } | 466 } |
474 | 467 |
475 /** | 468 /// Updates an instance, and begins allocating or releasing resources |
476 * Updates an instance, and begins allocating or releasing resources | 469 /// as requested. The returned long-running |
477 * as requested. The returned long-running | 470 /// operation can be used to track the |
478 * operation can be used to track the | 471 /// progress of updating the instance. If the named instance does not |
479 * progress of updating the instance. If the named instance does not | 472 /// exist, returns `NOT_FOUND`. |
480 * exist, returns `NOT_FOUND`. | 473 /// |
481 * | 474 /// Immediately upon completion of this request: |
482 * Immediately upon completion of this request: | 475 /// |
483 * | 476 /// * For resource types for which a decrease in the instance's allocation |
484 * * For resource types for which a decrease in the instance's allocation | 477 /// has been requested, billing is based on the newly-requested level. |
485 * has been requested, billing is based on the newly-requested level. | 478 /// |
486 * | 479 /// Until completion of the returned operation: |
487 * Until completion of the returned operation: | 480 /// |
488 * | 481 /// * Cancelling the operation sets its metadata's |
489 * * Cancelling the operation sets its metadata's | 482 /// cancel_time, and begins |
490 * cancel_time, and begins | 483 /// restoring resources to their pre-request values. The operation |
491 * restoring resources to their pre-request values. The operation | 484 /// is guaranteed to succeed at undoing all resource changes, |
492 * is guaranteed to succeed at undoing all resource changes, | 485 /// after which point it terminates with a `CANCELLED` status. |
493 * after which point it terminates with a `CANCELLED` status. | 486 /// * All other attempts to modify the instance are rejected. |
494 * * All other attempts to modify the instance are rejected. | 487 /// * Reading the instance via the API continues to give the pre-request |
495 * * Reading the instance via the API continues to give the pre-request | 488 /// resource levels. |
496 * resource levels. | 489 /// |
497 * | 490 /// Upon completion of the returned operation: |
498 * Upon completion of the returned operation: | 491 /// |
499 * | 492 /// * Billing begins for all successfully-allocated resources (some types |
500 * * Billing begins for all successfully-allocated resources (some types | 493 /// may have lower than the requested levels). |
501 * may have lower than the requested levels). | 494 /// * All newly-reserved resources are available for serving the instance's |
502 * * All newly-reserved resources are available for serving the instance's | 495 /// tables. |
503 * tables. | 496 /// * The instance's new resource levels are readable via the API. |
504 * * The instance's new resource levels are readable via the API. | 497 /// |
505 * | 498 /// The returned long-running operation will |
506 * The returned long-running operation will | 499 /// have a name of the format `<instance_name>/operations/<operation_id>` and |
507 * have a name of the format `<instance_name>/operations/<operation_id>` and | 500 /// can be used to track the instance modification. The |
508 * can be used to track the instance modification. The | 501 /// metadata field type is |
509 * metadata field type is | 502 /// UpdateInstanceMetadata. |
510 * UpdateInstanceMetadata. | 503 /// The response field type is |
511 * The response field type is | 504 /// Instance, if successful. |
512 * Instance, if successful. | 505 /// |
513 * | 506 /// Authorization requires `spanner.instances.update` permission on |
514 * Authorization requires `spanner.instances.update` permission on | 507 /// resource name. |
515 * resource name. | 508 /// |
516 * | 509 /// [request] - The metadata request object. |
517 * [request] - The metadata request object. | 510 /// |
518 * | 511 /// Request parameters: |
519 * Request parameters: | 512 /// |
520 * | 513 /// [name] - Required. A unique identifier for the instance, which cannot be |
521 * [name] - Required. A unique identifier for the instance, which cannot be | 514 /// changed |
522 * changed | 515 /// after the instance is created. Values are of the form |
523 * after the instance is created. Values are of the form | 516 /// `projects/<project>/instances/a-z*[a-z0-9]`. The final |
524 * `projects/<project>/instances/a-z*[a-z0-9]`. The final | 517 /// segment of the name must be between 6 and 30 characters in length. |
525 * segment of the name must be between 6 and 30 characters in length. | 518 /// Value must have pattern "^projects/[^/]+/instances/[^/]+$". |
526 * Value must have pattern "^projects/[^/]+/instances/[^/]+$". | 519 /// |
527 * | 520 /// Completes with a [Operation]. |
528 * Completes with a [Operation]. | 521 /// |
529 * | 522 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
530 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 523 /// an error. |
531 * error. | 524 /// |
532 * | 525 /// If the used [http.Client] completes with an error when making a REST |
533 * If the used [http.Client] completes with an error when making a REST call, | 526 /// call, this method will complete with the same error. |
534 * this method will complete with the same error. | 527 async.Future<Operation> patch( |
535 */ | 528 UpdateInstanceRequest request, core.String name) { |
536 async.Future<Operation> patch(UpdateInstanceRequest request, core.String name)
{ | |
537 var _url = null; | 529 var _url = null; |
538 var _queryParams = new core.Map(); | 530 var _queryParams = new core.Map(); |
539 var _uploadMedia = null; | 531 var _uploadMedia = null; |
540 var _uploadOptions = null; | 532 var _uploadOptions = null; |
541 var _downloadOptions = commons.DownloadOptions.Metadata; | 533 var _downloadOptions = commons.DownloadOptions.Metadata; |
542 var _body = null; | 534 var _body = null; |
543 | 535 |
544 if (request != null) { | 536 if (request != null) { |
545 _body = convert.JSON.encode((request).toJson()); | 537 _body = convert.JSON.encode((request).toJson()); |
546 } | 538 } |
547 if (name == null) { | 539 if (name == null) { |
548 throw new core.ArgumentError("Parameter name is required."); | 540 throw new core.ArgumentError("Parameter name is required."); |
549 } | 541 } |
550 | 542 |
551 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 543 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
552 | 544 |
553 var _response = _requester.request(_url, | 545 var _response = _requester.request(_url, "PATCH", |
554 "PATCH", | 546 body: _body, |
555 body: _body, | 547 queryParams: _queryParams, |
556 queryParams: _queryParams, | 548 uploadOptions: _uploadOptions, |
557 uploadOptions: _uploadOptions, | 549 uploadMedia: _uploadMedia, |
558 uploadMedia: _uploadMedia, | 550 downloadOptions: _downloadOptions); |
559 downloadOptions: _downloadOptions); | |
560 return _response.then((data) => new Operation.fromJson(data)); | 551 return _response.then((data) => new Operation.fromJson(data)); |
561 } | 552 } |
562 | 553 |
563 /** | 554 /// Sets the access control policy on an instance resource. Replaces any |
564 * Sets the access control policy on an instance resource. Replaces any | 555 /// existing policy. |
565 * existing policy. | 556 /// |
566 * | 557 /// Authorization requires `spanner.instances.setIamPolicy` on |
567 * Authorization requires `spanner.instances.setIamPolicy` on | 558 /// resource. |
568 * resource. | 559 /// |
569 * | 560 /// [request] - The metadata request object. |
570 * [request] - The metadata request object. | 561 /// |
571 * | 562 /// Request parameters: |
572 * Request parameters: | 563 /// |
573 * | 564 /// [resource] - REQUIRED: The Cloud Spanner resource for which the policy is |
574 * [resource] - REQUIRED: The Cloud Spanner resource for which the policy is | 565 /// being set. The format is `projects/<project ID>/instances/<instance ID>` |
575 * being set. The format is `projects/<project ID>/instances/<instance ID>` | 566 /// for instance resources and `projects/<project ID>/instances/<instance |
576 * for instance resources and `projects/<project ID>/instances/<instance | 567 /// ID>/databases/<database ID>` for databases resources. |
577 * ID>/databases/<database ID>` for databases resources. | 568 /// Value must have pattern "^projects/[^/]+/instances/[^/]+$". |
578 * Value must have pattern "^projects/[^/]+/instances/[^/]+$". | 569 /// |
579 * | 570 /// Completes with a [Policy]. |
580 * Completes with a [Policy]. | 571 /// |
581 * | 572 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
582 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 573 /// an error. |
583 * error. | 574 /// |
584 * | 575 /// If the used [http.Client] completes with an error when making a REST |
585 * If the used [http.Client] completes with an error when making a REST call, | 576 /// call, this method will complete with the same error. |
586 * this method will complete with the same error. | 577 async.Future<Policy> setIamPolicy( |
587 */ | 578 SetIamPolicyRequest request, core.String resource) { |
588 async.Future<Policy> setIamPolicy(SetIamPolicyRequest request, core.String res
ource) { | |
589 var _url = null; | 579 var _url = null; |
590 var _queryParams = new core.Map(); | 580 var _queryParams = new core.Map(); |
591 var _uploadMedia = null; | 581 var _uploadMedia = null; |
592 var _uploadOptions = null; | 582 var _uploadOptions = null; |
593 var _downloadOptions = commons.DownloadOptions.Metadata; | 583 var _downloadOptions = commons.DownloadOptions.Metadata; |
594 var _body = null; | 584 var _body = null; |
595 | 585 |
596 if (request != null) { | 586 if (request != null) { |
597 _body = convert.JSON.encode((request).toJson()); | 587 _body = convert.JSON.encode((request).toJson()); |
598 } | 588 } |
599 if (resource == null) { | 589 if (resource == null) { |
600 throw new core.ArgumentError("Parameter resource is required."); | 590 throw new core.ArgumentError("Parameter resource is required."); |
601 } | 591 } |
602 | 592 |
603 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':setIam
Policy'; | 593 _url = 'v1/' + |
| 594 commons.Escaper.ecapeVariableReserved('$resource') + |
| 595 ':setIamPolicy'; |
604 | 596 |
605 var _response = _requester.request(_url, | 597 var _response = _requester.request(_url, "POST", |
606 "POST", | 598 body: _body, |
607 body: _body, | 599 queryParams: _queryParams, |
608 queryParams: _queryParams, | 600 uploadOptions: _uploadOptions, |
609 uploadOptions: _uploadOptions, | 601 uploadMedia: _uploadMedia, |
610 uploadMedia: _uploadMedia, | 602 downloadOptions: _downloadOptions); |
611 downloadOptions: _downloadOptions); | |
612 return _response.then((data) => new Policy.fromJson(data)); | 603 return _response.then((data) => new Policy.fromJson(data)); |
613 } | 604 } |
614 | 605 |
615 /** | 606 /// Returns permissions that the caller has on the specified instance |
616 * Returns permissions that the caller has on the specified instance resource. | 607 /// resource. |
617 * | 608 /// |
618 * Attempting this RPC on a non-existent Cloud Spanner instance resource will | 609 /// Attempting this RPC on a non-existent Cloud Spanner instance resource |
619 * result in a NOT_FOUND error if the user has `spanner.instances.list` | 610 /// will |
620 * permission on the containing Google Cloud Project. Otherwise returns an | 611 /// result in a NOT_FOUND error if the user has `spanner.instances.list` |
621 * empty set of permissions. | 612 /// permission on the containing Google Cloud Project. Otherwise returns an |
622 * | 613 /// empty set of permissions. |
623 * [request] - The metadata request object. | 614 /// |
624 * | 615 /// [request] - The metadata request object. |
625 * Request parameters: | 616 /// |
626 * | 617 /// Request parameters: |
627 * [resource] - REQUIRED: The Cloud Spanner resource for which permissions are | 618 /// |
628 * being tested. The format is `projects/<project ID>/instances/<instance ID>` | 619 /// [resource] - REQUIRED: The Cloud Spanner resource for which permissions |
629 * for instance resources and `projects/<project ID>/instances/<instance | 620 /// are being tested. The format is `projects/<project |
630 * ID>/databases/<database ID>` for database resources. | 621 /// ID>/instances/<instance ID>` for instance resources and |
631 * Value must have pattern "^projects/[^/]+/instances/[^/]+$". | 622 /// `projects/<project ID>/instances/<instance ID>/databases/<database ID>` |
632 * | 623 /// for database resources. |
633 * Completes with a [TestIamPermissionsResponse]. | 624 /// Value must have pattern "^projects/[^/]+/instances/[^/]+$". |
634 * | 625 /// |
635 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 626 /// Completes with a [TestIamPermissionsResponse]. |
636 * error. | 627 /// |
637 * | 628 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
638 * If the used [http.Client] completes with an error when making a REST call, | 629 /// an error. |
639 * this method will complete with the same error. | 630 /// |
640 */ | 631 /// If the used [http.Client] completes with an error when making a REST |
641 async.Future<TestIamPermissionsResponse> testIamPermissions(TestIamPermissions
Request request, core.String resource) { | 632 /// call, this method will complete with the same error. |
| 633 async.Future<TestIamPermissionsResponse> testIamPermissions( |
| 634 TestIamPermissionsRequest request, core.String resource) { |
642 var _url = null; | 635 var _url = null; |
643 var _queryParams = new core.Map(); | 636 var _queryParams = new core.Map(); |
644 var _uploadMedia = null; | 637 var _uploadMedia = null; |
645 var _uploadOptions = null; | 638 var _uploadOptions = null; |
646 var _downloadOptions = commons.DownloadOptions.Metadata; | 639 var _downloadOptions = commons.DownloadOptions.Metadata; |
647 var _body = null; | 640 var _body = null; |
648 | 641 |
649 if (request != null) { | 642 if (request != null) { |
650 _body = convert.JSON.encode((request).toJson()); | 643 _body = convert.JSON.encode((request).toJson()); |
651 } | 644 } |
652 if (resource == null) { | 645 if (resource == null) { |
653 throw new core.ArgumentError("Parameter resource is required."); | 646 throw new core.ArgumentError("Parameter resource is required."); |
654 } | 647 } |
655 | 648 |
656 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':testIa
mPermissions'; | 649 _url = 'v1/' + |
| 650 commons.Escaper.ecapeVariableReserved('$resource') + |
| 651 ':testIamPermissions'; |
657 | 652 |
658 var _response = _requester.request(_url, | 653 var _response = _requester.request(_url, "POST", |
659 "POST", | 654 body: _body, |
660 body: _body, | 655 queryParams: _queryParams, |
661 queryParams: _queryParams, | 656 uploadOptions: _uploadOptions, |
662 uploadOptions: _uploadOptions, | 657 uploadMedia: _uploadMedia, |
663 uploadMedia: _uploadMedia, | 658 downloadOptions: _downloadOptions); |
664 downloadOptions: _downloadOptions); | 659 return _response |
665 return _response.then((data) => new TestIamPermissionsResponse.fromJson(data
)); | 660 .then((data) => new TestIamPermissionsResponse.fromJson(data)); |
666 } | 661 } |
667 | |
668 } | 662 } |
669 | 663 |
670 | |
671 class ProjectsInstancesDatabasesResourceApi { | 664 class ProjectsInstancesDatabasesResourceApi { |
672 final commons.ApiRequester _requester; | 665 final commons.ApiRequester _requester; |
673 | 666 |
674 ProjectsInstancesDatabasesOperationsResourceApi get operations => new Projects
InstancesDatabasesOperationsResourceApi(_requester); | 667 ProjectsInstancesDatabasesOperationsResourceApi get operations => |
675 ProjectsInstancesDatabasesSessionsResourceApi get sessions => new ProjectsInst
ancesDatabasesSessionsResourceApi(_requester); | 668 new ProjectsInstancesDatabasesOperationsResourceApi(_requester); |
| 669 ProjectsInstancesDatabasesSessionsResourceApi get sessions => |
| 670 new ProjectsInstancesDatabasesSessionsResourceApi(_requester); |
676 | 671 |
677 ProjectsInstancesDatabasesResourceApi(commons.ApiRequester client) : | 672 ProjectsInstancesDatabasesResourceApi(commons.ApiRequester client) |
678 _requester = client; | 673 : _requester = client; |
679 | 674 |
680 /** | 675 /// Creates a new Cloud Spanner database and starts to prepare it for |
681 * Creates a new Cloud Spanner database and starts to prepare it for serving. | 676 /// serving. |
682 * The returned long-running operation will | 677 /// The returned long-running operation will |
683 * have a name of the format `<database_name>/operations/<operation_id>` and | 678 /// have a name of the format `<database_name>/operations/<operation_id>` and |
684 * can be used to track preparation of the database. The | 679 /// can be used to track preparation of the database. The |
685 * metadata field type is | 680 /// metadata field type is |
686 * CreateDatabaseMetadata. The | 681 /// CreateDatabaseMetadata. The |
687 * response field type is | 682 /// response field type is |
688 * Database, if successful. | 683 /// Database, if successful. |
689 * | 684 /// |
690 * [request] - The metadata request object. | 685 /// [request] - The metadata request object. |
691 * | 686 /// |
692 * Request parameters: | 687 /// Request parameters: |
693 * | 688 /// |
694 * [parent] - Required. The name of the instance that will serve the new | 689 /// [parent] - Required. The name of the instance that will serve the new |
695 * database. | 690 /// database. |
696 * Values are of the form `projects/<project>/instances/<instance>`. | 691 /// Values are of the form `projects/<project>/instances/<instance>`. |
697 * Value must have pattern "^projects/[^/]+/instances/[^/]+$". | 692 /// Value must have pattern "^projects/[^/]+/instances/[^/]+$". |
698 * | 693 /// |
699 * Completes with a [Operation]. | 694 /// Completes with a [Operation]. |
700 * | 695 /// |
701 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 696 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
702 * error. | 697 /// an error. |
703 * | 698 /// |
704 * If the used [http.Client] completes with an error when making a REST call, | 699 /// If the used [http.Client] completes with an error when making a REST |
705 * this method will complete with the same error. | 700 /// call, this method will complete with the same error. |
706 */ | 701 async.Future<Operation> create( |
707 async.Future<Operation> create(CreateDatabaseRequest request, core.String pare
nt) { | 702 CreateDatabaseRequest request, core.String parent) { |
708 var _url = null; | 703 var _url = null; |
709 var _queryParams = new core.Map(); | 704 var _queryParams = new core.Map(); |
710 var _uploadMedia = null; | 705 var _uploadMedia = null; |
711 var _uploadOptions = null; | 706 var _uploadOptions = null; |
712 var _downloadOptions = commons.DownloadOptions.Metadata; | 707 var _downloadOptions = commons.DownloadOptions.Metadata; |
713 var _body = null; | 708 var _body = null; |
714 | 709 |
715 if (request != null) { | 710 if (request != null) { |
716 _body = convert.JSON.encode((request).toJson()); | 711 _body = convert.JSON.encode((request).toJson()); |
717 } | 712 } |
718 if (parent == null) { | 713 if (parent == null) { |
719 throw new core.ArgumentError("Parameter parent is required."); | 714 throw new core.ArgumentError("Parameter parent is required."); |
720 } | 715 } |
721 | 716 |
722 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/database
s'; | 717 _url = |
| 718 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/databases'; |
723 | 719 |
724 var _response = _requester.request(_url, | 720 var _response = _requester.request(_url, "POST", |
725 "POST", | 721 body: _body, |
726 body: _body, | 722 queryParams: _queryParams, |
727 queryParams: _queryParams, | 723 uploadOptions: _uploadOptions, |
728 uploadOptions: _uploadOptions, | 724 uploadMedia: _uploadMedia, |
729 uploadMedia: _uploadMedia, | 725 downloadOptions: _downloadOptions); |
730 downloadOptions: _downloadOptions); | |
731 return _response.then((data) => new Operation.fromJson(data)); | 726 return _response.then((data) => new Operation.fromJson(data)); |
732 } | 727 } |
733 | 728 |
734 /** | 729 /// Drops (aka deletes) a Cloud Spanner database. |
735 * Drops (aka deletes) a Cloud Spanner database. | 730 /// |
736 * | 731 /// Request parameters: |
737 * Request parameters: | 732 /// |
738 * | 733 /// [database] - Required. The database to be dropped. |
739 * [database] - Required. The database to be dropped. | 734 /// Value must have pattern |
740 * Value must have pattern "^projects/[^/]+/instances/[^/]+/databases/[^/]+$". | 735 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+$". |
741 * | 736 /// |
742 * Completes with a [Empty]. | 737 /// Completes with a [Empty]. |
743 * | 738 /// |
744 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 739 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
745 * error. | 740 /// an error. |
746 * | 741 /// |
747 * If the used [http.Client] completes with an error when making a REST call, | 742 /// If the used [http.Client] completes with an error when making a REST |
748 * this method will complete with the same error. | 743 /// call, this method will complete with the same error. |
749 */ | |
750 async.Future<Empty> dropDatabase(core.String database) { | 744 async.Future<Empty> dropDatabase(core.String database) { |
751 var _url = null; | 745 var _url = null; |
752 var _queryParams = new core.Map(); | 746 var _queryParams = new core.Map(); |
753 var _uploadMedia = null; | 747 var _uploadMedia = null; |
754 var _uploadOptions = null; | 748 var _uploadOptions = null; |
755 var _downloadOptions = commons.DownloadOptions.Metadata; | 749 var _downloadOptions = commons.DownloadOptions.Metadata; |
756 var _body = null; | 750 var _body = null; |
757 | 751 |
758 if (database == null) { | 752 if (database == null) { |
759 throw new core.ArgumentError("Parameter database is required."); | 753 throw new core.ArgumentError("Parameter database is required."); |
760 } | 754 } |
761 | 755 |
762 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$database'); | 756 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$database'); |
763 | 757 |
764 var _response = _requester.request(_url, | 758 var _response = _requester.request(_url, "DELETE", |
765 "DELETE", | 759 body: _body, |
766 body: _body, | 760 queryParams: _queryParams, |
767 queryParams: _queryParams, | 761 uploadOptions: _uploadOptions, |
768 uploadOptions: _uploadOptions, | 762 uploadMedia: _uploadMedia, |
769 uploadMedia: _uploadMedia, | 763 downloadOptions: _downloadOptions); |
770 downloadOptions: _downloadOptions); | |
771 return _response.then((data) => new Empty.fromJson(data)); | 764 return _response.then((data) => new Empty.fromJson(data)); |
772 } | 765 } |
773 | 766 |
774 /** | 767 /// Gets the state of a Cloud Spanner database. |
775 * Gets the state of a Cloud Spanner database. | 768 /// |
776 * | 769 /// Request parameters: |
777 * Request parameters: | 770 /// |
778 * | 771 /// [name] - Required. The name of the requested database. Values are of the |
779 * [name] - Required. The name of the requested database. Values are of the | 772 /// form |
780 * form | 773 /// `projects/<project>/instances/<instance>/databases/<database>`. |
781 * `projects/<project>/instances/<instance>/databases/<database>`. | 774 /// Value must have pattern |
782 * Value must have pattern "^projects/[^/]+/instances/[^/]+/databases/[^/]+$". | 775 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+$". |
783 * | 776 /// |
784 * Completes with a [Database]. | 777 /// Completes with a [Database]. |
785 * | 778 /// |
786 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 779 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
787 * error. | 780 /// an error. |
788 * | 781 /// |
789 * If the used [http.Client] completes with an error when making a REST call, | 782 /// If the used [http.Client] completes with an error when making a REST |
790 * this method will complete with the same error. | 783 /// call, this method will complete with the same error. |
791 */ | |
792 async.Future<Database> get(core.String name) { | 784 async.Future<Database> get(core.String name) { |
793 var _url = null; | 785 var _url = null; |
794 var _queryParams = new core.Map(); | 786 var _queryParams = new core.Map(); |
795 var _uploadMedia = null; | 787 var _uploadMedia = null; |
796 var _uploadOptions = null; | 788 var _uploadOptions = null; |
797 var _downloadOptions = commons.DownloadOptions.Metadata; | 789 var _downloadOptions = commons.DownloadOptions.Metadata; |
798 var _body = null; | 790 var _body = null; |
799 | 791 |
800 if (name == null) { | 792 if (name == null) { |
801 throw new core.ArgumentError("Parameter name is required."); | 793 throw new core.ArgumentError("Parameter name is required."); |
802 } | 794 } |
803 | 795 |
804 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 796 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
805 | 797 |
806 var _response = _requester.request(_url, | 798 var _response = _requester.request(_url, "GET", |
807 "GET", | 799 body: _body, |
808 body: _body, | 800 queryParams: _queryParams, |
809 queryParams: _queryParams, | 801 uploadOptions: _uploadOptions, |
810 uploadOptions: _uploadOptions, | 802 uploadMedia: _uploadMedia, |
811 uploadMedia: _uploadMedia, | 803 downloadOptions: _downloadOptions); |
812 downloadOptions: _downloadOptions); | |
813 return _response.then((data) => new Database.fromJson(data)); | 804 return _response.then((data) => new Database.fromJson(data)); |
814 } | 805 } |
815 | 806 |
816 /** | 807 /// Returns the schema of a Cloud Spanner database as a list of formatted |
817 * Returns the schema of a Cloud Spanner database as a list of formatted | 808 /// DDL statements. This method does not show pending schema updates, those |
818 * DDL statements. This method does not show pending schema updates, those may | 809 /// may |
819 * be queried using the Operations API. | 810 /// be queried using the Operations API. |
820 * | 811 /// |
821 * Request parameters: | 812 /// Request parameters: |
822 * | 813 /// |
823 * [database] - Required. The database whose schema we wish to get. | 814 /// [database] - Required. The database whose schema we wish to get. |
824 * Value must have pattern "^projects/[^/]+/instances/[^/]+/databases/[^/]+$". | 815 /// Value must have pattern |
825 * | 816 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+$". |
826 * Completes with a [GetDatabaseDdlResponse]. | 817 /// |
827 * | 818 /// Completes with a [GetDatabaseDdlResponse]. |
828 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 819 /// |
829 * error. | 820 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
830 * | 821 /// an error. |
831 * If the used [http.Client] completes with an error when making a REST call, | 822 /// |
832 * this method will complete with the same error. | 823 /// If the used [http.Client] completes with an error when making a REST |
833 */ | 824 /// call, this method will complete with the same error. |
834 async.Future<GetDatabaseDdlResponse> getDdl(core.String database) { | 825 async.Future<GetDatabaseDdlResponse> getDdl(core.String database) { |
835 var _url = null; | 826 var _url = null; |
836 var _queryParams = new core.Map(); | 827 var _queryParams = new core.Map(); |
837 var _uploadMedia = null; | 828 var _uploadMedia = null; |
838 var _uploadOptions = null; | 829 var _uploadOptions = null; |
839 var _downloadOptions = commons.DownloadOptions.Metadata; | 830 var _downloadOptions = commons.DownloadOptions.Metadata; |
840 var _body = null; | 831 var _body = null; |
841 | 832 |
842 if (database == null) { | 833 if (database == null) { |
843 throw new core.ArgumentError("Parameter database is required."); | 834 throw new core.ArgumentError("Parameter database is required."); |
844 } | 835 } |
845 | 836 |
846 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$database') + '/ddl'; | 837 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$database') + '/ddl'; |
847 | 838 |
848 var _response = _requester.request(_url, | 839 var _response = _requester.request(_url, "GET", |
849 "GET", | 840 body: _body, |
850 body: _body, | 841 queryParams: _queryParams, |
851 queryParams: _queryParams, | 842 uploadOptions: _uploadOptions, |
852 uploadOptions: _uploadOptions, | 843 uploadMedia: _uploadMedia, |
853 uploadMedia: _uploadMedia, | 844 downloadOptions: _downloadOptions); |
854 downloadOptions: _downloadOptions); | |
855 return _response.then((data) => new GetDatabaseDdlResponse.fromJson(data)); | 845 return _response.then((data) => new GetDatabaseDdlResponse.fromJson(data)); |
856 } | 846 } |
857 | 847 |
858 /** | 848 /// Gets the access control policy for a database resource. Returns an empty |
859 * Gets the access control policy for a database resource. Returns an empty | 849 /// policy if a database exists but does not have a policy set. |
860 * policy if a database exists but does not have a policy set. | 850 /// |
861 * | 851 /// Authorization requires `spanner.databases.getIamPolicy` permission on |
862 * Authorization requires `spanner.databases.getIamPolicy` permission on | 852 /// resource. |
863 * resource. | 853 /// |
864 * | 854 /// [request] - The metadata request object. |
865 * [request] - The metadata request object. | 855 /// |
866 * | 856 /// Request parameters: |
867 * Request parameters: | 857 /// |
868 * | 858 /// [resource] - REQUIRED: The Cloud Spanner resource for which the policy is |
869 * [resource] - REQUIRED: The Cloud Spanner resource for which the policy is | 859 /// being retrieved. The format is `projects/<project ID>/instances/<instance |
870 * being retrieved. The format is `projects/<project ID>/instances/<instance | 860 /// ID>` for instance resources and `projects/<project |
871 * ID>` for instance resources and `projects/<project ID>/instances/<instance | 861 /// ID>/instances/<instance ID>/databases/<database ID>` for database |
872 * ID>/databases/<database ID>` for database resources. | 862 /// resources. |
873 * Value must have pattern "^projects/[^/]+/instances/[^/]+/databases/[^/]+$". | 863 /// Value must have pattern |
874 * | 864 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+$". |
875 * Completes with a [Policy]. | 865 /// |
876 * | 866 /// Completes with a [Policy]. |
877 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 867 /// |
878 * error. | 868 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
879 * | 869 /// an error. |
880 * If the used [http.Client] completes with an error when making a REST call, | 870 /// |
881 * this method will complete with the same error. | 871 /// If the used [http.Client] completes with an error when making a REST |
882 */ | 872 /// call, this method will complete with the same error. |
883 async.Future<Policy> getIamPolicy(GetIamPolicyRequest request, core.String res
ource) { | 873 async.Future<Policy> getIamPolicy( |
| 874 GetIamPolicyRequest request, core.String resource) { |
884 var _url = null; | 875 var _url = null; |
885 var _queryParams = new core.Map(); | 876 var _queryParams = new core.Map(); |
886 var _uploadMedia = null; | 877 var _uploadMedia = null; |
887 var _uploadOptions = null; | 878 var _uploadOptions = null; |
888 var _downloadOptions = commons.DownloadOptions.Metadata; | 879 var _downloadOptions = commons.DownloadOptions.Metadata; |
889 var _body = null; | 880 var _body = null; |
890 | 881 |
891 if (request != null) { | 882 if (request != null) { |
892 _body = convert.JSON.encode((request).toJson()); | 883 _body = convert.JSON.encode((request).toJson()); |
893 } | 884 } |
894 if (resource == null) { | 885 if (resource == null) { |
895 throw new core.ArgumentError("Parameter resource is required."); | 886 throw new core.ArgumentError("Parameter resource is required."); |
896 } | 887 } |
897 | 888 |
898 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getIam
Policy'; | 889 _url = 'v1/' + |
| 890 commons.Escaper.ecapeVariableReserved('$resource') + |
| 891 ':getIamPolicy'; |
899 | 892 |
900 var _response = _requester.request(_url, | 893 var _response = _requester.request(_url, "POST", |
901 "POST", | 894 body: _body, |
902 body: _body, | 895 queryParams: _queryParams, |
903 queryParams: _queryParams, | 896 uploadOptions: _uploadOptions, |
904 uploadOptions: _uploadOptions, | 897 uploadMedia: _uploadMedia, |
905 uploadMedia: _uploadMedia, | 898 downloadOptions: _downloadOptions); |
906 downloadOptions: _downloadOptions); | |
907 return _response.then((data) => new Policy.fromJson(data)); | 899 return _response.then((data) => new Policy.fromJson(data)); |
908 } | 900 } |
909 | 901 |
910 /** | 902 /// Lists Cloud Spanner databases. |
911 * Lists Cloud Spanner databases. | 903 /// |
912 * | 904 /// Request parameters: |
913 * Request parameters: | 905 /// |
914 * | 906 /// [parent] - Required. The instance whose databases should be listed. |
915 * [parent] - Required. The instance whose databases should be listed. | 907 /// Values are of the form `projects/<project>/instances/<instance>`. |
916 * Values are of the form `projects/<project>/instances/<instance>`. | 908 /// Value must have pattern "^projects/[^/]+/instances/[^/]+$". |
917 * Value must have pattern "^projects/[^/]+/instances/[^/]+$". | 909 /// |
918 * | 910 /// [pageToken] - If non-empty, `page_token` should contain a |
919 * [pageToken] - If non-empty, `page_token` should contain a | 911 /// next_page_token from a |
920 * next_page_token from a | 912 /// previous ListDatabasesResponse. |
921 * previous ListDatabasesResponse. | 913 /// |
922 * | 914 /// [pageSize] - Number of databases to be returned in the response. If 0 or |
923 * [pageSize] - Number of databases to be returned in the response. If 0 or | 915 /// less, |
924 * less, | 916 /// defaults to the server's maximum allowed page size. |
925 * defaults to the server's maximum allowed page size. | 917 /// |
926 * | 918 /// Completes with a [ListDatabasesResponse]. |
927 * Completes with a [ListDatabasesResponse]. | 919 /// |
928 * | 920 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
929 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 921 /// an error. |
930 * error. | 922 /// |
931 * | 923 /// If the used [http.Client] completes with an error when making a REST |
932 * If the used [http.Client] completes with an error when making a REST call, | 924 /// call, this method will complete with the same error. |
933 * this method will complete with the same error. | 925 async.Future<ListDatabasesResponse> list(core.String parent, |
934 */ | 926 {core.String pageToken, core.int pageSize}) { |
935 async.Future<ListDatabasesResponse> list(core.String parent, {core.String page
Token, core.int pageSize}) { | |
936 var _url = null; | 927 var _url = null; |
937 var _queryParams = new core.Map(); | 928 var _queryParams = new core.Map(); |
938 var _uploadMedia = null; | 929 var _uploadMedia = null; |
939 var _uploadOptions = null; | 930 var _uploadOptions = null; |
940 var _downloadOptions = commons.DownloadOptions.Metadata; | 931 var _downloadOptions = commons.DownloadOptions.Metadata; |
941 var _body = null; | 932 var _body = null; |
942 | 933 |
943 if (parent == null) { | 934 if (parent == null) { |
944 throw new core.ArgumentError("Parameter parent is required."); | 935 throw new core.ArgumentError("Parameter parent is required."); |
945 } | 936 } |
946 if (pageToken != null) { | 937 if (pageToken != null) { |
947 _queryParams["pageToken"] = [pageToken]; | 938 _queryParams["pageToken"] = [pageToken]; |
948 } | 939 } |
949 if (pageSize != null) { | 940 if (pageSize != null) { |
950 _queryParams["pageSize"] = ["${pageSize}"]; | 941 _queryParams["pageSize"] = ["${pageSize}"]; |
951 } | 942 } |
952 | 943 |
953 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/database
s'; | 944 _url = |
| 945 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/databases'; |
954 | 946 |
955 var _response = _requester.request(_url, | 947 var _response = _requester.request(_url, "GET", |
956 "GET", | 948 body: _body, |
957 body: _body, | 949 queryParams: _queryParams, |
958 queryParams: _queryParams, | 950 uploadOptions: _uploadOptions, |
959 uploadOptions: _uploadOptions, | 951 uploadMedia: _uploadMedia, |
960 uploadMedia: _uploadMedia, | 952 downloadOptions: _downloadOptions); |
961 downloadOptions: _downloadOptions); | |
962 return _response.then((data) => new ListDatabasesResponse.fromJson(data)); | 953 return _response.then((data) => new ListDatabasesResponse.fromJson(data)); |
963 } | 954 } |
964 | 955 |
965 /** | 956 /// Sets the access control policy on a database resource. Replaces any |
966 * Sets the access control policy on a database resource. Replaces any | 957 /// existing policy. |
967 * existing policy. | 958 /// |
968 * | 959 /// Authorization requires `spanner.databases.setIamPolicy` permission on |
969 * Authorization requires `spanner.databases.setIamPolicy` permission on | 960 /// resource. |
970 * resource. | 961 /// |
971 * | 962 /// [request] - The metadata request object. |
972 * [request] - The metadata request object. | 963 /// |
973 * | 964 /// Request parameters: |
974 * Request parameters: | 965 /// |
975 * | 966 /// [resource] - REQUIRED: The Cloud Spanner resource for which the policy is |
976 * [resource] - REQUIRED: The Cloud Spanner resource for which the policy is | 967 /// being set. The format is `projects/<project ID>/instances/<instance ID>` |
977 * being set. The format is `projects/<project ID>/instances/<instance ID>` | 968 /// for instance resources and `projects/<project ID>/instances/<instance |
978 * for instance resources and `projects/<project ID>/instances/<instance | 969 /// ID>/databases/<database ID>` for databases resources. |
979 * ID>/databases/<database ID>` for databases resources. | 970 /// Value must have pattern |
980 * Value must have pattern "^projects/[^/]+/instances/[^/]+/databases/[^/]+$". | 971 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+$". |
981 * | 972 /// |
982 * Completes with a [Policy]. | 973 /// Completes with a [Policy]. |
983 * | 974 /// |
984 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 975 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
985 * error. | 976 /// an error. |
986 * | 977 /// |
987 * If the used [http.Client] completes with an error when making a REST call, | 978 /// If the used [http.Client] completes with an error when making a REST |
988 * this method will complete with the same error. | 979 /// call, this method will complete with the same error. |
989 */ | 980 async.Future<Policy> setIamPolicy( |
990 async.Future<Policy> setIamPolicy(SetIamPolicyRequest request, core.String res
ource) { | 981 SetIamPolicyRequest request, core.String resource) { |
991 var _url = null; | 982 var _url = null; |
992 var _queryParams = new core.Map(); | 983 var _queryParams = new core.Map(); |
993 var _uploadMedia = null; | 984 var _uploadMedia = null; |
994 var _uploadOptions = null; | 985 var _uploadOptions = null; |
995 var _downloadOptions = commons.DownloadOptions.Metadata; | 986 var _downloadOptions = commons.DownloadOptions.Metadata; |
996 var _body = null; | 987 var _body = null; |
997 | 988 |
998 if (request != null) { | 989 if (request != null) { |
999 _body = convert.JSON.encode((request).toJson()); | 990 _body = convert.JSON.encode((request).toJson()); |
1000 } | 991 } |
1001 if (resource == null) { | 992 if (resource == null) { |
1002 throw new core.ArgumentError("Parameter resource is required."); | 993 throw new core.ArgumentError("Parameter resource is required."); |
1003 } | 994 } |
1004 | 995 |
1005 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':setIam
Policy'; | 996 _url = 'v1/' + |
| 997 commons.Escaper.ecapeVariableReserved('$resource') + |
| 998 ':setIamPolicy'; |
1006 | 999 |
1007 var _response = _requester.request(_url, | 1000 var _response = _requester.request(_url, "POST", |
1008 "POST", | 1001 body: _body, |
1009 body: _body, | 1002 queryParams: _queryParams, |
1010 queryParams: _queryParams, | 1003 uploadOptions: _uploadOptions, |
1011 uploadOptions: _uploadOptions, | 1004 uploadMedia: _uploadMedia, |
1012 uploadMedia: _uploadMedia, | 1005 downloadOptions: _downloadOptions); |
1013 downloadOptions: _downloadOptions); | |
1014 return _response.then((data) => new Policy.fromJson(data)); | 1006 return _response.then((data) => new Policy.fromJson(data)); |
1015 } | 1007 } |
1016 | 1008 |
1017 /** | 1009 /// Returns permissions that the caller has on the specified database |
1018 * Returns permissions that the caller has on the specified database resource. | 1010 /// resource. |
1019 * | 1011 /// |
1020 * Attempting this RPC on a non-existent Cloud Spanner database will result in | 1012 /// Attempting this RPC on a non-existent Cloud Spanner database will result |
1021 * a NOT_FOUND error if the user has `spanner.databases.list` permission on | 1013 /// in |
1022 * the containing Cloud Spanner instance. Otherwise returns an empty set of | 1014 /// a NOT_FOUND error if the user has `spanner.databases.list` permission on |
1023 * permissions. | 1015 /// the containing Cloud Spanner instance. Otherwise returns an empty set of |
1024 * | 1016 /// permissions. |
1025 * [request] - The metadata request object. | 1017 /// |
1026 * | 1018 /// [request] - The metadata request object. |
1027 * Request parameters: | 1019 /// |
1028 * | 1020 /// Request parameters: |
1029 * [resource] - REQUIRED: The Cloud Spanner resource for which permissions are | 1021 /// |
1030 * being tested. The format is `projects/<project ID>/instances/<instance ID>` | 1022 /// [resource] - REQUIRED: The Cloud Spanner resource for which permissions |
1031 * for instance resources and `projects/<project ID>/instances/<instance | 1023 /// are being tested. The format is `projects/<project |
1032 * ID>/databases/<database ID>` for database resources. | 1024 /// ID>/instances/<instance ID>` for instance resources and |
1033 * Value must have pattern "^projects/[^/]+/instances/[^/]+/databases/[^/]+$". | 1025 /// `projects/<project ID>/instances/<instance ID>/databases/<database ID>` |
1034 * | 1026 /// for database resources. |
1035 * Completes with a [TestIamPermissionsResponse]. | 1027 /// Value must have pattern |
1036 * | 1028 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+$". |
1037 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1029 /// |
1038 * error. | 1030 /// Completes with a [TestIamPermissionsResponse]. |
1039 * | 1031 /// |
1040 * If the used [http.Client] completes with an error when making a REST call, | 1032 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1041 * this method will complete with the same error. | 1033 /// an error. |
1042 */ | 1034 /// |
1043 async.Future<TestIamPermissionsResponse> testIamPermissions(TestIamPermissions
Request request, core.String resource) { | 1035 /// If the used [http.Client] completes with an error when making a REST |
| 1036 /// call, this method will complete with the same error. |
| 1037 async.Future<TestIamPermissionsResponse> testIamPermissions( |
| 1038 TestIamPermissionsRequest request, core.String resource) { |
1044 var _url = null; | 1039 var _url = null; |
1045 var _queryParams = new core.Map(); | 1040 var _queryParams = new core.Map(); |
1046 var _uploadMedia = null; | 1041 var _uploadMedia = null; |
1047 var _uploadOptions = null; | 1042 var _uploadOptions = null; |
1048 var _downloadOptions = commons.DownloadOptions.Metadata; | 1043 var _downloadOptions = commons.DownloadOptions.Metadata; |
1049 var _body = null; | 1044 var _body = null; |
1050 | 1045 |
1051 if (request != null) { | 1046 if (request != null) { |
1052 _body = convert.JSON.encode((request).toJson()); | 1047 _body = convert.JSON.encode((request).toJson()); |
1053 } | 1048 } |
1054 if (resource == null) { | 1049 if (resource == null) { |
1055 throw new core.ArgumentError("Parameter resource is required."); | 1050 throw new core.ArgumentError("Parameter resource is required."); |
1056 } | 1051 } |
1057 | 1052 |
1058 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':testIa
mPermissions'; | 1053 _url = 'v1/' + |
| 1054 commons.Escaper.ecapeVariableReserved('$resource') + |
| 1055 ':testIamPermissions'; |
1059 | 1056 |
1060 var _response = _requester.request(_url, | 1057 var _response = _requester.request(_url, "POST", |
1061 "POST", | 1058 body: _body, |
1062 body: _body, | 1059 queryParams: _queryParams, |
1063 queryParams: _queryParams, | 1060 uploadOptions: _uploadOptions, |
1064 uploadOptions: _uploadOptions, | 1061 uploadMedia: _uploadMedia, |
1065 uploadMedia: _uploadMedia, | 1062 downloadOptions: _downloadOptions); |
1066 downloadOptions: _downloadOptions); | 1063 return _response |
1067 return _response.then((data) => new TestIamPermissionsResponse.fromJson(data
)); | 1064 .then((data) => new TestIamPermissionsResponse.fromJson(data)); |
1068 } | 1065 } |
1069 | 1066 |
1070 /** | 1067 /// Updates the schema of a Cloud Spanner database by |
1071 * Updates the schema of a Cloud Spanner database by | 1068 /// creating/altering/dropping tables, columns, indexes, etc. The returned |
1072 * creating/altering/dropping tables, columns, indexes, etc. The returned | 1069 /// long-running operation will have a name of |
1073 * long-running operation will have a name of | 1070 /// the format `<database_name>/operations/<operation_id>` and can be used to |
1074 * the format `<database_name>/operations/<operation_id>` and can be used to | 1071 /// track execution of the schema change(s). The |
1075 * track execution of the schema change(s). The | 1072 /// metadata field type is |
1076 * metadata field type is | 1073 /// UpdateDatabaseDdlMetadata. The operation has no response. |
1077 * UpdateDatabaseDdlMetadata. The operation has no response. | 1074 /// |
1078 * | 1075 /// [request] - The metadata request object. |
1079 * [request] - The metadata request object. | 1076 /// |
1080 * | 1077 /// Request parameters: |
1081 * Request parameters: | 1078 /// |
1082 * | 1079 /// [database] - Required. The database to update. |
1083 * [database] - Required. The database to update. | 1080 /// Value must have pattern |
1084 * Value must have pattern "^projects/[^/]+/instances/[^/]+/databases/[^/]+$". | 1081 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+$". |
1085 * | 1082 /// |
1086 * Completes with a [Operation]. | 1083 /// Completes with a [Operation]. |
1087 * | 1084 /// |
1088 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1085 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1089 * error. | 1086 /// an error. |
1090 * | 1087 /// |
1091 * If the used [http.Client] completes with an error when making a REST call, | 1088 /// If the used [http.Client] completes with an error when making a REST |
1092 * this method will complete with the same error. | 1089 /// call, this method will complete with the same error. |
1093 */ | 1090 async.Future<Operation> updateDdl( |
1094 async.Future<Operation> updateDdl(UpdateDatabaseDdlRequest request, core.Strin
g database) { | 1091 UpdateDatabaseDdlRequest request, core.String database) { |
1095 var _url = null; | 1092 var _url = null; |
1096 var _queryParams = new core.Map(); | 1093 var _queryParams = new core.Map(); |
1097 var _uploadMedia = null; | 1094 var _uploadMedia = null; |
1098 var _uploadOptions = null; | 1095 var _uploadOptions = null; |
1099 var _downloadOptions = commons.DownloadOptions.Metadata; | 1096 var _downloadOptions = commons.DownloadOptions.Metadata; |
1100 var _body = null; | 1097 var _body = null; |
1101 | 1098 |
1102 if (request != null) { | 1099 if (request != null) { |
1103 _body = convert.JSON.encode((request).toJson()); | 1100 _body = convert.JSON.encode((request).toJson()); |
1104 } | 1101 } |
1105 if (database == null) { | 1102 if (database == null) { |
1106 throw new core.ArgumentError("Parameter database is required."); | 1103 throw new core.ArgumentError("Parameter database is required."); |
1107 } | 1104 } |
1108 | 1105 |
1109 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$database') + '/ddl'; | 1106 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$database') + '/ddl'; |
1110 | 1107 |
1111 var _response = _requester.request(_url, | 1108 var _response = _requester.request(_url, "PATCH", |
1112 "PATCH", | 1109 body: _body, |
1113 body: _body, | 1110 queryParams: _queryParams, |
1114 queryParams: _queryParams, | 1111 uploadOptions: _uploadOptions, |
1115 uploadOptions: _uploadOptions, | 1112 uploadMedia: _uploadMedia, |
1116 uploadMedia: _uploadMedia, | 1113 downloadOptions: _downloadOptions); |
1117 downloadOptions: _downloadOptions); | |
1118 return _response.then((data) => new Operation.fromJson(data)); | 1114 return _response.then((data) => new Operation.fromJson(data)); |
1119 } | 1115 } |
1120 | |
1121 } | 1116 } |
1122 | 1117 |
1123 | |
1124 class ProjectsInstancesDatabasesOperationsResourceApi { | 1118 class ProjectsInstancesDatabasesOperationsResourceApi { |
1125 final commons.ApiRequester _requester; | 1119 final commons.ApiRequester _requester; |
1126 | 1120 |
1127 ProjectsInstancesDatabasesOperationsResourceApi(commons.ApiRequester client) :
| 1121 ProjectsInstancesDatabasesOperationsResourceApi(commons.ApiRequester client) |
1128 _requester = client; | 1122 : _requester = client; |
1129 | 1123 |
1130 /** | 1124 /// Starts asynchronous cancellation on a long-running operation. The server |
1131 * Starts asynchronous cancellation on a long-running operation. The server | 1125 /// makes a best effort to cancel the operation, but success is not |
1132 * makes a best effort to cancel the operation, but success is not | 1126 /// guaranteed. If the server doesn't support this method, it returns |
1133 * guaranteed. If the server doesn't support this method, it returns | 1127 /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use |
1134 * `google.rpc.Code.UNIMPLEMENTED`. Clients can use | 1128 /// Operations.GetOperation or |
1135 * Operations.GetOperation or | 1129 /// other methods to check whether the cancellation succeeded or whether the |
1136 * other methods to check whether the cancellation succeeded or whether the | 1130 /// operation completed despite cancellation. On successful cancellation, |
1137 * operation completed despite cancellation. On successful cancellation, | 1131 /// the operation is not deleted; instead, it becomes an operation with |
1138 * the operation is not deleted; instead, it becomes an operation with | 1132 /// an Operation.error value with a google.rpc.Status.code of 1, |
1139 * an Operation.error value with a google.rpc.Status.code of 1, | 1133 /// corresponding to `Code.CANCELLED`. |
1140 * corresponding to `Code.CANCELLED`. | 1134 /// |
1141 * | 1135 /// Request parameters: |
1142 * Request parameters: | 1136 /// |
1143 * | 1137 /// [name] - The name of the operation resource to be cancelled. |
1144 * [name] - The name of the operation resource to be cancelled. | 1138 /// Value must have pattern |
1145 * Value must have pattern | 1139 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+$". |
1146 * "^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+$". | 1140 /// |
1147 * | 1141 /// Completes with a [Empty]. |
1148 * Completes with a [Empty]. | 1142 /// |
1149 * | 1143 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1150 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1144 /// an error. |
1151 * error. | 1145 /// |
1152 * | 1146 /// If the used [http.Client] completes with an error when making a REST |
1153 * If the used [http.Client] completes with an error when making a REST call, | 1147 /// call, this method will complete with the same error. |
1154 * this method will complete with the same error. | |
1155 */ | |
1156 async.Future<Empty> cancel(core.String name) { | 1148 async.Future<Empty> cancel(core.String name) { |
1157 var _url = null; | 1149 var _url = null; |
1158 var _queryParams = new core.Map(); | 1150 var _queryParams = new core.Map(); |
1159 var _uploadMedia = null; | 1151 var _uploadMedia = null; |
1160 var _uploadOptions = null; | 1152 var _uploadOptions = null; |
1161 var _downloadOptions = commons.DownloadOptions.Metadata; | 1153 var _downloadOptions = commons.DownloadOptions.Metadata; |
1162 var _body = null; | 1154 var _body = null; |
1163 | 1155 |
1164 if (name == null) { | 1156 if (name == null) { |
1165 throw new core.ArgumentError("Parameter name is required."); | 1157 throw new core.ArgumentError("Parameter name is required."); |
1166 } | 1158 } |
1167 | 1159 |
1168 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name') + ':cancel'; | 1160 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name') + ':cancel'; |
1169 | 1161 |
1170 var _response = _requester.request(_url, | 1162 var _response = _requester.request(_url, "POST", |
1171 "POST", | 1163 body: _body, |
1172 body: _body, | 1164 queryParams: _queryParams, |
1173 queryParams: _queryParams, | 1165 uploadOptions: _uploadOptions, |
1174 uploadOptions: _uploadOptions, | 1166 uploadMedia: _uploadMedia, |
1175 uploadMedia: _uploadMedia, | 1167 downloadOptions: _downloadOptions); |
1176 downloadOptions: _downloadOptions); | |
1177 return _response.then((data) => new Empty.fromJson(data)); | 1168 return _response.then((data) => new Empty.fromJson(data)); |
1178 } | 1169 } |
1179 | 1170 |
1180 /** | 1171 /// Deletes a long-running operation. This method indicates that the client |
1181 * Deletes a long-running operation. This method indicates that the client is | 1172 /// is |
1182 * no longer interested in the operation result. It does not cancel the | 1173 /// no longer interested in the operation result. It does not cancel the |
1183 * operation. If the server doesn't support this method, it returns | 1174 /// operation. If the server doesn't support this method, it returns |
1184 * `google.rpc.Code.UNIMPLEMENTED`. | 1175 /// `google.rpc.Code.UNIMPLEMENTED`. |
1185 * | 1176 /// |
1186 * Request parameters: | 1177 /// Request parameters: |
1187 * | 1178 /// |
1188 * [name] - The name of the operation resource to be deleted. | 1179 /// [name] - The name of the operation resource to be deleted. |
1189 * Value must have pattern | 1180 /// Value must have pattern |
1190 * "^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+$". | 1181 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+$". |
1191 * | 1182 /// |
1192 * Completes with a [Empty]. | 1183 /// Completes with a [Empty]. |
1193 * | 1184 /// |
1194 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1185 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1195 * error. | 1186 /// an error. |
1196 * | 1187 /// |
1197 * If the used [http.Client] completes with an error when making a REST call, | 1188 /// If the used [http.Client] completes with an error when making a REST |
1198 * this method will complete with the same error. | 1189 /// call, this method will complete with the same error. |
1199 */ | |
1200 async.Future<Empty> delete(core.String name) { | 1190 async.Future<Empty> delete(core.String name) { |
1201 var _url = null; | 1191 var _url = null; |
1202 var _queryParams = new core.Map(); | 1192 var _queryParams = new core.Map(); |
1203 var _uploadMedia = null; | 1193 var _uploadMedia = null; |
1204 var _uploadOptions = null; | 1194 var _uploadOptions = null; |
1205 var _downloadOptions = commons.DownloadOptions.Metadata; | 1195 var _downloadOptions = commons.DownloadOptions.Metadata; |
1206 var _body = null; | 1196 var _body = null; |
1207 | 1197 |
1208 if (name == null) { | 1198 if (name == null) { |
1209 throw new core.ArgumentError("Parameter name is required."); | 1199 throw new core.ArgumentError("Parameter name is required."); |
1210 } | 1200 } |
1211 | 1201 |
1212 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 1202 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
1213 | 1203 |
1214 var _response = _requester.request(_url, | 1204 var _response = _requester.request(_url, "DELETE", |
1215 "DELETE", | 1205 body: _body, |
1216 body: _body, | 1206 queryParams: _queryParams, |
1217 queryParams: _queryParams, | 1207 uploadOptions: _uploadOptions, |
1218 uploadOptions: _uploadOptions, | 1208 uploadMedia: _uploadMedia, |
1219 uploadMedia: _uploadMedia, | 1209 downloadOptions: _downloadOptions); |
1220 downloadOptions: _downloadOptions); | |
1221 return _response.then((data) => new Empty.fromJson(data)); | 1210 return _response.then((data) => new Empty.fromJson(data)); |
1222 } | 1211 } |
1223 | 1212 |
1224 /** | 1213 /// Gets the latest state of a long-running operation. Clients can use this |
1225 * Gets the latest state of a long-running operation. Clients can use this | 1214 /// method to poll the operation result at intervals as recommended by the |
1226 * method to poll the operation result at intervals as recommended by the API | 1215 /// API |
1227 * service. | 1216 /// service. |
1228 * | 1217 /// |
1229 * Request parameters: | 1218 /// Request parameters: |
1230 * | 1219 /// |
1231 * [name] - The name of the operation resource. | 1220 /// [name] - The name of the operation resource. |
1232 * Value must have pattern | 1221 /// Value must have pattern |
1233 * "^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+$". | 1222 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+$". |
1234 * | 1223 /// |
1235 * Completes with a [Operation]. | 1224 /// Completes with a [Operation]. |
1236 * | 1225 /// |
1237 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1226 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1238 * error. | 1227 /// an error. |
1239 * | 1228 /// |
1240 * If the used [http.Client] completes with an error when making a REST call, | 1229 /// If the used [http.Client] completes with an error when making a REST |
1241 * this method will complete with the same error. | 1230 /// call, this method will complete with the same error. |
1242 */ | |
1243 async.Future<Operation> get(core.String name) { | 1231 async.Future<Operation> get(core.String name) { |
1244 var _url = null; | 1232 var _url = null; |
1245 var _queryParams = new core.Map(); | 1233 var _queryParams = new core.Map(); |
1246 var _uploadMedia = null; | 1234 var _uploadMedia = null; |
1247 var _uploadOptions = null; | 1235 var _uploadOptions = null; |
1248 var _downloadOptions = commons.DownloadOptions.Metadata; | 1236 var _downloadOptions = commons.DownloadOptions.Metadata; |
1249 var _body = null; | 1237 var _body = null; |
1250 | 1238 |
1251 if (name == null) { | 1239 if (name == null) { |
1252 throw new core.ArgumentError("Parameter name is required."); | 1240 throw new core.ArgumentError("Parameter name is required."); |
1253 } | 1241 } |
1254 | 1242 |
1255 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 1243 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
1256 | 1244 |
1257 var _response = _requester.request(_url, | 1245 var _response = _requester.request(_url, "GET", |
1258 "GET", | 1246 body: _body, |
1259 body: _body, | 1247 queryParams: _queryParams, |
1260 queryParams: _queryParams, | 1248 uploadOptions: _uploadOptions, |
1261 uploadOptions: _uploadOptions, | 1249 uploadMedia: _uploadMedia, |
1262 uploadMedia: _uploadMedia, | 1250 downloadOptions: _downloadOptions); |
1263 downloadOptions: _downloadOptions); | |
1264 return _response.then((data) => new Operation.fromJson(data)); | 1251 return _response.then((data) => new Operation.fromJson(data)); |
1265 } | 1252 } |
1266 | 1253 |
1267 /** | 1254 /// Lists operations that match the specified filter in the request. If the |
1268 * Lists operations that match the specified filter in the request. If the | 1255 /// server doesn't support this method, it returns `UNIMPLEMENTED`. |
1269 * server doesn't support this method, it returns `UNIMPLEMENTED`. | 1256 /// |
1270 * | 1257 /// NOTE: the `name` binding allows API services to override the binding |
1271 * NOTE: the `name` binding allows API services to override the binding | 1258 /// to use different resource name schemes, such as `users / * /operations`. |
1272 * to use different resource name schemes, such as `users / * /operations`. To | 1259 /// To |
1273 * override the binding, API services can add a binding such as | 1260 /// override the binding, API services can add a binding such as |
1274 * `"/v1/{name=users / * }/operations"` to their service configuration. | 1261 /// `"/v1/{name=users / * }/operations"` to their service configuration. |
1275 * For backwards compatibility, the default name includes the operations | 1262 /// For backwards compatibility, the default name includes the operations |
1276 * collection id, however overriding users must ensure the name binding | 1263 /// collection id, however overriding users must ensure the name binding |
1277 * is the parent resource, without the operations collection id. | 1264 /// is the parent resource, without the operations collection id. |
1278 * | 1265 /// |
1279 * Request parameters: | 1266 /// Request parameters: |
1280 * | 1267 /// |
1281 * [name] - The name of the operation's parent resource. | 1268 /// [name] - The name of the operation's parent resource. |
1282 * Value must have pattern | 1269 /// Value must have pattern |
1283 * "^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations$". | 1270 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations$". |
1284 * | 1271 /// |
1285 * [pageToken] - The standard list page token. | 1272 /// [filter] - The standard list filter. |
1286 * | 1273 /// |
1287 * [pageSize] - The standard list page size. | 1274 /// [pageToken] - The standard list page token. |
1288 * | 1275 /// |
1289 * [filter] - The standard list filter. | 1276 /// [pageSize] - The standard list page size. |
1290 * | 1277 /// |
1291 * Completes with a [ListOperationsResponse]. | 1278 /// Completes with a [ListOperationsResponse]. |
1292 * | 1279 /// |
1293 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1280 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1294 * error. | 1281 /// an error. |
1295 * | 1282 /// |
1296 * If the used [http.Client] completes with an error when making a REST call, | 1283 /// If the used [http.Client] completes with an error when making a REST |
1297 * this method will complete with the same error. | 1284 /// call, this method will complete with the same error. |
1298 */ | 1285 async.Future<ListOperationsResponse> list(core.String name, |
1299 async.Future<ListOperationsResponse> list(core.String name, {core.String pageT
oken, core.int pageSize, core.String filter}) { | 1286 {core.String filter, core.String pageToken, core.int pageSize}) { |
1300 var _url = null; | 1287 var _url = null; |
1301 var _queryParams = new core.Map(); | 1288 var _queryParams = new core.Map(); |
1302 var _uploadMedia = null; | 1289 var _uploadMedia = null; |
1303 var _uploadOptions = null; | 1290 var _uploadOptions = null; |
1304 var _downloadOptions = commons.DownloadOptions.Metadata; | 1291 var _downloadOptions = commons.DownloadOptions.Metadata; |
1305 var _body = null; | 1292 var _body = null; |
1306 | 1293 |
1307 if (name == null) { | 1294 if (name == null) { |
1308 throw new core.ArgumentError("Parameter name is required."); | 1295 throw new core.ArgumentError("Parameter name is required."); |
1309 } | 1296 } |
| 1297 if (filter != null) { |
| 1298 _queryParams["filter"] = [filter]; |
| 1299 } |
1310 if (pageToken != null) { | 1300 if (pageToken != null) { |
1311 _queryParams["pageToken"] = [pageToken]; | 1301 _queryParams["pageToken"] = [pageToken]; |
1312 } | 1302 } |
1313 if (pageSize != null) { | 1303 if (pageSize != null) { |
1314 _queryParams["pageSize"] = ["${pageSize}"]; | 1304 _queryParams["pageSize"] = ["${pageSize}"]; |
1315 } | 1305 } |
1316 if (filter != null) { | |
1317 _queryParams["filter"] = [filter]; | |
1318 } | |
1319 | 1306 |
1320 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 1307 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
1321 | 1308 |
1322 var _response = _requester.request(_url, | 1309 var _response = _requester.request(_url, "GET", |
1323 "GET", | 1310 body: _body, |
1324 body: _body, | 1311 queryParams: _queryParams, |
1325 queryParams: _queryParams, | 1312 uploadOptions: _uploadOptions, |
1326 uploadOptions: _uploadOptions, | 1313 uploadMedia: _uploadMedia, |
1327 uploadMedia: _uploadMedia, | 1314 downloadOptions: _downloadOptions); |
1328 downloadOptions: _downloadOptions); | |
1329 return _response.then((data) => new ListOperationsResponse.fromJson(data)); | 1315 return _response.then((data) => new ListOperationsResponse.fromJson(data)); |
1330 } | 1316 } |
1331 | |
1332 } | 1317 } |
1333 | 1318 |
1334 | |
1335 class ProjectsInstancesDatabasesSessionsResourceApi { | 1319 class ProjectsInstancesDatabasesSessionsResourceApi { |
1336 final commons.ApiRequester _requester; | 1320 final commons.ApiRequester _requester; |
1337 | 1321 |
1338 ProjectsInstancesDatabasesSessionsResourceApi(commons.ApiRequester client) : | 1322 ProjectsInstancesDatabasesSessionsResourceApi(commons.ApiRequester client) |
1339 _requester = client; | 1323 : _requester = client; |
1340 | 1324 |
1341 /** | 1325 /// Begins a new transaction. This step can often be skipped: |
1342 * Begins a new transaction. This step can often be skipped: | 1326 /// Read, ExecuteSql and |
1343 * Read, ExecuteSql and | 1327 /// Commit can begin a new transaction as a |
1344 * Commit can begin a new transaction as a | 1328 /// side-effect. |
1345 * side-effect. | 1329 /// |
1346 * | 1330 /// [request] - The metadata request object. |
1347 * [request] - The metadata request object. | 1331 /// |
1348 * | 1332 /// Request parameters: |
1349 * Request parameters: | 1333 /// |
1350 * | 1334 /// [session] - Required. The session in which the transaction runs. |
1351 * [session] - Required. The session in which the transaction runs. | 1335 /// Value must have pattern |
1352 * Value must have pattern | 1336 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". |
1353 * "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". | 1337 /// |
1354 * | 1338 /// Completes with a [Transaction]. |
1355 * Completes with a [Transaction]. | 1339 /// |
1356 * | 1340 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1357 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1341 /// an error. |
1358 * error. | 1342 /// |
1359 * | 1343 /// If the used [http.Client] completes with an error when making a REST |
1360 * If the used [http.Client] completes with an error when making a REST call, | 1344 /// call, this method will complete with the same error. |
1361 * this method will complete with the same error. | 1345 async.Future<Transaction> beginTransaction( |
1362 */ | 1346 BeginTransactionRequest request, core.String session) { |
1363 async.Future<Transaction> beginTransaction(BeginTransactionRequest request, co
re.String session) { | |
1364 var _url = null; | 1347 var _url = null; |
1365 var _queryParams = new core.Map(); | 1348 var _queryParams = new core.Map(); |
1366 var _uploadMedia = null; | 1349 var _uploadMedia = null; |
1367 var _uploadOptions = null; | 1350 var _uploadOptions = null; |
1368 var _downloadOptions = commons.DownloadOptions.Metadata; | 1351 var _downloadOptions = commons.DownloadOptions.Metadata; |
1369 var _body = null; | 1352 var _body = null; |
1370 | 1353 |
1371 if (request != null) { | 1354 if (request != null) { |
1372 _body = convert.JSON.encode((request).toJson()); | 1355 _body = convert.JSON.encode((request).toJson()); |
1373 } | 1356 } |
1374 if (session == null) { | 1357 if (session == null) { |
1375 throw new core.ArgumentError("Parameter session is required."); | 1358 throw new core.ArgumentError("Parameter session is required."); |
1376 } | 1359 } |
1377 | 1360 |
1378 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$session') + ':beginTr
ansaction'; | 1361 _url = 'v1/' + |
| 1362 commons.Escaper.ecapeVariableReserved('$session') + |
| 1363 ':beginTransaction'; |
1379 | 1364 |
1380 var _response = _requester.request(_url, | 1365 var _response = _requester.request(_url, "POST", |
1381 "POST", | 1366 body: _body, |
1382 body: _body, | 1367 queryParams: _queryParams, |
1383 queryParams: _queryParams, | 1368 uploadOptions: _uploadOptions, |
1384 uploadOptions: _uploadOptions, | 1369 uploadMedia: _uploadMedia, |
1385 uploadMedia: _uploadMedia, | 1370 downloadOptions: _downloadOptions); |
1386 downloadOptions: _downloadOptions); | |
1387 return _response.then((data) => new Transaction.fromJson(data)); | 1371 return _response.then((data) => new Transaction.fromJson(data)); |
1388 } | 1372 } |
1389 | 1373 |
1390 /** | 1374 /// Commits a transaction. The request includes the mutations to be |
1391 * Commits a transaction. The request includes the mutations to be | 1375 /// applied to rows in the database. |
1392 * applied to rows in the database. | 1376 /// |
1393 * | 1377 /// `Commit` might return an `ABORTED` error. This can occur at any time; |
1394 * `Commit` might return an `ABORTED` error. This can occur at any time; | 1378 /// commonly, the cause is conflicts with concurrent |
1395 * commonly, the cause is conflicts with concurrent | 1379 /// transactions. However, it can also happen for a variety of other |
1396 * transactions. However, it can also happen for a variety of other | 1380 /// reasons. If `Commit` returns `ABORTED`, the caller should re-attempt |
1397 * reasons. If `Commit` returns `ABORTED`, the caller should re-attempt | 1381 /// the transaction from the beginning, re-using the same session. |
1398 * the transaction from the beginning, re-using the same session. | 1382 /// |
1399 * | 1383 /// [request] - The metadata request object. |
1400 * [request] - The metadata request object. | 1384 /// |
1401 * | 1385 /// Request parameters: |
1402 * Request parameters: | 1386 /// |
1403 * | 1387 /// [session] - Required. The session in which the transaction to be |
1404 * [session] - Required. The session in which the transaction to be committed | 1388 /// committed is running. |
1405 * is running. | 1389 /// Value must have pattern |
1406 * Value must have pattern | 1390 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". |
1407 * "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". | 1391 /// |
1408 * | 1392 /// Completes with a [CommitResponse]. |
1409 * Completes with a [CommitResponse]. | 1393 /// |
1410 * | 1394 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1411 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1395 /// an error. |
1412 * error. | 1396 /// |
1413 * | 1397 /// If the used [http.Client] completes with an error when making a REST |
1414 * If the used [http.Client] completes with an error when making a REST call, | 1398 /// call, this method will complete with the same error. |
1415 * this method will complete with the same error. | 1399 async.Future<CommitResponse> commit( |
1416 */ | 1400 CommitRequest request, core.String session) { |
1417 async.Future<CommitResponse> commit(CommitRequest request, core.String session
) { | |
1418 var _url = null; | 1401 var _url = null; |
1419 var _queryParams = new core.Map(); | 1402 var _queryParams = new core.Map(); |
1420 var _uploadMedia = null; | 1403 var _uploadMedia = null; |
1421 var _uploadOptions = null; | 1404 var _uploadOptions = null; |
1422 var _downloadOptions = commons.DownloadOptions.Metadata; | 1405 var _downloadOptions = commons.DownloadOptions.Metadata; |
1423 var _body = null; | 1406 var _body = null; |
1424 | 1407 |
1425 if (request != null) { | 1408 if (request != null) { |
1426 _body = convert.JSON.encode((request).toJson()); | 1409 _body = convert.JSON.encode((request).toJson()); |
1427 } | 1410 } |
1428 if (session == null) { | 1411 if (session == null) { |
1429 throw new core.ArgumentError("Parameter session is required."); | 1412 throw new core.ArgumentError("Parameter session is required."); |
1430 } | 1413 } |
1431 | 1414 |
1432 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$session') + ':commit'
; | 1415 _url = |
| 1416 'v1/' + commons.Escaper.ecapeVariableReserved('$session') + ':commit'; |
1433 | 1417 |
1434 var _response = _requester.request(_url, | 1418 var _response = _requester.request(_url, "POST", |
1435 "POST", | 1419 body: _body, |
1436 body: _body, | 1420 queryParams: _queryParams, |
1437 queryParams: _queryParams, | 1421 uploadOptions: _uploadOptions, |
1438 uploadOptions: _uploadOptions, | 1422 uploadMedia: _uploadMedia, |
1439 uploadMedia: _uploadMedia, | 1423 downloadOptions: _downloadOptions); |
1440 downloadOptions: _downloadOptions); | |
1441 return _response.then((data) => new CommitResponse.fromJson(data)); | 1424 return _response.then((data) => new CommitResponse.fromJson(data)); |
1442 } | 1425 } |
1443 | 1426 |
1444 /** | 1427 /// Creates a new session. A session can be used to perform |
1445 * Creates a new session. A session can be used to perform | 1428 /// transactions that read and/or modify data in a Cloud Spanner database. |
1446 * transactions that read and/or modify data in a Cloud Spanner database. | 1429 /// Sessions are meant to be reused for many consecutive |
1447 * Sessions are meant to be reused for many consecutive | 1430 /// transactions. |
1448 * transactions. | 1431 /// |
1449 * | 1432 /// Sessions can only execute one transaction at a time. To execute |
1450 * Sessions can only execute one transaction at a time. To execute | 1433 /// multiple concurrent read-write/write-only transactions, create |
1451 * multiple concurrent read-write/write-only transactions, create | 1434 /// multiple sessions. Note that standalone reads and queries use a |
1452 * multiple sessions. Note that standalone reads and queries use a | 1435 /// transaction internally, and count toward the one transaction |
1453 * transaction internally, and count toward the one transaction | 1436 /// limit. |
1454 * limit. | 1437 /// |
1455 * | 1438 /// Cloud Spanner limits the number of sessions that can exist at any given |
1456 * Cloud Spanner limits the number of sessions that can exist at any given | 1439 /// time; thus, it is a good idea to delete idle and/or unneeded sessions. |
1457 * time; thus, it is a good idea to delete idle and/or unneeded sessions. | 1440 /// Aside from explicit deletes, Cloud Spanner can delete sessions for which |
1458 * Aside from explicit deletes, Cloud Spanner can delete sessions for which no | 1441 /// no |
1459 * operations are sent for more than an hour. If a session is deleted, | 1442 /// operations are sent for more than an hour. If a session is deleted, |
1460 * requests to it return `NOT_FOUND`. | 1443 /// requests to it return `NOT_FOUND`. |
1461 * | 1444 /// |
1462 * Idle sessions can be kept alive by sending a trivial SQL query | 1445 /// Idle sessions can be kept alive by sending a trivial SQL query |
1463 * periodically, e.g., `"SELECT 1"`. | 1446 /// periodically, e.g., `"SELECT 1"`. |
1464 * | 1447 /// |
1465 * Request parameters: | 1448 /// Request parameters: |
1466 * | 1449 /// |
1467 * [database] - Required. The database in which the new session is created. | 1450 /// [database] - Required. The database in which the new session is created. |
1468 * Value must have pattern "^projects/[^/]+/instances/[^/]+/databases/[^/]+$". | 1451 /// Value must have pattern |
1469 * | 1452 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+$". |
1470 * Completes with a [Session]. | 1453 /// |
1471 * | 1454 /// Completes with a [Session]. |
1472 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1455 /// |
1473 * error. | 1456 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1474 * | 1457 /// an error. |
1475 * If the used [http.Client] completes with an error when making a REST call, | 1458 /// |
1476 * this method will complete with the same error. | 1459 /// If the used [http.Client] completes with an error when making a REST |
1477 */ | 1460 /// call, this method will complete with the same error. |
1478 async.Future<Session> create(core.String database) { | 1461 async.Future<Session> create(core.String database) { |
1479 var _url = null; | 1462 var _url = null; |
1480 var _queryParams = new core.Map(); | 1463 var _queryParams = new core.Map(); |
1481 var _uploadMedia = null; | 1464 var _uploadMedia = null; |
1482 var _uploadOptions = null; | 1465 var _uploadOptions = null; |
1483 var _downloadOptions = commons.DownloadOptions.Metadata; | 1466 var _downloadOptions = commons.DownloadOptions.Metadata; |
1484 var _body = null; | 1467 var _body = null; |
1485 | 1468 |
1486 if (database == null) { | 1469 if (database == null) { |
1487 throw new core.ArgumentError("Parameter database is required."); | 1470 throw new core.ArgumentError("Parameter database is required."); |
1488 } | 1471 } |
1489 | 1472 |
1490 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$database') + '/sessio
ns'; | 1473 _url = 'v1/' + |
| 1474 commons.Escaper.ecapeVariableReserved('$database') + |
| 1475 '/sessions'; |
1491 | 1476 |
1492 var _response = _requester.request(_url, | 1477 var _response = _requester.request(_url, "POST", |
1493 "POST", | 1478 body: _body, |
1494 body: _body, | 1479 queryParams: _queryParams, |
1495 queryParams: _queryParams, | 1480 uploadOptions: _uploadOptions, |
1496 uploadOptions: _uploadOptions, | 1481 uploadMedia: _uploadMedia, |
1497 uploadMedia: _uploadMedia, | 1482 downloadOptions: _downloadOptions); |
1498 downloadOptions: _downloadOptions); | |
1499 return _response.then((data) => new Session.fromJson(data)); | 1483 return _response.then((data) => new Session.fromJson(data)); |
1500 } | 1484 } |
1501 | 1485 |
1502 /** | 1486 /// Ends a session, releasing server resources associated with it. |
1503 * Ends a session, releasing server resources associated with it. | 1487 /// |
1504 * | 1488 /// Request parameters: |
1505 * Request parameters: | 1489 /// |
1506 * | 1490 /// [name] - Required. The name of the session to delete. |
1507 * [name] - Required. The name of the session to delete. | 1491 /// Value must have pattern |
1508 * Value must have pattern | 1492 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". |
1509 * "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". | 1493 /// |
1510 * | 1494 /// Completes with a [Empty]. |
1511 * Completes with a [Empty]. | 1495 /// |
1512 * | 1496 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1513 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1497 /// an error. |
1514 * error. | 1498 /// |
1515 * | 1499 /// If the used [http.Client] completes with an error when making a REST |
1516 * If the used [http.Client] completes with an error when making a REST call, | 1500 /// call, this method will complete with the same error. |
1517 * this method will complete with the same error. | |
1518 */ | |
1519 async.Future<Empty> delete(core.String name) { | 1501 async.Future<Empty> delete(core.String name) { |
1520 var _url = null; | 1502 var _url = null; |
1521 var _queryParams = new core.Map(); | 1503 var _queryParams = new core.Map(); |
1522 var _uploadMedia = null; | 1504 var _uploadMedia = null; |
1523 var _uploadOptions = null; | 1505 var _uploadOptions = null; |
1524 var _downloadOptions = commons.DownloadOptions.Metadata; | 1506 var _downloadOptions = commons.DownloadOptions.Metadata; |
1525 var _body = null; | 1507 var _body = null; |
1526 | 1508 |
1527 if (name == null) { | 1509 if (name == null) { |
1528 throw new core.ArgumentError("Parameter name is required."); | 1510 throw new core.ArgumentError("Parameter name is required."); |
1529 } | 1511 } |
1530 | 1512 |
1531 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 1513 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
1532 | 1514 |
1533 var _response = _requester.request(_url, | 1515 var _response = _requester.request(_url, "DELETE", |
1534 "DELETE", | 1516 body: _body, |
1535 body: _body, | 1517 queryParams: _queryParams, |
1536 queryParams: _queryParams, | 1518 uploadOptions: _uploadOptions, |
1537 uploadOptions: _uploadOptions, | 1519 uploadMedia: _uploadMedia, |
1538 uploadMedia: _uploadMedia, | 1520 downloadOptions: _downloadOptions); |
1539 downloadOptions: _downloadOptions); | |
1540 return _response.then((data) => new Empty.fromJson(data)); | 1521 return _response.then((data) => new Empty.fromJson(data)); |
1541 } | 1522 } |
1542 | 1523 |
1543 /** | 1524 /// Executes an SQL query, returning all rows in a single reply. This |
1544 * Executes an SQL query, returning all rows in a single reply. This | 1525 /// method cannot be used to return a result set larger than 10 MiB; |
1545 * method cannot be used to return a result set larger than 10 MiB; | 1526 /// if the query yields more data than that, the query fails with |
1546 * if the query yields more data than that, the query fails with | 1527 /// a `FAILED_PRECONDITION` error. |
1547 * a `FAILED_PRECONDITION` error. | 1528 /// |
1548 * | 1529 /// Queries inside read-write transactions might return `ABORTED`. If |
1549 * Queries inside read-write transactions might return `ABORTED`. If | 1530 /// this occurs, the application should restart the transaction from |
1550 * this occurs, the application should restart the transaction from | 1531 /// the beginning. See Transaction for more details. |
1551 * the beginning. See Transaction for more details. | 1532 /// |
1552 * | 1533 /// Larger result sets can be fetched in streaming fashion by calling |
1553 * Larger result sets can be fetched in streaming fashion by calling | 1534 /// ExecuteStreamingSql instead. |
1554 * ExecuteStreamingSql instead. | 1535 /// |
1555 * | 1536 /// [request] - The metadata request object. |
1556 * [request] - The metadata request object. | 1537 /// |
1557 * | 1538 /// Request parameters: |
1558 * Request parameters: | 1539 /// |
1559 * | 1540 /// [session] - Required. The session in which the SQL query should be |
1560 * [session] - Required. The session in which the SQL query should be | 1541 /// performed. |
1561 * performed. | 1542 /// Value must have pattern |
1562 * Value must have pattern | 1543 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". |
1563 * "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". | 1544 /// |
1564 * | 1545 /// Completes with a [ResultSet]. |
1565 * Completes with a [ResultSet]. | 1546 /// |
1566 * | 1547 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1567 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1548 /// an error. |
1568 * error. | 1549 /// |
1569 * | 1550 /// If the used [http.Client] completes with an error when making a REST |
1570 * If the used [http.Client] completes with an error when making a REST call, | 1551 /// call, this method will complete with the same error. |
1571 * this method will complete with the same error. | 1552 async.Future<ResultSet> executeSql( |
1572 */ | 1553 ExecuteSqlRequest request, core.String session) { |
1573 async.Future<ResultSet> executeSql(ExecuteSqlRequest request, core.String sess
ion) { | |
1574 var _url = null; | 1554 var _url = null; |
1575 var _queryParams = new core.Map(); | 1555 var _queryParams = new core.Map(); |
1576 var _uploadMedia = null; | 1556 var _uploadMedia = null; |
1577 var _uploadOptions = null; | 1557 var _uploadOptions = null; |
1578 var _downloadOptions = commons.DownloadOptions.Metadata; | 1558 var _downloadOptions = commons.DownloadOptions.Metadata; |
1579 var _body = null; | 1559 var _body = null; |
1580 | 1560 |
1581 if (request != null) { | 1561 if (request != null) { |
1582 _body = convert.JSON.encode((request).toJson()); | 1562 _body = convert.JSON.encode((request).toJson()); |
1583 } | 1563 } |
1584 if (session == null) { | 1564 if (session == null) { |
1585 throw new core.ArgumentError("Parameter session is required."); | 1565 throw new core.ArgumentError("Parameter session is required."); |
1586 } | 1566 } |
1587 | 1567 |
1588 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$session') + ':execute
Sql'; | 1568 _url = 'v1/' + |
| 1569 commons.Escaper.ecapeVariableReserved('$session') + |
| 1570 ':executeSql'; |
1589 | 1571 |
1590 var _response = _requester.request(_url, | 1572 var _response = _requester.request(_url, "POST", |
1591 "POST", | 1573 body: _body, |
1592 body: _body, | 1574 queryParams: _queryParams, |
1593 queryParams: _queryParams, | 1575 uploadOptions: _uploadOptions, |
1594 uploadOptions: _uploadOptions, | 1576 uploadMedia: _uploadMedia, |
1595 uploadMedia: _uploadMedia, | 1577 downloadOptions: _downloadOptions); |
1596 downloadOptions: _downloadOptions); | |
1597 return _response.then((data) => new ResultSet.fromJson(data)); | 1578 return _response.then((data) => new ResultSet.fromJson(data)); |
1598 } | 1579 } |
1599 | 1580 |
1600 /** | 1581 /// Like ExecuteSql, except returns the result |
1601 * Like ExecuteSql, except returns the result | 1582 /// set as a stream. Unlike ExecuteSql, there |
1602 * set as a stream. Unlike ExecuteSql, there | 1583 /// is no limit on the size of the returned result set. However, no |
1603 * is no limit on the size of the returned result set. However, no | 1584 /// individual row in the result set can exceed 100 MiB, and no |
1604 * individual row in the result set can exceed 100 MiB, and no | 1585 /// column value can exceed 10 MiB. |
1605 * column value can exceed 10 MiB. | 1586 /// |
1606 * | 1587 /// [request] - The metadata request object. |
1607 * [request] - The metadata request object. | 1588 /// |
1608 * | 1589 /// Request parameters: |
1609 * Request parameters: | 1590 /// |
1610 * | 1591 /// [session] - Required. The session in which the SQL query should be |
1611 * [session] - Required. The session in which the SQL query should be | 1592 /// performed. |
1612 * performed. | 1593 /// Value must have pattern |
1613 * Value must have pattern | 1594 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". |
1614 * "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". | 1595 /// |
1615 * | 1596 /// Completes with a [PartialResultSet]. |
1616 * Completes with a [PartialResultSet]. | 1597 /// |
1617 * | 1598 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1618 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1599 /// an error. |
1619 * error. | 1600 /// |
1620 * | 1601 /// If the used [http.Client] completes with an error when making a REST |
1621 * If the used [http.Client] completes with an error when making a REST call, | 1602 /// call, this method will complete with the same error. |
1622 * this method will complete with the same error. | 1603 async.Future<PartialResultSet> executeStreamingSql( |
1623 */ | 1604 ExecuteSqlRequest request, core.String session) { |
1624 async.Future<PartialResultSet> executeStreamingSql(ExecuteSqlRequest request,
core.String session) { | |
1625 var _url = null; | 1605 var _url = null; |
1626 var _queryParams = new core.Map(); | 1606 var _queryParams = new core.Map(); |
1627 var _uploadMedia = null; | 1607 var _uploadMedia = null; |
1628 var _uploadOptions = null; | 1608 var _uploadOptions = null; |
1629 var _downloadOptions = commons.DownloadOptions.Metadata; | 1609 var _downloadOptions = commons.DownloadOptions.Metadata; |
1630 var _body = null; | 1610 var _body = null; |
1631 | 1611 |
1632 if (request != null) { | 1612 if (request != null) { |
1633 _body = convert.JSON.encode((request).toJson()); | 1613 _body = convert.JSON.encode((request).toJson()); |
1634 } | 1614 } |
1635 if (session == null) { | 1615 if (session == null) { |
1636 throw new core.ArgumentError("Parameter session is required."); | 1616 throw new core.ArgumentError("Parameter session is required."); |
1637 } | 1617 } |
1638 | 1618 |
1639 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$session') + ':execute
StreamingSql'; | 1619 _url = 'v1/' + |
| 1620 commons.Escaper.ecapeVariableReserved('$session') + |
| 1621 ':executeStreamingSql'; |
1640 | 1622 |
1641 var _response = _requester.request(_url, | 1623 var _response = _requester.request(_url, "POST", |
1642 "POST", | 1624 body: _body, |
1643 body: _body, | 1625 queryParams: _queryParams, |
1644 queryParams: _queryParams, | 1626 uploadOptions: _uploadOptions, |
1645 uploadOptions: _uploadOptions, | 1627 uploadMedia: _uploadMedia, |
1646 uploadMedia: _uploadMedia, | 1628 downloadOptions: _downloadOptions); |
1647 downloadOptions: _downloadOptions); | |
1648 return _response.then((data) => new PartialResultSet.fromJson(data)); | 1629 return _response.then((data) => new PartialResultSet.fromJson(data)); |
1649 } | 1630 } |
1650 | 1631 |
1651 /** | 1632 /// Gets a session. Returns `NOT_FOUND` if the session does not exist. |
1652 * Gets a session. Returns `NOT_FOUND` if the session does not exist. | 1633 /// This is mainly useful for determining whether a session is still |
1653 * This is mainly useful for determining whether a session is still | 1634 /// alive. |
1654 * alive. | 1635 /// |
1655 * | 1636 /// Request parameters: |
1656 * Request parameters: | 1637 /// |
1657 * | 1638 /// [name] - Required. The name of the session to retrieve. |
1658 * [name] - Required. The name of the session to retrieve. | 1639 /// Value must have pattern |
1659 * Value must have pattern | 1640 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". |
1660 * "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". | 1641 /// |
1661 * | 1642 /// Completes with a [Session]. |
1662 * Completes with a [Session]. | 1643 /// |
1663 * | 1644 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1664 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1645 /// an error. |
1665 * error. | 1646 /// |
1666 * | 1647 /// If the used [http.Client] completes with an error when making a REST |
1667 * If the used [http.Client] completes with an error when making a REST call, | 1648 /// call, this method will complete with the same error. |
1668 * this method will complete with the same error. | |
1669 */ | |
1670 async.Future<Session> get(core.String name) { | 1649 async.Future<Session> get(core.String name) { |
1671 var _url = null; | 1650 var _url = null; |
1672 var _queryParams = new core.Map(); | 1651 var _queryParams = new core.Map(); |
1673 var _uploadMedia = null; | 1652 var _uploadMedia = null; |
1674 var _uploadOptions = null; | 1653 var _uploadOptions = null; |
1675 var _downloadOptions = commons.DownloadOptions.Metadata; | 1654 var _downloadOptions = commons.DownloadOptions.Metadata; |
1676 var _body = null; | 1655 var _body = null; |
1677 | 1656 |
1678 if (name == null) { | 1657 if (name == null) { |
1679 throw new core.ArgumentError("Parameter name is required."); | 1658 throw new core.ArgumentError("Parameter name is required."); |
1680 } | 1659 } |
1681 | 1660 |
1682 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 1661 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
1683 | 1662 |
1684 var _response = _requester.request(_url, | 1663 var _response = _requester.request(_url, "GET", |
1685 "GET", | 1664 body: _body, |
1686 body: _body, | 1665 queryParams: _queryParams, |
1687 queryParams: _queryParams, | 1666 uploadOptions: _uploadOptions, |
1688 uploadOptions: _uploadOptions, | 1667 uploadMedia: _uploadMedia, |
1689 uploadMedia: _uploadMedia, | 1668 downloadOptions: _downloadOptions); |
1690 downloadOptions: _downloadOptions); | |
1691 return _response.then((data) => new Session.fromJson(data)); | 1669 return _response.then((data) => new Session.fromJson(data)); |
1692 } | 1670 } |
1693 | 1671 |
1694 /** | 1672 /// Reads rows from the database using key lookups and scans, as a |
1695 * Reads rows from the database using key lookups and scans, as a | 1673 /// simple key/value style alternative to |
1696 * simple key/value style alternative to | 1674 /// ExecuteSql. This method cannot be used to |
1697 * ExecuteSql. This method cannot be used to | 1675 /// return a result set larger than 10 MiB; if the read matches more |
1698 * return a result set larger than 10 MiB; if the read matches more | 1676 /// data than that, the read fails with a `FAILED_PRECONDITION` |
1699 * data than that, the read fails with a `FAILED_PRECONDITION` | 1677 /// error. |
1700 * error. | 1678 /// |
1701 * | 1679 /// Reads inside read-write transactions might return `ABORTED`. If |
1702 * Reads inside read-write transactions might return `ABORTED`. If | 1680 /// this occurs, the application should restart the transaction from |
1703 * this occurs, the application should restart the transaction from | 1681 /// the beginning. See Transaction for more details. |
1704 * the beginning. See Transaction for more details. | 1682 /// |
1705 * | 1683 /// Larger result sets can be yielded in streaming fashion by calling |
1706 * Larger result sets can be yielded in streaming fashion by calling | 1684 /// StreamingRead instead. |
1707 * StreamingRead instead. | 1685 /// |
1708 * | 1686 /// [request] - The metadata request object. |
1709 * [request] - The metadata request object. | 1687 /// |
1710 * | 1688 /// Request parameters: |
1711 * Request parameters: | 1689 /// |
1712 * | 1690 /// [session] - Required. The session in which the read should be performed. |
1713 * [session] - Required. The session in which the read should be performed. | 1691 /// Value must have pattern |
1714 * Value must have pattern | 1692 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". |
1715 * "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". | 1693 /// |
1716 * | 1694 /// Completes with a [ResultSet]. |
1717 * Completes with a [ResultSet]. | 1695 /// |
1718 * | 1696 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1719 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1697 /// an error. |
1720 * error. | 1698 /// |
1721 * | 1699 /// If the used [http.Client] completes with an error when making a REST |
1722 * If the used [http.Client] completes with an error when making a REST call, | 1700 /// call, this method will complete with the same error. |
1723 * this method will complete with the same error. | |
1724 */ | |
1725 async.Future<ResultSet> read(ReadRequest request, core.String session) { | 1701 async.Future<ResultSet> read(ReadRequest request, core.String session) { |
1726 var _url = null; | 1702 var _url = null; |
1727 var _queryParams = new core.Map(); | 1703 var _queryParams = new core.Map(); |
1728 var _uploadMedia = null; | 1704 var _uploadMedia = null; |
1729 var _uploadOptions = null; | 1705 var _uploadOptions = null; |
1730 var _downloadOptions = commons.DownloadOptions.Metadata; | 1706 var _downloadOptions = commons.DownloadOptions.Metadata; |
1731 var _body = null; | 1707 var _body = null; |
1732 | 1708 |
1733 if (request != null) { | 1709 if (request != null) { |
1734 _body = convert.JSON.encode((request).toJson()); | 1710 _body = convert.JSON.encode((request).toJson()); |
1735 } | 1711 } |
1736 if (session == null) { | 1712 if (session == null) { |
1737 throw new core.ArgumentError("Parameter session is required."); | 1713 throw new core.ArgumentError("Parameter session is required."); |
1738 } | 1714 } |
1739 | 1715 |
1740 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$session') + ':read'; | 1716 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$session') + ':read'; |
1741 | 1717 |
1742 var _response = _requester.request(_url, | 1718 var _response = _requester.request(_url, "POST", |
1743 "POST", | 1719 body: _body, |
1744 body: _body, | 1720 queryParams: _queryParams, |
1745 queryParams: _queryParams, | 1721 uploadOptions: _uploadOptions, |
1746 uploadOptions: _uploadOptions, | 1722 uploadMedia: _uploadMedia, |
1747 uploadMedia: _uploadMedia, | 1723 downloadOptions: _downloadOptions); |
1748 downloadOptions: _downloadOptions); | |
1749 return _response.then((data) => new ResultSet.fromJson(data)); | 1724 return _response.then((data) => new ResultSet.fromJson(data)); |
1750 } | 1725 } |
1751 | 1726 |
1752 /** | 1727 /// Rolls back a transaction, releasing any locks it holds. It is a good |
1753 * Rolls back a transaction, releasing any locks it holds. It is a good | 1728 /// idea to call this for any transaction that includes one or more |
1754 * idea to call this for any transaction that includes one or more | 1729 /// Read or ExecuteSql requests and |
1755 * Read or ExecuteSql requests and | 1730 /// ultimately decides not to commit. |
1756 * ultimately decides not to commit. | 1731 /// |
1757 * | 1732 /// `Rollback` returns `OK` if it successfully aborts the transaction, the |
1758 * `Rollback` returns `OK` if it successfully aborts the transaction, the | 1733 /// transaction was already aborted, or the transaction is not |
1759 * transaction was already aborted, or the transaction is not | 1734 /// found. `Rollback` never returns `ABORTED`. |
1760 * found. `Rollback` never returns `ABORTED`. | 1735 /// |
1761 * | 1736 /// [request] - The metadata request object. |
1762 * [request] - The metadata request object. | 1737 /// |
1763 * | 1738 /// Request parameters: |
1764 * Request parameters: | 1739 /// |
1765 * | 1740 /// [session] - Required. The session in which the transaction to roll back |
1766 * [session] - Required. The session in which the transaction to roll back is | 1741 /// is running. |
1767 * running. | 1742 /// Value must have pattern |
1768 * Value must have pattern | 1743 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". |
1769 * "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". | 1744 /// |
1770 * | 1745 /// Completes with a [Empty]. |
1771 * Completes with a [Empty]. | 1746 /// |
1772 * | 1747 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1773 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1748 /// an error. |
1774 * error. | 1749 /// |
1775 * | 1750 /// If the used [http.Client] completes with an error when making a REST |
1776 * If the used [http.Client] completes with an error when making a REST call, | 1751 /// call, this method will complete with the same error. |
1777 * this method will complete with the same error. | |
1778 */ | |
1779 async.Future<Empty> rollback(RollbackRequest request, core.String session) { | 1752 async.Future<Empty> rollback(RollbackRequest request, core.String session) { |
1780 var _url = null; | 1753 var _url = null; |
1781 var _queryParams = new core.Map(); | 1754 var _queryParams = new core.Map(); |
1782 var _uploadMedia = null; | 1755 var _uploadMedia = null; |
1783 var _uploadOptions = null; | 1756 var _uploadOptions = null; |
1784 var _downloadOptions = commons.DownloadOptions.Metadata; | 1757 var _downloadOptions = commons.DownloadOptions.Metadata; |
1785 var _body = null; | 1758 var _body = null; |
1786 | 1759 |
1787 if (request != null) { | 1760 if (request != null) { |
1788 _body = convert.JSON.encode((request).toJson()); | 1761 _body = convert.JSON.encode((request).toJson()); |
1789 } | 1762 } |
1790 if (session == null) { | 1763 if (session == null) { |
1791 throw new core.ArgumentError("Parameter session is required."); | 1764 throw new core.ArgumentError("Parameter session is required."); |
1792 } | 1765 } |
1793 | 1766 |
1794 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$session') + ':rollbac
k'; | 1767 _url = |
| 1768 'v1/' + commons.Escaper.ecapeVariableReserved('$session') + ':rollback'; |
1795 | 1769 |
1796 var _response = _requester.request(_url, | 1770 var _response = _requester.request(_url, "POST", |
1797 "POST", | 1771 body: _body, |
1798 body: _body, | 1772 queryParams: _queryParams, |
1799 queryParams: _queryParams, | 1773 uploadOptions: _uploadOptions, |
1800 uploadOptions: _uploadOptions, | 1774 uploadMedia: _uploadMedia, |
1801 uploadMedia: _uploadMedia, | 1775 downloadOptions: _downloadOptions); |
1802 downloadOptions: _downloadOptions); | |
1803 return _response.then((data) => new Empty.fromJson(data)); | 1776 return _response.then((data) => new Empty.fromJson(data)); |
1804 } | 1777 } |
1805 | 1778 |
1806 /** | 1779 /// Like Read, except returns the result set as a |
1807 * Like Read, except returns the result set as a | 1780 /// stream. Unlike Read, there is no limit on the |
1808 * stream. Unlike Read, there is no limit on the | 1781 /// size of the returned result set. However, no individual row in |
1809 * size of the returned result set. However, no individual row in | 1782 /// the result set can exceed 100 MiB, and no column value can exceed |
1810 * the result set can exceed 100 MiB, and no column value can exceed | 1783 /// 10 MiB. |
1811 * 10 MiB. | 1784 /// |
1812 * | 1785 /// [request] - The metadata request object. |
1813 * [request] - The metadata request object. | 1786 /// |
1814 * | 1787 /// Request parameters: |
1815 * Request parameters: | 1788 /// |
1816 * | 1789 /// [session] - Required. The session in which the read should be performed. |
1817 * [session] - Required. The session in which the read should be performed. | 1790 /// Value must have pattern |
1818 * Value must have pattern | 1791 /// "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". |
1819 * "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$". | 1792 /// |
1820 * | 1793 /// Completes with a [PartialResultSet]. |
1821 * Completes with a [PartialResultSet]. | 1794 /// |
1822 * | 1795 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1823 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1796 /// an error. |
1824 * error. | 1797 /// |
1825 * | 1798 /// If the used [http.Client] completes with an error when making a REST |
1826 * If the used [http.Client] completes with an error when making a REST call, | 1799 /// call, this method will complete with the same error. |
1827 * this method will complete with the same error. | 1800 async.Future<PartialResultSet> streamingRead( |
1828 */ | 1801 ReadRequest request, core.String session) { |
1829 async.Future<PartialResultSet> streamingRead(ReadRequest request, core.String
session) { | |
1830 var _url = null; | 1802 var _url = null; |
1831 var _queryParams = new core.Map(); | 1803 var _queryParams = new core.Map(); |
1832 var _uploadMedia = null; | 1804 var _uploadMedia = null; |
1833 var _uploadOptions = null; | 1805 var _uploadOptions = null; |
1834 var _downloadOptions = commons.DownloadOptions.Metadata; | 1806 var _downloadOptions = commons.DownloadOptions.Metadata; |
1835 var _body = null; | 1807 var _body = null; |
1836 | 1808 |
1837 if (request != null) { | 1809 if (request != null) { |
1838 _body = convert.JSON.encode((request).toJson()); | 1810 _body = convert.JSON.encode((request).toJson()); |
1839 } | 1811 } |
1840 if (session == null) { | 1812 if (session == null) { |
1841 throw new core.ArgumentError("Parameter session is required."); | 1813 throw new core.ArgumentError("Parameter session is required."); |
1842 } | 1814 } |
1843 | 1815 |
1844 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$session') + ':streami
ngRead'; | 1816 _url = 'v1/' + |
| 1817 commons.Escaper.ecapeVariableReserved('$session') + |
| 1818 ':streamingRead'; |
1845 | 1819 |
1846 var _response = _requester.request(_url, | 1820 var _response = _requester.request(_url, "POST", |
1847 "POST", | 1821 body: _body, |
1848 body: _body, | 1822 queryParams: _queryParams, |
1849 queryParams: _queryParams, | 1823 uploadOptions: _uploadOptions, |
1850 uploadOptions: _uploadOptions, | 1824 uploadMedia: _uploadMedia, |
1851 uploadMedia: _uploadMedia, | 1825 downloadOptions: _downloadOptions); |
1852 downloadOptions: _downloadOptions); | |
1853 return _response.then((data) => new PartialResultSet.fromJson(data)); | 1826 return _response.then((data) => new PartialResultSet.fromJson(data)); |
1854 } | 1827 } |
1855 | |
1856 } | 1828 } |
1857 | 1829 |
1858 | |
1859 class ProjectsInstancesOperationsResourceApi { | 1830 class ProjectsInstancesOperationsResourceApi { |
1860 final commons.ApiRequester _requester; | 1831 final commons.ApiRequester _requester; |
1861 | 1832 |
1862 ProjectsInstancesOperationsResourceApi(commons.ApiRequester client) : | 1833 ProjectsInstancesOperationsResourceApi(commons.ApiRequester client) |
1863 _requester = client; | 1834 : _requester = client; |
1864 | 1835 |
1865 /** | 1836 /// Starts asynchronous cancellation on a long-running operation. The server |
1866 * Starts asynchronous cancellation on a long-running operation. The server | 1837 /// makes a best effort to cancel the operation, but success is not |
1867 * makes a best effort to cancel the operation, but success is not | 1838 /// guaranteed. If the server doesn't support this method, it returns |
1868 * guaranteed. If the server doesn't support this method, it returns | 1839 /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use |
1869 * `google.rpc.Code.UNIMPLEMENTED`. Clients can use | 1840 /// Operations.GetOperation or |
1870 * Operations.GetOperation or | 1841 /// other methods to check whether the cancellation succeeded or whether the |
1871 * other methods to check whether the cancellation succeeded or whether the | 1842 /// operation completed despite cancellation. On successful cancellation, |
1872 * operation completed despite cancellation. On successful cancellation, | 1843 /// the operation is not deleted; instead, it becomes an operation with |
1873 * the operation is not deleted; instead, it becomes an operation with | 1844 /// an Operation.error value with a google.rpc.Status.code of 1, |
1874 * an Operation.error value with a google.rpc.Status.code of 1, | 1845 /// corresponding to `Code.CANCELLED`. |
1875 * corresponding to `Code.CANCELLED`. | 1846 /// |
1876 * | 1847 /// Request parameters: |
1877 * Request parameters: | 1848 /// |
1878 * | 1849 /// [name] - The name of the operation resource to be cancelled. |
1879 * [name] - The name of the operation resource to be cancelled. | 1850 /// Value must have pattern |
1880 * Value must have pattern | 1851 /// "^projects/[^/]+/instances/[^/]+/operations/[^/]+$". |
1881 * "^projects/[^/]+/instances/[^/]+/operations/[^/]+$". | 1852 /// |
1882 * | 1853 /// Completes with a [Empty]. |
1883 * Completes with a [Empty]. | 1854 /// |
1884 * | 1855 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1885 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1856 /// an error. |
1886 * error. | 1857 /// |
1887 * | 1858 /// If the used [http.Client] completes with an error when making a REST |
1888 * If the used [http.Client] completes with an error when making a REST call, | 1859 /// call, this method will complete with the same error. |
1889 * this method will complete with the same error. | |
1890 */ | |
1891 async.Future<Empty> cancel(core.String name) { | 1860 async.Future<Empty> cancel(core.String name) { |
1892 var _url = null; | 1861 var _url = null; |
1893 var _queryParams = new core.Map(); | 1862 var _queryParams = new core.Map(); |
1894 var _uploadMedia = null; | 1863 var _uploadMedia = null; |
1895 var _uploadOptions = null; | 1864 var _uploadOptions = null; |
1896 var _downloadOptions = commons.DownloadOptions.Metadata; | 1865 var _downloadOptions = commons.DownloadOptions.Metadata; |
1897 var _body = null; | 1866 var _body = null; |
1898 | 1867 |
1899 if (name == null) { | 1868 if (name == null) { |
1900 throw new core.ArgumentError("Parameter name is required."); | 1869 throw new core.ArgumentError("Parameter name is required."); |
1901 } | 1870 } |
1902 | 1871 |
1903 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name') + ':cancel'; | 1872 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name') + ':cancel'; |
1904 | 1873 |
1905 var _response = _requester.request(_url, | 1874 var _response = _requester.request(_url, "POST", |
1906 "POST", | 1875 body: _body, |
1907 body: _body, | 1876 queryParams: _queryParams, |
1908 queryParams: _queryParams, | 1877 uploadOptions: _uploadOptions, |
1909 uploadOptions: _uploadOptions, | 1878 uploadMedia: _uploadMedia, |
1910 uploadMedia: _uploadMedia, | 1879 downloadOptions: _downloadOptions); |
1911 downloadOptions: _downloadOptions); | |
1912 return _response.then((data) => new Empty.fromJson(data)); | 1880 return _response.then((data) => new Empty.fromJson(data)); |
1913 } | 1881 } |
1914 | 1882 |
1915 /** | 1883 /// Deletes a long-running operation. This method indicates that the client |
1916 * Deletes a long-running operation. This method indicates that the client is | 1884 /// is |
1917 * no longer interested in the operation result. It does not cancel the | 1885 /// no longer interested in the operation result. It does not cancel the |
1918 * operation. If the server doesn't support this method, it returns | 1886 /// operation. If the server doesn't support this method, it returns |
1919 * `google.rpc.Code.UNIMPLEMENTED`. | 1887 /// `google.rpc.Code.UNIMPLEMENTED`. |
1920 * | 1888 /// |
1921 * Request parameters: | 1889 /// Request parameters: |
1922 * | 1890 /// |
1923 * [name] - The name of the operation resource to be deleted. | 1891 /// [name] - The name of the operation resource to be deleted. |
1924 * Value must have pattern | 1892 /// Value must have pattern |
1925 * "^projects/[^/]+/instances/[^/]+/operations/[^/]+$". | 1893 /// "^projects/[^/]+/instances/[^/]+/operations/[^/]+$". |
1926 * | 1894 /// |
1927 * Completes with a [Empty]. | 1895 /// Completes with a [Empty]. |
1928 * | 1896 /// |
1929 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1897 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1930 * error. | 1898 /// an error. |
1931 * | 1899 /// |
1932 * If the used [http.Client] completes with an error when making a REST call, | 1900 /// If the used [http.Client] completes with an error when making a REST |
1933 * this method will complete with the same error. | 1901 /// call, this method will complete with the same error. |
1934 */ | |
1935 async.Future<Empty> delete(core.String name) { | 1902 async.Future<Empty> delete(core.String name) { |
1936 var _url = null; | 1903 var _url = null; |
1937 var _queryParams = new core.Map(); | 1904 var _queryParams = new core.Map(); |
1938 var _uploadMedia = null; | 1905 var _uploadMedia = null; |
1939 var _uploadOptions = null; | 1906 var _uploadOptions = null; |
1940 var _downloadOptions = commons.DownloadOptions.Metadata; | 1907 var _downloadOptions = commons.DownloadOptions.Metadata; |
1941 var _body = null; | 1908 var _body = null; |
1942 | 1909 |
1943 if (name == null) { | 1910 if (name == null) { |
1944 throw new core.ArgumentError("Parameter name is required."); | 1911 throw new core.ArgumentError("Parameter name is required."); |
1945 } | 1912 } |
1946 | 1913 |
1947 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 1914 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
1948 | 1915 |
1949 var _response = _requester.request(_url, | 1916 var _response = _requester.request(_url, "DELETE", |
1950 "DELETE", | 1917 body: _body, |
1951 body: _body, | 1918 queryParams: _queryParams, |
1952 queryParams: _queryParams, | 1919 uploadOptions: _uploadOptions, |
1953 uploadOptions: _uploadOptions, | 1920 uploadMedia: _uploadMedia, |
1954 uploadMedia: _uploadMedia, | 1921 downloadOptions: _downloadOptions); |
1955 downloadOptions: _downloadOptions); | |
1956 return _response.then((data) => new Empty.fromJson(data)); | 1922 return _response.then((data) => new Empty.fromJson(data)); |
1957 } | 1923 } |
1958 | 1924 |
1959 /** | 1925 /// Gets the latest state of a long-running operation. Clients can use this |
1960 * Gets the latest state of a long-running operation. Clients can use this | 1926 /// method to poll the operation result at intervals as recommended by the |
1961 * method to poll the operation result at intervals as recommended by the API | 1927 /// API |
1962 * service. | 1928 /// service. |
1963 * | 1929 /// |
1964 * Request parameters: | 1930 /// Request parameters: |
1965 * | 1931 /// |
1966 * [name] - The name of the operation resource. | 1932 /// [name] - The name of the operation resource. |
1967 * Value must have pattern | 1933 /// Value must have pattern |
1968 * "^projects/[^/]+/instances/[^/]+/operations/[^/]+$". | 1934 /// "^projects/[^/]+/instances/[^/]+/operations/[^/]+$". |
1969 * | 1935 /// |
1970 * Completes with a [Operation]. | 1936 /// Completes with a [Operation]. |
1971 * | 1937 /// |
1972 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1938 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1973 * error. | 1939 /// an error. |
1974 * | 1940 /// |
1975 * If the used [http.Client] completes with an error when making a REST call, | 1941 /// If the used [http.Client] completes with an error when making a REST |
1976 * this method will complete with the same error. | 1942 /// call, this method will complete with the same error. |
1977 */ | |
1978 async.Future<Operation> get(core.String name) { | 1943 async.Future<Operation> get(core.String name) { |
1979 var _url = null; | 1944 var _url = null; |
1980 var _queryParams = new core.Map(); | 1945 var _queryParams = new core.Map(); |
1981 var _uploadMedia = null; | 1946 var _uploadMedia = null; |
1982 var _uploadOptions = null; | 1947 var _uploadOptions = null; |
1983 var _downloadOptions = commons.DownloadOptions.Metadata; | 1948 var _downloadOptions = commons.DownloadOptions.Metadata; |
1984 var _body = null; | 1949 var _body = null; |
1985 | 1950 |
1986 if (name == null) { | 1951 if (name == null) { |
1987 throw new core.ArgumentError("Parameter name is required."); | 1952 throw new core.ArgumentError("Parameter name is required."); |
1988 } | 1953 } |
1989 | 1954 |
1990 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 1955 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
1991 | 1956 |
1992 var _response = _requester.request(_url, | 1957 var _response = _requester.request(_url, "GET", |
1993 "GET", | 1958 body: _body, |
1994 body: _body, | 1959 queryParams: _queryParams, |
1995 queryParams: _queryParams, | 1960 uploadOptions: _uploadOptions, |
1996 uploadOptions: _uploadOptions, | 1961 uploadMedia: _uploadMedia, |
1997 uploadMedia: _uploadMedia, | 1962 downloadOptions: _downloadOptions); |
1998 downloadOptions: _downloadOptions); | |
1999 return _response.then((data) => new Operation.fromJson(data)); | 1963 return _response.then((data) => new Operation.fromJson(data)); |
2000 } | 1964 } |
2001 | 1965 |
2002 /** | 1966 /// Lists operations that match the specified filter in the request. If the |
2003 * Lists operations that match the specified filter in the request. If the | 1967 /// server doesn't support this method, it returns `UNIMPLEMENTED`. |
2004 * server doesn't support this method, it returns `UNIMPLEMENTED`. | 1968 /// |
2005 * | 1969 /// NOTE: the `name` binding allows API services to override the binding |
2006 * NOTE: the `name` binding allows API services to override the binding | 1970 /// to use different resource name schemes, such as `users / * /operations`. |
2007 * to use different resource name schemes, such as `users / * /operations`. To | 1971 /// To |
2008 * override the binding, API services can add a binding such as | 1972 /// override the binding, API services can add a binding such as |
2009 * `"/v1/{name=users / * }/operations"` to their service configuration. | 1973 /// `"/v1/{name=users / * }/operations"` to their service configuration. |
2010 * For backwards compatibility, the default name includes the operations | 1974 /// For backwards compatibility, the default name includes the operations |
2011 * collection id, however overriding users must ensure the name binding | 1975 /// collection id, however overriding users must ensure the name binding |
2012 * is the parent resource, without the operations collection id. | 1976 /// is the parent resource, without the operations collection id. |
2013 * | 1977 /// |
2014 * Request parameters: | 1978 /// Request parameters: |
2015 * | 1979 /// |
2016 * [name] - The name of the operation's parent resource. | 1980 /// [name] - The name of the operation's parent resource. |
2017 * Value must have pattern "^projects/[^/]+/instances/[^/]+/operations$". | 1981 /// Value must have pattern "^projects/[^/]+/instances/[^/]+/operations$". |
2018 * | 1982 /// |
2019 * [filter] - The standard list filter. | 1983 /// [filter] - The standard list filter. |
2020 * | 1984 /// |
2021 * [pageToken] - The standard list page token. | 1985 /// [pageToken] - The standard list page token. |
2022 * | 1986 /// |
2023 * [pageSize] - The standard list page size. | 1987 /// [pageSize] - The standard list page size. |
2024 * | 1988 /// |
2025 * Completes with a [ListOperationsResponse]. | 1989 /// Completes with a [ListOperationsResponse]. |
2026 * | 1990 /// |
2027 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1991 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
2028 * error. | 1992 /// an error. |
2029 * | 1993 /// |
2030 * If the used [http.Client] completes with an error when making a REST call, | 1994 /// If the used [http.Client] completes with an error when making a REST |
2031 * this method will complete with the same error. | 1995 /// call, this method will complete with the same error. |
2032 */ | 1996 async.Future<ListOperationsResponse> list(core.String name, |
2033 async.Future<ListOperationsResponse> list(core.String name, {core.String filte
r, core.String pageToken, core.int pageSize}) { | 1997 {core.String filter, core.String pageToken, core.int pageSize}) { |
2034 var _url = null; | 1998 var _url = null; |
2035 var _queryParams = new core.Map(); | 1999 var _queryParams = new core.Map(); |
2036 var _uploadMedia = null; | 2000 var _uploadMedia = null; |
2037 var _uploadOptions = null; | 2001 var _uploadOptions = null; |
2038 var _downloadOptions = commons.DownloadOptions.Metadata; | 2002 var _downloadOptions = commons.DownloadOptions.Metadata; |
2039 var _body = null; | 2003 var _body = null; |
2040 | 2004 |
2041 if (name == null) { | 2005 if (name == null) { |
2042 throw new core.ArgumentError("Parameter name is required."); | 2006 throw new core.ArgumentError("Parameter name is required."); |
2043 } | 2007 } |
2044 if (filter != null) { | 2008 if (filter != null) { |
2045 _queryParams["filter"] = [filter]; | 2009 _queryParams["filter"] = [filter]; |
2046 } | 2010 } |
2047 if (pageToken != null) { | 2011 if (pageToken != null) { |
2048 _queryParams["pageToken"] = [pageToken]; | 2012 _queryParams["pageToken"] = [pageToken]; |
2049 } | 2013 } |
2050 if (pageSize != null) { | 2014 if (pageSize != null) { |
2051 _queryParams["pageSize"] = ["${pageSize}"]; | 2015 _queryParams["pageSize"] = ["${pageSize}"]; |
2052 } | 2016 } |
2053 | 2017 |
2054 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 2018 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
2055 | 2019 |
2056 var _response = _requester.request(_url, | 2020 var _response = _requester.request(_url, "GET", |
2057 "GET", | 2021 body: _body, |
2058 body: _body, | 2022 queryParams: _queryParams, |
2059 queryParams: _queryParams, | 2023 uploadOptions: _uploadOptions, |
2060 uploadOptions: _uploadOptions, | 2024 uploadMedia: _uploadMedia, |
2061 uploadMedia: _uploadMedia, | 2025 downloadOptions: _downloadOptions); |
2062 downloadOptions: _downloadOptions); | |
2063 return _response.then((data) => new ListOperationsResponse.fromJson(data)); | 2026 return _response.then((data) => new ListOperationsResponse.fromJson(data)); |
2064 } | 2027 } |
2065 | |
2066 } | |
2067 | |
2068 | |
2069 | |
2070 /** | |
2071 * Specifies the audit configuration for a service. | |
2072 * The configuration determines which permission types are logged, and what | |
2073 * identities, if any, are exempted from logging. | |
2074 * An AuditConfig must have one or more AuditLogConfigs. | |
2075 * | |
2076 * If there are AuditConfigs for both `allServices` and a specific service, | |
2077 * the union of the two AuditConfigs is used for that service: the log_types | |
2078 * specified in each AuditConfig are enabled, and the exempted_members in each | |
2079 * AuditConfig are exempted. | |
2080 * | |
2081 * Example Policy with multiple AuditConfigs: | |
2082 * | |
2083 * { | |
2084 * "audit_configs": [ | |
2085 * { | |
2086 * "service": "allServices" | |
2087 * "audit_log_configs": [ | |
2088 * { | |
2089 * "log_type": "DATA_READ", | |
2090 * "exempted_members": [ | |
2091 * "user:foo@gmail.com" | |
2092 * ] | |
2093 * }, | |
2094 * { | |
2095 * "log_type": "DATA_WRITE", | |
2096 * }, | |
2097 * { | |
2098 * "log_type": "ADMIN_READ", | |
2099 * } | |
2100 * ] | |
2101 * }, | |
2102 * { | |
2103 * "service": "fooservice.googleapis.com" | |
2104 * "audit_log_configs": [ | |
2105 * { | |
2106 * "log_type": "DATA_READ", | |
2107 * }, | |
2108 * { | |
2109 * "log_type": "DATA_WRITE", | |
2110 * "exempted_members": [ | |
2111 * "user:bar@gmail.com" | |
2112 * ] | |
2113 * } | |
2114 * ] | |
2115 * } | |
2116 * ] | |
2117 * } | |
2118 * | |
2119 * For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ | |
2120 * logging. It also exempts foo@gmail.com from DATA_READ logging, and | |
2121 * bar@gmail.com from DATA_WRITE logging. | |
2122 */ | |
2123 class AuditConfig { | |
2124 /** | |
2125 * The configuration for logging of each type of permission. | |
2126 * Next ID: 4 | |
2127 */ | |
2128 core.List<AuditLogConfig> auditLogConfigs; | |
2129 core.List<core.String> exemptedMembers; | |
2130 /** | |
2131 * Specifies a service that will be enabled for audit logging. | |
2132 * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. | |
2133 * `allServices` is a special value that covers all services. | |
2134 */ | |
2135 core.String service; | |
2136 | |
2137 AuditConfig(); | |
2138 | |
2139 AuditConfig.fromJson(core.Map _json) { | |
2140 if (_json.containsKey("auditLogConfigs")) { | |
2141 auditLogConfigs = _json["auditLogConfigs"].map((value) => new AuditLogConf
ig.fromJson(value)).toList(); | |
2142 } | |
2143 if (_json.containsKey("exemptedMembers")) { | |
2144 exemptedMembers = _json["exemptedMembers"]; | |
2145 } | |
2146 if (_json.containsKey("service")) { | |
2147 service = _json["service"]; | |
2148 } | |
2149 } | |
2150 | |
2151 core.Map<core.String, core.Object> toJson() { | |
2152 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
2153 if (auditLogConfigs != null) { | |
2154 _json["auditLogConfigs"] = auditLogConfigs.map((value) => (value).toJson()
).toList(); | |
2155 } | |
2156 if (exemptedMembers != null) { | |
2157 _json["exemptedMembers"] = exemptedMembers; | |
2158 } | |
2159 if (service != null) { | |
2160 _json["service"] = service; | |
2161 } | |
2162 return _json; | |
2163 } | |
2164 } | 2028 } |
2165 | 2029 |
2166 /** | 2030 /// The request for BeginTransaction. |
2167 * Provides the configuration for logging a type of permissions. | |
2168 * Example: | |
2169 * | |
2170 * { | |
2171 * "audit_log_configs": [ | |
2172 * { | |
2173 * "log_type": "DATA_READ", | |
2174 * "exempted_members": [ | |
2175 * "user:foo@gmail.com" | |
2176 * ] | |
2177 * }, | |
2178 * { | |
2179 * "log_type": "DATA_WRITE", | |
2180 * } | |
2181 * ] | |
2182 * } | |
2183 * | |
2184 * This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting | |
2185 * foo@gmail.com from DATA_READ logging. | |
2186 */ | |
2187 class AuditLogConfig { | |
2188 /** | |
2189 * Specifies the identities that do not cause logging for this type of | |
2190 * permission. | |
2191 * Follows the same format of Binding.members. | |
2192 */ | |
2193 core.List<core.String> exemptedMembers; | |
2194 /** | |
2195 * The log type that this config enables. | |
2196 * Possible string values are: | |
2197 * - "LOG_TYPE_UNSPECIFIED" : Default case. Should never be this. | |
2198 * - "ADMIN_READ" : Admin reads. Example: CloudIAM getIamPolicy | |
2199 * - "DATA_WRITE" : Data writes. Example: CloudSQL Users create | |
2200 * - "DATA_READ" : Data reads. Example: CloudSQL Users list | |
2201 */ | |
2202 core.String logType; | |
2203 | |
2204 AuditLogConfig(); | |
2205 | |
2206 AuditLogConfig.fromJson(core.Map _json) { | |
2207 if (_json.containsKey("exemptedMembers")) { | |
2208 exemptedMembers = _json["exemptedMembers"]; | |
2209 } | |
2210 if (_json.containsKey("logType")) { | |
2211 logType = _json["logType"]; | |
2212 } | |
2213 } | |
2214 | |
2215 core.Map<core.String, core.Object> toJson() { | |
2216 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
2217 if (exemptedMembers != null) { | |
2218 _json["exemptedMembers"] = exemptedMembers; | |
2219 } | |
2220 if (logType != null) { | |
2221 _json["logType"] = logType; | |
2222 } | |
2223 return _json; | |
2224 } | |
2225 } | |
2226 | |
2227 /** Authorization-related information used by Cloud Audit Logging. */ | |
2228 class AuthorizationLoggingOptions { | |
2229 /** | |
2230 * The type of the permission that was checked. | |
2231 * Possible string values are: | |
2232 * - "PERMISSION_TYPE_UNSPECIFIED" : Default. Should not be used. | |
2233 * - "ADMIN_READ" : A read of admin (meta) data. | |
2234 * - "ADMIN_WRITE" : A write of admin (meta) data. | |
2235 * - "DATA_READ" : A read of standard data. | |
2236 * - "DATA_WRITE" : A write of standard data. | |
2237 */ | |
2238 core.String permissionType; | |
2239 | |
2240 AuthorizationLoggingOptions(); | |
2241 | |
2242 AuthorizationLoggingOptions.fromJson(core.Map _json) { | |
2243 if (_json.containsKey("permissionType")) { | |
2244 permissionType = _json["permissionType"]; | |
2245 } | |
2246 } | |
2247 | |
2248 core.Map<core.String, core.Object> toJson() { | |
2249 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
2250 if (permissionType != null) { | |
2251 _json["permissionType"] = permissionType; | |
2252 } | |
2253 return _json; | |
2254 } | |
2255 } | |
2256 | |
2257 /** The request for BeginTransaction. */ | |
2258 class BeginTransactionRequest { | 2031 class BeginTransactionRequest { |
2259 /** Required. Options for the new transaction. */ | 2032 /// Required. Options for the new transaction. |
2260 TransactionOptions options; | 2033 TransactionOptions options; |
2261 | 2034 |
2262 BeginTransactionRequest(); | 2035 BeginTransactionRequest(); |
2263 | 2036 |
2264 BeginTransactionRequest.fromJson(core.Map _json) { | 2037 BeginTransactionRequest.fromJson(core.Map _json) { |
2265 if (_json.containsKey("options")) { | 2038 if (_json.containsKey("options")) { |
2266 options = new TransactionOptions.fromJson(_json["options"]); | 2039 options = new TransactionOptions.fromJson(_json["options"]); |
2267 } | 2040 } |
2268 } | 2041 } |
2269 | 2042 |
2270 core.Map<core.String, core.Object> toJson() { | 2043 core.Map<core.String, core.Object> toJson() { |
2271 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2044 final core.Map<core.String, core.Object> _json = |
| 2045 new core.Map<core.String, core.Object>(); |
2272 if (options != null) { | 2046 if (options != null) { |
2273 _json["options"] = (options).toJson(); | 2047 _json["options"] = (options).toJson(); |
2274 } | 2048 } |
2275 return _json; | 2049 return _json; |
2276 } | 2050 } |
2277 } | 2051 } |
2278 | 2052 |
2279 /** Associates `members` with a `role`. */ | 2053 /// Associates `members` with a `role`. |
2280 class Binding { | 2054 class Binding { |
2281 /** | 2055 /// Specifies the identities requesting access for a Cloud Platform resource. |
2282 * The condition that is associated with this binding. | 2056 /// `members` can have the following values: |
2283 * NOTE: an unsatisfied condition will not allow user access via current | 2057 /// |
2284 * binding. Different bindings, including their conditions, are examined | 2058 /// * `allUsers`: A special identifier that represents anyone who is |
2285 * independently. | 2059 /// on the internet; with or without a Google account. |
2286 * This field is GOOGLE_INTERNAL. | 2060 /// |
2287 */ | 2061 /// * `allAuthenticatedUsers`: A special identifier that represents anyone |
2288 Expr condition; | 2062 /// who is authenticated with a Google account or a service account. |
2289 /** | 2063 /// |
2290 * Specifies the identities requesting access for a Cloud Platform resource. | 2064 /// * `user:{emailid}`: An email address that represents a specific Google |
2291 * `members` can have the following values: | 2065 /// account. For example, `alice@gmail.com` or `joe@example.com`. |
2292 * | 2066 /// |
2293 * * `allUsers`: A special identifier that represents anyone who is | 2067 /// |
2294 * on the internet; with or without a Google account. | 2068 /// * `serviceAccount:{emailid}`: An email address that represents a service |
2295 * | 2069 /// account. For example, `my-other-app@appspot.gserviceaccount.com`. |
2296 * * `allAuthenticatedUsers`: A special identifier that represents anyone | 2070 /// |
2297 * who is authenticated with a Google account or a service account. | 2071 /// * `group:{emailid}`: An email address that represents a Google group. |
2298 * | 2072 /// For example, `admins@example.com`. |
2299 * * `user:{emailid}`: An email address that represents a specific Google | 2073 /// |
2300 * account. For example, `alice@gmail.com` or `joe@example.com`. | 2074 /// |
2301 * | 2075 /// * `domain:{domain}`: A Google Apps domain name that represents all the |
2302 * | 2076 /// users of that domain. For example, `google.com` or `example.com`. |
2303 * * `serviceAccount:{emailid}`: An email address that represents a service | |
2304 * account. For example, `my-other-app@appspot.gserviceaccount.com`. | |
2305 * | |
2306 * * `group:{emailid}`: An email address that represents a Google group. | |
2307 * For example, `admins@example.com`. | |
2308 * | |
2309 * | |
2310 * * `domain:{domain}`: A Google Apps domain name that represents all the | |
2311 * users of that domain. For example, `google.com` or `example.com`. | |
2312 */ | |
2313 core.List<core.String> members; | 2077 core.List<core.String> members; |
2314 /** | 2078 |
2315 * Role that is assigned to `members`. | 2079 /// Role that is assigned to `members`. |
2316 * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. | 2080 /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
2317 * Required | 2081 /// Required |
2318 */ | |
2319 core.String role; | 2082 core.String role; |
2320 | 2083 |
2321 Binding(); | 2084 Binding(); |
2322 | 2085 |
2323 Binding.fromJson(core.Map _json) { | 2086 Binding.fromJson(core.Map _json) { |
2324 if (_json.containsKey("condition")) { | |
2325 condition = new Expr.fromJson(_json["condition"]); | |
2326 } | |
2327 if (_json.containsKey("members")) { | 2087 if (_json.containsKey("members")) { |
2328 members = _json["members"]; | 2088 members = _json["members"]; |
2329 } | 2089 } |
2330 if (_json.containsKey("role")) { | 2090 if (_json.containsKey("role")) { |
2331 role = _json["role"]; | 2091 role = _json["role"]; |
2332 } | 2092 } |
2333 } | 2093 } |
2334 | 2094 |
2335 core.Map<core.String, core.Object> toJson() { | 2095 core.Map<core.String, core.Object> toJson() { |
2336 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2096 final core.Map<core.String, core.Object> _json = |
2337 if (condition != null) { | 2097 new core.Map<core.String, core.Object>(); |
2338 _json["condition"] = (condition).toJson(); | |
2339 } | |
2340 if (members != null) { | 2098 if (members != null) { |
2341 _json["members"] = members; | 2099 _json["members"] = members; |
2342 } | 2100 } |
2343 if (role != null) { | 2101 if (role != null) { |
2344 _json["role"] = role; | 2102 _json["role"] = role; |
2345 } | 2103 } |
2346 return _json; | 2104 return _json; |
2347 } | 2105 } |
2348 } | 2106 } |
2349 | 2107 |
2350 /** | 2108 /// Metadata associated with a parent-child relationship appearing in a |
2351 * Metadata associated with a parent-child relationship appearing in a | 2109 /// PlanNode. |
2352 * PlanNode. | |
2353 */ | |
2354 class ChildLink { | 2110 class ChildLink { |
2355 /** The node to which the link points. */ | 2111 /// The node to which the link points. |
2356 core.int childIndex; | 2112 core.int childIndex; |
2357 /** | 2113 |
2358 * The type of the link. For example, in Hash Joins this could be used to | 2114 /// The type of the link. For example, in Hash Joins this could be used to |
2359 * distinguish between the build child and the probe child, or in the case | 2115 /// distinguish between the build child and the probe child, or in the case |
2360 * of the child being an output variable, to represent the tag associated | 2116 /// of the child being an output variable, to represent the tag associated |
2361 * with the output variable. | 2117 /// with the output variable. |
2362 */ | |
2363 core.String type; | 2118 core.String type; |
2364 /** | 2119 |
2365 * Only present if the child node is SCALAR and corresponds | 2120 /// Only present if the child node is SCALAR and corresponds |
2366 * to an output variable of the parent node. The field carries the name of | 2121 /// to an output variable of the parent node. The field carries the name of |
2367 * the output variable. | 2122 /// the output variable. |
2368 * For example, a `TableScan` operator that reads rows from a table will | 2123 /// For example, a `TableScan` operator that reads rows from a table will |
2369 * have child links to the `SCALAR` nodes representing the output variables | 2124 /// have child links to the `SCALAR` nodes representing the output variables |
2370 * created for each column that is read by the operator. The corresponding | 2125 /// created for each column that is read by the operator. The corresponding |
2371 * `variable` fields will be set to the variable names assigned to the | 2126 /// `variable` fields will be set to the variable names assigned to the |
2372 * columns. | 2127 /// columns. |
2373 */ | |
2374 core.String variable; | 2128 core.String variable; |
2375 | 2129 |
2376 ChildLink(); | 2130 ChildLink(); |
2377 | 2131 |
2378 ChildLink.fromJson(core.Map _json) { | 2132 ChildLink.fromJson(core.Map _json) { |
2379 if (_json.containsKey("childIndex")) { | 2133 if (_json.containsKey("childIndex")) { |
2380 childIndex = _json["childIndex"]; | 2134 childIndex = _json["childIndex"]; |
2381 } | 2135 } |
2382 if (_json.containsKey("type")) { | 2136 if (_json.containsKey("type")) { |
2383 type = _json["type"]; | 2137 type = _json["type"]; |
2384 } | 2138 } |
2385 if (_json.containsKey("variable")) { | 2139 if (_json.containsKey("variable")) { |
2386 variable = _json["variable"]; | 2140 variable = _json["variable"]; |
2387 } | 2141 } |
2388 } | 2142 } |
2389 | 2143 |
2390 core.Map<core.String, core.Object> toJson() { | 2144 core.Map<core.String, core.Object> toJson() { |
2391 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2145 final core.Map<core.String, core.Object> _json = |
| 2146 new core.Map<core.String, core.Object>(); |
2392 if (childIndex != null) { | 2147 if (childIndex != null) { |
2393 _json["childIndex"] = childIndex; | 2148 _json["childIndex"] = childIndex; |
2394 } | 2149 } |
2395 if (type != null) { | 2150 if (type != null) { |
2396 _json["type"] = type; | 2151 _json["type"] = type; |
2397 } | 2152 } |
2398 if (variable != null) { | 2153 if (variable != null) { |
2399 _json["variable"] = variable; | 2154 _json["variable"] = variable; |
2400 } | 2155 } |
2401 return _json; | 2156 return _json; |
2402 } | 2157 } |
2403 } | 2158 } |
2404 | 2159 |
2405 /** Write a Cloud Audit log */ | 2160 /// The request for Commit. |
2406 class CloudAuditOptions { | 2161 class CommitRequest { |
2407 /** Information used by the Cloud Audit Logging pipeline. */ | 2162 /// The mutations to be executed when this transaction commits. All |
2408 AuthorizationLoggingOptions authorizationLoggingOptions; | 2163 /// mutations are applied atomically, in the order they appear in |
2409 /** | 2164 /// this list. |
2410 * The log_name to populate in the Cloud Audit Record. | 2165 core.List<Mutation> mutations; |
2411 * Possible string values are: | |
2412 * - "UNSPECIFIED_LOG_NAME" : Default. Should not be used. | |
2413 * - "ADMIN_ACTIVITY" : Corresponds to "cloudaudit.googleapis.com/activity" | |
2414 * - "DATA_ACCESS" : Corresponds to "cloudaudit.googleapis.com/data_access" | |
2415 */ | |
2416 core.String logName; | |
2417 | 2166 |
2418 CloudAuditOptions(); | 2167 /// Execute mutations in a temporary transaction. Note that unlike |
| 2168 /// commit of a previously-started transaction, commit with a |
| 2169 /// temporary transaction is non-idempotent. That is, if the |
| 2170 /// `CommitRequest` is sent to Cloud Spanner more than once (for |
| 2171 /// instance, due to retries in the application, or in the |
| 2172 /// transport library), it is possible that the mutations are |
| 2173 /// executed more than once. If this is undesirable, use |
| 2174 /// BeginTransaction and |
| 2175 /// Commit instead. |
| 2176 TransactionOptions singleUseTransaction; |
2419 | 2177 |
2420 CloudAuditOptions.fromJson(core.Map _json) { | 2178 /// Commit a previously-started transaction. |
2421 if (_json.containsKey("authorizationLoggingOptions")) { | |
2422 authorizationLoggingOptions = new AuthorizationLoggingOptions.fromJson(_js
on["authorizationLoggingOptions"]); | |
2423 } | |
2424 if (_json.containsKey("logName")) { | |
2425 logName = _json["logName"]; | |
2426 } | |
2427 } | |
2428 | |
2429 core.Map<core.String, core.Object> toJson() { | |
2430 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
2431 if (authorizationLoggingOptions != null) { | |
2432 _json["authorizationLoggingOptions"] = (authorizationLoggingOptions).toJso
n(); | |
2433 } | |
2434 if (logName != null) { | |
2435 _json["logName"] = logName; | |
2436 } | |
2437 return _json; | |
2438 } | |
2439 } | |
2440 | |
2441 /** The request for Commit. */ | |
2442 class CommitRequest { | |
2443 /** | |
2444 * The mutations to be executed when this transaction commits. All | |
2445 * mutations are applied atomically, in the order they appear in | |
2446 * this list. | |
2447 */ | |
2448 core.List<Mutation> mutations; | |
2449 /** | |
2450 * Execute mutations in a temporary transaction. Note that unlike | |
2451 * commit of a previously-started transaction, commit with a | |
2452 * temporary transaction is non-idempotent. That is, if the | |
2453 * `CommitRequest` is sent to Cloud Spanner more than once (for | |
2454 * instance, due to retries in the application, or in the | |
2455 * transport library), it is possible that the mutations are | |
2456 * executed more than once. If this is undesirable, use | |
2457 * BeginTransaction and | |
2458 * Commit instead. | |
2459 */ | |
2460 TransactionOptions singleUseTransaction; | |
2461 /** Commit a previously-started transaction. */ | |
2462 core.String transactionId; | 2179 core.String transactionId; |
2463 core.List<core.int> get transactionIdAsBytes { | 2180 core.List<core.int> get transactionIdAsBytes { |
2464 return convert.BASE64.decode(transactionId); | 2181 return convert.BASE64.decode(transactionId); |
2465 } | 2182 } |
2466 | 2183 |
2467 void set transactionIdAsBytes(core.List<core.int> _bytes) { | 2184 void set transactionIdAsBytes(core.List<core.int> _bytes) { |
2468 transactionId = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAl
l("+", "-"); | 2185 transactionId = |
| 2186 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
2469 } | 2187 } |
2470 | 2188 |
2471 CommitRequest(); | 2189 CommitRequest(); |
2472 | 2190 |
2473 CommitRequest.fromJson(core.Map _json) { | 2191 CommitRequest.fromJson(core.Map _json) { |
2474 if (_json.containsKey("mutations")) { | 2192 if (_json.containsKey("mutations")) { |
2475 mutations = _json["mutations"].map((value) => new Mutation.fromJson(value)
).toList(); | 2193 mutations = _json["mutations"] |
| 2194 .map((value) => new Mutation.fromJson(value)) |
| 2195 .toList(); |
2476 } | 2196 } |
2477 if (_json.containsKey("singleUseTransaction")) { | 2197 if (_json.containsKey("singleUseTransaction")) { |
2478 singleUseTransaction = new TransactionOptions.fromJson(_json["singleUseTra
nsaction"]); | 2198 singleUseTransaction = |
| 2199 new TransactionOptions.fromJson(_json["singleUseTransaction"]); |
2479 } | 2200 } |
2480 if (_json.containsKey("transactionId")) { | 2201 if (_json.containsKey("transactionId")) { |
2481 transactionId = _json["transactionId"]; | 2202 transactionId = _json["transactionId"]; |
2482 } | 2203 } |
2483 } | 2204 } |
2484 | 2205 |
2485 core.Map<core.String, core.Object> toJson() { | 2206 core.Map<core.String, core.Object> toJson() { |
2486 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2207 final core.Map<core.String, core.Object> _json = |
| 2208 new core.Map<core.String, core.Object>(); |
2487 if (mutations != null) { | 2209 if (mutations != null) { |
2488 _json["mutations"] = mutations.map((value) => (value).toJson()).toList(); | 2210 _json["mutations"] = mutations.map((value) => (value).toJson()).toList(); |
2489 } | 2211 } |
2490 if (singleUseTransaction != null) { | 2212 if (singleUseTransaction != null) { |
2491 _json["singleUseTransaction"] = (singleUseTransaction).toJson(); | 2213 _json["singleUseTransaction"] = (singleUseTransaction).toJson(); |
2492 } | 2214 } |
2493 if (transactionId != null) { | 2215 if (transactionId != null) { |
2494 _json["transactionId"] = transactionId; | 2216 _json["transactionId"] = transactionId; |
2495 } | 2217 } |
2496 return _json; | 2218 return _json; |
2497 } | 2219 } |
2498 } | 2220 } |
2499 | 2221 |
2500 /** The response for Commit. */ | 2222 /// The response for Commit. |
2501 class CommitResponse { | 2223 class CommitResponse { |
2502 /** The Cloud Spanner timestamp at which the transaction committed. */ | 2224 /// The Cloud Spanner timestamp at which the transaction committed. |
2503 core.String commitTimestamp; | 2225 core.String commitTimestamp; |
2504 | 2226 |
2505 CommitResponse(); | 2227 CommitResponse(); |
2506 | 2228 |
2507 CommitResponse.fromJson(core.Map _json) { | 2229 CommitResponse.fromJson(core.Map _json) { |
2508 if (_json.containsKey("commitTimestamp")) { | 2230 if (_json.containsKey("commitTimestamp")) { |
2509 commitTimestamp = _json["commitTimestamp"]; | 2231 commitTimestamp = _json["commitTimestamp"]; |
2510 } | 2232 } |
2511 } | 2233 } |
2512 | 2234 |
2513 core.Map<core.String, core.Object> toJson() { | 2235 core.Map<core.String, core.Object> toJson() { |
2514 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2236 final core.Map<core.String, core.Object> _json = |
| 2237 new core.Map<core.String, core.Object>(); |
2515 if (commitTimestamp != null) { | 2238 if (commitTimestamp != null) { |
2516 _json["commitTimestamp"] = commitTimestamp; | 2239 _json["commitTimestamp"] = commitTimestamp; |
2517 } | 2240 } |
2518 return _json; | 2241 return _json; |
2519 } | 2242 } |
2520 } | 2243 } |
2521 | 2244 |
2522 /** A condition to be met. */ | 2245 /// Metadata type for the operation returned by |
2523 class Condition { | 2246 /// CreateDatabase. |
2524 /** | |
2525 * Trusted attributes supplied by the IAM system. | |
2526 * Possible string values are: | |
2527 * - "NO_ATTR" : Default non-attribute. | |
2528 * - "AUTHORITY" : Either principal or (if present) authority selector. | |
2529 * - "ATTRIBUTION" : The principal (even if an authority selector is present), | |
2530 * which | |
2531 * must only be used for attribution, not authorization. | |
2532 * - "SECURITY_REALM" : Any of the security realms in the IAMContext | |
2533 * (go/security-realms). | |
2534 * When used with IN, the condition indicates "any of the request's realms | |
2535 * match one of the given values; with NOT_IN, "none of the realms match | |
2536 * any of the given values". It is not permitted to grant access based on | |
2537 * the *absence* of a realm, so realm conditions can only be used in | |
2538 * a "positive" context (e.g., ALLOW/IN or DENY/NOT_IN). | |
2539 * - "APPROVER" : An approver (distinct from the requester) that has | |
2540 * authorized this | |
2541 * request. | |
2542 * When used with IN, the condition indicates that one of the approvers | |
2543 * associated with the request matches the specified principal, or is a | |
2544 * member of the specified group. Approvers can only grant additional | |
2545 * access, and are thus only used in a strictly positive context | |
2546 * (e.g. ALLOW/IN or DENY/NOT_IN). | |
2547 * - "JUSTIFICATION_TYPE" : What types of justifications have been supplied | |
2548 * with this request. | |
2549 * String values should match enum names from tech.iam.JustificationType, | |
2550 * e.g. "MANUAL_STRING". It is not permitted to grant access based on | |
2551 * the *absence* of a justification, so justification conditions can only | |
2552 * be used in a "positive" context (e.g., ALLOW/IN or DENY/NOT_IN). | |
2553 * | |
2554 * Multiple justifications, e.g., a Buganizer ID and a manually-entered | |
2555 * reason, are normal and supported. | |
2556 */ | |
2557 core.String iam; | |
2558 /** | |
2559 * An operator to apply the subject with. | |
2560 * Possible string values are: | |
2561 * - "NO_OP" : Default no-op. | |
2562 * - "EQUALS" : DEPRECATED. Use IN instead. | |
2563 * - "NOT_EQUALS" : DEPRECATED. Use NOT_IN instead. | |
2564 * - "IN" : The condition is true if the subject (or any element of it if it | |
2565 * is | |
2566 * a set) matches any of the supplied values. | |
2567 * - "NOT_IN" : The condition is true if the subject (or every element of it | |
2568 * if it is | |
2569 * a set) matches none of the supplied values. | |
2570 * - "DISCHARGED" : Subject is discharged | |
2571 */ | |
2572 core.String op; | |
2573 /** Trusted attributes discharged by the service. */ | |
2574 core.String svc; | |
2575 /** | |
2576 * Trusted attributes supplied by any service that owns resources and uses | |
2577 * the IAM system for access control. | |
2578 * Possible string values are: | |
2579 * - "NO_ATTR" : Default non-attribute type | |
2580 * - "REGION" : Region of the resource | |
2581 * - "SERVICE" : Service name | |
2582 * - "NAME" : Resource name | |
2583 * - "IP" : IP address of the caller | |
2584 */ | |
2585 core.String sys; | |
2586 /** DEPRECATED. Use 'values' instead. */ | |
2587 core.String value; | |
2588 /** The objects of the condition. This is mutually exclusive with 'value'. */ | |
2589 core.List<core.String> values; | |
2590 | |
2591 Condition(); | |
2592 | |
2593 Condition.fromJson(core.Map _json) { | |
2594 if (_json.containsKey("iam")) { | |
2595 iam = _json["iam"]; | |
2596 } | |
2597 if (_json.containsKey("op")) { | |
2598 op = _json["op"]; | |
2599 } | |
2600 if (_json.containsKey("svc")) { | |
2601 svc = _json["svc"]; | |
2602 } | |
2603 if (_json.containsKey("sys")) { | |
2604 sys = _json["sys"]; | |
2605 } | |
2606 if (_json.containsKey("value")) { | |
2607 value = _json["value"]; | |
2608 } | |
2609 if (_json.containsKey("values")) { | |
2610 values = _json["values"]; | |
2611 } | |
2612 } | |
2613 | |
2614 core.Map<core.String, core.Object> toJson() { | |
2615 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
2616 if (iam != null) { | |
2617 _json["iam"] = iam; | |
2618 } | |
2619 if (op != null) { | |
2620 _json["op"] = op; | |
2621 } | |
2622 if (svc != null) { | |
2623 _json["svc"] = svc; | |
2624 } | |
2625 if (sys != null) { | |
2626 _json["sys"] = sys; | |
2627 } | |
2628 if (value != null) { | |
2629 _json["value"] = value; | |
2630 } | |
2631 if (values != null) { | |
2632 _json["values"] = values; | |
2633 } | |
2634 return _json; | |
2635 } | |
2636 } | |
2637 | |
2638 /** Options for counters */ | |
2639 class CounterOptions { | |
2640 /** The field value to attribute. */ | |
2641 core.String field; | |
2642 /** The metric to update. */ | |
2643 core.String metric; | |
2644 | |
2645 CounterOptions(); | |
2646 | |
2647 CounterOptions.fromJson(core.Map _json) { | |
2648 if (_json.containsKey("field")) { | |
2649 field = _json["field"]; | |
2650 } | |
2651 if (_json.containsKey("metric")) { | |
2652 metric = _json["metric"]; | |
2653 } | |
2654 } | |
2655 | |
2656 core.Map<core.String, core.Object> toJson() { | |
2657 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
2658 if (field != null) { | |
2659 _json["field"] = field; | |
2660 } | |
2661 if (metric != null) { | |
2662 _json["metric"] = metric; | |
2663 } | |
2664 return _json; | |
2665 } | |
2666 } | |
2667 | |
2668 /** | |
2669 * Metadata type for the operation returned by | |
2670 * CreateDatabase. | |
2671 */ | |
2672 class CreateDatabaseMetadata { | 2247 class CreateDatabaseMetadata { |
2673 /** The database being created. */ | 2248 /// The database being created. |
2674 core.String database; | 2249 core.String database; |
2675 | 2250 |
2676 CreateDatabaseMetadata(); | 2251 CreateDatabaseMetadata(); |
2677 | 2252 |
2678 CreateDatabaseMetadata.fromJson(core.Map _json) { | 2253 CreateDatabaseMetadata.fromJson(core.Map _json) { |
2679 if (_json.containsKey("database")) { | 2254 if (_json.containsKey("database")) { |
2680 database = _json["database"]; | 2255 database = _json["database"]; |
2681 } | 2256 } |
2682 } | 2257 } |
2683 | 2258 |
2684 core.Map<core.String, core.Object> toJson() { | 2259 core.Map<core.String, core.Object> toJson() { |
2685 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2260 final core.Map<core.String, core.Object> _json = |
| 2261 new core.Map<core.String, core.Object>(); |
2686 if (database != null) { | 2262 if (database != null) { |
2687 _json["database"] = database; | 2263 _json["database"] = database; |
2688 } | 2264 } |
2689 return _json; | 2265 return _json; |
2690 } | 2266 } |
2691 } | 2267 } |
2692 | 2268 |
2693 /** The request for CreateDatabase. */ | 2269 /// The request for CreateDatabase. |
2694 class CreateDatabaseRequest { | 2270 class CreateDatabaseRequest { |
2695 /** | 2271 /// Required. A `CREATE DATABASE` statement, which specifies the ID of the |
2696 * Required. A `CREATE DATABASE` statement, which specifies the ID of the | 2272 /// new database. The database ID must conform to the regular expression |
2697 * new database. The database ID must conform to the regular expression | 2273 /// `a-z*[a-z0-9]` and be between 2 and 30 characters in length. |
2698 * `a-z*[a-z0-9]` and be between 2 and 30 characters in length. | 2274 /// If the database ID is a reserved word or if it contains a hyphen, the |
2699 * If the database ID is a reserved word or if it contains a hyphen, the | 2275 /// database ID must be enclosed in backticks (`` ` ``). |
2700 * database ID must be enclosed in backticks (`` ` ``). | |
2701 */ | |
2702 core.String createStatement; | 2276 core.String createStatement; |
2703 /** | 2277 |
2704 * An optional list of DDL statements to run inside the newly created | 2278 /// An optional list of DDL statements to run inside the newly created |
2705 * database. Statements can create tables, indexes, etc. These | 2279 /// database. Statements can create tables, indexes, etc. These |
2706 * statements execute atomically with the creation of the database: | 2280 /// statements execute atomically with the creation of the database: |
2707 * if there is an error in any statement, the database is not created. | 2281 /// if there is an error in any statement, the database is not created. |
2708 */ | |
2709 core.List<core.String> extraStatements; | 2282 core.List<core.String> extraStatements; |
2710 | 2283 |
2711 CreateDatabaseRequest(); | 2284 CreateDatabaseRequest(); |
2712 | 2285 |
2713 CreateDatabaseRequest.fromJson(core.Map _json) { | 2286 CreateDatabaseRequest.fromJson(core.Map _json) { |
2714 if (_json.containsKey("createStatement")) { | 2287 if (_json.containsKey("createStatement")) { |
2715 createStatement = _json["createStatement"]; | 2288 createStatement = _json["createStatement"]; |
2716 } | 2289 } |
2717 if (_json.containsKey("extraStatements")) { | 2290 if (_json.containsKey("extraStatements")) { |
2718 extraStatements = _json["extraStatements"]; | 2291 extraStatements = _json["extraStatements"]; |
2719 } | 2292 } |
2720 } | 2293 } |
2721 | 2294 |
2722 core.Map<core.String, core.Object> toJson() { | 2295 core.Map<core.String, core.Object> toJson() { |
2723 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2296 final core.Map<core.String, core.Object> _json = |
| 2297 new core.Map<core.String, core.Object>(); |
2724 if (createStatement != null) { | 2298 if (createStatement != null) { |
2725 _json["createStatement"] = createStatement; | 2299 _json["createStatement"] = createStatement; |
2726 } | 2300 } |
2727 if (extraStatements != null) { | 2301 if (extraStatements != null) { |
2728 _json["extraStatements"] = extraStatements; | 2302 _json["extraStatements"] = extraStatements; |
2729 } | 2303 } |
2730 return _json; | 2304 return _json; |
2731 } | 2305 } |
2732 } | 2306 } |
2733 | 2307 |
2734 /** | 2308 /// Metadata type for the operation returned by |
2735 * Metadata type for the operation returned by | 2309 /// CreateInstance. |
2736 * CreateInstance. | |
2737 */ | |
2738 class CreateInstanceMetadata { | 2310 class CreateInstanceMetadata { |
2739 /** | 2311 /// The time at which this operation was cancelled. If set, this operation is |
2740 * The time at which this operation was cancelled. If set, this operation is | 2312 /// in the process of undoing itself (which is guaranteed to succeed) and |
2741 * in the process of undoing itself (which is guaranteed to succeed) and | 2313 /// cannot be cancelled again. |
2742 * cannot be cancelled again. | |
2743 */ | |
2744 core.String cancelTime; | 2314 core.String cancelTime; |
2745 /** The time at which this operation failed or was completed successfully. */ | 2315 |
| 2316 /// The time at which this operation failed or was completed successfully. |
2746 core.String endTime; | 2317 core.String endTime; |
2747 /** The instance being created. */ | 2318 |
| 2319 /// The instance being created. |
2748 Instance instance; | 2320 Instance instance; |
2749 /** | 2321 |
2750 * The time at which the | 2322 /// The time at which the |
2751 * CreateInstance request was | 2323 /// CreateInstance request was |
2752 * received. | 2324 /// received. |
2753 */ | |
2754 core.String startTime; | 2325 core.String startTime; |
2755 | 2326 |
2756 CreateInstanceMetadata(); | 2327 CreateInstanceMetadata(); |
2757 | 2328 |
2758 CreateInstanceMetadata.fromJson(core.Map _json) { | 2329 CreateInstanceMetadata.fromJson(core.Map _json) { |
2759 if (_json.containsKey("cancelTime")) { | 2330 if (_json.containsKey("cancelTime")) { |
2760 cancelTime = _json["cancelTime"]; | 2331 cancelTime = _json["cancelTime"]; |
2761 } | 2332 } |
2762 if (_json.containsKey("endTime")) { | 2333 if (_json.containsKey("endTime")) { |
2763 endTime = _json["endTime"]; | 2334 endTime = _json["endTime"]; |
2764 } | 2335 } |
2765 if (_json.containsKey("instance")) { | 2336 if (_json.containsKey("instance")) { |
2766 instance = new Instance.fromJson(_json["instance"]); | 2337 instance = new Instance.fromJson(_json["instance"]); |
2767 } | 2338 } |
2768 if (_json.containsKey("startTime")) { | 2339 if (_json.containsKey("startTime")) { |
2769 startTime = _json["startTime"]; | 2340 startTime = _json["startTime"]; |
2770 } | 2341 } |
2771 } | 2342 } |
2772 | 2343 |
2773 core.Map<core.String, core.Object> toJson() { | 2344 core.Map<core.String, core.Object> toJson() { |
2774 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2345 final core.Map<core.String, core.Object> _json = |
| 2346 new core.Map<core.String, core.Object>(); |
2775 if (cancelTime != null) { | 2347 if (cancelTime != null) { |
2776 _json["cancelTime"] = cancelTime; | 2348 _json["cancelTime"] = cancelTime; |
2777 } | 2349 } |
2778 if (endTime != null) { | 2350 if (endTime != null) { |
2779 _json["endTime"] = endTime; | 2351 _json["endTime"] = endTime; |
2780 } | 2352 } |
2781 if (instance != null) { | 2353 if (instance != null) { |
2782 _json["instance"] = (instance).toJson(); | 2354 _json["instance"] = (instance).toJson(); |
2783 } | 2355 } |
2784 if (startTime != null) { | 2356 if (startTime != null) { |
2785 _json["startTime"] = startTime; | 2357 _json["startTime"] = startTime; |
2786 } | 2358 } |
2787 return _json; | 2359 return _json; |
2788 } | 2360 } |
2789 } | 2361 } |
2790 | 2362 |
2791 /** The request for CreateInstance. */ | 2363 /// The request for CreateInstance. |
2792 class CreateInstanceRequest { | 2364 class CreateInstanceRequest { |
2793 /** | 2365 /// Required. The instance to create. The name may be omitted, but if |
2794 * Required. The instance to create. The name may be omitted, but if | 2366 /// specified must be `<parent>/instances/<instance_id>`. |
2795 * specified must be `<parent>/instances/<instance_id>`. | |
2796 */ | |
2797 Instance instance; | 2367 Instance instance; |
2798 /** | 2368 |
2799 * Required. The ID of the instance to create. Valid identifiers are of the | 2369 /// Required. The ID of the instance to create. Valid identifiers are of the |
2800 * form `a-z*[a-z0-9]` and must be between 6 and 30 characters in | 2370 /// form `a-z*[a-z0-9]` and must be between 6 and 30 characters in |
2801 * length. | 2371 /// length. |
2802 */ | |
2803 core.String instanceId; | 2372 core.String instanceId; |
2804 | 2373 |
2805 CreateInstanceRequest(); | 2374 CreateInstanceRequest(); |
2806 | 2375 |
2807 CreateInstanceRequest.fromJson(core.Map _json) { | 2376 CreateInstanceRequest.fromJson(core.Map _json) { |
2808 if (_json.containsKey("instance")) { | 2377 if (_json.containsKey("instance")) { |
2809 instance = new Instance.fromJson(_json["instance"]); | 2378 instance = new Instance.fromJson(_json["instance"]); |
2810 } | 2379 } |
2811 if (_json.containsKey("instanceId")) { | 2380 if (_json.containsKey("instanceId")) { |
2812 instanceId = _json["instanceId"]; | 2381 instanceId = _json["instanceId"]; |
2813 } | 2382 } |
2814 } | 2383 } |
2815 | 2384 |
2816 core.Map<core.String, core.Object> toJson() { | 2385 core.Map<core.String, core.Object> toJson() { |
2817 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2386 final core.Map<core.String, core.Object> _json = |
| 2387 new core.Map<core.String, core.Object>(); |
2818 if (instance != null) { | 2388 if (instance != null) { |
2819 _json["instance"] = (instance).toJson(); | 2389 _json["instance"] = (instance).toJson(); |
2820 } | 2390 } |
2821 if (instanceId != null) { | 2391 if (instanceId != null) { |
2822 _json["instanceId"] = instanceId; | 2392 _json["instanceId"] = instanceId; |
2823 } | 2393 } |
2824 return _json; | 2394 return _json; |
2825 } | 2395 } |
2826 } | 2396 } |
2827 | 2397 |
2828 /** Write a Data Access (Gin) log */ | 2398 /// A Cloud Spanner database. |
2829 class DataAccessOptions { | 2399 class Database { |
| 2400 /// Required. The name of the database. Values are of the form |
| 2401 /// `projects/<project>/instances/<instance>/databases/<database>`, |
| 2402 /// where `<database>` is as specified in the `CREATE DATABASE` |
| 2403 /// statement. This name can be passed to other API methods to |
| 2404 /// identify the database. |
| 2405 core.String name; |
2830 | 2406 |
2831 DataAccessOptions(); | 2407 /// Output only. The current database state. |
2832 | 2408 /// Possible string values are: |
2833 DataAccessOptions.fromJson(core.Map _json) { | 2409 /// - "STATE_UNSPECIFIED" : Not specified. |
2834 } | 2410 /// - "CREATING" : The database is still being created. Operations on the |
2835 | 2411 /// database may fail |
2836 core.Map<core.String, core.Object> toJson() { | 2412 /// with `FAILED_PRECONDITION` in this state. |
2837 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2413 /// - "READY" : The database is fully created and ready for use. |
2838 return _json; | |
2839 } | |
2840 } | |
2841 | |
2842 /** A Cloud Spanner database. */ | |
2843 class Database { | |
2844 /** | |
2845 * Required. The name of the database. Values are of the form | |
2846 * `projects/<project>/instances/<instance>/databases/<database>`, | |
2847 * where `<database>` is as specified in the `CREATE DATABASE` | |
2848 * statement. This name can be passed to other API methods to | |
2849 * identify the database. | |
2850 */ | |
2851 core.String name; | |
2852 /** | |
2853 * Output only. The current database state. | |
2854 * Possible string values are: | |
2855 * - "STATE_UNSPECIFIED" : Not specified. | |
2856 * - "CREATING" : The database is still being created. Operations on the | |
2857 * database may fail | |
2858 * with `FAILED_PRECONDITION` in this state. | |
2859 * - "READY" : The database is fully created and ready for use. | |
2860 */ | |
2861 core.String state; | 2414 core.String state; |
2862 | 2415 |
2863 Database(); | 2416 Database(); |
2864 | 2417 |
2865 Database.fromJson(core.Map _json) { | 2418 Database.fromJson(core.Map _json) { |
2866 if (_json.containsKey("name")) { | 2419 if (_json.containsKey("name")) { |
2867 name = _json["name"]; | 2420 name = _json["name"]; |
2868 } | 2421 } |
2869 if (_json.containsKey("state")) { | 2422 if (_json.containsKey("state")) { |
2870 state = _json["state"]; | 2423 state = _json["state"]; |
2871 } | 2424 } |
2872 } | 2425 } |
2873 | 2426 |
2874 core.Map<core.String, core.Object> toJson() { | 2427 core.Map<core.String, core.Object> toJson() { |
2875 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2428 final core.Map<core.String, core.Object> _json = |
| 2429 new core.Map<core.String, core.Object>(); |
2876 if (name != null) { | 2430 if (name != null) { |
2877 _json["name"] = name; | 2431 _json["name"] = name; |
2878 } | 2432 } |
2879 if (state != null) { | 2433 if (state != null) { |
2880 _json["state"] = state; | 2434 _json["state"] = state; |
2881 } | 2435 } |
2882 return _json; | 2436 return _json; |
2883 } | 2437 } |
2884 } | 2438 } |
2885 | 2439 |
2886 /** Arguments to delete operations. */ | 2440 /// Arguments to delete operations. |
2887 class Delete { | 2441 class Delete { |
2888 /** Required. The primary keys of the rows within table to delete. */ | 2442 /// Required. The primary keys of the rows within table to delete. |
2889 KeySet keySet; | 2443 KeySet keySet; |
2890 /** Required. The table whose rows will be deleted. */ | 2444 |
| 2445 /// Required. The table whose rows will be deleted. |
2891 core.String table; | 2446 core.String table; |
2892 | 2447 |
2893 Delete(); | 2448 Delete(); |
2894 | 2449 |
2895 Delete.fromJson(core.Map _json) { | 2450 Delete.fromJson(core.Map _json) { |
2896 if (_json.containsKey("keySet")) { | 2451 if (_json.containsKey("keySet")) { |
2897 keySet = new KeySet.fromJson(_json["keySet"]); | 2452 keySet = new KeySet.fromJson(_json["keySet"]); |
2898 } | 2453 } |
2899 if (_json.containsKey("table")) { | 2454 if (_json.containsKey("table")) { |
2900 table = _json["table"]; | 2455 table = _json["table"]; |
2901 } | 2456 } |
2902 } | 2457 } |
2903 | 2458 |
2904 core.Map<core.String, core.Object> toJson() { | 2459 core.Map<core.String, core.Object> toJson() { |
2905 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2460 final core.Map<core.String, core.Object> _json = |
| 2461 new core.Map<core.String, core.Object>(); |
2906 if (keySet != null) { | 2462 if (keySet != null) { |
2907 _json["keySet"] = (keySet).toJson(); | 2463 _json["keySet"] = (keySet).toJson(); |
2908 } | 2464 } |
2909 if (table != null) { | 2465 if (table != null) { |
2910 _json["table"] = table; | 2466 _json["table"] = table; |
2911 } | 2467 } |
2912 return _json; | 2468 return _json; |
2913 } | 2469 } |
2914 } | 2470 } |
2915 | 2471 |
2916 /** | 2472 /// A generic empty message that you can re-use to avoid defining duplicated |
2917 * A generic empty message that you can re-use to avoid defining duplicated | 2473 /// empty messages in your APIs. A typical example is to use it as the request |
2918 * empty messages in your APIs. A typical example is to use it as the request | 2474 /// or the response type of an API method. For instance: |
2919 * or the response type of an API method. For instance: | 2475 /// |
2920 * | 2476 /// service Foo { |
2921 * service Foo { | 2477 /// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
2922 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); | 2478 /// } |
2923 * } | 2479 /// |
2924 * | 2480 /// The JSON representation for `Empty` is empty JSON object `{}`. |
2925 * The JSON representation for `Empty` is empty JSON object `{}`. | |
2926 */ | |
2927 class Empty { | 2481 class Empty { |
2928 | |
2929 Empty(); | 2482 Empty(); |
2930 | 2483 |
2931 Empty.fromJson(core.Map _json) { | 2484 Empty.fromJson(core.Map _json) {} |
2932 } | |
2933 | 2485 |
2934 core.Map<core.String, core.Object> toJson() { | 2486 core.Map<core.String, core.Object> toJson() { |
2935 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2487 final core.Map<core.String, core.Object> _json = |
| 2488 new core.Map<core.String, core.Object>(); |
2936 return _json; | 2489 return _json; |
2937 } | 2490 } |
2938 } | 2491 } |
2939 | 2492 |
2940 /** | 2493 /// The request for ExecuteSql and |
2941 * The request for ExecuteSql and | 2494 /// ExecuteStreamingSql. |
2942 * ExecuteStreamingSql. | |
2943 */ | |
2944 class ExecuteSqlRequest { | 2495 class ExecuteSqlRequest { |
2945 /** | 2496 /// It is not always possible for Cloud Spanner to infer the right SQL type |
2946 * It is not always possible for Cloud Spanner to infer the right SQL type | 2497 /// from a JSON value. For example, values of type `BYTES` and values |
2947 * from a JSON value. For example, values of type `BYTES` and values | 2498 /// of type `STRING` both appear in params as JSON strings. |
2948 * of type `STRING` both appear in params as JSON strings. | 2499 /// |
2949 * | 2500 /// In these cases, `param_types` can be used to specify the exact |
2950 * In these cases, `param_types` can be used to specify the exact | 2501 /// SQL type for some or all of the SQL query parameters. See the |
2951 * SQL type for some or all of the SQL query parameters. See the | 2502 /// definition of Type for more information |
2952 * definition of Type for more information | 2503 /// about SQL types. |
2953 * about SQL types. | |
2954 */ | |
2955 core.Map<core.String, Type> paramTypes; | 2504 core.Map<core.String, Type> paramTypes; |
2956 /** | 2505 |
2957 * The SQL query string can contain parameter placeholders. A parameter | 2506 /// The SQL query string can contain parameter placeholders. A parameter |
2958 * placeholder consists of `'@'` followed by the parameter | 2507 /// placeholder consists of `'@'` followed by the parameter |
2959 * name. Parameter names consist of any combination of letters, | 2508 /// name. Parameter names consist of any combination of letters, |
2960 * numbers, and underscores. | 2509 /// numbers, and underscores. |
2961 * | 2510 /// |
2962 * Parameters can appear anywhere that a literal value is expected. The same | 2511 /// Parameters can appear anywhere that a literal value is expected. The |
2963 * parameter name can be used more than once, for example: | 2512 /// same |
2964 * `"WHERE id > @msg_id AND id < @msg_id + 100"` | 2513 /// parameter name can be used more than once, for example: |
2965 * | 2514 /// `"WHERE id > @msg_id AND id < @msg_id + 100"` |
2966 * It is an error to execute an SQL query with unbound parameters. | 2515 /// |
2967 * | 2516 /// It is an error to execute an SQL query with unbound parameters. |
2968 * Parameter values are specified using `params`, which is a JSON | 2517 /// |
2969 * object whose keys are parameter names, and whose values are the | 2518 /// Parameter values are specified using `params`, which is a JSON |
2970 * corresponding parameter values. | 2519 /// object whose keys are parameter names, and whose values are the |
2971 * | 2520 /// corresponding parameter values. |
2972 * The values for Object must be JSON objects. It can consist of `num`, | 2521 /// |
2973 * `String`, `bool` and `null` as well as `Map` and `List` values. | 2522 /// The values for Object must be JSON objects. It can consist of `num`, |
2974 */ | 2523 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
2975 core.Map<core.String, core.Object> params; | 2524 core.Map<core.String, core.Object> params; |
2976 /** | 2525 |
2977 * Used to control the amount of debugging information returned in | 2526 /// Used to control the amount of debugging information returned in |
2978 * ResultSetStats. | 2527 /// ResultSetStats. |
2979 * Possible string values are: | 2528 /// Possible string values are: |
2980 * - "NORMAL" : The default mode where only the query result, without any | 2529 /// - "NORMAL" : The default mode where only the query result, without any |
2981 * information | 2530 /// information |
2982 * about the query plan is returned. | 2531 /// about the query plan is returned. |
2983 * - "PLAN" : This mode returns only the query plan, without any result rows | 2532 /// - "PLAN" : This mode returns only the query plan, without any result rows |
2984 * or | 2533 /// or |
2985 * execution statistics information. | 2534 /// execution statistics information. |
2986 * - "PROFILE" : This mode returns both the query plan and the execution | 2535 /// - "PROFILE" : This mode returns both the query plan and the execution |
2987 * statistics along | 2536 /// statistics along |
2988 * with the result rows. | 2537 /// with the result rows. |
2989 */ | |
2990 core.String queryMode; | 2538 core.String queryMode; |
2991 /** | 2539 |
2992 * If this request is resuming a previously interrupted SQL query | 2540 /// If this request is resuming a previously interrupted SQL query |
2993 * execution, `resume_token` should be copied from the last | 2541 /// execution, `resume_token` should be copied from the last |
2994 * PartialResultSet yielded before the interruption. Doing this | 2542 /// PartialResultSet yielded before the interruption. Doing this |
2995 * enables the new SQL query execution to resume where the last one left | 2543 /// enables the new SQL query execution to resume where the last one left |
2996 * off. The rest of the request parameters must exactly match the | 2544 /// off. The rest of the request parameters must exactly match the |
2997 * request that yielded this token. | 2545 /// request that yielded this token. |
2998 */ | |
2999 core.String resumeToken; | 2546 core.String resumeToken; |
3000 core.List<core.int> get resumeTokenAsBytes { | 2547 core.List<core.int> get resumeTokenAsBytes { |
3001 return convert.BASE64.decode(resumeToken); | 2548 return convert.BASE64.decode(resumeToken); |
3002 } | 2549 } |
3003 | 2550 |
3004 void set resumeTokenAsBytes(core.List<core.int> _bytes) { | 2551 void set resumeTokenAsBytes(core.List<core.int> _bytes) { |
3005 resumeToken = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll(
"+", "-"); | 2552 resumeToken = |
| 2553 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
3006 } | 2554 } |
3007 /** Required. The SQL query string. */ | 2555 |
| 2556 /// Required. The SQL query string. |
3008 core.String sql; | 2557 core.String sql; |
3009 /** | 2558 |
3010 * The transaction to use. If none is provided, the default is a | 2559 /// The transaction to use. If none is provided, the default is a |
3011 * temporary read-only transaction with strong concurrency. | 2560 /// temporary read-only transaction with strong concurrency. |
3012 */ | |
3013 TransactionSelector transaction; | 2561 TransactionSelector transaction; |
3014 | 2562 |
3015 ExecuteSqlRequest(); | 2563 ExecuteSqlRequest(); |
3016 | 2564 |
3017 ExecuteSqlRequest.fromJson(core.Map _json) { | 2565 ExecuteSqlRequest.fromJson(core.Map _json) { |
3018 if (_json.containsKey("paramTypes")) { | 2566 if (_json.containsKey("paramTypes")) { |
3019 paramTypes = commons.mapMap<core.Map<core.String, core.Object>, Type>(_jso
n["paramTypes"], (core.Map<core.String, core.Object> item) => new Type.fromJson(
item)); | 2567 paramTypes = commons.mapMap<core.Map<core.String, core.Object>, Type>( |
| 2568 _json["paramTypes"], |
| 2569 (core.Map<core.String, core.Object> item) => new Type.fromJson(item)); |
3020 } | 2570 } |
3021 if (_json.containsKey("params")) { | 2571 if (_json.containsKey("params")) { |
3022 params = _json["params"]; | 2572 params = _json["params"]; |
3023 } | 2573 } |
3024 if (_json.containsKey("queryMode")) { | 2574 if (_json.containsKey("queryMode")) { |
3025 queryMode = _json["queryMode"]; | 2575 queryMode = _json["queryMode"]; |
3026 } | 2576 } |
3027 if (_json.containsKey("resumeToken")) { | 2577 if (_json.containsKey("resumeToken")) { |
3028 resumeToken = _json["resumeToken"]; | 2578 resumeToken = _json["resumeToken"]; |
3029 } | 2579 } |
3030 if (_json.containsKey("sql")) { | 2580 if (_json.containsKey("sql")) { |
3031 sql = _json["sql"]; | 2581 sql = _json["sql"]; |
3032 } | 2582 } |
3033 if (_json.containsKey("transaction")) { | 2583 if (_json.containsKey("transaction")) { |
3034 transaction = new TransactionSelector.fromJson(_json["transaction"]); | 2584 transaction = new TransactionSelector.fromJson(_json["transaction"]); |
3035 } | 2585 } |
3036 } | 2586 } |
3037 | 2587 |
3038 core.Map<core.String, core.Object> toJson() { | 2588 core.Map<core.String, core.Object> toJson() { |
3039 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2589 final core.Map<core.String, core.Object> _json = |
| 2590 new core.Map<core.String, core.Object>(); |
3040 if (paramTypes != null) { | 2591 if (paramTypes != null) { |
3041 _json["paramTypes"] = commons.mapMap<Type, core.Map<core.String, core.Obje
ct>>(paramTypes, (Type item) => (item).toJson()); | 2592 _json["paramTypes"] = |
| 2593 commons.mapMap<Type, core.Map<core.String, core.Object>>( |
| 2594 paramTypes, (Type item) => (item).toJson()); |
3042 } | 2595 } |
3043 if (params != null) { | 2596 if (params != null) { |
3044 _json["params"] = params; | 2597 _json["params"] = params; |
3045 } | 2598 } |
3046 if (queryMode != null) { | 2599 if (queryMode != null) { |
3047 _json["queryMode"] = queryMode; | 2600 _json["queryMode"] = queryMode; |
3048 } | 2601 } |
3049 if (resumeToken != null) { | 2602 if (resumeToken != null) { |
3050 _json["resumeToken"] = resumeToken; | 2603 _json["resumeToken"] = resumeToken; |
3051 } | 2604 } |
3052 if (sql != null) { | 2605 if (sql != null) { |
3053 _json["sql"] = sql; | 2606 _json["sql"] = sql; |
3054 } | 2607 } |
3055 if (transaction != null) { | 2608 if (transaction != null) { |
3056 _json["transaction"] = (transaction).toJson(); | 2609 _json["transaction"] = (transaction).toJson(); |
3057 } | 2610 } |
3058 return _json; | 2611 return _json; |
3059 } | 2612 } |
3060 } | 2613 } |
3061 | 2614 |
3062 /** | 2615 /// Message representing a single field of a struct. |
3063 * Represents an expression text. Example: | 2616 class Field { |
3064 * | 2617 /// The name of the field. For reads, this is the column name. For |
3065 * title: "User account presence" | 2618 /// SQL queries, it is the column alias (e.g., `"Word"` in the |
3066 * description: "Determines whether the request has a user account" | 2619 /// query `"SELECT 'hello' AS Word"`), or the column name (e.g., |
3067 * expression: "size(request.user) > 0" | 2620 /// `"ColName"` in the query `"SELECT ColName FROM Table"`). Some |
3068 */ | 2621 /// columns might have an empty name (e.g., !"SELECT |
3069 class Expr { | 2622 /// UPPER(ColName)"`). Note that a query result can contain |
3070 /** | 2623 /// multiple fields with the same name. |
3071 * An optional description of the expression. This is a longer text which | 2624 core.String name; |
3072 * describes the expression, e.g. when hovered over it in a UI. | |
3073 */ | |
3074 core.String description; | |
3075 /** | |
3076 * Textual representation of an expression in | |
3077 * Common Expression Language syntax. | |
3078 * | |
3079 * The application context of the containing message determines which | |
3080 * well-known feature set of CEL is supported. | |
3081 */ | |
3082 core.String expression; | |
3083 /** | |
3084 * An optional string indicating the location of the expression for error | |
3085 * reporting, e.g. a file name and a position in the file. | |
3086 */ | |
3087 core.String location; | |
3088 /** | |
3089 * An optional title for the expression, i.e. a short string describing | |
3090 * its purpose. This can be used e.g. in UIs which allow to enter the | |
3091 * expression. | |
3092 */ | |
3093 core.String title; | |
3094 | 2625 |
3095 Expr(); | 2626 /// The type of the field. |
3096 | |
3097 Expr.fromJson(core.Map _json) { | |
3098 if (_json.containsKey("description")) { | |
3099 description = _json["description"]; | |
3100 } | |
3101 if (_json.containsKey("expression")) { | |
3102 expression = _json["expression"]; | |
3103 } | |
3104 if (_json.containsKey("location")) { | |
3105 location = _json["location"]; | |
3106 } | |
3107 if (_json.containsKey("title")) { | |
3108 title = _json["title"]; | |
3109 } | |
3110 } | |
3111 | |
3112 core.Map<core.String, core.Object> toJson() { | |
3113 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
3114 if (description != null) { | |
3115 _json["description"] = description; | |
3116 } | |
3117 if (expression != null) { | |
3118 _json["expression"] = expression; | |
3119 } | |
3120 if (location != null) { | |
3121 _json["location"] = location; | |
3122 } | |
3123 if (title != null) { | |
3124 _json["title"] = title; | |
3125 } | |
3126 return _json; | |
3127 } | |
3128 } | |
3129 | |
3130 /** Message representing a single field of a struct. */ | |
3131 class Field { | |
3132 /** | |
3133 * The name of the field. For reads, this is the column name. For | |
3134 * SQL queries, it is the column alias (e.g., `"Word"` in the | |
3135 * query `"SELECT 'hello' AS Word"`), or the column name (e.g., | |
3136 * `"ColName"` in the query `"SELECT ColName FROM Table"`). Some | |
3137 * columns might have an empty name (e.g., !"SELECT | |
3138 * UPPER(ColName)"`). Note that a query result can contain | |
3139 * multiple fields with the same name. | |
3140 */ | |
3141 core.String name; | |
3142 /** The type of the field. */ | |
3143 Type type; | 2627 Type type; |
3144 | 2628 |
3145 Field(); | 2629 Field(); |
3146 | 2630 |
3147 Field.fromJson(core.Map _json) { | 2631 Field.fromJson(core.Map _json) { |
3148 if (_json.containsKey("name")) { | 2632 if (_json.containsKey("name")) { |
3149 name = _json["name"]; | 2633 name = _json["name"]; |
3150 } | 2634 } |
3151 if (_json.containsKey("type")) { | 2635 if (_json.containsKey("type")) { |
3152 type = new Type.fromJson(_json["type"]); | 2636 type = new Type.fromJson(_json["type"]); |
3153 } | 2637 } |
3154 } | 2638 } |
3155 | 2639 |
3156 core.Map<core.String, core.Object> toJson() { | 2640 core.Map<core.String, core.Object> toJson() { |
3157 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2641 final core.Map<core.String, core.Object> _json = |
| 2642 new core.Map<core.String, core.Object>(); |
3158 if (name != null) { | 2643 if (name != null) { |
3159 _json["name"] = name; | 2644 _json["name"] = name; |
3160 } | 2645 } |
3161 if (type != null) { | 2646 if (type != null) { |
3162 _json["type"] = (type).toJson(); | 2647 _json["type"] = (type).toJson(); |
3163 } | 2648 } |
3164 return _json; | 2649 return _json; |
3165 } | 2650 } |
3166 } | 2651 } |
3167 | 2652 |
3168 /** The response for GetDatabaseDdl. */ | 2653 /// The response for GetDatabaseDdl. |
3169 class GetDatabaseDdlResponse { | 2654 class GetDatabaseDdlResponse { |
3170 /** | 2655 /// A list of formatted DDL statements defining the schema of the database |
3171 * A list of formatted DDL statements defining the schema of the database | 2656 /// specified in the request. |
3172 * specified in the request. | |
3173 */ | |
3174 core.List<core.String> statements; | 2657 core.List<core.String> statements; |
3175 | 2658 |
3176 GetDatabaseDdlResponse(); | 2659 GetDatabaseDdlResponse(); |
3177 | 2660 |
3178 GetDatabaseDdlResponse.fromJson(core.Map _json) { | 2661 GetDatabaseDdlResponse.fromJson(core.Map _json) { |
3179 if (_json.containsKey("statements")) { | 2662 if (_json.containsKey("statements")) { |
3180 statements = _json["statements"]; | 2663 statements = _json["statements"]; |
3181 } | 2664 } |
3182 } | 2665 } |
3183 | 2666 |
3184 core.Map<core.String, core.Object> toJson() { | 2667 core.Map<core.String, core.Object> toJson() { |
3185 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2668 final core.Map<core.String, core.Object> _json = |
| 2669 new core.Map<core.String, core.Object>(); |
3186 if (statements != null) { | 2670 if (statements != null) { |
3187 _json["statements"] = statements; | 2671 _json["statements"] = statements; |
3188 } | 2672 } |
3189 return _json; | 2673 return _json; |
3190 } | 2674 } |
3191 } | 2675 } |
3192 | 2676 |
3193 /** Request message for `GetIamPolicy` method. */ | 2677 /// Request message for `GetIamPolicy` method. |
3194 class GetIamPolicyRequest { | 2678 class GetIamPolicyRequest { |
3195 | |
3196 GetIamPolicyRequest(); | 2679 GetIamPolicyRequest(); |
3197 | 2680 |
3198 GetIamPolicyRequest.fromJson(core.Map _json) { | 2681 GetIamPolicyRequest.fromJson(core.Map _json) {} |
3199 } | |
3200 | 2682 |
3201 core.Map<core.String, core.Object> toJson() { | 2683 core.Map<core.String, core.Object> toJson() { |
3202 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2684 final core.Map<core.String, core.Object> _json = |
| 2685 new core.Map<core.String, core.Object>(); |
3203 return _json; | 2686 return _json; |
3204 } | 2687 } |
3205 } | 2688 } |
3206 | 2689 |
3207 /** | 2690 /// An isolated set of Cloud Spanner resources on which databases can be |
3208 * An isolated set of Cloud Spanner resources on which databases can be hosted. | 2691 /// hosted. |
3209 */ | |
3210 class Instance { | 2692 class Instance { |
3211 /** | 2693 /// Required. The name of the instance's configuration. Values are of the |
3212 * Required. The name of the instance's configuration. Values are of the form | 2694 /// form |
3213 * `projects/<project>/instanceConfigs/<configuration>`. See | 2695 /// `projects/<project>/instanceConfigs/<configuration>`. See |
3214 * also InstanceConfig and | 2696 /// also InstanceConfig and |
3215 * ListInstanceConfigs. | 2697 /// ListInstanceConfigs. |
3216 */ | |
3217 core.String config; | 2698 core.String config; |
3218 /** | 2699 |
3219 * Required. The descriptive name for this instance as it appears in UIs. | 2700 /// Required. The descriptive name for this instance as it appears in UIs. |
3220 * Must be unique per project and between 4 and 30 characters in length. | 2701 /// Must be unique per project and between 4 and 30 characters in length. |
3221 */ | |
3222 core.String displayName; | 2702 core.String displayName; |
3223 /** | 2703 |
3224 * Cloud Labels are a flexible and lightweight mechanism for organizing cloud | 2704 /// Cloud Labels are a flexible and lightweight mechanism for organizing |
3225 * resources into groups that reflect a customer's organizational needs and | 2705 /// cloud |
3226 * deployment strategies. Cloud Labels can be used to filter collections of | 2706 /// resources into groups that reflect a customer's organizational needs and |
3227 * resources. They can be used to control how resource metrics are aggregated. | 2707 /// deployment strategies. Cloud Labels can be used to filter collections of |
3228 * And they can be used as arguments to policy management rules (e.g. route, | 2708 /// resources. They can be used to control how resource metrics are |
3229 * firewall, load balancing, etc.). | 2709 /// aggregated. |
3230 * | 2710 /// And they can be used as arguments to policy management rules (e.g. route, |
3231 * * Label keys must be between 1 and 63 characters long and must conform to | 2711 /// firewall, load balancing, etc.). |
3232 * the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. | 2712 /// |
3233 * * Label values must be between 0 and 63 characters long and must conform | 2713 /// * Label keys must be between 1 and 63 characters long and must conform to |
3234 * to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. | 2714 /// the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. |
3235 * * No more than 64 labels can be associated with a given resource. | 2715 /// * Label values must be between 0 and 63 characters long and must conform |
3236 * | 2716 /// to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. |
3237 * See https://goo.gl/xmQnxf for more information on and examples of labels. | 2717 /// * No more than 64 labels can be associated with a given resource. |
3238 * | 2718 /// |
3239 * If you plan to use labels in your own code, please note that additional | 2719 /// See https://goo.gl/xmQnxf for more information on and examples of labels. |
3240 * characters may be allowed in the future. And so you are advised to use an | 2720 /// |
3241 * internal label representation, such as JSON, which doesn't rely upon | 2721 /// If you plan to use labels in your own code, please note that additional |
3242 * specific characters being disallowed. For example, representing labels | 2722 /// characters may be allowed in the future. And so you are advised to use an |
3243 * as the string: name + "_" + value would prove problematic if we were to | 2723 /// internal label representation, such as JSON, which doesn't rely upon |
3244 * allow "_" in a future release. | 2724 /// specific characters being disallowed. For example, representing labels |
3245 */ | 2725 /// as the string: name + "_" + value would prove problematic if we were to |
| 2726 /// allow "_" in a future release. |
3246 core.Map<core.String, core.String> labels; | 2727 core.Map<core.String, core.String> labels; |
3247 /** | 2728 |
3248 * Required. A unique identifier for the instance, which cannot be changed | 2729 /// Required. A unique identifier for the instance, which cannot be changed |
3249 * after the instance is created. Values are of the form | 2730 /// after the instance is created. Values are of the form |
3250 * `projects/<project>/instances/a-z*[a-z0-9]`. The final | 2731 /// `projects/<project>/instances/a-z*[a-z0-9]`. The final |
3251 * segment of the name must be between 6 and 30 characters in length. | 2732 /// segment of the name must be between 6 and 30 characters in length. |
3252 */ | |
3253 core.String name; | 2733 core.String name; |
3254 /** | 2734 |
3255 * Required. The number of nodes allocated to this instance. This may be zero | 2735 /// Required. The number of nodes allocated to this instance. This may be |
3256 * in API responses for instances that are not yet in state `READY`. | 2736 /// zero |
3257 * | 2737 /// in API responses for instances that are not yet in state `READY`. |
3258 * Each Spanner node can provide up to 10,000 QPS of reads or 2000 QPS of | 2738 /// |
3259 * writes (writing single rows at 1KB data per row), and 2 TiB storage. | 2739 /// Each Spanner node can provide up to 10,000 QPS of reads or 2000 QPS of |
3260 * | 2740 /// writes (writing single rows at 1KB data per row), and 2 TiB storage. |
3261 * For optimal performance, we recommend provisioning enough nodes to keep | 2741 /// |
3262 * overall CPU utilization under 75%. | 2742 /// For optimal performance, we recommend provisioning enough nodes to keep |
3263 * | 2743 /// overall CPU utilization under 75%. |
3264 * A minimum of 3 nodes is recommended for production environments. This | 2744 /// |
3265 * minimum is required for SLAs to apply to your instance. | 2745 /// A minimum of 3 nodes is recommended for production environments. This |
3266 * | 2746 /// minimum is required for SLAs to apply to your instance. |
3267 * Note that Cloud Spanner performance is highly dependent on workload, schema | 2747 /// |
3268 * design, and dataset characteristics. The performance numbers above are | 2748 /// Note that Cloud Spanner performance is highly dependent on workload, |
3269 * estimates, and assume [best | 2749 /// schema |
3270 * practices](https://cloud.google.com/spanner/docs/bulk-loading) | 2750 /// design, and dataset characteristics. The performance numbers above are |
3271 * are followed. | 2751 /// estimates, and assume [best |
3272 */ | 2752 /// practices](https://cloud.google.com/spanner/docs/bulk-loading) |
| 2753 /// are followed. |
3273 core.int nodeCount; | 2754 core.int nodeCount; |
3274 /** | 2755 |
3275 * Output only. The current instance state. For | 2756 /// Output only. The current instance state. For |
3276 * CreateInstance, the state must be | 2757 /// CreateInstance, the state must be |
3277 * either omitted or set to `CREATING`. For | 2758 /// either omitted or set to `CREATING`. For |
3278 * UpdateInstance, the state must be | 2759 /// UpdateInstance, the state must be |
3279 * either omitted or set to `READY`. | 2760 /// either omitted or set to `READY`. |
3280 * Possible string values are: | 2761 /// Possible string values are: |
3281 * - "STATE_UNSPECIFIED" : Not specified. | 2762 /// - "STATE_UNSPECIFIED" : Not specified. |
3282 * - "CREATING" : The instance is still being created. Resources may not be | 2763 /// - "CREATING" : The instance is still being created. Resources may not be |
3283 * available yet, and operations such as database creation may not | 2764 /// available yet, and operations such as database creation may not |
3284 * work. | 2765 /// work. |
3285 * - "READY" : The instance is fully created and ready to do work such as | 2766 /// - "READY" : The instance is fully created and ready to do work such as |
3286 * creating databases. | 2767 /// creating databases. |
3287 */ | |
3288 core.String state; | 2768 core.String state; |
3289 | 2769 |
3290 Instance(); | 2770 Instance(); |
3291 | 2771 |
3292 Instance.fromJson(core.Map _json) { | 2772 Instance.fromJson(core.Map _json) { |
3293 if (_json.containsKey("config")) { | 2773 if (_json.containsKey("config")) { |
3294 config = _json["config"]; | 2774 config = _json["config"]; |
3295 } | 2775 } |
3296 if (_json.containsKey("displayName")) { | 2776 if (_json.containsKey("displayName")) { |
3297 displayName = _json["displayName"]; | 2777 displayName = _json["displayName"]; |
3298 } | 2778 } |
3299 if (_json.containsKey("labels")) { | 2779 if (_json.containsKey("labels")) { |
3300 labels = _json["labels"]; | 2780 labels = _json["labels"]; |
3301 } | 2781 } |
3302 if (_json.containsKey("name")) { | 2782 if (_json.containsKey("name")) { |
3303 name = _json["name"]; | 2783 name = _json["name"]; |
3304 } | 2784 } |
3305 if (_json.containsKey("nodeCount")) { | 2785 if (_json.containsKey("nodeCount")) { |
3306 nodeCount = _json["nodeCount"]; | 2786 nodeCount = _json["nodeCount"]; |
3307 } | 2787 } |
3308 if (_json.containsKey("state")) { | 2788 if (_json.containsKey("state")) { |
3309 state = _json["state"]; | 2789 state = _json["state"]; |
3310 } | 2790 } |
3311 } | 2791 } |
3312 | 2792 |
3313 core.Map<core.String, core.Object> toJson() { | 2793 core.Map<core.String, core.Object> toJson() { |
3314 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2794 final core.Map<core.String, core.Object> _json = |
| 2795 new core.Map<core.String, core.Object>(); |
3315 if (config != null) { | 2796 if (config != null) { |
3316 _json["config"] = config; | 2797 _json["config"] = config; |
3317 } | 2798 } |
3318 if (displayName != null) { | 2799 if (displayName != null) { |
3319 _json["displayName"] = displayName; | 2800 _json["displayName"] = displayName; |
3320 } | 2801 } |
3321 if (labels != null) { | 2802 if (labels != null) { |
3322 _json["labels"] = labels; | 2803 _json["labels"] = labels; |
3323 } | 2804 } |
3324 if (name != null) { | 2805 if (name != null) { |
3325 _json["name"] = name; | 2806 _json["name"] = name; |
3326 } | 2807 } |
3327 if (nodeCount != null) { | 2808 if (nodeCount != null) { |
3328 _json["nodeCount"] = nodeCount; | 2809 _json["nodeCount"] = nodeCount; |
3329 } | 2810 } |
3330 if (state != null) { | 2811 if (state != null) { |
3331 _json["state"] = state; | 2812 _json["state"] = state; |
3332 } | 2813 } |
3333 return _json; | 2814 return _json; |
3334 } | 2815 } |
3335 } | 2816 } |
3336 | 2817 |
3337 /** | 2818 /// A possible configuration for a Cloud Spanner instance. Configurations |
3338 * A possible configuration for a Cloud Spanner instance. Configurations | 2819 /// define the geographic placement of nodes and their replication. |
3339 * define the geographic placement of nodes and their replication. | |
3340 */ | |
3341 class InstanceConfig { | 2820 class InstanceConfig { |
3342 /** The name of this instance configuration as it appears in UIs. */ | 2821 /// The name of this instance configuration as it appears in UIs. |
3343 core.String displayName; | 2822 core.String displayName; |
3344 /** | 2823 |
3345 * A unique identifier for the instance configuration. Values | 2824 /// A unique identifier for the instance configuration. Values |
3346 * are of the form | 2825 /// are of the form |
3347 * `projects/<project>/instanceConfigs/a-z*` | 2826 /// `projects/<project>/instanceConfigs/a-z*` |
3348 */ | |
3349 core.String name; | 2827 core.String name; |
3350 | 2828 |
3351 InstanceConfig(); | 2829 InstanceConfig(); |
3352 | 2830 |
3353 InstanceConfig.fromJson(core.Map _json) { | 2831 InstanceConfig.fromJson(core.Map _json) { |
3354 if (_json.containsKey("displayName")) { | 2832 if (_json.containsKey("displayName")) { |
3355 displayName = _json["displayName"]; | 2833 displayName = _json["displayName"]; |
3356 } | 2834 } |
3357 if (_json.containsKey("name")) { | 2835 if (_json.containsKey("name")) { |
3358 name = _json["name"]; | 2836 name = _json["name"]; |
3359 } | 2837 } |
3360 } | 2838 } |
3361 | 2839 |
3362 core.Map<core.String, core.Object> toJson() { | 2840 core.Map<core.String, core.Object> toJson() { |
3363 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2841 final core.Map<core.String, core.Object> _json = |
| 2842 new core.Map<core.String, core.Object>(); |
3364 if (displayName != null) { | 2843 if (displayName != null) { |
3365 _json["displayName"] = displayName; | 2844 _json["displayName"] = displayName; |
3366 } | 2845 } |
3367 if (name != null) { | 2846 if (name != null) { |
3368 _json["name"] = name; | 2847 _json["name"] = name; |
3369 } | 2848 } |
3370 return _json; | 2849 return _json; |
3371 } | 2850 } |
3372 } | 2851 } |
3373 | 2852 |
3374 /** | 2853 /// KeyRange represents a range of rows in a table or index. |
3375 * KeyRange represents a range of rows in a table or index. | 2854 /// |
3376 * | 2855 /// A range has a start key and an end key. These keys can be open or |
3377 * A range has a start key and an end key. These keys can be open or | 2856 /// closed, indicating if the range includes rows with that key. |
3378 * closed, indicating if the range includes rows with that key. | 2857 /// |
3379 * | 2858 /// Keys are represented by lists, where the ith value in the list |
3380 * Keys are represented by lists, where the ith value in the list | 2859 /// corresponds to the ith component of the table or index primary key. |
3381 * corresponds to the ith component of the table or index primary key. | 2860 /// Individual values are encoded as described here. |
3382 * Individual values are encoded as described here. | 2861 /// |
3383 * | 2862 /// For example, consider the following table definition: |
3384 * For example, consider the following table definition: | 2863 /// |
3385 * | 2864 /// CREATE TABLE UserEvents ( |
3386 * CREATE TABLE UserEvents ( | 2865 /// UserName STRING(MAX), |
3387 * UserName STRING(MAX), | 2866 /// EventDate STRING(10) |
3388 * EventDate STRING(10) | 2867 /// ) PRIMARY KEY(UserName, EventDate); |
3389 * ) PRIMARY KEY(UserName, EventDate); | 2868 /// |
3390 * | 2869 /// The following keys name rows in this table: |
3391 * The following keys name rows in this table: | 2870 /// |
3392 * | 2871 /// "Bob", "2014-09-23" |
3393 * "Bob", "2014-09-23" | 2872 /// |
3394 * | 2873 /// Since the `UserEvents` table's `PRIMARY KEY` clause names two |
3395 * Since the `UserEvents` table's `PRIMARY KEY` clause names two | 2874 /// columns, each `UserEvents` key has two elements; the first is the |
3396 * columns, each `UserEvents` key has two elements; the first is the | 2875 /// `UserName`, and the second is the `EventDate`. |
3397 * `UserName`, and the second is the `EventDate`. | 2876 /// |
3398 * | 2877 /// Key ranges with multiple components are interpreted |
3399 * Key ranges with multiple components are interpreted | 2878 /// lexicographically by component using the table or index key's declared |
3400 * lexicographically by component using the table or index key's declared | 2879 /// sort order. For example, the following range returns all events for |
3401 * sort order. For example, the following range returns all events for | 2880 /// user `"Bob"` that occurred in the year 2015: |
3402 * user `"Bob"` that occurred in the year 2015: | 2881 /// |
3403 * | 2882 /// "start_closed": ["Bob", "2015-01-01"] |
3404 * "start_closed": ["Bob", "2015-01-01"] | 2883 /// "end_closed": ["Bob", "2015-12-31"] |
3405 * "end_closed": ["Bob", "2015-12-31"] | 2884 /// |
3406 * | 2885 /// Start and end keys can omit trailing key components. This affects the |
3407 * Start and end keys can omit trailing key components. This affects the | 2886 /// inclusion and exclusion of rows that exactly match the provided key |
3408 * inclusion and exclusion of rows that exactly match the provided key | 2887 /// components: if the key is closed, then rows that exactly match the |
3409 * components: if the key is closed, then rows that exactly match the | 2888 /// provided components are included; if the key is open, then rows |
3410 * provided components are included; if the key is open, then rows | 2889 /// that exactly match are not included. |
3411 * that exactly match are not included. | 2890 /// |
3412 * | 2891 /// For example, the following range includes all events for `"Bob"` that |
3413 * For example, the following range includes all events for `"Bob"` that | 2892 /// occurred during and after the year 2000: |
3414 * occurred during and after the year 2000: | 2893 /// |
3415 * | 2894 /// "start_closed": ["Bob", "2000-01-01"] |
3416 * "start_closed": ["Bob", "2000-01-01"] | 2895 /// "end_closed": ["Bob"] |
3417 * "end_closed": ["Bob"] | 2896 /// |
3418 * | 2897 /// The next example retrieves all events for `"Bob"`: |
3419 * The next example retrieves all events for `"Bob"`: | 2898 /// |
3420 * | 2899 /// "start_closed": ["Bob"] |
3421 * "start_closed": ["Bob"] | 2900 /// "end_closed": ["Bob"] |
3422 * "end_closed": ["Bob"] | 2901 /// |
3423 * | 2902 /// To retrieve events before the year 2000: |
3424 * To retrieve events before the year 2000: | 2903 /// |
3425 * | 2904 /// "start_closed": ["Bob"] |
3426 * "start_closed": ["Bob"] | 2905 /// "end_open": ["Bob", "2000-01-01"] |
3427 * "end_open": ["Bob", "2000-01-01"] | 2906 /// |
3428 * | 2907 /// The following range includes all rows in the table: |
3429 * The following range includes all rows in the table: | 2908 /// |
3430 * | 2909 /// "start_closed": [] |
3431 * "start_closed": [] | 2910 /// "end_closed": [] |
3432 * "end_closed": [] | 2911 /// |
3433 * | 2912 /// This range returns all users whose `UserName` begins with any |
3434 * This range returns all users whose `UserName` begins with any | 2913 /// character from A to C: |
3435 * character from A to C: | 2914 /// |
3436 * | 2915 /// "start_closed": ["A"] |
3437 * "start_closed": ["A"] | 2916 /// "end_open": ["D"] |
3438 * "end_open": ["D"] | 2917 /// |
3439 * | 2918 /// This range returns all users whose `UserName` begins with B: |
3440 * This range returns all users whose `UserName` begins with B: | 2919 /// |
3441 * | 2920 /// "start_closed": ["B"] |
3442 * "start_closed": ["B"] | 2921 /// "end_open": ["C"] |
3443 * "end_open": ["C"] | 2922 /// |
3444 * | 2923 /// Key ranges honor column sort order. For example, suppose a table is |
3445 * Key ranges honor column sort order. For example, suppose a table is | 2924 /// defined as follows: |
3446 * defined as follows: | 2925 /// |
3447 * | 2926 /// CREATE TABLE DescendingSortedTable { |
3448 * CREATE TABLE DescendingSortedTable { | 2927 /// Key INT64, |
3449 * Key INT64, | 2928 /// ... |
3450 * ... | 2929 /// ) PRIMARY KEY(Key DESC); |
3451 * ) PRIMARY KEY(Key DESC); | 2930 /// |
3452 * | 2931 /// The following range retrieves all rows with key values between 1 |
3453 * The following range retrieves all rows with key values between 1 | 2932 /// and 100 inclusive: |
3454 * and 100 inclusive: | 2933 /// |
3455 * | 2934 /// "start_closed": ["100"] |
3456 * "start_closed": ["100"] | 2935 /// "end_closed": ["1"] |
3457 * "end_closed": ["1"] | 2936 /// |
3458 * | 2937 /// Note that 100 is passed as the start, and 1 is passed as the end, |
3459 * Note that 100 is passed as the start, and 1 is passed as the end, | 2938 /// because `Key` is a descending column in the schema. |
3460 * because `Key` is a descending column in the schema. | |
3461 */ | |
3462 class KeyRange { | 2939 class KeyRange { |
3463 /** | 2940 /// If the end is closed, then the range includes all rows whose |
3464 * If the end is closed, then the range includes all rows whose | 2941 /// first `len(end_closed)` key columns exactly match `end_closed`. |
3465 * first `len(end_closed)` key columns exactly match `end_closed`. | 2942 /// |
3466 * | 2943 /// The values for Object must be JSON objects. It can consist of `num`, |
3467 * The values for Object must be JSON objects. It can consist of `num`, | 2944 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
3468 * `String`, `bool` and `null` as well as `Map` and `List` values. | |
3469 */ | |
3470 core.List<core.Object> endClosed; | 2945 core.List<core.Object> endClosed; |
3471 /** | 2946 |
3472 * If the end is open, then the range excludes rows whose first | 2947 /// If the end is open, then the range excludes rows whose first |
3473 * `len(end_open)` key columns exactly match `end_open`. | 2948 /// `len(end_open)` key columns exactly match `end_open`. |
3474 * | 2949 /// |
3475 * The values for Object must be JSON objects. It can consist of `num`, | 2950 /// The values for Object must be JSON objects. It can consist of `num`, |
3476 * `String`, `bool` and `null` as well as `Map` and `List` values. | 2951 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
3477 */ | |
3478 core.List<core.Object> endOpen; | 2952 core.List<core.Object> endOpen; |
3479 /** | 2953 |
3480 * If the start is closed, then the range includes all rows whose | 2954 /// If the start is closed, then the range includes all rows whose |
3481 * first `len(start_closed)` key columns exactly match `start_closed`. | 2955 /// first `len(start_closed)` key columns exactly match `start_closed`. |
3482 * | 2956 /// |
3483 * The values for Object must be JSON objects. It can consist of `num`, | 2957 /// The values for Object must be JSON objects. It can consist of `num`, |
3484 * `String`, `bool` and `null` as well as `Map` and `List` values. | 2958 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
3485 */ | |
3486 core.List<core.Object> startClosed; | 2959 core.List<core.Object> startClosed; |
3487 /** | 2960 |
3488 * If the start is open, then the range excludes rows whose first | 2961 /// If the start is open, then the range excludes rows whose first |
3489 * `len(start_open)` key columns exactly match `start_open`. | 2962 /// `len(start_open)` key columns exactly match `start_open`. |
3490 * | 2963 /// |
3491 * The values for Object must be JSON objects. It can consist of `num`, | 2964 /// The values for Object must be JSON objects. It can consist of `num`, |
3492 * `String`, `bool` and `null` as well as `Map` and `List` values. | 2965 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
3493 */ | |
3494 core.List<core.Object> startOpen; | 2966 core.List<core.Object> startOpen; |
3495 | 2967 |
3496 KeyRange(); | 2968 KeyRange(); |
3497 | 2969 |
3498 KeyRange.fromJson(core.Map _json) { | 2970 KeyRange.fromJson(core.Map _json) { |
3499 if (_json.containsKey("endClosed")) { | 2971 if (_json.containsKey("endClosed")) { |
3500 endClosed = _json["endClosed"]; | 2972 endClosed = _json["endClosed"]; |
3501 } | 2973 } |
3502 if (_json.containsKey("endOpen")) { | 2974 if (_json.containsKey("endOpen")) { |
3503 endOpen = _json["endOpen"]; | 2975 endOpen = _json["endOpen"]; |
3504 } | 2976 } |
3505 if (_json.containsKey("startClosed")) { | 2977 if (_json.containsKey("startClosed")) { |
3506 startClosed = _json["startClosed"]; | 2978 startClosed = _json["startClosed"]; |
3507 } | 2979 } |
3508 if (_json.containsKey("startOpen")) { | 2980 if (_json.containsKey("startOpen")) { |
3509 startOpen = _json["startOpen"]; | 2981 startOpen = _json["startOpen"]; |
3510 } | 2982 } |
3511 } | 2983 } |
3512 | 2984 |
3513 core.Map<core.String, core.Object> toJson() { | 2985 core.Map<core.String, core.Object> toJson() { |
3514 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2986 final core.Map<core.String, core.Object> _json = |
| 2987 new core.Map<core.String, core.Object>(); |
3515 if (endClosed != null) { | 2988 if (endClosed != null) { |
3516 _json["endClosed"] = endClosed; | 2989 _json["endClosed"] = endClosed; |
3517 } | 2990 } |
3518 if (endOpen != null) { | 2991 if (endOpen != null) { |
3519 _json["endOpen"] = endOpen; | 2992 _json["endOpen"] = endOpen; |
3520 } | 2993 } |
3521 if (startClosed != null) { | 2994 if (startClosed != null) { |
3522 _json["startClosed"] = startClosed; | 2995 _json["startClosed"] = startClosed; |
3523 } | 2996 } |
3524 if (startOpen != null) { | 2997 if (startOpen != null) { |
3525 _json["startOpen"] = startOpen; | 2998 _json["startOpen"] = startOpen; |
3526 } | 2999 } |
3527 return _json; | 3000 return _json; |
3528 } | 3001 } |
3529 } | 3002 } |
3530 | 3003 |
3531 /** | 3004 /// `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All |
3532 * `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All | 3005 /// the keys are expected to be in the same table or index. The keys need |
3533 * the keys are expected to be in the same table or index. The keys need | 3006 /// not be sorted in any particular way. |
3534 * not be sorted in any particular way. | 3007 /// |
3535 * | 3008 /// If the same key is specified multiple times in the set (for example |
3536 * If the same key is specified multiple times in the set (for example | 3009 /// if two ranges, two keys, or a key and a range overlap), Cloud Spanner |
3537 * if two ranges, two keys, or a key and a range overlap), Cloud Spanner | 3010 /// behaves as if the key were only specified once. |
3538 * behaves as if the key were only specified once. | |
3539 */ | |
3540 class KeySet { | 3011 class KeySet { |
3541 /** | 3012 /// For convenience `all` can be set to `true` to indicate that this |
3542 * For convenience `all` can be set to `true` to indicate that this | 3013 /// `KeySet` matches all keys in the table or index. Note that any keys |
3543 * `KeySet` matches all keys in the table or index. Note that any keys | 3014 /// specified in `keys` or `ranges` are only yielded once. |
3544 * specified in `keys` or `ranges` are only yielded once. | |
3545 */ | |
3546 core.bool all; | 3015 core.bool all; |
3547 /** | 3016 |
3548 * A list of specific keys. Entries in `keys` should have exactly as | 3017 /// A list of specific keys. Entries in `keys` should have exactly as |
3549 * many elements as there are columns in the primary or index key | 3018 /// many elements as there are columns in the primary or index key |
3550 * with which this `KeySet` is used. Individual key values are | 3019 /// with which this `KeySet` is used. Individual key values are |
3551 * encoded as described here. | 3020 /// encoded as described here. |
3552 * | 3021 /// |
3553 * The values for Object must be JSON objects. It can consist of `num`, | 3022 /// The values for Object must be JSON objects. It can consist of `num`, |
3554 * `String`, `bool` and `null` as well as `Map` and `List` values. | 3023 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
3555 */ | |
3556 core.List<core.List<core.Object>> keys; | 3024 core.List<core.List<core.Object>> keys; |
3557 /** | 3025 |
3558 * A list of key ranges. See KeyRange for more information about | 3026 /// A list of key ranges. See KeyRange for more information about |
3559 * key range specifications. | 3027 /// key range specifications. |
3560 */ | |
3561 core.List<KeyRange> ranges; | 3028 core.List<KeyRange> ranges; |
3562 | 3029 |
3563 KeySet(); | 3030 KeySet(); |
3564 | 3031 |
3565 KeySet.fromJson(core.Map _json) { | 3032 KeySet.fromJson(core.Map _json) { |
3566 if (_json.containsKey("all")) { | 3033 if (_json.containsKey("all")) { |
3567 all = _json["all"]; | 3034 all = _json["all"]; |
3568 } | 3035 } |
3569 if (_json.containsKey("keys")) { | 3036 if (_json.containsKey("keys")) { |
3570 keys = _json["keys"]; | 3037 keys = _json["keys"]; |
3571 } | 3038 } |
3572 if (_json.containsKey("ranges")) { | 3039 if (_json.containsKey("ranges")) { |
3573 ranges = _json["ranges"].map((value) => new KeyRange.fromJson(value)).toLi
st(); | 3040 ranges = |
| 3041 _json["ranges"].map((value) => new KeyRange.fromJson(value)).toList(); |
3574 } | 3042 } |
3575 } | 3043 } |
3576 | 3044 |
3577 core.Map<core.String, core.Object> toJson() { | 3045 core.Map<core.String, core.Object> toJson() { |
3578 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3046 final core.Map<core.String, core.Object> _json = |
| 3047 new core.Map<core.String, core.Object>(); |
3579 if (all != null) { | 3048 if (all != null) { |
3580 _json["all"] = all; | 3049 _json["all"] = all; |
3581 } | 3050 } |
3582 if (keys != null) { | 3051 if (keys != null) { |
3583 _json["keys"] = keys; | 3052 _json["keys"] = keys; |
3584 } | 3053 } |
3585 if (ranges != null) { | 3054 if (ranges != null) { |
3586 _json["ranges"] = ranges.map((value) => (value).toJson()).toList(); | 3055 _json["ranges"] = ranges.map((value) => (value).toJson()).toList(); |
3587 } | 3056 } |
3588 return _json; | 3057 return _json; |
3589 } | 3058 } |
3590 } | 3059 } |
3591 | 3060 |
3592 /** The response for ListDatabases. */ | 3061 /// The response for ListDatabases. |
3593 class ListDatabasesResponse { | 3062 class ListDatabasesResponse { |
3594 /** Databases that matched the request. */ | 3063 /// Databases that matched the request. |
3595 core.List<Database> databases; | 3064 core.List<Database> databases; |
3596 /** | 3065 |
3597 * `next_page_token` can be sent in a subsequent | 3066 /// `next_page_token` can be sent in a subsequent |
3598 * ListDatabases call to fetch more | 3067 /// ListDatabases call to fetch more |
3599 * of the matching databases. | 3068 /// of the matching databases. |
3600 */ | |
3601 core.String nextPageToken; | 3069 core.String nextPageToken; |
3602 | 3070 |
3603 ListDatabasesResponse(); | 3071 ListDatabasesResponse(); |
3604 | 3072 |
3605 ListDatabasesResponse.fromJson(core.Map _json) { | 3073 ListDatabasesResponse.fromJson(core.Map _json) { |
3606 if (_json.containsKey("databases")) { | 3074 if (_json.containsKey("databases")) { |
3607 databases = _json["databases"].map((value) => new Database.fromJson(value)
).toList(); | 3075 databases = _json["databases"] |
| 3076 .map((value) => new Database.fromJson(value)) |
| 3077 .toList(); |
3608 } | 3078 } |
3609 if (_json.containsKey("nextPageToken")) { | 3079 if (_json.containsKey("nextPageToken")) { |
3610 nextPageToken = _json["nextPageToken"]; | 3080 nextPageToken = _json["nextPageToken"]; |
3611 } | 3081 } |
3612 } | 3082 } |
3613 | 3083 |
3614 core.Map<core.String, core.Object> toJson() { | 3084 core.Map<core.String, core.Object> toJson() { |
3615 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3085 final core.Map<core.String, core.Object> _json = |
| 3086 new core.Map<core.String, core.Object>(); |
3616 if (databases != null) { | 3087 if (databases != null) { |
3617 _json["databases"] = databases.map((value) => (value).toJson()).toList(); | 3088 _json["databases"] = databases.map((value) => (value).toJson()).toList(); |
3618 } | 3089 } |
3619 if (nextPageToken != null) { | 3090 if (nextPageToken != null) { |
3620 _json["nextPageToken"] = nextPageToken; | 3091 _json["nextPageToken"] = nextPageToken; |
3621 } | 3092 } |
3622 return _json; | 3093 return _json; |
3623 } | 3094 } |
3624 } | 3095 } |
3625 | 3096 |
3626 /** The response for ListInstanceConfigs. */ | 3097 /// The response for ListInstanceConfigs. |
3627 class ListInstanceConfigsResponse { | 3098 class ListInstanceConfigsResponse { |
3628 /** The list of requested instance configurations. */ | 3099 /// The list of requested instance configurations. |
3629 core.List<InstanceConfig> instanceConfigs; | 3100 core.List<InstanceConfig> instanceConfigs; |
3630 /** | 3101 |
3631 * `next_page_token` can be sent in a subsequent | 3102 /// `next_page_token` can be sent in a subsequent |
3632 * ListInstanceConfigs call to | 3103 /// ListInstanceConfigs call to |
3633 * fetch more of the matching instance configurations. | 3104 /// fetch more of the matching instance configurations. |
3634 */ | |
3635 core.String nextPageToken; | 3105 core.String nextPageToken; |
3636 | 3106 |
3637 ListInstanceConfigsResponse(); | 3107 ListInstanceConfigsResponse(); |
3638 | 3108 |
3639 ListInstanceConfigsResponse.fromJson(core.Map _json) { | 3109 ListInstanceConfigsResponse.fromJson(core.Map _json) { |
3640 if (_json.containsKey("instanceConfigs")) { | 3110 if (_json.containsKey("instanceConfigs")) { |
3641 instanceConfigs = _json["instanceConfigs"].map((value) => new InstanceConf
ig.fromJson(value)).toList(); | 3111 instanceConfigs = _json["instanceConfigs"] |
| 3112 .map((value) => new InstanceConfig.fromJson(value)) |
| 3113 .toList(); |
3642 } | 3114 } |
3643 if (_json.containsKey("nextPageToken")) { | 3115 if (_json.containsKey("nextPageToken")) { |
3644 nextPageToken = _json["nextPageToken"]; | 3116 nextPageToken = _json["nextPageToken"]; |
3645 } | 3117 } |
3646 } | 3118 } |
3647 | 3119 |
3648 core.Map<core.String, core.Object> toJson() { | 3120 core.Map<core.String, core.Object> toJson() { |
3649 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3121 final core.Map<core.String, core.Object> _json = |
| 3122 new core.Map<core.String, core.Object>(); |
3650 if (instanceConfigs != null) { | 3123 if (instanceConfigs != null) { |
3651 _json["instanceConfigs"] = instanceConfigs.map((value) => (value).toJson()
).toList(); | 3124 _json["instanceConfigs"] = |
| 3125 instanceConfigs.map((value) => (value).toJson()).toList(); |
3652 } | 3126 } |
3653 if (nextPageToken != null) { | 3127 if (nextPageToken != null) { |
3654 _json["nextPageToken"] = nextPageToken; | 3128 _json["nextPageToken"] = nextPageToken; |
3655 } | 3129 } |
3656 return _json; | 3130 return _json; |
3657 } | 3131 } |
3658 } | 3132 } |
3659 | 3133 |
3660 /** The response for ListInstances. */ | 3134 /// The response for ListInstances. |
3661 class ListInstancesResponse { | 3135 class ListInstancesResponse { |
3662 /** The list of requested instances. */ | 3136 /// The list of requested instances. |
3663 core.List<Instance> instances; | 3137 core.List<Instance> instances; |
3664 /** | 3138 |
3665 * `next_page_token` can be sent in a subsequent | 3139 /// `next_page_token` can be sent in a subsequent |
3666 * ListInstances call to fetch more | 3140 /// ListInstances call to fetch more |
3667 * of the matching instances. | 3141 /// of the matching instances. |
3668 */ | |
3669 core.String nextPageToken; | 3142 core.String nextPageToken; |
3670 | 3143 |
3671 ListInstancesResponse(); | 3144 ListInstancesResponse(); |
3672 | 3145 |
3673 ListInstancesResponse.fromJson(core.Map _json) { | 3146 ListInstancesResponse.fromJson(core.Map _json) { |
3674 if (_json.containsKey("instances")) { | 3147 if (_json.containsKey("instances")) { |
3675 instances = _json["instances"].map((value) => new Instance.fromJson(value)
).toList(); | 3148 instances = _json["instances"] |
| 3149 .map((value) => new Instance.fromJson(value)) |
| 3150 .toList(); |
3676 } | 3151 } |
3677 if (_json.containsKey("nextPageToken")) { | 3152 if (_json.containsKey("nextPageToken")) { |
3678 nextPageToken = _json["nextPageToken"]; | 3153 nextPageToken = _json["nextPageToken"]; |
3679 } | 3154 } |
3680 } | 3155 } |
3681 | 3156 |
3682 core.Map<core.String, core.Object> toJson() { | 3157 core.Map<core.String, core.Object> toJson() { |
3683 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3158 final core.Map<core.String, core.Object> _json = |
| 3159 new core.Map<core.String, core.Object>(); |
3684 if (instances != null) { | 3160 if (instances != null) { |
3685 _json["instances"] = instances.map((value) => (value).toJson()).toList(); | 3161 _json["instances"] = instances.map((value) => (value).toJson()).toList(); |
3686 } | 3162 } |
3687 if (nextPageToken != null) { | 3163 if (nextPageToken != null) { |
3688 _json["nextPageToken"] = nextPageToken; | 3164 _json["nextPageToken"] = nextPageToken; |
3689 } | 3165 } |
3690 return _json; | 3166 return _json; |
3691 } | 3167 } |
3692 } | 3168 } |
3693 | 3169 |
3694 /** The response message for Operations.ListOperations. */ | 3170 /// The response message for Operations.ListOperations. |
3695 class ListOperationsResponse { | 3171 class ListOperationsResponse { |
3696 /** The standard List next-page token. */ | 3172 /// The standard List next-page token. |
3697 core.String nextPageToken; | 3173 core.String nextPageToken; |
3698 /** A list of operations that matches the specified filter in the request. */ | 3174 |
| 3175 /// A list of operations that matches the specified filter in the request. |
3699 core.List<Operation> operations; | 3176 core.List<Operation> operations; |
3700 | 3177 |
3701 ListOperationsResponse(); | 3178 ListOperationsResponse(); |
3702 | 3179 |
3703 ListOperationsResponse.fromJson(core.Map _json) { | 3180 ListOperationsResponse.fromJson(core.Map _json) { |
3704 if (_json.containsKey("nextPageToken")) { | 3181 if (_json.containsKey("nextPageToken")) { |
3705 nextPageToken = _json["nextPageToken"]; | 3182 nextPageToken = _json["nextPageToken"]; |
3706 } | 3183 } |
3707 if (_json.containsKey("operations")) { | 3184 if (_json.containsKey("operations")) { |
3708 operations = _json["operations"].map((value) => new Operation.fromJson(val
ue)).toList(); | 3185 operations = _json["operations"] |
| 3186 .map((value) => new Operation.fromJson(value)) |
| 3187 .toList(); |
3709 } | 3188 } |
3710 } | 3189 } |
3711 | 3190 |
3712 core.Map<core.String, core.Object> toJson() { | 3191 core.Map<core.String, core.Object> toJson() { |
3713 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3192 final core.Map<core.String, core.Object> _json = |
| 3193 new core.Map<core.String, core.Object>(); |
3714 if (nextPageToken != null) { | 3194 if (nextPageToken != null) { |
3715 _json["nextPageToken"] = nextPageToken; | 3195 _json["nextPageToken"] = nextPageToken; |
3716 } | 3196 } |
3717 if (operations != null) { | 3197 if (operations != null) { |
3718 _json["operations"] = operations.map((value) => (value).toJson()).toList()
; | 3198 _json["operations"] = |
| 3199 operations.map((value) => (value).toJson()).toList(); |
3719 } | 3200 } |
3720 return _json; | 3201 return _json; |
3721 } | 3202 } |
3722 } | 3203 } |
3723 | 3204 |
3724 /** | 3205 /// A modification to one or more Cloud Spanner rows. Mutations can be |
3725 * Specifies what kind of log the caller must write | 3206 /// applied to a Cloud Spanner database by sending them in a |
3726 * Increment a streamz counter with the specified metric and field names. | 3207 /// Commit call. |
3727 * | 3208 class Mutation { |
3728 * Metric names should start with a '/', generally be lowercase-only, | 3209 /// Delete rows from a table. Succeeds whether or not the named |
3729 * and end in "_count". Field names should not contain an initial slash. | 3210 /// rows were present. |
3730 * The actual exported metric names will have "/iam/policy" prepended. | 3211 Delete delete; |
3731 * | |
3732 * Field names correspond to IAM request parameters and field values are | |
3733 * their respective values. | |
3734 * | |
3735 * At present the only supported field names are | |
3736 * - "iam_principal", corresponding to IAMContext.principal; | |
3737 * - "" (empty string), resulting in one aggretated counter with no field. | |
3738 * | |
3739 * Examples: | |
3740 * counter { metric: "/debug_access_count" field: "iam_principal" } | |
3741 * ==> increment counter /iam/policy/backend_debug_access_count | |
3742 * {iam_principal=[value of IAMContext.principal]} | |
3743 * | |
3744 * At this time we do not support: | |
3745 * * multiple field names (though this may be supported in the future) | |
3746 * * decrementing the counter | |
3747 * * incrementing it by anything other than 1 | |
3748 */ | |
3749 class LogConfig { | |
3750 /** Cloud audit options. */ | |
3751 CloudAuditOptions cloudAudit; | |
3752 /** Counter options. */ | |
3753 CounterOptions counter; | |
3754 /** Data access options. */ | |
3755 DataAccessOptions dataAccess; | |
3756 | 3212 |
3757 LogConfig(); | 3213 /// Insert new rows in a table. If any of the rows already exist, |
| 3214 /// the write or transaction fails with error `ALREADY_EXISTS`. |
| 3215 Write insert; |
3758 | 3216 |
3759 LogConfig.fromJson(core.Map _json) { | 3217 /// Like insert, except that if the row already exists, then |
3760 if (_json.containsKey("cloudAudit")) { | 3218 /// its column values are overwritten with the ones provided. Any |
3761 cloudAudit = new CloudAuditOptions.fromJson(_json["cloudAudit"]); | 3219 /// column values not explicitly written are preserved. |
3762 } | 3220 Write insertOrUpdate; |
3763 if (_json.containsKey("counter")) { | |
3764 counter = new CounterOptions.fromJson(_json["counter"]); | |
3765 } | |
3766 if (_json.containsKey("dataAccess")) { | |
3767 dataAccess = new DataAccessOptions.fromJson(_json["dataAccess"]); | |
3768 } | |
3769 } | |
3770 | 3221 |
3771 core.Map<core.String, core.Object> toJson() { | 3222 /// Like insert, except that if the row already exists, it is |
3772 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3223 /// deleted, and the column values provided are inserted |
3773 if (cloudAudit != null) { | 3224 /// instead. Unlike insert_or_update, this means any values not |
3774 _json["cloudAudit"] = (cloudAudit).toJson(); | 3225 /// explicitly written become `NULL`. |
3775 } | 3226 Write replace; |
3776 if (counter != null) { | |
3777 _json["counter"] = (counter).toJson(); | |
3778 } | |
3779 if (dataAccess != null) { | |
3780 _json["dataAccess"] = (dataAccess).toJson(); | |
3781 } | |
3782 return _json; | |
3783 } | |
3784 } | |
3785 | 3227 |
3786 /** | 3228 /// Update existing rows in a table. If any of the rows does not |
3787 * A modification to one or more Cloud Spanner rows. Mutations can be | 3229 /// already exist, the transaction fails with error `NOT_FOUND`. |
3788 * applied to a Cloud Spanner database by sending them in a | |
3789 * Commit call. | |
3790 */ | |
3791 class Mutation { | |
3792 /** | |
3793 * Delete rows from a table. Succeeds whether or not the named | |
3794 * rows were present. | |
3795 */ | |
3796 Delete delete; | |
3797 /** | |
3798 * Insert new rows in a table. If any of the rows already exist, | |
3799 * the write or transaction fails with error `ALREADY_EXISTS`. | |
3800 */ | |
3801 Write insert; | |
3802 /** | |
3803 * Like insert, except that if the row already exists, then | |
3804 * its column values are overwritten with the ones provided. Any | |
3805 * column values not explicitly written are preserved. | |
3806 */ | |
3807 Write insertOrUpdate; | |
3808 /** | |
3809 * Like insert, except that if the row already exists, it is | |
3810 * deleted, and the column values provided are inserted | |
3811 * instead. Unlike insert_or_update, this means any values not | |
3812 * explicitly written become `NULL`. | |
3813 */ | |
3814 Write replace; | |
3815 /** | |
3816 * Update existing rows in a table. If any of the rows does not | |
3817 * already exist, the transaction fails with error `NOT_FOUND`. | |
3818 */ | |
3819 Write update; | 3230 Write update; |
3820 | 3231 |
3821 Mutation(); | 3232 Mutation(); |
3822 | 3233 |
3823 Mutation.fromJson(core.Map _json) { | 3234 Mutation.fromJson(core.Map _json) { |
3824 if (_json.containsKey("delete")) { | 3235 if (_json.containsKey("delete")) { |
3825 delete = new Delete.fromJson(_json["delete"]); | 3236 delete = new Delete.fromJson(_json["delete"]); |
3826 } | 3237 } |
3827 if (_json.containsKey("insert")) { | 3238 if (_json.containsKey("insert")) { |
3828 insert = new Write.fromJson(_json["insert"]); | 3239 insert = new Write.fromJson(_json["insert"]); |
3829 } | 3240 } |
3830 if (_json.containsKey("insertOrUpdate")) { | 3241 if (_json.containsKey("insertOrUpdate")) { |
3831 insertOrUpdate = new Write.fromJson(_json["insertOrUpdate"]); | 3242 insertOrUpdate = new Write.fromJson(_json["insertOrUpdate"]); |
3832 } | 3243 } |
3833 if (_json.containsKey("replace")) { | 3244 if (_json.containsKey("replace")) { |
3834 replace = new Write.fromJson(_json["replace"]); | 3245 replace = new Write.fromJson(_json["replace"]); |
3835 } | 3246 } |
3836 if (_json.containsKey("update")) { | 3247 if (_json.containsKey("update")) { |
3837 update = new Write.fromJson(_json["update"]); | 3248 update = new Write.fromJson(_json["update"]); |
3838 } | 3249 } |
3839 } | 3250 } |
3840 | 3251 |
3841 core.Map<core.String, core.Object> toJson() { | 3252 core.Map<core.String, core.Object> toJson() { |
3842 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3253 final core.Map<core.String, core.Object> _json = |
| 3254 new core.Map<core.String, core.Object>(); |
3843 if (delete != null) { | 3255 if (delete != null) { |
3844 _json["delete"] = (delete).toJson(); | 3256 _json["delete"] = (delete).toJson(); |
3845 } | 3257 } |
3846 if (insert != null) { | 3258 if (insert != null) { |
3847 _json["insert"] = (insert).toJson(); | 3259 _json["insert"] = (insert).toJson(); |
3848 } | 3260 } |
3849 if (insertOrUpdate != null) { | 3261 if (insertOrUpdate != null) { |
3850 _json["insertOrUpdate"] = (insertOrUpdate).toJson(); | 3262 _json["insertOrUpdate"] = (insertOrUpdate).toJson(); |
3851 } | 3263 } |
3852 if (replace != null) { | 3264 if (replace != null) { |
3853 _json["replace"] = (replace).toJson(); | 3265 _json["replace"] = (replace).toJson(); |
3854 } | 3266 } |
3855 if (update != null) { | 3267 if (update != null) { |
3856 _json["update"] = (update).toJson(); | 3268 _json["update"] = (update).toJson(); |
3857 } | 3269 } |
3858 return _json; | 3270 return _json; |
3859 } | 3271 } |
3860 } | 3272 } |
3861 | 3273 |
3862 /** | 3274 /// This resource represents a long-running operation that is the result of a |
3863 * This resource represents a long-running operation that is the result of a | 3275 /// network API call. |
3864 * network API call. | |
3865 */ | |
3866 class Operation { | 3276 class Operation { |
3867 /** | 3277 /// If the value is `false`, it means the operation is still in progress. |
3868 * If the value is `false`, it means the operation is still in progress. | 3278 /// If true, the operation is completed, and either `error` or `response` is |
3869 * If true, the operation is completed, and either `error` or `response` is | 3279 /// available. |
3870 * available. | |
3871 */ | |
3872 core.bool done; | 3280 core.bool done; |
3873 /** The error result of the operation in case of failure or cancellation. */ | 3281 |
| 3282 /// The error result of the operation in case of failure or cancellation. |
3874 Status error; | 3283 Status error; |
3875 /** | 3284 |
3876 * Service-specific metadata associated with the operation. It typically | 3285 /// Service-specific metadata associated with the operation. It typically |
3877 * contains progress information and common metadata such as create time. | 3286 /// contains progress information and common metadata such as create time. |
3878 * Some services might not provide such metadata. Any method that returns a | 3287 /// Some services might not provide such metadata. Any method that returns a |
3879 * long-running operation should document the metadata type, if any. | 3288 /// long-running operation should document the metadata type, if any. |
3880 * | 3289 /// |
3881 * The values for Object must be JSON objects. It can consist of `num`, | 3290 /// The values for Object must be JSON objects. It can consist of `num`, |
3882 * `String`, `bool` and `null` as well as `Map` and `List` values. | 3291 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
3883 */ | |
3884 core.Map<core.String, core.Object> metadata; | 3292 core.Map<core.String, core.Object> metadata; |
3885 /** | 3293 |
3886 * The server-assigned name, which is only unique within the same service that | 3294 /// The server-assigned name, which is only unique within the same service |
3887 * originally returns it. If you use the default HTTP mapping, the | 3295 /// that |
3888 * `name` should have the format of `operations/some/unique/name`. | 3296 /// originally returns it. If you use the default HTTP mapping, the |
3889 */ | 3297 /// `name` should have the format of `operations/some/unique/name`. |
3890 core.String name; | 3298 core.String name; |
3891 /** | 3299 |
3892 * The normal response of the operation in case of success. If the original | 3300 /// The normal response of the operation in case of success. If the original |
3893 * method returns no data on success, such as `Delete`, the response is | 3301 /// method returns no data on success, such as `Delete`, the response is |
3894 * `google.protobuf.Empty`. If the original method is standard | 3302 /// `google.protobuf.Empty`. If the original method is standard |
3895 * `Get`/`Create`/`Update`, the response should be the resource. For other | 3303 /// `Get`/`Create`/`Update`, the response should be the resource. For other |
3896 * methods, the response should have the type `XxxResponse`, where `Xxx` | 3304 /// methods, the response should have the type `XxxResponse`, where `Xxx` |
3897 * is the original method name. For example, if the original method name | 3305 /// is the original method name. For example, if the original method name |
3898 * is `TakeSnapshot()`, the inferred response type is | 3306 /// is `TakeSnapshot()`, the inferred response type is |
3899 * `TakeSnapshotResponse`. | 3307 /// `TakeSnapshotResponse`. |
3900 * | 3308 /// |
3901 * The values for Object must be JSON objects. It can consist of `num`, | 3309 /// The values for Object must be JSON objects. It can consist of `num`, |
3902 * `String`, `bool` and `null` as well as `Map` and `List` values. | 3310 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
3903 */ | |
3904 core.Map<core.String, core.Object> response; | 3311 core.Map<core.String, core.Object> response; |
3905 | 3312 |
3906 Operation(); | 3313 Operation(); |
3907 | 3314 |
3908 Operation.fromJson(core.Map _json) { | 3315 Operation.fromJson(core.Map _json) { |
3909 if (_json.containsKey("done")) { | 3316 if (_json.containsKey("done")) { |
3910 done = _json["done"]; | 3317 done = _json["done"]; |
3911 } | 3318 } |
3912 if (_json.containsKey("error")) { | 3319 if (_json.containsKey("error")) { |
3913 error = new Status.fromJson(_json["error"]); | 3320 error = new Status.fromJson(_json["error"]); |
3914 } | 3321 } |
3915 if (_json.containsKey("metadata")) { | 3322 if (_json.containsKey("metadata")) { |
3916 metadata = _json["metadata"]; | 3323 metadata = _json["metadata"]; |
3917 } | 3324 } |
3918 if (_json.containsKey("name")) { | 3325 if (_json.containsKey("name")) { |
3919 name = _json["name"]; | 3326 name = _json["name"]; |
3920 } | 3327 } |
3921 if (_json.containsKey("response")) { | 3328 if (_json.containsKey("response")) { |
3922 response = _json["response"]; | 3329 response = _json["response"]; |
3923 } | 3330 } |
3924 } | 3331 } |
3925 | 3332 |
3926 core.Map<core.String, core.Object> toJson() { | 3333 core.Map<core.String, core.Object> toJson() { |
3927 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3334 final core.Map<core.String, core.Object> _json = |
| 3335 new core.Map<core.String, core.Object>(); |
3928 if (done != null) { | 3336 if (done != null) { |
3929 _json["done"] = done; | 3337 _json["done"] = done; |
3930 } | 3338 } |
3931 if (error != null) { | 3339 if (error != null) { |
3932 _json["error"] = (error).toJson(); | 3340 _json["error"] = (error).toJson(); |
3933 } | 3341 } |
3934 if (metadata != null) { | 3342 if (metadata != null) { |
3935 _json["metadata"] = metadata; | 3343 _json["metadata"] = metadata; |
3936 } | 3344 } |
3937 if (name != null) { | 3345 if (name != null) { |
3938 _json["name"] = name; | 3346 _json["name"] = name; |
3939 } | 3347 } |
3940 if (response != null) { | 3348 if (response != null) { |
3941 _json["response"] = response; | 3349 _json["response"] = response; |
3942 } | 3350 } |
3943 return _json; | 3351 return _json; |
3944 } | 3352 } |
3945 } | 3353 } |
3946 | 3354 |
3947 /** | 3355 /// Partial results from a streaming read or SQL query. Streaming reads and |
3948 * Partial results from a streaming read or SQL query. Streaming reads and | 3356 /// SQL queries better tolerate large result sets, large rows, and large |
3949 * SQL queries better tolerate large result sets, large rows, and large | 3357 /// values, but are a little trickier to consume. |
3950 * values, but are a little trickier to consume. | |
3951 */ | |
3952 class PartialResultSet { | 3358 class PartialResultSet { |
3953 /** | 3359 /// If true, then the final value in values is chunked, and must |
3954 * If true, then the final value in values is chunked, and must | 3360 /// be combined with more values from subsequent `PartialResultSet`s |
3955 * be combined with more values from subsequent `PartialResultSet`s | 3361 /// to obtain a complete field value. |
3956 * to obtain a complete field value. | |
3957 */ | |
3958 core.bool chunkedValue; | 3362 core.bool chunkedValue; |
3959 /** | 3363 |
3960 * Metadata about the result set, such as row type information. | 3364 /// Metadata about the result set, such as row type information. |
3961 * Only present in the first response. | 3365 /// Only present in the first response. |
3962 */ | |
3963 ResultSetMetadata metadata; | 3366 ResultSetMetadata metadata; |
3964 /** | 3367 |
3965 * Streaming calls might be interrupted for a variety of reasons, such | 3368 /// Streaming calls might be interrupted for a variety of reasons, such |
3966 * as TCP connection loss. If this occurs, the stream of results can | 3369 /// as TCP connection loss. If this occurs, the stream of results can |
3967 * be resumed by re-sending the original request and including | 3370 /// be resumed by re-sending the original request and including |
3968 * `resume_token`. Note that executing any other transaction in the | 3371 /// `resume_token`. Note that executing any other transaction in the |
3969 * same session invalidates the token. | 3372 /// same session invalidates the token. |
3970 */ | |
3971 core.String resumeToken; | 3373 core.String resumeToken; |
3972 core.List<core.int> get resumeTokenAsBytes { | 3374 core.List<core.int> get resumeTokenAsBytes { |
3973 return convert.BASE64.decode(resumeToken); | 3375 return convert.BASE64.decode(resumeToken); |
3974 } | 3376 } |
3975 | 3377 |
3976 void set resumeTokenAsBytes(core.List<core.int> _bytes) { | 3378 void set resumeTokenAsBytes(core.List<core.int> _bytes) { |
3977 resumeToken = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll(
"+", "-"); | 3379 resumeToken = |
| 3380 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
3978 } | 3381 } |
3979 /** | 3382 |
3980 * Query plan and execution statistics for the query that produced this | 3383 /// Query plan and execution statistics for the query that produced this |
3981 * streaming result set. These can be requested by setting | 3384 /// streaming result set. These can be requested by setting |
3982 * ExecuteSqlRequest.query_mode and are sent | 3385 /// ExecuteSqlRequest.query_mode and are sent |
3983 * only once with the last response in the stream. | 3386 /// only once with the last response in the stream. |
3984 */ | |
3985 ResultSetStats stats; | 3387 ResultSetStats stats; |
3986 /** | 3388 |
3987 * A streamed result set consists of a stream of values, which might | 3389 /// A streamed result set consists of a stream of values, which might |
3988 * be split into many `PartialResultSet` messages to accommodate | 3390 /// be split into many `PartialResultSet` messages to accommodate |
3989 * large rows and/or large values. Every N complete values defines a | 3391 /// large rows and/or large values. Every N complete values defines a |
3990 * row, where N is equal to the number of entries in | 3392 /// row, where N is equal to the number of entries in |
3991 * metadata.row_type.fields. | 3393 /// metadata.row_type.fields. |
3992 * | 3394 /// |
3993 * Most values are encoded based on type as described | 3395 /// Most values are encoded based on type as described |
3994 * here. | 3396 /// here. |
3995 * | 3397 /// |
3996 * It is possible that the last value in values is "chunked", | 3398 /// It is possible that the last value in values is "chunked", |
3997 * meaning that the rest of the value is sent in subsequent | 3399 /// meaning that the rest of the value is sent in subsequent |
3998 * `PartialResultSet`(s). This is denoted by the chunked_value | 3400 /// `PartialResultSet`(s). This is denoted by the chunked_value |
3999 * field. Two or more chunked values can be merged to form a | 3401 /// field. Two or more chunked values can be merged to form a |
4000 * complete value as follows: | 3402 /// complete value as follows: |
4001 * | 3403 /// |
4002 * * `bool/number/null`: cannot be chunked | 3404 /// * `bool/number/null`: cannot be chunked |
4003 * * `string`: concatenate the strings | 3405 /// * `string`: concatenate the strings |
4004 * * `list`: concatenate the lists. If the last element in a list is a | 3406 /// * `list`: concatenate the lists. If the last element in a list is a |
4005 * `string`, `list`, or `object`, merge it with the first element in | 3407 /// `string`, `list`, or `object`, merge it with the first element in |
4006 * the next list by applying these rules recursively. | 3408 /// the next list by applying these rules recursively. |
4007 * * `object`: concatenate the (field name, field value) pairs. If a | 3409 /// * `object`: concatenate the (field name, field value) pairs. If a |
4008 * field name is duplicated, then apply these rules recursively | 3410 /// field name is duplicated, then apply these rules recursively |
4009 * to merge the field values. | 3411 /// to merge the field values. |
4010 * | 3412 /// |
4011 * Some examples of merging: | 3413 /// Some examples of merging: |
4012 * | 3414 /// |
4013 * # Strings are concatenated. | 3415 /// # Strings are concatenated. |
4014 * "foo", "bar" => "foobar" | 3416 /// "foo", "bar" => "foobar" |
4015 * | 3417 /// |
4016 * # Lists of non-strings are concatenated. | 3418 /// # Lists of non-strings are concatenated. |
4017 * [2, 3], [4] => [2, 3, 4] | 3419 /// [2, 3], [4] => [2, 3, 4] |
4018 * | 3420 /// |
4019 * # Lists are concatenated, but the last and first elements are merged | 3421 /// # Lists are concatenated, but the last and first elements are merged |
4020 * # because they are strings. | 3422 /// # because they are strings. |
4021 * ["a", "b"], ["c", "d"] => ["a", "bc", "d"] | 3423 /// ["a", "b"], ["c", "d"] => ["a", "bc", "d"] |
4022 * | 3424 /// |
4023 * # Lists are concatenated, but the last and first elements are merged | 3425 /// # Lists are concatenated, but the last and first elements are merged |
4024 * # because they are lists. Recursively, the last and first elements | 3426 /// # because they are lists. Recursively, the last and first elements |
4025 * # of the inner lists are merged because they are strings. | 3427 /// # of the inner lists are merged because they are strings. |
4026 * ["a", ["b", "c"]], [["d"], "e"] => ["a", ["b", "cd"], "e"] | 3428 /// ["a", ["b", "c"]], [["d"], "e"] => ["a", ["b", "cd"], "e"] |
4027 * | 3429 /// |
4028 * # Non-overlapping object fields are combined. | 3430 /// # Non-overlapping object fields are combined. |
4029 * {"a": "1"}, {"b": "2"} => {"a": "1", "b": 2"} | 3431 /// {"a": "1"}, {"b": "2"} => {"a": "1", "b": 2"} |
4030 * | 3432 /// |
4031 * # Overlapping object fields are merged. | 3433 /// # Overlapping object fields are merged. |
4032 * {"a": "1"}, {"a": "2"} => {"a": "12"} | 3434 /// {"a": "1"}, {"a": "2"} => {"a": "12"} |
4033 * | 3435 /// |
4034 * # Examples of merging objects containing lists of strings. | 3436 /// # Examples of merging objects containing lists of strings. |
4035 * {"a": ["1"]}, {"a": ["2"]} => {"a": ["12"]} | 3437 /// {"a": ["1"]}, {"a": ["2"]} => {"a": ["12"]} |
4036 * | 3438 /// |
4037 * For a more complete example, suppose a streaming SQL query is | 3439 /// For a more complete example, suppose a streaming SQL query is |
4038 * yielding a result set whose rows contain a single string | 3440 /// yielding a result set whose rows contain a single string |
4039 * field. The following `PartialResultSet`s might be yielded: | 3441 /// field. The following `PartialResultSet`s might be yielded: |
4040 * | 3442 /// |
4041 * { | 3443 /// { |
4042 * "metadata": { ... } | 3444 /// "metadata": { ... } |
4043 * "values": ["Hello", "W"] | 3445 /// "values": ["Hello", "W"] |
4044 * "chunked_value": true | 3446 /// "chunked_value": true |
4045 * "resume_token": "Af65..." | 3447 /// "resume_token": "Af65..." |
4046 * } | 3448 /// } |
4047 * { | 3449 /// { |
4048 * "values": ["orl"] | 3450 /// "values": ["orl"] |
4049 * "chunked_value": true | 3451 /// "chunked_value": true |
4050 * "resume_token": "Bqp2..." | 3452 /// "resume_token": "Bqp2..." |
4051 * } | 3453 /// } |
4052 * { | 3454 /// { |
4053 * "values": ["d"] | 3455 /// "values": ["d"] |
4054 * "resume_token": "Zx1B..." | 3456 /// "resume_token": "Zx1B..." |
4055 * } | 3457 /// } |
4056 * | 3458 /// |
4057 * This sequence of `PartialResultSet`s encodes two rows, one | 3459 /// This sequence of `PartialResultSet`s encodes two rows, one |
4058 * containing the field value `"Hello"`, and a second containing the | 3460 /// containing the field value `"Hello"`, and a second containing the |
4059 * field value `"World" = "W" + "orl" + "d"`. | 3461 /// field value `"World" = "W" + "orl" + "d"`. |
4060 * | 3462 /// |
4061 * The values for Object must be JSON objects. It can consist of `num`, | 3463 /// The values for Object must be JSON objects. It can consist of `num`, |
4062 * `String`, `bool` and `null` as well as `Map` and `List` values. | 3464 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
4063 */ | |
4064 core.List<core.Object> values; | 3465 core.List<core.Object> values; |
4065 | 3466 |
4066 PartialResultSet(); | 3467 PartialResultSet(); |
4067 | 3468 |
4068 PartialResultSet.fromJson(core.Map _json) { | 3469 PartialResultSet.fromJson(core.Map _json) { |
4069 if (_json.containsKey("chunkedValue")) { | 3470 if (_json.containsKey("chunkedValue")) { |
4070 chunkedValue = _json["chunkedValue"]; | 3471 chunkedValue = _json["chunkedValue"]; |
4071 } | 3472 } |
4072 if (_json.containsKey("metadata")) { | 3473 if (_json.containsKey("metadata")) { |
4073 metadata = new ResultSetMetadata.fromJson(_json["metadata"]); | 3474 metadata = new ResultSetMetadata.fromJson(_json["metadata"]); |
4074 } | 3475 } |
4075 if (_json.containsKey("resumeToken")) { | 3476 if (_json.containsKey("resumeToken")) { |
4076 resumeToken = _json["resumeToken"]; | 3477 resumeToken = _json["resumeToken"]; |
4077 } | 3478 } |
4078 if (_json.containsKey("stats")) { | 3479 if (_json.containsKey("stats")) { |
4079 stats = new ResultSetStats.fromJson(_json["stats"]); | 3480 stats = new ResultSetStats.fromJson(_json["stats"]); |
4080 } | 3481 } |
4081 if (_json.containsKey("values")) { | 3482 if (_json.containsKey("values")) { |
4082 values = _json["values"]; | 3483 values = _json["values"]; |
4083 } | 3484 } |
4084 } | 3485 } |
4085 | 3486 |
4086 core.Map<core.String, core.Object> toJson() { | 3487 core.Map<core.String, core.Object> toJson() { |
4087 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3488 final core.Map<core.String, core.Object> _json = |
| 3489 new core.Map<core.String, core.Object>(); |
4088 if (chunkedValue != null) { | 3490 if (chunkedValue != null) { |
4089 _json["chunkedValue"] = chunkedValue; | 3491 _json["chunkedValue"] = chunkedValue; |
4090 } | 3492 } |
4091 if (metadata != null) { | 3493 if (metadata != null) { |
4092 _json["metadata"] = (metadata).toJson(); | 3494 _json["metadata"] = (metadata).toJson(); |
4093 } | 3495 } |
4094 if (resumeToken != null) { | 3496 if (resumeToken != null) { |
4095 _json["resumeToken"] = resumeToken; | 3497 _json["resumeToken"] = resumeToken; |
4096 } | 3498 } |
4097 if (stats != null) { | 3499 if (stats != null) { |
4098 _json["stats"] = (stats).toJson(); | 3500 _json["stats"] = (stats).toJson(); |
4099 } | 3501 } |
4100 if (values != null) { | 3502 if (values != null) { |
4101 _json["values"] = values; | 3503 _json["values"] = values; |
4102 } | 3504 } |
4103 return _json; | 3505 return _json; |
4104 } | 3506 } |
4105 } | 3507 } |
4106 | 3508 |
4107 /** Node information for nodes appearing in a QueryPlan.plan_nodes. */ | 3509 /// Node information for nodes appearing in a QueryPlan.plan_nodes. |
4108 class PlanNode { | 3510 class PlanNode { |
4109 /** List of child node `index`es and their relationship to this parent. */ | 3511 /// List of child node `index`es and their relationship to this parent. |
4110 core.List<ChildLink> childLinks; | 3512 core.List<ChildLink> childLinks; |
4111 /** The display name for the node. */ | 3513 |
| 3514 /// The display name for the node. |
4112 core.String displayName; | 3515 core.String displayName; |
4113 /** | 3516 |
4114 * The execution statistics associated with the node, contained in a group of | 3517 /// The execution statistics associated with the node, contained in a group |
4115 * key-value pairs. Only present if the plan was returned as a result of a | 3518 /// of |
4116 * profile query. For example, number of executions, number of rows/time per | 3519 /// key-value pairs. Only present if the plan was returned as a result of a |
4117 * execution etc. | 3520 /// profile query. For example, number of executions, number of rows/time per |
4118 * | 3521 /// execution etc. |
4119 * The values for Object must be JSON objects. It can consist of `num`, | 3522 /// |
4120 * `String`, `bool` and `null` as well as `Map` and `List` values. | 3523 /// The values for Object must be JSON objects. It can consist of `num`, |
4121 */ | 3524 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
4122 core.Map<core.String, core.Object> executionStats; | 3525 core.Map<core.String, core.Object> executionStats; |
4123 /** The `PlanNode`'s index in node list. */ | 3526 |
| 3527 /// The `PlanNode`'s index in node list. |
4124 core.int index; | 3528 core.int index; |
4125 /** | 3529 |
4126 * Used to determine the type of node. May be needed for visualizing | 3530 /// Used to determine the type of node. May be needed for visualizing |
4127 * different kinds of nodes differently. For example, If the node is a | 3531 /// different kinds of nodes differently. For example, If the node is a |
4128 * SCALAR node, it will have a condensed representation | 3532 /// SCALAR node, it will have a condensed representation |
4129 * which can be used to directly embed a description of the node in its | 3533 /// which can be used to directly embed a description of the node in its |
4130 * parent. | 3534 /// parent. |
4131 * Possible string values are: | 3535 /// Possible string values are: |
4132 * - "KIND_UNSPECIFIED" : Not specified. | 3536 /// - "KIND_UNSPECIFIED" : Not specified. |
4133 * - "RELATIONAL" : Denotes a Relational operator node in the expression tree. | 3537 /// - "RELATIONAL" : Denotes a Relational operator node in the expression |
4134 * Relational | 3538 /// tree. Relational |
4135 * operators represent iterative processing of rows during query execution. | 3539 /// operators represent iterative processing of rows during query execution. |
4136 * For example, a `TableScan` operation that reads rows from a table. | 3540 /// For example, a `TableScan` operation that reads rows from a table. |
4137 * - "SCALAR" : Denotes a Scalar node in the expression tree. Scalar nodes | 3541 /// - "SCALAR" : Denotes a Scalar node in the expression tree. Scalar nodes |
4138 * represent | 3542 /// represent |
4139 * non-iterable entities in the query plan. For example, constants or | 3543 /// non-iterable entities in the query plan. For example, constants or |
4140 * arithmetic operators appearing inside predicate expressions or references | 3544 /// arithmetic operators appearing inside predicate expressions or references |
4141 * to column names. | 3545 /// to column names. |
4142 */ | |
4143 core.String kind; | 3546 core.String kind; |
4144 /** | 3547 |
4145 * Attributes relevant to the node contained in a group of key-value pairs. | 3548 /// Attributes relevant to the node contained in a group of key-value pairs. |
4146 * For example, a Parameter Reference node could have the following | 3549 /// For example, a Parameter Reference node could have the following |
4147 * information in its metadata: | 3550 /// information in its metadata: |
4148 * | 3551 /// |
4149 * { | 3552 /// { |
4150 * "parameter_reference": "param1", | 3553 /// "parameter_reference": "param1", |
4151 * "parameter_type": "array" | 3554 /// "parameter_type": "array" |
4152 * } | 3555 /// } |
4153 * | 3556 /// |
4154 * The values for Object must be JSON objects. It can consist of `num`, | 3557 /// The values for Object must be JSON objects. It can consist of `num`, |
4155 * `String`, `bool` and `null` as well as `Map` and `List` values. | 3558 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
4156 */ | |
4157 core.Map<core.String, core.Object> metadata; | 3559 core.Map<core.String, core.Object> metadata; |
4158 /** Condensed representation for SCALAR nodes. */ | 3560 |
| 3561 /// Condensed representation for SCALAR nodes. |
4159 ShortRepresentation shortRepresentation; | 3562 ShortRepresentation shortRepresentation; |
4160 | 3563 |
4161 PlanNode(); | 3564 PlanNode(); |
4162 | 3565 |
4163 PlanNode.fromJson(core.Map _json) { | 3566 PlanNode.fromJson(core.Map _json) { |
4164 if (_json.containsKey("childLinks")) { | 3567 if (_json.containsKey("childLinks")) { |
4165 childLinks = _json["childLinks"].map((value) => new ChildLink.fromJson(val
ue)).toList(); | 3568 childLinks = _json["childLinks"] |
| 3569 .map((value) => new ChildLink.fromJson(value)) |
| 3570 .toList(); |
4166 } | 3571 } |
4167 if (_json.containsKey("displayName")) { | 3572 if (_json.containsKey("displayName")) { |
4168 displayName = _json["displayName"]; | 3573 displayName = _json["displayName"]; |
4169 } | 3574 } |
4170 if (_json.containsKey("executionStats")) { | 3575 if (_json.containsKey("executionStats")) { |
4171 executionStats = _json["executionStats"]; | 3576 executionStats = _json["executionStats"]; |
4172 } | 3577 } |
4173 if (_json.containsKey("index")) { | 3578 if (_json.containsKey("index")) { |
4174 index = _json["index"]; | 3579 index = _json["index"]; |
4175 } | 3580 } |
4176 if (_json.containsKey("kind")) { | 3581 if (_json.containsKey("kind")) { |
4177 kind = _json["kind"]; | 3582 kind = _json["kind"]; |
4178 } | 3583 } |
4179 if (_json.containsKey("metadata")) { | 3584 if (_json.containsKey("metadata")) { |
4180 metadata = _json["metadata"]; | 3585 metadata = _json["metadata"]; |
4181 } | 3586 } |
4182 if (_json.containsKey("shortRepresentation")) { | 3587 if (_json.containsKey("shortRepresentation")) { |
4183 shortRepresentation = new ShortRepresentation.fromJson(_json["shortReprese
ntation"]); | 3588 shortRepresentation = |
| 3589 new ShortRepresentation.fromJson(_json["shortRepresentation"]); |
4184 } | 3590 } |
4185 } | 3591 } |
4186 | 3592 |
4187 core.Map<core.String, core.Object> toJson() { | 3593 core.Map<core.String, core.Object> toJson() { |
4188 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3594 final core.Map<core.String, core.Object> _json = |
| 3595 new core.Map<core.String, core.Object>(); |
4189 if (childLinks != null) { | 3596 if (childLinks != null) { |
4190 _json["childLinks"] = childLinks.map((value) => (value).toJson()).toList()
; | 3597 _json["childLinks"] = |
| 3598 childLinks.map((value) => (value).toJson()).toList(); |
4191 } | 3599 } |
4192 if (displayName != null) { | 3600 if (displayName != null) { |
4193 _json["displayName"] = displayName; | 3601 _json["displayName"] = displayName; |
4194 } | 3602 } |
4195 if (executionStats != null) { | 3603 if (executionStats != null) { |
4196 _json["executionStats"] = executionStats; | 3604 _json["executionStats"] = executionStats; |
4197 } | 3605 } |
4198 if (index != null) { | 3606 if (index != null) { |
4199 _json["index"] = index; | 3607 _json["index"] = index; |
4200 } | 3608 } |
4201 if (kind != null) { | 3609 if (kind != null) { |
4202 _json["kind"] = kind; | 3610 _json["kind"] = kind; |
4203 } | 3611 } |
4204 if (metadata != null) { | 3612 if (metadata != null) { |
4205 _json["metadata"] = metadata; | 3613 _json["metadata"] = metadata; |
4206 } | 3614 } |
4207 if (shortRepresentation != null) { | 3615 if (shortRepresentation != null) { |
4208 _json["shortRepresentation"] = (shortRepresentation).toJson(); | 3616 _json["shortRepresentation"] = (shortRepresentation).toJson(); |
4209 } | 3617 } |
4210 return _json; | 3618 return _json; |
4211 } | 3619 } |
4212 } | 3620 } |
4213 | 3621 |
4214 /** | 3622 /// Defines an Identity and Access Management (IAM) policy. It is used to |
4215 * Defines an Identity and Access Management (IAM) policy. It is used to | 3623 /// specify access control policies for Cloud Platform resources. |
4216 * specify access control policies for Cloud Platform resources. | 3624 /// |
4217 * | 3625 /// |
4218 * | 3626 /// A `Policy` consists of a list of `bindings`. A `Binding` binds a list of |
4219 * A `Policy` consists of a list of `bindings`. A `Binding` binds a list of | 3627 /// `members` to a `role`, where the members can be user accounts, Google |
4220 * `members` to a `role`, where the members can be user accounts, Google groups, | 3628 /// groups, |
4221 * Google domains, and service accounts. A `role` is a named list of permissions | 3629 /// Google domains, and service accounts. A `role` is a named list of |
4222 * defined by IAM. | 3630 /// permissions |
4223 * | 3631 /// defined by IAM. |
4224 * **Example** | 3632 /// |
4225 * | 3633 /// **Example** |
4226 * { | 3634 /// |
4227 * "bindings": [ | 3635 /// { |
4228 * { | 3636 /// "bindings": [ |
4229 * "role": "roles/owner", | 3637 /// { |
4230 * "members": [ | 3638 /// "role": "roles/owner", |
4231 * "user:mike@example.com", | 3639 /// "members": [ |
4232 * "group:admins@example.com", | 3640 /// "user:mike@example.com", |
4233 * "domain:google.com", | 3641 /// "group:admins@example.com", |
4234 * "serviceAccount:my-other-app@appspot.gserviceaccount.com", | 3642 /// "domain:google.com", |
4235 * ] | 3643 /// "serviceAccount:my-other-app@appspot.gserviceaccount.com", |
4236 * }, | 3644 /// ] |
4237 * { | 3645 /// }, |
4238 * "role": "roles/viewer", | 3646 /// { |
4239 * "members": ["user:sean@example.com"] | 3647 /// "role": "roles/viewer", |
4240 * } | 3648 /// "members": ["user:sean@example.com"] |
4241 * ] | 3649 /// } |
4242 * } | 3650 /// ] |
4243 * | 3651 /// } |
4244 * For a description of IAM and its features, see the | 3652 /// |
4245 * [IAM developer's guide](https://cloud.google.com/iam). | 3653 /// For a description of IAM and its features, see the |
4246 */ | 3654 /// [IAM developer's guide](https://cloud.google.com/iam). |
4247 class Policy { | 3655 class Policy { |
4248 /** Specifies cloud audit logging configuration for this policy. */ | 3656 /// Associates a list of `members` to a `role`. |
4249 core.List<AuditConfig> auditConfigs; | 3657 /// `bindings` with no members will result in an error. |
4250 /** | |
4251 * Associates a list of `members` to a `role`. | |
4252 * `bindings` with no members will result in an error. | |
4253 */ | |
4254 core.List<Binding> bindings; | 3658 core.List<Binding> bindings; |
4255 /** | 3659 |
4256 * `etag` is used for optimistic concurrency control as a way to help | 3660 /// `etag` is used for optimistic concurrency control as a way to help |
4257 * prevent simultaneous updates of a policy from overwriting each other. | 3661 /// prevent simultaneous updates of a policy from overwriting each other. |
4258 * It is strongly suggested that systems make use of the `etag` in the | 3662 /// It is strongly suggested that systems make use of the `etag` in the |
4259 * read-modify-write cycle to perform policy updates in order to avoid race | 3663 /// read-modify-write cycle to perform policy updates in order to avoid race |
4260 * conditions: An `etag` is returned in the response to `getIamPolicy`, and | 3664 /// conditions: An `etag` is returned in the response to `getIamPolicy`, and |
4261 * systems are expected to put that etag in the request to `setIamPolicy` to | 3665 /// systems are expected to put that etag in the request to `setIamPolicy` to |
4262 * ensure that their change will be applied to the same version of the policy. | 3666 /// ensure that their change will be applied to the same version of the |
4263 * | 3667 /// policy. |
4264 * If no `etag` is provided in the call to `setIamPolicy`, then the existing | 3668 /// |
4265 * policy is overwritten blindly. | 3669 /// If no `etag` is provided in the call to `setIamPolicy`, then the existing |
4266 */ | 3670 /// policy is overwritten blindly. |
4267 core.String etag; | 3671 core.String etag; |
4268 core.List<core.int> get etagAsBytes { | 3672 core.List<core.int> get etagAsBytes { |
4269 return convert.BASE64.decode(etag); | 3673 return convert.BASE64.decode(etag); |
4270 } | 3674 } |
4271 | 3675 |
4272 void set etagAsBytes(core.List<core.int> _bytes) { | 3676 void set etagAsBytes(core.List<core.int> _bytes) { |
4273 etag = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); | 3677 etag = |
| 3678 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
4274 } | 3679 } |
4275 core.bool iamOwned; | 3680 |
4276 /** | 3681 /// Version of the `Policy`. The default version is 0. |
4277 * If more than one rule is specified, the rules are applied in the following | |
4278 * manner: | |
4279 * - All matching LOG rules are always applied. | |
4280 * - If any DENY/DENY_WITH_LOG rule matches, permission is denied. | |
4281 * Logging will be applied if one or more matching rule requires logging. | |
4282 * - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is | |
4283 * granted. | |
4284 * Logging will be applied if one or more matching rule requires logging. | |
4285 * - Otherwise, if no rule applies, permission is denied. | |
4286 */ | |
4287 core.List<Rule> rules; | |
4288 /** Version of the `Policy`. The default version is 0. */ | |
4289 core.int version; | 3682 core.int version; |
4290 | 3683 |
4291 Policy(); | 3684 Policy(); |
4292 | 3685 |
4293 Policy.fromJson(core.Map _json) { | 3686 Policy.fromJson(core.Map _json) { |
4294 if (_json.containsKey("auditConfigs")) { | |
4295 auditConfigs = _json["auditConfigs"].map((value) => new AuditConfig.fromJs
on(value)).toList(); | |
4296 } | |
4297 if (_json.containsKey("bindings")) { | 3687 if (_json.containsKey("bindings")) { |
4298 bindings = _json["bindings"].map((value) => new Binding.fromJson(value)).t
oList(); | 3688 bindings = _json["bindings"] |
| 3689 .map((value) => new Binding.fromJson(value)) |
| 3690 .toList(); |
4299 } | 3691 } |
4300 if (_json.containsKey("etag")) { | 3692 if (_json.containsKey("etag")) { |
4301 etag = _json["etag"]; | 3693 etag = _json["etag"]; |
4302 } | 3694 } |
4303 if (_json.containsKey("iamOwned")) { | |
4304 iamOwned = _json["iamOwned"]; | |
4305 } | |
4306 if (_json.containsKey("rules")) { | |
4307 rules = _json["rules"].map((value) => new Rule.fromJson(value)).toList(); | |
4308 } | |
4309 if (_json.containsKey("version")) { | 3695 if (_json.containsKey("version")) { |
4310 version = _json["version"]; | 3696 version = _json["version"]; |
4311 } | 3697 } |
4312 } | 3698 } |
4313 | 3699 |
4314 core.Map<core.String, core.Object> toJson() { | 3700 core.Map<core.String, core.Object> toJson() { |
4315 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3701 final core.Map<core.String, core.Object> _json = |
4316 if (auditConfigs != null) { | 3702 new core.Map<core.String, core.Object>(); |
4317 _json["auditConfigs"] = auditConfigs.map((value) => (value).toJson()).toLi
st(); | |
4318 } | |
4319 if (bindings != null) { | 3703 if (bindings != null) { |
4320 _json["bindings"] = bindings.map((value) => (value).toJson()).toList(); | 3704 _json["bindings"] = bindings.map((value) => (value).toJson()).toList(); |
4321 } | 3705 } |
4322 if (etag != null) { | 3706 if (etag != null) { |
4323 _json["etag"] = etag; | 3707 _json["etag"] = etag; |
4324 } | 3708 } |
4325 if (iamOwned != null) { | |
4326 _json["iamOwned"] = iamOwned; | |
4327 } | |
4328 if (rules != null) { | |
4329 _json["rules"] = rules.map((value) => (value).toJson()).toList(); | |
4330 } | |
4331 if (version != null) { | 3709 if (version != null) { |
4332 _json["version"] = version; | 3710 _json["version"] = version; |
4333 } | 3711 } |
4334 return _json; | 3712 return _json; |
4335 } | 3713 } |
4336 } | 3714 } |
4337 | 3715 |
4338 /** Contains an ordered list of nodes appearing in the query plan. */ | 3716 /// Contains an ordered list of nodes appearing in the query plan. |
4339 class QueryPlan { | 3717 class QueryPlan { |
4340 /** | 3718 /// The nodes in the query plan. Plan nodes are returned in pre-order |
4341 * The nodes in the query plan. Plan nodes are returned in pre-order starting | 3719 /// starting |
4342 * with the plan root. Each PlanNode's `id` corresponds to its index in | 3720 /// with the plan root. Each PlanNode's `id` corresponds to its index in |
4343 * `plan_nodes`. | 3721 /// `plan_nodes`. |
4344 */ | |
4345 core.List<PlanNode> planNodes; | 3722 core.List<PlanNode> planNodes; |
4346 | 3723 |
4347 QueryPlan(); | 3724 QueryPlan(); |
4348 | 3725 |
4349 QueryPlan.fromJson(core.Map _json) { | 3726 QueryPlan.fromJson(core.Map _json) { |
4350 if (_json.containsKey("planNodes")) { | 3727 if (_json.containsKey("planNodes")) { |
4351 planNodes = _json["planNodes"].map((value) => new PlanNode.fromJson(value)
).toList(); | 3728 planNodes = _json["planNodes"] |
| 3729 .map((value) => new PlanNode.fromJson(value)) |
| 3730 .toList(); |
4352 } | 3731 } |
4353 } | 3732 } |
4354 | 3733 |
4355 core.Map<core.String, core.Object> toJson() { | 3734 core.Map<core.String, core.Object> toJson() { |
4356 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3735 final core.Map<core.String, core.Object> _json = |
| 3736 new core.Map<core.String, core.Object>(); |
4357 if (planNodes != null) { | 3737 if (planNodes != null) { |
4358 _json["planNodes"] = planNodes.map((value) => (value).toJson()).toList(); | 3738 _json["planNodes"] = planNodes.map((value) => (value).toJson()).toList(); |
4359 } | 3739 } |
4360 return _json; | 3740 return _json; |
4361 } | 3741 } |
4362 } | 3742 } |
4363 | 3743 |
4364 /** Message type to initiate a read-only transaction. */ | 3744 /// Message type to initiate a read-only transaction. |
4365 class ReadOnly { | 3745 class ReadOnly { |
4366 /** | 3746 /// Executes all reads at a timestamp that is `exact_staleness` |
4367 * Executes all reads at a timestamp that is `exact_staleness` | 3747 /// old. The timestamp is chosen soon after the read is started. |
4368 * old. The timestamp is chosen soon after the read is started. | 3748 /// |
4369 * | 3749 /// Guarantees that all writes that have committed more than the |
4370 * Guarantees that all writes that have committed more than the | 3750 /// specified number of seconds ago are visible. Because Cloud Spanner |
4371 * specified number of seconds ago are visible. Because Cloud Spanner | 3751 /// chooses the exact timestamp, this mode works even if the client's |
4372 * chooses the exact timestamp, this mode works even if the client's | 3752 /// local clock is substantially skewed from Cloud Spanner commit |
4373 * local clock is substantially skewed from Cloud Spanner commit | 3753 /// timestamps. |
4374 * timestamps. | 3754 /// |
4375 * | 3755 /// Useful for reading at nearby replicas without the distributed |
4376 * Useful for reading at nearby replicas without the distributed | 3756 /// timestamp negotiation overhead of `max_staleness`. |
4377 * timestamp negotiation overhead of `max_staleness`. | |
4378 */ | |
4379 core.String exactStaleness; | 3757 core.String exactStaleness; |
4380 /** | 3758 |
4381 * Read data at a timestamp >= `NOW - max_staleness` | 3759 /// Read data at a timestamp >= `NOW - max_staleness` |
4382 * seconds. Guarantees that all writes that have committed more | 3760 /// seconds. Guarantees that all writes that have committed more |
4383 * than the specified number of seconds ago are visible. Because | 3761 /// than the specified number of seconds ago are visible. Because |
4384 * Cloud Spanner chooses the exact timestamp, this mode works even if | 3762 /// Cloud Spanner chooses the exact timestamp, this mode works even if |
4385 * the client's local clock is substantially skewed from Cloud Spanner | 3763 /// the client's local clock is substantially skewed from Cloud Spanner |
4386 * commit timestamps. | 3764 /// commit timestamps. |
4387 * | 3765 /// |
4388 * Useful for reading the freshest data available at a nearby | 3766 /// Useful for reading the freshest data available at a nearby |
4389 * replica, while bounding the possible staleness if the local | 3767 /// replica, while bounding the possible staleness if the local |
4390 * replica has fallen behind. | 3768 /// replica has fallen behind. |
4391 * | 3769 /// |
4392 * Note that this option can only be used in single-use | 3770 /// Note that this option can only be used in single-use |
4393 * transactions. | 3771 /// transactions. |
4394 */ | |
4395 core.String maxStaleness; | 3772 core.String maxStaleness; |
4396 /** | 3773 |
4397 * Executes all reads at a timestamp >= `min_read_timestamp`. | 3774 /// Executes all reads at a timestamp >= `min_read_timestamp`. |
4398 * | 3775 /// |
4399 * This is useful for requesting fresher data than some previous | 3776 /// This is useful for requesting fresher data than some previous |
4400 * read, or data that is fresh enough to observe the effects of some | 3777 /// read, or data that is fresh enough to observe the effects of some |
4401 * previously committed transaction whose timestamp is known. | 3778 /// previously committed transaction whose timestamp is known. |
4402 * | 3779 /// |
4403 * Note that this option can only be used in single-use transactions. | 3780 /// Note that this option can only be used in single-use transactions. |
4404 */ | |
4405 core.String minReadTimestamp; | 3781 core.String minReadTimestamp; |
4406 /** | 3782 |
4407 * Executes all reads at the given timestamp. Unlike other modes, | 3783 /// Executes all reads at the given timestamp. Unlike other modes, |
4408 * reads at a specific timestamp are repeatable; the same read at | 3784 /// reads at a specific timestamp are repeatable; the same read at |
4409 * the same timestamp always returns the same data. If the | 3785 /// the same timestamp always returns the same data. If the |
4410 * timestamp is in the future, the read will block until the | 3786 /// timestamp is in the future, the read will block until the |
4411 * specified timestamp, modulo the read's deadline. | 3787 /// specified timestamp, modulo the read's deadline. |
4412 * | 3788 /// |
4413 * Useful for large scale consistent reads such as mapreduces, or | 3789 /// Useful for large scale consistent reads such as mapreduces, or |
4414 * for coordinating many reads against a consistent snapshot of the | 3790 /// for coordinating many reads against a consistent snapshot of the |
4415 * data. | 3791 /// data. |
4416 */ | |
4417 core.String readTimestamp; | 3792 core.String readTimestamp; |
4418 /** | 3793 |
4419 * If true, the Cloud Spanner-selected read timestamp is included in | 3794 /// If true, the Cloud Spanner-selected read timestamp is included in |
4420 * the Transaction message that describes the transaction. | 3795 /// the Transaction message that describes the transaction. |
4421 */ | |
4422 core.bool returnReadTimestamp; | 3796 core.bool returnReadTimestamp; |
4423 /** | 3797 |
4424 * Read at a timestamp where all previously committed transactions | 3798 /// Read at a timestamp where all previously committed transactions |
4425 * are visible. | 3799 /// are visible. |
4426 */ | |
4427 core.bool strong; | 3800 core.bool strong; |
4428 | 3801 |
4429 ReadOnly(); | 3802 ReadOnly(); |
4430 | 3803 |
4431 ReadOnly.fromJson(core.Map _json) { | 3804 ReadOnly.fromJson(core.Map _json) { |
4432 if (_json.containsKey("exactStaleness")) { | 3805 if (_json.containsKey("exactStaleness")) { |
4433 exactStaleness = _json["exactStaleness"]; | 3806 exactStaleness = _json["exactStaleness"]; |
4434 } | 3807 } |
4435 if (_json.containsKey("maxStaleness")) { | 3808 if (_json.containsKey("maxStaleness")) { |
4436 maxStaleness = _json["maxStaleness"]; | 3809 maxStaleness = _json["maxStaleness"]; |
4437 } | 3810 } |
4438 if (_json.containsKey("minReadTimestamp")) { | 3811 if (_json.containsKey("minReadTimestamp")) { |
4439 minReadTimestamp = _json["minReadTimestamp"]; | 3812 minReadTimestamp = _json["minReadTimestamp"]; |
4440 } | 3813 } |
4441 if (_json.containsKey("readTimestamp")) { | 3814 if (_json.containsKey("readTimestamp")) { |
4442 readTimestamp = _json["readTimestamp"]; | 3815 readTimestamp = _json["readTimestamp"]; |
4443 } | 3816 } |
4444 if (_json.containsKey("returnReadTimestamp")) { | 3817 if (_json.containsKey("returnReadTimestamp")) { |
4445 returnReadTimestamp = _json["returnReadTimestamp"]; | 3818 returnReadTimestamp = _json["returnReadTimestamp"]; |
4446 } | 3819 } |
4447 if (_json.containsKey("strong")) { | 3820 if (_json.containsKey("strong")) { |
4448 strong = _json["strong"]; | 3821 strong = _json["strong"]; |
4449 } | 3822 } |
4450 } | 3823 } |
4451 | 3824 |
4452 core.Map<core.String, core.Object> toJson() { | 3825 core.Map<core.String, core.Object> toJson() { |
4453 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3826 final core.Map<core.String, core.Object> _json = |
| 3827 new core.Map<core.String, core.Object>(); |
4454 if (exactStaleness != null) { | 3828 if (exactStaleness != null) { |
4455 _json["exactStaleness"] = exactStaleness; | 3829 _json["exactStaleness"] = exactStaleness; |
4456 } | 3830 } |
4457 if (maxStaleness != null) { | 3831 if (maxStaleness != null) { |
4458 _json["maxStaleness"] = maxStaleness; | 3832 _json["maxStaleness"] = maxStaleness; |
4459 } | 3833 } |
4460 if (minReadTimestamp != null) { | 3834 if (minReadTimestamp != null) { |
4461 _json["minReadTimestamp"] = minReadTimestamp; | 3835 _json["minReadTimestamp"] = minReadTimestamp; |
4462 } | 3836 } |
4463 if (readTimestamp != null) { | 3837 if (readTimestamp != null) { |
4464 _json["readTimestamp"] = readTimestamp; | 3838 _json["readTimestamp"] = readTimestamp; |
4465 } | 3839 } |
4466 if (returnReadTimestamp != null) { | 3840 if (returnReadTimestamp != null) { |
4467 _json["returnReadTimestamp"] = returnReadTimestamp; | 3841 _json["returnReadTimestamp"] = returnReadTimestamp; |
4468 } | 3842 } |
4469 if (strong != null) { | 3843 if (strong != null) { |
4470 _json["strong"] = strong; | 3844 _json["strong"] = strong; |
4471 } | 3845 } |
4472 return _json; | 3846 return _json; |
4473 } | 3847 } |
4474 } | 3848 } |
4475 | 3849 |
4476 /** | 3850 /// The request for Read and |
4477 * The request for Read and | 3851 /// StreamingRead. |
4478 * StreamingRead. | |
4479 */ | |
4480 class ReadRequest { | 3852 class ReadRequest { |
4481 /** | 3853 /// The columns of table to be returned for each row matching |
4482 * The columns of table to be returned for each row matching | 3854 /// this request. |
4483 * this request. | |
4484 */ | |
4485 core.List<core.String> columns; | 3855 core.List<core.String> columns; |
4486 /** | 3856 |
4487 * If non-empty, the name of an index on table. This index is | 3857 /// If non-empty, the name of an index on table. This index is |
4488 * used instead of the table primary key when interpreting key_set | 3858 /// used instead of the table primary key when interpreting key_set |
4489 * and sorting result rows. See key_set for further information. | 3859 /// and sorting result rows. See key_set for further information. |
4490 */ | |
4491 core.String index; | 3860 core.String index; |
4492 /** | 3861 |
4493 * Required. `key_set` identifies the rows to be yielded. `key_set` names the | 3862 /// Required. `key_set` identifies the rows to be yielded. `key_set` names |
4494 * primary keys of the rows in table to be yielded, unless index | 3863 /// the |
4495 * is present. If index is present, then key_set instead names | 3864 /// primary keys of the rows in table to be yielded, unless index |
4496 * index keys in index. | 3865 /// is present. If index is present, then key_set instead names |
4497 * | 3866 /// index keys in index. |
4498 * Rows are yielded in table primary key order (if index is empty) | 3867 /// |
4499 * or index key order (if index is non-empty). | 3868 /// Rows are yielded in table primary key order (if index is empty) |
4500 * | 3869 /// or index key order (if index is non-empty). |
4501 * It is not an error for the `key_set` to name rows that do not | 3870 /// |
4502 * exist in the database. Read yields nothing for nonexistent rows. | 3871 /// It is not an error for the `key_set` to name rows that do not |
4503 */ | 3872 /// exist in the database. Read yields nothing for nonexistent rows. |
4504 KeySet keySet; | 3873 KeySet keySet; |
4505 /** | 3874 |
4506 * If greater than zero, only the first `limit` rows are yielded. If `limit` | 3875 /// If greater than zero, only the first `limit` rows are yielded. If `limit` |
4507 * is zero, the default is no limit. | 3876 /// is zero, the default is no limit. |
4508 */ | |
4509 core.String limit; | 3877 core.String limit; |
4510 /** | 3878 |
4511 * If this request is resuming a previously interrupted read, | 3879 /// If this request is resuming a previously interrupted read, |
4512 * `resume_token` should be copied from the last | 3880 /// `resume_token` should be copied from the last |
4513 * PartialResultSet yielded before the interruption. Doing this | 3881 /// PartialResultSet yielded before the interruption. Doing this |
4514 * enables the new read to resume where the last read left off. The | 3882 /// enables the new read to resume where the last read left off. The |
4515 * rest of the request parameters must exactly match the request | 3883 /// rest of the request parameters must exactly match the request |
4516 * that yielded this token. | 3884 /// that yielded this token. |
4517 */ | |
4518 core.String resumeToken; | 3885 core.String resumeToken; |
4519 core.List<core.int> get resumeTokenAsBytes { | 3886 core.List<core.int> get resumeTokenAsBytes { |
4520 return convert.BASE64.decode(resumeToken); | 3887 return convert.BASE64.decode(resumeToken); |
4521 } | 3888 } |
4522 | 3889 |
4523 void set resumeTokenAsBytes(core.List<core.int> _bytes) { | 3890 void set resumeTokenAsBytes(core.List<core.int> _bytes) { |
4524 resumeToken = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll(
"+", "-"); | 3891 resumeToken = |
| 3892 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
4525 } | 3893 } |
4526 /** Required. The name of the table in the database to be read. */ | 3894 |
| 3895 /// Required. The name of the table in the database to be read. |
4527 core.String table; | 3896 core.String table; |
4528 /** | 3897 |
4529 * The transaction to use. If none is provided, the default is a | 3898 /// The transaction to use. If none is provided, the default is a |
4530 * temporary read-only transaction with strong concurrency. | 3899 /// temporary read-only transaction with strong concurrency. |
4531 */ | |
4532 TransactionSelector transaction; | 3900 TransactionSelector transaction; |
4533 | 3901 |
4534 ReadRequest(); | 3902 ReadRequest(); |
4535 | 3903 |
4536 ReadRequest.fromJson(core.Map _json) { | 3904 ReadRequest.fromJson(core.Map _json) { |
4537 if (_json.containsKey("columns")) { | 3905 if (_json.containsKey("columns")) { |
4538 columns = _json["columns"]; | 3906 columns = _json["columns"]; |
4539 } | 3907 } |
4540 if (_json.containsKey("index")) { | 3908 if (_json.containsKey("index")) { |
4541 index = _json["index"]; | 3909 index = _json["index"]; |
4542 } | 3910 } |
4543 if (_json.containsKey("keySet")) { | 3911 if (_json.containsKey("keySet")) { |
4544 keySet = new KeySet.fromJson(_json["keySet"]); | 3912 keySet = new KeySet.fromJson(_json["keySet"]); |
4545 } | 3913 } |
4546 if (_json.containsKey("limit")) { | 3914 if (_json.containsKey("limit")) { |
4547 limit = _json["limit"]; | 3915 limit = _json["limit"]; |
4548 } | 3916 } |
4549 if (_json.containsKey("resumeToken")) { | 3917 if (_json.containsKey("resumeToken")) { |
4550 resumeToken = _json["resumeToken"]; | 3918 resumeToken = _json["resumeToken"]; |
4551 } | 3919 } |
4552 if (_json.containsKey("table")) { | 3920 if (_json.containsKey("table")) { |
4553 table = _json["table"]; | 3921 table = _json["table"]; |
4554 } | 3922 } |
4555 if (_json.containsKey("transaction")) { | 3923 if (_json.containsKey("transaction")) { |
4556 transaction = new TransactionSelector.fromJson(_json["transaction"]); | 3924 transaction = new TransactionSelector.fromJson(_json["transaction"]); |
4557 } | 3925 } |
4558 } | 3926 } |
4559 | 3927 |
4560 core.Map<core.String, core.Object> toJson() { | 3928 core.Map<core.String, core.Object> toJson() { |
4561 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3929 final core.Map<core.String, core.Object> _json = |
| 3930 new core.Map<core.String, core.Object>(); |
4562 if (columns != null) { | 3931 if (columns != null) { |
4563 _json["columns"] = columns; | 3932 _json["columns"] = columns; |
4564 } | 3933 } |
4565 if (index != null) { | 3934 if (index != null) { |
4566 _json["index"] = index; | 3935 _json["index"] = index; |
4567 } | 3936 } |
4568 if (keySet != null) { | 3937 if (keySet != null) { |
4569 _json["keySet"] = (keySet).toJson(); | 3938 _json["keySet"] = (keySet).toJson(); |
4570 } | 3939 } |
4571 if (limit != null) { | 3940 if (limit != null) { |
4572 _json["limit"] = limit; | 3941 _json["limit"] = limit; |
4573 } | 3942 } |
4574 if (resumeToken != null) { | 3943 if (resumeToken != null) { |
4575 _json["resumeToken"] = resumeToken; | 3944 _json["resumeToken"] = resumeToken; |
4576 } | 3945 } |
4577 if (table != null) { | 3946 if (table != null) { |
4578 _json["table"] = table; | 3947 _json["table"] = table; |
4579 } | 3948 } |
4580 if (transaction != null) { | 3949 if (transaction != null) { |
4581 _json["transaction"] = (transaction).toJson(); | 3950 _json["transaction"] = (transaction).toJson(); |
4582 } | 3951 } |
4583 return _json; | 3952 return _json; |
4584 } | 3953 } |
4585 } | 3954 } |
4586 | 3955 |
4587 /** | 3956 /// Message type to initiate a read-write transaction. Currently this |
4588 * Message type to initiate a read-write transaction. Currently this | 3957 /// transaction type has no options. |
4589 * transaction type has no options. | |
4590 */ | |
4591 class ReadWrite { | 3958 class ReadWrite { |
4592 | |
4593 ReadWrite(); | 3959 ReadWrite(); |
4594 | 3960 |
4595 ReadWrite.fromJson(core.Map _json) { | 3961 ReadWrite.fromJson(core.Map _json) {} |
4596 } | |
4597 | 3962 |
4598 core.Map<core.String, core.Object> toJson() { | 3963 core.Map<core.String, core.Object> toJson() { |
4599 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3964 final core.Map<core.String, core.Object> _json = |
| 3965 new core.Map<core.String, core.Object>(); |
4600 return _json; | 3966 return _json; |
4601 } | 3967 } |
4602 } | 3968 } |
4603 | 3969 |
4604 /** | 3970 /// Results from Read or |
4605 * Results from Read or | 3971 /// ExecuteSql. |
4606 * ExecuteSql. | |
4607 */ | |
4608 class ResultSet { | 3972 class ResultSet { |
4609 /** Metadata about the result set, such as row type information. */ | 3973 /// Metadata about the result set, such as row type information. |
4610 ResultSetMetadata metadata; | 3974 ResultSetMetadata metadata; |
4611 /** | 3975 |
4612 * Each element in `rows` is a row whose format is defined by | 3976 /// Each element in `rows` is a row whose format is defined by |
4613 * metadata.row_type. The ith element | 3977 /// metadata.row_type. The ith element |
4614 * in each row matches the ith field in | 3978 /// in each row matches the ith field in |
4615 * metadata.row_type. Elements are | 3979 /// metadata.row_type. Elements are |
4616 * encoded based on type as described | 3980 /// encoded based on type as described |
4617 * here. | 3981 /// here. |
4618 * | 3982 /// |
4619 * The values for Object must be JSON objects. It can consist of `num`, | 3983 /// The values for Object must be JSON objects. It can consist of `num`, |
4620 * `String`, `bool` and `null` as well as `Map` and `List` values. | 3984 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
4621 */ | |
4622 core.List<core.List<core.Object>> rows; | 3985 core.List<core.List<core.Object>> rows; |
4623 /** | 3986 |
4624 * Query plan and execution statistics for the query that produced this | 3987 /// Query plan and execution statistics for the query that produced this |
4625 * result set. These can be requested by setting | 3988 /// result set. These can be requested by setting |
4626 * ExecuteSqlRequest.query_mode. | 3989 /// ExecuteSqlRequest.query_mode. |
4627 */ | |
4628 ResultSetStats stats; | 3990 ResultSetStats stats; |
4629 | 3991 |
4630 ResultSet(); | 3992 ResultSet(); |
4631 | 3993 |
4632 ResultSet.fromJson(core.Map _json) { | 3994 ResultSet.fromJson(core.Map _json) { |
4633 if (_json.containsKey("metadata")) { | 3995 if (_json.containsKey("metadata")) { |
4634 metadata = new ResultSetMetadata.fromJson(_json["metadata"]); | 3996 metadata = new ResultSetMetadata.fromJson(_json["metadata"]); |
4635 } | 3997 } |
4636 if (_json.containsKey("rows")) { | 3998 if (_json.containsKey("rows")) { |
4637 rows = _json["rows"]; | 3999 rows = _json["rows"]; |
4638 } | 4000 } |
4639 if (_json.containsKey("stats")) { | 4001 if (_json.containsKey("stats")) { |
4640 stats = new ResultSetStats.fromJson(_json["stats"]); | 4002 stats = new ResultSetStats.fromJson(_json["stats"]); |
4641 } | 4003 } |
4642 } | 4004 } |
4643 | 4005 |
4644 core.Map<core.String, core.Object> toJson() { | 4006 core.Map<core.String, core.Object> toJson() { |
4645 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4007 final core.Map<core.String, core.Object> _json = |
| 4008 new core.Map<core.String, core.Object>(); |
4646 if (metadata != null) { | 4009 if (metadata != null) { |
4647 _json["metadata"] = (metadata).toJson(); | 4010 _json["metadata"] = (metadata).toJson(); |
4648 } | 4011 } |
4649 if (rows != null) { | 4012 if (rows != null) { |
4650 _json["rows"] = rows; | 4013 _json["rows"] = rows; |
4651 } | 4014 } |
4652 if (stats != null) { | 4015 if (stats != null) { |
4653 _json["stats"] = (stats).toJson(); | 4016 _json["stats"] = (stats).toJson(); |
4654 } | 4017 } |
4655 return _json; | 4018 return _json; |
4656 } | 4019 } |
4657 } | 4020 } |
4658 | 4021 |
4659 /** Metadata about a ResultSet or PartialResultSet. */ | 4022 /// Metadata about a ResultSet or PartialResultSet. |
4660 class ResultSetMetadata { | 4023 class ResultSetMetadata { |
4661 /** | 4024 /// Indicates the field names and types for the rows in the result |
4662 * Indicates the field names and types for the rows in the result | 4025 /// set. For example, a SQL query like `"SELECT UserId, UserName FROM |
4663 * set. For example, a SQL query like `"SELECT UserId, UserName FROM | 4026 /// Users"` could return a `row_type` value like: |
4664 * Users"` could return a `row_type` value like: | 4027 /// |
4665 * | 4028 /// "fields": [ |
4666 * "fields": [ | 4029 /// { "name": "UserId", "type": { "code": "INT64" } }, |
4667 * { "name": "UserId", "type": { "code": "INT64" } }, | 4030 /// { "name": "UserName", "type": { "code": "STRING" } }, |
4668 * { "name": "UserName", "type": { "code": "STRING" } }, | 4031 /// ] |
4669 * ] | |
4670 */ | |
4671 StructType rowType; | 4032 StructType rowType; |
4672 /** | 4033 |
4673 * If the read or SQL query began a transaction as a side-effect, the | 4034 /// If the read or SQL query began a transaction as a side-effect, the |
4674 * information about the new transaction is yielded here. | 4035 /// information about the new transaction is yielded here. |
4675 */ | |
4676 Transaction transaction; | 4036 Transaction transaction; |
4677 | 4037 |
4678 ResultSetMetadata(); | 4038 ResultSetMetadata(); |
4679 | 4039 |
4680 ResultSetMetadata.fromJson(core.Map _json) { | 4040 ResultSetMetadata.fromJson(core.Map _json) { |
4681 if (_json.containsKey("rowType")) { | 4041 if (_json.containsKey("rowType")) { |
4682 rowType = new StructType.fromJson(_json["rowType"]); | 4042 rowType = new StructType.fromJson(_json["rowType"]); |
4683 } | 4043 } |
4684 if (_json.containsKey("transaction")) { | 4044 if (_json.containsKey("transaction")) { |
4685 transaction = new Transaction.fromJson(_json["transaction"]); | 4045 transaction = new Transaction.fromJson(_json["transaction"]); |
4686 } | 4046 } |
4687 } | 4047 } |
4688 | 4048 |
4689 core.Map<core.String, core.Object> toJson() { | 4049 core.Map<core.String, core.Object> toJson() { |
4690 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4050 final core.Map<core.String, core.Object> _json = |
| 4051 new core.Map<core.String, core.Object>(); |
4691 if (rowType != null) { | 4052 if (rowType != null) { |
4692 _json["rowType"] = (rowType).toJson(); | 4053 _json["rowType"] = (rowType).toJson(); |
4693 } | 4054 } |
4694 if (transaction != null) { | 4055 if (transaction != null) { |
4695 _json["transaction"] = (transaction).toJson(); | 4056 _json["transaction"] = (transaction).toJson(); |
4696 } | 4057 } |
4697 return _json; | 4058 return _json; |
4698 } | 4059 } |
4699 } | 4060 } |
4700 | 4061 |
4701 /** Additional statistics about a ResultSet or PartialResultSet. */ | 4062 /// Additional statistics about a ResultSet or PartialResultSet. |
4702 class ResultSetStats { | 4063 class ResultSetStats { |
4703 /** QueryPlan for the query associated with this result. */ | 4064 /// QueryPlan for the query associated with this result. |
4704 QueryPlan queryPlan; | 4065 QueryPlan queryPlan; |
4705 /** | 4066 |
4706 * Aggregated statistics from the execution of the query. Only present when | 4067 /// Aggregated statistics from the execution of the query. Only present when |
4707 * the query is profiled. For example, a query could return the statistics as | 4068 /// the query is profiled. For example, a query could return the statistics |
4708 * follows: | 4069 /// as |
4709 * | 4070 /// follows: |
4710 * { | 4071 /// |
4711 * "rows_returned": "3", | 4072 /// { |
4712 * "elapsed_time": "1.22 secs", | 4073 /// "rows_returned": "3", |
4713 * "cpu_time": "1.19 secs" | 4074 /// "elapsed_time": "1.22 secs", |
4714 * } | 4075 /// "cpu_time": "1.19 secs" |
4715 * | 4076 /// } |
4716 * The values for Object must be JSON objects. It can consist of `num`, | 4077 /// |
4717 * `String`, `bool` and `null` as well as `Map` and `List` values. | 4078 /// The values for Object must be JSON objects. It can consist of `num`, |
4718 */ | 4079 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
4719 core.Map<core.String, core.Object> queryStats; | 4080 core.Map<core.String, core.Object> queryStats; |
4720 | 4081 |
4721 ResultSetStats(); | 4082 ResultSetStats(); |
4722 | 4083 |
4723 ResultSetStats.fromJson(core.Map _json) { | 4084 ResultSetStats.fromJson(core.Map _json) { |
4724 if (_json.containsKey("queryPlan")) { | 4085 if (_json.containsKey("queryPlan")) { |
4725 queryPlan = new QueryPlan.fromJson(_json["queryPlan"]); | 4086 queryPlan = new QueryPlan.fromJson(_json["queryPlan"]); |
4726 } | 4087 } |
4727 if (_json.containsKey("queryStats")) { | 4088 if (_json.containsKey("queryStats")) { |
4728 queryStats = _json["queryStats"]; | 4089 queryStats = _json["queryStats"]; |
4729 } | 4090 } |
4730 } | 4091 } |
4731 | 4092 |
4732 core.Map<core.String, core.Object> toJson() { | 4093 core.Map<core.String, core.Object> toJson() { |
4733 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4094 final core.Map<core.String, core.Object> _json = |
| 4095 new core.Map<core.String, core.Object>(); |
4734 if (queryPlan != null) { | 4096 if (queryPlan != null) { |
4735 _json["queryPlan"] = (queryPlan).toJson(); | 4097 _json["queryPlan"] = (queryPlan).toJson(); |
4736 } | 4098 } |
4737 if (queryStats != null) { | 4099 if (queryStats != null) { |
4738 _json["queryStats"] = queryStats; | 4100 _json["queryStats"] = queryStats; |
4739 } | 4101 } |
4740 return _json; | 4102 return _json; |
4741 } | 4103 } |
4742 } | 4104 } |
4743 | 4105 |
4744 /** The request for Rollback. */ | 4106 /// The request for Rollback. |
4745 class RollbackRequest { | 4107 class RollbackRequest { |
4746 /** Required. The transaction to roll back. */ | 4108 /// Required. The transaction to roll back. |
4747 core.String transactionId; | 4109 core.String transactionId; |
4748 core.List<core.int> get transactionIdAsBytes { | 4110 core.List<core.int> get transactionIdAsBytes { |
4749 return convert.BASE64.decode(transactionId); | 4111 return convert.BASE64.decode(transactionId); |
4750 } | 4112 } |
4751 | 4113 |
4752 void set transactionIdAsBytes(core.List<core.int> _bytes) { | 4114 void set transactionIdAsBytes(core.List<core.int> _bytes) { |
4753 transactionId = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAl
l("+", "-"); | 4115 transactionId = |
| 4116 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
4754 } | 4117 } |
4755 | 4118 |
4756 RollbackRequest(); | 4119 RollbackRequest(); |
4757 | 4120 |
4758 RollbackRequest.fromJson(core.Map _json) { | 4121 RollbackRequest.fromJson(core.Map _json) { |
4759 if (_json.containsKey("transactionId")) { | 4122 if (_json.containsKey("transactionId")) { |
4760 transactionId = _json["transactionId"]; | 4123 transactionId = _json["transactionId"]; |
4761 } | 4124 } |
4762 } | 4125 } |
4763 | 4126 |
4764 core.Map<core.String, core.Object> toJson() { | 4127 core.Map<core.String, core.Object> toJson() { |
4765 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4128 final core.Map<core.String, core.Object> _json = |
| 4129 new core.Map<core.String, core.Object>(); |
4766 if (transactionId != null) { | 4130 if (transactionId != null) { |
4767 _json["transactionId"] = transactionId; | 4131 _json["transactionId"] = transactionId; |
4768 } | 4132 } |
4769 return _json; | 4133 return _json; |
4770 } | 4134 } |
4771 } | 4135 } |
4772 | 4136 |
4773 /** A rule to be applied in a Policy. */ | 4137 /// A session in the Cloud Spanner API. |
4774 class Rule { | |
4775 /** | |
4776 * Required | |
4777 * Possible string values are: | |
4778 * - "NO_ACTION" : Default no action. | |
4779 * - "ALLOW" : Matching 'Entries' grant access. | |
4780 * - "ALLOW_WITH_LOG" : Matching 'Entries' grant access and the caller | |
4781 * promises to log | |
4782 * the request per the returned log_configs. | |
4783 * - "DENY" : Matching 'Entries' deny access. | |
4784 * - "DENY_WITH_LOG" : Matching 'Entries' deny access and the caller promises | |
4785 * to log | |
4786 * the request per the returned log_configs. | |
4787 * - "LOG" : Matching 'Entries' tell IAM.Check callers to generate logs. | |
4788 */ | |
4789 core.String action; | |
4790 /** Additional restrictions that must be met */ | |
4791 core.List<Condition> conditions; | |
4792 /** Human-readable description of the rule. */ | |
4793 core.String description; | |
4794 /** | |
4795 * If one or more 'in' clauses are specified, the rule matches if | |
4796 * the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. | |
4797 */ | |
4798 core.List<core.String> in_; | |
4799 /** | |
4800 * The config returned to callers of tech.iam.IAM.CheckPolicy for any entries | |
4801 * that match the LOG action. | |
4802 */ | |
4803 core.List<LogConfig> logConfig; | |
4804 /** | |
4805 * If one or more 'not_in' clauses are specified, the rule matches | |
4806 * if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. | |
4807 * The format for in and not_in entries is the same as for members in a | |
4808 * Binding (see google/iam/v1/policy.proto). | |
4809 */ | |
4810 core.List<core.String> notIn; | |
4811 /** | |
4812 * A permission is a string of form '<service>.<resource type>.<verb>' | |
4813 * (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, | |
4814 * and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs. | |
4815 */ | |
4816 core.List<core.String> permissions; | |
4817 | |
4818 Rule(); | |
4819 | |
4820 Rule.fromJson(core.Map _json) { | |
4821 if (_json.containsKey("action")) { | |
4822 action = _json["action"]; | |
4823 } | |
4824 if (_json.containsKey("conditions")) { | |
4825 conditions = _json["conditions"].map((value) => new Condition.fromJson(val
ue)).toList(); | |
4826 } | |
4827 if (_json.containsKey("description")) { | |
4828 description = _json["description"]; | |
4829 } | |
4830 if (_json.containsKey("in")) { | |
4831 in_ = _json["in"]; | |
4832 } | |
4833 if (_json.containsKey("logConfig")) { | |
4834 logConfig = _json["logConfig"].map((value) => new LogConfig.fromJson(value
)).toList(); | |
4835 } | |
4836 if (_json.containsKey("notIn")) { | |
4837 notIn = _json["notIn"]; | |
4838 } | |
4839 if (_json.containsKey("permissions")) { | |
4840 permissions = _json["permissions"]; | |
4841 } | |
4842 } | |
4843 | |
4844 core.Map<core.String, core.Object> toJson() { | |
4845 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
4846 if (action != null) { | |
4847 _json["action"] = action; | |
4848 } | |
4849 if (conditions != null) { | |
4850 _json["conditions"] = conditions.map((value) => (value).toJson()).toList()
; | |
4851 } | |
4852 if (description != null) { | |
4853 _json["description"] = description; | |
4854 } | |
4855 if (in_ != null) { | |
4856 _json["in"] = in_; | |
4857 } | |
4858 if (logConfig != null) { | |
4859 _json["logConfig"] = logConfig.map((value) => (value).toJson()).toList(); | |
4860 } | |
4861 if (notIn != null) { | |
4862 _json["notIn"] = notIn; | |
4863 } | |
4864 if (permissions != null) { | |
4865 _json["permissions"] = permissions; | |
4866 } | |
4867 return _json; | |
4868 } | |
4869 } | |
4870 | |
4871 /** A session in the Cloud Spanner API. */ | |
4872 class Session { | 4138 class Session { |
4873 /** Required. The name of the session. */ | 4139 /// Required. The name of the session. |
4874 core.String name; | 4140 core.String name; |
4875 | 4141 |
4876 Session(); | 4142 Session(); |
4877 | 4143 |
4878 Session.fromJson(core.Map _json) { | 4144 Session.fromJson(core.Map _json) { |
4879 if (_json.containsKey("name")) { | 4145 if (_json.containsKey("name")) { |
4880 name = _json["name"]; | 4146 name = _json["name"]; |
4881 } | 4147 } |
4882 } | 4148 } |
4883 | 4149 |
4884 core.Map<core.String, core.Object> toJson() { | 4150 core.Map<core.String, core.Object> toJson() { |
4885 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4151 final core.Map<core.String, core.Object> _json = |
| 4152 new core.Map<core.String, core.Object>(); |
4886 if (name != null) { | 4153 if (name != null) { |
4887 _json["name"] = name; | 4154 _json["name"] = name; |
4888 } | 4155 } |
4889 return _json; | 4156 return _json; |
4890 } | 4157 } |
4891 } | 4158 } |
4892 | 4159 |
4893 /** Request message for `SetIamPolicy` method. */ | 4160 /// Request message for `SetIamPolicy` method. |
4894 class SetIamPolicyRequest { | 4161 class SetIamPolicyRequest { |
4895 /** | 4162 /// REQUIRED: The complete policy to be applied to the `resource`. The size |
4896 * REQUIRED: The complete policy to be applied to the `resource`. The size of | 4163 /// of |
4897 * the policy is limited to a few 10s of KB. An empty policy is a | 4164 /// the policy is limited to a few 10s of KB. An empty policy is a |
4898 * valid policy but certain Cloud Platform services (such as Projects) | 4165 /// valid policy but certain Cloud Platform services (such as Projects) |
4899 * might reject them. | 4166 /// might reject them. |
4900 */ | |
4901 Policy policy; | 4167 Policy policy; |
4902 /** | |
4903 * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only | |
4904 * the fields in the mask will be modified. If no mask is provided, the | |
4905 * following default mask is used: | |
4906 * paths: "bindings, etag" | |
4907 * This field is only used by Cloud IAM. | |
4908 */ | |
4909 core.String updateMask; | |
4910 | 4168 |
4911 SetIamPolicyRequest(); | 4169 SetIamPolicyRequest(); |
4912 | 4170 |
4913 SetIamPolicyRequest.fromJson(core.Map _json) { | 4171 SetIamPolicyRequest.fromJson(core.Map _json) { |
4914 if (_json.containsKey("policy")) { | 4172 if (_json.containsKey("policy")) { |
4915 policy = new Policy.fromJson(_json["policy"]); | 4173 policy = new Policy.fromJson(_json["policy"]); |
4916 } | 4174 } |
4917 if (_json.containsKey("updateMask")) { | |
4918 updateMask = _json["updateMask"]; | |
4919 } | |
4920 } | 4175 } |
4921 | 4176 |
4922 core.Map<core.String, core.Object> toJson() { | 4177 core.Map<core.String, core.Object> toJson() { |
4923 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4178 final core.Map<core.String, core.Object> _json = |
| 4179 new core.Map<core.String, core.Object>(); |
4924 if (policy != null) { | 4180 if (policy != null) { |
4925 _json["policy"] = (policy).toJson(); | 4181 _json["policy"] = (policy).toJson(); |
4926 } | 4182 } |
4927 if (updateMask != null) { | |
4928 _json["updateMask"] = updateMask; | |
4929 } | |
4930 return _json; | 4183 return _json; |
4931 } | 4184 } |
4932 } | 4185 } |
4933 | 4186 |
4934 /** | 4187 /// Condensed representation of a node and its subtree. Only present for |
4935 * Condensed representation of a node and its subtree. Only present for | 4188 /// `SCALAR` PlanNode(s). |
4936 * `SCALAR` PlanNode(s). | |
4937 */ | |
4938 class ShortRepresentation { | 4189 class ShortRepresentation { |
4939 /** A string representation of the expression subtree rooted at this node. */ | 4190 /// A string representation of the expression subtree rooted at this node. |
4940 core.String description; | 4191 core.String description; |
4941 /** | 4192 |
4942 * A mapping of (subquery variable name) -> (subquery node id) for cases | 4193 /// A mapping of (subquery variable name) -> (subquery node id) for cases |
4943 * where the `description` string of this node references a `SCALAR` | 4194 /// where the `description` string of this node references a `SCALAR` |
4944 * subquery contained in the expression subtree rooted at this node. The | 4195 /// subquery contained in the expression subtree rooted at this node. The |
4945 * referenced `SCALAR` subquery may not necessarily be a direct child of | 4196 /// referenced `SCALAR` subquery may not necessarily be a direct child of |
4946 * this node. | 4197 /// this node. |
4947 */ | |
4948 core.Map<core.String, core.int> subqueries; | 4198 core.Map<core.String, core.int> subqueries; |
4949 | 4199 |
4950 ShortRepresentation(); | 4200 ShortRepresentation(); |
4951 | 4201 |
4952 ShortRepresentation.fromJson(core.Map _json) { | 4202 ShortRepresentation.fromJson(core.Map _json) { |
4953 if (_json.containsKey("description")) { | 4203 if (_json.containsKey("description")) { |
4954 description = _json["description"]; | 4204 description = _json["description"]; |
4955 } | 4205 } |
4956 if (_json.containsKey("subqueries")) { | 4206 if (_json.containsKey("subqueries")) { |
4957 subqueries = _json["subqueries"]; | 4207 subqueries = _json["subqueries"]; |
4958 } | 4208 } |
4959 } | 4209 } |
4960 | 4210 |
4961 core.Map<core.String, core.Object> toJson() { | 4211 core.Map<core.String, core.Object> toJson() { |
4962 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4212 final core.Map<core.String, core.Object> _json = |
| 4213 new core.Map<core.String, core.Object>(); |
4963 if (description != null) { | 4214 if (description != null) { |
4964 _json["description"] = description; | 4215 _json["description"] = description; |
4965 } | 4216 } |
4966 if (subqueries != null) { | 4217 if (subqueries != null) { |
4967 _json["subqueries"] = subqueries; | 4218 _json["subqueries"] = subqueries; |
4968 } | 4219 } |
4969 return _json; | 4220 return _json; |
4970 } | 4221 } |
4971 } | 4222 } |
4972 | 4223 |
4973 /** | 4224 /// The `Status` type defines a logical error model that is suitable for |
4974 * The `Status` type defines a logical error model that is suitable for | 4225 /// different |
4975 * different | 4226 /// programming environments, including REST APIs and RPC APIs. It is used by |
4976 * programming environments, including REST APIs and RPC APIs. It is used by | 4227 /// [gRPC](https://github.com/grpc). The error model is designed to be: |
4977 * [gRPC](https://github.com/grpc). The error model is designed to be: | 4228 /// |
4978 * | 4229 /// - Simple to use and understand for most users |
4979 * - Simple to use and understand for most users | 4230 /// - Flexible enough to meet unexpected needs |
4980 * - Flexible enough to meet unexpected needs | 4231 /// |
4981 * | 4232 /// # Overview |
4982 * # Overview | 4233 /// |
4983 * | 4234 /// The `Status` message contains three pieces of data: error code, error |
4984 * The `Status` message contains three pieces of data: error code, error | 4235 /// message, |
4985 * message, | 4236 /// and error details. The error code should be an enum value of |
4986 * and error details. The error code should be an enum value of | 4237 /// google.rpc.Code, but it may accept additional error codes if needed. The |
4987 * google.rpc.Code, but it may accept additional error codes if needed. The | 4238 /// error message should be a developer-facing English message that helps |
4988 * error message should be a developer-facing English message that helps | 4239 /// developers *understand* and *resolve* the error. If a localized user-facing |
4989 * developers *understand* and *resolve* the error. If a localized user-facing | 4240 /// error message is needed, put the localized message in the error details or |
4990 * error message is needed, put the localized message in the error details or | 4241 /// localize it in the client. The optional error details may contain arbitrary |
4991 * localize it in the client. The optional error details may contain arbitrary | 4242 /// information about the error. There is a predefined set of error detail |
4992 * information about the error. There is a predefined set of error detail types | 4243 /// types |
4993 * in the package `google.rpc` that can be used for common error conditions. | 4244 /// in the package `google.rpc` that can be used for common error conditions. |
4994 * | 4245 /// |
4995 * # Language mapping | 4246 /// # Language mapping |
4996 * | 4247 /// |
4997 * The `Status` message is the logical representation of the error model, but it | 4248 /// The `Status` message is the logical representation of the error model, but |
4998 * is not necessarily the actual wire format. When the `Status` message is | 4249 /// it |
4999 * exposed in different client libraries and different wire protocols, it can be | 4250 /// is not necessarily the actual wire format. When the `Status` message is |
5000 * mapped differently. For example, it will likely be mapped to some exceptions | 4251 /// exposed in different client libraries and different wire protocols, it can |
5001 * in Java, but more likely mapped to some error codes in C. | 4252 /// be |
5002 * | 4253 /// mapped differently. For example, it will likely be mapped to some |
5003 * # Other uses | 4254 /// exceptions |
5004 * | 4255 /// in Java, but more likely mapped to some error codes in C. |
5005 * The error model and the `Status` message can be used in a variety of | 4256 /// |
5006 * environments, either with or without APIs, to provide a | 4257 /// # Other uses |
5007 * consistent developer experience across different environments. | 4258 /// |
5008 * | 4259 /// The error model and the `Status` message can be used in a variety of |
5009 * Example uses of this error model include: | 4260 /// environments, either with or without APIs, to provide a |
5010 * | 4261 /// consistent developer experience across different environments. |
5011 * - Partial errors. If a service needs to return partial errors to the client, | 4262 /// |
5012 * it may embed the `Status` in the normal response to indicate the partial | 4263 /// Example uses of this error model include: |
5013 * errors. | 4264 /// |
5014 * | 4265 /// - Partial errors. If a service needs to return partial errors to the |
5015 * - Workflow errors. A typical workflow has multiple steps. Each step may | 4266 /// client, |
5016 * have a `Status` message for error reporting. | 4267 /// it may embed the `Status` in the normal response to indicate the partial |
5017 * | 4268 /// errors. |
5018 * - Batch operations. If a client uses batch request and batch response, the | 4269 /// |
5019 * `Status` message should be used directly inside batch response, one for | 4270 /// - Workflow errors. A typical workflow has multiple steps. Each step may |
5020 * each error sub-response. | 4271 /// have a `Status` message for error reporting. |
5021 * | 4272 /// |
5022 * - Asynchronous operations. If an API call embeds asynchronous operation | 4273 /// - Batch operations. If a client uses batch request and batch response, the |
5023 * results in its response, the status of those operations should be | 4274 /// `Status` message should be used directly inside batch response, one for |
5024 * represented directly using the `Status` message. | 4275 /// each error sub-response. |
5025 * | 4276 /// |
5026 * - Logging. If some API errors are stored in logs, the message `Status` could | 4277 /// - Asynchronous operations. If an API call embeds asynchronous operation |
5027 * be used directly after any stripping needed for security/privacy reasons. | 4278 /// results in its response, the status of those operations should be |
5028 */ | 4279 /// represented directly using the `Status` message. |
| 4280 /// |
| 4281 /// - Logging. If some API errors are stored in logs, the message `Status` |
| 4282 /// could |
| 4283 /// be used directly after any stripping needed for security/privacy reasons. |
5029 class Status { | 4284 class Status { |
5030 /** The status code, which should be an enum value of google.rpc.Code. */ | 4285 /// The status code, which should be an enum value of google.rpc.Code. |
5031 core.int code; | 4286 core.int code; |
5032 /** | 4287 |
5033 * A list of messages that carry the error details. There is a common set of | 4288 /// A list of messages that carry the error details. There is a common set |
5034 * message types for APIs to use. | 4289 /// of |
5035 * | 4290 /// message types for APIs to use. |
5036 * The values for Object must be JSON objects. It can consist of `num`, | 4291 /// |
5037 * `String`, `bool` and `null` as well as `Map` and `List` values. | 4292 /// The values for Object must be JSON objects. It can consist of `num`, |
5038 */ | 4293 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
5039 core.List<core.Map<core.String, core.Object>> details; | 4294 core.List<core.Map<core.String, core.Object>> details; |
5040 /** | 4295 |
5041 * A developer-facing error message, which should be in English. Any | 4296 /// A developer-facing error message, which should be in English. Any |
5042 * user-facing error message should be localized and sent in the | 4297 /// user-facing error message should be localized and sent in the |
5043 * google.rpc.Status.details field, or localized by the client. | 4298 /// google.rpc.Status.details field, or localized by the client. |
5044 */ | |
5045 core.String message; | 4299 core.String message; |
5046 | 4300 |
5047 Status(); | 4301 Status(); |
5048 | 4302 |
5049 Status.fromJson(core.Map _json) { | 4303 Status.fromJson(core.Map _json) { |
5050 if (_json.containsKey("code")) { | 4304 if (_json.containsKey("code")) { |
5051 code = _json["code"]; | 4305 code = _json["code"]; |
5052 } | 4306 } |
5053 if (_json.containsKey("details")) { | 4307 if (_json.containsKey("details")) { |
5054 details = _json["details"]; | 4308 details = _json["details"]; |
5055 } | 4309 } |
5056 if (_json.containsKey("message")) { | 4310 if (_json.containsKey("message")) { |
5057 message = _json["message"]; | 4311 message = _json["message"]; |
5058 } | 4312 } |
5059 } | 4313 } |
5060 | 4314 |
5061 core.Map<core.String, core.Object> toJson() { | 4315 core.Map<core.String, core.Object> toJson() { |
5062 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4316 final core.Map<core.String, core.Object> _json = |
| 4317 new core.Map<core.String, core.Object>(); |
5063 if (code != null) { | 4318 if (code != null) { |
5064 _json["code"] = code; | 4319 _json["code"] = code; |
5065 } | 4320 } |
5066 if (details != null) { | 4321 if (details != null) { |
5067 _json["details"] = details; | 4322 _json["details"] = details; |
5068 } | 4323 } |
5069 if (message != null) { | 4324 if (message != null) { |
5070 _json["message"] = message; | 4325 _json["message"] = message; |
5071 } | 4326 } |
5072 return _json; | 4327 return _json; |
5073 } | 4328 } |
5074 } | 4329 } |
5075 | 4330 |
5076 /** `StructType` defines the fields of a STRUCT type. */ | 4331 /// `StructType` defines the fields of a STRUCT type. |
5077 class StructType { | 4332 class StructType { |
5078 /** | 4333 /// The list of fields that make up this struct. Order is |
5079 * The list of fields that make up this struct. Order is | 4334 /// significant, because values of this struct type are represented as |
5080 * significant, because values of this struct type are represented as | 4335 /// lists, where the order of field values matches the order of |
5081 * lists, where the order of field values matches the order of | 4336 /// fields in the StructType. In turn, the order of fields |
5082 * fields in the StructType. In turn, the order of fields | 4337 /// matches the order of columns in a read request, or the order of |
5083 * matches the order of columns in a read request, or the order of | 4338 /// fields in the `SELECT` clause of a query. |
5084 * fields in the `SELECT` clause of a query. | |
5085 */ | |
5086 core.List<Field> fields; | 4339 core.List<Field> fields; |
5087 | 4340 |
5088 StructType(); | 4341 StructType(); |
5089 | 4342 |
5090 StructType.fromJson(core.Map _json) { | 4343 StructType.fromJson(core.Map _json) { |
5091 if (_json.containsKey("fields")) { | 4344 if (_json.containsKey("fields")) { |
5092 fields = _json["fields"].map((value) => new Field.fromJson(value)).toList(
); | 4345 fields = |
| 4346 _json["fields"].map((value) => new Field.fromJson(value)).toList(); |
5093 } | 4347 } |
5094 } | 4348 } |
5095 | 4349 |
5096 core.Map<core.String, core.Object> toJson() { | 4350 core.Map<core.String, core.Object> toJson() { |
5097 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4351 final core.Map<core.String, core.Object> _json = |
| 4352 new core.Map<core.String, core.Object>(); |
5098 if (fields != null) { | 4353 if (fields != null) { |
5099 _json["fields"] = fields.map((value) => (value).toJson()).toList(); | 4354 _json["fields"] = fields.map((value) => (value).toJson()).toList(); |
5100 } | 4355 } |
5101 return _json; | 4356 return _json; |
5102 } | 4357 } |
5103 } | 4358 } |
5104 | 4359 |
5105 /** Request message for `TestIamPermissions` method. */ | 4360 /// Request message for `TestIamPermissions` method. |
5106 class TestIamPermissionsRequest { | 4361 class TestIamPermissionsRequest { |
5107 /** | 4362 /// REQUIRED: The set of permissions to check for 'resource'. |
5108 * REQUIRED: The set of permissions to check for 'resource'. | 4363 /// Permissions with wildcards (such as '*', 'spanner.*', |
5109 * Permissions with wildcards (such as '*', 'spanner.*', | 4364 /// 'spanner.instances.*') are not allowed. |
5110 * 'spanner.instances.*') are not allowed. | |
5111 */ | |
5112 core.List<core.String> permissions; | 4365 core.List<core.String> permissions; |
5113 | 4366 |
5114 TestIamPermissionsRequest(); | 4367 TestIamPermissionsRequest(); |
5115 | 4368 |
5116 TestIamPermissionsRequest.fromJson(core.Map _json) { | 4369 TestIamPermissionsRequest.fromJson(core.Map _json) { |
5117 if (_json.containsKey("permissions")) { | 4370 if (_json.containsKey("permissions")) { |
5118 permissions = _json["permissions"]; | 4371 permissions = _json["permissions"]; |
5119 } | 4372 } |
5120 } | 4373 } |
5121 | 4374 |
5122 core.Map<core.String, core.Object> toJson() { | 4375 core.Map<core.String, core.Object> toJson() { |
5123 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4376 final core.Map<core.String, core.Object> _json = |
| 4377 new core.Map<core.String, core.Object>(); |
5124 if (permissions != null) { | 4378 if (permissions != null) { |
5125 _json["permissions"] = permissions; | 4379 _json["permissions"] = permissions; |
5126 } | 4380 } |
5127 return _json; | 4381 return _json; |
5128 } | 4382 } |
5129 } | 4383 } |
5130 | 4384 |
5131 /** Response message for `TestIamPermissions` method. */ | 4385 /// Response message for `TestIamPermissions` method. |
5132 class TestIamPermissionsResponse { | 4386 class TestIamPermissionsResponse { |
5133 /** | 4387 /// A subset of `TestPermissionsRequest.permissions` that the caller is |
5134 * A subset of `TestPermissionsRequest.permissions` that the caller is | 4388 /// allowed. |
5135 * allowed. | |
5136 */ | |
5137 core.List<core.String> permissions; | 4389 core.List<core.String> permissions; |
5138 | 4390 |
5139 TestIamPermissionsResponse(); | 4391 TestIamPermissionsResponse(); |
5140 | 4392 |
5141 TestIamPermissionsResponse.fromJson(core.Map _json) { | 4393 TestIamPermissionsResponse.fromJson(core.Map _json) { |
5142 if (_json.containsKey("permissions")) { | 4394 if (_json.containsKey("permissions")) { |
5143 permissions = _json["permissions"]; | 4395 permissions = _json["permissions"]; |
5144 } | 4396 } |
5145 } | 4397 } |
5146 | 4398 |
5147 core.Map<core.String, core.Object> toJson() { | 4399 core.Map<core.String, core.Object> toJson() { |
5148 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4400 final core.Map<core.String, core.Object> _json = |
| 4401 new core.Map<core.String, core.Object>(); |
5149 if (permissions != null) { | 4402 if (permissions != null) { |
5150 _json["permissions"] = permissions; | 4403 _json["permissions"] = permissions; |
5151 } | 4404 } |
5152 return _json; | 4405 return _json; |
5153 } | 4406 } |
5154 } | 4407 } |
5155 | 4408 |
5156 /** A transaction. */ | 4409 /// A transaction. |
5157 class Transaction { | 4410 class Transaction { |
5158 /** | 4411 /// `id` may be used to identify the transaction in subsequent |
5159 * `id` may be used to identify the transaction in subsequent | 4412 /// Read, |
5160 * Read, | 4413 /// ExecuteSql, |
5161 * ExecuteSql, | 4414 /// Commit, or |
5162 * Commit, or | 4415 /// Rollback calls. |
5163 * Rollback calls. | 4416 /// |
5164 * | 4417 /// Single-use read-only transactions do not have IDs, because |
5165 * Single-use read-only transactions do not have IDs, because | 4418 /// single-use transactions do not support multiple requests. |
5166 * single-use transactions do not support multiple requests. | |
5167 */ | |
5168 core.String id; | 4419 core.String id; |
5169 core.List<core.int> get idAsBytes { | 4420 core.List<core.int> get idAsBytes { |
5170 return convert.BASE64.decode(id); | 4421 return convert.BASE64.decode(id); |
5171 } | 4422 } |
5172 | 4423 |
5173 void set idAsBytes(core.List<core.int> _bytes) { | 4424 void set idAsBytes(core.List<core.int> _bytes) { |
5174 id = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-")
; | 4425 id = |
| 4426 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
5175 } | 4427 } |
5176 /** | 4428 |
5177 * For snapshot read-only transactions, the read timestamp chosen | 4429 /// For snapshot read-only transactions, the read timestamp chosen |
5178 * for the transaction. Not returned by default: see | 4430 /// for the transaction. Not returned by default: see |
5179 * TransactionOptions.ReadOnly.return_read_timestamp. | 4431 /// TransactionOptions.ReadOnly.return_read_timestamp. |
5180 */ | |
5181 core.String readTimestamp; | 4432 core.String readTimestamp; |
5182 | 4433 |
5183 Transaction(); | 4434 Transaction(); |
5184 | 4435 |
5185 Transaction.fromJson(core.Map _json) { | 4436 Transaction.fromJson(core.Map _json) { |
5186 if (_json.containsKey("id")) { | 4437 if (_json.containsKey("id")) { |
5187 id = _json["id"]; | 4438 id = _json["id"]; |
5188 } | 4439 } |
5189 if (_json.containsKey("readTimestamp")) { | 4440 if (_json.containsKey("readTimestamp")) { |
5190 readTimestamp = _json["readTimestamp"]; | 4441 readTimestamp = _json["readTimestamp"]; |
5191 } | 4442 } |
5192 } | 4443 } |
5193 | 4444 |
5194 core.Map<core.String, core.Object> toJson() { | 4445 core.Map<core.String, core.Object> toJson() { |
5195 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4446 final core.Map<core.String, core.Object> _json = |
| 4447 new core.Map<core.String, core.Object>(); |
5196 if (id != null) { | 4448 if (id != null) { |
5197 _json["id"] = id; | 4449 _json["id"] = id; |
5198 } | 4450 } |
5199 if (readTimestamp != null) { | 4451 if (readTimestamp != null) { |
5200 _json["readTimestamp"] = readTimestamp; | 4452 _json["readTimestamp"] = readTimestamp; |
5201 } | 4453 } |
5202 return _json; | 4454 return _json; |
5203 } | 4455 } |
5204 } | 4456 } |
5205 | 4457 |
5206 /** | 4458 /// # Transactions |
5207 * # Transactions | 4459 /// |
5208 * | 4460 /// |
5209 * | 4461 /// Each session can have at most one active transaction at a time. After the |
5210 * Each session can have at most one active transaction at a time. After the | 4462 /// active transaction is completed, the session can immediately be |
5211 * active transaction is completed, the session can immediately be | 4463 /// re-used for the next transaction. It is not necessary to create a |
5212 * re-used for the next transaction. It is not necessary to create a | 4464 /// new session for each transaction. |
5213 * new session for each transaction. | 4465 /// |
5214 * | 4466 /// # Transaction Modes |
5215 * # Transaction Modes | 4467 /// |
5216 * | 4468 /// Cloud Spanner supports two transaction modes: |
5217 * Cloud Spanner supports two transaction modes: | 4469 /// |
5218 * | 4470 /// 1. Locking read-write. This type of transaction is the only way |
5219 * 1. Locking read-write. This type of transaction is the only way | 4471 /// to write data into Cloud Spanner. These transactions rely on |
5220 * to write data into Cloud Spanner. These transactions rely on | 4472 /// pessimistic locking and, if necessary, two-phase commit. |
5221 * pessimistic locking and, if necessary, two-phase commit. | 4473 /// Locking read-write transactions may abort, requiring the |
5222 * Locking read-write transactions may abort, requiring the | 4474 /// application to retry. |
5223 * application to retry. | 4475 /// |
5224 * | 4476 /// 2. Snapshot read-only. This transaction type provides guaranteed |
5225 * 2. Snapshot read-only. This transaction type provides guaranteed | 4477 /// consistency across several reads, but does not allow |
5226 * consistency across several reads, but does not allow | 4478 /// writes. Snapshot read-only transactions can be configured to |
5227 * writes. Snapshot read-only transactions can be configured to | 4479 /// read at timestamps in the past. Snapshot read-only |
5228 * read at timestamps in the past. Snapshot read-only | 4480 /// transactions do not need to be committed. |
5229 * transactions do not need to be committed. | 4481 /// |
5230 * | 4482 /// For transactions that only read, snapshot read-only transactions |
5231 * For transactions that only read, snapshot read-only transactions | 4483 /// provide simpler semantics and are almost always faster. In |
5232 * provide simpler semantics and are almost always faster. In | 4484 /// particular, read-only transactions do not take locks, so they do |
5233 * particular, read-only transactions do not take locks, so they do | 4485 /// not conflict with read-write transactions. As a consequence of not |
5234 * not conflict with read-write transactions. As a consequence of not | 4486 /// taking locks, they also do not abort, so retry loops are not needed. |
5235 * taking locks, they also do not abort, so retry loops are not needed. | 4487 /// |
5236 * | 4488 /// Transactions may only read/write data in a single database. They |
5237 * Transactions may only read/write data in a single database. They | 4489 /// may, however, read/write data in different tables within that |
5238 * may, however, read/write data in different tables within that | 4490 /// database. |
5239 * database. | 4491 /// |
5240 * | 4492 /// ## Locking Read-Write Transactions |
5241 * ## Locking Read-Write Transactions | 4493 /// |
5242 * | 4494 /// Locking transactions may be used to atomically read-modify-write |
5243 * Locking transactions may be used to atomically read-modify-write | 4495 /// data anywhere in a database. This type of transaction is externally |
5244 * data anywhere in a database. This type of transaction is externally | 4496 /// consistent. |
5245 * consistent. | 4497 /// |
5246 * | 4498 /// Clients should attempt to minimize the amount of time a transaction |
5247 * Clients should attempt to minimize the amount of time a transaction | 4499 /// is active. Faster transactions commit with higher probability |
5248 * is active. Faster transactions commit with higher probability | 4500 /// and cause less contention. Cloud Spanner attempts to keep read locks |
5249 * and cause less contention. Cloud Spanner attempts to keep read locks | 4501 /// active as long as the transaction continues to do reads, and the |
5250 * active as long as the transaction continues to do reads, and the | 4502 /// transaction has not been terminated by |
5251 * transaction has not been terminated by | 4503 /// Commit or |
5252 * Commit or | 4504 /// Rollback. Long periods of |
5253 * Rollback. Long periods of | 4505 /// inactivity at the client may cause Cloud Spanner to release a |
5254 * inactivity at the client may cause Cloud Spanner to release a | 4506 /// transaction's locks and abort it. |
5255 * transaction's locks and abort it. | 4507 /// |
5256 * | 4508 /// Reads performed within a transaction acquire locks on the data |
5257 * Reads performed within a transaction acquire locks on the data | 4509 /// being read. Writes can only be done at commit time, after all reads |
5258 * being read. Writes can only be done at commit time, after all reads | 4510 /// have been completed. |
5259 * have been completed. | 4511 /// Conceptually, a read-write transaction consists of zero or more |
5260 * Conceptually, a read-write transaction consists of zero or more | 4512 /// reads or SQL queries followed by |
5261 * reads or SQL queries followed by | 4513 /// Commit. At any time before |
5262 * Commit. At any time before | 4514 /// Commit, the client can send a |
5263 * Commit, the client can send a | 4515 /// Rollback request to abort the |
5264 * Rollback request to abort the | 4516 /// transaction. |
5265 * transaction. | 4517 /// |
5266 * | 4518 /// ### Semantics |
5267 * ### Semantics | 4519 /// |
5268 * | 4520 /// Cloud Spanner can commit the transaction if all read locks it acquired |
5269 * Cloud Spanner can commit the transaction if all read locks it acquired | 4521 /// are still valid at commit time, and it is able to acquire write |
5270 * are still valid at commit time, and it is able to acquire write | 4522 /// locks for all writes. Cloud Spanner can abort the transaction for any |
5271 * locks for all writes. Cloud Spanner can abort the transaction for any | 4523 /// reason. If a commit attempt returns `ABORTED`, Cloud Spanner guarantees |
5272 * reason. If a commit attempt returns `ABORTED`, Cloud Spanner guarantees | 4524 /// that the transaction has not modified any user data in Cloud Spanner. |
5273 * that the transaction has not modified any user data in Cloud Spanner. | 4525 /// |
5274 * | 4526 /// Unless the transaction commits, Cloud Spanner makes no guarantees about |
5275 * Unless the transaction commits, Cloud Spanner makes no guarantees about | 4527 /// how long the transaction's locks were held for. It is an error to |
5276 * how long the transaction's locks were held for. It is an error to | 4528 /// use Cloud Spanner locks for any sort of mutual exclusion other than |
5277 * use Cloud Spanner locks for any sort of mutual exclusion other than | 4529 /// between Cloud Spanner transactions themselves. |
5278 * between Cloud Spanner transactions themselves. | 4530 /// |
5279 * | 4531 /// ### Retrying Aborted Transactions |
5280 * ### Retrying Aborted Transactions | 4532 /// |
5281 * | 4533 /// When a transaction aborts, the application can choose to retry the |
5282 * When a transaction aborts, the application can choose to retry the | 4534 /// whole transaction again. To maximize the chances of successfully |
5283 * whole transaction again. To maximize the chances of successfully | 4535 /// committing the retry, the client should execute the retry in the |
5284 * committing the retry, the client should execute the retry in the | 4536 /// same session as the original attempt. The original session's lock |
5285 * same session as the original attempt. The original session's lock | 4537 /// priority increases with each consecutive abort, meaning that each |
5286 * priority increases with each consecutive abort, meaning that each | 4538 /// attempt has a slightly better chance of success than the previous. |
5287 * attempt has a slightly better chance of success than the previous. | 4539 /// |
5288 * | 4540 /// Under some circumstances (e.g., many transactions attempting to |
5289 * Under some circumstances (e.g., many transactions attempting to | 4541 /// modify the same row(s)), a transaction can abort many times in a |
5290 * modify the same row(s)), a transaction can abort many times in a | 4542 /// short period before successfully committing. Thus, it is not a good |
5291 * short period before successfully committing. Thus, it is not a good | 4543 /// idea to cap the number of retries a transaction can attempt; |
5292 * idea to cap the number of retries a transaction can attempt; | 4544 /// instead, it is better to limit the total amount of wall time spent |
5293 * instead, it is better to limit the total amount of wall time spent | 4545 /// retrying. |
5294 * retrying. | 4546 /// |
5295 * | 4547 /// ### Idle Transactions |
5296 * ### Idle Transactions | 4548 /// |
5297 * | 4549 /// A transaction is considered idle if it has no outstanding reads or |
5298 * A transaction is considered idle if it has no outstanding reads or | 4550 /// SQL queries and has not started a read or SQL query within the last 10 |
5299 * SQL queries and has not started a read or SQL query within the last 10 | 4551 /// seconds. Idle transactions can be aborted by Cloud Spanner so that they |
5300 * seconds. Idle transactions can be aborted by Cloud Spanner so that they | 4552 /// don't hold on to locks indefinitely. In that case, the commit will |
5301 * don't hold on to locks indefinitely. In that case, the commit will | 4553 /// fail with error `ABORTED`. |
5302 * fail with error `ABORTED`. | 4554 /// |
5303 * | 4555 /// If this behavior is undesirable, periodically executing a simple |
5304 * If this behavior is undesirable, periodically executing a simple | 4556 /// SQL query in the transaction (e.g., `SELECT 1`) prevents the |
5305 * SQL query in the transaction (e.g., `SELECT 1`) prevents the | 4557 /// transaction from becoming idle. |
5306 * transaction from becoming idle. | 4558 /// |
5307 * | 4559 /// ## Snapshot Read-Only Transactions |
5308 * ## Snapshot Read-Only Transactions | 4560 /// |
5309 * | 4561 /// Snapshot read-only transactions provides a simpler method than |
5310 * Snapshot read-only transactions provides a simpler method than | 4562 /// locking read-write transactions for doing several consistent |
5311 * locking read-write transactions for doing several consistent | 4563 /// reads. However, this type of transaction does not support writes. |
5312 * reads. However, this type of transaction does not support writes. | 4564 /// |
5313 * | 4565 /// Snapshot transactions do not take locks. Instead, they work by |
5314 * Snapshot transactions do not take locks. Instead, they work by | 4566 /// choosing a Cloud Spanner timestamp, then executing all reads at that |
5315 * choosing a Cloud Spanner timestamp, then executing all reads at that | 4567 /// timestamp. Since they do not acquire locks, they do not block |
5316 * timestamp. Since they do not acquire locks, they do not block | 4568 /// concurrent read-write transactions. |
5317 * concurrent read-write transactions. | 4569 /// |
5318 * | 4570 /// Unlike locking read-write transactions, snapshot read-only |
5319 * Unlike locking read-write transactions, snapshot read-only | 4571 /// transactions never abort. They can fail if the chosen read |
5320 * transactions never abort. They can fail if the chosen read | 4572 /// timestamp is garbage collected; however, the default garbage |
5321 * timestamp is garbage collected; however, the default garbage | 4573 /// collection policy is generous enough that most applications do not |
5322 * collection policy is generous enough that most applications do not | 4574 /// need to worry about this in practice. |
5323 * need to worry about this in practice. | 4575 /// |
5324 * | 4576 /// Snapshot read-only transactions do not need to call |
5325 * Snapshot read-only transactions do not need to call | 4577 /// Commit or |
5326 * Commit or | 4578 /// Rollback (and in fact are not |
5327 * Rollback (and in fact are not | 4579 /// permitted to do so). |
5328 * permitted to do so). | 4580 /// |
5329 * | 4581 /// To execute a snapshot transaction, the client specifies a timestamp |
5330 * To execute a snapshot transaction, the client specifies a timestamp | 4582 /// bound, which tells Cloud Spanner how to choose a read timestamp. |
5331 * bound, which tells Cloud Spanner how to choose a read timestamp. | 4583 /// |
5332 * | 4584 /// The types of timestamp bound are: |
5333 * The types of timestamp bound are: | 4585 /// |
5334 * | 4586 /// - Strong (the default). |
5335 * - Strong (the default). | 4587 /// - Bounded staleness. |
5336 * - Bounded staleness. | 4588 /// - Exact staleness. |
5337 * - Exact staleness. | 4589 /// |
5338 * | 4590 /// If the Cloud Spanner database to be read is geographically distributed, |
5339 * If the Cloud Spanner database to be read is geographically distributed, | 4591 /// stale read-only transactions can execute more quickly than strong |
5340 * stale read-only transactions can execute more quickly than strong | 4592 /// or read-write transaction, because they are able to execute far |
5341 * or read-write transaction, because they are able to execute far | 4593 /// from the leader replica. |
5342 * from the leader replica. | 4594 /// |
5343 * | 4595 /// Each type of timestamp bound is discussed in detail below. |
5344 * Each type of timestamp bound is discussed in detail below. | 4596 /// |
5345 * | 4597 /// ### Strong |
5346 * ### Strong | 4598 /// |
5347 * | 4599 /// Strong reads are guaranteed to see the effects of all transactions |
5348 * Strong reads are guaranteed to see the effects of all transactions | 4600 /// that have committed before the start of the read. Furthermore, all |
5349 * that have committed before the start of the read. Furthermore, all | 4601 /// rows yielded by a single read are consistent with each other -- if |
5350 * rows yielded by a single read are consistent with each other -- if | 4602 /// any part of the read observes a transaction, all parts of the read |
5351 * any part of the read observes a transaction, all parts of the read | 4603 /// see the transaction. |
5352 * see the transaction. | 4604 /// |
5353 * | 4605 /// Strong reads are not repeatable: two consecutive strong read-only |
5354 * Strong reads are not repeatable: two consecutive strong read-only | 4606 /// transactions might return inconsistent results if there are |
5355 * transactions might return inconsistent results if there are | 4607 /// concurrent writes. If consistency across reads is required, the |
5356 * concurrent writes. If consistency across reads is required, the | 4608 /// reads should be executed within a transaction or at an exact read |
5357 * reads should be executed within a transaction or at an exact read | 4609 /// timestamp. |
5358 * timestamp. | 4610 /// |
5359 * | 4611 /// See TransactionOptions.ReadOnly.strong. |
5360 * See TransactionOptions.ReadOnly.strong. | 4612 /// |
5361 * | 4613 /// ### Exact Staleness |
5362 * ### Exact Staleness | 4614 /// |
5363 * | 4615 /// These timestamp bounds execute reads at a user-specified |
5364 * These timestamp bounds execute reads at a user-specified | 4616 /// timestamp. Reads at a timestamp are guaranteed to see a consistent |
5365 * timestamp. Reads at a timestamp are guaranteed to see a consistent | 4617 /// prefix of the global transaction history: they observe |
5366 * prefix of the global transaction history: they observe | 4618 /// modifications done by all transactions with a commit timestamp <= |
5367 * modifications done by all transactions with a commit timestamp <= | 4619 /// the read timestamp, and observe none of the modifications done by |
5368 * the read timestamp, and observe none of the modifications done by | 4620 /// transactions with a larger commit timestamp. They will block until |
5369 * transactions with a larger commit timestamp. They will block until | 4621 /// all conflicting transactions that may be assigned commit timestamps |
5370 * all conflicting transactions that may be assigned commit timestamps | 4622 /// <= the read timestamp have finished. |
5371 * <= the read timestamp have finished. | 4623 /// |
5372 * | 4624 /// The timestamp can either be expressed as an absolute Cloud Spanner commit |
5373 * The timestamp can either be expressed as an absolute Cloud Spanner commit | 4625 /// timestamp or a staleness relative to the current time. |
5374 * timestamp or a staleness relative to the current time. | 4626 /// |
5375 * | 4627 /// These modes do not require a "negotiation phase" to pick a |
5376 * These modes do not require a "negotiation phase" to pick a | 4628 /// timestamp. As a result, they execute slightly faster than the |
5377 * timestamp. As a result, they execute slightly faster than the | 4629 /// equivalent boundedly stale concurrency modes. On the other hand, |
5378 * equivalent boundedly stale concurrency modes. On the other hand, | 4630 /// boundedly stale reads usually return fresher results. |
5379 * boundedly stale reads usually return fresher results. | 4631 /// |
5380 * | 4632 /// See TransactionOptions.ReadOnly.read_timestamp and |
5381 * See TransactionOptions.ReadOnly.read_timestamp and | 4633 /// TransactionOptions.ReadOnly.exact_staleness. |
5382 * TransactionOptions.ReadOnly.exact_staleness. | 4634 /// |
5383 * | 4635 /// ### Bounded Staleness |
5384 * ### Bounded Staleness | 4636 /// |
5385 * | 4637 /// Bounded staleness modes allow Cloud Spanner to pick the read timestamp, |
5386 * Bounded staleness modes allow Cloud Spanner to pick the read timestamp, | 4638 /// subject to a user-provided staleness bound. Cloud Spanner chooses the |
5387 * subject to a user-provided staleness bound. Cloud Spanner chooses the | 4639 /// newest timestamp within the staleness bound that allows execution |
5388 * newest timestamp within the staleness bound that allows execution | 4640 /// of the reads at the closest available replica without blocking. |
5389 * of the reads at the closest available replica without blocking. | 4641 /// |
5390 * | 4642 /// All rows yielded are consistent with each other -- if any part of |
5391 * All rows yielded are consistent with each other -- if any part of | 4643 /// the read observes a transaction, all parts of the read see the |
5392 * the read observes a transaction, all parts of the read see the | 4644 /// transaction. Boundedly stale reads are not repeatable: two stale |
5393 * transaction. Boundedly stale reads are not repeatable: two stale | 4645 /// reads, even if they use the same staleness bound, can execute at |
5394 * reads, even if they use the same staleness bound, can execute at | 4646 /// different timestamps and thus return inconsistent results. |
5395 * different timestamps and thus return inconsistent results. | 4647 /// |
5396 * | 4648 /// Boundedly stale reads execute in two phases: the first phase |
5397 * Boundedly stale reads execute in two phases: the first phase | 4649 /// negotiates a timestamp among all replicas needed to serve the |
5398 * negotiates a timestamp among all replicas needed to serve the | 4650 /// read. In the second phase, reads are executed at the negotiated |
5399 * read. In the second phase, reads are executed at the negotiated | 4651 /// timestamp. |
5400 * timestamp. | 4652 /// |
5401 * | 4653 /// As a result of the two phase execution, bounded staleness reads are |
5402 * As a result of the two phase execution, bounded staleness reads are | 4654 /// usually a little slower than comparable exact staleness |
5403 * usually a little slower than comparable exact staleness | 4655 /// reads. However, they are typically able to return fresher |
5404 * reads. However, they are typically able to return fresher | 4656 /// results, and are more likely to execute at the closest replica. |
5405 * results, and are more likely to execute at the closest replica. | 4657 /// |
5406 * | 4658 /// Because the timestamp negotiation requires up-front knowledge of |
5407 * Because the timestamp negotiation requires up-front knowledge of | 4659 /// which rows will be read, it can only be used with single-use |
5408 * which rows will be read, it can only be used with single-use | 4660 /// read-only transactions. |
5409 * read-only transactions. | 4661 /// |
5410 * | 4662 /// See TransactionOptions.ReadOnly.max_staleness and |
5411 * See TransactionOptions.ReadOnly.max_staleness and | 4663 /// TransactionOptions.ReadOnly.min_read_timestamp. |
5412 * TransactionOptions.ReadOnly.min_read_timestamp. | 4664 /// |
5413 * | 4665 /// ### Old Read Timestamps and Garbage Collection |
5414 * ### Old Read Timestamps and Garbage Collection | 4666 /// |
5415 * | 4667 /// Cloud Spanner continuously garbage collects deleted and overwritten data |
5416 * Cloud Spanner continuously garbage collects deleted and overwritten data | 4668 /// in the background to reclaim storage space. This process is known |
5417 * in the background to reclaim storage space. This process is known | 4669 /// as "version GC". By default, version GC reclaims versions after they |
5418 * as "version GC". By default, version GC reclaims versions after they | 4670 /// are one hour old. Because of this, Cloud Spanner cannot perform reads |
5419 * are one hour old. Because of this, Cloud Spanner cannot perform reads | 4671 /// at read timestamps more than one hour in the past. This |
5420 * at read timestamps more than one hour in the past. This | 4672 /// restriction also applies to in-progress reads and/or SQL queries whose |
5421 * restriction also applies to in-progress reads and/or SQL queries whose | 4673 /// timestamp become too old while executing. Reads and SQL queries with |
5422 * timestamp become too old while executing. Reads and SQL queries with | 4674 /// too-old read timestamps fail with the error `FAILED_PRECONDITION`. |
5423 * too-old read timestamps fail with the error `FAILED_PRECONDITION`. | |
5424 */ | |
5425 class TransactionOptions { | 4675 class TransactionOptions { |
5426 /** | 4676 /// Transaction will not write. |
5427 * Transaction will not write. | 4677 /// |
5428 * | 4678 /// Authorization to begin a read-only transaction requires |
5429 * Authorization to begin a read-only transaction requires | 4679 /// `spanner.databases.beginReadOnlyTransaction` permission |
5430 * `spanner.databases.beginReadOnlyTransaction` permission | 4680 /// on the `session` resource. |
5431 * on the `session` resource. | |
5432 */ | |
5433 ReadOnly readOnly; | 4681 ReadOnly readOnly; |
5434 /** | 4682 |
5435 * Transaction may write. | 4683 /// Transaction may write. |
5436 * | 4684 /// |
5437 * Authorization to begin a read-write transaction requires | 4685 /// Authorization to begin a read-write transaction requires |
5438 * `spanner.databases.beginOrRollbackReadWriteTransaction` permission | 4686 /// `spanner.databases.beginOrRollbackReadWriteTransaction` permission |
5439 * on the `session` resource. | 4687 /// on the `session` resource. |
5440 */ | |
5441 ReadWrite readWrite; | 4688 ReadWrite readWrite; |
5442 | 4689 |
5443 TransactionOptions(); | 4690 TransactionOptions(); |
5444 | 4691 |
5445 TransactionOptions.fromJson(core.Map _json) { | 4692 TransactionOptions.fromJson(core.Map _json) { |
5446 if (_json.containsKey("readOnly")) { | 4693 if (_json.containsKey("readOnly")) { |
5447 readOnly = new ReadOnly.fromJson(_json["readOnly"]); | 4694 readOnly = new ReadOnly.fromJson(_json["readOnly"]); |
5448 } | 4695 } |
5449 if (_json.containsKey("readWrite")) { | 4696 if (_json.containsKey("readWrite")) { |
5450 readWrite = new ReadWrite.fromJson(_json["readWrite"]); | 4697 readWrite = new ReadWrite.fromJson(_json["readWrite"]); |
5451 } | 4698 } |
5452 } | 4699 } |
5453 | 4700 |
5454 core.Map<core.String, core.Object> toJson() { | 4701 core.Map<core.String, core.Object> toJson() { |
5455 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4702 final core.Map<core.String, core.Object> _json = |
| 4703 new core.Map<core.String, core.Object>(); |
5456 if (readOnly != null) { | 4704 if (readOnly != null) { |
5457 _json["readOnly"] = (readOnly).toJson(); | 4705 _json["readOnly"] = (readOnly).toJson(); |
5458 } | 4706 } |
5459 if (readWrite != null) { | 4707 if (readWrite != null) { |
5460 _json["readWrite"] = (readWrite).toJson(); | 4708 _json["readWrite"] = (readWrite).toJson(); |
5461 } | 4709 } |
5462 return _json; | 4710 return _json; |
5463 } | 4711 } |
5464 } | 4712 } |
5465 | 4713 |
5466 /** | 4714 /// This message is used to select the transaction in which a |
5467 * This message is used to select the transaction in which a | 4715 /// Read or |
5468 * Read or | 4716 /// ExecuteSql call runs. |
5469 * ExecuteSql call runs. | 4717 /// |
5470 * | 4718 /// See TransactionOptions for more information about transactions. |
5471 * See TransactionOptions for more information about transactions. | |
5472 */ | |
5473 class TransactionSelector { | 4719 class TransactionSelector { |
5474 /** | 4720 /// Begin a new transaction and execute this read or SQL query in |
5475 * Begin a new transaction and execute this read or SQL query in | 4721 /// it. The transaction ID of the new transaction is returned in |
5476 * it. The transaction ID of the new transaction is returned in | 4722 /// ResultSetMetadata.transaction, which is a Transaction. |
5477 * ResultSetMetadata.transaction, which is a Transaction. | |
5478 */ | |
5479 TransactionOptions begin; | 4723 TransactionOptions begin; |
5480 /** Execute the read or SQL query in a previously-started transaction. */ | 4724 |
| 4725 /// Execute the read or SQL query in a previously-started transaction. |
5481 core.String id; | 4726 core.String id; |
5482 core.List<core.int> get idAsBytes { | 4727 core.List<core.int> get idAsBytes { |
5483 return convert.BASE64.decode(id); | 4728 return convert.BASE64.decode(id); |
5484 } | 4729 } |
5485 | 4730 |
5486 void set idAsBytes(core.List<core.int> _bytes) { | 4731 void set idAsBytes(core.List<core.int> _bytes) { |
5487 id = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-")
; | 4732 id = |
| 4733 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
5488 } | 4734 } |
5489 /** | 4735 |
5490 * Execute the read or SQL query in a temporary transaction. | 4736 /// Execute the read or SQL query in a temporary transaction. |
5491 * This is the most efficient way to execute a transaction that | 4737 /// This is the most efficient way to execute a transaction that |
5492 * consists of a single SQL query. | 4738 /// consists of a single SQL query. |
5493 */ | |
5494 TransactionOptions singleUse; | 4739 TransactionOptions singleUse; |
5495 | 4740 |
5496 TransactionSelector(); | 4741 TransactionSelector(); |
5497 | 4742 |
5498 TransactionSelector.fromJson(core.Map _json) { | 4743 TransactionSelector.fromJson(core.Map _json) { |
5499 if (_json.containsKey("begin")) { | 4744 if (_json.containsKey("begin")) { |
5500 begin = new TransactionOptions.fromJson(_json["begin"]); | 4745 begin = new TransactionOptions.fromJson(_json["begin"]); |
5501 } | 4746 } |
5502 if (_json.containsKey("id")) { | 4747 if (_json.containsKey("id")) { |
5503 id = _json["id"]; | 4748 id = _json["id"]; |
5504 } | 4749 } |
5505 if (_json.containsKey("singleUse")) { | 4750 if (_json.containsKey("singleUse")) { |
5506 singleUse = new TransactionOptions.fromJson(_json["singleUse"]); | 4751 singleUse = new TransactionOptions.fromJson(_json["singleUse"]); |
5507 } | 4752 } |
5508 } | 4753 } |
5509 | 4754 |
5510 core.Map<core.String, core.Object> toJson() { | 4755 core.Map<core.String, core.Object> toJson() { |
5511 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4756 final core.Map<core.String, core.Object> _json = |
| 4757 new core.Map<core.String, core.Object>(); |
5512 if (begin != null) { | 4758 if (begin != null) { |
5513 _json["begin"] = (begin).toJson(); | 4759 _json["begin"] = (begin).toJson(); |
5514 } | 4760 } |
5515 if (id != null) { | 4761 if (id != null) { |
5516 _json["id"] = id; | 4762 _json["id"] = id; |
5517 } | 4763 } |
5518 if (singleUse != null) { | 4764 if (singleUse != null) { |
5519 _json["singleUse"] = (singleUse).toJson(); | 4765 _json["singleUse"] = (singleUse).toJson(); |
5520 } | 4766 } |
5521 return _json; | 4767 return _json; |
5522 } | 4768 } |
5523 } | 4769 } |
5524 | 4770 |
5525 /** | 4771 /// `Type` indicates the type of a Cloud Spanner value, as might be stored in a |
5526 * `Type` indicates the type of a Cloud Spanner value, as might be stored in a | 4772 /// table cell or returned from an SQL query. |
5527 * table cell or returned from an SQL query. | |
5528 */ | |
5529 class Type { | 4773 class Type { |
5530 /** | 4774 /// If code == ARRAY, then `array_element_type` |
5531 * If code == ARRAY, then `array_element_type` | 4775 /// is the type of the array elements. |
5532 * is the type of the array elements. | |
5533 */ | |
5534 Type arrayElementType; | 4776 Type arrayElementType; |
5535 /** | 4777 |
5536 * Required. The TypeCode for this type. | 4778 /// Required. The TypeCode for this type. |
5537 * Possible string values are: | 4779 /// Possible string values are: |
5538 * - "TYPE_CODE_UNSPECIFIED" : Not specified. | 4780 /// - "TYPE_CODE_UNSPECIFIED" : Not specified. |
5539 * - "BOOL" : Encoded as JSON `true` or `false`. | 4781 /// - "BOOL" : Encoded as JSON `true` or `false`. |
5540 * - "INT64" : Encoded as `string`, in decimal format. | 4782 /// - "INT64" : Encoded as `string`, in decimal format. |
5541 * - "FLOAT64" : Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or | 4783 /// - "FLOAT64" : Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, |
5542 * `"-Infinity"`. | 4784 /// or |
5543 * - "TIMESTAMP" : Encoded as `string` in RFC 3339 timestamp format. The time | 4785 /// `"-Infinity"`. |
5544 * zone | 4786 /// - "TIMESTAMP" : Encoded as `string` in RFC 3339 timestamp format. The |
5545 * must be present, and must be `"Z"`. | 4787 /// time zone |
5546 * - "DATE" : Encoded as `string` in RFC 3339 date format. | 4788 /// must be present, and must be `"Z"`. |
5547 * - "STRING" : Encoded as `string`. | 4789 /// - "DATE" : Encoded as `string` in RFC 3339 date format. |
5548 * - "BYTES" : Encoded as a base64-encoded `string`, as described in RFC 4648, | 4790 /// - "STRING" : Encoded as `string`. |
5549 * section 4. | 4791 /// - "BYTES" : Encoded as a base64-encoded `string`, as described in RFC |
5550 * - "ARRAY" : Encoded as `list`, where the list elements are represented | 4792 /// 4648, |
5551 * according to array_element_type. | 4793 /// section 4. |
5552 * - "STRUCT" : Encoded as `list`, where list element `i` is represented | 4794 /// - "ARRAY" : Encoded as `list`, where the list elements are represented |
5553 * according | 4795 /// according to array_element_type. |
5554 * to [struct_type.fields[i]][google.spanner.v1.StructType.fields]. | 4796 /// - "STRUCT" : Encoded as `list`, where list element `i` is represented |
5555 */ | 4797 /// according |
| 4798 /// to [struct_type.fields[i]][google.spanner.v1.StructType.fields]. |
5556 core.String code; | 4799 core.String code; |
5557 /** | 4800 |
5558 * If code == STRUCT, then `struct_type` | 4801 /// If code == STRUCT, then `struct_type` |
5559 * provides type information for the struct's fields. | 4802 /// provides type information for the struct's fields. |
5560 */ | |
5561 StructType structType; | 4803 StructType structType; |
5562 | 4804 |
5563 Type(); | 4805 Type(); |
5564 | 4806 |
5565 Type.fromJson(core.Map _json) { | 4807 Type.fromJson(core.Map _json) { |
5566 if (_json.containsKey("arrayElementType")) { | 4808 if (_json.containsKey("arrayElementType")) { |
5567 arrayElementType = new Type.fromJson(_json["arrayElementType"]); | 4809 arrayElementType = new Type.fromJson(_json["arrayElementType"]); |
5568 } | 4810 } |
5569 if (_json.containsKey("code")) { | 4811 if (_json.containsKey("code")) { |
5570 code = _json["code"]; | 4812 code = _json["code"]; |
5571 } | 4813 } |
5572 if (_json.containsKey("structType")) { | 4814 if (_json.containsKey("structType")) { |
5573 structType = new StructType.fromJson(_json["structType"]); | 4815 structType = new StructType.fromJson(_json["structType"]); |
5574 } | 4816 } |
5575 } | 4817 } |
5576 | 4818 |
5577 core.Map<core.String, core.Object> toJson() { | 4819 core.Map<core.String, core.Object> toJson() { |
5578 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4820 final core.Map<core.String, core.Object> _json = |
| 4821 new core.Map<core.String, core.Object>(); |
5579 if (arrayElementType != null) { | 4822 if (arrayElementType != null) { |
5580 _json["arrayElementType"] = (arrayElementType).toJson(); | 4823 _json["arrayElementType"] = (arrayElementType).toJson(); |
5581 } | 4824 } |
5582 if (code != null) { | 4825 if (code != null) { |
5583 _json["code"] = code; | 4826 _json["code"] = code; |
5584 } | 4827 } |
5585 if (structType != null) { | 4828 if (structType != null) { |
5586 _json["structType"] = (structType).toJson(); | 4829 _json["structType"] = (structType).toJson(); |
5587 } | 4830 } |
5588 return _json; | 4831 return _json; |
5589 } | 4832 } |
5590 } | 4833 } |
5591 | 4834 |
5592 /** | 4835 /// Metadata type for the operation returned by |
5593 * Metadata type for the operation returned by | 4836 /// UpdateDatabaseDdl. |
5594 * UpdateDatabaseDdl. | |
5595 */ | |
5596 class UpdateDatabaseDdlMetadata { | 4837 class UpdateDatabaseDdlMetadata { |
5597 /** | 4838 /// Reports the commit timestamps of all statements that have |
5598 * Reports the commit timestamps of all statements that have | 4839 /// succeeded so far, where `commit_timestamps[i]` is the commit |
5599 * succeeded so far, where `commit_timestamps[i]` is the commit | 4840 /// timestamp for the statement `statements[i]`. |
5600 * timestamp for the statement `statements[i]`. | |
5601 */ | |
5602 core.List<core.String> commitTimestamps; | 4841 core.List<core.String> commitTimestamps; |
5603 /** The database being modified. */ | 4842 |
| 4843 /// The database being modified. |
5604 core.String database; | 4844 core.String database; |
5605 /** | 4845 |
5606 * For an update this list contains all the statements. For an | 4846 /// For an update this list contains all the statements. For an |
5607 * individual statement, this list contains only that statement. | 4847 /// individual statement, this list contains only that statement. |
5608 */ | |
5609 core.List<core.String> statements; | 4848 core.List<core.String> statements; |
5610 | 4849 |
5611 UpdateDatabaseDdlMetadata(); | 4850 UpdateDatabaseDdlMetadata(); |
5612 | 4851 |
5613 UpdateDatabaseDdlMetadata.fromJson(core.Map _json) { | 4852 UpdateDatabaseDdlMetadata.fromJson(core.Map _json) { |
5614 if (_json.containsKey("commitTimestamps")) { | 4853 if (_json.containsKey("commitTimestamps")) { |
5615 commitTimestamps = _json["commitTimestamps"]; | 4854 commitTimestamps = _json["commitTimestamps"]; |
5616 } | 4855 } |
5617 if (_json.containsKey("database")) { | 4856 if (_json.containsKey("database")) { |
5618 database = _json["database"]; | 4857 database = _json["database"]; |
5619 } | 4858 } |
5620 if (_json.containsKey("statements")) { | 4859 if (_json.containsKey("statements")) { |
5621 statements = _json["statements"]; | 4860 statements = _json["statements"]; |
5622 } | 4861 } |
5623 } | 4862 } |
5624 | 4863 |
5625 core.Map<core.String, core.Object> toJson() { | 4864 core.Map<core.String, core.Object> toJson() { |
5626 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4865 final core.Map<core.String, core.Object> _json = |
| 4866 new core.Map<core.String, core.Object>(); |
5627 if (commitTimestamps != null) { | 4867 if (commitTimestamps != null) { |
5628 _json["commitTimestamps"] = commitTimestamps; | 4868 _json["commitTimestamps"] = commitTimestamps; |
5629 } | 4869 } |
5630 if (database != null) { | 4870 if (database != null) { |
5631 _json["database"] = database; | 4871 _json["database"] = database; |
5632 } | 4872 } |
5633 if (statements != null) { | 4873 if (statements != null) { |
5634 _json["statements"] = statements; | 4874 _json["statements"] = statements; |
5635 } | 4875 } |
5636 return _json; | 4876 return _json; |
5637 } | 4877 } |
5638 } | 4878 } |
5639 | 4879 |
5640 /** | 4880 /// Enqueues the given DDL statements to be applied, in order but not |
5641 * Enqueues the given DDL statements to be applied, in order but not | 4881 /// necessarily all at once, to the database schema at some point (or |
5642 * necessarily all at once, to the database schema at some point (or | 4882 /// points) in the future. The server checks that the statements |
5643 * points) in the future. The server checks that the statements | 4883 /// are executable (syntactically valid, name tables that exist, etc.) |
5644 * are executable (syntactically valid, name tables that exist, etc.) | 4884 /// before enqueueing them, but they may still fail upon |
5645 * before enqueueing them, but they may still fail upon | 4885 /// later execution (e.g., if a statement from another batch of |
5646 * later execution (e.g., if a statement from another batch of | 4886 /// statements is applied first and it conflicts in some way, or if |
5647 * statements is applied first and it conflicts in some way, or if | 4887 /// there is some data-related problem like a `NULL` value in a column to |
5648 * there is some data-related problem like a `NULL` value in a column to | 4888 /// which `NOT NULL` would be added). If a statement fails, all |
5649 * which `NOT NULL` would be added). If a statement fails, all | 4889 /// subsequent statements in the batch are automatically cancelled. |
5650 * subsequent statements in the batch are automatically cancelled. | 4890 /// |
5651 * | 4891 /// Each batch of statements is assigned a name which can be used with |
5652 * Each batch of statements is assigned a name which can be used with | 4892 /// the Operations API to monitor |
5653 * the Operations API to monitor | 4893 /// progress. See the |
5654 * progress. See the | 4894 /// operation_id field for more |
5655 * operation_id field for more | 4895 /// details. |
5656 * details. | |
5657 */ | |
5658 class UpdateDatabaseDdlRequest { | 4896 class UpdateDatabaseDdlRequest { |
5659 /** | 4897 /// If empty, the new update request is assigned an |
5660 * If empty, the new update request is assigned an | 4898 /// automatically-generated operation ID. Otherwise, `operation_id` |
5661 * automatically-generated operation ID. Otherwise, `operation_id` | 4899 /// is used to construct the name of the resulting |
5662 * is used to construct the name of the resulting | 4900 /// Operation. |
5663 * Operation. | 4901 /// |
5664 * | 4902 /// Specifying an explicit operation ID simplifies determining |
5665 * Specifying an explicit operation ID simplifies determining | 4903 /// whether the statements were executed in the event that the |
5666 * whether the statements were executed in the event that the | 4904 /// UpdateDatabaseDdl call is replayed, |
5667 * UpdateDatabaseDdl call is replayed, | 4905 /// or the return value is otherwise lost: the database and |
5668 * or the return value is otherwise lost: the database and | 4906 /// `operation_id` fields can be combined to form the |
5669 * `operation_id` fields can be combined to form the | 4907 /// name of the resulting |
5670 * name of the resulting | 4908 /// longrunning.Operation: `<database>/operations/<operation_id>`. |
5671 * longrunning.Operation: `<database>/operations/<operation_id>`. | 4909 /// |
5672 * | 4910 /// `operation_id` should be unique within the database, and must be |
5673 * `operation_id` should be unique within the database, and must be | 4911 /// a valid identifier: `a-z*`. Note that |
5674 * a valid identifier: `a-z*`. Note that | 4912 /// automatically-generated operation IDs always begin with an |
5675 * automatically-generated operation IDs always begin with an | 4913 /// underscore. If the named operation already exists, |
5676 * underscore. If the named operation already exists, | 4914 /// UpdateDatabaseDdl returns |
5677 * UpdateDatabaseDdl returns | 4915 /// `ALREADY_EXISTS`. |
5678 * `ALREADY_EXISTS`. | |
5679 */ | |
5680 core.String operationId; | 4916 core.String operationId; |
5681 /** DDL statements to be applied to the database. */ | 4917 |
| 4918 /// DDL statements to be applied to the database. |
5682 core.List<core.String> statements; | 4919 core.List<core.String> statements; |
5683 | 4920 |
5684 UpdateDatabaseDdlRequest(); | 4921 UpdateDatabaseDdlRequest(); |
5685 | 4922 |
5686 UpdateDatabaseDdlRequest.fromJson(core.Map _json) { | 4923 UpdateDatabaseDdlRequest.fromJson(core.Map _json) { |
5687 if (_json.containsKey("operationId")) { | 4924 if (_json.containsKey("operationId")) { |
5688 operationId = _json["operationId"]; | 4925 operationId = _json["operationId"]; |
5689 } | 4926 } |
5690 if (_json.containsKey("statements")) { | 4927 if (_json.containsKey("statements")) { |
5691 statements = _json["statements"]; | 4928 statements = _json["statements"]; |
5692 } | 4929 } |
5693 } | 4930 } |
5694 | 4931 |
5695 core.Map<core.String, core.Object> toJson() { | 4932 core.Map<core.String, core.Object> toJson() { |
5696 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4933 final core.Map<core.String, core.Object> _json = |
| 4934 new core.Map<core.String, core.Object>(); |
5697 if (operationId != null) { | 4935 if (operationId != null) { |
5698 _json["operationId"] = operationId; | 4936 _json["operationId"] = operationId; |
5699 } | 4937 } |
5700 if (statements != null) { | 4938 if (statements != null) { |
5701 _json["statements"] = statements; | 4939 _json["statements"] = statements; |
5702 } | 4940 } |
5703 return _json; | 4941 return _json; |
5704 } | 4942 } |
5705 } | 4943 } |
5706 | 4944 |
5707 /** | 4945 /// Metadata type for the operation returned by |
5708 * Metadata type for the operation returned by | 4946 /// UpdateInstance. |
5709 * UpdateInstance. | |
5710 */ | |
5711 class UpdateInstanceMetadata { | 4947 class UpdateInstanceMetadata { |
5712 /** | 4948 /// The time at which this operation was cancelled. If set, this operation is |
5713 * The time at which this operation was cancelled. If set, this operation is | 4949 /// in the process of undoing itself (which is guaranteed to succeed) and |
5714 * in the process of undoing itself (which is guaranteed to succeed) and | 4950 /// cannot be cancelled again. |
5715 * cannot be cancelled again. | |
5716 */ | |
5717 core.String cancelTime; | 4951 core.String cancelTime; |
5718 /** The time at which this operation failed or was completed successfully. */ | 4952 |
| 4953 /// The time at which this operation failed or was completed successfully. |
5719 core.String endTime; | 4954 core.String endTime; |
5720 /** The desired end state of the update. */ | 4955 |
| 4956 /// The desired end state of the update. |
5721 Instance instance; | 4957 Instance instance; |
5722 /** | 4958 |
5723 * The time at which UpdateInstance | 4959 /// The time at which UpdateInstance |
5724 * request was received. | 4960 /// request was received. |
5725 */ | |
5726 core.String startTime; | 4961 core.String startTime; |
5727 | 4962 |
5728 UpdateInstanceMetadata(); | 4963 UpdateInstanceMetadata(); |
5729 | 4964 |
5730 UpdateInstanceMetadata.fromJson(core.Map _json) { | 4965 UpdateInstanceMetadata.fromJson(core.Map _json) { |
5731 if (_json.containsKey("cancelTime")) { | 4966 if (_json.containsKey("cancelTime")) { |
5732 cancelTime = _json["cancelTime"]; | 4967 cancelTime = _json["cancelTime"]; |
5733 } | 4968 } |
5734 if (_json.containsKey("endTime")) { | 4969 if (_json.containsKey("endTime")) { |
5735 endTime = _json["endTime"]; | 4970 endTime = _json["endTime"]; |
5736 } | 4971 } |
5737 if (_json.containsKey("instance")) { | 4972 if (_json.containsKey("instance")) { |
5738 instance = new Instance.fromJson(_json["instance"]); | 4973 instance = new Instance.fromJson(_json["instance"]); |
5739 } | 4974 } |
5740 if (_json.containsKey("startTime")) { | 4975 if (_json.containsKey("startTime")) { |
5741 startTime = _json["startTime"]; | 4976 startTime = _json["startTime"]; |
5742 } | 4977 } |
5743 } | 4978 } |
5744 | 4979 |
5745 core.Map<core.String, core.Object> toJson() { | 4980 core.Map<core.String, core.Object> toJson() { |
5746 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4981 final core.Map<core.String, core.Object> _json = |
| 4982 new core.Map<core.String, core.Object>(); |
5747 if (cancelTime != null) { | 4983 if (cancelTime != null) { |
5748 _json["cancelTime"] = cancelTime; | 4984 _json["cancelTime"] = cancelTime; |
5749 } | 4985 } |
5750 if (endTime != null) { | 4986 if (endTime != null) { |
5751 _json["endTime"] = endTime; | 4987 _json["endTime"] = endTime; |
5752 } | 4988 } |
5753 if (instance != null) { | 4989 if (instance != null) { |
5754 _json["instance"] = (instance).toJson(); | 4990 _json["instance"] = (instance).toJson(); |
5755 } | 4991 } |
5756 if (startTime != null) { | 4992 if (startTime != null) { |
5757 _json["startTime"] = startTime; | 4993 _json["startTime"] = startTime; |
5758 } | 4994 } |
5759 return _json; | 4995 return _json; |
5760 } | 4996 } |
5761 } | 4997 } |
5762 | 4998 |
5763 /** The request for UpdateInstance. */ | 4999 /// The request for UpdateInstance. |
5764 class UpdateInstanceRequest { | 5000 class UpdateInstanceRequest { |
5765 /** | 5001 /// Required. A mask specifying which fields in |
5766 * Required. A mask specifying which fields in | 5002 /// [][google.spanner.admin.instance.v1.UpdateInstanceRequest.instance] |
5767 * [][google.spanner.admin.instance.v1.UpdateInstanceRequest.instance] should | 5003 /// should be updated. |
5768 * be updated. | 5004 /// The field mask must always be specified; this prevents any future fields |
5769 * The field mask must always be specified; this prevents any future fields in | 5005 /// in |
5770 * [][google.spanner.admin.instance.v1.Instance] from being erased | 5006 /// [][google.spanner.admin.instance.v1.Instance] from being erased |
5771 * accidentally by clients that do not know | 5007 /// accidentally by clients that do not know |
5772 * about them. | 5008 /// about them. |
5773 */ | |
5774 core.String fieldMask; | 5009 core.String fieldMask; |
5775 /** | 5010 |
5776 * Required. The instance to update, which must always include the instance | 5011 /// Required. The instance to update, which must always include the instance |
5777 * name. Otherwise, only fields mentioned in | 5012 /// name. Otherwise, only fields mentioned in |
5778 * [][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask] need | 5013 /// [][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask] |
5779 * be included. | 5014 /// need be included. |
5780 */ | |
5781 Instance instance; | 5015 Instance instance; |
5782 | 5016 |
5783 UpdateInstanceRequest(); | 5017 UpdateInstanceRequest(); |
5784 | 5018 |
5785 UpdateInstanceRequest.fromJson(core.Map _json) { | 5019 UpdateInstanceRequest.fromJson(core.Map _json) { |
5786 if (_json.containsKey("fieldMask")) { | 5020 if (_json.containsKey("fieldMask")) { |
5787 fieldMask = _json["fieldMask"]; | 5021 fieldMask = _json["fieldMask"]; |
5788 } | 5022 } |
5789 if (_json.containsKey("instance")) { | 5023 if (_json.containsKey("instance")) { |
5790 instance = new Instance.fromJson(_json["instance"]); | 5024 instance = new Instance.fromJson(_json["instance"]); |
5791 } | 5025 } |
5792 } | 5026 } |
5793 | 5027 |
5794 core.Map<core.String, core.Object> toJson() { | 5028 core.Map<core.String, core.Object> toJson() { |
5795 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 5029 final core.Map<core.String, core.Object> _json = |
| 5030 new core.Map<core.String, core.Object>(); |
5796 if (fieldMask != null) { | 5031 if (fieldMask != null) { |
5797 _json["fieldMask"] = fieldMask; | 5032 _json["fieldMask"] = fieldMask; |
5798 } | 5033 } |
5799 if (instance != null) { | 5034 if (instance != null) { |
5800 _json["instance"] = (instance).toJson(); | 5035 _json["instance"] = (instance).toJson(); |
5801 } | 5036 } |
5802 return _json; | 5037 return _json; |
5803 } | 5038 } |
5804 } | 5039 } |
5805 | 5040 |
5806 /** | 5041 /// Arguments to insert, update, insert_or_update, and |
5807 * Arguments to insert, update, insert_or_update, and | 5042 /// replace operations. |
5808 * replace operations. | |
5809 */ | |
5810 class Write { | 5043 class Write { |
5811 /** | 5044 /// The names of the columns in table to be written. |
5812 * The names of the columns in table to be written. | 5045 /// |
5813 * | 5046 /// The list of columns must contain enough columns to allow |
5814 * The list of columns must contain enough columns to allow | 5047 /// Cloud Spanner to derive values for all primary key columns in the |
5815 * Cloud Spanner to derive values for all primary key columns in the | 5048 /// row(s) to be modified. |
5816 * row(s) to be modified. | |
5817 */ | |
5818 core.List<core.String> columns; | 5049 core.List<core.String> columns; |
5819 /** Required. The table whose rows will be written. */ | 5050 |
| 5051 /// Required. The table whose rows will be written. |
5820 core.String table; | 5052 core.String table; |
5821 /** | 5053 |
5822 * The values to be written. `values` can contain more than one | 5054 /// The values to be written. `values` can contain more than one |
5823 * list of values. If it does, then multiple rows are written, one | 5055 /// list of values. If it does, then multiple rows are written, one |
5824 * for each entry in `values`. Each list in `values` must have | 5056 /// for each entry in `values`. Each list in `values` must have |
5825 * exactly as many entries as there are entries in columns | 5057 /// exactly as many entries as there are entries in columns |
5826 * above. Sending multiple lists is equivalent to sending multiple | 5058 /// above. Sending multiple lists is equivalent to sending multiple |
5827 * `Mutation`s, each containing one `values` entry and repeating | 5059 /// `Mutation`s, each containing one `values` entry and repeating |
5828 * table and columns. Individual values in each list are | 5060 /// table and columns. Individual values in each list are |
5829 * encoded as described here. | 5061 /// encoded as described here. |
5830 * | 5062 /// |
5831 * The values for Object must be JSON objects. It can consist of `num`, | 5063 /// The values for Object must be JSON objects. It can consist of `num`, |
5832 * `String`, `bool` and `null` as well as `Map` and `List` values. | 5064 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
5833 */ | |
5834 core.List<core.List<core.Object>> values; | 5065 core.List<core.List<core.Object>> values; |
5835 | 5066 |
5836 Write(); | 5067 Write(); |
5837 | 5068 |
5838 Write.fromJson(core.Map _json) { | 5069 Write.fromJson(core.Map _json) { |
5839 if (_json.containsKey("columns")) { | 5070 if (_json.containsKey("columns")) { |
5840 columns = _json["columns"]; | 5071 columns = _json["columns"]; |
5841 } | 5072 } |
5842 if (_json.containsKey("table")) { | 5073 if (_json.containsKey("table")) { |
5843 table = _json["table"]; | 5074 table = _json["table"]; |
5844 } | 5075 } |
5845 if (_json.containsKey("values")) { | 5076 if (_json.containsKey("values")) { |
5846 values = _json["values"]; | 5077 values = _json["values"]; |
5847 } | 5078 } |
5848 } | 5079 } |
5849 | 5080 |
5850 core.Map<core.String, core.Object> toJson() { | 5081 core.Map<core.String, core.Object> toJson() { |
5851 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 5082 final core.Map<core.String, core.Object> _json = |
| 5083 new core.Map<core.String, core.Object>(); |
5852 if (columns != null) { | 5084 if (columns != null) { |
5853 _json["columns"] = columns; | 5085 _json["columns"] = columns; |
5854 } | 5086 } |
5855 if (table != null) { | 5087 if (table != null) { |
5856 _json["table"] = table; | 5088 _json["table"] = table; |
5857 } | 5089 } |
5858 if (values != null) { | 5090 if (values != null) { |
5859 _json["values"] = values; | 5091 _json["values"] = values; |
5860 } | 5092 } |
5861 return _json; | 5093 return _json; |
5862 } | 5094 } |
5863 } | 5095 } |
OLD | NEW |