module Network.AWS.Redshift.RestoreFromClusterSnapshot
(
RestoreFromClusterSnapshot
, restoreFromClusterSnapshot
, rfcsAllowVersionUpgrade
, rfcsAutomatedSnapshotRetentionPeriod
, rfcsAvailabilityZone
, rfcsClusterIdentifier
, rfcsClusterParameterGroupName
, rfcsClusterSecurityGroups
, rfcsClusterSubnetGroupName
, rfcsElasticIp
, rfcsHsmClientCertificateIdentifier
, rfcsHsmConfigurationIdentifier
, rfcsKmsKeyId
, rfcsOwnerAccount
, rfcsPort
, rfcsPreferredMaintenanceWindow
, rfcsPubliclyAccessible
, rfcsSnapshotClusterIdentifier
, rfcsSnapshotIdentifier
, rfcsVpcSecurityGroupIds
, RestoreFromClusterSnapshotResponse
, restoreFromClusterSnapshotResponse
, rfcsrCluster
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.Redshift.Types
import qualified GHC.Exts
data RestoreFromClusterSnapshot = RestoreFromClusterSnapshot
{ _rfcsAllowVersionUpgrade :: Maybe Bool
, _rfcsAutomatedSnapshotRetentionPeriod :: Maybe Int
, _rfcsAvailabilityZone :: Maybe Text
, _rfcsClusterIdentifier :: Text
, _rfcsClusterParameterGroupName :: Maybe Text
, _rfcsClusterSecurityGroups :: List "member" Text
, _rfcsClusterSubnetGroupName :: Maybe Text
, _rfcsElasticIp :: Maybe Text
, _rfcsHsmClientCertificateIdentifier :: Maybe Text
, _rfcsHsmConfigurationIdentifier :: Maybe Text
, _rfcsKmsKeyId :: Maybe Text
, _rfcsOwnerAccount :: Maybe Text
, _rfcsPort :: Maybe Int
, _rfcsPreferredMaintenanceWindow :: Maybe Text
, _rfcsPubliclyAccessible :: Maybe Bool
, _rfcsSnapshotClusterIdentifier :: Maybe Text
, _rfcsSnapshotIdentifier :: Text
, _rfcsVpcSecurityGroupIds :: List "member" Text
} deriving (Eq, Ord, Read, Show)
restoreFromClusterSnapshot :: Text
-> Text
-> RestoreFromClusterSnapshot
restoreFromClusterSnapshot p1 p2 = RestoreFromClusterSnapshot
{ _rfcsClusterIdentifier = p1
, _rfcsSnapshotIdentifier = p2
, _rfcsSnapshotClusterIdentifier = Nothing
, _rfcsPort = Nothing
, _rfcsAvailabilityZone = Nothing
, _rfcsAllowVersionUpgrade = Nothing
, _rfcsClusterSubnetGroupName = Nothing
, _rfcsPubliclyAccessible = Nothing
, _rfcsOwnerAccount = Nothing
, _rfcsHsmClientCertificateIdentifier = Nothing
, _rfcsHsmConfigurationIdentifier = Nothing
, _rfcsElasticIp = Nothing
, _rfcsClusterParameterGroupName = Nothing
, _rfcsClusterSecurityGroups = mempty
, _rfcsVpcSecurityGroupIds = mempty
, _rfcsPreferredMaintenanceWindow = Nothing
, _rfcsAutomatedSnapshotRetentionPeriod = Nothing
, _rfcsKmsKeyId = Nothing
}
rfcsAllowVersionUpgrade :: Lens' RestoreFromClusterSnapshot (Maybe Bool)
rfcsAllowVersionUpgrade =
lens _rfcsAllowVersionUpgrade (\s a -> s { _rfcsAllowVersionUpgrade = a })
rfcsAutomatedSnapshotRetentionPeriod :: Lens' RestoreFromClusterSnapshot (Maybe Int)
rfcsAutomatedSnapshotRetentionPeriod =
lens _rfcsAutomatedSnapshotRetentionPeriod
(\s a -> s { _rfcsAutomatedSnapshotRetentionPeriod = a })
rfcsAvailabilityZone :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsAvailabilityZone =
lens _rfcsAvailabilityZone (\s a -> s { _rfcsAvailabilityZone = a })
rfcsClusterIdentifier :: Lens' RestoreFromClusterSnapshot Text
rfcsClusterIdentifier =
lens _rfcsClusterIdentifier (\s a -> s { _rfcsClusterIdentifier = a })
rfcsClusterParameterGroupName :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsClusterParameterGroupName =
lens _rfcsClusterParameterGroupName
(\s a -> s { _rfcsClusterParameterGroupName = a })
rfcsClusterSecurityGroups :: Lens' RestoreFromClusterSnapshot [Text]
rfcsClusterSecurityGroups =
lens _rfcsClusterSecurityGroups
(\s a -> s { _rfcsClusterSecurityGroups = a })
. _List
rfcsClusterSubnetGroupName :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsClusterSubnetGroupName =
lens _rfcsClusterSubnetGroupName
(\s a -> s { _rfcsClusterSubnetGroupName = a })
rfcsElasticIp :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsElasticIp = lens _rfcsElasticIp (\s a -> s { _rfcsElasticIp = a })
rfcsHsmClientCertificateIdentifier :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsHsmClientCertificateIdentifier =
lens _rfcsHsmClientCertificateIdentifier
(\s a -> s { _rfcsHsmClientCertificateIdentifier = a })
rfcsHsmConfigurationIdentifier :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsHsmConfigurationIdentifier =
lens _rfcsHsmConfigurationIdentifier
(\s a -> s { _rfcsHsmConfigurationIdentifier = a })
rfcsKmsKeyId :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsKmsKeyId = lens _rfcsKmsKeyId (\s a -> s { _rfcsKmsKeyId = a })
rfcsOwnerAccount :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsOwnerAccount = lens _rfcsOwnerAccount (\s a -> s { _rfcsOwnerAccount = a })
rfcsPort :: Lens' RestoreFromClusterSnapshot (Maybe Int)
rfcsPort = lens _rfcsPort (\s a -> s { _rfcsPort = a })
rfcsPreferredMaintenanceWindow :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsPreferredMaintenanceWindow =
lens _rfcsPreferredMaintenanceWindow
(\s a -> s { _rfcsPreferredMaintenanceWindow = a })
rfcsPubliclyAccessible :: Lens' RestoreFromClusterSnapshot (Maybe Bool)
rfcsPubliclyAccessible =
lens _rfcsPubliclyAccessible (\s a -> s { _rfcsPubliclyAccessible = a })
rfcsSnapshotClusterIdentifier :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsSnapshotClusterIdentifier =
lens _rfcsSnapshotClusterIdentifier
(\s a -> s { _rfcsSnapshotClusterIdentifier = a })
rfcsSnapshotIdentifier :: Lens' RestoreFromClusterSnapshot Text
rfcsSnapshotIdentifier =
lens _rfcsSnapshotIdentifier (\s a -> s { _rfcsSnapshotIdentifier = a })
rfcsVpcSecurityGroupIds :: Lens' RestoreFromClusterSnapshot [Text]
rfcsVpcSecurityGroupIds =
lens _rfcsVpcSecurityGroupIds (\s a -> s { _rfcsVpcSecurityGroupIds = a })
. _List
newtype RestoreFromClusterSnapshotResponse = RestoreFromClusterSnapshotResponse
{ _rfcsrCluster :: Maybe Cluster
} deriving (Eq, Read, Show)
restoreFromClusterSnapshotResponse :: RestoreFromClusterSnapshotResponse
restoreFromClusterSnapshotResponse = RestoreFromClusterSnapshotResponse
{ _rfcsrCluster = Nothing
}
rfcsrCluster :: Lens' RestoreFromClusterSnapshotResponse (Maybe Cluster)
rfcsrCluster = lens _rfcsrCluster (\s a -> s { _rfcsrCluster = a })
instance ToPath RestoreFromClusterSnapshot where
toPath = const "/"
instance ToQuery RestoreFromClusterSnapshot where
toQuery RestoreFromClusterSnapshot{..} = mconcat
[ "AllowVersionUpgrade" =? _rfcsAllowVersionUpgrade
, "AutomatedSnapshotRetentionPeriod" =? _rfcsAutomatedSnapshotRetentionPeriod
, "AvailabilityZone" =? _rfcsAvailabilityZone
, "ClusterIdentifier" =? _rfcsClusterIdentifier
, "ClusterParameterGroupName" =? _rfcsClusterParameterGroupName
, "ClusterSecurityGroups" =? _rfcsClusterSecurityGroups
, "ClusterSubnetGroupName" =? _rfcsClusterSubnetGroupName
, "ElasticIp" =? _rfcsElasticIp
, "HsmClientCertificateIdentifier" =? _rfcsHsmClientCertificateIdentifier
, "HsmConfigurationIdentifier" =? _rfcsHsmConfigurationIdentifier
, "KmsKeyId" =? _rfcsKmsKeyId
, "OwnerAccount" =? _rfcsOwnerAccount
, "Port" =? _rfcsPort
, "PreferredMaintenanceWindow" =? _rfcsPreferredMaintenanceWindow
, "PubliclyAccessible" =? _rfcsPubliclyAccessible
, "SnapshotClusterIdentifier" =? _rfcsSnapshotClusterIdentifier
, "SnapshotIdentifier" =? _rfcsSnapshotIdentifier
, "VpcSecurityGroupIds" =? _rfcsVpcSecurityGroupIds
]
instance ToHeaders RestoreFromClusterSnapshot
instance AWSRequest RestoreFromClusterSnapshot where
type Sv RestoreFromClusterSnapshot = Redshift
type Rs RestoreFromClusterSnapshot = RestoreFromClusterSnapshotResponse
request = post "RestoreFromClusterSnapshot"
response = xmlResponse
instance FromXML RestoreFromClusterSnapshotResponse where
parseXML = withElement "RestoreFromClusterSnapshotResult" $ \x -> RestoreFromClusterSnapshotResponse
<$> x .@? "Cluster"