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" AltMedia :>
MultipartRelated '[JSON] TimelineItem RequestBody :>
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
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
requestClient (MediaUpload TimelineUpdate{..} body)
= go _tuId (Just AltJSON) (Just AltMedia) _tuPayload
body
mirrorService
where _ :<|> go
= buildClient (Proxy :: Proxy TimelineUpdateResource)
mempty