| 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.sheets.v4; | 3 library googleapis.sheets.v4; |
| 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 } | 280 } |
| 281 | 281 |
| 282 | 282 |
| 283 class SpreadsheetsValuesResourceApi { | 283 class SpreadsheetsValuesResourceApi { |
| 284 final commons.ApiRequester _requester; | 284 final commons.ApiRequester _requester; |
| 285 | 285 |
| 286 SpreadsheetsValuesResourceApi(commons.ApiRequester client) : | 286 SpreadsheetsValuesResourceApi(commons.ApiRequester client) : |
| 287 _requester = client; | 287 _requester = client; |
| 288 | 288 |
| 289 /** | 289 /** |
| 290 * Appends values to a spreadsheet. The input range is used to search for |
| 291 * existing data and find a "table" within that range. Values will be |
| 292 * appended to the next row of the table, starting with the first column of |
| 293 * the table. See the |
| 294 * [guide](/sheets/guides/values#appending_values) |
| 295 * and |
| 296 * [sample code](/sheets/samples/writing#append_values) |
| 297 * for specific details of how tables are detected and data is appended. |
| 298 * |
| 299 * The caller must specify the spreadsheet ID, range, and |
| 300 * a valueInputOption. The `valueInputOption` only |
| 301 * controls how the input data will be added to the sheet (column-wise or |
| 302 * row-wise), it does not influence what cell the data starts being written |
| 303 * to. |
| 304 * |
| 305 * [request] - The metadata request object. |
| 306 * |
| 307 * Request parameters: |
| 308 * |
| 309 * [spreadsheetId] - The ID of the spreadsheet to update. |
| 310 * |
| 311 * [range] - The A1 notation of a range to search for a logical table of data. |
| 312 * Values will be appended after the last row of the table. |
| 313 * |
| 314 * [valueInputOption] - How the input data should be interpreted. |
| 315 * Possible string values are: |
| 316 * - "INPUT_VALUE_OPTION_UNSPECIFIED" : A INPUT_VALUE_OPTION_UNSPECIFIED. |
| 317 * - "RAW" : A RAW. |
| 318 * - "USER_ENTERED" : A USER_ENTERED. |
| 319 * |
| 320 * [insertDataOption] - How the input data should be inserted. |
| 321 * Possible string values are: |
| 322 * - "OVERWRITE" : A OVERWRITE. |
| 323 * - "INSERT_ROWS" : A INSERT_ROWS. |
| 324 * |
| 325 * Completes with a [AppendValuesResponse]. |
| 326 * |
| 327 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 328 * error. |
| 329 * |
| 330 * If the used [http.Client] completes with an error when making a REST call, |
| 331 * this method will complete with the same error. |
| 332 */ |
| 333 async.Future<AppendValuesResponse> append(ValueRange request, core.String spre
adsheetId, core.String range, {core.String valueInputOption, core.String insertD
ataOption}) { |
| 334 var _url = null; |
| 335 var _queryParams = new core.Map(); |
| 336 var _uploadMedia = null; |
| 337 var _uploadOptions = null; |
| 338 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 339 var _body = null; |
| 340 |
| 341 if (request != null) { |
| 342 _body = convert.JSON.encode((request).toJson()); |
| 343 } |
| 344 if (spreadsheetId == null) { |
| 345 throw new core.ArgumentError("Parameter spreadsheetId is required."); |
| 346 } |
| 347 if (range == null) { |
| 348 throw new core.ArgumentError("Parameter range is required."); |
| 349 } |
| 350 if (valueInputOption != null) { |
| 351 _queryParams["valueInputOption"] = [valueInputOption]; |
| 352 } |
| 353 if (insertDataOption != null) { |
| 354 _queryParams["insertDataOption"] = [insertDataOption]; |
| 355 } |
| 356 |
| 357 _url = 'v4/spreadsheets/' + commons.Escaper.ecapeVariable('$spreadsheetId')
+ '/values/' + commons.Escaper.ecapeVariable('$range') + ':append'; |
| 358 |
| 359 var _response = _requester.request(_url, |
| 360 "POST", |
| 361 body: _body, |
| 362 queryParams: _queryParams, |
| 363 uploadOptions: _uploadOptions, |
| 364 uploadMedia: _uploadMedia, |
| 365 downloadOptions: _downloadOptions); |
| 366 return _response.then((data) => new AppendValuesResponse.fromJson(data)); |
| 367 } |
| 368 |
| 369 /** |
| 290 * Returns one or more ranges of values from a spreadsheet. | 370 * Returns one or more ranges of values from a spreadsheet. |
| 291 * The caller must specify the spreadsheet ID and one or more ranges. | 371 * The caller must specify the spreadsheet ID and one or more ranges. |
| 292 * | 372 * |
| 293 * Request parameters: | 373 * Request parameters: |
| 294 * | 374 * |
| 295 * [spreadsheetId] - The ID of the spreadsheet to retrieve data from. | 375 * [spreadsheetId] - The ID of the spreadsheet to retrieve data from. |
| 296 * | 376 * |
| 297 * [ranges] - The A1 notation of the values to retrieve. | 377 * [ranges] - The A1 notation of the values to retrieve. |
| 298 * | 378 * |
| 299 * [valueRenderOption] - How values should be represented in the output. | 379 * [valueRenderOption] - How values should be represented in the output. |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 } | 634 } |
| 555 | 635 |
| 556 } | 636 } |
| 557 | 637 |
| 558 | 638 |
| 559 | 639 |
| 560 /** Adds a chart to a sheet in the spreadsheet. */ | 640 /** Adds a chart to a sheet in the spreadsheet. */ |
| 561 class AddChartRequest { | 641 class AddChartRequest { |
| 562 /** | 642 /** |
| 563 * The chart that should be added to the spreadsheet, including the position | 643 * The chart that should be added to the spreadsheet, including the position |
| 564 * where it should be placed. | 644 * where it should be placed. The chartId |
| 645 * field is optional; if one is not set, an id will be randomly generated. (It |
| 646 * is an error to specify the ID of a chart that already exists.) |
| 565 */ | 647 */ |
| 566 EmbeddedChart chart; | 648 EmbeddedChart chart; |
| 567 | 649 |
| 568 AddChartRequest(); | 650 AddChartRequest(); |
| 569 | 651 |
| 570 AddChartRequest.fromJson(core.Map _json) { | 652 AddChartRequest.fromJson(core.Map _json) { |
| 571 if (_json.containsKey("chart")) { | 653 if (_json.containsKey("chart")) { |
| 572 chart = new EmbeddedChart.fromJson(_json["chart"]); | 654 chart = new EmbeddedChart.fromJson(_json["chart"]); |
| 573 } | 655 } |
| 574 } | 656 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 } | 714 } |
| 633 if (rule != null) { | 715 if (rule != null) { |
| 634 _json["rule"] = (rule).toJson(); | 716 _json["rule"] = (rule).toJson(); |
| 635 } | 717 } |
| 636 return _json; | 718 return _json; |
| 637 } | 719 } |
| 638 } | 720 } |
| 639 | 721 |
| 640 /** Adds a filter view. */ | 722 /** Adds a filter view. */ |
| 641 class AddFilterViewRequest { | 723 class AddFilterViewRequest { |
| 642 /** The filter to add. */ | 724 /** |
| 725 * The filter to add. The filterViewId |
| 726 * field is optional; if one is not set, an id will be randomly generated. (It |
| 727 * is an error to specify the ID of a filter that already exists.) |
| 728 */ |
| 643 FilterView filter; | 729 FilterView filter; |
| 644 | 730 |
| 645 AddFilterViewRequest(); | 731 AddFilterViewRequest(); |
| 646 | 732 |
| 647 AddFilterViewRequest.fromJson(core.Map _json) { | 733 AddFilterViewRequest.fromJson(core.Map _json) { |
| 648 if (_json.containsKey("filter")) { | 734 if (_json.containsKey("filter")) { |
| 649 filter = new FilterView.fromJson(_json["filter"]); | 735 filter = new FilterView.fromJson(_json["filter"]); |
| 650 } | 736 } |
| 651 } | 737 } |
| 652 | 738 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 677 if (filter != null) { | 763 if (filter != null) { |
| 678 _json["filter"] = (filter).toJson(); | 764 _json["filter"] = (filter).toJson(); |
| 679 } | 765 } |
| 680 return _json; | 766 return _json; |
| 681 } | 767 } |
| 682 } | 768 } |
| 683 | 769 |
| 684 /** Adds a named range to the spreadsheet. */ | 770 /** Adds a named range to the spreadsheet. */ |
| 685 class AddNamedRangeRequest { | 771 class AddNamedRangeRequest { |
| 686 /** | 772 /** |
| 687 * The named range to add. If a non-empty | 773 * The named range to add. The namedRangeId |
| 688 * namedRangeId is specified, the named range | 774 * field is optional; if one is not set, an id will be randomly generated. (It |
| 689 * will use that ID. (It is an error to specify the ID of a named | 775 * is an error to specify the ID of a range that already exists.) |
| 690 * range that already exists.) | |
| 691 */ | 776 */ |
| 692 NamedRange namedRange; | 777 NamedRange namedRange; |
| 693 | 778 |
| 694 AddNamedRangeRequest(); | 779 AddNamedRangeRequest(); |
| 695 | 780 |
| 696 AddNamedRangeRequest.fromJson(core.Map _json) { | 781 AddNamedRangeRequest.fromJson(core.Map _json) { |
| 697 if (_json.containsKey("namedRange")) { | 782 if (_json.containsKey("namedRange")) { |
| 698 namedRange = new NamedRange.fromJson(_json["namedRange"]); | 783 namedRange = new NamedRange.fromJson(_json["namedRange"]); |
| 699 } | 784 } |
| 700 } | 785 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 725 var _json = new core.Map(); | 810 var _json = new core.Map(); |
| 726 if (namedRange != null) { | 811 if (namedRange != null) { |
| 727 _json["namedRange"] = (namedRange).toJson(); | 812 _json["namedRange"] = (namedRange).toJson(); |
| 728 } | 813 } |
| 729 return _json; | 814 return _json; |
| 730 } | 815 } |
| 731 } | 816 } |
| 732 | 817 |
| 733 /** Adds a new protected range. */ | 818 /** Adds a new protected range. */ |
| 734 class AddProtectedRangeRequest { | 819 class AddProtectedRangeRequest { |
| 735 /** The protected range to be added. */ | 820 /** |
| 821 * The protected range to be added. The |
| 822 * protectedRangeId field is optional; if |
| 823 * one is not set, an id will be randomly generated. (It is an error to |
| 824 * specify the ID of a range that already exists.) |
| 825 */ |
| 736 ProtectedRange protectedRange; | 826 ProtectedRange protectedRange; |
| 737 | 827 |
| 738 AddProtectedRangeRequest(); | 828 AddProtectedRangeRequest(); |
| 739 | 829 |
| 740 AddProtectedRangeRequest.fromJson(core.Map _json) { | 830 AddProtectedRangeRequest.fromJson(core.Map _json) { |
| 741 if (_json.containsKey("protectedRange")) { | 831 if (_json.containsKey("protectedRange")) { |
| 742 protectedRange = new ProtectedRange.fromJson(_json["protectedRange"]); | 832 protectedRange = new ProtectedRange.fromJson(_json["protectedRange"]); |
| 743 } | 833 } |
| 744 } | 834 } |
| 745 | 835 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 * When a sheet is added at a given index, | 869 * When a sheet is added at a given index, |
| 780 * all subsequent sheets' indexes are incremented. | 870 * all subsequent sheets' indexes are incremented. |
| 781 * To add an object sheet, use AddChartRequest instead and specify | 871 * To add an object sheet, use AddChartRequest instead and specify |
| 782 * EmbeddedObjectPosition.sheetId or | 872 * EmbeddedObjectPosition.sheetId or |
| 783 * EmbeddedObjectPosition.newSheet. | 873 * EmbeddedObjectPosition.newSheet. |
| 784 */ | 874 */ |
| 785 class AddSheetRequest { | 875 class AddSheetRequest { |
| 786 /** | 876 /** |
| 787 * The properties the new sheet should have. | 877 * The properties the new sheet should have. |
| 788 * All properties are optional. | 878 * All properties are optional. |
| 789 * If a sheetId | 879 * The sheetId field is optional; if one is not |
| 790 * is specified, the sheet will use that ID. | 880 * set, an id will be randomly generated. (It is an error to specify the ID |
| 791 * (It is an error to specify the ID of a sheet that already exists.) | 881 * of a sheet that already exists.) |
| 792 */ | 882 */ |
| 793 SheetProperties properties; | 883 SheetProperties properties; |
| 794 | 884 |
| 795 AddSheetRequest(); | 885 AddSheetRequest(); |
| 796 | 886 |
| 797 AddSheetRequest.fromJson(core.Map _json) { | 887 AddSheetRequest.fromJson(core.Map _json) { |
| 798 if (_json.containsKey("properties")) { | 888 if (_json.containsKey("properties")) { |
| 799 properties = new SheetProperties.fromJson(_json["properties"]); | 889 properties = new SheetProperties.fromJson(_json["properties"]); |
| 800 } | 890 } |
| 801 } | 891 } |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 if (length != null) { | 1004 if (length != null) { |
| 915 _json["length"] = length; | 1005 _json["length"] = length; |
| 916 } | 1006 } |
| 917 if (sheetId != null) { | 1007 if (sheetId != null) { |
| 918 _json["sheetId"] = sheetId; | 1008 _json["sheetId"] = sheetId; |
| 919 } | 1009 } |
| 920 return _json; | 1010 return _json; |
| 921 } | 1011 } |
| 922 } | 1012 } |
| 923 | 1013 |
| 1014 /** The response when updating a range of values in a spreadsheet. */ |
| 1015 class AppendValuesResponse { |
| 1016 /** The spreadsheet the updates were applied to. */ |
| 1017 core.String spreadsheetId; |
| 1018 /** |
| 1019 * The range (in A1 notation) of the table that values are being appended to |
| 1020 * (before the values were appended). |
| 1021 * Empty if no table was found. |
| 1022 */ |
| 1023 core.String tableRange; |
| 1024 /** Information about the updates that were applied. */ |
| 1025 UpdateValuesResponse updates; |
| 1026 |
| 1027 AppendValuesResponse(); |
| 1028 |
| 1029 AppendValuesResponse.fromJson(core.Map _json) { |
| 1030 if (_json.containsKey("spreadsheetId")) { |
| 1031 spreadsheetId = _json["spreadsheetId"]; |
| 1032 } |
| 1033 if (_json.containsKey("tableRange")) { |
| 1034 tableRange = _json["tableRange"]; |
| 1035 } |
| 1036 if (_json.containsKey("updates")) { |
| 1037 updates = new UpdateValuesResponse.fromJson(_json["updates"]); |
| 1038 } |
| 1039 } |
| 1040 |
| 1041 core.Map toJson() { |
| 1042 var _json = new core.Map(); |
| 1043 if (spreadsheetId != null) { |
| 1044 _json["spreadsheetId"] = spreadsheetId; |
| 1045 } |
| 1046 if (tableRange != null) { |
| 1047 _json["tableRange"] = tableRange; |
| 1048 } |
| 1049 if (updates != null) { |
| 1050 _json["updates"] = (updates).toJson(); |
| 1051 } |
| 1052 return _json; |
| 1053 } |
| 1054 } |
| 1055 |
| 924 /** Fills in more data based on existing data. */ | 1056 /** Fills in more data based on existing data. */ |
| 925 class AutoFillRequest { | 1057 class AutoFillRequest { |
| 926 /** | 1058 /** |
| 927 * The range to autofill. This will examine the range and detect | 1059 * The range to autofill. This will examine the range and detect |
| 928 * the location that has data and automatically fill that data | 1060 * the location that has data and automatically fill that data |
| 929 * in to the rest of the range. | 1061 * in to the rest of the range. |
| 930 */ | 1062 */ |
| 931 GridRange range; | 1063 GridRange range; |
| 932 /** | 1064 /** |
| 933 * The source and destination areas to autofill. | 1065 * The source and destination areas to autofill. |
| (...skipping 5650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6584 * Updates an existing protected range with the specified | 6716 * Updates an existing protected range with the specified |
| 6585 * protectedRangeId. | 6717 * protectedRangeId. |
| 6586 */ | 6718 */ |
| 6587 class UpdateProtectedRangeRequest { | 6719 class UpdateProtectedRangeRequest { |
| 6588 /** | 6720 /** |
| 6589 * The fields that should be updated. At least one field must be specified. | 6721 * The fields that should be updated. At least one field must be specified. |
| 6590 * The root `protectedRange` is implied and should not be specified. | 6722 * The root `protectedRange` is implied and should not be specified. |
| 6591 * A single `"*"` can be used as short-hand for listing every field. | 6723 * A single `"*"` can be used as short-hand for listing every field. |
| 6592 */ | 6724 */ |
| 6593 core.String fields; | 6725 core.String fields; |
| 6594 /** | 6726 /** The protected range to update with the new properties. */ |
| 6595 * The protected range to update with the new properties. If a nonzero | |
| 6596 * protectedRangeId is | |
| 6597 * specified, the protected range will use that ID. (It is an error to | |
| 6598 * specify the ID of a protected range that already exists.) | |
| 6599 */ | |
| 6600 ProtectedRange protectedRange; | 6727 ProtectedRange protectedRange; |
| 6601 | 6728 |
| 6602 UpdateProtectedRangeRequest(); | 6729 UpdateProtectedRangeRequest(); |
| 6603 | 6730 |
| 6604 UpdateProtectedRangeRequest.fromJson(core.Map _json) { | 6731 UpdateProtectedRangeRequest.fromJson(core.Map _json) { |
| 6605 if (_json.containsKey("fields")) { | 6732 if (_json.containsKey("fields")) { |
| 6606 fields = _json["fields"]; | 6733 fields = _json["fields"]; |
| 6607 } | 6734 } |
| 6608 if (_json.containsKey("protectedRange")) { | 6735 if (_json.containsKey("protectedRange")) { |
| 6609 protectedRange = new ProtectedRange.fromJson(_json["protectedRange"]); | 6736 protectedRange = new ProtectedRange.fromJson(_json["protectedRange"]); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6768 * Possible string values are: | 6895 * Possible string values are: |
| 6769 * - "DIMENSION_UNSPECIFIED" : The default value, do not use. | 6896 * - "DIMENSION_UNSPECIFIED" : The default value, do not use. |
| 6770 * - "ROWS" : Operates on the rows of a sheet. | 6897 * - "ROWS" : Operates on the rows of a sheet. |
| 6771 * - "COLUMNS" : Operates on the columns of a sheet. | 6898 * - "COLUMNS" : Operates on the columns of a sheet. |
| 6772 */ | 6899 */ |
| 6773 core.String majorDimension; | 6900 core.String majorDimension; |
| 6774 /** | 6901 /** |
| 6775 * The range the values cover, in A1 notation. | 6902 * The range the values cover, in A1 notation. |
| 6776 * For output, this range indicates the entire requested range, | 6903 * For output, this range indicates the entire requested range, |
| 6777 * even though the values will exclude trailing rows and columns. | 6904 * even though the values will exclude trailing rows and columns. |
| 6905 * When appending values, this field represents the range to search for a |
| 6906 * table, after which values will be appended. |
| 6778 */ | 6907 */ |
| 6779 core.String range; | 6908 core.String range; |
| 6780 /** | 6909 /** |
| 6781 * The data that was read or to be written. This is an array of arrays, | 6910 * The data that was read or to be written. This is an array of arrays, |
| 6782 * the outer array representing all the data and each inner array | 6911 * the outer array representing all the data and each inner array |
| 6783 * representing a major dimension. Each item in the inner array | 6912 * representing a major dimension. Each item in the inner array |
| 6784 * corresponds with one cell. | 6913 * corresponds with one cell. |
| 6785 * | 6914 * |
| 6786 * For output, empty trailing rows and columns will not be included. | 6915 * For output, empty trailing rows and columns will not be included. |
| 6787 * | 6916 * |
| (...skipping 27 matching lines...) Expand all Loading... |
| 6815 } | 6944 } |
| 6816 if (range != null) { | 6945 if (range != null) { |
| 6817 _json["range"] = range; | 6946 _json["range"] = range; |
| 6818 } | 6947 } |
| 6819 if (values != null) { | 6948 if (values != null) { |
| 6820 _json["values"] = values; | 6949 _json["values"] = values; |
| 6821 } | 6950 } |
| 6822 return _json; | 6951 return _json; |
| 6823 } | 6952 } |
| 6824 } | 6953 } |
| OLD | NEW |