| 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.consumersurveys.v2; | 3 library googleapis.consumersurveys.v2; |
| 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; |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 } | 253 } |
| 254 | 254 |
| 255 | 255 |
| 256 class SurveysResourceApi { | 256 class SurveysResourceApi { |
| 257 final commons.ApiRequester _requester; | 257 final commons.ApiRequester _requester; |
| 258 | 258 |
| 259 SurveysResourceApi(commons.ApiRequester client) : | 259 SurveysResourceApi(commons.ApiRequester client) : |
| 260 _requester = client; | 260 _requester = client; |
| 261 | 261 |
| 262 /** | 262 /** |
| 263 * Removes a survey from view in all user GET requests. |
| 264 * |
| 265 * Request parameters: |
| 266 * |
| 267 * [surveyUrlId] - External URL ID for the survey. |
| 268 * |
| 269 * Completes with a [SurveysDeleteResponse]. |
| 270 * |
| 271 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 272 * error. |
| 273 * |
| 274 * If the used [http.Client] completes with an error when making a REST call, |
| 275 * this method will complete with the same error. |
| 276 */ |
| 277 async.Future<SurveysDeleteResponse> delete(core.String surveyUrlId) { |
| 278 var _url = null; |
| 279 var _queryParams = new core.Map(); |
| 280 var _uploadMedia = null; |
| 281 var _uploadOptions = null; |
| 282 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 283 var _body = null; |
| 284 |
| 285 if (surveyUrlId == null) { |
| 286 throw new core.ArgumentError("Parameter surveyUrlId is required."); |
| 287 } |
| 288 |
| 289 _url = 'surveys/' + commons.Escaper.ecapeVariable('$surveyUrlId'); |
| 290 |
| 291 var _response = _requester.request(_url, |
| 292 "DELETE", |
| 293 body: _body, |
| 294 queryParams: _queryParams, |
| 295 uploadOptions: _uploadOptions, |
| 296 uploadMedia: _uploadMedia, |
| 297 downloadOptions: _downloadOptions); |
| 298 return _response.then((data) => new SurveysDeleteResponse.fromJson(data)); |
| 299 } |
| 300 |
| 301 /** |
| 263 * Retrieves information about the specified survey. | 302 * Retrieves information about the specified survey. |
| 264 * | 303 * |
| 265 * Request parameters: | 304 * Request parameters: |
| 266 * | 305 * |
| 267 * [surveyUrlId] - External URL ID for the survey. | 306 * [surveyUrlId] - External URL ID for the survey. |
| 268 * | 307 * |
| 269 * Completes with a [Survey]. | 308 * Completes with a [Survey]. |
| 270 * | 309 * |
| 271 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 310 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 272 * error. | 311 * error. |
| (...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1291 if (status != null) { | 1330 if (status != null) { |
| 1292 _json["status"] = status; | 1331 _json["status"] = status; |
| 1293 } | 1332 } |
| 1294 if (surveyUrlId != null) { | 1333 if (surveyUrlId != null) { |
| 1295 _json["surveyUrlId"] = surveyUrlId; | 1334 _json["surveyUrlId"] = surveyUrlId; |
| 1296 } | 1335 } |
| 1297 return _json; | 1336 return _json; |
| 1298 } | 1337 } |
| 1299 } | 1338 } |
| 1300 | 1339 |
| 1340 class SurveysDeleteResponse { |
| 1341 /** |
| 1342 * Unique request ID used for logging and debugging. Please include in any |
| 1343 * error reporting or troubleshooting requests. |
| 1344 */ |
| 1345 core.String requestId; |
| 1346 |
| 1347 SurveysDeleteResponse(); |
| 1348 |
| 1349 SurveysDeleteResponse.fromJson(core.Map _json) { |
| 1350 if (_json.containsKey("requestId")) { |
| 1351 requestId = _json["requestId"]; |
| 1352 } |
| 1353 } |
| 1354 |
| 1355 core.Map toJson() { |
| 1356 var _json = new core.Map(); |
| 1357 if (requestId != null) { |
| 1358 _json["requestId"] = requestId; |
| 1359 } |
| 1360 return _json; |
| 1361 } |
| 1362 } |
| 1363 |
| 1301 class SurveysListResponse { | 1364 class SurveysListResponse { |
| 1302 PageInfo pageInfo; | 1365 PageInfo pageInfo; |
| 1303 /** | 1366 /** |
| 1304 * Unique request ID used for logging and debugging. Please include in any | 1367 * Unique request ID used for logging and debugging. Please include in any |
| 1305 * error reporting or troubleshooting requests. | 1368 * error reporting or troubleshooting requests. |
| 1306 */ | 1369 */ |
| 1307 core.String requestId; | 1370 core.String requestId; |
| 1308 /** An individual survey resource. */ | 1371 /** An individual survey resource. */ |
| 1309 core.List<Survey> resources; | 1372 core.List<Survey> resources; |
| 1310 TokenPagination tokenPagination; | 1373 TokenPagination tokenPagination; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1451 var _json = new core.Map(); | 1514 var _json = new core.Map(); |
| 1452 if (nextPageToken != null) { | 1515 if (nextPageToken != null) { |
| 1453 _json["nextPageToken"] = nextPageToken; | 1516 _json["nextPageToken"] = nextPageToken; |
| 1454 } | 1517 } |
| 1455 if (previousPageToken != null) { | 1518 if (previousPageToken != null) { |
| 1456 _json["previousPageToken"] = previousPageToken; | 1519 _json["previousPageToken"] = previousPageToken; |
| 1457 } | 1520 } |
| 1458 return _json; | 1521 return _json; |
| 1459 } | 1522 } |
| 1460 } | 1523 } |
| OLD | NEW |