Skip to content

Commit

Permalink
Regenerating RDS from latest service definition
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanhay committed May 30, 2016
1 parent 93b6b72 commit 98edec9
Show file tree
Hide file tree
Showing 6 changed files with 355 additions and 0 deletions.
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module : Network.AWS.RDS.DescribeDBClusterSnapshotAttributes
-- Copyright : (c) 2013-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns a list of DB cluster snapshot attribute names and values for a
-- manual DB cluster snapshot.
--
-- When sharing snapshots with other AWS accounts,
-- 'DescribeDBClusterSnapshotAttributes' returns the 'restore' attribute
-- and a list of IDs for the AWS accounts that are authorized to copy or
-- restore the manual DB cluster snapshot. If 'all' is included in the list
-- of values for the 'restore' attribute, then the manual DB cluster
-- snapshot is public and can be copied or restored by all AWS accounts.
--
-- To add or remove access for an AWS account to copy or restore a manual
-- DB cluster snapshot, or to make the manual DB cluster snapshot public or
-- private, use the < ModifyDBClusterSnapshotAttribute> API action.
module Network.AWS.RDS.DescribeDBClusterSnapshotAttributes
(
-- * Creating a Request
describeDBClusterSnapshotAttributes
, DescribeDBClusterSnapshotAttributes
-- * Request Lenses
, ddcsaDBClusterSnapshotIdentifier

-- * Destructuring the Response
, describeDBClusterSnapshotAttributesResponse
, DescribeDBClusterSnapshotAttributesResponse
-- * Response Lenses
, ddcsarsDBClusterSnapshotAttributesResult
, ddcsarsResponseStatus
) where

import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response

