{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Resource.CivicInfo.Elections.VoterInfoQuery
(
ElectionsVoterInfoQueryResource
, electionsVoterInfoQuery
, ElectionsVoterInfoQuery
, eviqReturnAllAvailableData
, eviqElectionId
, eviqAddress
, eviqPayload
, eviqOfficialOnly
) where
import Network.Google.CivicInfo.Types
import Network.Google.Prelude
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
data ElectionsVoterInfoQuery = ElectionsVoterInfoQuery'
{ _eviqReturnAllAvailableData :: !Bool
, _eviqElectionId :: !(Textual Int64)
, _eviqAddress :: !Text
, _eviqPayload :: !VoterInfoRequest
, _eviqOfficialOnly :: !Bool
} deriving (Eq,Show,Data,Typeable,Generic)
electionsVoterInfoQuery
:: Text
-> VoterInfoRequest
-> ElectionsVoterInfoQuery
electionsVoterInfoQuery pEviqAddress_ pEviqPayload_ =
ElectionsVoterInfoQuery'
{ _eviqReturnAllAvailableData = False
, _eviqElectionId = 0
, _eviqAddress = pEviqAddress_
, _eviqPayload = pEviqPayload_
, _eviqOfficialOnly = False
}
eviqReturnAllAvailableData :: Lens' ElectionsVoterInfoQuery Bool
eviqReturnAllAvailableData
= lens _eviqReturnAllAvailableData
(\ s a -> s{_eviqReturnAllAvailableData = a})
eviqElectionId :: Lens' ElectionsVoterInfoQuery Int64
eviqElectionId
= lens _eviqElectionId
(\ s a -> s{_eviqElectionId = a})
. _Coerce
eviqAddress :: Lens' ElectionsVoterInfoQuery Text
eviqAddress
= lens _eviqAddress (\ s a -> s{_eviqAddress = a})
eviqPayload :: Lens' ElectionsVoterInfoQuery VoterInfoRequest
eviqPayload
= lens _eviqPayload (\ s a -> s{_eviqPayload = a})
eviqOfficialOnly :: Lens' ElectionsVoterInfoQuery Bool
eviqOfficialOnly
= lens _eviqOfficialOnly
(\ s a -> s{_eviqOfficialOnly = a})
instance GoogleRequest ElectionsVoterInfoQuery where
type Rs ElectionsVoterInfoQuery = VoterInfoResponse
type Scopes ElectionsVoterInfoQuery = '[]
requestClient ElectionsVoterInfoQuery'{..}
= go (Just _eviqAddress)
(Just _eviqReturnAllAvailableData)
(Just _eviqElectionId)
(Just _eviqOfficialOnly)
(Just AltJSON)
_eviqPayload
civicInfoService
where go
= buildClient
(Proxy :: Proxy ElectionsVoterInfoQueryResource)
mempty