{-# 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.DefaultObjectAccessControls.Insert
(
DefaultObjectAccessControlsInsertResource
, defaultObjectAccessControlsInsert
, DefaultObjectAccessControlsInsert
, doaciBucket
, doaciPayload
, doaciUserProject
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type DefaultObjectAccessControlsInsertResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
"defaultObjectAcl" :>
QueryParam "userProject" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ObjectAccessControl :>
Post '[JSON] ObjectAccessControl
data DefaultObjectAccessControlsInsert = DefaultObjectAccessControlsInsert'
{ _doaciBucket :: !Text
, _doaciPayload :: !ObjectAccessControl
, _doaciUserProject :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
defaultObjectAccessControlsInsert
:: Text
-> ObjectAccessControl
-> DefaultObjectAccessControlsInsert
defaultObjectAccessControlsInsert pDoaciBucket_ pDoaciPayload_ =
DefaultObjectAccessControlsInsert'
{ _doaciBucket = pDoaciBucket_
, _doaciPayload = pDoaciPayload_
, _doaciUserProject = Nothing
}
doaciBucket :: Lens' DefaultObjectAccessControlsInsert Text
doaciBucket
= lens _doaciBucket (\ s a -> s{_doaciBucket = a})
doaciPayload :: Lens' DefaultObjectAccessControlsInsert ObjectAccessControl
doaciPayload
= lens _doaciPayload (\ s a -> s{_doaciPayload = a})
doaciUserProject :: Lens' DefaultObjectAccessControlsInsert (Maybe Text)
doaciUserProject
= lens _doaciUserProject
(\ s a -> s{_doaciUserProject = a})
instance GoogleRequest
DefaultObjectAccessControlsInsert where
type Rs DefaultObjectAccessControlsInsert =
ObjectAccessControl
type Scopes DefaultObjectAccessControlsInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control"]
requestClient DefaultObjectAccessControlsInsert'{..}
= go _doaciBucket _doaciUserProject (Just AltJSON)
_doaciPayload
storageService
where go
= buildClient
(Proxy ::
Proxy DefaultObjectAccessControlsInsertResource)
mempty