{-# 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.ObjectAccessControls.Insert
(
ObjectAccessControlsInsertResource
, objectAccessControlsInsert
, ObjectAccessControlsInsert
, oaciBucket
, oaciPayload
, oaciObject
, oaciGeneration
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type ObjectAccessControlsInsertResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
"o" :>
Capture "object" Text :>
"acl" :>
QueryParam "generation" (Textual Int64) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ObjectAccessControl :>
Post '[JSON] ObjectAccessControl
-- | Creates a new ACL entry on the specified object.
--
-- /See:/ 'objectAccessControlsInsert' smart constructor.
data ObjectAccessControlsInsert = ObjectAccessControlsInsert'
{ _oaciBucket :: !Text
, _oaciPayload :: !ObjectAccessControl
, _oaciObject :: !Text
, _oaciGeneration :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'ObjectAccessControlsInsert' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'oaciBucket'
--
-- * 'oaciPayload'
--
-- * 'oaciObject'
--
-- * 'oaciGeneration'
objectAccessControlsInsert
:: Text -- ^ 'oaciBucket'
-> ObjectAccessControl -- ^ 'oaciPayload'
-> Text -- ^ 'oaciObject'
-> ObjectAccessControlsInsert
objectAccessControlsInsert pOaciBucket_ pOaciPayload_ pOaciObject_ =
ObjectAccessControlsInsert'
{ _oaciBucket = pOaciBucket_
, _oaciPayload = pOaciPayload_
, _oaciObject = pOaciObject_
, _oaciGeneration = Nothing
}
-- | Name of a bucket.
oaciBucket :: Lens' ObjectAccessControlsInsert Text
oaciBucket
= lens _oaciBucket (\ s a -> s{_oaciBucket = a})
-- | Multipart request metadata.
oaciPayload :: Lens' ObjectAccessControlsInsert ObjectAccessControl
oaciPayload
= lens _oaciPayload (\ s a -> s{_oaciPayload = a})
-- | Name of the object. For information about how to URL encode object names
-- to be path safe, see Encoding URI Path Parts.
oaciObject :: Lens' ObjectAccessControlsInsert Text
oaciObject
= lens _oaciObject (\ s a -> s{_oaciObject = a})
-- | If present, selects a specific revision of this object (as opposed to
-- the latest version, the default).
oaciGeneration :: Lens' ObjectAccessControlsInsert (Maybe Int64)
oaciGeneration
= lens _oaciGeneration
(\ s a -> s{_oaciGeneration = a})
. mapping _Coerce
instance GoogleRequest ObjectAccessControlsInsert
where
type Rs ObjectAccessControlsInsert =
ObjectAccessControl
type Scopes ObjectAccessControlsInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control"]
requestClient ObjectAccessControlsInsert'{..}
= go _oaciBucket _oaciObject _oaciGeneration
(Just AltJSON)
_oaciPayload
storageService
where go
= buildClient
(Proxy :: Proxy ObjectAccessControlsInsertResource)
mempty