gogol-civicinfo 0.1.0 → 0.1.1
raw patch · 11 files changed
+445/−47 lines, 11 filesdep ~gogol-corePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: gogol-core
API changes (from Hackage documentation)
+ Network.Google.CivicInfo: abAddressLines :: Lens' AdministrativeBody [Text]
+ Network.Google.CivicInfo: contextParams :: ContextParams
+ Network.Google.CivicInfo: cpClientProFile :: Lens' ContextParams (Maybe Text)
+ Network.Google.CivicInfo: data ContextParams
+ Network.Google.CivicInfo: data DivisionRepresentativeInfoRequest
+ Network.Google.CivicInfo: data DivisionSearchRequest
+ Network.Google.CivicInfo: data ElectionsQueryRequest
+ Network.Google.CivicInfo: data RepresentativeInfoRequest
+ Network.Google.CivicInfo: data VoterInfoRequest
+ Network.Google.CivicInfo: divisionRepresentativeInfoRequest :: DivisionRepresentativeInfoRequest
+ Network.Google.CivicInfo: divisionSearchRequest :: DivisionSearchRequest
+ Network.Google.CivicInfo: drirContextParams :: Lens' DivisionRepresentativeInfoRequest (Maybe ContextParams)
+ Network.Google.CivicInfo: dsrContextParams :: Lens' DivisionSearchRequest (Maybe ContextParams)
+ Network.Google.CivicInfo: edKgForeignKey :: Lens' ElectoralDistrict (Maybe Text)
+ Network.Google.CivicInfo: electionsQueryRequest :: ElectionsQueryRequest
+ Network.Google.CivicInfo: eqrContextParams :: Lens' ElectionsQueryRequest (Maybe ContextParams)
+ Network.Google.CivicInfo: representativeInfoRequest :: RepresentativeInfoRequest
+ Network.Google.CivicInfo: rirContextParams :: Lens' RepresentativeInfoRequest (Maybe ContextParams)
+ Network.Google.CivicInfo: virContextParams :: Lens' VoterInfoRequest (Maybe ContextParams)
+ Network.Google.CivicInfo: voterInfoRequest :: VoterInfoRequest
+ Network.Google.CivicInfo.Types: abAddressLines :: Lens' AdministrativeBody [Text]
+ Network.Google.CivicInfo.Types: contextParams :: ContextParams
+ Network.Google.CivicInfo.Types: cpClientProFile :: Lens' ContextParams (Maybe Text)
+ Network.Google.CivicInfo.Types: data ContextParams
+ Network.Google.CivicInfo.Types: data DivisionRepresentativeInfoRequest
+ Network.Google.CivicInfo.Types: data DivisionSearchRequest
+ Network.Google.CivicInfo.Types: data ElectionsQueryRequest
+ Network.Google.CivicInfo.Types: data RepresentativeInfoRequest
+ Network.Google.CivicInfo.Types: data VoterInfoRequest
+ Network.Google.CivicInfo.Types: divisionRepresentativeInfoRequest :: DivisionRepresentativeInfoRequest
+ Network.Google.CivicInfo.Types: divisionSearchRequest :: DivisionSearchRequest
+ Network.Google.CivicInfo.Types: drirContextParams :: Lens' DivisionRepresentativeInfoRequest (Maybe ContextParams)
+ Network.Google.CivicInfo.Types: dsrContextParams :: Lens' DivisionSearchRequest (Maybe ContextParams)
+ Network.Google.CivicInfo.Types: edKgForeignKey :: Lens' ElectoralDistrict (Maybe Text)
+ Network.Google.CivicInfo.Types: electionsQueryRequest :: ElectionsQueryRequest
+ Network.Google.CivicInfo.Types: eqrContextParams :: Lens' ElectionsQueryRequest (Maybe ContextParams)
+ Network.Google.CivicInfo.Types: representativeInfoRequest :: RepresentativeInfoRequest
+ Network.Google.CivicInfo.Types: rirContextParams :: Lens' RepresentativeInfoRequest (Maybe ContextParams)
+ Network.Google.CivicInfo.Types: virContextParams :: Lens' VoterInfoRequest (Maybe ContextParams)
+ Network.Google.CivicInfo.Types: voterInfoRequest :: VoterInfoRequest
+ Network.Google.Resource.CivicInfo.Divisions.Search: dsPayload :: Lens' DivisionsSearch DivisionSearchRequest
+ Network.Google.Resource.CivicInfo.Elections.ElectionQuery: eeqPayload :: Lens' ElectionsElectionQuery ElectionsQueryRequest
+ Network.Google.Resource.CivicInfo.Elections.VoterInfoQuery: eviqPayload :: Lens' ElectionsVoterInfoQuery VoterInfoRequest
+ Network.Google.Resource.CivicInfo.Elections.VoterInfoQuery: eviqReturnAllAvailableData :: Lens' ElectionsVoterInfoQuery Bool
+ Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByAddress: rribaPayload :: Lens' RepresentativesRepresentativeInfoByAddress RepresentativeInfoRequest
+ Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByDivision: rribdPayload :: Lens' RepresentativesRepresentativeInfoByDivision DivisionRepresentativeInfoRequest
- Network.Google.Resource.CivicInfo.Divisions.Search: divisionsSearch :: DivisionsSearch
+ Network.Google.Resource.CivicInfo.Divisions.Search: divisionsSearch :: DivisionSearchRequest -> DivisionsSearch
- Network.Google.Resource.CivicInfo.Divisions.Search: type DivisionsSearchResource = "civicinfo" :> ("v2" :> ("divisions" :> (QueryParam "query" Text :> (QueryParam "alt" AltJSON :> Get '[JSON] DivisionSearchResponse))))
+ Network.Google.Resource.CivicInfo.Divisions.Search: type DivisionsSearchResource = "civicinfo" :> ("v2" :> ("divisions" :> (QueryParam "query" Text :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] DivisionSearchRequest :> Get '[JSON] DivisionSearchResponse)))))
- Network.Google.Resource.CivicInfo.Elections.ElectionQuery: electionsElectionQuery :: ElectionsElectionQuery
+ Network.Google.Resource.CivicInfo.Elections.ElectionQuery: electionsElectionQuery :: ElectionsQueryRequest -> ElectionsElectionQuery
- Network.Google.Resource.CivicInfo.Elections.ElectionQuery: type ElectionsElectionQueryResource = "civicinfo" :> ("v2" :> ("elections" :> (QueryParam "alt" AltJSON :> Get '[JSON] ElectionsQueryResponse)))
+ Network.Google.Resource.CivicInfo.Elections.ElectionQuery: type ElectionsElectionQueryResource = "civicinfo" :> ("v2" :> ("elections" :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] ElectionsQueryRequest :> Get '[JSON] ElectionsQueryResponse))))
- Network.Google.Resource.CivicInfo.Elections.VoterInfoQuery: electionsVoterInfoQuery :: Text -> ElectionsVoterInfoQuery
+ Network.Google.Resource.CivicInfo.Elections.VoterInfoQuery: electionsVoterInfoQuery :: Text -> VoterInfoRequest -> ElectionsVoterInfoQuery
- Network.Google.Resource.CivicInfo.Elections.VoterInfoQuery: type ElectionsVoterInfoQueryResource = "civicinfo" :> ("v2" :> ("voterinfo" :> (QueryParam "address" Text :> (QueryParam "electionId" (Textual Int64) :> (QueryParam "officialOnly" Bool :> (QueryParam "alt" AltJSON :> Get '[JSON] VoterInfoResponse))))))
+ Network.Google.Resource.CivicInfo.Elections.VoterInfoQuery: type ElectionsVoterInfoQueryResource = "civicinfo" :> ("v2" :> ("voterinfo" :> (QueryParam "address" Text :> (QueryParam "returnAllAvailableData" Bool :> (QueryParam "electionId" (Textual Int64) :> (QueryParam "officialOnly" Bool :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] VoterInfoRequest :> Get '[JSON] VoterInfoResponse))))))))
- Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByAddress: representativesRepresentativeInfoByAddress :: RepresentativesRepresentativeInfoByAddress
+ Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByAddress: representativesRepresentativeInfoByAddress :: RepresentativeInfoRequest -> RepresentativesRepresentativeInfoByAddress
- Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByAddress: type RepresentativesRepresentativeInfoByAddressResource = "civicinfo" :> ("v2" :> ("representatives" :> (QueryParams "roles" RepresentativesRepresentativeInfoByAddressRoles :> (QueryParam "address" Text :> (QueryParam "includeOffices" Bool :> (QueryParams "levels" RepresentativesRepresentativeInfoByAddressLevels :> (QueryParam "alt" AltJSON :> Get '[JSON] RepresentativeInfoResponse)))))))
+ Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByAddress: type RepresentativesRepresentativeInfoByAddressResource = "civicinfo" :> ("v2" :> ("representatives" :> (QueryParams "roles" RepresentativesRepresentativeInfoByAddressRoles :> (QueryParam "address" Text :> (QueryParam "includeOffices" Bool :> (QueryParams "levels" RepresentativesRepresentativeInfoByAddressLevels :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] RepresentativeInfoRequest :> Get '[JSON] RepresentativeInfoResponse))))))))
- Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByDivision: representativesRepresentativeInfoByDivision :: Text -> RepresentativesRepresentativeInfoByDivision
+ Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByDivision: representativesRepresentativeInfoByDivision :: DivisionRepresentativeInfoRequest -> Text -> RepresentativesRepresentativeInfoByDivision
- Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByDivision: type RepresentativesRepresentativeInfoByDivisionResource = "civicinfo" :> ("v2" :> ("representatives" :> (Capture "ocdId" Text :> (QueryParams "roles" RepresentativesRepresentativeInfoByDivisionRoles :> (QueryParam "recursive" Bool :> (QueryParams "levels" RepresentativesRepresentativeInfoByDivisionLevels :> (QueryParam "alt" AltJSON :> Get '[JSON] RepresentativeInfoData)))))))
+ Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByDivision: type RepresentativesRepresentativeInfoByDivisionResource = "civicinfo" :> ("v2" :> ("representatives" :> (Capture "ocdId" Text :> (QueryParams "roles" RepresentativesRepresentativeInfoByDivisionRoles :> (QueryParam "recursive" Bool :> (QueryParams "levels" RepresentativesRepresentativeInfoByDivisionLevels :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] DivisionRepresentativeInfoRequest :> Get '[JSON] RepresentativeInfoData))))))))
Files
- README.md +1/−1
- gen/Network/Google/CivicInfo.hs +35/−1
- gen/Network/Google/CivicInfo/Types.hs +32/−0
- gen/Network/Google/CivicInfo/Types/Product.hs +257/−10
- gen/Network/Google/Resource/CivicInfo/Divisions/Search.hs +20/−7
- gen/Network/Google/Resource/CivicInfo/Elections/ElectionQuery.hs +23/−8
- gen/Network/Google/Resource/CivicInfo/Elections/VoterInfoQuery.hs +39/−10
- gen/Network/Google/Resource/CivicInfo/Representatives/RepresentativeInfoByAddress.hs +16/−3
- gen/Network/Google/Resource/CivicInfo/Representatives/RepresentativeInfoByDivision.hs +16/−3
- gogol-civicinfo.cabal +6/−4
- src/.gitkeep +0/−0
README.md view
@@ -8,7 +8,7 @@ ## Version -`0.1.0`+`0.1.1` ## Description
gen/Network/Google/CivicInfo.hs view
@@ -13,7 +13,9 @@ -- Stability : auto-generated -- Portability : non-portable (GHC extensions) ----- An API for accessing civic information.+-- Provides polling places, early vote locations, contest data, election+-- officials, and government representatives for U.S. residential+-- addresses. -- -- /See:/ <https://developers.google.com/civic-information Google Civic Information API Reference> module Network.Google.CivicInfo@@ -114,6 +116,11 @@ -- ** RepresentativesRepresentativeInfoByDivisionRoles , RepresentativesRepresentativeInfoByDivisionRoles (..) + -- ** ElectionsQueryRequest+ , ElectionsQueryRequest+ , electionsQueryRequest+ , eqrContextParams+ -- ** Channel , Channel , channel@@ -144,6 +151,11 @@ , dsrName , dsrOcdId + -- ** DivisionSearchRequest+ , DivisionSearchRequest+ , divisionSearchRequest+ , dsrContextParams+ -- ** AdministrativeBody , AdministrativeBody , administrativeBody@@ -158,9 +170,15 @@ , abElectionOfficials , abName , abElectionRulesURL+ , abAddressLines , abVoterServices , abElectionRegistrationURL + -- ** RepresentativeInfoRequest+ , RepresentativeInfoRequest+ , representativeInfoRequest+ , rirContextParams+ -- ** Contest , Contest , contest@@ -225,13 +243,24 @@ , sName , sOfficial + -- ** DivisionRepresentativeInfoRequest+ , DivisionRepresentativeInfoRequest+ , divisionRepresentativeInfoRequest+ , drirContextParams+ -- ** ElectoralDistrict , ElectoralDistrict , electoralDistrict+ , edKgForeignKey , edName , edScope , edId + -- ** VoterInfoRequest+ , VoterInfoRequest+ , voterInfoRequest+ , virContextParams+ -- ** SimpleAddressType , SimpleAddressType , simpleAddressType@@ -242,6 +271,11 @@ , satCity , satLine1 , satLocationName++ -- ** ContextParams+ , ContextParams+ , contextParams+ , cpClientProFile -- ** AdministrationRegion , AdministrationRegion
gen/Network/Google/CivicInfo/Types.hs view
@@ -90,6 +90,11 @@ -- * RepresentativesRepresentativeInfoByDivisionRoles , RepresentativesRepresentativeInfoByDivisionRoles (..) + -- * ElectionsQueryRequest+ , ElectionsQueryRequest+ , electionsQueryRequest+ , eqrContextParams+ -- * Channel , Channel , channel@@ -120,6 +125,11 @@ , dsrName , dsrOcdId + -- * DivisionSearchRequest+ , DivisionSearchRequest+ , divisionSearchRequest+ , dsrContextParams+ -- * AdministrativeBody , AdministrativeBody , administrativeBody@@ -134,9 +144,15 @@ , abElectionOfficials , abName , abElectionRulesURL+ , abAddressLines , abVoterServices , abElectionRegistrationURL + -- * RepresentativeInfoRequest+ , RepresentativeInfoRequest+ , representativeInfoRequest+ , rirContextParams+ -- * Contest , Contest , contest@@ -201,13 +217,24 @@ , sName , sOfficial + -- * DivisionRepresentativeInfoRequest+ , DivisionRepresentativeInfoRequest+ , divisionRepresentativeInfoRequest+ , drirContextParams+ -- * ElectoralDistrict , ElectoralDistrict , electoralDistrict+ , edKgForeignKey , edName , edScope , edId + -- * VoterInfoRequest+ , VoterInfoRequest+ , voterInfoRequest+ , virContextParams+ -- * SimpleAddressType , SimpleAddressType , simpleAddressType@@ -218,6 +245,11 @@ , satCity , satLine1 , satLocationName++ -- * ContextParams+ , ContextParams+ , contextParams+ , cpClientProFile -- * AdministrationRegion , AdministrationRegion
gen/Network/Google/CivicInfo/Types/Product.hs view
@@ -519,7 +519,10 @@ (\ s a -> s{_cOrderOnBallot = a}) . mapping _Coerce --- | The candidate\'s name.+-- | 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\" cName :: Lens' Candidate (Maybe Text) cName = lens _cName (\ s a -> s{_cName = a}) @@ -656,6 +659,41 @@ ("sources" .=) <$> _oSources, ("name" .=) <$> _oName, ("levels" .=) <$> _oLevels]) +--+-- /See:/ 'electionsQueryRequest' smart constructor.+newtype ElectionsQueryRequest = ElectionsQueryRequest'+ { _eqrContextParams :: Maybe ContextParams+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'ElectionsQueryRequest' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'eqrContextParams'+electionsQueryRequest+ :: ElectionsQueryRequest+electionsQueryRequest =+ ElectionsQueryRequest'+ { _eqrContextParams = Nothing+ }++eqrContextParams :: Lens' ElectionsQueryRequest (Maybe ContextParams)+eqrContextParams+ = lens _eqrContextParams+ (\ s a -> s{_eqrContextParams = a})++instance FromJSON ElectionsQueryRequest where+ parseJSON+ = withObject "ElectionsQueryRequest"+ (\ o ->+ ElectionsQueryRequest' <$> (o .:? "contextParams"))++instance ToJSON ElectionsQueryRequest where+ toJSON ElectionsQueryRequest'{..}+ = object+ (catMaybes+ [("contextParams" .=) <$> _eqrContextParams])+ -- | A social media or web channel for a candidate. -- -- /See:/ 'channel' smart constructor.@@ -925,6 +963,42 @@ ("name" .=) <$> _dsrName, ("ocdId" .=) <$> _dsrOcdId]) +-- | A search request for political geographies.+--+-- /See:/ 'divisionSearchRequest' smart constructor.+newtype DivisionSearchRequest = DivisionSearchRequest'+ { _dsrContextParams :: Maybe ContextParams+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'DivisionSearchRequest' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'dsrContextParams'+divisionSearchRequest+ :: DivisionSearchRequest+divisionSearchRequest =+ DivisionSearchRequest'+ { _dsrContextParams = Nothing+ }++dsrContextParams :: Lens' DivisionSearchRequest (Maybe ContextParams)+dsrContextParams+ = lens _dsrContextParams+ (\ s a -> s{_dsrContextParams = a})++instance FromJSON DivisionSearchRequest where+ parseJSON+ = withObject "DivisionSearchRequest"+ (\ o ->+ DivisionSearchRequest' <$> (o .:? "contextParams"))++instance ToJSON DivisionSearchRequest where+ toJSON DivisionSearchRequest'{..}+ = object+ (catMaybes+ [("contextParams" .=) <$> _dsrContextParams])+ -- | Information about an election administrative body (e.g. County Board of -- Elections). --@@ -941,6 +1015,7 @@ , _abElectionOfficials :: !(Maybe [ElectionOfficial]) , _abName :: !(Maybe Text) , _abElectionRulesURL :: !(Maybe Text)+ , _abAddressLines :: !(Maybe [Text]) , _abVoterServices :: !(Maybe [Text]) , _abElectionRegistrationURL :: !(Maybe Text) } deriving (Eq,Show,Data,Typeable,Generic)@@ -971,6 +1046,8 @@ -- -- * 'abElectionRulesURL' --+-- * 'abAddressLines'+-- -- * 'abVoterServices' -- -- * 'abElectionRegistrationURL'@@ -989,6 +1066,7 @@ , _abElectionOfficials = Nothing , _abName = Nothing , _abElectionRulesURL = Nothing+ , _abAddressLines = Nothing , _abVoterServices = Nothing , _abElectionRegistrationURL = Nothing }@@ -1065,6 +1143,13 @@ = lens _abElectionRulesURL (\ s a -> s{_abElectionRulesURL = a}) +abAddressLines :: Lens' AdministrativeBody [Text]+abAddressLines+ = lens _abAddressLines+ (\ s a -> s{_abAddressLines = a})+ . _Default+ . _Coerce+ -- | A description of the services this administrative body may provide. abVoterServices :: Lens' AdministrativeBody [Text] abVoterServices@@ -1096,6 +1181,7 @@ <*> (o .:? "electionOfficials" .!= mempty) <*> (o .:? "name") <*> (o .:? "electionRulesUrl")+ <*> (o .:? "addressLines" .!= mempty) <*> (o .:? "voter_services" .!= mempty) <*> (o .:? "electionRegistrationUrl")) @@ -1118,10 +1204,49 @@ ("electionOfficials" .=) <$> _abElectionOfficials, ("name" .=) <$> _abName, ("electionRulesUrl" .=) <$> _abElectionRulesURL,+ ("addressLines" .=) <$> _abAddressLines, ("voter_services" .=) <$> _abVoterServices, ("electionRegistrationUrl" .=) <$> _abElectionRegistrationURL]) +-- | A request for political geography and representative information for an+-- address.+--+-- /See:/ 'representativeInfoRequest' smart constructor.+newtype RepresentativeInfoRequest = RepresentativeInfoRequest'+ { _rirContextParams :: Maybe ContextParams+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'RepresentativeInfoRequest' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'rirContextParams'+representativeInfoRequest+ :: RepresentativeInfoRequest+representativeInfoRequest =+ RepresentativeInfoRequest'+ { _rirContextParams = Nothing+ }++rirContextParams :: Lens' RepresentativeInfoRequest (Maybe ContextParams)+rirContextParams+ = lens _rirContextParams+ (\ s a -> s{_rirContextParams = a})++instance FromJSON RepresentativeInfoRequest where+ parseJSON+ = withObject "RepresentativeInfoRequest"+ (\ o ->+ RepresentativeInfoRequest' <$>+ (o .:? "contextParams"))++instance ToJSON RepresentativeInfoRequest where+ toJSON RepresentativeInfoRequest'{..}+ = object+ (catMaybes+ [("contextParams" .=) <$> _rirContextParams])+ -- | Information about a contest that appears on a voter\'s ballot. -- -- /See:/ 'contest' smart constructor.@@ -1308,8 +1433,8 @@ -- | 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\'.+-- or \"no\" for referenda. This field is only populated for contests of+-- type \'Referendum\'. conReferendumBallotResponses :: Lens' Contest [Text] conReferendumBallotResponses = lens _conReferendumBallotResponses@@ -1351,7 +1476,8 @@ -- | The type of contest. Usually this will be \'General\', \'Primary\', or -- \'Run-off\' for contests with candidates. For referenda this will be--- \'Referendum\'.+-- \'Referendum\'. For Retention contests this will typically be+-- \'Retention\'. conType :: Lens' Contest (Maybe Text) conType = lens _conType (\ s a -> s{_conType = a}) @@ -1750,19 +1876,61 @@ [("name" .=) <$> _sName, ("official" .=) <$> _sOfficial]) +-- | A request to look up representative information for a single division.+--+-- /See:/ 'divisionRepresentativeInfoRequest' smart constructor.+newtype DivisionRepresentativeInfoRequest = DivisionRepresentativeInfoRequest'+ { _drirContextParams :: Maybe ContextParams+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'DivisionRepresentativeInfoRequest' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'drirContextParams'+divisionRepresentativeInfoRequest+ :: DivisionRepresentativeInfoRequest+divisionRepresentativeInfoRequest =+ DivisionRepresentativeInfoRequest'+ { _drirContextParams = Nothing+ }++drirContextParams :: Lens' DivisionRepresentativeInfoRequest (Maybe ContextParams)+drirContextParams+ = lens _drirContextParams+ (\ s a -> s{_drirContextParams = a})++instance FromJSON DivisionRepresentativeInfoRequest+ where+ parseJSON+ = withObject "DivisionRepresentativeInfoRequest"+ (\ o ->+ DivisionRepresentativeInfoRequest' <$>+ (o .:? "contextParams"))++instance ToJSON DivisionRepresentativeInfoRequest+ where+ toJSON DivisionRepresentativeInfoRequest'{..}+ = object+ (catMaybes+ [("contextParams" .=) <$> _drirContextParams])+ -- | Describes the geographic scope of a contest. -- -- /See:/ 'electoralDistrict' smart constructor. data ElectoralDistrict = ElectoralDistrict'- { _edName :: !(Maybe Text)- , _edScope :: !(Maybe Text)- , _edId :: !(Maybe Text)+ { _edKgForeignKey :: !(Maybe Text)+ , _edName :: !(Maybe Text)+ , _edScope :: !(Maybe Text)+ , _edId :: !(Maybe Text) } deriving (Eq,Show,Data,Typeable,Generic) -- | Creates a value of 'ElectoralDistrict' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: --+-- * 'edKgForeignKey'+-- -- * 'edName' -- -- * 'edScope'@@ -1772,11 +1940,17 @@ :: ElectoralDistrict electoralDistrict = ElectoralDistrict'- { _edName = Nothing+ { _edKgForeignKey = Nothing+ , _edName = Nothing , _edScope = Nothing , _edId = Nothing } +edKgForeignKey :: Lens' ElectoralDistrict (Maybe Text)+edKgForeignKey+ = lens _edKgForeignKey+ (\ s a -> s{_edKgForeignKey = a})+ -- | The name of the district. edName :: Lens' ElectoralDistrict (Maybe Text) edName = lens _edName (\ s a -> s{_edName = a})@@ -1799,15 +1973,54 @@ = withObject "ElectoralDistrict" (\ o -> ElectoralDistrict' <$>- (o .:? "name") <*> (o .:? "scope") <*> (o .:? "id"))+ (o .:? "kgForeignKey") <*> (o .:? "name") <*>+ (o .:? "scope")+ <*> (o .:? "id")) instance ToJSON ElectoralDistrict where toJSON ElectoralDistrict'{..} = object (catMaybes- [("name" .=) <$> _edName, ("scope" .=) <$> _edScope,+ [("kgForeignKey" .=) <$> _edKgForeignKey,+ ("name" .=) <$> _edName, ("scope" .=) <$> _edScope, ("id" .=) <$> _edId]) +-- | A request for information about a voter.+--+-- /See:/ 'voterInfoRequest' smart constructor.+newtype VoterInfoRequest = VoterInfoRequest'+ { _virContextParams :: Maybe ContextParams+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'VoterInfoRequest' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'virContextParams'+voterInfoRequest+ :: VoterInfoRequest+voterInfoRequest =+ VoterInfoRequest'+ { _virContextParams = Nothing+ }++virContextParams :: Lens' VoterInfoRequest (Maybe ContextParams)+virContextParams+ = lens _virContextParams+ (\ s a -> s{_virContextParams = a})++instance FromJSON VoterInfoRequest where+ parseJSON+ = withObject "VoterInfoRequest"+ (\ o ->+ VoterInfoRequest' <$> (o .:? "contextParams"))++instance ToJSON VoterInfoRequest where+ toJSON VoterInfoRequest'{..}+ = object+ (catMaybes+ [("contextParams" .=) <$> _virContextParams])+ -- | A simple representation of an address. -- -- /See:/ 'simpleAddressType' smart constructor.@@ -1902,6 +2115,40 @@ ("line3" .=) <$> _satLine3, ("zip" .=) <$> _satZip, ("city" .=) <$> _satCity, ("line1" .=) <$> _satLine1, ("locationName" .=) <$> _satLocationName])++--+-- /See:/ 'contextParams' smart constructor.+newtype ContextParams = ContextParams'+ { _cpClientProFile :: Maybe Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'ContextParams' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'cpClientProFile'+contextParams+ :: ContextParams+contextParams =+ ContextParams'+ { _cpClientProFile = Nothing+ }++cpClientProFile :: Lens' ContextParams (Maybe Text)+cpClientProFile+ = lens _cpClientProFile+ (\ s a -> s{_cpClientProFile = a})++instance FromJSON ContextParams where+ parseJSON+ = withObject "ContextParams"+ (\ o -> ContextParams' <$> (o .:? "clientProfile"))++instance ToJSON ContextParams where+ toJSON ContextParams'{..}+ = object+ (catMaybes+ [("clientProfile" .=) <$> _cpClientProFile]) -- | Describes information about a regional election administrative area. --
gen/Network/Google/Resource/CivicInfo/Divisions/Search.hs view
@@ -33,6 +33,7 @@ , DivisionsSearch -- * Request Lenses+ , dsPayload , dsQuery ) where @@ -47,27 +48,38 @@ "divisions" :> QueryParam "query" Text :> QueryParam "alt" AltJSON :>- Get '[JSON] DivisionSearchResponse+ ReqBody '[JSON] DivisionSearchRequest :>+ Get '[JSON] DivisionSearchResponse -- | Searches for political divisions by their natural name or OCD ID. -- -- /See:/ 'divisionsSearch' smart constructor.-newtype DivisionsSearch = DivisionsSearch'- { _dsQuery :: Maybe Text+data DivisionsSearch = DivisionsSearch'+ { _dsPayload :: !DivisionSearchRequest+ , _dsQuery :: !(Maybe Text) } deriving (Eq,Show,Data,Typeable,Generic) -- | Creates a value of 'DivisionsSearch' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: --+-- * 'dsPayload'+-- -- * 'dsQuery' divisionsSearch- :: DivisionsSearch-divisionsSearch =+ :: DivisionSearchRequest -- ^ 'dsPayload'+ -> DivisionsSearch+divisionsSearch pDsPayload_ = DivisionsSearch'- { _dsQuery = Nothing+ { _dsPayload = pDsPayload_+ , _dsQuery = Nothing } +-- | Multipart request metadata.+dsPayload :: Lens' DivisionsSearch DivisionSearchRequest+dsPayload+ = lens _dsPayload (\ s a -> s{_dsPayload = a})+ -- | The search query. Queries can cover any parts of a OCD ID or a human -- readable division name. All words given in the query are treated as -- required patterns. In addition to that, most query operators of the@@ -80,7 +92,8 @@ type Rs DivisionsSearch = DivisionSearchResponse type Scopes DivisionsSearch = '[] requestClient DivisionsSearch'{..}- = go _dsQuery (Just AltJSON) civicInfoService+ = go _dsQuery (Just AltJSON) _dsPayload+ civicInfoService where go = buildClient (Proxy :: Proxy DivisionsSearchResource)
gen/Network/Google/Resource/CivicInfo/Elections/ElectionQuery.hs view
@@ -32,6 +32,8 @@ , electionsElectionQuery , ElectionsElectionQuery + -- * Request Lenses+ , eeqPayload ) where import Network.Google.CivicInfo.Types@@ -44,27 +46,40 @@ "v2" :> "elections" :> QueryParam "alt" AltJSON :>- Get '[JSON] ElectionsQueryResponse+ ReqBody '[JSON] ElectionsQueryRequest :>+ Get '[JSON] ElectionsQueryResponse -- | List of available elections to query. -- -- /See:/ 'electionsElectionQuery' smart constructor.-data ElectionsElectionQuery =- ElectionsElectionQuery'- deriving (Eq,Show,Data,Typeable,Generic)+newtype ElectionsElectionQuery = ElectionsElectionQuery'+ { _eeqPayload :: ElectionsQueryRequest+ } deriving (Eq,Show,Data,Typeable,Generic) -- | Creates a value of 'ElectionsElectionQuery' with the minimum fields required to make a request. --+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'eeqPayload' electionsElectionQuery- :: ElectionsElectionQuery-electionsElectionQuery = ElectionsElectionQuery'+ :: ElectionsQueryRequest -- ^ 'eeqPayload'+ -> ElectionsElectionQuery+electionsElectionQuery pEeqPayload_ =+ ElectionsElectionQuery'+ { _eeqPayload = pEeqPayload_+ } +-- | Multipart request metadata.+eeqPayload :: Lens' ElectionsElectionQuery ElectionsQueryRequest+eeqPayload+ = lens _eeqPayload (\ s a -> s{_eeqPayload = a})+ instance GoogleRequest ElectionsElectionQuery where type Rs ElectionsElectionQuery = ElectionsQueryResponse type Scopes ElectionsElectionQuery = '[]- requestClient ElectionsElectionQuery'{}- = go (Just AltJSON) civicInfoService+ requestClient ElectionsElectionQuery'{..}+ = go (Just AltJSON) _eeqPayload civicInfoService where go = buildClient (Proxy :: Proxy ElectionsElectionQueryResource)
gen/Network/Google/Resource/CivicInfo/Elections/VoterInfoQuery.hs view
@@ -34,8 +34,10 @@ , ElectionsVoterInfoQuery -- * Request Lenses+ , eviqReturnAllAvailableData , eviqElectionId , eviqAddress+ , eviqPayload , eviqOfficialOnly ) where @@ -49,40 +51,59 @@ "v2" :> "voterinfo" :> QueryParam "address" Text :>- QueryParam "electionId" (Textual Int64) :>- QueryParam "officialOnly" Bool :>- QueryParam "alt" AltJSON :>- Get '[JSON] VoterInfoResponse+ QueryParam "returnAllAvailableData" Bool :>+ QueryParam "electionId" (Textual Int64) :>+ QueryParam "officialOnly" Bool :>+ QueryParam "alt" AltJSON :>+ ReqBody '[JSON] VoterInfoRequest :>+ Get '[JSON] VoterInfoResponse -- | Looks up information relevant to a voter based on the voter\'s -- registered address. -- -- /See:/ 'electionsVoterInfoQuery' smart constructor. data ElectionsVoterInfoQuery = ElectionsVoterInfoQuery'- { _eviqElectionId :: !(Textual Int64)- , _eviqAddress :: !Text- , _eviqOfficialOnly :: !Bool+ { _eviqReturnAllAvailableData :: !Bool+ , _eviqElectionId :: !(Textual Int64)+ , _eviqAddress :: !Text+ , _eviqPayload :: !VoterInfoRequest+ , _eviqOfficialOnly :: !Bool } deriving (Eq,Show,Data,Typeable,Generic) -- | Creates a value of 'ElectionsVoterInfoQuery' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: --+-- * 'eviqReturnAllAvailableData'+-- -- * 'eviqElectionId' -- -- * 'eviqAddress' --+-- * 'eviqPayload'+-- -- * 'eviqOfficialOnly' electionsVoterInfoQuery :: Text -- ^ 'eviqAddress'+ -> VoterInfoRequest -- ^ 'eviqPayload' -> ElectionsVoterInfoQuery-electionsVoterInfoQuery pEviqAddress_ =+electionsVoterInfoQuery pEviqAddress_ pEviqPayload_ = ElectionsVoterInfoQuery'- { _eviqElectionId = 0+ { _eviqReturnAllAvailableData = False+ , _eviqElectionId = 0 , _eviqAddress = pEviqAddress_+ , _eviqPayload = pEviqPayload_ , _eviqOfficialOnly = False } +-- | 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.+eviqReturnAllAvailableData :: Lens' ElectionsVoterInfoQuery Bool+eviqReturnAllAvailableData+ = lens _eviqReturnAllAvailableData+ (\ s a -> s{_eviqReturnAllAvailableData = a})+ -- | The unique ID of the election to look up. A list of election IDs can be -- obtained at -- https:\/\/www.googleapis.com\/civicinfo\/{version}\/elections@@ -97,6 +118,11 @@ eviqAddress = lens _eviqAddress (\ s a -> s{_eviqAddress = a}) +-- | Multipart request metadata.+eviqPayload :: Lens' ElectionsVoterInfoQuery VoterInfoRequest+eviqPayload+ = lens _eviqPayload (\ s a -> s{_eviqPayload = a})+ -- | If set to true, only data from official state sources will be returned. eviqOfficialOnly :: Lens' ElectionsVoterInfoQuery Bool eviqOfficialOnly@@ -107,9 +133,12 @@ type Rs ElectionsVoterInfoQuery = VoterInfoResponse type Scopes ElectionsVoterInfoQuery = '[] requestClient ElectionsVoterInfoQuery'{..}- = go (Just _eviqAddress) (Just _eviqElectionId)+ = go (Just _eviqAddress)+ (Just _eviqReturnAllAvailableData)+ (Just _eviqElectionId) (Just _eviqOfficialOnly) (Just AltJSON)+ _eviqPayload civicInfoService where go = buildClient
gen/Network/Google/Resource/CivicInfo/Representatives/RepresentativeInfoByAddress.hs view
@@ -36,6 +36,7 @@ -- * Request Lenses , rribaRoles , rribaAddress+ , rribaPayload , rribaIncludeOffices , rribaLevels ) where@@ -59,7 +60,8 @@ RepresentativesRepresentativeInfoByAddressLevels :> QueryParam "alt" AltJSON :>- Get '[JSON] RepresentativeInfoResponse+ ReqBody '[JSON] RepresentativeInfoRequest :>+ Get '[JSON] RepresentativeInfoResponse -- | Looks up political geography and representative information for a single -- address.@@ -68,6 +70,7 @@ data RepresentativesRepresentativeInfoByAddress = RepresentativesRepresentativeInfoByAddress' { _rribaRoles :: !(Maybe [RepresentativesRepresentativeInfoByAddressRoles]) , _rribaAddress :: !(Maybe Text)+ , _rribaPayload :: !RepresentativeInfoRequest , _rribaIncludeOffices :: !Bool , _rribaLevels :: !(Maybe [RepresentativesRepresentativeInfoByAddressLevels]) } deriving (Eq,Show,Data,Typeable,Generic)@@ -80,15 +83,19 @@ -- -- * 'rribaAddress' --+-- * 'rribaPayload'+-- -- * 'rribaIncludeOffices' -- -- * 'rribaLevels' representativesRepresentativeInfoByAddress- :: RepresentativesRepresentativeInfoByAddress-representativesRepresentativeInfoByAddress =+ :: RepresentativeInfoRequest -- ^ 'rribaPayload'+ -> RepresentativesRepresentativeInfoByAddress+representativesRepresentativeInfoByAddress pRribaPayload_ = RepresentativesRepresentativeInfoByAddress' { _rribaRoles = Nothing , _rribaAddress = Nothing+ , _rribaPayload = pRribaPayload_ , _rribaIncludeOffices = True , _rribaLevels = Nothing }@@ -108,6 +115,11 @@ rribaAddress = lens _rribaAddress (\ s a -> s{_rribaAddress = a}) +-- | Multipart request metadata.+rribaPayload :: Lens' RepresentativesRepresentativeInfoByAddress RepresentativeInfoRequest+rribaPayload+ = lens _rribaPayload (\ s a -> s{_rribaPayload = a})+ -- | Whether to return information about offices and officials. If false, -- only the top-level district information will be returned. rribaIncludeOffices :: Lens' RepresentativesRepresentativeInfoByAddress Bool@@ -137,6 +149,7 @@ (Just _rribaIncludeOffices) (_rribaLevels ^. _Default) (Just AltJSON)+ _rribaPayload civicInfoService where go = buildClient
gen/Network/Google/Resource/CivicInfo/Representatives/RepresentativeInfoByDivision.hs view
@@ -34,6 +34,7 @@ -- * Request Lenses , rribdRoles+ , rribdPayload , rribdRecursive , rribdOcdId , rribdLevels@@ -58,13 +59,15 @@ RepresentativesRepresentativeInfoByDivisionLevels :> QueryParam "alt" AltJSON :>- Get '[JSON] RepresentativeInfoData+ ReqBody '[JSON] DivisionRepresentativeInfoRequest :>+ Get '[JSON] RepresentativeInfoData -- | Looks up representative information for a single geographic division. -- -- /See:/ 'representativesRepresentativeInfoByDivision' smart constructor. data RepresentativesRepresentativeInfoByDivision = RepresentativesRepresentativeInfoByDivision' { _rribdRoles :: !(Maybe [RepresentativesRepresentativeInfoByDivisionRoles])+ , _rribdPayload :: !DivisionRepresentativeInfoRequest , _rribdRecursive :: !(Maybe Bool) , _rribdOcdId :: !Text , _rribdLevels :: !(Maybe [RepresentativesRepresentativeInfoByDivisionLevels])@@ -76,17 +79,21 @@ -- -- * 'rribdRoles' --+-- * 'rribdPayload'+-- -- * 'rribdRecursive' -- -- * 'rribdOcdId' -- -- * 'rribdLevels' representativesRepresentativeInfoByDivision- :: Text -- ^ 'rribdOcdId'+ :: DivisionRepresentativeInfoRequest -- ^ 'rribdPayload'+ -> Text -- ^ 'rribdOcdId' -> RepresentativesRepresentativeInfoByDivision-representativesRepresentativeInfoByDivision pRribdOcdId_ =+representativesRepresentativeInfoByDivision pRribdPayload_ pRribdOcdId_ = RepresentativesRepresentativeInfoByDivision' { _rribdRoles = Nothing+ , _rribdPayload = pRribdPayload_ , _rribdRecursive = Nothing , _rribdOcdId = pRribdOcdId_ , _rribdLevels = Nothing@@ -101,6 +108,11 @@ _Default . _Coerce +-- | Multipart request metadata.+rribdPayload :: Lens' RepresentativesRepresentativeInfoByDivision DivisionRepresentativeInfoRequest+rribdPayload+ = lens _rribdPayload (\ s a -> s{_rribdPayload = a})+ -- | If true, information about all divisions contained in the division -- requested will be included as well. For example, if querying -- ocd-division\/country:us\/district:dc, this would also return all DC\'s@@ -137,6 +149,7 @@ _rribdRecursive (_rribdLevels ^. _Default) (Just AltJSON)+ _rribdPayload civicInfoService where go = buildClient
gogol-civicinfo.cabal view
@@ -1,5 +1,5 @@ name: gogol-civicinfo-version: 0.1.0+version: 0.1.1 synopsis: Google Civic Information SDK. homepage: https://github.com/brendanhay/gogol bug-reports: https://github.com/brendanhay/gogol/issues@@ -11,10 +11,12 @@ category: Network, Google, Cloud build-type: Simple cabal-version: >= 1.10-extra-source-files: README.md+extra-source-files: README.md src/.gitkeep description:- An API for accessing civic information.+ Provides polling places, early vote locations, contest data, election+ officials, and government representatives for U.S. residential+ addresses. . /Warning:/ This is an experimental prototype/preview release which is still under exploratory development and not intended for public use, caveat emptor!@@ -46,5 +48,5 @@ , Network.Google.CivicInfo.Types.Sum build-depends:- gogol-core == 0.1.0.*+ gogol-core == 0.1.1.* , base >= 4.7 && < 5
+ src/.gitkeep view