-- |
--
-- /See:/ 'describeDBClusterSnapshotAttributes' smart constructor.
newtype DescribeDBClusterSnapshotAttributes = DescribeDBClusterSnapshotAttributes'
{ _ddcsaDBClusterSnapshotIdentifier :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DescribeDBClusterSnapshotAttributes' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ddcsaDBClusterSnapshotIdentifier'
describeDBClusterSnapshotAttributes
:: Text -- ^ 'ddcsaDBClusterSnapshotIdentifier'
-> DescribeDBClusterSnapshotAttributes
describeDBClusterSnapshotAttributes pDBClusterSnapshotIdentifier_ =
DescribeDBClusterSnapshotAttributes'
{ _ddcsaDBClusterSnapshotIdentifier = pDBClusterSnapshotIdentifier_
}

-- | The identifier for the DB cluster snapshot to describe the attributes
-- for.
ddcsaDBClusterSnapshotIdentifier :: Lens' DescribeDBClusterSnapshotAttributes Text
ddcsaDBClusterSnapshotIdentifier = lens _ddcsaDBClusterSnapshotIdentifier (\ s a -> s{_ddcsaDBClusterSnapshotIdentifier = a});

instance AWSRequest
DescribeDBClusterSnapshotAttributes where
type Rs DescribeDBClusterSnapshotAttributes =
DescribeDBClusterSnapshotAttributesResponse
request = postQuery rds
response
= receiveXMLWrapper
"DescribeDBClusterSnapshotAttributesResult"
(\ s h x ->
DescribeDBClusterSnapshotAttributesResponse' <$>
(x .@? "DBClusterSnapshotAttributesResult") <*>
(pure (fromEnum s)))

instance Hashable DescribeDBClusterSnapshotAttributes

instance NFData DescribeDBClusterSnapshotAttributes

instance ToHeaders
DescribeDBClusterSnapshotAttributes where
toHeaders = const mempty

instance ToPath DescribeDBClusterSnapshotAttributes
where
toPath = const "/"

instance ToQuery DescribeDBClusterSnapshotAttributes
where
toQuery DescribeDBClusterSnapshotAttributes'{..}
= mconcat
["Action" =:
("DescribeDBClusterSnapshotAttributes" ::
ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"DBClusterSnapshotIdentifier" =:
_ddcsaDBClusterSnapshotIdentifier]

-- | /See:/ 'describeDBClusterSnapshotAttributesResponse' smart constructor.
data DescribeDBClusterSnapshotAttributesResponse = DescribeDBClusterSnapshotAttributesResponse'
{ _ddcsarsDBClusterSnapshotAttributesResult :: !(Maybe DBClusterSnapshotAttributesResult)
, _ddcsarsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DescribeDBClusterSnapshotAttributesResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ddcsarsDBClusterSnapshotAttributesResult'
--
-- * 'ddcsarsResponseStatus'
describeDBClusterSnapshotAttributesResponse
:: Int -- ^ 'ddcsarsResponseStatus'
-> DescribeDBClusterSnapshotAttributesResponse
describeDBClusterSnapshotAttributesResponse pResponseStatus_ =
DescribeDBClusterSnapshotAttributesResponse'
{ _ddcsarsDBClusterSnapshotAttributesResult = Nothing
, _ddcsarsResponseStatus = pResponseStatus_
}

-- | Undocumented member.
ddcsarsDBClusterSnapshotAttributesResult :: Lens' DescribeDBClusterSnapshotAttributesResponse (Maybe DBClusterSnapshotAttributesResult)
ddcsarsDBClusterSnapshotAttributesResult = lens _ddcsarsDBClusterSnapshotAttributesResult (\ s a -> s{_ddcsarsDBClusterSnapshotAttributesResult = a});

-- | The response status code.
ddcsarsResponseStatus :: Lens' DescribeDBClusterSnapshotAttributesResponse Int
ddcsarsResponseStatus = lens _ddcsarsResponseStatus (\ s a -> s{_ddcsarsResponseStatus = a});

instance NFData
DescribeDBClusterSnapshotAttributesResponse
206 changes: 206 additions & 0 deletions amazonka-rds/gen/Network/AWS/RDS/ModifyDBClusterSnapshotAttribute.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module : Network.AWS.RDS.ModifyDBClusterSnapshotAttribute
-- Copyright : (c) 2013-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Adds an attribute and values to, or removes an attribute and values
-- from, a manual DB cluster snapshot.
--
-- To share a manual DB cluster snapshot with other AWS accounts, specify
-- 'restore' as the 'AttributeName' and use the 'ValuesToAdd' parameter to
-- add a list of IDs of the AWS accounts that are authorized to restore the
-- manual DB cluster snapshot. Use the value 'all' to make the manual DB
-- cluster snapshot public, which means that it can be copied or restored
-- by all AWS accounts. Do not add the 'all' value for any manual DB
-- cluster snapshots that contain private information that you don\'t want
-- available to all AWS accounts.
--
-- To view which AWS accounts have access to copy or restore a manual DB
-- cluster snapshot, or whether a manual DB cluster snapshot public or
-- private, use the < DescribeDBClusterSnapshotAttributes> API action.
--
-- If a manual DB cluster snapshot is encrypted, it cannot be shared.
module Network.AWS.RDS.ModifyDBClusterSnapshotAttribute
(
-- * Creating a Request
modifyDBClusterSnapshotAttribute
, ModifyDBClusterSnapshotAttribute
-- * Request Lenses
, mdcsaValuesToAdd
, mdcsaValuesToRemove
, mdcsaDBClusterSnapshotIdentifier
, mdcsaAttributeName

-- * Destructuring the Response
, modifyDBClusterSnapshotAttributeResponse
, ModifyDBClusterSnapshotAttributeResponse
-- * Response Lenses
, mdcsarsDBClusterSnapshotAttributesResult
, mdcsarsResponseStatus
) where

import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response

-- |
--
-- /See:/ 'modifyDBClusterSnapshotAttribute' smart constructor.
data ModifyDBClusterSnapshotAttribute = ModifyDBClusterSnapshotAttribute'
{ _mdcsaValuesToAdd :: !(Maybe [Text])
, _mdcsaValuesToRemove :: !(Maybe [Text])
, _mdcsaDBClusterSnapshotIdentifier :: !Text
, _mdcsaAttributeName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ModifyDBClusterSnapshotAttribute' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'mdcsaValuesToAdd'
--
-- * 'mdcsaValuesToRemove'
--
-- * 'mdcsaDBClusterSnapshotIdentifier'
--
-- * 'mdcsaAttributeName'
modifyDBClusterSnapshotAttribute
:: Text -- ^ 'mdcsaDBClusterSnapshotIdentifier'
-> Text -- ^ 'mdcsaAttributeName'
-> ModifyDBClusterSnapshotAttribute
modifyDBClusterSnapshotAttribute pDBClusterSnapshotIdentifier_ pAttributeName_ =
ModifyDBClusterSnapshotAttribute'
{ _mdcsaValuesToAdd = Nothing
, _mdcsaValuesToRemove = Nothing
, _mdcsaDBClusterSnapshotIdentifier = pDBClusterSnapshotIdentifier_
, _mdcsaAttributeName = pAttributeName_
}

-- | A list of DB cluster snapshot attributes to add to the attribute
-- specified by 'AttributeName'.
--
-- To authorize other AWS accounts to copy or restore a manual DB cluster
-- snapshot, set this list to include one or more AWS account IDs, or 'all'
-- to make the manual DB cluster snapshot restorable by any AWS account. Do
-- not add the 'all' value for any manual DB cluster snapshots that contain
-- private information that you don\'t want available to all AWS accounts.
mdcsaValuesToAdd :: Lens' ModifyDBClusterSnapshotAttribute [Text]
mdcsaValuesToAdd = lens _mdcsaValuesToAdd (\ s a -> s{_mdcsaValuesToAdd = a}) . _Default . _Coerce;

-- | A list of DB cluster snapshot attributes to remove from the attribute
-- specified by 'AttributeName'.
--
-- To remove authorization for other AWS accounts to copy or restore a
-- manual DB cluster snapshot, set this list to include one or more AWS
-- account identifiers, or 'all' to remove authorization for any AWS
-- account to copy or restore the DB cluster snapshot. If you specify
-- 'all', an AWS account whose account ID is explicitly added to the
-- 'restore' attribute can still copy or restore a manual DB cluster
-- snapshot.
mdcsaValuesToRemove :: Lens' ModifyDBClusterSnapshotAttribute [Text]
mdcsaValuesToRemove = lens _mdcsaValuesToRemove (\ s a -> s{_mdcsaValuesToRemove = a}) . _Default . _Coerce;

-- | The identifier for the DB cluster snapshot to modify the attributes for.
mdcsaDBClusterSnapshotIdentifier :: Lens' ModifyDBClusterSnapshotAttribute Text
mdcsaDBClusterSnapshotIdentifier = lens _mdcsaDBClusterSnapshotIdentifier (\ s a -> s{_mdcsaDBClusterSnapshotIdentifier = a});

-- | The name of the DB cluster snapshot attribute to modify.
--
-- To manage authorization for other AWS accounts to copy or restore a
-- manual DB cluster snapshot, set this value to 'restore'.
mdcsaAttributeName :: Lens' ModifyDBClusterSnapshotAttribute Text
mdcsaAttributeName = lens _mdcsaAttributeName (\ s a -> s{_mdcsaAttributeName = a});

instance AWSRequest ModifyDBClusterSnapshotAttribute
where
type Rs ModifyDBClusterSnapshotAttribute =
ModifyDBClusterSnapshotAttributeResponse
request = postQuery rds
response
= receiveXMLWrapper
"ModifyDBClusterSnapshotAttributeResult"
(\ s h x ->
ModifyDBClusterSnapshotAttributeResponse' <$>
(x .@? "DBClusterSnapshotAttributesResult") <*>
(pure (fromEnum s)))

instance Hashable ModifyDBClusterSnapshotAttribute

instance NFData ModifyDBClusterSnapshotAttribute

instance ToHeaders ModifyDBClusterSnapshotAttribute
where
toHeaders = const mempty

instance ToPath ModifyDBClusterSnapshotAttribute
where
toPath = const "/"

instance ToQuery ModifyDBClusterSnapshotAttribute
where
toQuery ModifyDBClusterSnapshotAttribute'{..}
= mconcat
["Action" =:
("ModifyDBClusterSnapshotAttribute" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"ValuesToAdd" =:
toQuery
(toQueryList "AttributeValue" <$> _mdcsaValuesToAdd),
"ValuesToRemove" =:
toQuery
(toQueryList "AttributeValue" <$>
_mdcsaValuesToRemove),
"DBClusterSnapshotIdentifier" =:
_mdcsaDBClusterSnapshotIdentifier,
"AttributeName" =: _mdcsaAttributeName]

-- | /See:/ 'modifyDBClusterSnapshotAttributeResponse' smart constructor.
data ModifyDBClusterSnapshotAttributeResponse = ModifyDBClusterSnapshotAttributeResponse'
{ _mdcsarsDBClusterSnapshotAttributesResult :: !(Maybe DBClusterSnapshotAttributesResult)
, _mdcsarsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ModifyDBClusterSnapshotAttributeResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'mdcsarsDBClusterSnapshotAttributesResult'
--
-- * 'mdcsarsResponseStatus'
modifyDBClusterSnapshotAttributeResponse
:: Int -- ^ 'mdcsarsResponseStatus'
-> ModifyDBClusterSnapshotAttributeResponse
modifyDBClusterSnapshotAttributeResponse pResponseStatus_ =
ModifyDBClusterSnapshotAttributeResponse'
{ _mdcsarsDBClusterSnapshotAttributesResult = Nothing
, _mdcsarsResponseStatus = pResponseStatus_
}

-- | Undocumented member.
mdcsarsDBClusterSnapshotAttributesResult :: Lens' ModifyDBClusterSnapshotAttributeResponse (Maybe DBClusterSnapshotAttributesResult)
mdcsarsDBClusterSnapshotAttributesResult = lens _mdcsarsDBClusterSnapshotAttributesResult (\ s a -> s{_mdcsarsDBClusterSnapshotAttributesResult = a});

-- | The response status code.
mdcsarsResponseStatus :: Lens' ModifyDBClusterSnapshotAttributeResponse Int
mdcsarsResponseStatus = lens _mdcsarsResponseStatus (\ s a -> s{_mdcsarsResponseStatus = a});

instance NFData
ModifyDBClusterSnapshotAttributeResponse

0 comments on commit 98edec9

Please sign in to comment.