Skip to content

Commit

Permalink
Regenerating Redshift from latest service definition
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanhay committed May 4, 2016
1 parent 488c620 commit baffabf
Show file tree
Hide file tree
Showing 12 changed files with 300 additions and 5 deletions.
1 change: 1 addition & 0 deletions amazonka-redshift/amazonka-redshift.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ library
, Network.AWS.Redshift.EnableLogging
, Network.AWS.Redshift.EnableSnapshotCopy
, Network.AWS.Redshift.ModifyCluster
, Network.AWS.Redshift.ModifyClusterIAMRoles
, Network.AWS.Redshift.ModifyClusterParameterGroup
, Network.AWS.Redshift.ModifyClusterSubnetGroup
, Network.AWS.Redshift.ModifyEventSubscription
Expand Down
Empty file.
Empty file.
11 changes: 11 additions & 0 deletions amazonka-redshift/gen/Network/AWS/Redshift.hs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,9 @@ module Network.AWS.Redshift
-- ** ModifySnapshotCopyRetentionPeriod
, module Network.AWS.Redshift.ModifySnapshotCopyRetentionPeriod

-- ** ModifyClusterIAMRoles
, module Network.AWS.Redshift.ModifyClusterIAMRoles

-- ** AuthorizeSnapshotAccess
, module Network.AWS.Redshift.AuthorizeSnapshotAccess

Expand Down Expand Up @@ -537,6 +540,7 @@ module Network.AWS.Redshift
, cAvailabilityZone
, cVPCSecurityGroups
, cHSMStatus
, cIAMRoles
, cElasticIPStatus
, cClusterVersion
, cNodeType
Expand All @@ -549,6 +553,12 @@ module Network.AWS.Redshift
, cClusterNodes
, cDBName

-- ** ClusterIAMRole
, ClusterIAMRole
, clusterIAMRole
, cirIAMRoleARN
, cirApplyStatus

