{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.RDS.StartExportTask
(
StartExportTask (..),
newStartExportTask,
startExportTask_exportOnly,
startExportTask_s3Prefix,
startExportTask_exportTaskIdentifier,
startExportTask_sourceArn,
startExportTask_s3BucketName,
startExportTask_iamRoleArn,
startExportTask_kmsKeyId,
ExportTask (..),
newExportTask,
exportTask_totalExtractedDataInGB,
exportTask_status,
exportTask_iamRoleArn,
exportTask_sourceArn,
exportTask_exportOnly,
exportTask_taskStartTime,
exportTask_warningMessage,
exportTask_snapshotTime,
exportTask_kmsKeyId,
exportTask_taskEndTime,
exportTask_exportTaskIdentifier,
exportTask_s3Prefix,
exportTask_percentProgress,
exportTask_s3Bucket,
exportTask_failureCause,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data StartExportTask = StartExportTask'
{
StartExportTask -> Maybe [Text]
exportOnly :: Prelude.Maybe [Prelude.Text],
StartExportTask -> Maybe Text
s3Prefix :: Prelude.Maybe Prelude.Text,
StartExportTask -> Text
exportTaskIdentifier :: Prelude.Text,
StartExportTask -> Text
sourceArn :: Prelude.Text,
StartExportTask -> Text
s3BucketName :: Prelude.Text,
StartExportTask -> Text
iamRoleArn :: Prelude.Text,
StartExportTask -> Text
kmsKeyId :: Prelude.Text
}
deriving (StartExportTask -> StartExportTask -> Bool
(StartExportTask -> StartExportTask -> Bool)
-> (StartExportTask -> StartExportTask -> Bool)
-> Eq StartExportTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartExportTask -> StartExportTask -> Bool
$c/= :: StartExportTask -> StartExportTask -> Bool
== :: StartExportTask -> StartExportTask -> Bool
$c== :: StartExportTask -> StartExportTask -> Bool
Prelude.Eq, ReadPrec [StartExportTask]
ReadPrec StartExportTask
Int -> ReadS StartExportTask
ReadS [StartExportTask]
(Int -> ReadS StartExportTask)
-> ReadS [StartExportTask]
-> ReadPrec StartExportTask
-> ReadPrec [StartExportTask]
-> Read StartExportTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartExportTask]
$creadListPrec :: ReadPrec [StartExportTask]
readPrec :: ReadPrec StartExportTask
$creadPrec :: ReadPrec StartExportTask
readList :: ReadS [StartExportTask]
$creadList :: ReadS [StartExportTask]
readsPrec :: Int -> ReadS StartExportTask
$creadsPrec :: Int -> ReadS StartExportTask
Prelude.Read, Int -> StartExportTask -> ShowS
[StartExportTask] -> ShowS
StartExportTask -> String
(Int -> StartExportTask -> ShowS)
-> (StartExportTask -> String)
-> ([StartExportTask] -> ShowS)
-> Show StartExportTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartExportTask] -> ShowS
$cshowList :: [StartExportTask] -> ShowS
show :: StartExportTask -> String
$cshow :: StartExportTask -> String
showsPrec :: Int -> StartExportTask -> ShowS
$cshowsPrec :: Int -> StartExportTask -> ShowS
Prelude.Show, (forall x. StartExportTask -> Rep StartExportTask x)
-> (forall x. Rep StartExportTask x -> StartExportTask)
-> Generic StartExportTask
forall x. Rep StartExportTask x -> StartExportTask
forall x. StartExportTask -> Rep StartExportTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartExportTask x -> StartExportTask
$cfrom :: forall x. StartExportTask -> Rep StartExportTask x
Prelude.Generic)
newStartExportTask ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
StartExportTask
newStartExportTask :: Text -> Text -> Text -> Text -> Text -> StartExportTask
newStartExportTask
Text
pExportTaskIdentifier_
Text
pSourceArn_
Text
pS3BucketName_
Text
pIamRoleArn_
Text
pKmsKeyId_ =
StartExportTask' :: Maybe [Text]
-> Maybe Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> StartExportTask
StartExportTask'
{ $sel:exportOnly:StartExportTask' :: Maybe [Text]
exportOnly = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:s3Prefix:StartExportTask' :: Maybe Text
s3Prefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:exportTaskIdentifier:StartExportTask' :: Text
exportTaskIdentifier = Text
pExportTaskIdentifier_,
$sel:sourceArn:StartExportTask' :: Text
sourceArn = Text
pSourceArn_,
$sel:s3BucketName:StartExportTask' :: Text
s3BucketName = Text
pS3BucketName_,
$sel:iamRoleArn:StartExportTask' :: Text
iamRoleArn = Text
pIamRoleArn_,
$sel:kmsKeyId:StartExportTask' :: Text
kmsKeyId = Text
pKmsKeyId_
}
startExportTask_exportOnly :: Lens.Lens' StartExportTask (Prelude.Maybe [Prelude.Text])
startExportTask_exportOnly :: (Maybe [Text] -> f (Maybe [Text]))
-> StartExportTask -> f StartExportTask
startExportTask_exportOnly = (StartExportTask -> Maybe [Text])
-> (StartExportTask -> Maybe [Text] -> StartExportTask)
-> Lens
StartExportTask StartExportTask (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartExportTask' {Maybe [Text]
exportOnly :: Maybe [Text]
$sel:exportOnly:StartExportTask' :: StartExportTask -> Maybe [Text]
exportOnly} -> Maybe [Text]
exportOnly) (\s :: StartExportTask
s@StartExportTask' {} Maybe [Text]
a -> StartExportTask
s {$sel:exportOnly:StartExportTask' :: Maybe [Text]
exportOnly = Maybe [Text]
a} :: StartExportTask) ((Maybe [Text] -> f (Maybe [Text]))
-> StartExportTask -> f StartExportTask)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> StartExportTask
-> f StartExportTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
startExportTask_s3Prefix :: Lens.Lens' StartExportTask (Prelude.Maybe Prelude.Text)
startExportTask_s3Prefix :: (Maybe Text -> f (Maybe Text))
-> StartExportTask -> f StartExportTask
startExportTask_s3Prefix = (StartExportTask -> Maybe Text)
-> (StartExportTask -> Maybe Text -> StartExportTask)
-> Lens StartExportTask StartExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartExportTask' {Maybe Text
s3Prefix :: Maybe Text
$sel:s3Prefix:StartExportTask' :: StartExportTask -> Maybe Text
s3Prefix} -> Maybe Text
s3Prefix) (\s :: StartExportTask
s@StartExportTask' {} Maybe Text
a -> StartExportTask
s {$sel:s3Prefix:StartExportTask' :: Maybe Text
s3Prefix = Maybe Text
a} :: StartExportTask)
startExportTask_exportTaskIdentifier :: Lens.Lens' StartExportTask Prelude.Text
startExportTask_exportTaskIdentifier :: (Text -> f Text) -> StartExportTask -> f StartExportTask
startExportTask_exportTaskIdentifier = (StartExportTask -> Text)
-> (StartExportTask -> Text -> StartExportTask)
-> Lens StartExportTask StartExportTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartExportTask' {Text
exportTaskIdentifier :: Text
$sel:exportTaskIdentifier:StartExportTask' :: StartExportTask -> Text
exportTaskIdentifier} -> Text
exportTaskIdentifier) (\s :: StartExportTask
s@StartExportTask' {} Text
a -> StartExportTask
s {$sel:exportTaskIdentifier:StartExportTask' :: Text
exportTaskIdentifier = Text
a} :: StartExportTask)
startExportTask_sourceArn :: Lens.Lens' StartExportTask Prelude.Text
startExportTask_sourceArn :: (Text -> f Text) -> StartExportTask -> f StartExportTask
startExportTask_sourceArn = (StartExportTask -> Text)
-> (StartExportTask -> Text -> StartExportTask)
-> Lens StartExportTask StartExportTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartExportTask' {Text
sourceArn :: Text
$sel:sourceArn:StartExportTask' :: StartExportTask -> Text
sourceArn} -> Text
sourceArn) (\s :: StartExportTask
s@StartExportTask' {} Text
a -> StartExportTask
s {$sel:sourceArn:StartExportTask' :: Text
sourceArn = Text
a} :: StartExportTask)
startExportTask_s3BucketName :: Lens.Lens' StartExportTask Prelude.Text
startExportTask_s3BucketName :: (Text -> f Text) -> StartExportTask -> f StartExportTask
startExportTask_s3BucketName = (StartExportTask -> Text)
-> (StartExportTask -> Text -> StartExportTask)
-> Lens StartExportTask StartExportTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartExportTask' {Text
s3BucketName :: Text
$sel:s3BucketName:StartExportTask' :: StartExportTask -> Text
s3BucketName} -> Text
s3BucketName) (\s :: StartExportTask
s@StartExportTask' {} Text
a -> StartExportTask
s {$sel:s3BucketName:StartExportTask' :: Text
s3BucketName = Text
a} :: StartExportTask)
startExportTask_iamRoleArn :: Lens.Lens' StartExportTask Prelude.Text
startExportTask_iamRoleArn :: (Text -> f Text) -> StartExportTask -> f StartExportTask
startExportTask_iamRoleArn = (StartExportTask -> Text)
-> (StartExportTask -> Text -> StartExportTask)
-> Lens StartExportTask StartExportTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartExportTask' {Text
iamRoleArn :: Text
$sel:iamRoleArn:StartExportTask' :: StartExportTask -> Text
iamRoleArn} -> Text
iamRoleArn) (\s :: StartExportTask
s@StartExportTask' {} Text
a -> StartExportTask
s {$sel:iamRoleArn:StartExportTask' :: Text
iamRoleArn = Text
a} :: StartExportTask)
startExportTask_kmsKeyId :: Lens.Lens' StartExportTask Prelude.Text
startExportTask_kmsKeyId :: (Text -> f Text) -> StartExportTask -> f StartExportTask
startExportTask_kmsKeyId = (StartExportTask -> Text)
-> (StartExportTask -> Text -> StartExportTask)
-> Lens StartExportTask StartExportTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartExportTask' {Text
kmsKeyId :: Text
$sel:kmsKeyId:StartExportTask' :: StartExportTask -> Text
kmsKeyId} -> Text
kmsKeyId) (\s :: StartExportTask
s@StartExportTask' {} Text
a -> StartExportTask
s {$sel:kmsKeyId:StartExportTask' :: Text
kmsKeyId = Text
a} :: StartExportTask)
instance Core.AWSRequest StartExportTask where
type AWSResponse StartExportTask = ExportTask
request :: StartExportTask -> Request StartExportTask
request = Service -> StartExportTask -> Request StartExportTask
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy StartExportTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartExportTask)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse StartExportTask))
-> Logger
-> Service
-> Proxy StartExportTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartExportTask)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"StartExportTaskResult"
(\Int
s ResponseHeaders
h [Node]
x -> [Node] -> Either String ExportTask
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
instance Prelude.Hashable StartExportTask
instance Prelude.NFData StartExportTask
instance Core.ToHeaders StartExportTask where
toHeaders :: StartExportTask -> ResponseHeaders
toHeaders = ResponseHeaders -> StartExportTask -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath StartExportTask where
toPath :: StartExportTask -> ByteString
toPath = ByteString -> StartExportTask -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StartExportTask where
toQuery :: StartExportTask -> QueryString
toQuery StartExportTask' {Maybe [Text]
Maybe Text
Text
kmsKeyId :: Text
iamRoleArn :: Text
s3BucketName :: Text
sourceArn :: Text
exportTaskIdentifier :: Text
s3Prefix :: Maybe Text
exportOnly :: Maybe [Text]
$sel:kmsKeyId:StartExportTask' :: StartExportTask -> Text
$sel:iamRoleArn:StartExportTask' :: StartExportTask -> Text
$sel:s3BucketName:StartExportTask' :: StartExportTask -> Text
$sel:sourceArn:StartExportTask' :: StartExportTask -> Text
$sel:exportTaskIdentifier:StartExportTask' :: StartExportTask -> Text
$sel:s3Prefix:StartExportTask' :: StartExportTask -> Maybe Text
$sel:exportOnly:StartExportTask' :: StartExportTask -> Maybe [Text]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"StartExportTask" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
ByteString
"ExportOnly"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
exportOnly),
ByteString
"S3Prefix" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
s3Prefix,
ByteString
"ExportTaskIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
exportTaskIdentifier,
ByteString
"SourceArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
sourceArn,
ByteString
"S3BucketName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
s3BucketName,
ByteString
"IamRoleArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
iamRoleArn,
ByteString
"KmsKeyId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
kmsKeyId
]