{-# 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.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 :>
AltMedia :> 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
type Scopes TimelineAttachmentsInsert =
'["https://www.googleapis.com/auth/glass.timeline"]
requestClient TimelineAttachmentsInsert'{..}
= go _taiItemId (Just AltJSON) mirrorService
where go :<|> _
= buildClient
(Proxy :: Proxy TimelineAttachmentsInsertResource)
mempty
instance GoogleRequest
(MediaUpload TimelineAttachmentsInsert) where
type Rs (MediaUpload TimelineAttachmentsInsert) =
Attachment
type Scopes (MediaUpload TimelineAttachmentsInsert) =
Scopes TimelineAttachmentsInsert
requestClient
(MediaUpload TimelineAttachmentsInsert'{..} body)
= go _taiItemId (Just AltJSON) (Just AltMedia) body
mirrorService
where _ :<|> go
= buildClient
(Proxy :: Proxy TimelineAttachmentsInsertResource)
mempty