{-# 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.Mirror.Contacts.Patch
(
ContactsPatchResource
, contactsPatch
, ContactsPatch
, cpPayload
, cpId
) where
import Network.Google.Mirror.Types
import Network.Google.Prelude
type ContactsPatchResource =
"mirror" :>
"v1" :>
"contacts" :>
Capture "id" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Contact :> Patch '[JSON] Contact
data ContactsPatch = ContactsPatch'
{ _cpPayload :: !Contact
, _cpId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
contactsPatch
:: Contact
-> Text
-> ContactsPatch
contactsPatch pCpPayload_ pCpId_ =
ContactsPatch'
{ _cpPayload = pCpPayload_
, _cpId = pCpId_
}
cpPayload :: Lens' ContactsPatch Contact
cpPayload
= lens _cpPayload (\ s a -> s{_cpPayload = a})
cpId :: Lens' ContactsPatch Text
cpId = lens _cpId (\ s a -> s{_cpId = a})
instance GoogleRequest ContactsPatch where
type Rs ContactsPatch = Contact
type Scopes ContactsPatch =
'["https://www.googleapis.com/auth/glass.timeline"]
requestClient ContactsPatch'{..}
= go _cpId (Just AltJSON) _cpPayload mirrorService
where go
= buildClient (Proxy :: Proxy ContactsPatchResource)
mempty