{-# 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.Storage.Objects.Get
(
ObjectsGetResource
, objectsGet
, ObjectsGet
, ogIfMetagenerationMatch
, ogIfGenerationNotMatch
, ogIfGenerationMatch
, ogBucket
, ogUserProject
, ogIfMetagenerationNotMatch
, ogObject
, ogProjection
, ogGeneration
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type ObjectsGetResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
"o" :>
Capture "object" Text :>
QueryParam "ifMetagenerationMatch" (Textual Int64) :>
QueryParam "ifGenerationNotMatch" (Textual Int64) :>
QueryParam "ifGenerationMatch" (Textual Int64) :>
QueryParam "userProject" Text :>
QueryParam "ifMetagenerationNotMatch" (Textual Int64)
:>
QueryParam "projection" ObjectsGetProjection :>
QueryParam "generation" (Textual Int64) :>
QueryParam "alt" AltJSON :> Get '[JSON] Object
:<|>
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
"o" :>
Capture "object" Text :>
QueryParam "ifMetagenerationMatch" (Textual Int64) :>
QueryParam "ifGenerationNotMatch" (Textual Int64) :>
QueryParam "ifGenerationMatch" (Textual Int64) :>
QueryParam "userProject" Text :>
QueryParam "ifMetagenerationNotMatch" (Textual Int64)
:>
QueryParam "projection" ObjectsGetProjection :>
QueryParam "generation" (Textual Int64) :>
QueryParam "alt" AltMedia :>
Get '[OctetStream] Stream
data ObjectsGet = ObjectsGet'
{ _ogIfMetagenerationMatch :: !(Maybe (Textual Int64))
, _ogIfGenerationNotMatch :: !(Maybe (Textual Int64))
, _ogIfGenerationMatch :: !(Maybe (Textual Int64))
, _ogBucket :: !Text
, _ogUserProject :: !(Maybe Text)
, _ogIfMetagenerationNotMatch :: !(Maybe (Textual Int64))
, _ogObject :: !Text
, _ogProjection :: !(Maybe ObjectsGetProjection)
, _ogGeneration :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
objectsGet
:: Text
-> Text
-> ObjectsGet
objectsGet pOgBucket_ pOgObject_ =
ObjectsGet'
{ _ogIfMetagenerationMatch = Nothing
, _ogIfGenerationNotMatch = Nothing
, _ogIfGenerationMatch = Nothing
, _ogBucket = pOgBucket_
, _ogUserProject = Nothing
, _ogIfMetagenerationNotMatch = Nothing
, _ogObject = pOgObject_
, _ogProjection = Nothing
, _ogGeneration = Nothing
}
ogIfMetagenerationMatch :: Lens' ObjectsGet (Maybe Int64)
ogIfMetagenerationMatch
= lens _ogIfMetagenerationMatch
(\ s a -> s{_ogIfMetagenerationMatch = a})
. mapping _Coerce
ogIfGenerationNotMatch :: Lens' ObjectsGet (Maybe Int64)
ogIfGenerationNotMatch
= lens _ogIfGenerationNotMatch
(\ s a -> s{_ogIfGenerationNotMatch = a})
. mapping _Coerce
ogIfGenerationMatch :: Lens' ObjectsGet (Maybe Int64)
ogIfGenerationMatch
= lens _ogIfGenerationMatch
(\ s a -> s{_ogIfGenerationMatch = a})
. mapping _Coerce
ogBucket :: Lens' ObjectsGet Text
ogBucket = lens _ogBucket (\ s a -> s{_ogBucket = a})
ogUserProject :: Lens' ObjectsGet (Maybe Text)
ogUserProject
= lens _ogUserProject
(\ s a -> s{_ogUserProject = a})
ogIfMetagenerationNotMatch :: Lens' ObjectsGet (Maybe Int64)
ogIfMetagenerationNotMatch
= lens _ogIfMetagenerationNotMatch
(\ s a -> s{_ogIfMetagenerationNotMatch = a})
. mapping _Coerce
ogObject :: Lens' ObjectsGet Text
ogObject = lens _ogObject (\ s a -> s{_ogObject = a})
ogProjection :: Lens' ObjectsGet (Maybe ObjectsGetProjection)
ogProjection
= lens _ogProjection (\ s a -> s{_ogProjection = a})
ogGeneration :: Lens' ObjectsGet (Maybe Int64)
ogGeneration
= lens _ogGeneration (\ s a -> s{_ogGeneration = a})
. mapping _Coerce
instance GoogleRequest ObjectsGet where
type Rs ObjectsGet = Object
type Scopes ObjectsGet =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/devstorage.read_write"]
requestClient ObjectsGet'{..}
= go _ogBucket _ogObject _ogIfMetagenerationMatch
_ogIfGenerationNotMatch
_ogIfGenerationMatch
_ogUserProject
_ogIfMetagenerationNotMatch
_ogProjection
_ogGeneration
(Just AltJSON)
storageService
where go :<|> _
= buildClient (Proxy :: Proxy ObjectsGetResource)
mempty
instance GoogleRequest (MediaDownload ObjectsGet)
where
type Rs (MediaDownload ObjectsGet) = Stream
type Scopes (MediaDownload ObjectsGet) =
Scopes ObjectsGet
requestClient (MediaDownload ObjectsGet'{..})
= go _ogBucket _ogObject _ogIfMetagenerationMatch
_ogIfGenerationNotMatch
_ogIfGenerationMatch
_ogUserProject
_ogIfMetagenerationNotMatch
_ogProjection
_ogGeneration
(Just AltMedia)
storageService
where _ :<|> go
= buildClient (Proxy :: Proxy ObjectsGetResource)
mempty