{-# 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.ElectionQuery
(
ElectionsElectionQueryResource
, electionsElectionQuery
, ElectionsElectionQuery
, eeqPayload
) where
import Network.Google.CivicInfo.Types
import Network.Google.Prelude
type ElectionsElectionQueryResource =
"civicinfo" :>
"v2" :>
"elections" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ElectionsQueryRequest :>
Get '[JSON] ElectionsQueryResponse
newtype ElectionsElectionQuery = ElectionsElectionQuery'
{ _eeqPayload :: ElectionsQueryRequest
} deriving (Eq,Show,Data,Typeable,Generic)
electionsElectionQuery
:: ElectionsQueryRequest
-> ElectionsElectionQuery
electionsElectionQuery pEeqPayload_ =
ElectionsElectionQuery'
{ _eeqPayload = pEeqPayload_
}
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) _eeqPayload civicInfoService
where go
= buildClient
(Proxy :: Proxy ElectionsElectionQueryResource)
mempty