| OLD | NEW |
| 1 library googleapis.civicinfo.v1; | 1 library googleapis.civicinfo.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; |
| 11 import '../common/common.dart' as common; | 11 import '../common/common.dart' as common; |
| 12 | 12 |
| 13 export '../common/common.dart' show ApiRequestError; | 13 export '../common/common.dart' show ApiRequestError; |
| 14 export '../common/common.dart' show DetailedApiRequestError; | 14 export '../common/common.dart' show DetailedApiRequestError; |
| 15 | 15 |
| 16 /** An API for accessing civic information. */ | 16 /** An API for accessing civic information. */ |
| 17 class CivicinfoApi { | 17 class CivicinfoApi { |
| 18 | 18 |
| 19 final common_internal.ApiRequester _requester; | 19 final common_internal.ApiRequester _requester; |
| 20 | 20 |
| 21 DivisionsResourceApi get divisions => new DivisionsResourceApi(_requester); | 21 DivisionsResourceApi get divisions => new DivisionsResourceApi(_requester); |
| 22 ElectionsResourceApi get elections => new ElectionsResourceApi(_requester); | 22 ElectionsResourceApi get elections => new ElectionsResourceApi(_requester); |
| 23 RepresentativesResourceApi get representatives => new RepresentativesResourceA
pi(_requester); | 23 RepresentativesResourceApi get representatives => new RepresentativesResourceA
pi(_requester); |
| 24 | 24 |
| 25 CivicinfoApi(http.Client client) : | 25 CivicinfoApi(http.Client client) : |
| 26 _requester = new common_internal.ApiRequester(client, "https://www.googlea
pis.com/", "/civicinfo/v1/"); | 26 _requester = new common_internal.ApiRequester(client, "https://www.googlea
pis.com/", "civicinfo/v1/"); |
| 27 } | 27 } |
| 28 | 28 |
| 29 | 29 |
| 30 /** Not documented yet. */ | 30 /** Not documented yet. */ |
| 31 class DivisionsResourceApi { | 31 class DivisionsResourceApi { |
| 32 final common_internal.ApiRequester _requester; | 32 final common_internal.ApiRequester _requester; |
| 33 | 33 |
| 34 DivisionsResourceApi(common_internal.ApiRequester client) : | 34 DivisionsResourceApi(common_internal.ApiRequester client) : |
| 35 _requester = client; | 35 _requester = client; |
| 36 | 36 |
| (...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 _json["scope"] = scope; | 1077 _json["scope"] = scope; |
| 1078 } | 1078 } |
| 1079 return _json; | 1079 return _json; |
| 1080 } | 1080 } |
| 1081 } | 1081 } |
| 1082 | 1082 |
| 1083 | 1083 |
| 1084 /** Describes a political geography. */ | 1084 /** Describes a political geography. */ |
| 1085 class GeographicDivision { | 1085 class GeographicDivision { |
| 1086 /** | 1086 /** |
| 1087 * Any other valid OCD IDs that refer to the same division. For example, if | 1087 * Any other valid OCD IDs that refer to the same division. |
| 1088 * this division's OCD ID is ocd-division/country:us/district:dc, this will | 1088 * |
| 1089 * contain ocd-division/country:us/state:dc. | 1089 * Because OCD IDs are meant to be human-readable and at least somewhat |
| 1090 * predictable, there are occasionally several identifiers for a single |
| 1091 * division. These identifiers are defined to be equivalent to one another, |
| 1092 * and one is always indicated as the primary identifier. The primary |
| 1093 * identifier will be returned in ocd_id above, and any other equivalent valid |
| 1094 * identifiers will be returned in this list. |
| 1095 * |
| 1096 * For example, if this division's OCD ID is |
| 1097 * ocd-division/country:us/district:dc, this will contain |
| 1098 * ocd-division/country:us/state:dc. |
| 1090 */ | 1099 */ |
| 1091 core.List<core.String> alsoKnownAs; | 1100 core.List<core.String> alsoKnownAs; |
| 1092 | 1101 |
| 1093 /** The name of the division. */ | 1102 /** The name of the division. */ |
| 1094 core.String name; | 1103 core.String name; |
| 1095 | 1104 |
| 1096 /** | 1105 /** |
| 1097 * List of keys in the offices object, one for each office elected from this | 1106 * List of keys in the offices object, one for each office elected from this |
| 1098 * division. Will only be present if includeOffices was true (or absent) in | 1107 * division. Will only be present if includeOffices was true (or absent) in |
| 1099 * the request. | 1108 * the request. |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 _json["officialIds"] = officialIds; | 1216 _json["officialIds"] = officialIds; |
| 1208 } | 1217 } |
| 1209 if (sources != null) { | 1218 if (sources != null) { |
| 1210 _json["sources"] = sources.map((value) => (value).toJson()).toList(); | 1219 _json["sources"] = sources.map((value) => (value).toJson()).toList(); |
| 1211 } | 1220 } |
| 1212 return _json; | 1221 return _json; |
| 1213 } | 1222 } |
| 1214 } | 1223 } |
| 1215 | 1224 |
| 1216 | 1225 |
| 1217 /** Information about a official holding an elected office. */ | 1226 /** Information about a person holding an elected office. */ |
| 1218 class Official { | 1227 class Official { |
| 1219 /** Addresses at which to contact the official. */ | 1228 /** Addresses at which to contact the official. */ |
| 1220 core.List<SimpleAddressType> address; | 1229 core.List<SimpleAddressType> address; |
| 1221 | 1230 |
| 1222 /** A list of known (social) media channels for this official. */ | 1231 /** A list of known (social) media channels for this official. */ |
| 1223 core.List<Channel> channels; | 1232 core.List<Channel> channels; |
| 1224 | 1233 |
| 1225 /** The direct email addresses for the official. */ | 1234 /** The direct email addresses for the official. */ |
| 1226 core.List<core.String> emails; | 1235 core.List<core.String> emails; |
| 1227 | 1236 |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1766 _json["state"] = state.map((value) => (value).toJson()).toList(); | 1775 _json["state"] = state.map((value) => (value).toJson()).toList(); |
| 1767 } | 1776 } |
| 1768 if (status != null) { | 1777 if (status != null) { |
| 1769 _json["status"] = status; | 1778 _json["status"] = status; |
| 1770 } | 1779 } |
| 1771 return _json; | 1780 return _json; |
| 1772 } | 1781 } |
| 1773 } | 1782 } |
| 1774 | 1783 |
| 1775 | 1784 |
| OLD | NEW |