{-# 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.Compose
(
ObjectsComposeResource
, objectsCompose
, ObjectsCompose
, oDestinationPredefinedACL
, oIfMetagenerationMatch
, oIfGenerationMatch
, oPayload
, oUserProject
, oDestinationBucket
, oKmsKeyName
, oDestinationObject
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type ObjectsComposeResource =
"storage" :>
"v1" :>
"b" :>
Capture "destinationBucket" Text :>
"o" :>
Capture "destinationObject" Text :>
"compose" :>
QueryParam "destinationPredefinedAcl"
ObjectsComposeDestinationPredefinedACL
:>
QueryParam "ifMetagenerationMatch" (Textual Int64) :>
QueryParam "ifGenerationMatch" (Textual Int64) :>
QueryParam "userProject" Text :>
QueryParam "kmsKeyName" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ComposeRequest :>
Post '[JSON] Object
data ObjectsCompose = ObjectsCompose'
{ _oDestinationPredefinedACL :: !(Maybe ObjectsComposeDestinationPredefinedACL)
, _oIfMetagenerationMatch :: !(Maybe (Textual Int64))
, _oIfGenerationMatch :: !(Maybe (Textual Int64))
, _oPayload :: !ComposeRequest
, _oUserProject :: !(Maybe Text)
, _oDestinationBucket :: !Text
, _oKmsKeyName :: !(Maybe Text)
, _oDestinationObject :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
objectsCompose
:: ComposeRequest
-> Text
-> Text
-> ObjectsCompose
objectsCompose pOPayload_ pODestinationBucket_ pODestinationObject_ =
ObjectsCompose'
{ _oDestinationPredefinedACL = Nothing
, _oIfMetagenerationMatch = Nothing
, _oIfGenerationMatch = Nothing
, _oPayload = pOPayload_
, _oUserProject = Nothing
, _oDestinationBucket = pODestinationBucket_
, _oKmsKeyName = Nothing
, _oDestinationObject = pODestinationObject_
}
oDestinationPredefinedACL :: Lens' ObjectsCompose (Maybe ObjectsComposeDestinationPredefinedACL)
oDestinationPredefinedACL
= lens _oDestinationPredefinedACL
(\ s a -> s{_oDestinationPredefinedACL = a})
oIfMetagenerationMatch :: Lens' ObjectsCompose (Maybe Int64)
oIfMetagenerationMatch
= lens _oIfMetagenerationMatch
(\ s a -> s{_oIfMetagenerationMatch = a})
. mapping _Coerce
oIfGenerationMatch :: Lens' ObjectsCompose (Maybe Int64)
oIfGenerationMatch
= lens _oIfGenerationMatch
(\ s a -> s{_oIfGenerationMatch = a})
. mapping _Coerce
oPayload :: Lens' ObjectsCompose ComposeRequest
oPayload = lens _oPayload (\ s a -> s{_oPayload = a})
oUserProject :: Lens' ObjectsCompose (Maybe Text)
oUserProject
= lens _oUserProject (\ s a -> s{_oUserProject = a})
oDestinationBucket :: Lens' ObjectsCompose Text
oDestinationBucket
= lens _oDestinationBucket
(\ s a -> s{_oDestinationBucket = a})
oKmsKeyName :: Lens' ObjectsCompose (Maybe Text)
oKmsKeyName
= lens _oKmsKeyName (\ s a -> s{_oKmsKeyName = a})
oDestinationObject :: Lens' ObjectsCompose Text
oDestinationObject
= lens _oDestinationObject
(\ s a -> s{_oDestinationObject = a})
instance GoogleRequest ObjectsCompose where
type Rs ObjectsCompose = Object
type Scopes ObjectsCompose =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/devstorage.read_write"]
requestClient ObjectsCompose'{..}
= go _oDestinationBucket _oDestinationObject
_oDestinationPredefinedACL
_oIfMetagenerationMatch
_oIfGenerationMatch
_oUserProject
_oKmsKeyName
(Just AltJSON)
_oPayload
storageService
where go
= buildClient (Proxy :: Proxy ObjectsComposeResource)
mempty