| OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
| 1 library googleapis.appstate.v1; | 3 library googleapis.appstate.v1; |
| 2 | 4 |
| 3 import "dart:core" as core; | 5 import 'dart:core' as core; |
| 4 import "dart:collection" as collection; | 6 import 'dart:collection' as collection; |
| 5 import "dart:async" as async; | 7 import 'dart:async' as async; |
| 6 import "dart:convert" as convert; | 8 import 'dart:convert' as convert; |
| 7 | 9 |
| 8 import "package:crypto/crypto.dart" as crypto; | 10 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 11 import 'package:crypto/crypto.dart' as crypto; |
| 9 import 'package:http/http.dart' as http; | 12 import 'package:http/http.dart' as http; |
| 10 import '../src/common_internal.dart' as common_internal; | |
| 11 import '../common/common.dart' as common; | |
| 12 | 13 |
| 13 export '../common/common.dart' show ApiRequestError; | 14 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
| 14 export '../common/common.dart' show DetailedApiRequestError; | 15 ApiRequestError, DetailedApiRequestError; |
| 16 |
| 17 const core.String USER_AGENT = 'dart-api-client appstate/v1'; |
| 15 | 18 |
| 16 /** The Google App State API. */ | 19 /** The Google App State API. */ |
| 17 class AppstateApi { | 20 class AppstateApi { |
| 18 /** View and manage your data for this application */ | 21 /** View and manage your data for this application */ |
| 19 static const AppstateScope = "https://www.googleapis.com/auth/appstate"; | 22 static const AppstateScope = "https://www.googleapis.com/auth/appstate"; |
| 20 | 23 |
| 21 | 24 |
| 22 final common_internal.ApiRequester _requester; | 25 final commons.ApiRequester _requester; |
| 23 | 26 |
| 24 StatesResourceApi get states => new StatesResourceApi(_requester); | 27 StatesResourceApi get states => new StatesResourceApi(_requester); |
| 25 | 28 |
| 26 AppstateApi(http.Client client, {core.String rootUrl: "https://www.googleapis.
com/", core.String servicePath: "appstate/v1/"}) : | 29 AppstateApi(http.Client client, {core.String rootUrl: "https://www.googleapis.
com/", core.String servicePath: "appstate/v1/"}) : |
| 27 _requester = new common_internal.ApiRequester(client, rootUrl, servicePath
); | 30 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
| 28 } | 31 } |
| 29 | 32 |
| 30 | 33 |
| 31 /** Not documented yet. */ | |
| 32 class StatesResourceApi { | 34 class StatesResourceApi { |
| 33 final common_internal.ApiRequester _requester; | 35 final commons.ApiRequester _requester; |
| 34 | 36 |
| 35 StatesResourceApi(common_internal.ApiRequester client) : | 37 StatesResourceApi(commons.ApiRequester client) : |
| 36 _requester = client; | 38 _requester = client; |
| 37 | 39 |
| 38 /** | 40 /** |
| 39 * Clears (sets to empty) the data for the passed key if and only if the | 41 * Clears (sets to empty) the data for the passed key if and only if the |
| 40 * passed version matches the currently stored version. This method results in | 42 * passed version matches the currently stored version. This method results in |
| 41 * a conflict error on version mismatch. | 43 * a conflict error on version mismatch. |
| 42 * | 44 * |
| 43 * Request parameters: | 45 * Request parameters: |
| 44 * | 46 * |
| 45 * [stateKey] - The key for the data to be retrieved. | 47 * [stateKey] - The key for the data to be retrieved. |
| 46 * Value must be between "0" and "3". | 48 * Value must be between "0" and "3". |
| 47 * | 49 * |
| 48 * [currentDataVersion] - The version of the data to be cleared. Version | 50 * [currentDataVersion] - The version of the data to be cleared. Version |
| 49 * strings are returned by the server. | 51 * strings are returned by the server. |
| 50 * | 52 * |
| 51 * Completes with a [WriteResult]. | 53 * Completes with a [WriteResult]. |
| 52 * | 54 * |
| 53 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 55 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 54 * error. | 56 * error. |
| 55 * | 57 * |
| 56 * If the used [http.Client] completes with an error when making a REST call, | 58 * If the used [http.Client] completes with an error when making a REST call, |
| 57 * this method will complete with the same error. | 59 * this method will complete with the same error. |
| 58 */ | 60 */ |
| 59 async.Future<WriteResult> clear(core.int stateKey, {core.String currentDataVer
sion}) { | 61 async.Future<WriteResult> clear(core.int stateKey, {core.String currentDataVer
sion}) { |
| 60 var _url = null; | 62 var _url = null; |
| 61 var _queryParams = new core.Map(); | 63 var _queryParams = new core.Map(); |
| 62 var _uploadMedia = null; | 64 var _uploadMedia = null; |
| 63 var _uploadOptions = null; | 65 var _uploadOptions = null; |
| 64 var _downloadOptions = common.DownloadOptions.Metadata; | 66 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 65 var _body = null; | 67 var _body = null; |
| 66 | 68 |
| 67 if (stateKey == null) { | 69 if (stateKey == null) { |
| 68 throw new core.ArgumentError("Parameter stateKey is required."); | 70 throw new core.ArgumentError("Parameter stateKey is required."); |
| 69 } | 71 } |
| 70 if (currentDataVersion != null) { | 72 if (currentDataVersion != null) { |
| 71 _queryParams["currentDataVersion"] = [currentDataVersion]; | 73 _queryParams["currentDataVersion"] = [currentDataVersion]; |
| 72 } | 74 } |
| 73 | 75 |
| 74 | 76 |
| 75 _url = 'states/' + common_internal.Escaper.ecapeVariable('$stateKey') + '/cl
ear'; | 77 _url = 'states/' + commons.Escaper.ecapeVariable('$stateKey') + '/clear'; |
| 76 | 78 |
| 77 var _response = _requester.request(_url, | 79 var _response = _requester.request(_url, |
| 78 "POST", | 80 "POST", |
| 79 body: _body, | 81 body: _body, |
| 80 queryParams: _queryParams, | 82 queryParams: _queryParams, |
| 81 uploadOptions: _uploadOptions, | 83 uploadOptions: _uploadOptions, |
| 82 uploadMedia: _uploadMedia, | 84 uploadMedia: _uploadMedia, |
| 83 downloadOptions: _downloadOptions); | 85 downloadOptions: _downloadOptions); |
| 84 return _response.then((data) => new WriteResult.fromJson(data)); | 86 return _response.then((data) => new WriteResult.fromJson(data)); |
| 85 } | 87 } |
| 86 | 88 |
| 87 /** | 89 /** |
| 88 * Deletes a key and the data associated with it. The key is removed and no | 90 * Deletes a key and the data associated with it. The key is removed and no |
| 89 * longer counts against the key quota. Note that since this method is not | 91 * longer counts against the key quota. Note that since this method is not |
| 90 * safe in the face of concurrent modifications, it should only be used for | 92 * safe in the face of concurrent modifications, it should only be used for |
| 91 * development and testing purposes. Invoking this method in shipping code can | 93 * development and testing purposes. Invoking this method in shipping code can |
| 92 * result in data loss and data corruption. | 94 * result in data loss and data corruption. |
| 93 * | 95 * |
| 94 * Request parameters: | 96 * Request parameters: |
| 95 * | 97 * |
| 96 * [stateKey] - The key for the data to be retrieved. | 98 * [stateKey] - The key for the data to be retrieved. |
| 97 * Value must be between "0" and "3". | 99 * Value must be between "0" and "3". |
| 98 * | 100 * |
| 99 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 101 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 100 * error. | 102 * error. |
| 101 * | 103 * |
| 102 * If the used [http.Client] completes with an error when making a REST call, | 104 * If the used [http.Client] completes with an error when making a REST call, |
| 103 * this method will complete with the same error. | 105 * this method will complete with the same error. |
| 104 */ | 106 */ |
| 105 async.Future delete(core.int stateKey) { | 107 async.Future delete(core.int stateKey) { |
| 106 var _url = null; | 108 var _url = null; |
| 107 var _queryParams = new core.Map(); | 109 var _queryParams = new core.Map(); |
| 108 var _uploadMedia = null; | 110 var _uploadMedia = null; |
| 109 var _uploadOptions = null; | 111 var _uploadOptions = null; |
| 110 var _downloadOptions = common.DownloadOptions.Metadata; | 112 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 111 var _body = null; | 113 var _body = null; |
| 112 | 114 |
| 113 if (stateKey == null) { | 115 if (stateKey == null) { |
| 114 throw new core.ArgumentError("Parameter stateKey is required."); | 116 throw new core.ArgumentError("Parameter stateKey is required."); |
| 115 } | 117 } |
| 116 | 118 |
| 117 _downloadOptions = null; | 119 _downloadOptions = null; |
| 118 | 120 |
| 119 _url = 'states/' + common_internal.Escaper.ecapeVariable('$stateKey'); | 121 _url = 'states/' + commons.Escaper.ecapeVariable('$stateKey'); |
| 120 | 122 |
| 121 var _response = _requester.request(_url, | 123 var _response = _requester.request(_url, |
| 122 "DELETE", | 124 "DELETE", |
| 123 body: _body, | 125 body: _body, |
| 124 queryParams: _queryParams, | 126 queryParams: _queryParams, |
| 125 uploadOptions: _uploadOptions, | 127 uploadOptions: _uploadOptions, |
| 126 uploadMedia: _uploadMedia, | 128 uploadMedia: _uploadMedia, |
| 127 downloadOptions: _downloadOptions); | 129 downloadOptions: _downloadOptions); |
| 128 return _response.then((data) => null); | 130 return _response.then((data) => null); |
| 129 } | 131 } |
| 130 | 132 |
| 131 /** | 133 /** |
| 132 * Retrieves the data corresponding to the passed key. If the key does not | 134 * Retrieves the data corresponding to the passed key. If the key does not |
| 133 * exist on the server, an HTTP 404 will be returned. | 135 * exist on the server, an HTTP 404 will be returned. |
| 134 * | 136 * |
| 135 * Request parameters: | 137 * Request parameters: |
| 136 * | 138 * |
| 137 * [stateKey] - The key for the data to be retrieved. | 139 * [stateKey] - The key for the data to be retrieved. |
| 138 * Value must be between "0" and "3". | 140 * Value must be between "0" and "3". |
| 139 * | 141 * |
| 140 * Completes with a [GetResponse]. | 142 * Completes with a [GetResponse]. |
| 141 * | 143 * |
| 142 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 144 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 143 * error. | 145 * error. |
| 144 * | 146 * |
| 145 * If the used [http.Client] completes with an error when making a REST call, | 147 * If the used [http.Client] completes with an error when making a REST call, |
| 146 * this method will complete with the same error. | 148 * this method will complete with the same error. |
| 147 */ | 149 */ |
| 148 async.Future<GetResponse> get(core.int stateKey) { | 150 async.Future<GetResponse> get(core.int stateKey) { |
| 149 var _url = null; | 151 var _url = null; |
| 150 var _queryParams = new core.Map(); | 152 var _queryParams = new core.Map(); |
| 151 var _uploadMedia = null; | 153 var _uploadMedia = null; |
| 152 var _uploadOptions = null; | 154 var _uploadOptions = null; |
| 153 var _downloadOptions = common.DownloadOptions.Metadata; | 155 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 154 var _body = null; | 156 var _body = null; |
| 155 | 157 |
| 156 if (stateKey == null) { | 158 if (stateKey == null) { |
| 157 throw new core.ArgumentError("Parameter stateKey is required."); | 159 throw new core.ArgumentError("Parameter stateKey is required."); |
| 158 } | 160 } |
| 159 | 161 |
| 160 | 162 |
| 161 _url = 'states/' + common_internal.Escaper.ecapeVariable('$stateKey'); | 163 _url = 'states/' + commons.Escaper.ecapeVariable('$stateKey'); |
| 162 | 164 |
| 163 var _response = _requester.request(_url, | 165 var _response = _requester.request(_url, |
| 164 "GET", | 166 "GET", |
| 165 body: _body, | 167 body: _body, |
| 166 queryParams: _queryParams, | 168 queryParams: _queryParams, |
| 167 uploadOptions: _uploadOptions, | 169 uploadOptions: _uploadOptions, |
| 168 uploadMedia: _uploadMedia, | 170 uploadMedia: _uploadMedia, |
| 169 downloadOptions: _downloadOptions); | 171 downloadOptions: _downloadOptions); |
| 170 return _response.then((data) => new GetResponse.fromJson(data)); | 172 return _response.then((data) => new GetResponse.fromJson(data)); |
| 171 } | 173 } |
| 172 | 174 |
| 173 /** | 175 /** |
| 174 * Lists all the states keys, and optionally the state data. | 176 * Lists all the states keys, and optionally the state data. |
| 175 * | 177 * |
| 176 * Request parameters: | 178 * Request parameters: |
| 177 * | 179 * |
| 178 * [includeData] - Whether to include the full data in addition to the version | 180 * [includeData] - Whether to include the full data in addition to the version |
| 179 * number | 181 * number |
| 180 * | 182 * |
| 181 * Completes with a [ListResponse]. | 183 * Completes with a [ListResponse]. |
| 182 * | 184 * |
| 183 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 185 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 184 * error. | 186 * error. |
| 185 * | 187 * |
| 186 * If the used [http.Client] completes with an error when making a REST call, | 188 * If the used [http.Client] completes with an error when making a REST call, |
| 187 * this method will complete with the same error. | 189 * this method will complete with the same error. |
| 188 */ | 190 */ |
| 189 async.Future<ListResponse> list({core.bool includeData}) { | 191 async.Future<ListResponse> list({core.bool includeData}) { |
| 190 var _url = null; | 192 var _url = null; |
| 191 var _queryParams = new core.Map(); | 193 var _queryParams = new core.Map(); |
| 192 var _uploadMedia = null; | 194 var _uploadMedia = null; |
| 193 var _uploadOptions = null; | 195 var _uploadOptions = null; |
| 194 var _downloadOptions = common.DownloadOptions.Metadata; | 196 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 195 var _body = null; | 197 var _body = null; |
| 196 | 198 |
| 197 if (includeData != null) { | 199 if (includeData != null) { |
| 198 _queryParams["includeData"] = ["${includeData}"]; | 200 _queryParams["includeData"] = ["${includeData}"]; |
| 199 } | 201 } |
| 200 | 202 |
| 201 | 203 |
| 202 _url = 'states'; | 204 _url = 'states'; |
| 203 | 205 |
| 204 var _response = _requester.request(_url, | 206 var _response = _requester.request(_url, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 224 * Value must be between "0" and "3". | 226 * Value must be between "0" and "3". |
| 225 * | 227 * |
| 226 * [currentStateVersion] - The version of the app state your application is | 228 * [currentStateVersion] - The version of the app state your application is |
| 227 * attempting to update. If this does not match the current version, this | 229 * attempting to update. If this does not match the current version, this |
| 228 * method will return a conflict error. If there is no data stored on the | 230 * method will return a conflict error. If there is no data stored on the |
| 229 * server for this key, the update will succeed irrespective of the value of | 231 * server for this key, the update will succeed irrespective of the value of |
| 230 * this parameter. | 232 * this parameter. |
| 231 * | 233 * |
| 232 * Completes with a [WriteResult]. | 234 * Completes with a [WriteResult]. |
| 233 * | 235 * |
| 234 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 236 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 235 * error. | 237 * error. |
| 236 * | 238 * |
| 237 * If the used [http.Client] completes with an error when making a REST call, | 239 * If the used [http.Client] completes with an error when making a REST call, |
| 238 * this method will complete with the same error. | 240 * this method will complete with the same error. |
| 239 */ | 241 */ |
| 240 async.Future<WriteResult> update(UpdateRequest request, core.int stateKey, {co
re.String currentStateVersion}) { | 242 async.Future<WriteResult> update(UpdateRequest request, core.int stateKey, {co
re.String currentStateVersion}) { |
| 241 var _url = null; | 243 var _url = null; |
| 242 var _queryParams = new core.Map(); | 244 var _queryParams = new core.Map(); |
| 243 var _uploadMedia = null; | 245 var _uploadMedia = null; |
| 244 var _uploadOptions = null; | 246 var _uploadOptions = null; |
| 245 var _downloadOptions = common.DownloadOptions.Metadata; | 247 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 246 var _body = null; | 248 var _body = null; |
| 247 | 249 |
| 248 if (request != null) { | 250 if (request != null) { |
| 249 _body = convert.JSON.encode((request).toJson()); | 251 _body = convert.JSON.encode((request).toJson()); |
| 250 } | 252 } |
| 251 if (stateKey == null) { | 253 if (stateKey == null) { |
| 252 throw new core.ArgumentError("Parameter stateKey is required."); | 254 throw new core.ArgumentError("Parameter stateKey is required."); |
| 253 } | 255 } |
| 254 if (currentStateVersion != null) { | 256 if (currentStateVersion != null) { |
| 255 _queryParams["currentStateVersion"] = [currentStateVersion]; | 257 _queryParams["currentStateVersion"] = [currentStateVersion]; |
| 256 } | 258 } |
| 257 | 259 |
| 258 | 260 |
| 259 _url = 'states/' + common_internal.Escaper.ecapeVariable('$stateKey'); | 261 _url = 'states/' + commons.Escaper.ecapeVariable('$stateKey'); |
| 260 | 262 |
| 261 var _response = _requester.request(_url, | 263 var _response = _requester.request(_url, |
| 262 "PUT", | 264 "PUT", |
| 263 body: _body, | 265 body: _body, |
| 264 queryParams: _queryParams, | 266 queryParams: _queryParams, |
| 265 uploadOptions: _uploadOptions, | 267 uploadOptions: _uploadOptions, |
| 266 uploadMedia: _uploadMedia, | 268 uploadMedia: _uploadMedia, |
| 267 downloadOptions: _downloadOptions); | 269 downloadOptions: _downloadOptions); |
| 268 return _response.then((data) => new WriteResult.fromJson(data)); | 270 return _response.then((data) => new WriteResult.fromJson(data)); |
| 269 } | 271 } |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 } | 445 } |
| 444 if (kind != null) { | 446 if (kind != null) { |
| 445 _json["kind"] = kind; | 447 _json["kind"] = kind; |
| 446 } | 448 } |
| 447 if (stateKey != null) { | 449 if (stateKey != null) { |
| 448 _json["stateKey"] = stateKey; | 450 _json["stateKey"] = stateKey; |
| 449 } | 451 } |
| 450 return _json; | 452 return _json; |
| 451 } | 453 } |
| 452 } | 454 } |
| 453 | |
| 454 | |
| OLD | NEW |