{-# 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.Get
(
TimelineAttachmentsGetResource
, timelineAttachmentsGet
, TimelineAttachmentsGet
, tagItemId
, tagAttachmentId
) where
import Network.Google.Mirror.Types
import Network.Google.Prelude
type TimelineAttachmentsGetResource =
"mirror" :>
"v1" :>
"timeline" :>
Capture "itemId" Text :>
"attachments" :>
Capture "attachmentId" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] Attachment
:<|>
"mirror" :>
"v1" :>
"timeline" :>
Capture "itemId" Text :>
"attachments" :>
Capture "attachmentId" Text :>
QueryParam "alt" AltMedia :>
Get '[OctetStream] Stream
data TimelineAttachmentsGet = TimelineAttachmentsGet'
{ _tagItemId :: !Text
, _tagAttachmentId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
timelineAttachmentsGet
:: Text
-> Text
-> TimelineAttachmentsGet
timelineAttachmentsGet pTagItemId_ pTagAttachmentId_ =
TimelineAttachmentsGet'
{ _tagItemId = pTagItemId_
, _tagAttachmentId = pTagAttachmentId_
}
tagItemId :: Lens' TimelineAttachmentsGet Text
tagItemId
= lens _tagItemId (\ s a -> s{_tagItemId = a})
tagAttachmentId :: Lens' TimelineAttachmentsGet Text
tagAttachmentId
= lens _tagAttachmentId
(\ s a -> s{_tagAttachmentId = a})
instance GoogleRequest TimelineAttachmentsGet where
type Rs TimelineAttachmentsGet = Attachment
type Scopes TimelineAttachmentsGet =
'["https://www.googleapis.com/auth/glass.timeline"]
requestClient TimelineAttachmentsGet'{..}
= go _tagItemId _tagAttachmentId (Just AltJSON)
mirrorService
where go :<|> _
= buildClient
(Proxy :: Proxy TimelineAttachmentsGetResource)
mempty
instance GoogleRequest
(MediaDownload TimelineAttachmentsGet) where
type Rs (MediaDownload TimelineAttachmentsGet) =
Stream
type Scopes (MediaDownload TimelineAttachmentsGet) =
Scopes TimelineAttachmentsGet
requestClient
(MediaDownload TimelineAttachmentsGet'{..})
= go _tagItemId _tagAttachmentId (Just AltMedia)
mirrorService
where _ :<|> go
= buildClient
(Proxy :: Proxy TimelineAttachmentsGetResource)
mempty