{-# 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.Update
(
TimelineUpdateResource
, timelineUpdate
, TimelineUpdate
, tuPayload
, tuId
) where
import Network.Google.Mirror.Types
import Network.Google.Prelude
type TimelineUpdateResource =
"mirror" :>
"v1" :>
"timeline" :>
Capture "id" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] TimelineItem :>
Put '[JSON] TimelineItem
:<|>
"upload" :>
"mirror" :>
"v1" :>
"timeline" :>
Capture "id" Text :>
QueryParam "alt" AltJSON :>
QueryParam "uploadType" Multipart :>
MultipartRelated '[JSON] TimelineItem :>
Put '[JSON] TimelineItem
data TimelineUpdate = TimelineUpdate'
{ _tuPayload :: !TimelineItem
, _tuId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
timelineUpdate
:: TimelineItem
-> Text
-> TimelineUpdate
timelineUpdate pTuPayload_ pTuId_ =
TimelineUpdate'
{ _tuPayload = pTuPayload_
, _tuId = pTuId_
}
tuPayload :: Lens' TimelineUpdate TimelineItem
tuPayload
= lens _tuPayload (\ s a -> s{_tuPayload = a})
tuId :: Lens' TimelineUpdate Text
tuId = lens _tuId (\ s a -> s{_tuId = a})
instance GoogleRequest TimelineUpdate where
type Rs TimelineUpdate = TimelineItem
type Scopes TimelineUpdate =
'["https://www.googleapis.com/auth/glass.location",
"https://www.googleapis.com/auth/glass.timeline"]
requestClient TimelineUpdate'{..}
= go _tuId (Just AltJSON) _tuPayload mirrorService
where go :<|> _
= buildClient (Proxy :: Proxy TimelineUpdateResource)
mempty
instance GoogleRequest (MediaUpload TimelineUpdate)
where
type Rs (MediaUpload TimelineUpdate) = TimelineItem
type Scopes (MediaUpload TimelineUpdate) =
Scopes TimelineUpdate
requestClient (MediaUpload TimelineUpdate'{..} body)
= go _tuId (Just AltJSON) (Just Multipart) _tuPayload
body
mirrorService
where _ :<|> go
= buildClient (Proxy :: Proxy TimelineUpdateResource)
mempty