{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.EC2.ModifySnapshotAttribute
(
modifySnapshotAttribute
, ModifySnapshotAttribute
, msaAttribute
, msaCreateVolumePermission
, msaUserIds
, msaGroupNames
, msaOperationType
, msaDryRun
, msaSnapshotId
, modifySnapshotAttributeResponse
, ModifySnapshotAttributeResponse
) where
import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ModifySnapshotAttribute = ModifySnapshotAttribute'
{ _msaAttribute :: !(Maybe SnapshotAttributeName)
, _msaCreateVolumePermission :: !(Maybe CreateVolumePermissionModifications)
, _msaUserIds :: !(Maybe [Text])
, _msaGroupNames :: !(Maybe [Text])
, _msaOperationType :: !(Maybe OperationType)
, _msaDryRun :: !(Maybe Bool)
, _msaSnapshotId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
modifySnapshotAttribute
:: Text
-> ModifySnapshotAttribute
modifySnapshotAttribute pSnapshotId_ =
ModifySnapshotAttribute'
{ _msaAttribute = Nothing
, _msaCreateVolumePermission = Nothing
, _msaUserIds = Nothing
, _msaGroupNames = Nothing
, _msaOperationType = Nothing
, _msaDryRun = Nothing
, _msaSnapshotId = pSnapshotId_
}
msaAttribute :: Lens' ModifySnapshotAttribute (Maybe SnapshotAttributeName)
msaAttribute = lens _msaAttribute (\ s a -> s{_msaAttribute = a})
msaCreateVolumePermission :: Lens' ModifySnapshotAttribute (Maybe CreateVolumePermissionModifications)
msaCreateVolumePermission = lens _msaCreateVolumePermission (\ s a -> s{_msaCreateVolumePermission = a})
msaUserIds :: Lens' ModifySnapshotAttribute [Text]
msaUserIds = lens _msaUserIds (\ s a -> s{_msaUserIds = a}) . _Default . _Coerce
msaGroupNames :: Lens' ModifySnapshotAttribute [Text]
msaGroupNames = lens _msaGroupNames (\ s a -> s{_msaGroupNames = a}) . _Default . _Coerce
msaOperationType :: Lens' ModifySnapshotAttribute (Maybe OperationType)
msaOperationType = lens _msaOperationType (\ s a -> s{_msaOperationType = a})
msaDryRun :: Lens' ModifySnapshotAttribute (Maybe Bool)
msaDryRun = lens _msaDryRun (\ s a -> s{_msaDryRun = a})
msaSnapshotId :: Lens' ModifySnapshotAttribute Text
msaSnapshotId = lens _msaSnapshotId (\ s a -> s{_msaSnapshotId = a})
instance AWSRequest ModifySnapshotAttribute where
type Rs ModifySnapshotAttribute =
ModifySnapshotAttributeResponse
request = postQuery ec2
response
= receiveNull ModifySnapshotAttributeResponse'
instance Hashable ModifySnapshotAttribute where
instance NFData ModifySnapshotAttribute where
instance ToHeaders ModifySnapshotAttribute where
toHeaders = const mempty
instance ToPath ModifySnapshotAttribute where
toPath = const "/"
instance ToQuery ModifySnapshotAttribute where
toQuery ModifySnapshotAttribute'{..}
= mconcat
["Action" =:
("ModifySnapshotAttribute" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"Attribute" =: _msaAttribute,
"CreateVolumePermission" =:
_msaCreateVolumePermission,
toQuery (toQueryList "UserId" <$> _msaUserIds),
toQuery (toQueryList "UserGroup" <$> _msaGroupNames),
"OperationType" =: _msaOperationType,
"DryRun" =: _msaDryRun,
"SnapshotId" =: _msaSnapshotId]
data ModifySnapshotAttributeResponse =
ModifySnapshotAttributeResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
modifySnapshotAttributeResponse
:: ModifySnapshotAttributeResponse
modifySnapshotAttributeResponse = ModifySnapshotAttributeResponse'
instance NFData ModifySnapshotAttributeResponse where