{-# 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
, baciUserProject
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type BucketAccessControlsInsertResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
"acl" :>
QueryParam "userProject" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] BucketAccessControl :>
Post '[JSON] BucketAccessControl
data BucketAccessControlsInsert = BucketAccessControlsInsert'
{ _baciBucket :: !Text
, _baciPayload :: !BucketAccessControl
, _baciUserProject :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
bucketAccessControlsInsert
:: Text
-> BucketAccessControl
-> BucketAccessControlsInsert
bucketAccessControlsInsert pBaciBucket_ pBaciPayload_ =
BucketAccessControlsInsert'
{ _baciBucket = pBaciBucket_
, _baciPayload = pBaciPayload_
, _baciUserProject = Nothing
}
baciBucket :: Lens' BucketAccessControlsInsert Text
baciBucket
= lens _baciBucket (\ s a -> s{_baciBucket = a})
baciPayload :: Lens' BucketAccessControlsInsert BucketAccessControl
baciPayload
= lens _baciPayload (\ s a -> s{_baciPayload = a})
baciUserProject :: Lens' BucketAccessControlsInsert (Maybe Text)
baciUserProject
= lens _baciUserProject
(\ s a -> s{_baciUserProject = 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 _baciUserProject (Just AltJSON)
_baciPayload
storageService
where go
= buildClient
(Proxy :: Proxy BucketAccessControlsInsertResource)
mempty