module Network.Google.Resource.Mirror.Timeline.Attachments.Insert
(
TimelineAttachmentsInsertResource
, timelineAttachmentsInsert
, TimelineAttachmentsInsert
, taiItemId
) where
import Network.Google.Mirror.Types
import Network.Google.Prelude
type TimelineAttachmentsInsertResource =
"mirror" :>
"v1" :>
"timeline" :>
Capture "itemId" Text :>
"attachments" :>
QueryParam "alt" AltJSON :> Post '[JSON] Attachment
:<|>
"upload" :>
"mirror" :>
"v1" :>
"timeline" :>
Capture "itemId" Text :>
"attachments" :>
QueryParam "alt" AltJSON :>
QueryParam "uploadType" AltMedia :>
ReqBody '[OctetStream] RequestBody :>
Post '[JSON] Attachment
newtype TimelineAttachmentsInsert = TimelineAttachmentsInsert
{ _taiItemId :: Text
} deriving (Eq,Show,Data,Typeable,Generic)
timelineAttachmentsInsert
:: Text
-> TimelineAttachmentsInsert
timelineAttachmentsInsert pTaiItemId_ =
TimelineAttachmentsInsert
{ _taiItemId = pTaiItemId_
}
taiItemId :: Lens' TimelineAttachmentsInsert Text
taiItemId
= lens _taiItemId (\ s a -> s{_taiItemId = a})
instance GoogleRequest TimelineAttachmentsInsert
where
type Rs TimelineAttachmentsInsert = Attachment
requestClient TimelineAttachmentsInsert{..}
= go _taiItemId (Just AltJSON) mirrorService
where go :<|> _
= buildClient
(Proxy :: Proxy TimelineAttachmentsInsertResource)
mempty
instance GoogleRequest
(MediaUpload TimelineAttachmentsInsert) where
type Rs (MediaUpload TimelineAttachmentsInsert) =
Attachment
requestClient
(MediaUpload TimelineAttachmentsInsert{..} body)
= go _taiItemId (Just AltJSON) (Just AltMedia) body
mirrorService
where _ :<|> go
= buildClient
(Proxy :: Proxy TimelineAttachmentsInsertResource)
mempty