OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
1 library googleapis.civicinfo.v2; | 3 library googleapis.civicinfo.v2; |
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 civicinfo/v2'; |
15 | 18 |
16 /** An API for accessing civic information. */ | 19 /** An API for accessing civic information. */ |
17 class CivicinfoApi { | 20 class CivicinfoApi { |
18 | 21 |
19 final common_internal.ApiRequester _requester; | 22 final commons.ApiRequester _requester; |
20 | 23 |
21 DivisionsResourceApi get divisions => new DivisionsResourceApi(_requester); | 24 DivisionsResourceApi get divisions => new DivisionsResourceApi(_requester); |
22 ElectionsResourceApi get elections => new ElectionsResourceApi(_requester); | 25 ElectionsResourceApi get elections => new ElectionsResourceApi(_requester); |
23 RepresentativesResourceApi get representatives => new RepresentativesResourceA
pi(_requester); | 26 RepresentativesResourceApi get representatives => new RepresentativesResourceA
pi(_requester); |
24 | 27 |
25 CivicinfoApi(http.Client client, {core.String rootUrl: "https://www.googleapis
.com/", core.String servicePath: "civicinfo/v2/"}) : | 28 CivicinfoApi(http.Client client, {core.String rootUrl: "https://www.googleapis
.com/", core.String servicePath: "civicinfo/v2/"}) : |
26 _requester = new common_internal.ApiRequester(client, rootUrl, servicePath
); | 29 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
27 } | 30 } |
28 | 31 |
29 | 32 |
30 /** Not documented yet. */ | |
31 class DivisionsResourceApi { | 33 class DivisionsResourceApi { |
32 final common_internal.ApiRequester _requester; | 34 final commons.ApiRequester _requester; |
33 | 35 |
34 DivisionsResourceApi(common_internal.ApiRequester client) : | 36 DivisionsResourceApi(commons.ApiRequester client) : |
35 _requester = client; | 37 _requester = client; |
36 | 38 |
37 /** | 39 /** |
38 * Searches for political divisions by their natural name or OCD ID. | 40 * Searches for political divisions by their natural name or OCD ID. |
39 * | 41 * |
40 * Request parameters: | 42 * Request parameters: |
41 * | 43 * |
42 * [query] - The search query. Queries can cover any parts of a OCD ID or a | 44 * [query] - The search query. Queries can cover any parts of a OCD ID or a |
43 * human readable division name. All words given in the query are treated as | 45 * human readable division name. All words given in the query are treated as |
44 * required patterns. In addition to that, most query operators of the Apache | 46 * required patterns. In addition to that, most query operators of the Apache |
45 * Lucene library are supported. See | 47 * Lucene library are supported. See |
46 * http://lucene.apache.org/core/2_9_4/queryparsersyntax.html | 48 * http://lucene.apache.org/core/2_9_4/queryparsersyntax.html |
47 * | 49 * |
48 * Completes with a [DivisionSearchResponse]. | 50 * Completes with a [DivisionSearchResponse]. |
49 * | 51 * |
50 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 52 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
51 * error. | 53 * error. |
52 * | 54 * |
53 * If the used [http.Client] completes with an error when making a REST call, | 55 * If the used [http.Client] completes with an error when making a REST call, |
54 * this method will complete with the same error. | 56 * this method will complete with the same error. |
55 */ | 57 */ |
56 async.Future<DivisionSearchResponse> search({core.String query}) { | 58 async.Future<DivisionSearchResponse> search({core.String query}) { |
57 var _url = null; | 59 var _url = null; |
58 var _queryParams = new core.Map(); | 60 var _queryParams = new core.Map(); |
59 var _uploadMedia = null; | 61 var _uploadMedia = null; |
60 var _uploadOptions = null; | 62 var _uploadOptions = null; |
61 var _downloadOptions = common.DownloadOptions.Metadata; | 63 var _downloadOptions = commons.DownloadOptions.Metadata; |
62 var _body = null; | 64 var _body = null; |
63 | 65 |
64 if (query != null) { | 66 if (query != null) { |
65 _queryParams["query"] = [query]; | 67 _queryParams["query"] = [query]; |
66 } | 68 } |
67 | 69 |
68 | 70 |
69 _url = 'divisions'; | 71 _url = 'divisions'; |
70 | 72 |
71 var _response = _requester.request(_url, | 73 var _response = _requester.request(_url, |
72 "GET", | 74 "GET", |
73 body: _body, | 75 body: _body, |
74 queryParams: _queryParams, | 76 queryParams: _queryParams, |
75 uploadOptions: _uploadOptions, | 77 uploadOptions: _uploadOptions, |
76 uploadMedia: _uploadMedia, | 78 uploadMedia: _uploadMedia, |
77 downloadOptions: _downloadOptions); | 79 downloadOptions: _downloadOptions); |
78 return _response.then((data) => new DivisionSearchResponse.fromJson(data)); | 80 return _response.then((data) => new DivisionSearchResponse.fromJson(data)); |
79 } | 81 } |
80 | 82 |
81 } | 83 } |
82 | 84 |
83 | 85 |
84 /** Not documented yet. */ | |
85 class ElectionsResourceApi { | 86 class ElectionsResourceApi { |
86 final common_internal.ApiRequester _requester; | 87 final commons.ApiRequester _requester; |
87 | 88 |
88 ElectionsResourceApi(common_internal.ApiRequester client) : | 89 ElectionsResourceApi(commons.ApiRequester client) : |
89 _requester = client; | 90 _requester = client; |
90 | 91 |
91 /** | 92 /** |
92 * List of available elections to query. | 93 * List of available elections to query. |
93 * | 94 * |
94 * Request parameters: | 95 * Request parameters: |
95 * | 96 * |
96 * Completes with a [ElectionsQueryResponse]. | 97 * Completes with a [ElectionsQueryResponse]. |
97 * | 98 * |
98 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 99 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
99 * error. | 100 * error. |
100 * | 101 * |
101 * If the used [http.Client] completes with an error when making a REST call, | 102 * If the used [http.Client] completes with an error when making a REST call, |
102 * this method will complete with the same error. | 103 * this method will complete with the same error. |
103 */ | 104 */ |
104 async.Future<ElectionsQueryResponse> electionQuery() { | 105 async.Future<ElectionsQueryResponse> electionQuery() { |
105 var _url = null; | 106 var _url = null; |
106 var _queryParams = new core.Map(); | 107 var _queryParams = new core.Map(); |
107 var _uploadMedia = null; | 108 var _uploadMedia = null; |
108 var _uploadOptions = null; | 109 var _uploadOptions = null; |
109 var _downloadOptions = common.DownloadOptions.Metadata; | 110 var _downloadOptions = commons.DownloadOptions.Metadata; |
110 var _body = null; | 111 var _body = null; |
111 | 112 |
112 | 113 |
113 | 114 |
114 _url = 'elections'; | 115 _url = 'elections'; |
115 | 116 |
116 var _response = _requester.request(_url, | 117 var _response = _requester.request(_url, |
117 "GET", | 118 "GET", |
118 body: _body, | 119 body: _body, |
119 queryParams: _queryParams, | 120 queryParams: _queryParams, |
(...skipping 13 matching lines...) Expand all Loading... |
133 * | 134 * |
134 * [electionId] - The unique ID of the election to look up. A list of election | 135 * [electionId] - The unique ID of the election to look up. A list of election |
135 * IDs can be obtained at | 136 * IDs can be obtained at |
136 * https://www.googleapis.com/civicinfo/{version}/elections | 137 * https://www.googleapis.com/civicinfo/{version}/elections |
137 * | 138 * |
138 * [officialOnly] - If set to true, only data from official state sources will | 139 * [officialOnly] - If set to true, only data from official state sources will |
139 * be returned. | 140 * be returned. |
140 * | 141 * |
141 * Completes with a [VoterInfoResponse]. | 142 * Completes with a [VoterInfoResponse]. |
142 * | 143 * |
143 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 144 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
144 * error. | 145 * error. |
145 * | 146 * |
146 * 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, |
147 * this method will complete with the same error. | 148 * this method will complete with the same error. |
148 */ | 149 */ |
149 async.Future<VoterInfoResponse> voterInfoQuery(core.String address, {core.Stri
ng electionId, core.bool officialOnly}) { | 150 async.Future<VoterInfoResponse> voterInfoQuery(core.String address, {core.Stri
ng electionId, core.bool officialOnly}) { |
150 var _url = null; | 151 var _url = null; |
151 var _queryParams = new core.Map(); | 152 var _queryParams = new core.Map(); |
152 var _uploadMedia = null; | 153 var _uploadMedia = null; |
153 var _uploadOptions = null; | 154 var _uploadOptions = null; |
154 var _downloadOptions = common.DownloadOptions.Metadata; | 155 var _downloadOptions = commons.DownloadOptions.Metadata; |
155 var _body = null; | 156 var _body = null; |
156 | 157 |
157 if (address == null) { | 158 if (address == null) { |
158 throw new core.ArgumentError("Parameter address is required."); | 159 throw new core.ArgumentError("Parameter address is required."); |
159 } | 160 } |
160 _queryParams["address"] = [address]; | 161 _queryParams["address"] = [address]; |
161 if (electionId != null) { | 162 if (electionId != null) { |
162 _queryParams["electionId"] = [electionId]; | 163 _queryParams["electionId"] = [electionId]; |
163 } | 164 } |
164 if (officialOnly != null) { | 165 if (officialOnly != null) { |
165 _queryParams["officialOnly"] = ["${officialOnly}"]; | 166 _queryParams["officialOnly"] = ["${officialOnly}"]; |
166 } | 167 } |
167 | 168 |
168 | 169 |
169 _url = 'voterinfo'; | 170 _url = 'voterinfo'; |
170 | 171 |
171 var _response = _requester.request(_url, | 172 var _response = _requester.request(_url, |
172 "GET", | 173 "GET", |
173 body: _body, | 174 body: _body, |
174 queryParams: _queryParams, | 175 queryParams: _queryParams, |
175 uploadOptions: _uploadOptions, | 176 uploadOptions: _uploadOptions, |
176 uploadMedia: _uploadMedia, | 177 uploadMedia: _uploadMedia, |
177 downloadOptions: _downloadOptions); | 178 downloadOptions: _downloadOptions); |
178 return _response.then((data) => new VoterInfoResponse.fromJson(data)); | 179 return _response.then((data) => new VoterInfoResponse.fromJson(data)); |
179 } | 180 } |
180 | 181 |
181 } | 182 } |
182 | 183 |
183 | 184 |
184 /** Not documented yet. */ | |
185 class RepresentativesResourceApi { | 185 class RepresentativesResourceApi { |
186 final common_internal.ApiRequester _requester; | 186 final commons.ApiRequester _requester; |
187 | 187 |
188 RepresentativesResourceApi(common_internal.ApiRequester client) : | 188 RepresentativesResourceApi(commons.ApiRequester client) : |
189 _requester = client; | 189 _requester = client; |
190 | 190 |
191 /** | 191 /** |
192 * Looks up political geography and representative information for a single | 192 * Looks up political geography and representative information for a single |
193 * address. | 193 * address. |
194 * | 194 * |
195 * Request parameters: | 195 * Request parameters: |
196 * | 196 * |
197 * [address] - The address to look up. May only be specified if the field | 197 * [address] - The address to look up. May only be specified if the field |
198 * ocdId is not given in the URL. | 198 * ocdId is not given in the URL. |
199 * | 199 * |
200 * [includeOffices] - Whether to return information about offices and | 200 * [includeOffices] - Whether to return information about offices and |
201 * officials. If false, only the top-level district information will be | 201 * officials. If false, only the top-level district information will be |
202 * returned. | 202 * returned. |
203 * | 203 * |
204 * [levels] - A list of office levels to filter by. Only offices that serve at | 204 * [levels] - A list of office levels to filter by. Only offices that serve at |
205 * least one of these levels will be returned. Divisions that don't contain a | 205 * least one of these levels will be returned. Divisions that don't contain a |
206 * matching office will not be returned. | 206 * matching office will not be returned. |
207 * | 207 * |
208 * [roles] - A list of office roles to filter by. Only offices fulfilling one | 208 * [roles] - A list of office roles to filter by. Only offices fulfilling one |
209 * of these roles will be returned. Divisions that don't contain a matching | 209 * of these roles will be returned. Divisions that don't contain a matching |
210 * office will not be returned. | 210 * office will not be returned. |
211 * | 211 * |
212 * Completes with a [RepresentativeInfoResponse]. | 212 * Completes with a [RepresentativeInfoResponse]. |
213 * | 213 * |
214 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 214 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
215 * error. | 215 * error. |
216 * | 216 * |
217 * If the used [http.Client] completes with an error when making a REST call, | 217 * If the used [http.Client] completes with an error when making a REST call, |
218 * this method will complete with the same error. | 218 * this method will complete with the same error. |
219 */ | 219 */ |
220 async.Future<RepresentativeInfoResponse> representativeInfoByAddress({core.Str
ing address, core.bool includeOffices, core.List<core.String> levels, core.List<
core.String> roles}) { | 220 async.Future<RepresentativeInfoResponse> representativeInfoByAddress({core.Str
ing address, core.bool includeOffices, core.List<core.String> levels, core.List<
core.String> roles}) { |
221 var _url = null; | 221 var _url = null; |
222 var _queryParams = new core.Map(); | 222 var _queryParams = new core.Map(); |
223 var _uploadMedia = null; | 223 var _uploadMedia = null; |
224 var _uploadOptions = null; | 224 var _uploadOptions = null; |
225 var _downloadOptions = common.DownloadOptions.Metadata; | 225 var _downloadOptions = commons.DownloadOptions.Metadata; |
226 var _body = null; | 226 var _body = null; |
227 | 227 |
228 if (address != null) { | 228 if (address != null) { |
229 _queryParams["address"] = [address]; | 229 _queryParams["address"] = [address]; |
230 } | 230 } |
231 if (includeOffices != null) { | 231 if (includeOffices != null) { |
232 _queryParams["includeOffices"] = ["${includeOffices}"]; | 232 _queryParams["includeOffices"] = ["${includeOffices}"]; |
233 } | 233 } |
234 if (levels != null) { | 234 if (levels != null) { |
235 _queryParams["levels"] = levels; | 235 _queryParams["levels"] = levels; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 * division requested will be included as well. For example, if querying | 267 * division requested will be included as well. For example, if querying |
268 * ocd-division/country:us/district:dc, this would also return all DC's wards | 268 * ocd-division/country:us/district:dc, this would also return all DC's wards |
269 * and ANCs. | 269 * and ANCs. |
270 * | 270 * |
271 * [roles] - A list of office roles to filter by. Only offices fulfilling one | 271 * [roles] - A list of office roles to filter by. Only offices fulfilling one |
272 * of these roles will be returned. Divisions that don't contain a matching | 272 * of these roles will be returned. Divisions that don't contain a matching |
273 * office will not be returned. | 273 * office will not be returned. |
274 * | 274 * |
275 * Completes with a [RepresentativeInfoData]. | 275 * Completes with a [RepresentativeInfoData]. |
276 * | 276 * |
277 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 277 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
278 * error. | 278 * error. |
279 * | 279 * |
280 * If the used [http.Client] completes with an error when making a REST call, | 280 * If the used [http.Client] completes with an error when making a REST call, |
281 * this method will complete with the same error. | 281 * this method will complete with the same error. |
282 */ | 282 */ |
283 async.Future<RepresentativeInfoData> representativeInfoByDivision(core.String
ocdId, {core.List<core.String> levels, core.bool recursive, core.List<core.Strin
g> roles}) { | 283 async.Future<RepresentativeInfoData> representativeInfoByDivision(core.String
ocdId, {core.List<core.String> levels, core.bool recursive, core.List<core.Strin
g> roles}) { |
284 var _url = null; | 284 var _url = null; |
285 var _queryParams = new core.Map(); | 285 var _queryParams = new core.Map(); |
286 var _uploadMedia = null; | 286 var _uploadMedia = null; |
287 var _uploadOptions = null; | 287 var _uploadOptions = null; |
288 var _downloadOptions = common.DownloadOptions.Metadata; | 288 var _downloadOptions = commons.DownloadOptions.Metadata; |
289 var _body = null; | 289 var _body = null; |
290 | 290 |
291 if (ocdId == null) { | 291 if (ocdId == null) { |
292 throw new core.ArgumentError("Parameter ocdId is required."); | 292 throw new core.ArgumentError("Parameter ocdId is required."); |
293 } | 293 } |
294 if (levels != null) { | 294 if (levels != null) { |
295 _queryParams["levels"] = levels; | 295 _queryParams["levels"] = levels; |
296 } | 296 } |
297 if (recursive != null) { | 297 if (recursive != null) { |
298 _queryParams["recursive"] = ["${recursive}"]; | 298 _queryParams["recursive"] = ["${recursive}"]; |
299 } | 299 } |
300 if (roles != null) { | 300 if (roles != null) { |
301 _queryParams["roles"] = roles; | 301 _queryParams["roles"] = roles; |
302 } | 302 } |
303 | 303 |
304 | 304 |
305 _url = 'representatives/' + common_internal.Escaper.ecapeVariable('$ocdId'); | 305 _url = 'representatives/' + commons.Escaper.ecapeVariable('$ocdId'); |
306 | 306 |
307 var _response = _requester.request(_url, | 307 var _response = _requester.request(_url, |
308 "GET", | 308 "GET", |
309 body: _body, | 309 body: _body, |
310 queryParams: _queryParams, | 310 queryParams: _queryParams, |
311 uploadOptions: _uploadOptions, | 311 uploadOptions: _uploadOptions, |
312 uploadMedia: _uploadMedia, | 312 uploadMedia: _uploadMedia, |
313 downloadOptions: _downloadOptions); | 313 downloadOptions: _downloadOptions); |
314 return _response.then((data) => new RepresentativeInfoData.fromJson(data)); | 314 return _response.then((data) => new RepresentativeInfoData.fromJson(data)); |
315 } | 315 } |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 | 872 |
873 | 873 |
874 /** The result of a division search query. */ | 874 /** The result of a division search query. */ |
875 class DivisionSearchResponse { | 875 class DivisionSearchResponse { |
876 /** | 876 /** |
877 * Identifies what kind of resource this is. Value: the fixed string | 877 * Identifies what kind of resource this is. Value: the fixed string |
878 * "civicinfo#divisionSearchResponse". | 878 * "civicinfo#divisionSearchResponse". |
879 */ | 879 */ |
880 core.String kind; | 880 core.String kind; |
881 | 881 |
882 /** Not documented yet. */ | |
883 core.List<DivisionSearchResult> results; | 882 core.List<DivisionSearchResult> results; |
884 | 883 |
885 | 884 |
886 DivisionSearchResponse(); | 885 DivisionSearchResponse(); |
887 | 886 |
888 DivisionSearchResponse.fromJson(core.Map _json) { | 887 DivisionSearchResponse.fromJson(core.Map _json) { |
889 if (_json.containsKey("kind")) { | 888 if (_json.containsKey("kind")) { |
890 kind = _json["kind"]; | 889 kind = _json["kind"]; |
891 } | 890 } |
892 if (_json.containsKey("results")) { | 891 if (_json.containsKey("results")) { |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 _json["startDate"] = startDate; | 1490 _json["startDate"] = startDate; |
1492 } | 1491 } |
1493 if (voterServices != null) { | 1492 if (voterServices != null) { |
1494 _json["voterServices"] = voterServices; | 1493 _json["voterServices"] = voterServices; |
1495 } | 1494 } |
1496 return _json; | 1495 return _json; |
1497 } | 1496 } |
1498 } | 1497 } |
1499 | 1498 |
1500 | 1499 |
1501 /** Not documented yet. */ | |
1502 class RepresentativeInfoData { | 1500 class RepresentativeInfoData { |
1503 /** Political geographic divisions that contain the requested address. */ | 1501 /** Political geographic divisions that contain the requested address. */ |
1504 core.Map<core.String, GeographicDivision> divisions; | 1502 core.Map<core.String, GeographicDivision> divisions; |
1505 | 1503 |
1506 /** | 1504 /** |
1507 * Elected offices referenced by the divisions listed above. Will only be | 1505 * Elected offices referenced by the divisions listed above. Will only be |
1508 * present if includeOffices was true in the request. | 1506 * present if includeOffices was true in the request. |
1509 */ | 1507 */ |
1510 core.List<Office> offices; | 1508 core.List<Office> offices; |
1511 | 1509 |
1512 /** | 1510 /** |
1513 * Officials holding the offices listed above. Will only be present if | 1511 * Officials holding the offices listed above. Will only be present if |
1514 * includeOffices was true in the request. | 1512 * includeOffices was true in the request. |
1515 */ | 1513 */ |
1516 core.List<Official> officials; | 1514 core.List<Official> officials; |
1517 | 1515 |
1518 | 1516 |
1519 RepresentativeInfoData(); | 1517 RepresentativeInfoData(); |
1520 | 1518 |
1521 RepresentativeInfoData.fromJson(core.Map _json) { | 1519 RepresentativeInfoData.fromJson(core.Map _json) { |
1522 if (_json.containsKey("divisions")) { | 1520 if (_json.containsKey("divisions")) { |
1523 divisions = common_internal.mapMap(_json["divisions"], (item) => new Geogr
aphicDivision.fromJson(item)); | 1521 divisions = commons.mapMap(_json["divisions"], (item) => new GeographicDiv
ision.fromJson(item)); |
1524 } | 1522 } |
1525 if (_json.containsKey("offices")) { | 1523 if (_json.containsKey("offices")) { |
1526 offices = _json["offices"].map((value) => new Office.fromJson(value)).toLi
st(); | 1524 offices = _json["offices"].map((value) => new Office.fromJson(value)).toLi
st(); |
1527 } | 1525 } |
1528 if (_json.containsKey("officials")) { | 1526 if (_json.containsKey("officials")) { |
1529 officials = _json["officials"].map((value) => new Official.fromJson(value)
).toList(); | 1527 officials = _json["officials"].map((value) => new Official.fromJson(value)
).toList(); |
1530 } | 1528 } |
1531 } | 1529 } |
1532 | 1530 |
1533 core.Map toJson() { | 1531 core.Map toJson() { |
1534 var _json = new core.Map(); | 1532 var _json = new core.Map(); |
1535 if (divisions != null) { | 1533 if (divisions != null) { |
1536 _json["divisions"] = common_internal.mapMap(divisions, (item) => (item).to
Json()); | 1534 _json["divisions"] = commons.mapMap(divisions, (item) => (item).toJson()); |
1537 } | 1535 } |
1538 if (offices != null) { | 1536 if (offices != null) { |
1539 _json["offices"] = offices.map((value) => (value).toJson()).toList(); | 1537 _json["offices"] = offices.map((value) => (value).toJson()).toList(); |
1540 } | 1538 } |
1541 if (officials != null) { | 1539 if (officials != null) { |
1542 _json["officials"] = officials.map((value) => (value).toJson()).toList(); | 1540 _json["officials"] = officials.map((value) => (value).toJson()).toList(); |
1543 } | 1541 } |
1544 return _json; | 1542 return _json; |
1545 } | 1543 } |
1546 } | 1544 } |
(...skipping 23 matching lines...) Expand all Loading... |
1570 * Officials holding the offices listed above. Will only be present if | 1568 * Officials holding the offices listed above. Will only be present if |
1571 * includeOffices was true in the request. | 1569 * includeOffices was true in the request. |
1572 */ | 1570 */ |
1573 core.List<Official> officials; | 1571 core.List<Official> officials; |
1574 | 1572 |
1575 | 1573 |
1576 RepresentativeInfoResponse(); | 1574 RepresentativeInfoResponse(); |
1577 | 1575 |
1578 RepresentativeInfoResponse.fromJson(core.Map _json) { | 1576 RepresentativeInfoResponse.fromJson(core.Map _json) { |
1579 if (_json.containsKey("divisions")) { | 1577 if (_json.containsKey("divisions")) { |
1580 divisions = common_internal.mapMap(_json["divisions"], (item) => new Geogr
aphicDivision.fromJson(item)); | 1578 divisions = commons.mapMap(_json["divisions"], (item) => new GeographicDiv
ision.fromJson(item)); |
1581 } | 1579 } |
1582 if (_json.containsKey("kind")) { | 1580 if (_json.containsKey("kind")) { |
1583 kind = _json["kind"]; | 1581 kind = _json["kind"]; |
1584 } | 1582 } |
1585 if (_json.containsKey("normalizedInput")) { | 1583 if (_json.containsKey("normalizedInput")) { |
1586 normalizedInput = new SimpleAddressType.fromJson(_json["normalizedInput"])
; | 1584 normalizedInput = new SimpleAddressType.fromJson(_json["normalizedInput"])
; |
1587 } | 1585 } |
1588 if (_json.containsKey("offices")) { | 1586 if (_json.containsKey("offices")) { |
1589 offices = _json["offices"].map((value) => new Office.fromJson(value)).toLi
st(); | 1587 offices = _json["offices"].map((value) => new Office.fromJson(value)).toLi
st(); |
1590 } | 1588 } |
1591 if (_json.containsKey("officials")) { | 1589 if (_json.containsKey("officials")) { |
1592 officials = _json["officials"].map((value) => new Official.fromJson(value)
).toList(); | 1590 officials = _json["officials"].map((value) => new Official.fromJson(value)
).toList(); |
1593 } | 1591 } |
1594 } | 1592 } |
1595 | 1593 |
1596 core.Map toJson() { | 1594 core.Map toJson() { |
1597 var _json = new core.Map(); | 1595 var _json = new core.Map(); |
1598 if (divisions != null) { | 1596 if (divisions != null) { |
1599 _json["divisions"] = common_internal.mapMap(divisions, (item) => (item).to
Json()); | 1597 _json["divisions"] = commons.mapMap(divisions, (item) => (item).toJson()); |
1600 } | 1598 } |
1601 if (kind != null) { | 1599 if (kind != null) { |
1602 _json["kind"] = kind; | 1600 _json["kind"] = kind; |
1603 } | 1601 } |
1604 if (normalizedInput != null) { | 1602 if (normalizedInput != null) { |
1605 _json["normalizedInput"] = (normalizedInput).toJson(); | 1603 _json["normalizedInput"] = (normalizedInput).toJson(); |
1606 } | 1604 } |
1607 if (offices != null) { | 1605 if (offices != null) { |
1608 _json["offices"] = offices.map((value) => (value).toJson()).toList(); | 1606 _json["offices"] = offices.map((value) => (value).toJson()).toList(); |
1609 } | 1607 } |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1762 /** | 1760 /** |
1763 * If no election ID was specified in the query, and there was more than one | 1761 * If no election ID was specified in the query, and there was more than one |
1764 * election with data for the given voter, this will contain information about | 1762 * election with data for the given voter, this will contain information about |
1765 * the other elections that could apply. | 1763 * the other elections that could apply. |
1766 */ | 1764 */ |
1767 core.List<Election> otherElections; | 1765 core.List<Election> otherElections; |
1768 | 1766 |
1769 /** Locations where the voter is eligible to vote on election day. */ | 1767 /** Locations where the voter is eligible to vote on election day. */ |
1770 core.List<PollingLocation> pollingLocations; | 1768 core.List<PollingLocation> pollingLocations; |
1771 | 1769 |
1772 /** Not documented yet. */ | |
1773 core.String precinctId; | 1770 core.String precinctId; |
1774 | 1771 |
1775 /** | 1772 /** |
1776 * Local Election Information for the state that the voter votes in. For the | 1773 * Local Election Information for the state that the voter votes in. For the |
1777 * US, there will only be one element in this array. | 1774 * US, there will only be one element in this array. |
1778 */ | 1775 */ |
1779 core.List<AdministrationRegion> state; | 1776 core.List<AdministrationRegion> state; |
1780 | 1777 |
1781 | 1778 |
1782 VoterInfoResponse(); | 1779 VoterInfoResponse(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1842 } | 1839 } |
1843 if (precinctId != null) { | 1840 if (precinctId != null) { |
1844 _json["precinctId"] = precinctId; | 1841 _json["precinctId"] = precinctId; |
1845 } | 1842 } |
1846 if (state != null) { | 1843 if (state != null) { |
1847 _json["state"] = state.map((value) => (value).toJson()).toList(); | 1844 _json["state"] = state.map((value) => (value).toJson()).toList(); |
1848 } | 1845 } |
1849 return _json; | 1846 return _json; |
1850 } | 1847 } |
1851 } | 1848 } |
1852 | |
1853 | |
OLD | NEW |