on develop help sign in
Regenerating gogol-civicinfo from latest service definition
commit652ac73b11e65445a95f58474a726793e49b69ca authorBrendan Hay <brendan.g.hay@gmail.com> dateTue 25 Oct 2016, 11:37 (10 years ago) parent5a936ce
10 files changed+535−49
gen/model/civicinfo/v2/civicinfo-api.json+94−6 gogol-civicinfo/gen/Network/Google/CivicInfo.hs+35−1 gogol-civicinfo/gen/Network/Google/CivicInfo/Types.hs+32 gogol-civicinfo/gen/Network/Google/CivicInfo/Types/Product.hs+257−10 gogol-civicinfo/gen/Network/Google/Resource/CivicInfo/Divisions/Search.hs+20−7 gogol-civicinfo/gen/Network/Google/Resource/CivicInfo/Elections/ElectionQuery.hs+23−8 gogol-civicinfo/gen/Network/Google/Resource/CivicInfo/Elections/VoterInfoQuery.hs+39−10 gogol-civicinfo/gen/Network/Google/Resource/CivicInfo/Representatives/RepresentativeInfoByAddress.hs+16−3 gogol-civicinfo/gen/Network/Google/Resource/CivicInfo/Representatives/RepresentativeInfoByDivision.hs+16−3 gogol-civicinfo/gogol-civicinfo.cabal+3−1
gen/model/civicinfo/v2/civicinfo-api.json+94−6
@@ -1,14 +1,14 @@
11{
22 "kind": "discovery#restDescription",
3− "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ZiNhyAfCE7ZKhbU1KQ-igi1g1zk\"",
3+ "etag": "\"C5oy1hgQsABtYOYIOXWcR3BgYqU/dddQ_XrBtLta7hoQNz6vCsWY1OE\"",
44 "discoveryVersion": "v1",
55 "id": "civicinfo:v2",
66 "name": "civicinfo",
77 "canonicalName": "Civic Info",
88 "version": "v2",
9− "revision": "20150820",
9+ "revision": "20161017",
1010 "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.",
1212 "ownerDomain": "google.com",
1313 "ownerName": "Google",
1414 "icons": {
@@ -107,6 +107,12 @@
107107 "type": "string",
108108 "description": "A URL provided by this administrative body for information on absentee voting."
109109 },
110+ "addressLines": {
111+ "type": "array",
112+ "items": {
113+ "type": "string"
114+ }
115+ },
110116 "ballotInfoUrl": {
111117 "type": "string",
112118 "description": "A URL provided by this administrative body to give contest information to the voter."
@@ -185,7 +191,7 @@
185191 },
186192 "name": {
187193 "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\""
189195 },
190196 "orderOnBallot": {
191197 "type": "string",
@@ -277,7 +283,7 @@
277283 },
278284 "referendumBallotResponses": {
279285 "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'.",
281287 "items": {
282288 "type": "string"
283289 }
@@ -338,7 +344,36 @@
338344 },
339345 "type": {
340346 "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"
342377 }
343378 }
344379 },
@@ -433,6 +468,15 @@
433468 }
434469 }
435470 },
471+ "ElectionsQueryRequest": {
472+ "id": "ElectionsQueryRequest",
473+ "type": "object",
474+ "properties": {
475+ "contextParams": {
476+ "$ref": "ContextParams"
477+ }
478+ }
479+ },
436480 "ElectionsQueryResponse": {
437481 "id": "ElectionsQueryResponse",
438482 "type": "object",
@@ -461,6 +505,9 @@
461505 "type": "string",
462506 "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."
463507 },
508+ "kgForeignKey": {
509+ "type": "string"
510+ },
464511 "name": {
465512 "type": "string",
466513 "description": "The name of the district."
@@ -669,6 +716,16 @@
669716 }
670717 }
671718 },
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+ },
672729 "RepresentativeInfoResponse": {
673730 "id": "RepresentativeInfoResponse",
674731 "type": "object",
@@ -757,6 +814,16 @@
757814 }
758815 }
759816 },
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+ },
760827 "VoterInfoResponse": {
761828 "id": "VoterInfoResponse",
762829 "type": "object",
@@ -842,6 +909,9 @@
842909 "location": "query"
843910 }
844911 },
912+ "request": {
913+ "$ref": "DivisionSearchRequest"
914+ },
845915 "response": {
846916 "$ref": "DivisionSearchResponse"
847917 }
@@ -855,6 +925,9 @@
855925 "path": "elections",
856926 "httpMethod": "GET",
857927 "description": "List of available elections to query.",
928+ "request": {
929+ "$ref": "ElectionsQueryRequest"
930+ },
858931 "response": {
859932 "$ref": "ElectionsQueryResponse"
860933 }
@@ -883,11 +956,20 @@
883956 "description": "If set to true, only data from official state sources will be returned.",
884957 "default": "false",
885958 "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"
886965 }
887966 },
888967 "parameterOrder": [
889968 "address"
890969 ],
970+ "request": {
971+ "$ref": "VoterInfoRequest"
972+ },
891973 "response": {
892974 "$ref": "VoterInfoResponse"
893975 }
@@ -974,6 +1056,9 @@
9741056 "location": "query"
9751057 }
9761058 },
1059+ "request": {
1060+ "$ref": "RepresentativeInfoRequest"
1061+ },
9771062 "response": {
9781063 "$ref": "RepresentativeInfoResponse"
9791064 }
@@ -1059,6 +1144,9 @@
10591144 "parameterOrder": [
10601145 "ocdId"
10611146 ],
1147+ "request": {
1148+ "$ref": "DivisionRepresentativeInfoRequest"
1149+ },
10621150 "response": {
10631151 "$ref": "RepresentativeInfoData"
10641152 }
gogol-civicinfo/gen/Network/Google/CivicInfo.hs+35−1
@@ -13,7 +13,9 @@
1313-- Stability : auto-generated
1414-- Portability : non-portable (GHC extensions)
1515--
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.
1719--
1820-- /See:/ <https://developers.google.com/civic-information Google Civic Information API Reference>
1921module Network.Google.CivicInfo
@@ -114,6 +116,11 @@ module Network.Google.CivicInfo
114116 -- ** RepresentativesRepresentativeInfoByDivisionRoles
115117 , RepresentativesRepresentativeInfoByDivisionRoles (..)
116118
119+ -- ** ElectionsQueryRequest
120+ , ElectionsQueryRequest
121+ , electionsQueryRequest
122+ , eqrContextParams
123+
117124 -- ** Channel
118125 , Channel
119126 , channel
@@ -144,6 +151,11 @@ module Network.Google.CivicInfo
144151 , dsrName
145152 , dsrOcdId
146153
154+ -- ** DivisionSearchRequest
155+ , DivisionSearchRequest
156+ , divisionSearchRequest
157+ , dsrContextParams
158+
147159 -- ** AdministrativeBody
148160 , AdministrativeBody
149161 , administrativeBody
@@ -158,9 +170,15 @@ module Network.Google.CivicInfo
158170 , abElectionOfficials
159171 , abName
160172 , abElectionRulesURL
173+ , abAddressLines
161174 , abVoterServices
162175 , abElectionRegistrationURL
163176
177+ -- ** RepresentativeInfoRequest
178+ , RepresentativeInfoRequest
179+ , representativeInfoRequest
180+ , rirContextParams
181+
164182 -- ** Contest
165183 , Contest
166184 , contest
@@ -225,13 +243,24 @@ module Network.Google.CivicInfo
225243 , sName
226244 , sOfficial
227245
246+ -- ** DivisionRepresentativeInfoRequest
247+ , DivisionRepresentativeInfoRequest
248+ , divisionRepresentativeInfoRequest
249+ , drirContextParams
250+
228251 -- ** ElectoralDistrict
229252 , ElectoralDistrict
230253 , electoralDistrict
254+ , edKgForeignKey
231255 , edName
232256 , edScope
233257 , edId
234258
259+ -- ** VoterInfoRequest
260+ , VoterInfoRequest
261+ , voterInfoRequest
262+ , virContextParams
263+
235264 -- ** SimpleAddressType
236265 , SimpleAddressType
237266 , simpleAddressType
@@ -243,6 +272,11 @@ module Network.Google.CivicInfo
243272 , satLine1
244273 , satLocationName
245274
275+ -- ** ContextParams
276+ , ContextParams
277+ , contextParams
278+ , cpClientProFile
279+
246280 -- ** AdministrationRegion
247281 , AdministrationRegion
248282 , administrationRegion
gogol-civicinfo/gen/Network/Google/CivicInfo/Types.hs+32
@@ -90,6 +90,11 @@ module Network.Google.CivicInfo.Types
9090 -- * RepresentativesRepresentativeInfoByDivisionRoles
9191 , RepresentativesRepresentativeInfoByDivisionRoles (..)
9292
93+ -- * ElectionsQueryRequest
94+ , ElectionsQueryRequest
95+ , electionsQueryRequest
96+ , eqrContextParams
97+
9398 -- * Channel
9499 , Channel
95100 , channel
@@ -120,6 +125,11 @@ module Network.Google.CivicInfo.Types
120125 , dsrName
121126 , dsrOcdId
122127
128+ -- * DivisionSearchRequest
129+ , DivisionSearchRequest
130+ , divisionSearchRequest
131+ , dsrContextParams
132+
123133 -- * AdministrativeBody
124134 , AdministrativeBody
125135 , administrativeBody
@@ -134,9 +144,15 @@ module Network.Google.CivicInfo.Types
134144 , abElectionOfficials
135145 , abName
136146 , abElectionRulesURL
147+ , abAddressLines
137148 , abVoterServices
138149 , abElectionRegistrationURL
139150
151+ -- * RepresentativeInfoRequest
152+ , RepresentativeInfoRequest
153+ , representativeInfoRequest
154+ , rirContextParams
155+
140156 -- * Contest
141157 , Contest
142158 , contest
@@ -201,13 +217,24 @@ module Network.Google.CivicInfo.Types
201217 , sName
202218 , sOfficial
203219
220+ -- * DivisionRepresentativeInfoRequest
221+ , DivisionRepresentativeInfoRequest
222+ , divisionRepresentativeInfoRequest
223+ , drirContextParams
224+
204225 -- * ElectoralDistrict
205226 , ElectoralDistrict
206227 , electoralDistrict
228+ , edKgForeignKey
207229 , edName
208230 , edScope
209231 , edId
210232
233+ -- * VoterInfoRequest
234+ , VoterInfoRequest
235+ , voterInfoRequest
236+ , virContextParams
237+
211238 -- * SimpleAddressType
212239 , SimpleAddressType
213240 , simpleAddressType
@@ -219,6 +246,11 @@ module Network.Google.CivicInfo.Types
219246 , satLine1
220247 , satLocationName
221248
249+ -- * ContextParams
250+ , ContextParams
251+ , contextParams
252+ , cpClientProFile
253+
222254 -- * AdministrationRegion
223255 , AdministrationRegion
224256 , administrationRegion
gogol-civicinfo/gen/Network/Google/CivicInfo/Types/Product.hs+257−10
@@ -519,7 +519,10 @@ cOrderOnBallot
519519 (\ s a -> s{_cOrderOnBallot = a})
520520 . mapping _Coerce
521521
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\"
523526cName :: Lens' Candidate (Maybe Text)
524527cName = lens _cName (\ s a -> s{_cName = a})
525528
@@ -656,6 +659,41 @@ instance ToJSON Office where
656659 ("sources" .=) <$> _oSources, ("name" .=) <$> _oName,
657660 ("levels" .=) <$> _oLevels])
658661
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+
659697-- | A social media or web channel for a candidate.
660698--
661699-- /See:/ 'channel' smart constructor.
@@ -925,6 +963,42 @@ instance ToJSON DivisionSearchResult where
925963 ("name" .=) <$> _dsrName,
926964 ("ocdId" .=) <$> _dsrOcdId])
927965
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+
9281002-- | Information about an election administrative body (e.g. County Board of
9291003-- Elections).
9301004--
@@ -941,6 +1015,7 @@ data AdministrativeBody = AdministrativeBody'
9411015 , _abElectionOfficials :: !(Maybe [ElectionOfficial])
9421016 , _abName :: !(Maybe Text)
9431017 , _abElectionRulesURL :: !(Maybe Text)
1018+ , _abAddressLines :: !(Maybe [Text])
9441019 , _abVoterServices :: !(Maybe [Text])
9451020 , _abElectionRegistrationURL :: !(Maybe Text)
9461021 } deriving (Eq,Show,Data,Typeable,Generic)
@@ -971,6 +1046,8 @@ data AdministrativeBody = AdministrativeBody'
9711046--
9721047-- * 'abElectionRulesURL'
9731048--
1049+-- * 'abAddressLines'
1050+--
9741051-- * 'abVoterServices'
9751052--
9761053-- * 'abElectionRegistrationURL'
@@ -989,6 +1066,7 @@ administrativeBody =
9891066 , _abElectionOfficials = Nothing
9901067 , _abName = Nothing
9911068 , _abElectionRulesURL = Nothing
1069+ , _abAddressLines = Nothing
9921070 , _abVoterServices = Nothing
9931071 , _abElectionRegistrationURL = Nothing
9941072 }
@@ -1065,6 +1143,13 @@ abElectionRulesURL
10651143 = lens _abElectionRulesURL
10661144 (\ s a -> s{_abElectionRulesURL = a})
10671145
1146+abAddressLines :: Lens' AdministrativeBody [Text]
1147+abAddressLines
1148+ = lens _abAddressLines
1149+ (\ s a -> s{_abAddressLines = a})
1150+ . _Default
1151+ . _Coerce
1152+
10681153-- | A description of the services this administrative body may provide.
10691154abVoterServices :: Lens' AdministrativeBody [Text]
10701155abVoterServices
@@ -1096,6 +1181,7 @@ instance FromJSON AdministrativeBody where
10961181 <*> (o .:? "electionOfficials" .!= mempty)
10971182 <*> (o .:? "name")
10981183 <*> (o .:? "electionRulesUrl")
1184+ <*> (o .:? "addressLines" .!= mempty)
10991185 <*> (o .:? "voter_services" .!= mempty)
11001186 <*> (o .:? "electionRegistrationUrl"))
11011187
@@ -1118,10 +1204,49 @@ instance ToJSON AdministrativeBody where
11181204 ("electionOfficials" .=) <$> _abElectionOfficials,
11191205 ("name" .=) <$> _abName,
11201206 ("electionRulesUrl" .=) <$> _abElectionRulesURL,
1207+ ("addressLines" .=) <$> _abAddressLines,
11211208 ("voter_services" .=) <$> _abVoterServices,
11221209 ("electionRegistrationUrl" .=) <$>
11231210 _abElectionRegistrationURL])
11241211
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+
11251250-- | Information about a contest that appears on a voter\'s ballot.
11261251--
11271252-- /See:/ 'contest' smart constructor.
@@ -1308,8 +1433,8 @@ conReferendumProStatement
13081433
13091434-- | The set of ballot responses for the referendum. A ballot response
13101435-- 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\'.
13131438conReferendumBallotResponses :: Lens' Contest [Text]
13141439conReferendumBallotResponses
13151440 = lens _conReferendumBallotResponses
@@ -1351,7 +1476,8 @@ conId = lens _conId (\ s a -> s{_conId = a})
13511476
13521477-- | The type of contest. Usually this will be \'General\', \'Primary\', or
13531478-- \'Run-off\' for contests with candidates. For referenda this will be
1354−-- \'Referendum\'.
1479+-- \'Referendum\'. For Retention contests this will typically be
1480+-- \'Retention\'.
13551481conType :: Lens' Contest (Maybe Text)
13561482conType = lens _conType (\ s a -> s{_conType = a})
13571483
@@ -1750,19 +1876,61 @@ instance ToJSON Source where
17501876 [("name" .=) <$> _sName,
17511877 ("official" .=) <$> _sOfficial])
17521878
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+
17531918-- | Describes the geographic scope of a contest.
17541919--
17551920-- /See:/ 'electoralDistrict' smart constructor.
17561921data ElectoralDistrict = ElectoralDistrict'
1757− { _edName :: !(Maybe Text)
1758− , _edScope :: !(Maybe Text)
1759− , _edId :: !(Maybe Text)
1922+ { _edKgForeignKey :: !(Maybe Text)
1923+ , _edName :: !(Maybe Text)
1924+ , _edScope :: !(Maybe Text)
1925+ , _edId :: !(Maybe Text)
17601926 } deriving (Eq,Show,Data,Typeable,Generic)
17611927
17621928-- | Creates a value of 'ElectoralDistrict' with the minimum fields required to make a request.
17631929--
17641930-- Use one of the following lenses to modify other fields as desired:
17651931--
1932+-- * 'edKgForeignKey'
1933+--
17661934-- * 'edName'
17671935--
17681936-- * 'edScope'
@@ -1772,11 +1940,17 @@ electoralDistrict
17721940 :: ElectoralDistrict
17731941electoralDistrict =
17741942 ElectoralDistrict'
1775− { _edName = Nothing
1943+ { _edKgForeignKey = Nothing
1944+ , _edName = Nothing
17761945 , _edScope = Nothing
17771946 , _edId = Nothing
17781947 }
17791948
1949+edKgForeignKey :: Lens' ElectoralDistrict (Maybe Text)
1950+edKgForeignKey
1951+ = lens _edKgForeignKey
1952+ (\ s a -> s{_edKgForeignKey = a})
1953+
17801954-- | The name of the district.
17811955edName :: Lens' ElectoralDistrict (Maybe Text)
17821956edName = lens _edName (\ s a -> s{_edName = a})
@@ -1799,15 +1973,54 @@ instance FromJSON ElectoralDistrict where
17991973 = withObject "ElectoralDistrict"
18001974 (\ o ->
18011975 ElectoralDistrict' <$>
1802− (o .:? "name") <*> (o .:? "scope") <*> (o .:? "id"))
1976+ (o .:? "kgForeignKey") <*> (o .:? "name") <*>
1977+ (o .:? "scope")
1978+ <*> (o .:? "id"))
18031979
18041980instance ToJSON ElectoralDistrict where
18051981 toJSON ElectoralDistrict'{..}
18061982 = object
18071983 (catMaybes
1808− [("name" .=) <$> _edName, ("scope" .=) <$> _edScope,
1984+ [("kgForeignKey" .=) <$> _edKgForeignKey,
1985+ ("name" .=) <$> _edName, ("scope" .=) <$> _edScope,
18091986 ("id" .=) <$> _edId])
18101987
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+
18112024-- | A simple representation of an address.
18122025--
18132026-- /See:/ 'simpleAddressType' smart constructor.
@@ -1903,6 +2116,40 @@ instance ToJSON SimpleAddressType where
19032116 ("city" .=) <$> _satCity, ("line1" .=) <$> _satLine1,
19042117 ("locationName" .=) <$> _satLocationName])
19052118
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+
19062153-- | Describes information about a regional election administrative area.
19072154--
19082155-- /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
3333 , DivisionsSearch
3434
3535 -- * Request Lenses
36+ , dsPayload
3637 , dsQuery
3738 ) where
3839
@@ -47,27 +48,38 @@ type DivisionsSearchResource =
4748 "divisions" :>
4849 QueryParam "query" Text :>
4950 QueryParam "alt" AltJSON :>
50− Get '[JSON] DivisionSearchResponse
51+ ReqBody '[JSON] DivisionSearchRequest :>
52+ Get '[JSON] DivisionSearchResponse
5153
5254-- | Searches for political divisions by their natural name or OCD ID.
5355--
5456-- /See:/ 'divisionsSearch' smart constructor.
55−newtype DivisionsSearch = DivisionsSearch'
56− { _dsQuery :: Maybe Text
57+data DivisionsSearch = DivisionsSearch'
58+ { _dsPayload :: !DivisionSearchRequest
59+ , _dsQuery :: !(Maybe Text)
5760 } deriving (Eq,Show,Data,Typeable,Generic)
5861
5962-- | Creates a value of 'DivisionsSearch' with the minimum fields required to make a request.
6063--
6164-- Use one of the following lenses to modify other fields as desired:
6265--
66+-- * 'dsPayload'
67+--
6368-- * 'dsQuery'
6469divisionsSearch
65− :: DivisionsSearch
66−divisionsSearch =
70+ :: DivisionSearchRequest -- ^ 'dsPayload'
71+ -> DivisionsSearch
72+divisionsSearch pDsPayload_ =
6773 DivisionsSearch'
68− { _dsQuery = Nothing
74+ { _dsPayload = pDsPayload_
75+ , _dsQuery = Nothing
6976 }
7077
78+-- | Multipart request metadata.
79+dsPayload :: Lens' DivisionsSearch DivisionSearchRequest
80+dsPayload
81+ = lens _dsPayload (\ s a -> s{_dsPayload = a})
82+
7183-- | The search query. Queries can cover any parts of a OCD ID or a human
7284-- readable division name. All words given in the query are treated as
7385-- required patterns. In addition to that, most query operators of the
@@ -80,7 +92,8 @@ instance GoogleRequest DivisionsSearch where
8092 type Rs DivisionsSearch = DivisionSearchResponse
8193 type Scopes DivisionsSearch = '[]
8294 requestClient DivisionsSearch'{..}
83− = go _dsQuery (Just AltJSON) civicInfoService
95+ = go _dsQuery (Just AltJSON) _dsPayload
96+ civicInfoService
8497 where go
8598 = buildClient
8699 (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
3232 , electionsElectionQuery
3333 , ElectionsElectionQuery
3434
35+ -- * Request Lenses
36+ , eeqPayload
3537 ) where
3638
3739import Network.Google.CivicInfo.Types
@@ -44,27 +46,40 @@ type ElectionsElectionQueryResource =
4446 "v2" :>
4547 "elections" :>
4648 QueryParam "alt" AltJSON :>
47− Get '[JSON] ElectionsQueryResponse
49+ ReqBody '[JSON] ElectionsQueryRequest :>
50+ Get '[JSON] ElectionsQueryResponse
4851
4952-- | List of available elections to query.
5053--
5154-- /See:/ 'electionsElectionQuery' smart constructor.
52−data ElectionsElectionQuery =
53− ElectionsElectionQuery'
54− deriving (Eq,Show,Data,Typeable,Generic)
55+newtype ElectionsElectionQuery = ElectionsElectionQuery'
56+ { _eeqPayload :: ElectionsQueryRequest
57+ } deriving (Eq,Show,Data,Typeable,Generic)
5558
5659-- | Creates a value of 'ElectionsElectionQuery' with the minimum fields required to make a request.
5760--
61+-- Use one of the following lenses to modify other fields as desired:
62+--
63+-- * 'eeqPayload'
5864electionsElectionQuery
59− :: ElectionsElectionQuery
60−electionsElectionQuery = ElectionsElectionQuery'
65+ :: ElectionsQueryRequest -- ^ 'eeqPayload'
66+ -> 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})
6176
6277instance GoogleRequest ElectionsElectionQuery where
6378 type Rs ElectionsElectionQuery =
6479 ElectionsQueryResponse
6580 type Scopes ElectionsElectionQuery = '[]
66− requestClient ElectionsElectionQuery'{}
67− = go (Just AltJSON) civicInfoService
81+ requestClient ElectionsElectionQuery'{..}
82+ = go (Just AltJSON) _eeqPayload civicInfoService
6883 where go
6984 = buildClient
7085 (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
3434 , ElectionsVoterInfoQuery
3535
3636 -- * Request Lenses
37+ , eviqReturnAllAvailableData
3738 , eviqElectionId
3839 , eviqAddress
40+ , eviqPayload
3941 , eviqOfficialOnly
4042 ) where
4143
@@ -49,40 +51,59 @@ type ElectionsVoterInfoQueryResource =
4951 "v2" :>
5052 "voterinfo" :>
5153 QueryParam "address" Text :>
52− QueryParam "electionId" (Textual Int64) :>
53− QueryParam "officialOnly" Bool :>
54− QueryParam "alt" AltJSON :>
55− Get '[JSON] VoterInfoResponse
54+ QueryParam "returnAllAvailableData" Bool :>
55+ QueryParam "electionId" (Textual Int64) :>
56+ QueryParam "officialOnly" Bool :>
57+ QueryParam "alt" AltJSON :>
58+ ReqBody '[JSON] VoterInfoRequest :>
59+ Get '[JSON] VoterInfoResponse
5660
5761-- | Looks up information relevant to a voter based on the voter\'s
5862-- registered address.
5963--
6064-- /See:/ 'electionsVoterInfoQuery' smart constructor.
6165data ElectionsVoterInfoQuery = ElectionsVoterInfoQuery'
62− { _eviqElectionId :: !(Textual Int64)
63− , _eviqAddress :: !Text
64− , _eviqOfficialOnly :: !Bool
66+ { _eviqReturnAllAvailableData :: !Bool
67+ , _eviqElectionId :: !(Textual Int64)
68+ , _eviqAddress :: !Text
69+ , _eviqPayload :: !VoterInfoRequest
70+ , _eviqOfficialOnly :: !Bool
6571 } deriving (Eq,Show,Data,Typeable,Generic)
6672
6773-- | Creates a value of 'ElectionsVoterInfoQuery' with the minimum fields required to make a request.
6874--
6975-- Use one of the following lenses to modify other fields as desired:
7076--
77+-- * 'eviqReturnAllAvailableData'
78+--
7179-- * 'eviqElectionId'
7280--
7381-- * 'eviqAddress'
7482--
83+-- * 'eviqPayload'
84+--
7585-- * 'eviqOfficialOnly'
7686electionsVoterInfoQuery
7787 :: Text -- ^ 'eviqAddress'
88+ -> VoterInfoRequest -- ^ 'eviqPayload'
7889 -> ElectionsVoterInfoQuery
79−electionsVoterInfoQuery pEviqAddress_ =
90+electionsVoterInfoQuery pEviqAddress_ pEviqPayload_ =
8091 ElectionsVoterInfoQuery'
81− { _eviqElectionId = 0
92+ { _eviqReturnAllAvailableData = False
93+ , _eviqElectionId = 0
8294 , _eviqAddress = pEviqAddress_
95+ , _eviqPayload = pEviqPayload_
8396 , _eviqOfficialOnly = False
8497 }
8598
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+
86107-- | The unique ID of the election to look up. A list of election IDs can be
87108-- obtained at
88109-- https:\/\/www.googleapis.com\/civicinfo\/{version}\/elections
@@ -97,6 +118,11 @@ eviqAddress :: Lens' ElectionsVoterInfoQuery Text
97118eviqAddress
98119 = lens _eviqAddress (\ s a -> s{_eviqAddress = a})
99120
121+-- | Multipart request metadata.
122+eviqPayload :: Lens' ElectionsVoterInfoQuery VoterInfoRequest
123+eviqPayload
124+ = lens _eviqPayload (\ s a -> s{_eviqPayload = a})
125+
100126-- | If set to true, only data from official state sources will be returned.
101127eviqOfficialOnly :: Lens' ElectionsVoterInfoQuery Bool
102128eviqOfficialOnly
@@ -107,9 +133,12 @@ instance GoogleRequest ElectionsVoterInfoQuery where
107133 type Rs ElectionsVoterInfoQuery = VoterInfoResponse
108134 type Scopes ElectionsVoterInfoQuery = '[]
109135 requestClient ElectionsVoterInfoQuery'{..}
110− = go (Just _eviqAddress) (Just _eviqElectionId)
136+ = go (Just _eviqAddress)
137+ (Just _eviqReturnAllAvailableData)
138+ (Just _eviqElectionId)
111139 (Just _eviqOfficialOnly)
112140 (Just AltJSON)
141+ _eviqPayload
113142 civicInfoService
114143 where go
115144 = buildClient
gogol-civicinfo/gen/Network/Google/Resource/CivicInfo/Representatives/RepresentativeInfoByAddress.hs+16−3
@@ -36,6 +36,7 @@ module Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByAdd
3636 -- * Request Lenses
3737 , rribaRoles
3838 , rribaAddress
39+ , rribaPayload
3940 , rribaIncludeOffices
4041 , rribaLevels
4142 ) where
@@ -59,7 +60,8 @@ type RepresentativesRepresentativeInfoByAddressResource
5960 RepresentativesRepresentativeInfoByAddressLevels
6061 :>
6162 QueryParam "alt" AltJSON :>
62− Get '[JSON] RepresentativeInfoResponse
63+ ReqBody '[JSON] RepresentativeInfoRequest :>
64+ Get '[JSON] RepresentativeInfoResponse
6365
6466-- | Looks up political geography and representative information for a single
6567-- address.
@@ -68,6 +70,7 @@ type RepresentativesRepresentativeInfoByAddressResource
6870data RepresentativesRepresentativeInfoByAddress = RepresentativesRepresentativeInfoByAddress'
6971 { _rribaRoles :: !(Maybe [RepresentativesRepresentativeInfoByAddressRoles])
7072 , _rribaAddress :: !(Maybe Text)
73+ , _rribaPayload :: !RepresentativeInfoRequest
7174 , _rribaIncludeOffices :: !Bool
7275 , _rribaLevels :: !(Maybe [RepresentativesRepresentativeInfoByAddressLevels])
7376 } deriving (Eq,Show,Data,Typeable,Generic)
@@ -80,15 +83,19 @@ data RepresentativesRepresentativeInfoByAddress = RepresentativesRepresentativeI
8083--
8184-- * 'rribaAddress'
8285--
86+-- * 'rribaPayload'
87+--
8388-- * 'rribaIncludeOffices'
8489--
8590-- * 'rribaLevels'
8691representativesRepresentativeInfoByAddress
87− :: RepresentativesRepresentativeInfoByAddress
88−representativesRepresentativeInfoByAddress =
92+ :: RepresentativeInfoRequest -- ^ 'rribaPayload'
93+ -> RepresentativesRepresentativeInfoByAddress
94+representativesRepresentativeInfoByAddress pRribaPayload_ =
8995 RepresentativesRepresentativeInfoByAddress'
9096 { _rribaRoles = Nothing
9197 , _rribaAddress = Nothing
98+ , _rribaPayload = pRribaPayload_
9299 , _rribaIncludeOffices = True
93100 , _rribaLevels = Nothing
94101 }
@@ -108,6 +115,11 @@ rribaAddress :: Lens' RepresentativesRepresentativeInfoByAddress (Maybe Text)
108115rribaAddress
109116 = lens _rribaAddress (\ s a -> s{_rribaAddress = a})
110117
118+-- | Multipart request metadata.
119+rribaPayload :: Lens' RepresentativesRepresentativeInfoByAddress RepresentativeInfoRequest
120+rribaPayload
121+ = lens _rribaPayload (\ s a -> s{_rribaPayload = a})
122+
111123-- | Whether to return information about offices and officials. If false,
112124-- only the top-level district information will be returned.
113125rribaIncludeOffices :: Lens' RepresentativesRepresentativeInfoByAddress Bool
@@ -137,6 +149,7 @@ instance GoogleRequest
137149 (Just _rribaIncludeOffices)
138150 (_rribaLevels ^. _Default)
139151 (Just AltJSON)
152+ _rribaPayload
140153 civicInfoService
141154 where go
142155 = buildClient
gogol-civicinfo/gen/Network/Google/Resource/CivicInfo/Representatives/RepresentativeInfoByDivision.hs+16−3
@@ -34,6 +34,7 @@ module Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByDiv
3434
3535 -- * Request Lenses
3636 , rribdRoles
37+ , rribdPayload
3738 , rribdRecursive
3839 , rribdOcdId
3940 , rribdLevels
@@ -58,13 +59,15 @@ type RepresentativesRepresentativeInfoByDivisionResource
5859 RepresentativesRepresentativeInfoByDivisionLevels
5960 :>
6061 QueryParam "alt" AltJSON :>
61− Get '[JSON] RepresentativeInfoData
62+ ReqBody '[JSON] DivisionRepresentativeInfoRequest :>
63+ Get '[JSON] RepresentativeInfoData
6264
6365-- | Looks up representative information for a single geographic division.
6466--
6567-- /See:/ 'representativesRepresentativeInfoByDivision' smart constructor.
6668data RepresentativesRepresentativeInfoByDivision = RepresentativesRepresentativeInfoByDivision'
6769 { _rribdRoles :: !(Maybe [RepresentativesRepresentativeInfoByDivisionRoles])
70+ , _rribdPayload :: !DivisionRepresentativeInfoRequest
6871 , _rribdRecursive :: !(Maybe Bool)
6972 , _rribdOcdId :: !Text
7073 , _rribdLevels :: !(Maybe [RepresentativesRepresentativeInfoByDivisionLevels])
@@ -76,17 +79,21 @@ data RepresentativesRepresentativeInfoByDivision = RepresentativesRepresentative
7679--
7780-- * 'rribdRoles'
7881--
82+-- * 'rribdPayload'
83+--
7984-- * 'rribdRecursive'
8085--
8186-- * 'rribdOcdId'
8287--
8388-- * 'rribdLevels'
8489representativesRepresentativeInfoByDivision
85− :: Text -- ^ 'rribdOcdId'
90+ :: DivisionRepresentativeInfoRequest -- ^ 'rribdPayload'
91+ -> Text -- ^ 'rribdOcdId'
8692 -> RepresentativesRepresentativeInfoByDivision
87−representativesRepresentativeInfoByDivision pRribdOcdId_ =
93+representativesRepresentativeInfoByDivision pRribdPayload_ pRribdOcdId_ =
8894 RepresentativesRepresentativeInfoByDivision'
8995 { _rribdRoles = Nothing
96+ , _rribdPayload = pRribdPayload_
9097 , _rribdRecursive = Nothing
9198 , _rribdOcdId = pRribdOcdId_
9299 , _rribdLevels = Nothing
@@ -101,6 +108,11 @@ rribdRoles
101108 _Default
102109 . _Coerce
103110
111+-- | Multipart request metadata.
112+rribdPayload :: Lens' RepresentativesRepresentativeInfoByDivision DivisionRepresentativeInfoRequest
113+rribdPayload
114+ = lens _rribdPayload (\ s a -> s{_rribdPayload = a})
115+
104116-- | If true, information about all divisions contained in the division
105117-- requested will be included as well. For example, if querying
106118-- ocd-division\/country:us\/district:dc, this would also return all DC\'s
@@ -137,6 +149,7 @@ instance GoogleRequest
137149 _rribdRecursive
138150 (_rribdLevels ^. _Default)
139151 (Just AltJSON)
152+ _rribdPayload
140153 civicInfoService
141154 where go
142155 = buildClient
gogol-civicinfo/gogol-civicinfo.cabal+3−1
@@ -14,7 +14,9 @@ cabal-version: >= 1.10
1414extra-source-files: README.md
1515
1616description:
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.
1820 .
1921 /Warning:/ This is an experimental prototype/preview release which is still
2022 under exploratory development and not intended for public use, caveat emptor!