{-# 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.Representatives.RepresentativeInfoByAddress
(
RepresentativesRepresentativeInfoByAddressResource
, representativesRepresentativeInfoByAddress
, RepresentativesRepresentativeInfoByAddress
, rribaRoles
, rribaAddress
, rribaPayload
, rribaIncludeOffices
, rribaLevels
) where
import Network.Google.CivicInfo.Types
import Network.Google.Prelude
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
data RepresentativesRepresentativeInfoByAddress = RepresentativesRepresentativeInfoByAddress'
{ _rribaRoles :: !(Maybe [RepresentativesRepresentativeInfoByAddressRoles])
, _rribaAddress :: !(Maybe Text)
, _rribaPayload :: !RepresentativeInfoRequest
, _rribaIncludeOffices :: !Bool
, _rribaLevels :: !(Maybe [RepresentativesRepresentativeInfoByAddressLevels])
} deriving (Eq,Show,Data,Typeable,Generic)
representativesRepresentativeInfoByAddress
:: RepresentativeInfoRequest
-> RepresentativesRepresentativeInfoByAddress
representativesRepresentativeInfoByAddress pRribaPayload_ =
RepresentativesRepresentativeInfoByAddress'
{ _rribaRoles = Nothing
, _rribaAddress = Nothing
, _rribaPayload = pRribaPayload_
, _rribaIncludeOffices = True
, _rribaLevels = Nothing
}
rribaRoles :: Lens' RepresentativesRepresentativeInfoByAddress [RepresentativesRepresentativeInfoByAddressRoles]
rribaRoles
= lens _rribaRoles (\ s a -> s{_rribaRoles = a}) .
_Default
. _Coerce
rribaAddress :: Lens' RepresentativesRepresentativeInfoByAddress (Maybe Text)
rribaAddress
= lens _rribaAddress (\ s a -> s{_rribaAddress = a})
rribaPayload :: Lens' RepresentativesRepresentativeInfoByAddress RepresentativeInfoRequest
rribaPayload
= lens _rribaPayload (\ s a -> s{_rribaPayload = a})
rribaIncludeOffices :: Lens' RepresentativesRepresentativeInfoByAddress Bool
rribaIncludeOffices
= lens _rribaIncludeOffices
(\ s a -> s{_rribaIncludeOffices = a})
rribaLevels :: Lens' RepresentativesRepresentativeInfoByAddress [RepresentativesRepresentativeInfoByAddressLevels]
rribaLevels
= lens _rribaLevels (\ s a -> s{_rribaLevels = a}) .
_Default
. _Coerce
instance GoogleRequest
RepresentativesRepresentativeInfoByAddress where
type Rs RepresentativesRepresentativeInfoByAddress =
RepresentativeInfoResponse
type Scopes
RepresentativesRepresentativeInfoByAddress
= '[]
requestClient
RepresentativesRepresentativeInfoByAddress'{..}
= go (_rribaRoles ^. _Default) _rribaAddress
(Just _rribaIncludeOffices)
(_rribaLevels ^. _Default)
(Just AltJSON)
_rribaPayload
civicInfoService
where go
= buildClient
(Proxy ::
Proxy
RepresentativesRepresentativeInfoByAddressResource)
mempty