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:crypto/crypto.dart' as crypto; | |
11 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
12 | 11 |
13 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
14 ApiRequestError, DetailedApiRequestError, Media, UploadOptions, | 13 ApiRequestError, DetailedApiRequestError, Media, UploadOptions, |
15 ResumableUploadOptions, DownloadOptions, PartialDownloadOptions, | 14 ResumableUploadOptions, DownloadOptions, PartialDownloadOptions, |
16 ByteRange; | 15 ByteRange; |
17 | 16 |
18 const core.String USER_AGENT = 'dart-api-client consumersurveys/v2'; | 17 const core.String USER_AGENT = 'dart-api-client consumersurveys/v2'; |
19 | 18 |
20 /** | 19 /** |
21 * Creates and conducts surveys, lists the surveys that an authenticated user | 20 * Creates and conducts surveys, lists the surveys that an authenticated user |
22 * owns, and retrieves survey results and information about specified surveys. | 21 * owns, and retrieves survey results and information about specified surveys. |
23 */ | 22 */ |
24 class ConsumersurveysApi { | 23 class ConsumersurveysApi { |
25 /** View and edit your surveys and results */ | 24 /** View and edit your surveys and results */ |
26 static const ConsumersurveysScope = "https://www.googleapis.com/auth/consumers
urveys"; | 25 static const ConsumersurveysScope = "https://www.googleapis.com/auth/consumers
urveys"; |
27 | 26 |
28 /** View the results for your surveys */ | 27 /** View the results for your surveys */ |
29 static const ConsumersurveysReadonlyScope = "https://www.googleapis.com/auth/c
onsumersurveys.readonly"; | 28 static const ConsumersurveysReadonlyScope = "https://www.googleapis.com/auth/c
onsumersurveys.readonly"; |
30 | 29 |
31 /** View your email address */ | 30 /** View your email address */ |
32 static const UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.em
ail"; | 31 static const UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.em
ail"; |
33 | 32 |
34 | 33 |
35 final commons.ApiRequester _requester; | 34 final commons.ApiRequester _requester; |
36 | 35 |
| 36 MobileapppanelsResourceApi get mobileapppanels => new MobileapppanelsResourceA
pi(_requester); |
37 ResultsResourceApi get results => new ResultsResourceApi(_requester); | 37 ResultsResourceApi get results => new ResultsResourceApi(_requester); |
38 SurveysResourceApi get surveys => new SurveysResourceApi(_requester); | 38 SurveysResourceApi get surveys => new SurveysResourceApi(_requester); |
39 | 39 |
40 ConsumersurveysApi(http.Client client, {core.String rootUrl: "https://www.goog
leapis.com/", core.String servicePath: "consumersurveys/v2/"}) : | 40 ConsumersurveysApi(http.Client client, {core.String rootUrl: "https://www.goog
leapis.com/", core.String servicePath: "consumersurveys/v2/"}) : |
41 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 41 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
42 } | 42 } |
43 | 43 |
44 | 44 |
| 45 class MobileapppanelsResourceApi { |
| 46 final commons.ApiRequester _requester; |
| 47 |
| 48 MobileapppanelsResourceApi(commons.ApiRequester client) : |
| 49 _requester = client; |
| 50 |
| 51 /** |
| 52 * Retrieves a MobileAppPanel that is available to the authenticated user. |
| 53 * |
| 54 * Request parameters: |
| 55 * |
| 56 * [panelId] - External URL ID for the panel. |
| 57 * |
| 58 * Completes with a [MobileAppPanel]. |
| 59 * |
| 60 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 61 * error. |
| 62 * |
| 63 * If the used [http.Client] completes with an error when making a REST call, |
| 64 * this method will complete with the same error. |
| 65 */ |
| 66 async.Future<MobileAppPanel> get(core.String panelId) { |
| 67 var _url = null; |
| 68 var _queryParams = new core.Map(); |
| 69 var _uploadMedia = null; |
| 70 var _uploadOptions = null; |
| 71 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 72 var _body = null; |
| 73 |
| 74 if (panelId == null) { |
| 75 throw new core.ArgumentError("Parameter panelId is required."); |
| 76 } |
| 77 |
| 78 _url = 'mobileAppPanels/' + commons.Escaper.ecapeVariable('$panelId'); |
| 79 |
| 80 var _response = _requester.request(_url, |
| 81 "GET", |
| 82 body: _body, |
| 83 queryParams: _queryParams, |
| 84 uploadOptions: _uploadOptions, |
| 85 uploadMedia: _uploadMedia, |
| 86 downloadOptions: _downloadOptions); |
| 87 return _response.then((data) => new MobileAppPanel.fromJson(data)); |
| 88 } |
| 89 |
| 90 /** |
| 91 * Lists the MobileAppPanels available to the authenticated user. |
| 92 * |
| 93 * Request parameters: |
| 94 * |
| 95 * [maxResults] - null |
| 96 * |
| 97 * [startIndex] - null |
| 98 * |
| 99 * [token] - null |
| 100 * |
| 101 * Completes with a [MobileAppPanelsListResponse]. |
| 102 * |
| 103 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 104 * error. |
| 105 * |
| 106 * If the used [http.Client] completes with an error when making a REST call, |
| 107 * this method will complete with the same error. |
| 108 */ |
| 109 async.Future<MobileAppPanelsListResponse> list({core.int maxResults, core.int
startIndex, core.String token}) { |
| 110 var _url = null; |
| 111 var _queryParams = new core.Map(); |
| 112 var _uploadMedia = null; |
| 113 var _uploadOptions = null; |
| 114 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 115 var _body = null; |
| 116 |
| 117 if (maxResults != null) { |
| 118 _queryParams["maxResults"] = ["${maxResults}"]; |
| 119 } |
| 120 if (startIndex != null) { |
| 121 _queryParams["startIndex"] = ["${startIndex}"]; |
| 122 } |
| 123 if (token != null) { |
| 124 _queryParams["token"] = [token]; |
| 125 } |
| 126 |
| 127 _url = 'mobileAppPanels'; |
| 128 |
| 129 var _response = _requester.request(_url, |
| 130 "GET", |
| 131 body: _body, |
| 132 queryParams: _queryParams, |
| 133 uploadOptions: _uploadOptions, |
| 134 uploadMedia: _uploadMedia, |
| 135 downloadOptions: _downloadOptions); |
| 136 return _response.then((data) => new MobileAppPanelsListResponse.fromJson(dat
a)); |
| 137 } |
| 138 |
| 139 /** |
| 140 * Updates a MobileAppPanel. Currently the only property that can be updated |
| 141 * is the owners property. |
| 142 * |
| 143 * [request] - The metadata request object. |
| 144 * |
| 145 * Request parameters: |
| 146 * |
| 147 * [panelId] - External URL ID for the panel. |
| 148 * |
| 149 * Completes with a [MobileAppPanel]. |
| 150 * |
| 151 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 152 * error. |
| 153 * |
| 154 * If the used [http.Client] completes with an error when making a REST call, |
| 155 * this method will complete with the same error. |
| 156 */ |
| 157 async.Future<MobileAppPanel> update(MobileAppPanel request, core.String panelI
d) { |
| 158 var _url = null; |
| 159 var _queryParams = new core.Map(); |
| 160 var _uploadMedia = null; |
| 161 var _uploadOptions = null; |
| 162 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 163 var _body = null; |
| 164 |
| 165 if (request != null) { |
| 166 _body = convert.JSON.encode((request).toJson()); |
| 167 } |
| 168 if (panelId == null) { |
| 169 throw new core.ArgumentError("Parameter panelId is required."); |
| 170 } |
| 171 |
| 172 _url = 'mobileAppPanels/' + commons.Escaper.ecapeVariable('$panelId'); |
| 173 |
| 174 var _response = _requester.request(_url, |
| 175 "PUT", |
| 176 body: _body, |
| 177 queryParams: _queryParams, |
| 178 uploadOptions: _uploadOptions, |
| 179 uploadMedia: _uploadMedia, |
| 180 downloadOptions: _downloadOptions); |
| 181 return _response.then((data) => new MobileAppPanel.fromJson(data)); |
| 182 } |
| 183 |
| 184 } |
| 185 |
| 186 |
45 class ResultsResourceApi { | 187 class ResultsResourceApi { |
46 final commons.ApiRequester _requester; | 188 final commons.ApiRequester _requester; |
47 | 189 |
48 ResultsResourceApi(commons.ApiRequester client) : | 190 ResultsResourceApi(commons.ApiRequester client) : |
49 _requester = client; | 191 _requester = client; |
50 | 192 |
51 /** | 193 /** |
52 * Retrieves any survey results that have been produced so far. Results are | 194 * Retrieves any survey results that have been produced so far. Results are |
53 * formatted as an Excel file. | 195 * formatted as an Excel file. |
54 * | 196 * |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 if (fields != null) { | 538 if (fields != null) { |
397 _json["fields"] = fields.map((value) => (value).toJson()).toList(); | 539 _json["fields"] = fields.map((value) => (value).toJson()).toList(); |
398 } | 540 } |
399 if (id != null) { | 541 if (id != null) { |
400 _json["id"] = id; | 542 _json["id"] = id; |
401 } | 543 } |
402 return _json; | 544 return _json; |
403 } | 545 } |
404 } | 546 } |
405 | 547 |
| 548 /** |
| 549 * Representation of an individual pre-defined panel object defining a targeted |
| 550 * audience of opinion rewards mobile app users. |
| 551 */ |
| 552 class MobileAppPanel { |
| 553 /** |
| 554 * Country code for the country of the users that the panel contains. Uses |
| 555 * standard ISO 3166-1 2-character language codes. For instance, 'US' for the |
| 556 * United States, and 'GB' for the United Kingdom. Any survey created |
| 557 * targeting this panel must also target the corresponding country. |
| 558 */ |
| 559 core.String country; |
| 560 /** Whether or not the panel is accessible to all API users. */ |
| 561 core.bool isPublicPanel; |
| 562 /** |
| 563 * Language code that the panel can target. For instance, 'en-US'. Uses |
| 564 * standard BCP47 language codes. See specification. Any survey created |
| 565 * targeting this panel must also target the corresponding language. |
| 566 */ |
| 567 core.String language; |
| 568 /** |
| 569 * Unique panel ID string. This corresponds to the mobile_app_panel_id used in |
| 570 * Survey Insert requests. |
| 571 */ |
| 572 core.String mobileAppPanelId; |
| 573 /** Human readable name of the audience panel. */ |
| 574 core.String name; |
| 575 /** |
| 576 * List of email addresses for users who can target members of this panel. |
| 577 * Must contain at least the address of the user making the API call for |
| 578 * panels that are not public. This field will be empty for public panels. |
| 579 */ |
| 580 core.List<core.String> owners; |
| 581 |
| 582 MobileAppPanel(); |
| 583 |
| 584 MobileAppPanel.fromJson(core.Map _json) { |
| 585 if (_json.containsKey("country")) { |
| 586 country = _json["country"]; |
| 587 } |
| 588 if (_json.containsKey("isPublicPanel")) { |
| 589 isPublicPanel = _json["isPublicPanel"]; |
| 590 } |
| 591 if (_json.containsKey("language")) { |
| 592 language = _json["language"]; |
| 593 } |
| 594 if (_json.containsKey("mobileAppPanelId")) { |
| 595 mobileAppPanelId = _json["mobileAppPanelId"]; |
| 596 } |
| 597 if (_json.containsKey("name")) { |
| 598 name = _json["name"]; |
| 599 } |
| 600 if (_json.containsKey("owners")) { |
| 601 owners = _json["owners"]; |
| 602 } |
| 603 } |
| 604 |
| 605 core.Map toJson() { |
| 606 var _json = new core.Map(); |
| 607 if (country != null) { |
| 608 _json["country"] = country; |
| 609 } |
| 610 if (isPublicPanel != null) { |
| 611 _json["isPublicPanel"] = isPublicPanel; |
| 612 } |
| 613 if (language != null) { |
| 614 _json["language"] = language; |
| 615 } |
| 616 if (mobileAppPanelId != null) { |
| 617 _json["mobileAppPanelId"] = mobileAppPanelId; |
| 618 } |
| 619 if (name != null) { |
| 620 _json["name"] = name; |
| 621 } |
| 622 if (owners != null) { |
| 623 _json["owners"] = owners; |
| 624 } |
| 625 return _json; |
| 626 } |
| 627 } |
| 628 |
| 629 class MobileAppPanelsListResponse { |
| 630 PageInfo pageInfo; |
| 631 /** |
| 632 * Unique request ID used for logging and debugging. Please include in any |
| 633 * error reporting or troubleshooting requests. |
| 634 */ |
| 635 core.String requestId; |
| 636 /** An individual predefined panel of Opinion Rewards mobile users. */ |
| 637 core.List<MobileAppPanel> resources; |
| 638 TokenPagination tokenPagination; |
| 639 |
| 640 MobileAppPanelsListResponse(); |
| 641 |
| 642 MobileAppPanelsListResponse.fromJson(core.Map _json) { |
| 643 if (_json.containsKey("pageInfo")) { |
| 644 pageInfo = new PageInfo.fromJson(_json["pageInfo"]); |
| 645 } |
| 646 if (_json.containsKey("requestId")) { |
| 647 requestId = _json["requestId"]; |
| 648 } |
| 649 if (_json.containsKey("resources")) { |
| 650 resources = _json["resources"].map((value) => new MobileAppPanel.fromJson(
value)).toList(); |
| 651 } |
| 652 if (_json.containsKey("tokenPagination")) { |
| 653 tokenPagination = new TokenPagination.fromJson(_json["tokenPagination"]); |
| 654 } |
| 655 } |
| 656 |
| 657 core.Map toJson() { |
| 658 var _json = new core.Map(); |
| 659 if (pageInfo != null) { |
| 660 _json["pageInfo"] = (pageInfo).toJson(); |
| 661 } |
| 662 if (requestId != null) { |
| 663 _json["requestId"] = requestId; |
| 664 } |
| 665 if (resources != null) { |
| 666 _json["resources"] = resources.map((value) => (value).toJson()).toList(); |
| 667 } |
| 668 if (tokenPagination != null) { |
| 669 _json["tokenPagination"] = (tokenPagination).toJson(); |
| 670 } |
| 671 return _json; |
| 672 } |
| 673 } |
| 674 |
406 class PageInfo { | 675 class PageInfo { |
407 core.int resultPerPage; | 676 core.int resultPerPage; |
408 core.int startIndex; | 677 core.int startIndex; |
409 core.int totalResults; | 678 core.int totalResults; |
410 | 679 |
411 PageInfo(); | 680 PageInfo(); |
412 | 681 |
413 PageInfo.fromJson(core.Map _json) { | 682 PageInfo.fromJson(core.Map _json) { |
414 if (_json.containsKey("resultPerPage")) { | 683 if (_json.containsKey("resultPerPage")) { |
415 resultPerPage = _json["resultPerPage"]; | 684 resultPerPage = _json["resultPerPage"]; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 SurveyAudience audience; | 759 SurveyAudience audience; |
491 /** Cost to run the survey and collect the necessary number of responses. */ | 760 /** Cost to run the survey and collect the necessary number of responses. */ |
492 SurveyCost cost; | 761 SurveyCost cost; |
493 /** | 762 /** |
494 * Additional information to store on behalf of the API consumer and associate | 763 * Additional information to store on behalf of the API consumer and associate |
495 * with this question. This binary blob is treated as opaque. This field is | 764 * with this question. This binary blob is treated as opaque. This field is |
496 * limited to 64K bytes. | 765 * limited to 64K bytes. |
497 */ | 766 */ |
498 core.String customerData; | 767 core.String customerData; |
499 core.List<core.int> get customerDataAsBytes { | 768 core.List<core.int> get customerDataAsBytes { |
500 return crypto.CryptoUtils.base64StringToBytes(customerData); | 769 return convert.BASE64.decode(customerData); |
501 } | 770 } |
502 | 771 |
503 void set customerDataAsBytes(core.List<core.int> _bytes) { | 772 void set customerDataAsBytes(core.List<core.int> _bytes) { |
504 customerData = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); | 773 customerData = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll
("+", "-"); |
505 } | 774 } |
506 /** Text description of the survey. */ | 775 /** Text description of the survey. */ |
507 core.String description; | 776 core.String description; |
508 /** | 777 /** |
509 * List of email addresses for survey owners. Must contain at least the | 778 * List of email addresses for survey owners. Must contain at least the |
510 * address of the user making the API call. | 779 * address of the user making the API call. |
511 */ | 780 */ |
512 core.List<core.String> owners; | 781 core.List<core.String> owners; |
513 /** List of questions defining the survey. */ | 782 /** List of questions defining the survey. */ |
514 core.List<SurveyQuestion> questions; | 783 core.List<SurveyQuestion> questions; |
515 /** | 784 /** State that the survey is in. */ |
516 * State that the survey is in. Can be modified to start, stop, or pause | |
517 * survey. | |
518 */ | |
519 core.String state; | 785 core.String state; |
520 /** Unique survey ID, that is viewable in the URL of the Survey Creator UI */ | 786 /** Unique survey ID, that is viewable in the URL of the Survey Creator UI */ |
521 core.String surveyUrlId; | 787 core.String surveyUrlId; |
522 /** Optional name that will be given to the survey. */ | 788 /** Optional name that will be given to the survey. */ |
523 core.String title; | 789 core.String title; |
524 /** Number of responses desired for the survey. */ | 790 /** Number of responses desired for the survey. */ |
525 core.int wantedResponseCount; | 791 core.int wantedResponseCount; |
526 | 792 |
527 Survey(); | 793 Survey(); |
528 | 794 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 * Language code that surveys should be targeted to. For instance, 'en-US'. | 888 * Language code that surveys should be targeted to. For instance, 'en-US'. |
623 * Surveys may target bilingual users by specifying a list of language codes | 889 * Surveys may target bilingual users by specifying a list of language codes |
624 * (for example, 'de' and 'en-US'). In that case, all languages will be used | 890 * (for example, 'de' and 'en-US'). In that case, all languages will be used |
625 * for targeting users but the survey content (which is displayed) must match | 891 * for targeting users but the survey content (which is displayed) must match |
626 * the first language listed. Accepts standard BCP47 language codes. See | 892 * the first language listed. Accepts standard BCP47 language codes. See |
627 * specification. | 893 * specification. |
628 */ | 894 */ |
629 core.List<core.String> languages; | 895 core.List<core.String> languages; |
630 /** | 896 /** |
631 * Key for predefined panel that causes survey to be sent to a predefined set | 897 * Key for predefined panel that causes survey to be sent to a predefined set |
632 * of Opinion Rewards App users. PopulationSource must be set to | 898 * of Opinion Rewards App users. You must set PopulationSource to |
633 * ANDROID_APP_PANEL to use this field. | 899 * ANDROID_APP_PANEL to use this field. |
634 */ | 900 */ |
635 core.String mobileAppPanelId; | 901 core.String mobileAppPanelId; |
636 /** Online population source where the respondents are sampled from. */ | 902 /** Online population source where the respondents are sampled from. */ |
637 core.String populationSource; | 903 core.String populationSource; |
638 | 904 |
639 SurveyAudience(); | 905 SurveyAudience(); |
640 | 906 |
641 SurveyAudience.fromJson(core.Map _json) { | 907 SurveyAudience.fromJson(core.Map _json) { |
642 if (_json.containsKey("ages")) { | 908 if (_json.containsKey("ages")) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 if (populationSource != null) { | 951 if (populationSource != null) { |
686 _json["populationSource"] = populationSource; | 952 _json["populationSource"] = populationSource; |
687 } | 953 } |
688 return _json; | 954 return _json; |
689 } | 955 } |
690 } | 956 } |
691 | 957 |
692 /** Message defining the cost to run a given survey through API. */ | 958 /** Message defining the cost to run a given survey through API. */ |
693 class SurveyCost { | 959 class SurveyCost { |
694 /** | 960 /** |
695 * Threshold to start a survey automically if the quoted prices is at most | |
696 * this value. When a survey has a Screener (threshold) question, it must go | |
697 * through an incidence pricing test to determine the final cost per response. | |
698 * Typically the API consumer would have to make a followup call to start the | |
699 * survey given the (previously not) known cost. If the survey has no | |
700 * threshold_answers, setting this property will return an error. This | |
701 * property allows API callers to indicate the max price per response they'd | |
702 * be willing to pay in advance of that test. If the price turns out to be | |
703 * lower than the specified autostart_max, the survey should begin immediately | |
704 * and the user will be charged at the rate determined by the Incidence | |
705 * pricing test. If the price turns out to be greater than the specified | |
706 * autostart_max the survey will not be started and the user will instead be | |
707 * notified what price was determined by the incidence test. At that point | |
708 * they must raise the value of this property to be greater than or equal to | |
709 * that cost before attempting to start the survey again. This will | |
710 * immediately start the survey as long the incidence test was run within the | |
711 * last 21 days. | |
712 */ | |
713 core.String autostartMaxCostPerResponse; | |
714 /** | |
715 * Cost per survey response in nano units of the given currency. To get the | 961 * Cost per survey response in nano units of the given currency. To get the |
716 * total cost for a survey, multiply this value by wanted_response_count. | 962 * total cost for a survey, multiply this value by wanted_response_count. |
717 */ | 963 */ |
718 core.String costPerResponseNanos; | 964 core.String costPerResponseNanos; |
719 /** Currency code that the cost is given in. */ | 965 /** Currency code that the cost is given in. */ |
720 core.String currencyCode; | 966 core.String currencyCode; |
721 /** | 967 /** |
| 968 * Threshold to start a survey automatically if the quoted price is at most |
| 969 * this value. When a survey has a Screener (threshold) question, it must go |
| 970 * through an incidence pricing test to determine the final cost per response. |
| 971 * Typically you will have to make a followup call to start the survey giving |
| 972 * the final computed cost per response. If the survey has no |
| 973 * threshold_answers, setting this property will return an error. By |
| 974 * specifying this property, you indicate the max price per response you are |
| 975 * willing to pay in advance of the incidence test. If the price turns out to |
| 976 * be lower than the specified value, the survey will begin immediately and |
| 977 * you will be charged at the rate determined by the incidence pricing test. |
| 978 * If the price turns out to be greater than the specified value the survey |
| 979 * will not be started and you will instead be notified what price was |
| 980 * determined by the incidence test. At that point, you must raise the value |
| 981 * of this property to be greater than or equal to that cost before attempting |
| 982 * to start the survey again. This will immediately start the survey as long |
| 983 * the incidence test was run within the last 21 days. |
| 984 */ |
| 985 core.String maxCostPerResponseNanos; |
| 986 /** |
722 * Cost of survey in nano units of the given currency. DEPRECATED in favor of | 987 * Cost of survey in nano units of the given currency. DEPRECATED in favor of |
723 * cost_per_response_nanos | 988 * cost_per_response_nanos |
724 */ | 989 */ |
725 core.String nanos; | 990 core.String nanos; |
726 | 991 |
727 SurveyCost(); | 992 SurveyCost(); |
728 | 993 |
729 SurveyCost.fromJson(core.Map _json) { | 994 SurveyCost.fromJson(core.Map _json) { |
730 if (_json.containsKey("autostartMaxCostPerResponse")) { | |
731 autostartMaxCostPerResponse = _json["autostartMaxCostPerResponse"]; | |
732 } | |
733 if (_json.containsKey("costPerResponseNanos")) { | 995 if (_json.containsKey("costPerResponseNanos")) { |
734 costPerResponseNanos = _json["costPerResponseNanos"]; | 996 costPerResponseNanos = _json["costPerResponseNanos"]; |
735 } | 997 } |
736 if (_json.containsKey("currencyCode")) { | 998 if (_json.containsKey("currencyCode")) { |
737 currencyCode = _json["currencyCode"]; | 999 currencyCode = _json["currencyCode"]; |
738 } | 1000 } |
| 1001 if (_json.containsKey("maxCostPerResponseNanos")) { |
| 1002 maxCostPerResponseNanos = _json["maxCostPerResponseNanos"]; |
| 1003 } |
739 if (_json.containsKey("nanos")) { | 1004 if (_json.containsKey("nanos")) { |
740 nanos = _json["nanos"]; | 1005 nanos = _json["nanos"]; |
741 } | 1006 } |
742 } | 1007 } |
743 | 1008 |
744 core.Map toJson() { | 1009 core.Map toJson() { |
745 var _json = new core.Map(); | 1010 var _json = new core.Map(); |
746 if (autostartMaxCostPerResponse != null) { | |
747 _json["autostartMaxCostPerResponse"] = autostartMaxCostPerResponse; | |
748 } | |
749 if (costPerResponseNanos != null) { | 1011 if (costPerResponseNanos != null) { |
750 _json["costPerResponseNanos"] = costPerResponseNanos; | 1012 _json["costPerResponseNanos"] = costPerResponseNanos; |
751 } | 1013 } |
752 if (currencyCode != null) { | 1014 if (currencyCode != null) { |
753 _json["currencyCode"] = currencyCode; | 1015 _json["currencyCode"] = currencyCode; |
754 } | 1016 } |
| 1017 if (maxCostPerResponseNanos != null) { |
| 1018 _json["maxCostPerResponseNanos"] = maxCostPerResponseNanos; |
| 1019 } |
755 if (nanos != null) { | 1020 if (nanos != null) { |
756 _json["nanos"] = nanos; | 1021 _json["nanos"] = nanos; |
757 } | 1022 } |
758 return _json; | 1023 return _json; |
759 } | 1024 } |
760 } | 1025 } |
761 | 1026 |
762 /** Message defining the question specifications. */ | 1027 /** Message defining the question specifications. */ |
763 class SurveyQuestion { | 1028 class SurveyQuestion { |
764 /** | 1029 /** |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 /** Container object for image data and alt_text. */ | 1223 /** Container object for image data and alt_text. */ |
959 class SurveyQuestionImage { | 1224 class SurveyQuestionImage { |
960 /** The alt text property used in image tags is required for all images. */ | 1225 /** The alt text property used in image tags is required for all images. */ |
961 core.String altText; | 1226 core.String altText; |
962 /** | 1227 /** |
963 * Inline jpeg, gif, tiff, bmp, or png image raw bytes for an image question | 1228 * Inline jpeg, gif, tiff, bmp, or png image raw bytes for an image question |
964 * types. | 1229 * types. |
965 */ | 1230 */ |
966 core.String data; | 1231 core.String data; |
967 core.List<core.int> get dataAsBytes { | 1232 core.List<core.int> get dataAsBytes { |
968 return crypto.CryptoUtils.base64StringToBytes(data); | 1233 return convert.BASE64.decode(data); |
969 } | 1234 } |
970 | 1235 |
971 void set dataAsBytes(core.List<core.int> _bytes) { | 1236 void set dataAsBytes(core.List<core.int> _bytes) { |
972 data = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); | 1237 data = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); |
973 } | 1238 } |
974 /** The read-only URL for the hosted images. */ | 1239 /** The read-only URL for the hosted images. */ |
975 core.String url; | 1240 core.String url; |
976 | 1241 |
977 SurveyQuestionImage(); | 1242 SurveyQuestionImage(); |
978 | 1243 |
979 SurveyQuestionImage.fromJson(core.Map _json) { | 1244 SurveyQuestionImage.fromJson(core.Map _json) { |
980 if (_json.containsKey("altText")) { | 1245 if (_json.containsKey("altText")) { |
981 altText = _json["altText"]; | 1246 altText = _json["altText"]; |
982 } | 1247 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 } | 1342 } |
1078 return _json; | 1343 return _json; |
1079 } | 1344 } |
1080 } | 1345 } |
1081 | 1346 |
1082 class SurveysStartRequest { | 1347 class SurveysStartRequest { |
1083 /** | 1348 /** |
1084 * Threshold to start a survey automically if the quoted prices is less than | 1349 * Threshold to start a survey automically if the quoted prices is less than |
1085 * or equal to this value. See Survey.Cost for more details. | 1350 * or equal to this value. See Survey.Cost for more details. |
1086 */ | 1351 */ |
1087 core.String autostartMaxCostPerResponse; | 1352 core.String maxCostPerResponseNanos; |
1088 | 1353 |
1089 SurveysStartRequest(); | 1354 SurveysStartRequest(); |
1090 | 1355 |
1091 SurveysStartRequest.fromJson(core.Map _json) { | 1356 SurveysStartRequest.fromJson(core.Map _json) { |
1092 if (_json.containsKey("autostartMaxCostPerResponse")) { | 1357 if (_json.containsKey("maxCostPerResponseNanos")) { |
1093 autostartMaxCostPerResponse = _json["autostartMaxCostPerResponse"]; | 1358 maxCostPerResponseNanos = _json["maxCostPerResponseNanos"]; |
1094 } | 1359 } |
1095 } | 1360 } |
1096 | 1361 |
1097 core.Map toJson() { | 1362 core.Map toJson() { |
1098 var _json = new core.Map(); | 1363 var _json = new core.Map(); |
1099 if (autostartMaxCostPerResponse != null) { | 1364 if (maxCostPerResponseNanos != null) { |
1100 _json["autostartMaxCostPerResponse"] = autostartMaxCostPerResponse; | 1365 _json["maxCostPerResponseNanos"] = maxCostPerResponseNanos; |
1101 } | 1366 } |
1102 return _json; | 1367 return _json; |
1103 } | 1368 } |
1104 } | 1369 } |
1105 | 1370 |
1106 class SurveysStartResponse { | 1371 class SurveysStartResponse { |
1107 /** | 1372 /** |
1108 * Unique request ID used for logging and debugging. Please include in any | 1373 * Unique request ID used for logging and debugging. Please include in any |
1109 * error reporting or troubleshooting requests. | 1374 * error reporting or troubleshooting requests. |
1110 */ | 1375 */ |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 var _json = new core.Map(); | 1451 var _json = new core.Map(); |
1187 if (nextPageToken != null) { | 1452 if (nextPageToken != null) { |
1188 _json["nextPageToken"] = nextPageToken; | 1453 _json["nextPageToken"] = nextPageToken; |
1189 } | 1454 } |
1190 if (previousPageToken != null) { | 1455 if (previousPageToken != null) { |
1191 _json["previousPageToken"] = previousPageToken; | 1456 _json["previousPageToken"] = previousPageToken; |
1192 } | 1457 } |
1193 return _json; | 1458 return _json; |
1194 } | 1459 } |
1195 } | 1460 } |
OLD | NEW |