{-# 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.Timeline.Patch
(
TimelinePatchResource
, timelinePatch
, TimelinePatch
, tpPayload
, tpId
) where
import Network.Google.Mirror.Types
import Network.Google.Prelude
type TimelinePatchResource =
"mirror" :>
"v1" :>
"timeline" :>
Capture "id" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] TimelineItem :>
Patch '[JSON] TimelineItem
-- | Updates a timeline item in place. This method supports patch semantics.
--
-- /See:/ 'timelinePatch' smart constructor.
data TimelinePatch = TimelinePatch'
{ _tpPayload :: !TimelineItem
, _tpId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'TimelinePatch' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'tpPayload'
--
-- * 'tpId'
timelinePatch
:: TimelineItem -- ^ 'tpPayload'
-> Text -- ^ 'tpId'
-> TimelinePatch
timelinePatch pTpPayload_ pTpId_ =
TimelinePatch'
{ _tpPayload = pTpPayload_
, _tpId = pTpId_
}
-- | Multipart request metadata.
tpPayload :: Lens' TimelinePatch TimelineItem
tpPayload
= lens _tpPayload (\ s a -> s{_tpPayload = a})
-- | The ID of the timeline item.
tpId :: Lens' TimelinePatch Text
tpId = lens _tpId (\ s a -> s{_tpId = a})
instance GoogleRequest TimelinePatch where
type Rs TimelinePatch = TimelineItem
type Scopes TimelinePatch =
'["https://www.googleapis.com/auth/glass.location",
"https://www.googleapis.com/auth/glass.timeline"]
requestClient TimelinePatch'{..}
= go _tpId (Just AltJSON) _tpPayload mirrorService
where go
= buildClient (Proxy :: Proxy TimelinePatchResource)
mempty