module Network.Google.Resource.Storage.Objects.Get
(
ObjectsGetResource
, objectsGet
, ObjectsGet
, ogIfMetagenerationMatch
, ogIfGenerationNotMatch
, ogIfGenerationMatch
, ogBucket
, 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 "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 "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
, _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_
, _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})
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
requestClient ObjectsGet{..}
= go _ogBucket _ogObject _ogIfMetagenerationMatch
_ogIfGenerationNotMatch
_ogIfGenerationMatch
_ogIfMetagenerationNotMatch
_ogProjection
_ogGeneration
(Just AltJSON)
storageService
where go :<|> _
= buildClient (Proxy :: Proxy ObjectsGetResource)
mempty
instance GoogleRequest (MediaDownload ObjectsGet)
where
type Rs (MediaDownload ObjectsGet) = Stream
requestClient (MediaDownload ObjectsGet{..})
= go _ogBucket _ogObject _ogIfMetagenerationMatch
_ogIfGenerationNotMatch
_ogIfGenerationMatch
_ogIfMetagenerationNotMatch
_ogProjection
_ogGeneration
(Just AltMedia)
storageService
where _ :<|> go
= buildClient (Proxy :: Proxy ObjectsGetResource)
mempty