{-# 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.Insert
(
TimelineInsertResource
, timelineInsert
, TimelineInsert
, tiPayload
) where
import Network.Google.Mirror.Types
import Network.Google.Prelude
type TimelineInsertResource =
"mirror" :>
"v1" :>
"timeline" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] TimelineItem :>
Post '[JSON] TimelineItem
:<|>
"upload" :>
"mirror" :>
"v1" :>
"timeline" :>
QueryParam "alt" AltJSON :>
QueryParam "uploadType" Multipart :>
MultipartRelated '[JSON] TimelineItem :>
Post '[JSON] TimelineItem
newtype TimelineInsert = TimelineInsert'
{ _tiPayload :: TimelineItem
} deriving (Eq,Show,Data,Typeable,Generic)
timelineInsert
:: TimelineItem
-> TimelineInsert
timelineInsert pTiPayload_ =
TimelineInsert'
{ _tiPayload = pTiPayload_
}
tiPayload :: Lens' TimelineInsert TimelineItem
tiPayload
= lens _tiPayload (\ s a -> s{_tiPayload = a})
instance GoogleRequest TimelineInsert where
type Rs TimelineInsert = TimelineItem
type Scopes TimelineInsert =
'["https://www.googleapis.com/auth/glass.location",
"https://www.googleapis.com/auth/glass.timeline"]
requestClient TimelineInsert'{..}
= go (Just AltJSON) _tiPayload mirrorService
where go :<|> _
= buildClient (Proxy :: Proxy TimelineInsertResource)
mempty
instance GoogleRequest (MediaUpload TimelineInsert)
where
type Rs (MediaUpload TimelineInsert) = TimelineItem
type Scopes (MediaUpload TimelineInsert) =
Scopes TimelineInsert
requestClient (MediaUpload TimelineInsert'{..} body)
= go (Just AltJSON) (Just Multipart) _tiPayload body
mirrorService
where _ :<|> go
= buildClient (Proxy :: Proxy TimelineInsertResource)
mempty