| 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.appstate.v1; | 3 library googleapis.appstate.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 appstate/v1'; | 15 const core.String USER_AGENT = 'dart-api-client appstate/v1'; |
| 16 | 16 |
| 17 /** The Google App State API. */ | 17 /// The Google App State API. |
| 18 class AppstateApi { | 18 class AppstateApi { |
| 19 /** View and manage your data for this application */ | 19 /// View and manage your data for this application |
| 20 static const AppstateScope = "https://www.googleapis.com/auth/appstate"; | 20 static const AppstateScope = "https://www.googleapis.com/auth/appstate"; |
| 21 | 21 |
| 22 | |
| 23 final commons.ApiRequester _requester; | 22 final commons.ApiRequester _requester; |
| 24 | 23 |
| 25 StatesResourceApi get states => new StatesResourceApi(_requester); | 24 StatesResourceApi get states => new StatesResourceApi(_requester); |
| 26 | 25 |
| 27 AppstateApi(http.Client client, {core.String rootUrl: "https://www.googleapis.
com/", core.String servicePath: "appstate/v1/"}) : | 26 AppstateApi(http.Client client, |
| 28 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 27 {core.String rootUrl: "https://www.googleapis.com/", |
| 28 core.String servicePath: "appstate/v1/"}) |
| 29 : _requester = |
| 30 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT); |
| 29 } | 31 } |
| 30 | 32 |
| 31 | |
| 32 class StatesResourceApi { | 33 class StatesResourceApi { |
| 33 final commons.ApiRequester _requester; | 34 final commons.ApiRequester _requester; |
| 34 | 35 |
| 35 StatesResourceApi(commons.ApiRequester client) : | 36 StatesResourceApi(commons.ApiRequester client) : _requester = client; |
| 36 _requester = client; | |
| 37 | 37 |
| 38 /** | 38 /// Clears (sets to empty) the data for the passed key if and only if the |
| 39 * Clears (sets to empty) the data for the passed key if and only if the | 39 /// passed version matches the currently stored version. This method results |
| 40 * passed version matches the currently stored version. This method results in | 40 /// in a conflict error on version mismatch. |
| 41 * a conflict error on version mismatch. | 41 /// |
| 42 * | 42 /// Request parameters: |
| 43 * Request parameters: | 43 /// |
| 44 * | 44 /// [stateKey] - The key for the data to be retrieved. |
| 45 * [stateKey] - The key for the data to be retrieved. | 45 /// Value must be between "0" and "3". |
| 46 * Value must be between "0" and "3". | 46 /// |
| 47 * | 47 /// [currentDataVersion] - The version of the data to be cleared. Version |
| 48 * [currentDataVersion] - The version of the data to be cleared. Version | 48 /// strings are returned by the server. |
| 49 * strings are returned by the server. | 49 /// |
| 50 * | 50 /// Completes with a [WriteResult]. |
| 51 * Completes with a [WriteResult]. | 51 /// |
| 52 * | 52 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 53 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 53 /// an error. |
| 54 * error. | 54 /// |
| 55 * | 55 /// If the used [http.Client] completes with an error when making a REST |
| 56 * If the used [http.Client] completes with an error when making a REST call, | 56 /// call, this method will complete with the same error. |
| 57 * this method will complete with the same error. | 57 async.Future<WriteResult> clear(core.int stateKey, |
| 58 */ | 58 {core.String currentDataVersion}) { |
| 59 async.Future<WriteResult> clear(core.int stateKey, {core.String currentDataVer
sion}) { | |
| 60 var _url = null; | 59 var _url = null; |
| 61 var _queryParams = new core.Map(); | 60 var _queryParams = new core.Map(); |
| 62 var _uploadMedia = null; | 61 var _uploadMedia = null; |
| 63 var _uploadOptions = null; | 62 var _uploadOptions = null; |
| 64 var _downloadOptions = commons.DownloadOptions.Metadata; | 63 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 65 var _body = null; | 64 var _body = null; |
| 66 | 65 |
| 67 if (stateKey == null) { | 66 if (stateKey == null) { |
| 68 throw new core.ArgumentError("Parameter stateKey is required."); | 67 throw new core.ArgumentError("Parameter stateKey is required."); |
| 69 } | 68 } |
| 70 if (currentDataVersion != null) { | 69 if (currentDataVersion != null) { |
| 71 _queryParams["currentDataVersion"] = [currentDataVersion]; | 70 _queryParams["currentDataVersion"] = [currentDataVersion]; |
| 72 } | 71 } |
| 73 | 72 |
| 74 _url = 'states/' + commons.Escaper.ecapeVariable('$stateKey') + '/clear'; | 73 _url = 'states/' + commons.Escaper.ecapeVariable('$stateKey') + '/clear'; |
| 75 | 74 |
| 76 var _response = _requester.request(_url, | 75 var _response = _requester.request(_url, "POST", |
| 77 "POST", | 76 body: _body, |
| 78 body: _body, | 77 queryParams: _queryParams, |
| 79 queryParams: _queryParams, | 78 uploadOptions: _uploadOptions, |
| 80 uploadOptions: _uploadOptions, | 79 uploadMedia: _uploadMedia, |
| 81 uploadMedia: _uploadMedia, | 80 downloadOptions: _downloadOptions); |
| 82 downloadOptions: _downloadOptions); | |
| 83 return _response.then((data) => new WriteResult.fromJson(data)); | 81 return _response.then((data) => new WriteResult.fromJson(data)); |
| 84 } | 82 } |
| 85 | 83 |
| 86 /** | 84 /// Deletes a key and the data associated with it. The key is removed and no |
| 87 * Deletes a key and the data associated with it. The key is removed and no | 85 /// longer counts against the key quota. Note that since this method is not |
| 88 * longer counts against the key quota. Note that since this method is not | 86 /// safe in the face of concurrent modifications, it should only be used for |
| 89 * safe in the face of concurrent modifications, it should only be used for | 87 /// development and testing purposes. Invoking this method in shipping code |
| 90 * development and testing purposes. Invoking this method in shipping code can | 88 /// can result in data loss and data corruption. |
| 91 * result in data loss and data corruption. | 89 /// |
| 92 * | 90 /// Request parameters: |
| 93 * Request parameters: | 91 /// |
| 94 * | 92 /// [stateKey] - The key for the data to be retrieved. |
| 95 * [stateKey] - The key for the data to be retrieved. | 93 /// Value must be between "0" and "3". |
| 96 * Value must be between "0" and "3". | 94 /// |
| 97 * | 95 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 98 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 96 /// an error. |
| 99 * error. | 97 /// |
| 100 * | 98 /// If the used [http.Client] completes with an error when making a REST |
| 101 * If the used [http.Client] completes with an error when making a REST call, | 99 /// call, this method will complete with the same error. |
| 102 * this method will complete with the same error. | |
| 103 */ | |
| 104 async.Future delete(core.int stateKey) { | 100 async.Future delete(core.int stateKey) { |
| 105 var _url = null; | 101 var _url = null; |
| 106 var _queryParams = new core.Map(); | 102 var _queryParams = new core.Map(); |
| 107 var _uploadMedia = null; | 103 var _uploadMedia = null; |
| 108 var _uploadOptions = null; | 104 var _uploadOptions = null; |
| 109 var _downloadOptions = commons.DownloadOptions.Metadata; | 105 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 110 var _body = null; | 106 var _body = null; |
| 111 | 107 |
| 112 if (stateKey == null) { | 108 if (stateKey == null) { |
| 113 throw new core.ArgumentError("Parameter stateKey is required."); | 109 throw new core.ArgumentError("Parameter stateKey is required."); |
| 114 } | 110 } |
| 115 | 111 |
| 116 _downloadOptions = null; | 112 _downloadOptions = null; |
| 117 | 113 |
| 118 _url = 'states/' + commons.Escaper.ecapeVariable('$stateKey'); | 114 _url = 'states/' + commons.Escaper.ecapeVariable('$stateKey'); |
| 119 | 115 |
| 120 var _response = _requester.request(_url, | 116 var _response = _requester.request(_url, "DELETE", |
| 121 "DELETE", | 117 body: _body, |
| 122 body: _body, | 118 queryParams: _queryParams, |
| 123 queryParams: _queryParams, | 119 uploadOptions: _uploadOptions, |
| 124 uploadOptions: _uploadOptions, | 120 uploadMedia: _uploadMedia, |
| 125 uploadMedia: _uploadMedia, | 121 downloadOptions: _downloadOptions); |
| 126 downloadOptions: _downloadOptions); | |
| 127 return _response.then((data) => null); | 122 return _response.then((data) => null); |
| 128 } | 123 } |
| 129 | 124 |
| 130 /** | 125 /// Retrieves the data corresponding to the passed key. If the key does not |
| 131 * Retrieves the data corresponding to the passed key. If the key does not | 126 /// exist on the server, an HTTP 404 will be returned. |
| 132 * exist on the server, an HTTP 404 will be returned. | 127 /// |
| 133 * | 128 /// Request parameters: |
| 134 * Request parameters: | 129 /// |
| 135 * | 130 /// [stateKey] - The key for the data to be retrieved. |
| 136 * [stateKey] - The key for the data to be retrieved. | 131 /// Value must be between "0" and "3". |
| 137 * Value must be between "0" and "3". | 132 /// |
| 138 * | 133 /// Completes with a [GetResponse]. |
| 139 * Completes with a [GetResponse]. | 134 /// |
| 140 * | 135 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 141 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 136 /// an error. |
| 142 * error. | 137 /// |
| 143 * | 138 /// If the used [http.Client] completes with an error when making a REST |
| 144 * If the used [http.Client] completes with an error when making a REST call, | 139 /// call, this method will complete with the same error. |
| 145 * this method will complete with the same error. | |
| 146 */ | |
| 147 async.Future<GetResponse> get(core.int stateKey) { | 140 async.Future<GetResponse> get(core.int stateKey) { |
| 148 var _url = null; | 141 var _url = null; |
| 149 var _queryParams = new core.Map(); | 142 var _queryParams = new core.Map(); |
| 150 var _uploadMedia = null; | 143 var _uploadMedia = null; |
| 151 var _uploadOptions = null; | 144 var _uploadOptions = null; |
| 152 var _downloadOptions = commons.DownloadOptions.Metadata; | 145 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 153 var _body = null; | 146 var _body = null; |
| 154 | 147 |
| 155 if (stateKey == null) { | 148 if (stateKey == null) { |
| 156 throw new core.ArgumentError("Parameter stateKey is required."); | 149 throw new core.ArgumentError("Parameter stateKey is required."); |
| 157 } | 150 } |
| 158 | 151 |
| 159 _url = 'states/' + commons.Escaper.ecapeVariable('$stateKey'); | 152 _url = 'states/' + commons.Escaper.ecapeVariable('$stateKey'); |
| 160 | 153 |
| 161 var _response = _requester.request(_url, | 154 var _response = _requester.request(_url, "GET", |
| 162 "GET", | 155 body: _body, |
| 163 body: _body, | 156 queryParams: _queryParams, |
| 164 queryParams: _queryParams, | 157 uploadOptions: _uploadOptions, |
| 165 uploadOptions: _uploadOptions, | 158 uploadMedia: _uploadMedia, |
| 166 uploadMedia: _uploadMedia, | 159 downloadOptions: _downloadOptions); |
| 167 downloadOptions: _downloadOptions); | |
| 168 return _response.then((data) => new GetResponse.fromJson(data)); | 160 return _response.then((data) => new GetResponse.fromJson(data)); |
| 169 } | 161 } |
| 170 | 162 |
| 171 /** | 163 /// Lists all the states keys, and optionally the state data. |
| 172 * Lists all the states keys, and optionally the state data. | 164 /// |
| 173 * | 165 /// Request parameters: |
| 174 * Request parameters: | 166 /// |
| 175 * | 167 /// [includeData] - Whether to include the full data in addition to the |
| 176 * [includeData] - Whether to include the full data in addition to the version | 168 /// version number |
| 177 * number | 169 /// |
| 178 * | 170 /// Completes with a [ListResponse]. |
| 179 * Completes with a [ListResponse]. | 171 /// |
| 180 * | 172 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 181 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 173 /// an error. |
| 182 * error. | 174 /// |
| 183 * | 175 /// If the used [http.Client] completes with an error when making a REST |
| 184 * If the used [http.Client] completes with an error when making a REST call, | 176 /// call, this method will complete with the same error. |
| 185 * this method will complete with the same error. | |
| 186 */ | |
| 187 async.Future<ListResponse> list({core.bool includeData}) { | 177 async.Future<ListResponse> list({core.bool includeData}) { |
| 188 var _url = null; | 178 var _url = null; |
| 189 var _queryParams = new core.Map(); | 179 var _queryParams = new core.Map(); |
| 190 var _uploadMedia = null; | 180 var _uploadMedia = null; |
| 191 var _uploadOptions = null; | 181 var _uploadOptions = null; |
| 192 var _downloadOptions = commons.DownloadOptions.Metadata; | 182 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 193 var _body = null; | 183 var _body = null; |
| 194 | 184 |
| 195 if (includeData != null) { | 185 if (includeData != null) { |
| 196 _queryParams["includeData"] = ["${includeData}"]; | 186 _queryParams["includeData"] = ["${includeData}"]; |
| 197 } | 187 } |
| 198 | 188 |
| 199 _url = 'states'; | 189 _url = 'states'; |
| 200 | 190 |
| 201 var _response = _requester.request(_url, | 191 var _response = _requester.request(_url, "GET", |
| 202 "GET", | 192 body: _body, |
| 203 body: _body, | 193 queryParams: _queryParams, |
| 204 queryParams: _queryParams, | 194 uploadOptions: _uploadOptions, |
| 205 uploadOptions: _uploadOptions, | 195 uploadMedia: _uploadMedia, |
| 206 uploadMedia: _uploadMedia, | 196 downloadOptions: _downloadOptions); |
| 207 downloadOptions: _downloadOptions); | |
| 208 return _response.then((data) => new ListResponse.fromJson(data)); | 197 return _response.then((data) => new ListResponse.fromJson(data)); |
| 209 } | 198 } |
| 210 | 199 |
| 211 /** | 200 /// Update the data associated with the input key if and only if the passed |
| 212 * Update the data associated with the input key if and only if the passed | 201 /// version matches the currently stored version. This method is safe in the |
| 213 * version matches the currently stored version. This method is safe in the | 202 /// face of concurrent writes. Maximum per-key size is 128KB. |
| 214 * face of concurrent writes. Maximum per-key size is 128KB. | 203 /// |
| 215 * | 204 /// [request] - The metadata request object. |
| 216 * [request] - The metadata request object. | 205 /// |
| 217 * | 206 /// Request parameters: |
| 218 * Request parameters: | 207 /// |
| 219 * | 208 /// [stateKey] - The key for the data to be retrieved. |
| 220 * [stateKey] - The key for the data to be retrieved. | 209 /// Value must be between "0" and "3". |
| 221 * Value must be between "0" and "3". | 210 /// |
| 222 * | 211 /// [currentStateVersion] - The version of the app state your application is |
| 223 * [currentStateVersion] - The version of the app state your application is | 212 /// attempting to update. If this does not match the current version, this |
| 224 * attempting to update. If this does not match the current version, this | 213 /// method will return a conflict error. If there is no data stored on the |
| 225 * method will return a conflict error. If there is no data stored on the | 214 /// server for this key, the update will succeed irrespective of the value of |
| 226 * server for this key, the update will succeed irrespective of the value of | 215 /// this parameter. |
| 227 * this parameter. | 216 /// |
| 228 * | 217 /// Completes with a [WriteResult]. |
| 229 * Completes with a [WriteResult]. | 218 /// |
| 230 * | 219 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 231 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 220 /// an error. |
| 232 * error. | 221 /// |
| 233 * | 222 /// If the used [http.Client] completes with an error when making a REST |
| 234 * If the used [http.Client] completes with an error when making a REST call, | 223 /// call, this method will complete with the same error. |
| 235 * this method will complete with the same error. | 224 async.Future<WriteResult> update(UpdateRequest request, core.int stateKey, |
| 236 */ | 225 {core.String currentStateVersion}) { |
| 237 async.Future<WriteResult> update(UpdateRequest request, core.int stateKey, {co
re.String currentStateVersion}) { | |
| 238 var _url = null; | 226 var _url = null; |
| 239 var _queryParams = new core.Map(); | 227 var _queryParams = new core.Map(); |
| 240 var _uploadMedia = null; | 228 var _uploadMedia = null; |
| 241 var _uploadOptions = null; | 229 var _uploadOptions = null; |
| 242 var _downloadOptions = commons.DownloadOptions.Metadata; | 230 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 243 var _body = null; | 231 var _body = null; |
| 244 | 232 |
| 245 if (request != null) { | 233 if (request != null) { |
| 246 _body = convert.JSON.encode((request).toJson()); | 234 _body = convert.JSON.encode((request).toJson()); |
| 247 } | 235 } |
| 248 if (stateKey == null) { | 236 if (stateKey == null) { |
| 249 throw new core.ArgumentError("Parameter stateKey is required."); | 237 throw new core.ArgumentError("Parameter stateKey is required."); |
| 250 } | 238 } |
| 251 if (currentStateVersion != null) { | 239 if (currentStateVersion != null) { |
| 252 _queryParams["currentStateVersion"] = [currentStateVersion]; | 240 _queryParams["currentStateVersion"] = [currentStateVersion]; |
| 253 } | 241 } |
| 254 | 242 |
| 255 _url = 'states/' + commons.Escaper.ecapeVariable('$stateKey'); | 243 _url = 'states/' + commons.Escaper.ecapeVariable('$stateKey'); |
| 256 | 244 |
| 257 var _response = _requester.request(_url, | 245 var _response = _requester.request(_url, "PUT", |
| 258 "PUT", | 246 body: _body, |
| 259 body: _body, | 247 queryParams: _queryParams, |
| 260 queryParams: _queryParams, | 248 uploadOptions: _uploadOptions, |
| 261 uploadOptions: _uploadOptions, | 249 uploadMedia: _uploadMedia, |
| 262 uploadMedia: _uploadMedia, | 250 downloadOptions: _downloadOptions); |
| 263 downloadOptions: _downloadOptions); | |
| 264 return _response.then((data) => new WriteResult.fromJson(data)); | 251 return _response.then((data) => new WriteResult.fromJson(data)); |
| 265 } | 252 } |
| 266 | |
| 267 } | 253 } |
| 268 | 254 |
| 255 /// This is a JSON template for an app state resource. |
| 256 class GetResponse { |
| 257 /// The current app state version. |
| 258 core.String currentStateVersion; |
| 269 | 259 |
| 260 /// The requested data. |
| 261 core.String data; |
| 270 | 262 |
| 271 /** This is a JSON template for an app state resource. */ | 263 /// Uniquely identifies the type of this resource. Value is always the fixed |
| 272 class GetResponse { | 264 /// string appstate#getResponse. |
| 273 /** The current app state version. */ | |
| 274 core.String currentStateVersion; | |
| 275 /** The requested data. */ | |
| 276 core.String data; | |
| 277 /** | |
| 278 * Uniquely identifies the type of this resource. Value is always the fixed | |
| 279 * string appstate#getResponse. | |
| 280 */ | |
| 281 core.String kind; | 265 core.String kind; |
| 282 /** The key for the data. */ | 266 |
| 267 /// The key for the data. |
| 283 core.int stateKey; | 268 core.int stateKey; |
| 284 | 269 |
| 285 GetResponse(); | 270 GetResponse(); |
| 286 | 271 |
| 287 GetResponse.fromJson(core.Map _json) { | 272 GetResponse.fromJson(core.Map _json) { |
| 288 if (_json.containsKey("currentStateVersion")) { | 273 if (_json.containsKey("currentStateVersion")) { |
| 289 currentStateVersion = _json["currentStateVersion"]; | 274 currentStateVersion = _json["currentStateVersion"]; |
| 290 } | 275 } |
| 291 if (_json.containsKey("data")) { | 276 if (_json.containsKey("data")) { |
| 292 data = _json["data"]; | 277 data = _json["data"]; |
| 293 } | 278 } |
| 294 if (_json.containsKey("kind")) { | 279 if (_json.containsKey("kind")) { |
| 295 kind = _json["kind"]; | 280 kind = _json["kind"]; |
| 296 } | 281 } |
| 297 if (_json.containsKey("stateKey")) { | 282 if (_json.containsKey("stateKey")) { |
| 298 stateKey = _json["stateKey"]; | 283 stateKey = _json["stateKey"]; |
| 299 } | 284 } |
| 300 } | 285 } |
| 301 | 286 |
| 302 core.Map<core.String, core.Object> toJson() { | 287 core.Map<core.String, core.Object> toJson() { |
| 303 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 288 final core.Map<core.String, core.Object> _json = |
| 289 new core.Map<core.String, core.Object>(); |
| 304 if (currentStateVersion != null) { | 290 if (currentStateVersion != null) { |
| 305 _json["currentStateVersion"] = currentStateVersion; | 291 _json["currentStateVersion"] = currentStateVersion; |
| 306 } | 292 } |
| 307 if (data != null) { | 293 if (data != null) { |
| 308 _json["data"] = data; | 294 _json["data"] = data; |
| 309 } | 295 } |
| 310 if (kind != null) { | 296 if (kind != null) { |
| 311 _json["kind"] = kind; | 297 _json["kind"] = kind; |
| 312 } | 298 } |
| 313 if (stateKey != null) { | 299 if (stateKey != null) { |
| 314 _json["stateKey"] = stateKey; | 300 _json["stateKey"] = stateKey; |
| 315 } | 301 } |
| 316 return _json; | 302 return _json; |
| 317 } | 303 } |
| 318 } | 304 } |
| 319 | 305 |
| 320 /** This is a JSON template to convert a list-response for app state. */ | 306 /// This is a JSON template to convert a list-response for app state. |
| 321 class ListResponse { | 307 class ListResponse { |
| 322 /** The app state data. */ | 308 /// The app state data. |
| 323 core.List<GetResponse> items; | 309 core.List<GetResponse> items; |
| 324 /** | 310 |
| 325 * Uniquely identifies the type of this resource. Value is always the fixed | 311 /// Uniquely identifies the type of this resource. Value is always the fixed |
| 326 * string appstate#listResponse. | 312 /// string appstate#listResponse. |
| 327 */ | |
| 328 core.String kind; | 313 core.String kind; |
| 329 /** The maximum number of keys allowed for this user. */ | 314 |
| 315 /// The maximum number of keys allowed for this user. |
| 330 core.int maximumKeyCount; | 316 core.int maximumKeyCount; |
| 331 | 317 |
| 332 ListResponse(); | 318 ListResponse(); |
| 333 | 319 |
| 334 ListResponse.fromJson(core.Map _json) { | 320 ListResponse.fromJson(core.Map _json) { |
| 335 if (_json.containsKey("items")) { | 321 if (_json.containsKey("items")) { |
| 336 items = _json["items"].map((value) => new GetResponse.fromJson(value)).toL
ist(); | 322 items = _json["items"] |
| 323 .map((value) => new GetResponse.fromJson(value)) |
| 324 .toList(); |
| 337 } | 325 } |
| 338 if (_json.containsKey("kind")) { | 326 if (_json.containsKey("kind")) { |
| 339 kind = _json["kind"]; | 327 kind = _json["kind"]; |
| 340 } | 328 } |
| 341 if (_json.containsKey("maximumKeyCount")) { | 329 if (_json.containsKey("maximumKeyCount")) { |
| 342 maximumKeyCount = _json["maximumKeyCount"]; | 330 maximumKeyCount = _json["maximumKeyCount"]; |
| 343 } | 331 } |
| 344 } | 332 } |
| 345 | 333 |
| 346 core.Map<core.String, core.Object> toJson() { | 334 core.Map<core.String, core.Object> toJson() { |
| 347 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 335 final core.Map<core.String, core.Object> _json = |
| 336 new core.Map<core.String, core.Object>(); |
| 348 if (items != null) { | 337 if (items != null) { |
| 349 _json["items"] = items.map((value) => (value).toJson()).toList(); | 338 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 350 } | 339 } |
| 351 if (kind != null) { | 340 if (kind != null) { |
| 352 _json["kind"] = kind; | 341 _json["kind"] = kind; |
| 353 } | 342 } |
| 354 if (maximumKeyCount != null) { | 343 if (maximumKeyCount != null) { |
| 355 _json["maximumKeyCount"] = maximumKeyCount; | 344 _json["maximumKeyCount"] = maximumKeyCount; |
| 356 } | 345 } |
| 357 return _json; | 346 return _json; |
| 358 } | 347 } |
| 359 } | 348 } |
| 360 | 349 |
| 361 /** This is a JSON template for a requests which update app state */ | 350 /// This is a JSON template for a requests which update app state |
| 362 class UpdateRequest { | 351 class UpdateRequest { |
| 363 /** The new app state data that your application is trying to update with. */ | 352 /// The new app state data that your application is trying to update with. |
| 364 core.String data; | 353 core.String data; |
| 365 /** | 354 |
| 366 * Uniquely identifies the type of this resource. Value is always the fixed | 355 /// Uniquely identifies the type of this resource. Value is always the fixed |
| 367 * string appstate#updateRequest. | 356 /// string appstate#updateRequest. |
| 368 */ | |
| 369 core.String kind; | 357 core.String kind; |
| 370 | 358 |
| 371 UpdateRequest(); | 359 UpdateRequest(); |
| 372 | 360 |
| 373 UpdateRequest.fromJson(core.Map _json) { | 361 UpdateRequest.fromJson(core.Map _json) { |
| 374 if (_json.containsKey("data")) { | 362 if (_json.containsKey("data")) { |
| 375 data = _json["data"]; | 363 data = _json["data"]; |
| 376 } | 364 } |
| 377 if (_json.containsKey("kind")) { | 365 if (_json.containsKey("kind")) { |
| 378 kind = _json["kind"]; | 366 kind = _json["kind"]; |
| 379 } | 367 } |
| 380 } | 368 } |
| 381 | 369 |
| 382 core.Map<core.String, core.Object> toJson() { | 370 core.Map<core.String, core.Object> toJson() { |
| 383 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 371 final core.Map<core.String, core.Object> _json = |
| 372 new core.Map<core.String, core.Object>(); |
| 384 if (data != null) { | 373 if (data != null) { |
| 385 _json["data"] = data; | 374 _json["data"] = data; |
| 386 } | 375 } |
| 387 if (kind != null) { | 376 if (kind != null) { |
| 388 _json["kind"] = kind; | 377 _json["kind"] = kind; |
| 389 } | 378 } |
| 390 return _json; | 379 return _json; |
| 391 } | 380 } |
| 392 } | 381 } |
| 393 | 382 |
| 394 /** This is a JSON template for an app state write result. */ | 383 /// This is a JSON template for an app state write result. |
| 395 class WriteResult { | 384 class WriteResult { |
| 396 /** The version of the data for this key on the server. */ | 385 /// The version of the data for this key on the server. |
| 397 core.String currentStateVersion; | 386 core.String currentStateVersion; |
| 398 /** | 387 |
| 399 * Uniquely identifies the type of this resource. Value is always the fixed | 388 /// Uniquely identifies the type of this resource. Value is always the fixed |
| 400 * string appstate#writeResult. | 389 /// string appstate#writeResult. |
| 401 */ | |
| 402 core.String kind; | 390 core.String kind; |
| 403 /** The written key. */ | 391 |
| 392 /// The written key. |
| 404 core.int stateKey; | 393 core.int stateKey; |
| 405 | 394 |
| 406 WriteResult(); | 395 WriteResult(); |
| 407 | 396 |
| 408 WriteResult.fromJson(core.Map _json) { | 397 WriteResult.fromJson(core.Map _json) { |
| 409 if (_json.containsKey("currentStateVersion")) { | 398 if (_json.containsKey("currentStateVersion")) { |
| 410 currentStateVersion = _json["currentStateVersion"]; | 399 currentStateVersion = _json["currentStateVersion"]; |
| 411 } | 400 } |
| 412 if (_json.containsKey("kind")) { | 401 if (_json.containsKey("kind")) { |
| 413 kind = _json["kind"]; | 402 kind = _json["kind"]; |
| 414 } | 403 } |
| 415 if (_json.containsKey("stateKey")) { | 404 if (_json.containsKey("stateKey")) { |
| 416 stateKey = _json["stateKey"]; | 405 stateKey = _json["stateKey"]; |
| 417 } | 406 } |
| 418 } | 407 } |
| 419 | 408 |
| 420 core.Map<core.String, core.Object> toJson() { | 409 core.Map<core.String, core.Object> toJson() { |
| 421 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 410 final core.Map<core.String, core.Object> _json = |
| 411 new core.Map<core.String, core.Object>(); |
| 422 if (currentStateVersion != null) { | 412 if (currentStateVersion != null) { |
| 423 _json["currentStateVersion"] = currentStateVersion; | 413 _json["currentStateVersion"] = currentStateVersion; |
| 424 } | 414 } |
| 425 if (kind != null) { | 415 if (kind != null) { |
| 426 _json["kind"] = kind; | 416 _json["kind"] = kind; |
| 427 } | 417 } |
| 428 if (stateKey != null) { | 418 if (stateKey != null) { |
| 429 _json["stateKey"] = stateKey; | 419 _json["stateKey"] = stateKey; |
| 430 } | 420 } |
| 431 return _json; | 421 return _json; |
| 432 } | 422 } |
| 433 } | 423 } |
| OLD | NEW |