{-# 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.Buckets.Insert
(
BucketsInsertResource
, bucketsInsert
, BucketsInsert
, biProject
, biPredefinedACL
, biPayload
, biPredefinedDefaultObjectACL
, biUserProject
, biProjection
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type BucketsInsertResource =
"storage" :>
"v1" :>
"b" :>
QueryParam "project" Text :>
QueryParam "predefinedAcl" BucketsInsertPredefinedACL
:>
QueryParam "predefinedDefaultObjectAcl"
BucketsInsertPredefinedDefaultObjectACL
:>
QueryParam "userProject" Text :>
QueryParam "projection" BucketsInsertProjection :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Bucket :> Post '[JSON] Bucket
data BucketsInsert = BucketsInsert'
{ _biProject :: !Text
, _biPredefinedACL :: !(Maybe BucketsInsertPredefinedACL)
, _biPayload :: !Bucket
, _biPredefinedDefaultObjectACL :: !(Maybe BucketsInsertPredefinedDefaultObjectACL)
, _biUserProject :: !(Maybe Text)
, _biProjection :: !(Maybe BucketsInsertProjection)
} deriving (Eq,Show,Data,Typeable,Generic)
bucketsInsert
:: Text
-> Bucket
-> BucketsInsert
bucketsInsert pBiProject_ pBiPayload_ =
BucketsInsert'
{ _biProject = pBiProject_
, _biPredefinedACL = Nothing
, _biPayload = pBiPayload_
, _biPredefinedDefaultObjectACL = Nothing
, _biUserProject = Nothing
, _biProjection = Nothing
}
biProject :: Lens' BucketsInsert Text
biProject
= lens _biProject (\ s a -> s{_biProject = a})
biPredefinedACL :: Lens' BucketsInsert (Maybe BucketsInsertPredefinedACL)
biPredefinedACL
= lens _biPredefinedACL
(\ s a -> s{_biPredefinedACL = a})
biPayload :: Lens' BucketsInsert Bucket
biPayload
= lens _biPayload (\ s a -> s{_biPayload = a})
biPredefinedDefaultObjectACL :: Lens' BucketsInsert (Maybe BucketsInsertPredefinedDefaultObjectACL)
biPredefinedDefaultObjectACL
= lens _biPredefinedDefaultObjectACL
(\ s a -> s{_biPredefinedDefaultObjectACL = a})
biUserProject :: Lens' BucketsInsert (Maybe Text)
biUserProject
= lens _biUserProject
(\ s a -> s{_biUserProject = a})
biProjection :: Lens' BucketsInsert (Maybe BucketsInsertProjection)
biProjection
= lens _biProjection (\ s a -> s{_biProjection = a})
instance GoogleRequest BucketsInsert where
type Rs BucketsInsert = Bucket
type Scopes BucketsInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/devstorage.read_write"]
requestClient BucketsInsert'{..}
= go (Just _biProject) _biPredefinedACL
_biPredefinedDefaultObjectACL
_biUserProject
_biProjection
(Just AltJSON)
_biPayload
storageService
where go
= buildClient (Proxy :: Proxy BucketsInsertResource)
mempty