OLD | NEW |
1 library googleapis.civicinfo.v2; | 1 library googleapis.civicinfo.v2; |
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 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 } | 1372 } |
1373 if (urls != null) { | 1373 if (urls != null) { |
1374 _json["urls"] = urls; | 1374 _json["urls"] = urls; |
1375 } | 1375 } |
1376 return _json; | 1376 return _json; |
1377 } | 1377 } |
1378 } | 1378 } |
1379 | 1379 |
1380 | 1380 |
1381 /** | 1381 /** |
1382 * A location where a voter can vote. This may be an early vote site or an | 1382 * A location where a voter can vote. This may be an early vote site, an |
1383 * election day voting location. | 1383 * election day voting location, or a drop off location for a completed ballot. |
1384 */ | 1384 */ |
1385 class PollingLocation { | 1385 class PollingLocation { |
1386 /** The address of the location */ | 1386 /** The address of the location. */ |
1387 SimpleAddressType address; | 1387 SimpleAddressType address; |
1388 | 1388 |
1389 /** | 1389 /** |
1390 * The last date that this early vote site may be used. This field is not | 1390 * The last date that this early vote site or drop off location may be used. |
1391 * populated for polling locations. | 1391 * This field is not populated for polling locations. |
1392 */ | 1392 */ |
1393 core.String endDate; | 1393 core.String endDate; |
1394 | 1394 |
1395 /** | 1395 /** |
1396 * An ID for this object. IDs may change in future requests and should not be | 1396 * An ID for this object. IDs may change in future requests and should not be |
1397 * cached. Access to this field requires special access that can be requested | 1397 * cached. Access to this field requires special access that can be requested |
1398 * from the Request more link on the Quotas page. | 1398 * from the Request more link on the Quotas page. |
1399 */ | 1399 */ |
1400 core.String id; | 1400 core.String id; |
1401 | 1401 |
1402 /** | 1402 /** |
1403 * The name of the early vote site. This field is not populated for polling | 1403 * The name of the early vote site or drop off location. This field is not |
1404 * locations. | 1404 * populated for polling locations. |
1405 */ | 1405 */ |
1406 core.String name; | 1406 core.String name; |
1407 | 1407 |
1408 /** Notes about this location (e.g. accessibility ramp or entrance to use) */ | 1408 /** |
| 1409 * Notes about this location (e.g. accessibility ramp or entrance to use). |
| 1410 */ |
1409 core.String notes; | 1411 core.String notes; |
1410 | 1412 |
1411 /** A description of when this location is open. */ | 1413 /** A description of when this location is open. */ |
1412 core.String pollingHours; | 1414 core.String pollingHours; |
1413 | 1415 |
1414 /** | 1416 /** |
1415 * A list of sources for this location. If multiple sources are listed the | 1417 * A list of sources for this location. If multiple sources are listed the |
1416 * data has been aggregated from those sources. | 1418 * data has been aggregated from those sources. |
1417 */ | 1419 */ |
1418 core.List<Source> sources; | 1420 core.List<Source> sources; |
1419 | 1421 |
1420 /** | 1422 /** |
1421 * The first date that this early vote site may be used. This field is not | 1423 * The first date that this early vote site or drop off location may be used. |
1422 * populated for polling locations. | 1424 * This field is not populated for polling locations. |
1423 */ | 1425 */ |
1424 core.String startDate; | 1426 core.String startDate; |
1425 | 1427 |
1426 /** | 1428 /** |
1427 * The services provided by this early vote site. This field is not populated | 1429 * The services provided by this early vote site or drop off location. This |
1428 * for polling locations. | 1430 * field is not populated for polling locations. |
1429 */ | 1431 */ |
1430 core.String voterServices; | 1432 core.String voterServices; |
1431 | 1433 |
1432 | 1434 |
1433 PollingLocation(); | 1435 PollingLocation(); |
1434 | 1436 |
1435 PollingLocation.fromJson(core.Map _json) { | 1437 PollingLocation.fromJson(core.Map _json) { |
1436 if (_json.containsKey("address")) { | 1438 if (_json.containsKey("address")) { |
1437 address = new SimpleAddressType.fromJson(_json["address"]); | 1439 address = new SimpleAddressType.fromJson(_json["address"]); |
1438 } | 1440 } |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1721 if (official != null) { | 1723 if (official != null) { |
1722 _json["official"] = official; | 1724 _json["official"] = official; |
1723 } | 1725 } |
1724 return _json; | 1726 return _json; |
1725 } | 1727 } |
1726 } | 1728 } |
1727 | 1729 |
1728 | 1730 |
1729 /** The result of a voter info lookup query. */ | 1731 /** The result of a voter info lookup query. */ |
1730 class VoterInfoResponse { | 1732 class VoterInfoResponse { |
1731 /** Contests that will appear on the voter's ballot */ | 1733 /** Contests that will appear on the voter's ballot. */ |
1732 core.List<Contest> contests; | 1734 core.List<Contest> contests; |
1733 | 1735 |
1734 /** | 1736 /** |
1735 * Locations where the voter is eligible to vote early, prior to election day | 1737 * Locations where a voter is eligible to drop off a completed ballot. The |
| 1738 * voter must have received and completed a ballot prior to arriving at the |
| 1739 * location. The location may not have ballots available on the premises. |
| 1740 * These locations could be open on or before election day as indicated in the |
| 1741 * pollingHours field. |
| 1742 */ |
| 1743 core.List<PollingLocation> dropOffLocations; |
| 1744 |
| 1745 /** |
| 1746 * Locations where the voter is eligible to vote early, prior to election day. |
1736 */ | 1747 */ |
1737 core.List<PollingLocation> earlyVoteSites; | 1748 core.List<PollingLocation> earlyVoteSites; |
1738 | 1749 |
1739 /** The election that was queried. */ | 1750 /** The election that was queried. */ |
1740 Election election; | 1751 Election election; |
1741 | 1752 |
1742 /** | 1753 /** |
1743 * Identifies what kind of resource this is. Value: the fixed string | 1754 * Identifies what kind of resource this is. Value: the fixed string |
1744 * "civicinfo#voterInfoResponse". | 1755 * "civicinfo#voterInfoResponse". |
1745 */ | 1756 */ |
1746 core.String kind; | 1757 core.String kind; |
1747 | 1758 |
1748 /** The normalized version of the requested address */ | 1759 /** The normalized version of the requested address */ |
1749 SimpleAddressType normalizedInput; | 1760 SimpleAddressType normalizedInput; |
1750 | 1761 |
1751 /** | 1762 /** |
1752 * If no election ID was specified in the query, and there was more than one | 1763 * If no election ID was specified in the query, and there was more than one |
1753 * election with data for the given voter, this will contain information about | 1764 * election with data for the given voter, this will contain information about |
1754 * the other elections that could apply. | 1765 * the other elections that could apply. |
1755 */ | 1766 */ |
1756 core.List<Election> otherElections; | 1767 core.List<Election> otherElections; |
1757 | 1768 |
1758 /** | 1769 /** Locations where the voter is eligible to vote on election day. */ |
1759 * Locations where the voter is eligible to vote on election day. For states | |
1760 * with mail-in voting only, these locations will be nearby drop box | |
1761 * locations. Drop box locations are free to the voter and may be used instead | |
1762 * of placing the ballot in the mail. | |
1763 */ | |
1764 core.List<PollingLocation> pollingLocations; | 1770 core.List<PollingLocation> pollingLocations; |
1765 | 1771 |
1766 /** Not documented yet. */ | 1772 /** Not documented yet. */ |
1767 core.String precinctId; | 1773 core.String precinctId; |
1768 | 1774 |
1769 /** | 1775 /** |
1770 * Local Election Information for the state that the voter votes in. For the | 1776 * Local Election Information for the state that the voter votes in. For the |
1771 * US, there will only be one element in this array. | 1777 * US, there will only be one element in this array. |
1772 */ | 1778 */ |
1773 core.List<AdministrationRegion> state; | 1779 core.List<AdministrationRegion> state; |
1774 | 1780 |
1775 | 1781 |
1776 VoterInfoResponse(); | 1782 VoterInfoResponse(); |
1777 | 1783 |
1778 VoterInfoResponse.fromJson(core.Map _json) { | 1784 VoterInfoResponse.fromJson(core.Map _json) { |
1779 if (_json.containsKey("contests")) { | 1785 if (_json.containsKey("contests")) { |
1780 contests = _json["contests"].map((value) => new Contest.fromJson(value)).t
oList(); | 1786 contests = _json["contests"].map((value) => new Contest.fromJson(value)).t
oList(); |
1781 } | 1787 } |
| 1788 if (_json.containsKey("dropOffLocations")) { |
| 1789 dropOffLocations = _json["dropOffLocations"].map((value) => new PollingLoc
ation.fromJson(value)).toList(); |
| 1790 } |
1782 if (_json.containsKey("earlyVoteSites")) { | 1791 if (_json.containsKey("earlyVoteSites")) { |
1783 earlyVoteSites = _json["earlyVoteSites"].map((value) => new PollingLocatio
n.fromJson(value)).toList(); | 1792 earlyVoteSites = _json["earlyVoteSites"].map((value) => new PollingLocatio
n.fromJson(value)).toList(); |
1784 } | 1793 } |
1785 if (_json.containsKey("election")) { | 1794 if (_json.containsKey("election")) { |
1786 election = new Election.fromJson(_json["election"]); | 1795 election = new Election.fromJson(_json["election"]); |
1787 } | 1796 } |
1788 if (_json.containsKey("kind")) { | 1797 if (_json.containsKey("kind")) { |
1789 kind = _json["kind"]; | 1798 kind = _json["kind"]; |
1790 } | 1799 } |
1791 if (_json.containsKey("normalizedInput")) { | 1800 if (_json.containsKey("normalizedInput")) { |
(...skipping 11 matching lines...) Expand all Loading... |
1803 if (_json.containsKey("state")) { | 1812 if (_json.containsKey("state")) { |
1804 state = _json["state"].map((value) => new AdministrationRegion.fromJson(va
lue)).toList(); | 1813 state = _json["state"].map((value) => new AdministrationRegion.fromJson(va
lue)).toList(); |
1805 } | 1814 } |
1806 } | 1815 } |
1807 | 1816 |
1808 core.Map toJson() { | 1817 core.Map toJson() { |
1809 var _json = new core.Map(); | 1818 var _json = new core.Map(); |
1810 if (contests != null) { | 1819 if (contests != null) { |
1811 _json["contests"] = contests.map((value) => (value).toJson()).toList(); | 1820 _json["contests"] = contests.map((value) => (value).toJson()).toList(); |
1812 } | 1821 } |
| 1822 if (dropOffLocations != null) { |
| 1823 _json["dropOffLocations"] = dropOffLocations.map((value) => (value).toJson
()).toList(); |
| 1824 } |
1813 if (earlyVoteSites != null) { | 1825 if (earlyVoteSites != null) { |
1814 _json["earlyVoteSites"] = earlyVoteSites.map((value) => (value).toJson()).
toList(); | 1826 _json["earlyVoteSites"] = earlyVoteSites.map((value) => (value).toJson()).
toList(); |
1815 } | 1827 } |
1816 if (election != null) { | 1828 if (election != null) { |
1817 _json["election"] = (election).toJson(); | 1829 _json["election"] = (election).toJson(); |
1818 } | 1830 } |
1819 if (kind != null) { | 1831 if (kind != null) { |
1820 _json["kind"] = kind; | 1832 _json["kind"] = kind; |
1821 } | 1833 } |
1822 if (normalizedInput != null) { | 1834 if (normalizedInput != null) { |
1823 _json["normalizedInput"] = (normalizedInput).toJson(); | 1835 _json["normalizedInput"] = (normalizedInput).toJson(); |
1824 } | 1836 } |
1825 if (otherElections != null) { | 1837 if (otherElections != null) { |
1826 _json["otherElections"] = otherElections.map((value) => (value).toJson()).
toList(); | 1838 _json["otherElections"] = otherElections.map((value) => (value).toJson()).
toList(); |
1827 } | 1839 } |
1828 if (pollingLocations != null) { | 1840 if (pollingLocations != null) { |
1829 _json["pollingLocations"] = pollingLocations.map((value) => (value).toJson
()).toList(); | 1841 _json["pollingLocations"] = pollingLocations.map((value) => (value).toJson
()).toList(); |
1830 } | 1842 } |
1831 if (precinctId != null) { | 1843 if (precinctId != null) { |
1832 _json["precinctId"] = precinctId; | 1844 _json["precinctId"] = precinctId; |
1833 } | 1845 } |
1834 if (state != null) { | 1846 if (state != null) { |
1835 _json["state"] = state.map((value) => (value).toJson()).toList(); | 1847 _json["state"] = state.map((value) => (value).toJson()).toList(); |
1836 } | 1848 } |
1837 return _json; | 1849 return _json; |
1838 } | 1850 } |
1839 } | 1851 } |
1840 | 1852 |
1841 | 1853 |
OLD | NEW |