OLD | NEW |
1 library googleapis.civicinfo.us_v1; | 1 library googleapis.civicinfo.us_v1; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import "package:crypto/crypto.dart" as crypto; | 8 import "package:crypto/crypto.dart" as crypto; |
9 import 'package:http/http.dart' as http; | 9 import 'package:http/http.dart' as http; |
10 import '../src/common_internal.dart' as common_internal; | 10 import '../src/common_internal.dart' as common_internal; |
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1304 } | 1304 } |
1305 if (urls != null) { | 1305 if (urls != null) { |
1306 _json["urls"] = urls; | 1306 _json["urls"] = urls; |
1307 } | 1307 } |
1308 return _json; | 1308 return _json; |
1309 } | 1309 } |
1310 } | 1310 } |
1311 | 1311 |
1312 | 1312 |
1313 /** | 1313 /** |
1314 * A location where a voter can vote. This may be an early vote site or an | 1314 * A location where a voter can vote. This may be an early vote site, an |
1315 * election day voting location. | 1315 * election day voting location, or a drop off location for a completed ballot. |
1316 */ | 1316 */ |
1317 class PollingLocation { | 1317 class PollingLocation { |
1318 /** The address of the location */ | 1318 /** The address of the location. */ |
1319 SimpleAddressType address; | 1319 SimpleAddressType address; |
1320 | 1320 |
1321 /** | 1321 /** |
1322 * The last date that this early vote site may be used. This field is not | 1322 * The last date that this early vote site or drop off location may be used. |
1323 * populated for polling locations. | 1323 * This field is not populated for polling locations. |
1324 */ | 1324 */ |
1325 core.String endDate; | 1325 core.String endDate; |
1326 | 1326 |
1327 /** | 1327 /** |
1328 * An ID for this object. IDs may change in future requests and should not be | 1328 * An ID for this object. IDs may change in future requests and should not be |
1329 * cached. Access to this field requires special access that can be requested | 1329 * cached. Access to this field requires special access that can be requested |
1330 * from the Request more link on the Quotas page. | 1330 * from the Request more link on the Quotas page. |
1331 */ | 1331 */ |
1332 core.String id; | 1332 core.String id; |
1333 | 1333 |
1334 /** | 1334 /** |
1335 * The name of the early vote site. This field is not populated for polling | 1335 * The name of the early vote site or drop off location. This field is not |
1336 * locations. | 1336 * populated for polling locations. |
1337 */ | 1337 */ |
1338 core.String name; | 1338 core.String name; |
1339 | 1339 |
1340 /** Notes about this location (e.g. accessibility ramp or entrance to use) */ | 1340 /** |
| 1341 * Notes about this location (e.g. accessibility ramp or entrance to use). |
| 1342 */ |
1341 core.String notes; | 1343 core.String notes; |
1342 | 1344 |
1343 /** A description of when this location is open. */ | 1345 /** A description of when this location is open. */ |
1344 core.String pollingHours; | 1346 core.String pollingHours; |
1345 | 1347 |
1346 /** | 1348 /** |
1347 * A list of sources for this location. If multiple sources are listed the | 1349 * A list of sources for this location. If multiple sources are listed the |
1348 * data has been aggregated from those sources. | 1350 * data has been aggregated from those sources. |
1349 */ | 1351 */ |
1350 core.List<Source> sources; | 1352 core.List<Source> sources; |
1351 | 1353 |
1352 /** | 1354 /** |
1353 * The first date that this early vote site may be used. This field is not | 1355 * The first date that this early vote site or drop off location may be used. |
1354 * populated for polling locations. | 1356 * This field is not populated for polling locations. |
1355 */ | 1357 */ |
1356 core.String startDate; | 1358 core.String startDate; |
1357 | 1359 |
1358 /** | 1360 /** |
1359 * The services provided by this early vote site. This field is not populated | 1361 * The services provided by this early vote site or drop off location. This |
1360 * for polling locations. | 1362 * field is not populated for polling locations. |
1361 */ | 1363 */ |
1362 core.String voterServices; | 1364 core.String voterServices; |
1363 | 1365 |
1364 | 1366 |
1365 PollingLocation(); | 1367 PollingLocation(); |
1366 | 1368 |
1367 PollingLocation.fromJson(core.Map _json) { | 1369 PollingLocation.fromJson(core.Map _json) { |
1368 if (_json.containsKey("address")) { | 1370 if (_json.containsKey("address")) { |
1369 address = new SimpleAddressType.fromJson(_json["address"]); | 1371 address = new SimpleAddressType.fromJson(_json["address"]); |
1370 } | 1372 } |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1673 if (address != null) { | 1675 if (address != null) { |
1674 _json["address"] = address; | 1676 _json["address"] = address; |
1675 } | 1677 } |
1676 return _json; | 1678 return _json; |
1677 } | 1679 } |
1678 } | 1680 } |
1679 | 1681 |
1680 | 1682 |
1681 /** The result of a voter info lookup query. */ | 1683 /** The result of a voter info lookup query. */ |
1682 class VoterInfoResponse { | 1684 class VoterInfoResponse { |
1683 /** Contests that will appear on the voter's ballot */ | 1685 /** Contests that will appear on the voter's ballot. */ |
1684 core.List<Contest> contests; | 1686 core.List<Contest> contests; |
1685 | 1687 |
1686 /** | 1688 /** |
1687 * Locations where the voter is eligible to vote early, prior to election day | 1689 * Locations where a voter is eligible to drop off a completed ballot. The |
| 1690 * voter must have received and completed a ballot prior to arriving at the |
| 1691 * location. The location may not have ballots available on the premises. |
| 1692 * These locations could be open on or before election day as indicated in the |
| 1693 * pollingHours field. |
| 1694 */ |
| 1695 core.List<PollingLocation> dropOffLocations; |
| 1696 |
| 1697 /** |
| 1698 * Locations where the voter is eligible to vote early, prior to election day. |
1688 */ | 1699 */ |
1689 core.List<PollingLocation> earlyVoteSites; | 1700 core.List<PollingLocation> earlyVoteSites; |
1690 | 1701 |
1691 /** The election that was queried. */ | 1702 /** The election that was queried. */ |
1692 Election election; | 1703 Election election; |
1693 | 1704 |
1694 /** | 1705 /** |
1695 * Identifies what kind of resource this is. Value: the fixed string | 1706 * Identifies what kind of resource this is. Value: the fixed string |
1696 * "civicinfo#voterInfoResponse". | 1707 * "civicinfo#voterInfoResponse". |
1697 */ | 1708 */ |
1698 core.String kind; | 1709 core.String kind; |
1699 | 1710 |
1700 /** The normalized version of the requested address */ | 1711 /** The normalized version of the requested address */ |
1701 SimpleAddressType normalizedInput; | 1712 SimpleAddressType normalizedInput; |
1702 | 1713 |
1703 /** | 1714 /** Locations where the voter is eligible to vote on election day. */ |
1704 * Locations where the voter is eligible to vote on election day. For states | |
1705 * with mail-in voting only, these locations will be nearby drop box | |
1706 * locations. Drop box locations are free to the voter and may be used instead | |
1707 * of placing the ballot in the mail. | |
1708 */ | |
1709 core.List<PollingLocation> pollingLocations; | 1715 core.List<PollingLocation> pollingLocations; |
1710 | 1716 |
1711 /** Not documented yet. */ | 1717 /** Not documented yet. */ |
1712 core.String precinctId; | 1718 core.String precinctId; |
1713 | 1719 |
1714 /** | 1720 /** |
1715 * Local Election Information for the state that the voter votes in. For the | 1721 * Local Election Information for the state that the voter votes in. For the |
1716 * US, there will only be one element in this array. | 1722 * US, there will only be one element in this array. |
1717 */ | 1723 */ |
1718 core.List<AdministrationRegion> state; | 1724 core.List<AdministrationRegion> state; |
1719 | 1725 |
1720 /** | 1726 /** |
1721 * The result of the request. One of: success, noStreetSegmentFound, | 1727 * The result of the request. One of: success, noStreetSegmentFound, |
1722 * addressUnparseable, noAddressParameter, multipleStreetSegmentsFound, | 1728 * addressUnparseable, noAddressParameter, multipleStreetSegmentsFound, |
1723 * electionOver, electionUnknown, internalLookupFailure | 1729 * electionOver, electionUnknown, internalLookupFailure |
1724 */ | 1730 */ |
1725 core.String status; | 1731 core.String status; |
1726 | 1732 |
1727 | 1733 |
1728 VoterInfoResponse(); | 1734 VoterInfoResponse(); |
1729 | 1735 |
1730 VoterInfoResponse.fromJson(core.Map _json) { | 1736 VoterInfoResponse.fromJson(core.Map _json) { |
1731 if (_json.containsKey("contests")) { | 1737 if (_json.containsKey("contests")) { |
1732 contests = _json["contests"].map((value) => new Contest.fromJson(value)).t
oList(); | 1738 contests = _json["contests"].map((value) => new Contest.fromJson(value)).t
oList(); |
1733 } | 1739 } |
| 1740 if (_json.containsKey("dropOffLocations")) { |
| 1741 dropOffLocations = _json["dropOffLocations"].map((value) => new PollingLoc
ation.fromJson(value)).toList(); |
| 1742 } |
1734 if (_json.containsKey("earlyVoteSites")) { | 1743 if (_json.containsKey("earlyVoteSites")) { |
1735 earlyVoteSites = _json["earlyVoteSites"].map((value) => new PollingLocatio
n.fromJson(value)).toList(); | 1744 earlyVoteSites = _json["earlyVoteSites"].map((value) => new PollingLocatio
n.fromJson(value)).toList(); |
1736 } | 1745 } |
1737 if (_json.containsKey("election")) { | 1746 if (_json.containsKey("election")) { |
1738 election = new Election.fromJson(_json["election"]); | 1747 election = new Election.fromJson(_json["election"]); |
1739 } | 1748 } |
1740 if (_json.containsKey("kind")) { | 1749 if (_json.containsKey("kind")) { |
1741 kind = _json["kind"]; | 1750 kind = _json["kind"]; |
1742 } | 1751 } |
1743 if (_json.containsKey("normalizedInput")) { | 1752 if (_json.containsKey("normalizedInput")) { |
(...skipping 11 matching lines...) Expand all Loading... |
1755 if (_json.containsKey("status")) { | 1764 if (_json.containsKey("status")) { |
1756 status = _json["status"]; | 1765 status = _json["status"]; |
1757 } | 1766 } |
1758 } | 1767 } |
1759 | 1768 |
1760 core.Map toJson() { | 1769 core.Map toJson() { |
1761 var _json = new core.Map(); | 1770 var _json = new core.Map(); |
1762 if (contests != null) { | 1771 if (contests != null) { |
1763 _json["contests"] = contests.map((value) => (value).toJson()).toList(); | 1772 _json["contests"] = contests.map((value) => (value).toJson()).toList(); |
1764 } | 1773 } |
| 1774 if (dropOffLocations != null) { |
| 1775 _json["dropOffLocations"] = dropOffLocations.map((value) => (value).toJson
()).toList(); |
| 1776 } |
1765 if (earlyVoteSites != null) { | 1777 if (earlyVoteSites != null) { |
1766 _json["earlyVoteSites"] = earlyVoteSites.map((value) => (value).toJson()).
toList(); | 1778 _json["earlyVoteSites"] = earlyVoteSites.map((value) => (value).toJson()).
toList(); |
1767 } | 1779 } |
1768 if (election != null) { | 1780 if (election != null) { |
1769 _json["election"] = (election).toJson(); | 1781 _json["election"] = (election).toJson(); |
1770 } | 1782 } |
1771 if (kind != null) { | 1783 if (kind != null) { |
1772 _json["kind"] = kind; | 1784 _json["kind"] = kind; |
1773 } | 1785 } |
1774 if (normalizedInput != null) { | 1786 if (normalizedInput != null) { |
1775 _json["normalizedInput"] = (normalizedInput).toJson(); | 1787 _json["normalizedInput"] = (normalizedInput).toJson(); |
1776 } | 1788 } |
1777 if (pollingLocations != null) { | 1789 if (pollingLocations != null) { |
1778 _json["pollingLocations"] = pollingLocations.map((value) => (value).toJson
()).toList(); | 1790 _json["pollingLocations"] = pollingLocations.map((value) => (value).toJson
()).toList(); |
1779 } | 1791 } |
1780 if (precinctId != null) { | 1792 if (precinctId != null) { |
1781 _json["precinctId"] = precinctId; | 1793 _json["precinctId"] = precinctId; |
1782 } | 1794 } |
1783 if (state != null) { | 1795 if (state != null) { |
1784 _json["state"] = state.map((value) => (value).toJson()).toList(); | 1796 _json["state"] = state.map((value) => (value).toJson()).toList(); |
1785 } | 1797 } |
1786 if (status != null) { | 1798 if (status != null) { |
1787 _json["status"] = status; | 1799 _json["status"] = status; |
1788 } | 1800 } |
1789 return _json; | 1801 return _json; |
1790 } | 1802 } |
1791 } | 1803 } |
1792 | 1804 |
1793 | 1805 |
OLD | NEW |