-- ** ClusterNode
, ClusterNode
, clusterNode
Expand Down Expand Up @@ -940,6 +950,7 @@ import Network.AWS.Redshift.DisableSnapshotCopy
import Network.AWS.Redshift.EnableLogging
import Network.AWS.Redshift.EnableSnapshotCopy
import Network.AWS.Redshift.ModifyCluster
import Network.AWS.Redshift.ModifyClusterIAMRoles
import Network.AWS.Redshift.ModifyClusterParameterGroup
import Network.AWS.Redshift.ModifyClusterSubnetGroup
import Network.AWS.Redshift.ModifyEventSubscription
Expand Down
16 changes: 16 additions & 0 deletions amazonka-redshift/gen/Network/AWS/Redshift/CreateCluster.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module Network.AWS.Redshift.CreateCluster
, ccKMSKeyId
, ccAvailabilityZone
, ccVPCSecurityGroupIds
, ccIAMRoles
, ccClusterType
, ccClusterVersion
, ccAllowVersionUpgrade
Expand Down Expand Up @@ -91,6 +92,7 @@ data CreateCluster = CreateCluster'
, _ccKMSKeyId :: !(Maybe Text)
, _ccAvailabilityZone :: !(Maybe Text)
, _ccVPCSecurityGroupIds :: !(Maybe [Text])
, _ccIAMRoles :: !(Maybe [Text])
, _ccClusterType :: !(Maybe Text)
, _ccClusterVersion :: !(Maybe Text)
, _ccAllowVersionUpgrade :: !(Maybe Bool)
Expand Down Expand Up @@ -136,6 +138,8 @@ data CreateCluster = CreateCluster'
--
-- * 'ccVPCSecurityGroupIds'
--
-- * 'ccIAMRoles'
--
-- * 'ccClusterType'
--
-- * 'ccClusterVersion'
Expand Down Expand Up @@ -179,6 +183,7 @@ createCluster pClusterIdentifier_ pNodeType_ pMasterUsername_ pMasterUserPasswor
, _ccKMSKeyId = Nothing
, _ccAvailabilityZone = Nothing
, _ccVPCSecurityGroupIds = Nothing
, _ccIAMRoles = Nothing
, _ccClusterType = Nothing
, _ccClusterVersion = Nothing
, _ccAllowVersionUpgrade = Nothing
Expand Down Expand Up @@ -312,6 +317,15 @@ ccAvailabilityZone = lens _ccAvailabilityZone (\ s a -> s{_ccAvailabilityZone =
ccVPCSecurityGroupIds :: Lens' CreateCluster [Text]
ccVPCSecurityGroupIds = lens _ccVPCSecurityGroupIds (\ s a -> s{_ccVPCSecurityGroupIds = a}) . _Default . _Coerce;

-- | A list of AWS Identity and Access Management (IAM) roles that can be
-- used by the cluster to access other AWS services. You must supply the
-- IAM roles in their Amazon Resource Name (ARN) format. You can supply up
-- to 10 IAM roles in a single request.
--
-- A cluster can have up to 10 IAM roles associated at any time.
ccIAMRoles :: Lens' CreateCluster [Text]
ccIAMRoles = lens _ccIAMRoles (\ s a -> s{_ccIAMRoles = a}) . _Default . _Coerce;

-- | The type of the cluster. When cluster type is specified as
--
-- - 'single-node', the __NumberOfNodes__ parameter is not required.
Expand Down Expand Up @@ -500,6 +514,8 @@ instance ToQuery CreateCluster where
toQuery
(toQueryList "VpcSecurityGroupId" <$>
_ccVPCSecurityGroupIds),
"IamRoles" =:
toQuery (toQueryList "IamRoleArn" <$> _ccIAMRoles),
"ClusterType" =: _ccClusterType,
"ClusterVersion" =: _ccClusterVersion,
"AllowVersionUpgrade" =: _ccAllowVersionUpgrade,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
-- Lists the status of one or more table restore requests made using the
-- < RestoreTableFromClusterSnapshot> API action. If you don\'t specify a
-- value for the 'TableRestoreRequestId' parameter, then
-- 'DescribeTableRestoreStatus' returns the status of all in-progress table
-- restore requests. Otherwise 'DescribeTableRestoreStatus' returns the
-- status of the table specified by 'TableRestoreRequestId'.
-- 'DescribeTableRestoreStatus' returns the status of all table restore
-- requests ordered by the date and time of the request in ascending order.
-- Otherwise 'DescribeTableRestoreStatus' returns the status of the table
-- specified by 'TableRestoreRequestId'.
module Network.AWS.Redshift.DescribeTableRestoreStatus
(
-- * Creating a Request
Expand Down
158 changes: 158 additions & 0 deletions amazonka-redshift/gen/Network/AWS/Redshift/ModifyClusterIAMRoles.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{-# 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.Redshift.ModifyClusterIAMRoles
-- 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)
--
-- Modifies the list of AWS Identity and Access Management (IAM) roles that
-- can be used by the cluster to access other AWS services.
--
-- A cluster can have up to 10 IAM roles associated at any time.
module Network.AWS.Redshift.ModifyClusterIAMRoles
(
-- * Creating a Request
modifyClusterIAMRoles
, ModifyClusterIAMRoles
-- * Request Lenses
, mcirRemoveIAMRoles
, mcirAddIAMRoles
, mcirClusterIdentifier

-- * Destructuring the Response
, modifyClusterIAMRolesResponse
, ModifyClusterIAMRolesResponse
-- * Response Lenses
, mcirrsCluster
, mcirrsResponseStatus
) where

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

-- |
--
-- /See:/ 'modifyClusterIAMRoles' smart constructor.
data ModifyClusterIAMRoles = ModifyClusterIAMRoles'
{ _mcirRemoveIAMRoles :: !(Maybe [Text])
, _mcirAddIAMRoles :: !(Maybe [Text])
, _mcirClusterIdentifier :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ModifyClusterIAMRoles' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'mcirRemoveIAMRoles'
--
-- * 'mcirAddIAMRoles'
--
-- * 'mcirClusterIdentifier'
modifyClusterIAMRoles
:: Text -- ^ 'mcirClusterIdentifier'
-> ModifyClusterIAMRoles
modifyClusterIAMRoles pClusterIdentifier_ =
ModifyClusterIAMRoles'
{ _mcirRemoveIAMRoles = Nothing
, _mcirAddIAMRoles = Nothing
, _mcirClusterIdentifier = pClusterIdentifier_
}

-- | Zero or more IAM roles (in their ARN format) to disassociate from the
-- cluster. You can disassociate up to 10 IAM roles from a single cluster
-- in a single request.
mcirRemoveIAMRoles :: Lens' ModifyClusterIAMRoles [Text]
mcirRemoveIAMRoles = lens _mcirRemoveIAMRoles (\ s a -> s{_mcirRemoveIAMRoles = a}) . _Default . _Coerce;

-- | Zero or more IAM roles (in their ARN format) to associate with the
-- cluster. You can associate up to 10 IAM roles with a single cluster in a
-- single request.
mcirAddIAMRoles :: Lens' ModifyClusterIAMRoles [Text]
mcirAddIAMRoles = lens _mcirAddIAMRoles (\ s a -> s{_mcirAddIAMRoles = a}) . _Default . _Coerce;

-- | The unique identifier of the cluster for which you want to associate or
-- disassociate IAM roles.
mcirClusterIdentifier :: Lens' ModifyClusterIAMRoles Text
mcirClusterIdentifier = lens _mcirClusterIdentifier (\ s a -> s{_mcirClusterIdentifier = a});

instance AWSRequest ModifyClusterIAMRoles where
type Rs ModifyClusterIAMRoles =
ModifyClusterIAMRolesResponse
request = postQuery redshift
response
= receiveXMLWrapper "ModifyClusterIamRolesResult"
(\ s h x ->
ModifyClusterIAMRolesResponse' <$>
(x .@? "Cluster") <*> (pure (fromEnum s)))

instance Hashable ModifyClusterIAMRoles

instance NFData ModifyClusterIAMRoles

instance ToHeaders ModifyClusterIAMRoles where
toHeaders = const mempty

instance ToPath ModifyClusterIAMRoles where
toPath = const "/"

instance ToQuery ModifyClusterIAMRoles where
toQuery ModifyClusterIAMRoles'{..}
= mconcat
["Action" =: ("ModifyClusterIamRoles" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"RemoveIamRoles" =:
toQuery
(toQueryList "IamRoleArn" <$> _mcirRemoveIAMRoles),
"AddIamRoles" =:
toQuery
(toQueryList "IamRoleArn" <$> _mcirAddIAMRoles),
"ClusterIdentifier" =: _mcirClusterIdentifier]

-- | /See:/ 'modifyClusterIAMRolesResponse' smart constructor.
data ModifyClusterIAMRolesResponse = ModifyClusterIAMRolesResponse'
{ _mcirrsCluster :: !(Maybe Cluster)
, _mcirrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ModifyClusterIAMRolesResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'mcirrsCluster'
--
-- * 'mcirrsResponseStatus'
modifyClusterIAMRolesResponse
:: Int -- ^ 'mcirrsResponseStatus'
-> ModifyClusterIAMRolesResponse
modifyClusterIAMRolesResponse pResponseStatus_ =
ModifyClusterIAMRolesResponse'
{ _mcirrsCluster = Nothing
, _mcirrsResponseStatus = pResponseStatus_
}

-- | Undocumented member.
mcirrsCluster :: Lens' ModifyClusterIAMRolesResponse (Maybe Cluster)
mcirrsCluster = lens _mcirrsCluster (\ s a -> s{_mcirrsCluster = a});

-- | The response status code.
mcirrsResponseStatus :: Lens' ModifyClusterIAMRolesResponse Int
mcirrsResponseStatus = lens _mcirrsResponseStatus (\ s a -> s{_mcirrsResponseStatus = a});

instance NFData ModifyClusterIAMRolesResponse
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module Network.AWS.Redshift.RestoreFromClusterSnapshot
, rfcsKMSKeyId
, rfcsAvailabilityZone
, rfcsVPCSecurityGroupIds
, rfcsIAMRoles
, rfcsOwnerAccount
, rfcsNodeType
, rfcsAllowVersionUpgrade
Expand Down Expand Up @@ -93,6 +94,7 @@ data RestoreFromClusterSnapshot = RestoreFromClusterSnapshot'
, _rfcsKMSKeyId :: !(Maybe Text)
, _rfcsAvailabilityZone :: !(Maybe Text)
, _rfcsVPCSecurityGroupIds :: !(Maybe [Text])
, _rfcsIAMRoles :: !(Maybe [Text])
, _rfcsOwnerAccount :: !(Maybe Text)
, _rfcsNodeType :: !(Maybe Text)
, _rfcsAllowVersionUpgrade :: !(Maybe Bool)
Expand Down Expand Up @@ -132,6 +134,8 @@ data RestoreFromClusterSnapshot = RestoreFromClusterSnapshot'
--
-- * 'rfcsVPCSecurityGroupIds'
--
-- * 'rfcsIAMRoles'
--
-- * 'rfcsOwnerAccount'
--
-- * 'rfcsNodeType'
Expand Down Expand Up @@ -164,6 +168,7 @@ restoreFromClusterSnapshot pClusterIdentifier_ pSnapshotIdentifier_ =
, _rfcsKMSKeyId = Nothing
, _rfcsAvailabilityZone = Nothing
, _rfcsVPCSecurityGroupIds = Nothing
, _rfcsIAMRoles = Nothing
, _rfcsOwnerAccount = Nothing
, _rfcsNodeType = Nothing
, _rfcsAllowVersionUpgrade = Nothing
Expand Down Expand Up @@ -269,6 +274,15 @@ rfcsAvailabilityZone = lens _rfcsAvailabilityZone (\ s a -> s{_rfcsAvailabilityZ
rfcsVPCSecurityGroupIds :: Lens' RestoreFromClusterSnapshot [Text]
rfcsVPCSecurityGroupIds = lens _rfcsVPCSecurityGroupIds (\ s a -> s{_rfcsVPCSecurityGroupIds = a}) . _Default . _Coerce;

-- | A list of AWS Identity and Access Management (IAM) roles that can be
-- used by the cluster to access other AWS services. You must supply the
-- IAM roles in their Amazon Resource Name (ARN) format. You can supply up
-- to 10 IAM roles in a single request.
--
-- A cluster can have up to 10 IAM roles associated at any time.
rfcsIAMRoles :: Lens' RestoreFromClusterSnapshot [Text]
rfcsIAMRoles = lens _rfcsIAMRoles (\ s a -> s{_rfcsIAMRoles = a}) . _Default . _Coerce;

-- | The AWS customer account used to create or copy the snapshot. Required
-- if you are restoring a snapshot you do not own, optional if you own the
-- snapshot.
Expand Down Expand Up @@ -391,6 +405,8 @@ instance ToQuery RestoreFromClusterSnapshot where
toQuery
(toQueryList "VpcSecurityGroupId" <$>
_rfcsVPCSecurityGroupIds),
"IamRoles" =:
toQuery (toQueryList "IamRoleArn" <$> _rfcsIAMRoles),
"OwnerAccount" =: _rfcsOwnerAccount,
"NodeType" =: _rfcsNodeType,
"AllowVersionUpgrade" =: _rfcsAllowVersionUpgrade,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ rtfcsTargetDatabaseName :: Lens' RestoreTableFromClusterSnapshot (Maybe Text)
rtfcsTargetDatabaseName = lens _rtfcsTargetDatabaseName (\ s a -> s{_rtfcsTargetDatabaseName = a});

-- | The name of the source schema that contains the table to restore from.
-- If you do not specify a 'SourceSchemaName' value, the default is
-- 'public'.
rtfcsSourceSchemaName :: Lens' RestoreTableFromClusterSnapshot (Maybe Text)
rtfcsSourceSchemaName = lens _rtfcsSourceSchemaName (\ s a -> s{_rtfcsSourceSchemaName = a});

Expand Down
9 changes: 9 additions & 0 deletions amazonka-redshift/gen/Network/AWS/Redshift/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ module Network.AWS.Redshift.Types
, cAvailabilityZone
, cVPCSecurityGroups
, cHSMStatus
, cIAMRoles
, cElasticIPStatus
, cClusterVersion
, cNodeType
Expand All @@ -154,6 +155,12 @@ module Network.AWS.Redshift.Types
, cClusterNodes
, cDBName

-- * ClusterIAMRole
, ClusterIAMRole
, clusterIAMRole
, cirIAMRoleARN
, cirApplyStatus

-- * ClusterNode
, ClusterNode
, clusterNode
Expand Down Expand Up @@ -529,6 +536,8 @@ redshift =
| has (hasCode "ThrottlingException" . hasStatus 400) e =
Just "throttling_exception"
| has (hasCode "Throttling" . hasStatus 400) e = Just "throttling"
| has (hasStatus 504) e = Just "gateway_timeout"
| has (hasStatus 502) e = Just "bad_gateway"
| has (hasStatus 503) e = Just "service_unavailable"
| has (hasStatus 500) e = Just "general_server_error"
| has (hasStatus 509) e = Just "limit_exceeded"
Expand Down
Loading

0 comments on commit baffabf

Please sign in to comment.