{-# 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.RepresentativeInfoByDivision
(
RepresentativesRepresentativeInfoByDivisionResource
, representativesRepresentativeInfoByDivision
, RepresentativesRepresentativeInfoByDivision
, rribdRoles
, rribdPayload
, rribdRecursive
, rribdOcdId
, rribdLevels
) where
import Network.Google.CivicInfo.Types
import Network.Google.Prelude
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
data RepresentativesRepresentativeInfoByDivision = RepresentativesRepresentativeInfoByDivision'
{ _rribdRoles :: !(Maybe [RepresentativesRepresentativeInfoByDivisionRoles])
, _rribdPayload :: !DivisionRepresentativeInfoRequest
, _rribdRecursive :: !(Maybe Bool)
, _rribdOcdId :: !Text
, _rribdLevels :: !(Maybe [RepresentativesRepresentativeInfoByDivisionLevels])
} deriving (Eq,Show,Data,Typeable,Generic)
representativesRepresentativeInfoByDivision
:: DivisionRepresentativeInfoRequest
-> Text
-> RepresentativesRepresentativeInfoByDivision
representativesRepresentativeInfoByDivision pRribdPayload_ pRribdOcdId_ =
RepresentativesRepresentativeInfoByDivision'
{ _rribdRoles = Nothing
, _rribdPayload = pRribdPayload_
, _rribdRecursive = Nothing
, _rribdOcdId = pRribdOcdId_
, _rribdLevels = Nothing
}
rribdRoles :: Lens' RepresentativesRepresentativeInfoByDivision [RepresentativesRepresentativeInfoByDivisionRoles]
rribdRoles
= lens _rribdRoles (\ s a -> s{_rribdRoles = a}) .
_Default
. _Coerce
rribdPayload :: Lens' RepresentativesRepresentativeInfoByDivision DivisionRepresentativeInfoRequest
rribdPayload
= lens _rribdPayload (\ s a -> s{_rribdPayload = a})
rribdRecursive :: Lens' RepresentativesRepresentativeInfoByDivision (Maybe Bool)
rribdRecursive
= lens _rribdRecursive
(\ s a -> s{_rribdRecursive = a})
rribdOcdId :: Lens' RepresentativesRepresentativeInfoByDivision Text
rribdOcdId
= lens _rribdOcdId (\ s a -> s{_rribdOcdId = a})
rribdLevels :: Lens' RepresentativesRepresentativeInfoByDivision [RepresentativesRepresentativeInfoByDivisionLevels]
rribdLevels
= lens _rribdLevels (\ s a -> s{_rribdLevels = a}) .
_Default
. _Coerce
instance GoogleRequest
RepresentativesRepresentativeInfoByDivision where
type Rs RepresentativesRepresentativeInfoByDivision =
RepresentativeInfoData
type Scopes
RepresentativesRepresentativeInfoByDivision
= '[]
requestClient
RepresentativesRepresentativeInfoByDivision'{..}
= go _rribdOcdId (_rribdRoles ^. _Default)
_rribdRecursive
(_rribdLevels ^. _Default)
(Just AltJSON)
_rribdPayload
civicInfoService
where go
= buildClient
(Proxy ::
Proxy
RepresentativesRepresentativeInfoByDivisionResource)
mempty