on develop help sign in
Regenerating gogol-civicinfo from latest service definition
652ac73Brendan Hay
gen/model/civicinfo/v2/civicinfo-api.json+94−6
@@ -1,14 +1,14 @@
1{
1{
2 "kind": "discovery#restDescription",
2 "kind": "discovery#restDescription",
3− "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ZiNhyAfCE7ZKhbU1KQ-igi1g1zk\"",
3+ "etag": "\"C5oy1hgQsABtYOYIOXWcR3BgYqU/dddQ_XrBtLta7hoQNz6vCsWY1OE\"",
4 "discoveryVersion": "v1",
4 "discoveryVersion": "v1",
5 "id": "civicinfo:v2",
5 "id": "civicinfo:v2",
6 "name": "civicinfo",
6 "name": "civicinfo",
7 "canonicalName": "Civic Info",
7 "canonicalName": "Civic Info",
8 "version": "v2",
8 "version": "v2",
9− "revision": "20150820",
9+ "revision": "20161017",
10 "title": "Google Civic Information API",
10 "title": "Google Civic Information API",
11− "description": "An API for accessing civic information.",
11+ "description": "Provides polling places, early vote locations, contest data, election officials, and government representatives for U.S. residential addresses.",
12 "ownerDomain": "google.com",
12 "ownerDomain": "google.com",
13 "ownerName": "Google",
13 "ownerName": "Google",
14 "icons": {
14 "icons": {
@@ -107,6 +107,12 @@
107 "type": "string",
107 "type": "string",
108 "description": "A URL provided by this administrative body for information on absentee voting."
108 "description": "A URL provided by this administrative body for information on absentee voting."
109 },
109 },
110+ "addressLines": {
111+ "type": "array",
112+ "items": {
113+ "type": "string"
114+ }
115+ },
110 "ballotInfoUrl": {
116 "ballotInfoUrl": {
111 "type": "string",
117 "type": "string",
112 "description": "A URL provided by this administrative body to give contest information to the voter."
118 "description": "A URL provided by this administrative body to give contest information to the voter."
@@ -185,7 +191,7 @@
185 },
191 },
186 "name": {
192 "name": {
187 "type": "string",
193 "type": "string",
188− "description": "The candidate's name."
194+ "description": "The candidate's name. If this is a joint ticket it will indicate the name of the candidate at the top of a ticket followed by a / and that name of candidate at the bottom of the ticket. e.g. \"Mitt Romney / Paul Ryan\""
189 },
195 },
190 "orderOnBallot": {
196 "orderOnBallot": {
191 "type": "string",
197 "type": "string",
@@ -277,7 +283,7 @@
277 },
283 },
278 "referendumBallotResponses": {
284 "referendumBallotResponses": {
279 "type": "array",
285 "type": "array",
280− "description": "The set of ballot responses for the referendum. A ballot response represents a line on the ballot. Common examples might include \"yes\" or \"no\" for referenda, or a judge's name for a retention contest. This field is only populated for contests of type 'Referendum'.",
286+ "description": "The set of ballot responses for the referendum. A ballot response represents a line on the ballot. Common examples might include \"yes\" or \"no\" for referenda. This field is only populated for contests of type 'Referendum'.",
281 "items": {
287 "items": {
282 "type": "string"
288 "type": "string"
283 }
289 }
@@ -338,7 +344,36 @@
338 },
344 },
339 "type": {
345 "type": {
340 "type": "string",
346 "type": "string",
341− "description": "The type of contest. Usually this will be 'General', 'Primary', or 'Run-off' for contests with candidates. For referenda this will be 'Referendum'."
347+ "description": "The type of contest. Usually this will be 'General', 'Primary', or 'Run-off' for contests with candidates. For referenda this will be 'Referendum'. For Retention contests this will typically be 'Retention'."
348+ }
349+ }
350+ },
351+ "ContextParams": {
352+ "id": "ContextParams",
353+ "type": "object",
354+ "properties": {
355+ "clientProfile": {
356+ "type": "string"
357+ }
358+ }
359+ },
360+ "DivisionRepresentativeInfoRequest": {
361+ "id": "DivisionRepresentativeInfoRequest",
362+ "type": "object",
363+ "description": "A request to look up representative information for a single division.",
364+ "properties": {
365+ "contextParams": {
366+ "$ref": "ContextParams"
367+ }
368+ }
369+ },
370+ "DivisionSearchRequest": {
371+ "id": "DivisionSearchRequest",
372+ "type": "object",
373+ "description": "A search request for political geographies.",
374+ "properties": {
375+ "contextParams": {
376+ "$ref": "ContextParams"
342 }
377 }
343 }
378 }
344 },
379 },
@@ -433,6 +468,15 @@
433 }
468 }
434 }
469 }
435 },
470 },
471+ "ElectionsQueryRequest": {
472+ "id": "ElectionsQueryRequest",
473+ "type": "object",
474+ "properties": {
475+ "contextParams": {
476+ "$ref": "ContextParams"
477+ }
478+ }
479+ },
436 "ElectionsQueryResponse": {
480 "ElectionsQueryResponse": {
437 "id": "ElectionsQueryResponse",
481 "id": "ElectionsQueryResponse",
438 "type": "object",
482 "type": "object",
@@ -461,6 +505,9 @@
461 "type": "string",
505 "type": "string",
462 "description": "An identifier for this district, relative to its scope. For example, the 34th State Senate district would have id \"34\" and a scope of stateUpper."
506 "description": "An identifier for this district, relative to its scope. For example, the 34th State Senate district would have id \"34\" and a scope of stateUpper."
463 },
507 },
508+ "kgForeignKey": {
509+ "type": "string"
510+ },
464 "name": {
511 "name": {
465 "type": "string",
512 "type": "string",
466 "description": "The name of the district."
513 "description": "The name of the district."
@@ -669,6 +716,16 @@
669 }
716 }
670 }
717 }
671 },
718 },
719+ "RepresentativeInfoRequest": {
720+ "id": "RepresentativeInfoRequest",
721+ "type": "object",
722+ "description": "A request for political geography and representative information for an address.",
723+ "properties": {
724+ "contextParams": {
725+ "$ref": "ContextParams"
726+ }
727+ }
728+ },
672 "RepresentativeInfoResponse": {
729 "RepresentativeInfoResponse": {
673 "id": "RepresentativeInfoResponse",
730 "id": "RepresentativeInfoResponse",
674 "type": "object",
731 "type": "object",
@@ -757,6 +814,16 @@
757 }
814 }
758 }
815 }
759 },
816 },
817+ "VoterInfoRequest": {
818+ "id": "VoterInfoRequest",
819+ "type": "object",
820+ "description": "A request for information about a voter.",
821+ "properties": {
822+ "contextParams": {
823+ "$ref": "ContextParams"
824+ }
825+ }
826+ },
760 "VoterInfoResponse": {
827 "VoterInfoResponse": {
761 "id": "VoterInfoResponse",
828 "id": "VoterInfoResponse",
762 "type": "object",
829 "type": "object",
@@ -842,6 +909,9 @@
842 "location": "query"
909 "location": "query"
843 }
910 }
844 },
911 },
912+ "request": {
913+ "$ref": "DivisionSearchRequest"
914+ },
845 "response": {
915 "response": {
846 "$ref": "DivisionSearchResponse"
916 "$ref": "DivisionSearchResponse"
847 }
917 }
@@ -855,6 +925,9 @@
855 "path": "elections",
925 "path": "elections",
856 "httpMethod": "GET",
926 "httpMethod": "GET",
857 "description": "List of available elections to query.",
927 "description": "List of available elections to query.",
928+ "request": {
929+ "$ref": "ElectionsQueryRequest"
930+ },
858 "response": {
931 "response": {
859 "$ref": "ElectionsQueryResponse"
932 "$ref": "ElectionsQueryResponse"
860 }
933 }
@@ -883,11 +956,20 @@
883 "description": "If set to true, only data from official state sources will be returned.",
956 "description": "If set to true, only data from official state sources will be returned.",
884 "default": "false",
957 "default": "false",
885 "location": "query"
958 "location": "query"
959+ },
960+ "returnAllAvailableData": {
961+ "type": "boolean",
962+ "description": "If set to true, the query will return the success codeand include any partial information when it is unable to determine a matching address or unable to determine the election for electionId=0 queries.",
963+ "default": "false",
964+ "location": "query"
886 }
965 }
887 },
966 },
888 "parameterOrder": [
967 "parameterOrder": [
889 "address"
968 "address"
890 ],
969 ],
970+ "request": {
971+ "$ref": "VoterInfoRequest"
972+ },
891 "response": {
973 "response": {
892 "$ref": "VoterInfoResponse"
974 "$ref": "VoterInfoResponse"
893 }
975 }
@@ -974,6 +1056,9 @@
974 "location": "query"
1056 "location": "query"
975 }
1057 }
976 },
1058 },
1059+ "request": {
1060+ "$ref": "RepresentativeInfoRequest"
1061+ },
977 "response": {
1062 "response": {
978 "$ref": "RepresentativeInfoResponse"
1063 "$ref": "RepresentativeInfoResponse"
979 }
1064 }
@@ -1059,6 +1144,9 @@
1059 "parameterOrder": [
1144 "parameterOrder": [
1060 "ocdId"
1145 "ocdId"
1061 ],
1146 ],
1147+ "request": {
1148+ "$ref": "DivisionRepresentativeInfoRequest"
1149+ },
1062 "response": {
1150 "response": {
1063 "$ref": "RepresentativeInfoData"
1151 "$ref": "RepresentativeInfoData"
1064 }
1152 }
gogol-civicinfo/gen/Network/Google/CivicInfo.hs+35−1
@@ -13,7 +13,9 @@
13-- Stability : auto-generated
13-- Stability : auto-generated
14-- Portability : non-portable (GHC extensions)
14-- Portability : non-portable (GHC extensions)
15--
15--
16−-- An API for accessing civic information.
16+-- Provides polling places, early vote locations, contest data, election
17+-- officials, and government representatives for U.S. residential
18+-- addresses.
17--
19--
18-- /See:/ <https://developers.google.com/civic-information Google Civic Information API Reference>
20-- /See:/ <https://developers.google.com/civic-information Google Civic Information API Reference>
19module Network.Google.CivicInfo
21module Network.Google.CivicInfo
@@ -114,6 +116,11 @@ module Network.Google.CivicInfo
114 -- ** RepresentativesRepresentativeInfoByDivisionRoles
116 -- ** RepresentativesRepresentativeInfoByDivisionRoles
115 , RepresentativesRepresentativeInfoByDivisionRoles (..)
117 , RepresentativesRepresentativeInfoByDivisionRoles (..)
116
118
119+ -- ** ElectionsQueryRequest
120+ , ElectionsQueryRequest
121+ , electionsQueryRequest
122+ , eqrContextParams
123+
117 -- ** Channel
124 -- ** Channel
118 , Channel
125 , Channel
119 , channel
126 , channel
@@ -144,6 +151,11 @@ module Network.Google.CivicInfo
144 , dsrName
151 , dsrName
145 , dsrOcdId
152 , dsrOcdId
146
153
154+ -- ** DivisionSearchRequest
155+ , DivisionSearchRequest
156+ , divisionSearchRequest
157+ , dsrContextParams
158+
147 -- ** AdministrativeBody
159 -- ** AdministrativeBody
148 , AdministrativeBody
160 , AdministrativeBody
149 , administrativeBody
161 , administrativeBody
@@ -158,9 +170,15 @@ module Network.Google.CivicInfo
158 , abElectionOfficials
170 , abElectionOfficials
159 , abName
171 , abName
160 , abElectionRulesURL
172 , abElectionRulesURL
173+ , abAddressLines
161 , abVoterServices
174 , abVoterServices
162 , abElectionRegistrationURL
175 , abElectionRegistrationURL
163
176
177+ -- ** RepresentativeInfoRequest
178+ , RepresentativeInfoRequest
179+ , representativeInfoRequest
180+ , rirContextParams
181+
164 -- ** Contest
182 -- ** Contest
165 , Contest
183 , Contest
166 , contest
184 , contest
@@ -225,13 +243,24 @@ module Network.Google.CivicInfo
225 , sName
243 , sName
226 , sOfficial
244 , sOfficial
227
245
246+ -- ** DivisionRepresentativeInfoRequest
247+ , DivisionRepresentativeInfoRequest
248+ , divisionRepresentativeInfoRequest
249+ , drirContextParams
250+
228 -- ** ElectoralDistrict
251 -- ** ElectoralDistrict
229 , ElectoralDistrict
252 , ElectoralDistrict
230 , electoralDistrict
253 , electoralDistrict
254+ , edKgForeignKey
231 , edName
255 , edName
232 , edScope
256 , edScope
233 , edId
257 , edId
234
258
259+ -- ** VoterInfoRequest
260+ , VoterInfoRequest
261+ , voterInfoRequest
262+ , virContextParams
263+
235 -- ** SimpleAddressType
264 -- ** SimpleAddressType
236 , SimpleAddressType
265 , SimpleAddressType
237 , simpleAddressType
266 , simpleAddressType
@@ -243,6 +272,11 @@ module Network.Google.CivicInfo
243 , satLine1
272 , satLine1
244 , satLocationName
273 , satLocationName
245
274
275+ -- ** ContextParams
276+ , ContextParams
277+ , contextParams
278+ , cpClientProFile
279+
246 -- ** AdministrationRegion
280 -- ** AdministrationRegion
247 , AdministrationRegion
281 , AdministrationRegion
248 , administrationRegion
282 , administrationRegion
gogol-civicinfo/gen/Network/Google/CivicInfo/Types.hs+32
@@ -90,6 +90,11 @@ module Network.Google.CivicInfo.Types
90 -- * RepresentativesRepresentativeInfoByDivisionRoles
90 -- * RepresentativesRepresentativeInfoByDivisionRoles
91 , RepresentativesRepresentativeInfoByDivisionRoles (..)
91 , RepresentativesRepresentativeInfoByDivisionRoles (..)
92
92
93+ -- * ElectionsQueryRequest
94+ , ElectionsQueryRequest
95+ , electionsQueryRequest
96+ , eqrContextParams
97+
93 -- * Channel
98 -- * Channel
94 , Channel
99 , Channel
95 , channel
100 , channel
@@ -120,6 +125,11 @@ module Network.Google.CivicInfo.Types
120 , dsrName
125 , dsrName
121 , dsrOcdId
126 , dsrOcdId
122
127
128+ -- * DivisionSearchRequest
129+ , DivisionSearchRequest
130+ , divisionSearchRequest
131+ , dsrContextParams
132+
123 -- * AdministrativeBody
133 -- * AdministrativeBody
124 , AdministrativeBody
134 , AdministrativeBody
125 , administrativeBody
135 , administrativeBody
@@ -134,9 +144,15 @@ module Network.Google.CivicInfo.Types
134 , abElectionOfficials
144 , abElectionOfficials
135 , abName
145 , abName
136 , abElectionRulesURL
146 , abElectionRulesURL
147+ , abAddressLines
137 , abVoterServices
148 , abVoterServices
138 , abElectionRegistrationURL
149 , abElectionRegistrationURL
139
150
151+ -- * RepresentativeInfoRequest
152+ , RepresentativeInfoRequest
153+ , representativeInfoRequest
154+ , rirContextParams
155+
140 -- * Contest
156 -- * Contest
141 , Contest
157 , Contest
142 , contest
158 , contest
@@ -201,13 +217,24 @@ module Network.Google.CivicInfo.Types
201 , sName
217 , sName
202 , sOfficial
218 , sOfficial
203
219
220+ -- * DivisionRepresentativeInfoRequest
221+ , DivisionRepresentativeInfoRequest
222+ , divisionRepresentativeInfoRequest
223+ , drirContextParams
224+
204 -- * ElectoralDistrict
225 -- * ElectoralDistrict
205 , ElectoralDistrict
226 , ElectoralDistrict
206 , electoralDistrict
227 , electoralDistrict
228+ , edKgForeignKey
207 , edName
229 , edName
208 , edScope
230 , edScope
209 , edId
231 , edId
210
232
233+ -- * VoterInfoRequest
234+ , VoterInfoRequest
235+ , voterInfoRequest
236+ , virContextParams
237+
211 -- * SimpleAddressType
238 -- * SimpleAddressType
212 , SimpleAddressType
239 , SimpleAddressType
213 , simpleAddressType
240 , simpleAddressType
@@ -219,6 +246,11 @@ module Network.Google.CivicInfo.Types
219 , satLine1
246 , satLine1
220 , satLocationName
247 , satLocationName
221
248
249+ -- * ContextParams
250+ , ContextParams
251+ , contextParams
252+ , cpClientProFile
253+
222 -- * AdministrationRegion
254 -- * AdministrationRegion
223 , AdministrationRegion
255 , AdministrationRegion
224 , administrationRegion
256 , administrationRegion
gogol-civicinfo/gen/Network/Google/CivicInfo/Types/Product.hs+257−10
@@ -519,7 +519,10 @@ cOrderOnBallot
519 (\ s a -> s{_cOrderOnBallot = a})
519 (\ s a -> s{_cOrderOnBallot = a})
520 . mapping _Coerce
520 . mapping _Coerce
521
521
522−-- | The candidate\'s name.
522+-- | The candidate\'s name. If this is a joint ticket it will indicate the
523+-- name of the candidate at the top of a ticket followed by a \/ and that
524+-- name of candidate at the bottom of the ticket. e.g. \"Mitt Romney \/
525+-- Paul Ryan\"
523cName :: Lens' Candidate (Maybe Text)
526cName :: Lens' Candidate (Maybe Text)
524cName = lens _cName (\ s a -> s{_cName = a})
527cName = lens _cName (\ s a -> s{_cName = a})
525
528
@@ -656,6 +659,41 @@ instance ToJSON Office where
656 ("sources" .=) <$> _oSources, ("name" .=) <$> _oName,
659 ("sources" .=) <$> _oSources, ("name" .=) <$> _oName,
657 ("levels" .=) <$> _oLevels])
660 ("levels" .=) <$> _oLevels])
658
661
662+--
663+-- /See:/ 'electionsQueryRequest' smart constructor.
664+newtype ElectionsQueryRequest = ElectionsQueryRequest'
665+ { _eqrContextParams :: Maybe ContextParams
666+ } deriving (Eq,Show,Data,Typeable,Generic)
667+
668+-- | Creates a value of 'ElectionsQueryRequest' with the minimum fields required to make a request.
669+--
670+-- Use one of the following lenses to modify other fields as desired:
671+--
672+-- * 'eqrContextParams'
673+electionsQueryRequest
674+ :: ElectionsQueryRequest
675+electionsQueryRequest =
676+ ElectionsQueryRequest'
677+ { _eqrContextParams = Nothing
678+ }
679+
680+eqrContextParams :: Lens' ElectionsQueryRequest (Maybe ContextParams)
681+eqrContextParams
682+ = lens _eqrContextParams
683+ (\ s a -> s{_eqrContextParams = a})
684+
685+instance FromJSON ElectionsQueryRequest where
686+ parseJSON
687+ = withObject "ElectionsQueryRequest"
688+ (\ o ->
689+ ElectionsQueryRequest' <$> (o .:? "contextParams"))
690+
691+instance ToJSON ElectionsQueryRequest where
692+ toJSON ElectionsQueryRequest'{..}
693+ = object
694+ (catMaybes
695+ [("contextParams" .=) <$> _eqrContextParams])
696+
659-- | A social media or web channel for a candidate.
697-- | A social media or web channel for a candidate.
660--
698--
661-- /See:/ 'channel' smart constructor.
699-- /See:/ 'channel' smart constructor.
@@ -925,6 +963,42 @@ instance ToJSON DivisionSearchResult where
925 ("name" .=) <$> _dsrName,
963 ("name" .=) <$> _dsrName,
926 ("ocdId" .=) <$> _dsrOcdId])
964 ("ocdId" .=) <$> _dsrOcdId])
927
965
966+-- | A search request for political geographies.
967+--
968+-- /See:/ 'divisionSearchRequest' smart constructor.
969+newtype DivisionSearchRequest = DivisionSearchRequest'
970+ { _dsrContextParams :: Maybe ContextParams
971+ } deriving (Eq,Show,Data,Typeable,Generic)
972+
973+-- | Creates a value of 'DivisionSearchRequest' with the minimum fields required to make a request.
974+--
975+-- Use one of the following lenses to modify other fields as desired:
976+--
977+-- * 'dsrContextParams'
978+divisionSearchRequest
979+ :: DivisionSearchRequest
980+divisionSearchRequest =
981+ DivisionSearchRequest'
982+ { _dsrContextParams = Nothing
983+ }
984+
985+dsrContextParams :: Lens' DivisionSearchRequest (Maybe ContextParams)
986+dsrContextParams
987+ = lens _dsrContextParams
988+ (\ s a -> s{_dsrContextParams = a})
989+
990+instance FromJSON DivisionSearchRequest where
991+ parseJSON
992+ = withObject "DivisionSearchRequest"
993+ (\ o ->
994+ DivisionSearchRequest' <$> (o .:? "contextParams"))
995+
996+instance ToJSON DivisionSearchRequest where
997+ toJSON DivisionSearchRequest'{..}
998+ = object
999+ (catMaybes
1000+ [("contextParams" .=) <$> _dsrContextParams])
1001+
928-- | Information about an election administrative body (e.g. County Board of
1002-- | Information about an election administrative body (e.g. County Board of
929-- Elections).
1003-- Elections).
930--
1004--
@@ -941,6 +1015,7 @@ data AdministrativeBody = AdministrativeBody'
941 , _abElectionOfficials :: !(Maybe [ElectionOfficial])
1015 , _abElectionOfficials :: !(Maybe [ElectionOfficial])
942 , _abName :: !(Maybe Text)
1016 , _abName :: !(Maybe Text)
943 , _abElectionRulesURL :: !(Maybe Text)
1017 , _abElectionRulesURL :: !(Maybe Text)
1018+ , _abAddressLines :: !(Maybe [Text])
944 , _abVoterServices :: !(Maybe [Text])
1019 , _abVoterServices :: !(Maybe [Text])
945 , _abElectionRegistrationURL :: !(Maybe Text)
1020 , _abElectionRegistrationURL :: !(Maybe Text)
946 } deriving (Eq,Show,Data,Typeable,Generic)
1021 } deriving (Eq,Show,Data,Typeable,Generic)
@@ -971,6 +1046,8 @@ data AdministrativeBody = AdministrativeBody'
971--
1046--
972-- * 'abElectionRulesURL'
1047-- * 'abElectionRulesURL'
973--
1048--
1049+-- * 'abAddressLines'
1050+--
974-- * 'abVoterServices'
1051-- * 'abVoterServices'
975--
1052--
976-- * 'abElectionRegistrationURL'
1053-- * 'abElectionRegistrationURL'
@@ -989,6 +1066,7 @@ administrativeBody =
989 , _abElectionOfficials = Nothing
1066 , _abElectionOfficials = Nothing
990 , _abName = Nothing
1067 , _abName = Nothing
991 , _abElectionRulesURL = Nothing
1068 , _abElectionRulesURL = Nothing
1069+ , _abAddressLines = Nothing
992 , _abVoterServices = Nothing
1070 , _abVoterServices = Nothing
993 , _abElectionRegistrationURL = Nothing
1071 , _abElectionRegistrationURL = Nothing
994 }
1072 }
@@ -1065,6 +1143,13 @@ abElectionRulesURL
1065 = lens _abElectionRulesURL
1143 = lens _abElectionRulesURL
1066 (\ s a -> s{_abElectionRulesURL = a})
1144 (\ s a -> s{_abElectionRulesURL = a})
1067
1145
1146+abAddressLines :: Lens' AdministrativeBody [Text]
1147+abAddressLines
1148+ = lens _abAddressLines
1149+ (\ s a -> s{_abAddressLines = a})
1150+ . _Default
1151+ . _Coerce
1152+
1068-- | A description of the services this administrative body may provide.
1153-- | A description of the services this administrative body may provide.
1069abVoterServices :: Lens' AdministrativeBody [Text]
1154abVoterServices :: Lens' AdministrativeBody [Text]
1070abVoterServices
1155abVoterServices
@@ -1096,6 +1181,7 @@ instance FromJSON AdministrativeBody where
1096 <*> (o .:? "electionOfficials" .!= mempty)
1181 <*> (o .:? "electionOfficials" .!= mempty)
1097 <*> (o .:? "name")
1182 <*> (o .:? "name")
1098 <*> (o .:? "electionRulesUrl")
1183 <*> (o .:? "electionRulesUrl")
1184+ <*> (o .:? "addressLines" .!= mempty)
1099 <*> (o .:? "voter_services" .!= mempty)
1185 <*> (o .:? "voter_services" .!= mempty)
1100 <*> (o .:? "electionRegistrationUrl"))
1186 <*> (o .:? "electionRegistrationUrl"))
1101
1187
@@ -1118,10 +1204,49 @@ instance ToJSON AdministrativeBody where
1118 ("electionOfficials" .=) <$> _abElectionOfficials,
1204 ("electionOfficials" .=) <$> _abElectionOfficials,
1119 ("name" .=) <$> _abName,
1205 ("name" .=) <$> _abName,
1120 ("electionRulesUrl" .=) <$> _abElectionRulesURL,
1206 ("electionRulesUrl" .=) <$> _abElectionRulesURL,
1207+ ("addressLines" .=) <$> _abAddressLines,
1121 ("voter_services" .=) <$> _abVoterServices,
1208 ("voter_services" .=) <$> _abVoterServices,
1122 ("electionRegistrationUrl" .=) <$>
1209 ("electionRegistrationUrl" .=) <$>
1123 _abElectionRegistrationURL])
1210 _abElectionRegistrationURL])
1124
1211
1212+-- | A request for political geography and representative information for an
1213+-- address.
1214+--
1215+-- /See:/ 'representativeInfoRequest' smart constructor.
1216+newtype RepresentativeInfoRequest = RepresentativeInfoRequest'
1217+ { _rirContextParams :: Maybe ContextParams
1218+ } deriving (Eq,Show,Data,Typeable,Generic)
1219+
1220+-- | Creates a value of 'RepresentativeInfoRequest' with the minimum fields required to make a request.
1221+--
1222+-- Use one of the following lenses to modify other fields as desired:
1223+--
1224+-- * 'rirContextParams'
1225+representativeInfoRequest
1226+ :: RepresentativeInfoRequest
1227+representativeInfoRequest =
1228+ RepresentativeInfoRequest'
1229+ { _rirContextParams = Nothing
1230+ }
1231+
1232+rirContextParams :: Lens' RepresentativeInfoRequest (Maybe ContextParams)
1233+rirContextParams
1234+ = lens _rirContextParams
1235+ (\ s a -> s{_rirContextParams = a})
1236+
1237+instance FromJSON RepresentativeInfoRequest where
1238+ parseJSON
1239+ = withObject "RepresentativeInfoRequest"
1240+ (\ o ->
1241+ RepresentativeInfoRequest' <$>
1242+ (o .:? "contextParams"))
1243+
1244+instance ToJSON RepresentativeInfoRequest where
1245+ toJSON RepresentativeInfoRequest'{..}
1246+ = object
1247+ (catMaybes
1248+ [("contextParams" .=) <$> _rirContextParams])
1249+
1125-- | Information about a contest that appears on a voter\'s ballot.
1250-- | Information about a contest that appears on a voter\'s ballot.
1126--
1251--
1127-- /See:/ 'contest' smart constructor.
1252-- /See:/ 'contest' smart constructor.
@@ -1308,8 +1433,8 @@ conReferendumProStatement
1308
1433
1309-- | The set of ballot responses for the referendum. A ballot response
1434-- | The set of ballot responses for the referendum. A ballot response
1310-- represents a line on the ballot. Common examples might include \"yes\"
1435-- represents a line on the ballot. Common examples might include \"yes\"
1311−-- or \"no\" for referenda, or a judge\'s name for a retention contest.
1312−-- This field is only populated for contests of type \'Referendum\'.
1436+-- or \"no\" for referenda. This field is only populated for contests of
1437+-- type \'Referendum\'.
1313conReferendumBallotResponses :: Lens' Contest [Text]
1438conReferendumBallotResponses :: Lens' Contest [Text]
1314conReferendumBallotResponses
1439conReferendumBallotResponses
1315 = lens _conReferendumBallotResponses
1440 = lens _conReferendumBallotResponses
@@ -1351,7 +1476,8 @@ conId = lens _conId (\ s a -> s{_conId = a})
1351
1476
1352-- | The type of contest. Usually this will be \'General\', \'Primary\', or
1477-- | The type of contest. Usually this will be \'General\', \'Primary\', or
1353-- \'Run-off\' for contests with candidates. For referenda this will be
1478-- \'Run-off\' for contests with candidates. For referenda this will be
1354−-- \'Referendum\'.
1479+-- \'Referendum\'. For Retention contests this will typically be
1480+-- \'Retention\'.
1355conType :: Lens' Contest (Maybe Text)
1481conType :: Lens' Contest (Maybe Text)
1356conType = lens _conType (\ s a -> s{_conType = a})
1482conType = lens _conType (\ s a -> s{_conType = a})
1357
1483
@@ -1750,19 +1876,61 @@ instance ToJSON Source where
1750 [("name" .=) <$> _sName,
1876 [("name" .=) <$> _sName,
1751 ("official" .=) <$> _sOfficial])
1877 ("official" .=) <$> _sOfficial])
1752
1878
1879+-- | A request to look up representative information for a single division.
1880+--
1881+-- /See:/ 'divisionRepresentativeInfoRequest' smart constructor.
1882+newtype DivisionRepresentativeInfoRequest = DivisionRepresentativeInfoRequest'
1883+ { _drirContextParams :: Maybe ContextParams
1884+ } deriving (Eq,Show,Data,Typeable,Generic)
1885+
1886+-- | Creates a value of 'DivisionRepresentativeInfoRequest' with the minimum fields required to make a request.
1887+--
1888+-- Use one of the following lenses to modify other fields as desired:
1889+--
1890+-- * 'drirContextParams'
1891+divisionRepresentativeInfoRequest
1892+ :: DivisionRepresentativeInfoRequest
1893+divisionRepresentativeInfoRequest =
1894+ DivisionRepresentativeInfoRequest'
1895+ { _drirContextParams = Nothing
1896+ }
1897+
1898+drirContextParams :: Lens' DivisionRepresentativeInfoRequest (Maybe ContextParams)
1899+drirContextParams
1900+ = lens _drirContextParams
1901+ (\ s a -> s{_drirContextParams = a})
1902+
1903+instance FromJSON DivisionRepresentativeInfoRequest
1904+ where
1905+ parseJSON
1906+ = withObject "DivisionRepresentativeInfoRequest"
1907+ (\ o ->
1908+ DivisionRepresentativeInfoRequest' <$>
1909+ (o .:? "contextParams"))
1910+
1911+instance ToJSON DivisionRepresentativeInfoRequest
1912+ where
1913+ toJSON DivisionRepresentativeInfoRequest'{..}
1914+ = object
1915+ (catMaybes
1916+ [("contextParams" .=) <$> _drirContextParams])
1917+
1753-- | Describes the geographic scope of a contest.
1918-- | Describes the geographic scope of a contest.
1754--
1919--
1755-- /See:/ 'electoralDistrict' smart constructor.
1920-- /See:/ 'electoralDistrict' smart constructor.
1756data ElectoralDistrict = ElectoralDistrict'
1921data ElectoralDistrict = ElectoralDistrict'
1922+ { _edKgForeignKey :: !(Maybe Text)
1757− { _edName :: !(Maybe Text)
1923+ , _edName :: !(Maybe Text)
1758− , _edScope :: !(Maybe Text)
1924+ , _edScope :: !(Maybe Text)
1759− , _edId :: !(Maybe Text)
1925+ , _edId :: !(Maybe Text)
1760 } deriving (Eq,Show,Data,Typeable,Generic)
1926 } deriving (Eq,Show,Data,Typeable,Generic)
1761
1927
1762-- | Creates a value of 'ElectoralDistrict' with the minimum fields required to make a request.
1928-- | Creates a value of 'ElectoralDistrict' with the minimum fields required to make a request.
1763--
1929--
1764-- Use one of the following lenses to modify other fields as desired:
1930-- Use one of the following lenses to modify other fields as desired:
1765--
1931--
1932+-- * 'edKgForeignKey'
1933+--
1766-- * 'edName'
1934-- * 'edName'
1767--
1935--
1768-- * 'edScope'
1936-- * 'edScope'
@@ -1772,11 +1940,17 @@ electoralDistrict
1772 :: ElectoralDistrict
1940 :: ElectoralDistrict
1773electoralDistrict =
1941electoralDistrict =
1774 ElectoralDistrict'
1942 ElectoralDistrict'
1943+ { _edKgForeignKey = Nothing
1775− { _edName = Nothing
1944+ , _edName = Nothing
1776 , _edScope = Nothing
1945 , _edScope = Nothing
1777 , _edId = Nothing
1946 , _edId = Nothing
1778 }
1947 }
1779
1948
1949+edKgForeignKey :: Lens' ElectoralDistrict (Maybe Text)
1950+edKgForeignKey
1951+ = lens _edKgForeignKey
1952+ (\ s a -> s{_edKgForeignKey = a})
1953+
1780-- | The name of the district.
1954-- | The name of the district.
1781edName :: Lens' ElectoralDistrict (Maybe Text)
1955edName :: Lens' ElectoralDistrict (Maybe Text)
1782edName = lens _edName (\ s a -> s{_edName = a})
1956edName = lens _edName (\ s a -> s{_edName = a})
@@ -1799,15 +1973,54 @@ instance FromJSON ElectoralDistrict where
1799 = withObject "ElectoralDistrict"
1973 = withObject "ElectoralDistrict"
1800 (\ o ->
1974 (\ o ->
1801 ElectoralDistrict' <$>
1975 ElectoralDistrict' <$>
1976+ (o .:? "kgForeignKey") <*> (o .:? "name") <*>
1802− (o .:? "name") <*> (o .:? "scope") <*> (o .:? "id"))
1977+ (o .:? "scope")
1978+ <*> (o .:? "id"))
1803
1979
1804instance ToJSON ElectoralDistrict where
1980instance ToJSON ElectoralDistrict where
1805 toJSON ElectoralDistrict'{..}
1981 toJSON ElectoralDistrict'{..}
1806 = object
1982 = object
1807 (catMaybes
1983 (catMaybes
1984+ [("kgForeignKey" .=) <$> _edKgForeignKey,
1808− [("name" .=) <$> _edName, ("scope" .=) <$> _edScope,
1985+ ("name" .=) <$> _edName, ("scope" .=) <$> _edScope,
1809 ("id" .=) <$> _edId])
1986 ("id" .=) <$> _edId])
1810
1987
1988+-- | A request for information about a voter.
1989+--
1990+-- /See:/ 'voterInfoRequest' smart constructor.
1991+newtype VoterInfoRequest = VoterInfoRequest'
1992+ { _virContextParams :: Maybe ContextParams
1993+ } deriving (Eq,Show,Data,Typeable,Generic)
1994+
1995+-- | Creates a value of 'VoterInfoRequest' with the minimum fields required to make a request.
1996+--
1997+-- Use one of the following lenses to modify other fields as desired:
1998+--
1999+-- * 'virContextParams'
2000+voterInfoRequest
2001+ :: VoterInfoRequest
2002+voterInfoRequest =
2003+ VoterInfoRequest'
2004+ { _virContextParams = Nothing
2005+ }
2006+
2007+virContextParams :: Lens' VoterInfoRequest (Maybe ContextParams)
2008+virContextParams
2009+ = lens _virContextParams
2010+ (\ s a -> s{_virContextParams = a})
2011+
2012+instance FromJSON VoterInfoRequest where
2013+ parseJSON
2014+ = withObject "VoterInfoRequest"
2015+ (\ o ->
2016+ VoterInfoRequest' <$> (o .:? "contextParams"))
2017+
2018+instance ToJSON VoterInfoRequest where
2019+ toJSON VoterInfoRequest'{..}
2020+ = object
2021+ (catMaybes
2022+ [("contextParams" .=) <$> _virContextParams])
2023+
1811-- | A simple representation of an address.
2024-- | A simple representation of an address.
1812--
2025--
1813-- /See:/ 'simpleAddressType' smart constructor.
2026-- /See:/ 'simpleAddressType' smart constructor.
@@ -1903,6 +2116,40 @@ instance ToJSON SimpleAddressType where
1903 ("city" .=) <$> _satCity, ("line1" .=) <$> _satLine1,
2116 ("city" .=) <$> _satCity, ("line1" .=) <$> _satLine1,
1904 ("locationName" .=) <$> _satLocationName])
2117 ("locationName" .=) <$> _satLocationName])
1905
2118
2119+--
2120+-- /See:/ 'contextParams' smart constructor.
2121+newtype ContextParams = ContextParams'
2122+ { _cpClientProFile :: Maybe Text
2123+ } deriving (Eq,Show,Data,Typeable,Generic)
2124+
2125+-- | Creates a value of 'ContextParams' with the minimum fields required to make a request.
2126+--
2127+-- Use one of the following lenses to modify other fields as desired:
2128+--
2129+-- * 'cpClientProFile'
2130+contextParams
2131+ :: ContextParams
2132+contextParams =
2133+ ContextParams'
2134+ { _cpClientProFile = Nothing
2135+ }
2136+
2137+cpClientProFile :: Lens' ContextParams (Maybe Text)
2138+cpClientProFile
2139+ = lens _cpClientProFile
2140+ (\ s a -> s{_cpClientProFile = a})
2141+
2142+instance FromJSON ContextParams where
2143+ parseJSON
2144+ = withObject "ContextParams"
2145+ (\ o -> ContextParams' <$> (o .:? "clientProfile"))
2146+
2147+instance ToJSON ContextParams where
2148+ toJSON ContextParams'{..}
2149+ = object
2150+ (catMaybes
2151+ [("clientProfile" .=) <$> _cpClientProFile])
2152+
1906-- | Describes information about a regional election administrative area.
2153-- | Describes information about a regional election administrative area.
1907--
2154--
1908-- /See:/ 'administrationRegion' smart constructor.
2155-- /See:/ 'administrationRegion' smart constructor.
gogol-civicinfo/gen/Network/Google/Resource/CivicInfo/Divisions/Search.hs+20−7
@@ -33,6 +33,7 @@ module Network.Google.Resource.CivicInfo.Divisions.Search
33 , DivisionsSearch
33 , DivisionsSearch
34
34
35 -- * Request Lenses
35 -- * Request Lenses
36+ , dsPayload
36 , dsQuery
37 , dsQuery
37 ) where
38 ) where
38
39
@@ -47,27 +48,38 @@ type DivisionsSearchResource =
47 "divisions" :>
48 "divisions" :>
48 QueryParam "query" Text :>
49 QueryParam "query" Text :>
49 QueryParam "alt" AltJSON :>
50 QueryParam "alt" AltJSON :>
51+ ReqBody '[JSON] DivisionSearchRequest :>
50− Get '[JSON] DivisionSearchResponse
52+ Get '[JSON] DivisionSearchResponse
51
53
52-- | Searches for political divisions by their natural name or OCD ID.
54-- | Searches for political divisions by their natural name or OCD ID.
53--
55--
54-- /See:/ 'divisionsSearch' smart constructor.
56-- /See:/ 'divisionsSearch' smart constructor.
55−newtype DivisionsSearch = DivisionsSearch'
57+data DivisionsSearch = DivisionsSearch'
58+ { _dsPayload :: !DivisionSearchRequest
56− { _dsQuery :: Maybe Text
59+ , _dsQuery :: !(Maybe Text)
57 } deriving (Eq,Show,Data,Typeable,Generic)
60 } deriving (Eq,Show,Data,Typeable,Generic)
58
61
59-- | Creates a value of 'DivisionsSearch' with the minimum fields required to make a request.
62-- | Creates a value of 'DivisionsSearch' with the minimum fields required to make a request.
60--
63--
61-- Use one of the following lenses to modify other fields as desired:
64-- Use one of the following lenses to modify other fields as desired:
62--
65--
66+-- * 'dsPayload'
67+--
63-- * 'dsQuery'
68-- * 'dsQuery'
64divisionsSearch
69divisionsSearch
70+ :: DivisionSearchRequest -- ^ 'dsPayload'
65− :: DivisionsSearch
71+ -> DivisionsSearch
66−divisionsSearch =
72+divisionsSearch pDsPayload_ =
67 DivisionsSearch'
73 DivisionsSearch'
74+ { _dsPayload = pDsPayload_
68− { _dsQuery = Nothing
75+ , _dsQuery = Nothing
69 }
76 }
70
77
78+-- | Multipart request metadata.
79+dsPayload :: Lens' DivisionsSearch DivisionSearchRequest
80+dsPayload
81+ = lens _dsPayload (\ s a -> s{_dsPayload = a})
82+
71-- | The search query. Queries can cover any parts of a OCD ID or a human
83-- | The search query. Queries can cover any parts of a OCD ID or a human
72-- readable division name. All words given in the query are treated as
84-- readable division name. All words given in the query are treated as
73-- required patterns. In addition to that, most query operators of the
85-- required patterns. In addition to that, most query operators of the
@@ -80,7 +92,8 @@ instance GoogleRequest DivisionsSearch where
80 type Rs DivisionsSearch = DivisionSearchResponse
92 type Rs DivisionsSearch = DivisionSearchResponse
81 type Scopes DivisionsSearch = '[]
93 type Scopes DivisionsSearch = '[]
82 requestClient DivisionsSearch'{..}
94 requestClient DivisionsSearch'{..}
83− = go _dsQuery (Just AltJSON) civicInfoService
95+ = go _dsQuery (Just AltJSON) _dsPayload
96+ civicInfoService
84 where go
97 where go
85 = buildClient
98 = buildClient
86 (Proxy :: Proxy DivisionsSearchResource)
99 (Proxy :: Proxy DivisionsSearchResource)
gogol-civicinfo/gen/Network/Google/Resource/CivicInfo/Elections/ElectionQuery.hs+23−8
@@ -32,6 +32,8 @@ module Network.Google.Resource.CivicInfo.Elections.ElectionQuery
32 , electionsElectionQuery
32 , electionsElectionQuery
33 , ElectionsElectionQuery
33 , ElectionsElectionQuery
34
34
35+ -- * Request Lenses
36+ , eeqPayload
35 ) where
37 ) where
36
38
37import Network.Google.CivicInfo.Types
39import Network.Google.CivicInfo.Types
@@ -44,27 +46,40 @@ type ElectionsElectionQueryResource =
44 "v2" :>
46 "v2" :>
45 "elections" :>
47 "elections" :>
46 QueryParam "alt" AltJSON :>
48 QueryParam "alt" AltJSON :>
49+ ReqBody '[JSON] ElectionsQueryRequest :>
47− Get '[JSON] ElectionsQueryResponse
50+ Get '[JSON] ElectionsQueryResponse
48
51
49-- | List of available elections to query.
52-- | List of available elections to query.
50--
53--
51-- /See:/ 'electionsElectionQuery' smart constructor.
54-- /See:/ 'electionsElectionQuery' smart constructor.
52−data ElectionsElectionQuery =
53− ElectionsElectionQuery'
55+newtype ElectionsElectionQuery = ElectionsElectionQuery'
56+ { _eeqPayload :: ElectionsQueryRequest
54− deriving (Eq,Show,Data,Typeable,Generic)
57+ } deriving (Eq,Show,Data,Typeable,Generic)
55
58
56-- | Creates a value of 'ElectionsElectionQuery' with the minimum fields required to make a request.
59-- | Creates a value of 'ElectionsElectionQuery' with the minimum fields required to make a request.
57--
60--
61+-- Use one of the following lenses to modify other fields as desired:
62+--
63+-- * 'eeqPayload'
58electionsElectionQuery
64electionsElectionQuery
65+ :: ElectionsQueryRequest -- ^ 'eeqPayload'
59− :: ElectionsElectionQuery
66+ -> ElectionsElectionQuery
60−electionsElectionQuery = ElectionsElectionQuery'
67+electionsElectionQuery pEeqPayload_ =
68+ ElectionsElectionQuery'
69+ { _eeqPayload = pEeqPayload_
70+ }
71+
72+-- | Multipart request metadata.
73+eeqPayload :: Lens' ElectionsElectionQuery ElectionsQueryRequest
74+eeqPayload
75+ = lens _eeqPayload (\ s a -> s{_eeqPayload = a})
61
76
62instance GoogleRequest ElectionsElectionQuery where
77instance GoogleRequest ElectionsElectionQuery where
63 type Rs ElectionsElectionQuery =
78 type Rs ElectionsElectionQuery =
64 ElectionsQueryResponse
79 ElectionsQueryResponse
65 type Scopes ElectionsElectionQuery = '[]
80 type Scopes ElectionsElectionQuery = '[]
66− requestClient ElectionsElectionQuery'{}
81+ requestClient ElectionsElectionQuery'{..}
67− = go (Just AltJSON) civicInfoService
82+ = go (Just AltJSON) _eeqPayload civicInfoService
68 where go
83 where go
69 = buildClient
84 = buildClient
70 (Proxy :: Proxy ElectionsElectionQueryResource)
85 (Proxy :: Proxy ElectionsElectionQueryResource)
gogol-civicinfo/gen/Network/Google/Resource/CivicInfo/Elections/VoterInfoQuery.hs+39−10
@@ -34,8 +34,10 @@ module Network.Google.Resource.CivicInfo.Elections.VoterInfoQuery
34 , ElectionsVoterInfoQuery
34 , ElectionsVoterInfoQuery
35
35
36 -- * Request Lenses
36 -- * Request Lenses
37+ , eviqReturnAllAvailableData
37 , eviqElectionId
38 , eviqElectionId
38 , eviqAddress
39 , eviqAddress
40+ , eviqPayload
39 , eviqOfficialOnly
41 , eviqOfficialOnly
40 ) where
42 ) where
41
43
@@ -49,40 +51,59 @@ type ElectionsVoterInfoQueryResource =
49 "v2" :>
51 "v2" :>
50 "voterinfo" :>
52 "voterinfo" :>
51 QueryParam "address" Text :>
53 QueryParam "address" Text :>
54+ QueryParam "returnAllAvailableData" Bool :>
52− QueryParam "electionId" (Textual Int64) :>
55+ QueryParam "electionId" (Textual Int64) :>
53− QueryParam "officialOnly" Bool :>
56+ QueryParam "officialOnly" Bool :>
54− QueryParam "alt" AltJSON :>
57+ QueryParam "alt" AltJSON :>
58+ ReqBody '[JSON] VoterInfoRequest :>
55− Get '[JSON] VoterInfoResponse
59+ Get '[JSON] VoterInfoResponse
56
60
57-- | Looks up information relevant to a voter based on the voter\'s
61-- | Looks up information relevant to a voter based on the voter\'s
58-- registered address.
62-- registered address.
59--
63--
60-- /See:/ 'electionsVoterInfoQuery' smart constructor.
64-- /See:/ 'electionsVoterInfoQuery' smart constructor.
61data ElectionsVoterInfoQuery = ElectionsVoterInfoQuery'
65data ElectionsVoterInfoQuery = ElectionsVoterInfoQuery'
66+ { _eviqReturnAllAvailableData :: !Bool
62− { _eviqElectionId :: !(Textual Int64)
67+ , _eviqElectionId :: !(Textual Int64)
63− , _eviqAddress :: !Text
68+ , _eviqAddress :: !Text
69+ , _eviqPayload :: !VoterInfoRequest
64− , _eviqOfficialOnly :: !Bool
70+ , _eviqOfficialOnly :: !Bool
65 } deriving (Eq,Show,Data,Typeable,Generic)
71 } deriving (Eq,Show,Data,Typeable,Generic)
66
72
67-- | Creates a value of 'ElectionsVoterInfoQuery' with the minimum fields required to make a request.
73-- | Creates a value of 'ElectionsVoterInfoQuery' with the minimum fields required to make a request.
68--
74--
69-- Use one of the following lenses to modify other fields as desired:
75-- Use one of the following lenses to modify other fields as desired:
70--
76--
77+-- * 'eviqReturnAllAvailableData'
78+--
71-- * 'eviqElectionId'
79-- * 'eviqElectionId'
72--
80--
73-- * 'eviqAddress'
81-- * 'eviqAddress'
74--
82--
83+-- * 'eviqPayload'
84+--
75-- * 'eviqOfficialOnly'
85-- * 'eviqOfficialOnly'
76electionsVoterInfoQuery
86electionsVoterInfoQuery
77 :: Text -- ^ 'eviqAddress'
87 :: Text -- ^ 'eviqAddress'
88+ -> VoterInfoRequest -- ^ 'eviqPayload'
78 -> ElectionsVoterInfoQuery
89 -> ElectionsVoterInfoQuery
79−electionsVoterInfoQuery pEviqAddress_ =
90+electionsVoterInfoQuery pEviqAddress_ pEviqPayload_ =
80 ElectionsVoterInfoQuery'
91 ElectionsVoterInfoQuery'
92+ { _eviqReturnAllAvailableData = False
81− { _eviqElectionId = 0
93+ , _eviqElectionId = 0
82 , _eviqAddress = pEviqAddress_
94 , _eviqAddress = pEviqAddress_
95+ , _eviqPayload = pEviqPayload_
83 , _eviqOfficialOnly = False
96 , _eviqOfficialOnly = False
84 }
97 }
85
98
99+-- | If set to true, the query will return the success codeand include any
100+-- partial information when it is unable to determine a matching address or
101+-- unable to determine the election for electionId=0 queries.
102+eviqReturnAllAvailableData :: Lens' ElectionsVoterInfoQuery Bool
103+eviqReturnAllAvailableData
104+ = lens _eviqReturnAllAvailableData
105+ (\ s a -> s{_eviqReturnAllAvailableData = a})
106+
86-- | The unique ID of the election to look up. A list of election IDs can be
107-- | The unique ID of the election to look up. A list of election IDs can be
87-- obtained at
108-- obtained at
88-- https:\/\/www.googleapis.com\/civicinfo\/{version}\/elections
109-- https:\/\/www.googleapis.com\/civicinfo\/{version}\/elections
@@ -97,6 +118,11 @@ eviqAddress :: Lens' ElectionsVoterInfoQuery Text
97eviqAddress
118eviqAddress
98 = lens _eviqAddress (\ s a -> s{_eviqAddress = a})
119 = lens _eviqAddress (\ s a -> s{_eviqAddress = a})
99
120
121+-- | Multipart request metadata.
122+eviqPayload :: Lens' ElectionsVoterInfoQuery VoterInfoRequest
123+eviqPayload
124+ = lens _eviqPayload (\ s a -> s{_eviqPayload = a})
125+
100-- | If set to true, only data from official state sources will be returned.
126-- | If set to true, only data from official state sources will be returned.
101eviqOfficialOnly :: Lens' ElectionsVoterInfoQuery Bool
127eviqOfficialOnly :: Lens' ElectionsVoterInfoQuery Bool
102eviqOfficialOnly
128eviqOfficialOnly
@@ -107,9 +133,12 @@ instance GoogleRequest ElectionsVoterInfoQuery where
107 type Rs ElectionsVoterInfoQuery = VoterInfoResponse
133 type Rs ElectionsVoterInfoQuery = VoterInfoResponse
108 type Scopes ElectionsVoterInfoQuery = '[]
134 type Scopes ElectionsVoterInfoQuery = '[]
109 requestClient ElectionsVoterInfoQuery'{..}
135 requestClient ElectionsVoterInfoQuery'{..}
136+ = go (Just _eviqAddress)
137+ (Just _eviqReturnAllAvailableData)
110− = go (Just _eviqAddress) (Just _eviqElectionId)
138+ (Just _eviqElectionId)
111 (Just _eviqOfficialOnly)
139 (Just _eviqOfficialOnly)
112 (Just AltJSON)
140 (Just AltJSON)
141+ _eviqPayload
113 civicInfoService
142 civicInfoService
114 where go
143 where go
115 = buildClient
144 = buildClient
gogol-civicinfo/gen/Network/Google/Resource/CivicInfo/Representatives/RepresentativeInfoByAddress.hs+16−3
@@ -36,6 +36,7 @@ module Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByAdd
36 -- * Request Lenses
36 -- * Request Lenses
37 , rribaRoles
37 , rribaRoles
38 , rribaAddress
38 , rribaAddress
39+ , rribaPayload
39 , rribaIncludeOffices
40 , rribaIncludeOffices
40 , rribaLevels
41 , rribaLevels
41 ) where
42 ) where
@@ -59,7 +60,8 @@ type RepresentativesRepresentativeInfoByAddressResource
59 RepresentativesRepresentativeInfoByAddressLevels
60 RepresentativesRepresentativeInfoByAddressLevels
60 :>
61 :>
61 QueryParam "alt" AltJSON :>
62 QueryParam "alt" AltJSON :>
63+ ReqBody '[JSON] RepresentativeInfoRequest :>
62− Get '[JSON] RepresentativeInfoResponse
64+ Get '[JSON] RepresentativeInfoResponse
63
65
64-- | Looks up political geography and representative information for a single
66-- | Looks up political geography and representative information for a single
65-- address.
67-- address.
@@ -68,6 +70,7 @@ type RepresentativesRepresentativeInfoByAddressResource
68data RepresentativesRepresentativeInfoByAddress = RepresentativesRepresentativeInfoByAddress'
70data RepresentativesRepresentativeInfoByAddress = RepresentativesRepresentativeInfoByAddress'
69 { _rribaRoles :: !(Maybe [RepresentativesRepresentativeInfoByAddressRoles])
71 { _rribaRoles :: !(Maybe [RepresentativesRepresentativeInfoByAddressRoles])
70 , _rribaAddress :: !(Maybe Text)
72 , _rribaAddress :: !(Maybe Text)
73+ , _rribaPayload :: !RepresentativeInfoRequest
71 , _rribaIncludeOffices :: !Bool
74 , _rribaIncludeOffices :: !Bool
72 , _rribaLevels :: !(Maybe [RepresentativesRepresentativeInfoByAddressLevels])
75 , _rribaLevels :: !(Maybe [RepresentativesRepresentativeInfoByAddressLevels])
73 } deriving (Eq,Show,Data,Typeable,Generic)
76 } deriving (Eq,Show,Data,Typeable,Generic)
@@ -80,15 +83,19 @@ data RepresentativesRepresentativeInfoByAddress = RepresentativesRepresentativeI
80--
83--
81-- * 'rribaAddress'
84-- * 'rribaAddress'
82--
85--
86+-- * 'rribaPayload'
87+--
83-- * 'rribaIncludeOffices'
88-- * 'rribaIncludeOffices'
84--
89--
85-- * 'rribaLevels'
90-- * 'rribaLevels'
86representativesRepresentativeInfoByAddress
91representativesRepresentativeInfoByAddress
92+ :: RepresentativeInfoRequest -- ^ 'rribaPayload'
87− :: RepresentativesRepresentativeInfoByAddress
93+ -> RepresentativesRepresentativeInfoByAddress
88−representativesRepresentativeInfoByAddress =
94+representativesRepresentativeInfoByAddress pRribaPayload_ =
89 RepresentativesRepresentativeInfoByAddress'
95 RepresentativesRepresentativeInfoByAddress'
90 { _rribaRoles = Nothing
96 { _rribaRoles = Nothing
91 , _rribaAddress = Nothing
97 , _rribaAddress = Nothing
98+ , _rribaPayload = pRribaPayload_
92 , _rribaIncludeOffices = True
99 , _rribaIncludeOffices = True
93 , _rribaLevels = Nothing
100 , _rribaLevels = Nothing
94 }
101 }
@@ -108,6 +115,11 @@ rribaAddress :: Lens' RepresentativesRepresentativeInfoByAddress (Maybe Text)
108rribaAddress
115rribaAddress
109 = lens _rribaAddress (\ s a -> s{_rribaAddress = a})
116 = lens _rribaAddress (\ s a -> s{_rribaAddress = a})
110
117
118+-- | Multipart request metadata.
119+rribaPayload :: Lens' RepresentativesRepresentativeInfoByAddress RepresentativeInfoRequest
120+rribaPayload
121+ = lens _rribaPayload (\ s a -> s{_rribaPayload = a})
122+
111-- | Whether to return information about offices and officials. If false,
123-- | Whether to return information about offices and officials. If false,
112-- only the top-level district information will be returned.
124-- only the top-level district information will be returned.
113rribaIncludeOffices :: Lens' RepresentativesRepresentativeInfoByAddress Bool
125rribaIncludeOffices :: Lens' RepresentativesRepresentativeInfoByAddress Bool
@@ -137,6 +149,7 @@ instance GoogleRequest
137 (Just _rribaIncludeOffices)
149 (Just _rribaIncludeOffices)
138 (_rribaLevels ^. _Default)
150 (_rribaLevels ^. _Default)
139 (Just AltJSON)
151 (Just AltJSON)
152+ _rribaPayload
140 civicInfoService
153 civicInfoService
141 where go
154 where go
142 = buildClient
155 = buildClient
gogol-civicinfo/gen/Network/Google/Resource/CivicInfo/Representatives/RepresentativeInfoByDivision.hs+16−3
@@ -34,6 +34,7 @@ module Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByDiv
34
34
35 -- * Request Lenses
35 -- * Request Lenses
36 , rribdRoles
36 , rribdRoles
37+ , rribdPayload
37 , rribdRecursive
38 , rribdRecursive
38 , rribdOcdId
39 , rribdOcdId
39 , rribdLevels
40 , rribdLevels
@@ -58,13 +59,15 @@ type RepresentativesRepresentativeInfoByDivisionResource
58 RepresentativesRepresentativeInfoByDivisionLevels
59 RepresentativesRepresentativeInfoByDivisionLevels
59 :>
60 :>
60 QueryParam "alt" AltJSON :>
61 QueryParam "alt" AltJSON :>
62+ ReqBody '[JSON] DivisionRepresentativeInfoRequest :>
61− Get '[JSON] RepresentativeInfoData
63+ Get '[JSON] RepresentativeInfoData
62
64
63-- | Looks up representative information for a single geographic division.
65-- | Looks up representative information for a single geographic division.
64--
66--
65-- /See:/ 'representativesRepresentativeInfoByDivision' smart constructor.
67-- /See:/ 'representativesRepresentativeInfoByDivision' smart constructor.
66data RepresentativesRepresentativeInfoByDivision = RepresentativesRepresentativeInfoByDivision'
68data RepresentativesRepresentativeInfoByDivision = RepresentativesRepresentativeInfoByDivision'
67 { _rribdRoles :: !(Maybe [RepresentativesRepresentativeInfoByDivisionRoles])
69 { _rribdRoles :: !(Maybe [RepresentativesRepresentativeInfoByDivisionRoles])
70+ , _rribdPayload :: !DivisionRepresentativeInfoRequest
68 , _rribdRecursive :: !(Maybe Bool)
71 , _rribdRecursive :: !(Maybe Bool)
69 , _rribdOcdId :: !Text
72 , _rribdOcdId :: !Text
70 , _rribdLevels :: !(Maybe [RepresentativesRepresentativeInfoByDivisionLevels])
73 , _rribdLevels :: !(Maybe [RepresentativesRepresentativeInfoByDivisionLevels])
@@ -76,17 +79,21 @@ data RepresentativesRepresentativeInfoByDivision = RepresentativesRepresentative
76--
79--
77-- * 'rribdRoles'
80-- * 'rribdRoles'
78--
81--
82+-- * 'rribdPayload'
83+--
79-- * 'rribdRecursive'
84-- * 'rribdRecursive'
80--
85--
81-- * 'rribdOcdId'
86-- * 'rribdOcdId'
82--
87--
83-- * 'rribdLevels'
88-- * 'rribdLevels'
84representativesRepresentativeInfoByDivision
89representativesRepresentativeInfoByDivision
90+ :: DivisionRepresentativeInfoRequest -- ^ 'rribdPayload'
85− :: Text -- ^ 'rribdOcdId'
91+ -> Text -- ^ 'rribdOcdId'
86 -> RepresentativesRepresentativeInfoByDivision
92 -> RepresentativesRepresentativeInfoByDivision
87−representativesRepresentativeInfoByDivision pRribdOcdId_ =
93+representativesRepresentativeInfoByDivision pRribdPayload_ pRribdOcdId_ =
88 RepresentativesRepresentativeInfoByDivision'
94 RepresentativesRepresentativeInfoByDivision'
89 { _rribdRoles = Nothing
95 { _rribdRoles = Nothing
96+ , _rribdPayload = pRribdPayload_
90 , _rribdRecursive = Nothing
97 , _rribdRecursive = Nothing
91 , _rribdOcdId = pRribdOcdId_
98 , _rribdOcdId = pRribdOcdId_
92 , _rribdLevels = Nothing
99 , _rribdLevels = Nothing
@@ -101,6 +108,11 @@ rribdRoles
101 _Default
108 _Default
102 . _Coerce
109 . _Coerce
103
110
111+-- | Multipart request metadata.
112+rribdPayload :: Lens' RepresentativesRepresentativeInfoByDivision DivisionRepresentativeInfoRequest
113+rribdPayload
114+ = lens _rribdPayload (\ s a -> s{_rribdPayload = a})
115+
104-- | If true, information about all divisions contained in the division
116-- | If true, information about all divisions contained in the division
105-- requested will be included as well. For example, if querying
117-- requested will be included as well. For example, if querying
106-- ocd-division\/country:us\/district:dc, this would also return all DC\'s
118-- ocd-division\/country:us\/district:dc, this would also return all DC\'s
@@ -137,6 +149,7 @@ instance GoogleRequest
137 _rribdRecursive
149 _rribdRecursive
138 (_rribdLevels ^. _Default)
150 (_rribdLevels ^. _Default)
139 (Just AltJSON)
151 (Just AltJSON)
152+ _rribdPayload
140 civicInfoService
153 civicInfoService
141 where go
154 where go
142 = buildClient
155 = buildClient
gogol-civicinfo/gogol-civicinfo.cabal+3−1
@@ -14,7 +14,9 @@ cabal-version: >= 1.10
14extra-source-files: README.md
14extra-source-files: README.md
15
15
16description:
16description:
17− An API for accessing civic information.
17+ Provides polling places, early vote locations, contest data, election
18+ officials, and government representatives for U.S. residential
19+ addresses.
18 .
20 .
19 /Warning:/ This is an experimental prototype/preview release which is still
21 /Warning:/ This is an experimental prototype/preview release which is still
20 under exploratory development and not intended for public use, caveat emptor!
22 under exploratory development and not intended for public use, caveat emptor!