{-# 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.AdExchangeBuyer.Proposals.Update
(
ProposalsUpdateResource
, proposalsUpdate
, ProposalsUpdate
, puUpdateAction
, puRevisionNumber
, puPayload
, puProposalId
) where
import Network.Google.AdExchangeBuyer.Types
import Network.Google.Prelude
type ProposalsUpdateResource =
"adexchangebuyer" :>
"v1.4" :>
"proposals" :>
Capture "proposalId" Text :>
Capture "revisionNumber" (Textual Int64) :>
Capture "updateAction" ProposalsUpdateUpdateAction :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Proposal :> Put '[JSON] Proposal
data ProposalsUpdate = ProposalsUpdate'
{ _puUpdateAction :: !ProposalsUpdateUpdateAction
, _puRevisionNumber :: !(Textual Int64)
, _puPayload :: !Proposal
, _puProposalId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
proposalsUpdate
:: ProposalsUpdateUpdateAction
-> Int64
-> Proposal
-> Text
-> ProposalsUpdate
proposalsUpdate pPuUpdateAction_ pPuRevisionNumber_ pPuPayload_ pPuProposalId_ =
ProposalsUpdate'
{ _puUpdateAction = pPuUpdateAction_
, _puRevisionNumber = _Coerce # pPuRevisionNumber_
, _puPayload = pPuPayload_
, _puProposalId = pPuProposalId_
}
puUpdateAction :: Lens' ProposalsUpdate ProposalsUpdateUpdateAction
puUpdateAction
= lens _puUpdateAction
(\ s a -> s{_puUpdateAction = a})
puRevisionNumber :: Lens' ProposalsUpdate Int64
puRevisionNumber
= lens _puRevisionNumber
(\ s a -> s{_puRevisionNumber = a})
. _Coerce
puPayload :: Lens' ProposalsUpdate Proposal
puPayload
= lens _puPayload (\ s a -> s{_puPayload = a})
puProposalId :: Lens' ProposalsUpdate Text
puProposalId
= lens _puProposalId (\ s a -> s{_puProposalId = a})
instance GoogleRequest ProposalsUpdate where
type Rs ProposalsUpdate = Proposal
type Scopes ProposalsUpdate =
'["https://www.googleapis.com/auth/adexchange.buyer"]
requestClient ProposalsUpdate'{..}
= go _puProposalId _puRevisionNumber _puUpdateAction
(Just AltJSON)
_puPayload
adExchangeBuyerService
where go
= buildClient
(Proxy :: Proxy ProposalsUpdateResource)
mempty