{-# 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.BucketAccessControls.Insert
(
BucketAccessControlsInsertResource
, bucketAccessControlsInsert
, BucketAccessControlsInsert
, baciBucket
, baciPayload
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type BucketAccessControlsInsertResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
"acl" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] BucketAccessControl :>
Post '[JSON] BucketAccessControl
-- | Creates a new ACL entry on the specified bucket.
--
-- /See:/ 'bucketAccessControlsInsert' smart constructor.
data BucketAccessControlsInsert = BucketAccessControlsInsert'
{ _baciBucket :: !Text
, _baciPayload :: !BucketAccessControl
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'BucketAccessControlsInsert' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'baciBucket'
--
-- * 'baciPayload'
bucketAccessControlsInsert
:: Text -- ^ 'baciBucket'
-> BucketAccessControl -- ^ 'baciPayload'
-> BucketAccessControlsInsert
bucketAccessControlsInsert pBaciBucket_ pBaciPayload_ =
BucketAccessControlsInsert'
{ _baciBucket = pBaciBucket_
, _baciPayload = pBaciPayload_
}
-- | Name of a bucket.
baciBucket :: Lens' BucketAccessControlsInsert Text
baciBucket
= lens _baciBucket (\ s a -> s{_baciBucket = a})
-- | Multipart request metadata.
baciPayload :: Lens' BucketAccessControlsInsert BucketAccessControl
baciPayload
= lens _baciPayload (\ s a -> s{_baciPayload = a})
instance GoogleRequest BucketAccessControlsInsert
where
type Rs BucketAccessControlsInsert =
BucketAccessControl
type Scopes BucketAccessControlsInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control"]
requestClient BucketAccessControlsInsert'{..}
= go _baciBucket (Just AltJSON) _baciPayload
storageService
where go
= buildClient
(Proxy :: Proxy BucketAccessControlsInsertResource)
mempty