{-# 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.Backup.StartBackupJob
(
StartBackupJob (..),
newStartBackupJob,
startBackupJob_idempotencyToken,
startBackupJob_lifecycle,
startBackupJob_recoveryPointTags,
startBackupJob_completeWindowMinutes,
startBackupJob_backupOptions,
startBackupJob_startWindowMinutes,
startBackupJob_backupVaultName,
startBackupJob_resourceArn,
startBackupJob_iamRoleArn,
StartBackupJobResponse (..),
newStartBackupJobResponse,
startBackupJobResponse_backupJobId,
startBackupJobResponse_recoveryPointArn,
startBackupJobResponse_creationDate,
startBackupJobResponse_httpStatus,
)
where
import Amazonka.Backup.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data StartBackupJob = StartBackupJob'
{
StartBackupJob -> Maybe Text
idempotencyToken :: Prelude.Maybe Prelude.Text,
StartBackupJob -> Maybe Lifecycle
lifecycle :: Prelude.Maybe Lifecycle,
StartBackupJob -> Maybe (Sensitive (HashMap Text Text))
recoveryPointTags :: Prelude.Maybe (Core.Sensitive (Prelude.HashMap Prelude.Text Prelude.Text)),
StartBackupJob -> Maybe Integer
completeWindowMinutes :: Prelude.Maybe Prelude.Integer,
StartBackupJob -> Maybe (HashMap Text Text)
backupOptions :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
StartBackupJob -> Maybe Integer
startWindowMinutes :: Prelude.Maybe Prelude.Integer,
StartBackupJob -> Text
backupVaultName :: Prelude.Text,
StartBackupJob -> Text
resourceArn :: Prelude.Text,
StartBackupJob -> Text
iamRoleArn :: Prelude.Text
}
deriving (StartBackupJob -> StartBackupJob -> Bool
(StartBackupJob -> StartBackupJob -> Bool)
-> (StartBackupJob -> StartBackupJob -> Bool) -> Eq StartBackupJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartBackupJob -> StartBackupJob -> Bool
$c/= :: StartBackupJob -> StartBackupJob -> Bool
== :: StartBackupJob -> StartBackupJob -> Bool
$c== :: StartBackupJob -> StartBackupJob -> Bool
Prelude.Eq, Int -> StartBackupJob -> ShowS
[StartBackupJob] -> ShowS
StartBackupJob -> String
(Int -> StartBackupJob -> ShowS)
-> (StartBackupJob -> String)
-> ([StartBackupJob] -> ShowS)
-> Show StartBackupJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartBackupJob] -> ShowS
$cshowList :: [StartBackupJob] -> ShowS
show :: StartBackupJob -> String
$cshow :: StartBackupJob -> String
showsPrec :: Int -> StartBackupJob -> ShowS
$cshowsPrec :: Int -> StartBackupJob -> ShowS
Prelude.Show, (forall x. StartBackupJob -> Rep StartBackupJob x)
-> (forall x. Rep StartBackupJob x -> StartBackupJob)
-> Generic StartBackupJob
forall x. Rep StartBackupJob x -> StartBackupJob
forall x. StartBackupJob -> Rep StartBackupJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartBackupJob x -> StartBackupJob
$cfrom :: forall x. StartBackupJob -> Rep StartBackupJob x
Prelude.Generic)
newStartBackupJob ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
StartBackupJob
newStartBackupJob :: Text -> Text -> Text -> StartBackupJob
newStartBackupJob
Text
pBackupVaultName_
Text
pResourceArn_
Text
pIamRoleArn_ =
StartBackupJob' :: Maybe Text
-> Maybe Lifecycle
-> Maybe (Sensitive (HashMap Text Text))
-> Maybe Integer
-> Maybe (HashMap Text Text)
-> Maybe Integer
-> Text
-> Text
-> Text
-> StartBackupJob
StartBackupJob'
{ $sel:idempotencyToken:StartBackupJob' :: Maybe Text
idempotencyToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lifecycle:StartBackupJob' :: Maybe Lifecycle
lifecycle = Maybe Lifecycle
forall a. Maybe a
Prelude.Nothing,
$sel:recoveryPointTags:StartBackupJob' :: Maybe (Sensitive (HashMap Text Text))
recoveryPointTags = Maybe (Sensitive (HashMap Text Text))
forall a. Maybe a
Prelude.Nothing,
$sel:completeWindowMinutes:StartBackupJob' :: Maybe Integer
completeWindowMinutes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:backupOptions:StartBackupJob' :: Maybe (HashMap Text Text)
backupOptions = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:startWindowMinutes:StartBackupJob' :: Maybe Integer
startWindowMinutes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:backupVaultName:StartBackupJob' :: Text
backupVaultName = Text
pBackupVaultName_,
$sel:resourceArn:StartBackupJob' :: Text
resourceArn = Text
pResourceArn_,
$sel:iamRoleArn:StartBackupJob' :: Text
iamRoleArn = Text
pIamRoleArn_
}
startBackupJob_idempotencyToken :: Lens.Lens' StartBackupJob (Prelude.Maybe Prelude.Text)
startBackupJob_idempotencyToken :: (Maybe Text -> f (Maybe Text))
-> StartBackupJob -> f StartBackupJob
startBackupJob_idempotencyToken = (StartBackupJob -> Maybe Text)
-> (StartBackupJob -> Maybe Text -> StartBackupJob)
-> Lens StartBackupJob StartBackupJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartBackupJob' {Maybe Text
idempotencyToken :: Maybe Text
$sel:idempotencyToken:StartBackupJob' :: StartBackupJob -> Maybe Text
idempotencyToken} -> Maybe Text
idempotencyToken) (\s :: StartBackupJob
s@StartBackupJob' {} Maybe Text
a -> StartBackupJob
s {$sel:idempotencyToken:StartBackupJob' :: Maybe Text
idempotencyToken = Maybe Text
a} :: StartBackupJob)
startBackupJob_lifecycle :: Lens.Lens' StartBackupJob (Prelude.Maybe Lifecycle)
startBackupJob_lifecycle :: (Maybe Lifecycle -> f (Maybe Lifecycle))
-> StartBackupJob -> f StartBackupJob
startBackupJob_lifecycle = (StartBackupJob -> Maybe Lifecycle)
-> (StartBackupJob -> Maybe Lifecycle -> StartBackupJob)
-> Lens
StartBackupJob StartBackupJob (Maybe Lifecycle) (Maybe Lifecycle)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartBackupJob' {Maybe Lifecycle
lifecycle :: Maybe Lifecycle
$sel:lifecycle:StartBackupJob' :: StartBackupJob -> Maybe Lifecycle
lifecycle} -> Maybe Lifecycle
lifecycle) (\s :: StartBackupJob
s@StartBackupJob' {} Maybe Lifecycle
a -> StartBackupJob
s {$sel:lifecycle:StartBackupJob' :: Maybe Lifecycle
lifecycle = Maybe Lifecycle
a} :: StartBackupJob)
startBackupJob_recoveryPointTags :: Lens.Lens' StartBackupJob (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
startBackupJob_recoveryPointTags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> StartBackupJob -> f StartBackupJob
startBackupJob_recoveryPointTags = (StartBackupJob -> Maybe (Sensitive (HashMap Text Text)))
-> (StartBackupJob
-> Maybe (Sensitive (HashMap Text Text)) -> StartBackupJob)
-> Lens
StartBackupJob
StartBackupJob
(Maybe (Sensitive (HashMap Text Text)))
(Maybe (Sensitive (HashMap Text Text)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartBackupJob' {Maybe (Sensitive (HashMap Text Text))
recoveryPointTags :: Maybe (Sensitive (HashMap Text Text))
$sel:recoveryPointTags:StartBackupJob' :: StartBackupJob -> Maybe (Sensitive (HashMap Text Text))
recoveryPointTags} -> Maybe (Sensitive (HashMap Text Text))
recoveryPointTags) (\s :: StartBackupJob
s@StartBackupJob' {} Maybe (Sensitive (HashMap Text Text))
a -> StartBackupJob
s {$sel:recoveryPointTags:StartBackupJob' :: Maybe (Sensitive (HashMap Text Text))
recoveryPointTags = Maybe (Sensitive (HashMap Text Text))
a} :: StartBackupJob) ((Maybe (Sensitive (HashMap Text Text))
-> f (Maybe (Sensitive (HashMap Text Text))))
-> StartBackupJob -> f StartBackupJob)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (Sensitive (HashMap Text Text))
-> f (Maybe (Sensitive (HashMap Text Text))))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> StartBackupJob
-> f StartBackupJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (Sensitive (HashMap Text Text)))
(Maybe (Sensitive (HashMap Text Text)))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text 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
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive AnIso
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
-> (Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
-> Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text)))
-> AnIso
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
-> Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)
startBackupJob_completeWindowMinutes :: Lens.Lens' StartBackupJob (Prelude.Maybe Prelude.Integer)
startBackupJob_completeWindowMinutes :: (Maybe Integer -> f (Maybe Integer))
-> StartBackupJob -> f StartBackupJob
startBackupJob_completeWindowMinutes = (StartBackupJob -> Maybe Integer)
-> (StartBackupJob -> Maybe Integer -> StartBackupJob)
-> Lens
StartBackupJob StartBackupJob (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartBackupJob' {Maybe Integer
completeWindowMinutes :: Maybe Integer
$sel:completeWindowMinutes:StartBackupJob' :: StartBackupJob -> Maybe Integer
completeWindowMinutes} -> Maybe Integer
completeWindowMinutes) (\s :: StartBackupJob
s@StartBackupJob' {} Maybe Integer
a -> StartBackupJob
s {$sel:completeWindowMinutes:StartBackupJob' :: Maybe Integer
completeWindowMinutes = Maybe Integer
a} :: StartBackupJob)
startBackupJob_backupOptions :: Lens.Lens' StartBackupJob (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
startBackupJob_backupOptions :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> StartBackupJob -> f StartBackupJob
startBackupJob_backupOptions = (StartBackupJob -> Maybe (HashMap Text Text))
-> (StartBackupJob -> Maybe (HashMap Text Text) -> StartBackupJob)
-> Lens
StartBackupJob
StartBackupJob
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartBackupJob' {Maybe (HashMap Text Text)
backupOptions :: Maybe (HashMap Text Text)
$sel:backupOptions:StartBackupJob' :: StartBackupJob -> Maybe (HashMap Text Text)
backupOptions} -> Maybe (HashMap Text Text)
backupOptions) (\s :: StartBackupJob
s@StartBackupJob' {} Maybe (HashMap Text Text)
a -> StartBackupJob
s {$sel:backupOptions:StartBackupJob' :: Maybe (HashMap Text Text)
backupOptions = Maybe (HashMap Text Text)
a} :: StartBackupJob) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> StartBackupJob -> f StartBackupJob)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> StartBackupJob
-> f StartBackupJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
-> Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text)))
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text 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 Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
-> Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
startBackupJob_startWindowMinutes :: Lens.Lens' StartBackupJob (Prelude.Maybe Prelude.Integer)
startBackupJob_startWindowMinutes :: (Maybe Integer -> f (Maybe Integer))
-> StartBackupJob -> f StartBackupJob
startBackupJob_startWindowMinutes = (StartBackupJob -> Maybe Integer)
-> (StartBackupJob -> Maybe Integer -> StartBackupJob)
-> Lens
StartBackupJob StartBackupJob (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartBackupJob' {Maybe Integer
startWindowMinutes :: Maybe Integer
$sel:startWindowMinutes:StartBackupJob' :: StartBackupJob -> Maybe Integer
startWindowMinutes} -> Maybe Integer
startWindowMinutes) (\s :: StartBackupJob
s@StartBackupJob' {} Maybe Integer
a -> StartBackupJob
s {$sel:startWindowMinutes:StartBackupJob' :: Maybe Integer
startWindowMinutes = Maybe Integer
a} :: StartBackupJob)
startBackupJob_backupVaultName :: Lens.Lens' StartBackupJob Prelude.Text
startBackupJob_backupVaultName :: (Text -> f Text) -> StartBackupJob -> f StartBackupJob
startBackupJob_backupVaultName = (StartBackupJob -> Text)
-> (StartBackupJob -> Text -> StartBackupJob)
-> Lens StartBackupJob StartBackupJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartBackupJob' {Text
backupVaultName :: Text
$sel:backupVaultName:StartBackupJob' :: StartBackupJob -> Text
backupVaultName} -> Text
backupVaultName) (\s :: StartBackupJob
s@StartBackupJob' {} Text
a -> StartBackupJob
s {$sel:backupVaultName:StartBackupJob' :: Text
backupVaultName = Text
a} :: StartBackupJob)
startBackupJob_resourceArn :: Lens.Lens' StartBackupJob Prelude.Text
startBackupJob_resourceArn :: (Text -> f Text) -> StartBackupJob -> f StartBackupJob
startBackupJob_resourceArn = (StartBackupJob -> Text)
-> (StartBackupJob -> Text -> StartBackupJob)
-> Lens StartBackupJob StartBackupJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartBackupJob' {Text
resourceArn :: Text
$sel:resourceArn:StartBackupJob' :: StartBackupJob -> Text
resourceArn} -> Text
resourceArn) (\s :: StartBackupJob
s@StartBackupJob' {} Text
a -> StartBackupJob
s {$sel:resourceArn:StartBackupJob' :: Text
resourceArn = Text
a} :: StartBackupJob)
startBackupJob_iamRoleArn :: Lens.Lens' StartBackupJob Prelude.Text
startBackupJob_iamRoleArn :: (Text -> f Text) -> StartBackupJob -> f StartBackupJob
startBackupJob_iamRoleArn = (StartBackupJob -> Text)
-> (StartBackupJob -> Text -> StartBackupJob)
-> Lens StartBackupJob StartBackupJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartBackupJob' {Text
iamRoleArn :: Text
$sel:iamRoleArn:StartBackupJob' :: StartBackupJob -> Text
iamRoleArn} -> Text
iamRoleArn) (\s :: StartBackupJob
s@StartBackupJob' {} Text
a -> StartBackupJob
s {$sel:iamRoleArn:StartBackupJob' :: Text
iamRoleArn = Text
a} :: StartBackupJob)
instance Core.AWSRequest StartBackupJob where
type
AWSResponse StartBackupJob =
StartBackupJobResponse
request :: StartBackupJob -> Request StartBackupJob
request = Service -> StartBackupJob -> Request StartBackupJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartBackupJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartBackupJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StartBackupJob))
-> Logger
-> Service
-> Proxy StartBackupJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartBackupJob)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe Text -> Maybe POSIX -> Int -> StartBackupJobResponse
StartBackupJobResponse'
(Maybe Text
-> Maybe Text -> Maybe POSIX -> Int -> StartBackupJobResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Maybe POSIX -> Int -> StartBackupJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"BackupJobId")
Either
String (Maybe Text -> Maybe POSIX -> Int -> StartBackupJobResponse)
-> Either String (Maybe Text)
-> Either String (Maybe POSIX -> Int -> StartBackupJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RecoveryPointArn")
Either String (Maybe POSIX -> Int -> StartBackupJobResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> StartBackupJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreationDate")
Either String (Int -> StartBackupJobResponse)
-> Either String Int -> Either String StartBackupJobResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable StartBackupJob
instance Prelude.NFData StartBackupJob
instance Core.ToHeaders StartBackupJob where
toHeaders :: StartBackupJob -> ResponseHeaders
toHeaders =
ResponseHeaders -> StartBackupJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON StartBackupJob where
toJSON :: StartBackupJob -> Value
toJSON StartBackupJob' {Maybe Integer
Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive (HashMap Text Text))
Maybe Lifecycle
Text
iamRoleArn :: Text
resourceArn :: Text
backupVaultName :: Text
startWindowMinutes :: Maybe Integer
backupOptions :: Maybe (HashMap Text Text)
completeWindowMinutes :: Maybe Integer
recoveryPointTags :: Maybe (Sensitive (HashMap Text Text))
lifecycle :: Maybe Lifecycle
idempotencyToken :: Maybe Text
$sel:iamRoleArn:StartBackupJob' :: StartBackupJob -> Text
$sel:resourceArn:StartBackupJob' :: StartBackupJob -> Text
$sel:backupVaultName:StartBackupJob' :: StartBackupJob -> Text
$sel:startWindowMinutes:StartBackupJob' :: StartBackupJob -> Maybe Integer
$sel:backupOptions:StartBackupJob' :: StartBackupJob -> Maybe (HashMap Text Text)
$sel:completeWindowMinutes:StartBackupJob' :: StartBackupJob -> Maybe Integer
$sel:recoveryPointTags:StartBackupJob' :: StartBackupJob -> Maybe (Sensitive (HashMap Text Text))
$sel:lifecycle:StartBackupJob' :: StartBackupJob -> Maybe Lifecycle
$sel:idempotencyToken:StartBackupJob' :: StartBackupJob -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"IdempotencyToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
idempotencyToken,
(Text
"Lifecycle" Text -> Lifecycle -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Lifecycle -> Pair) -> Maybe Lifecycle -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Lifecycle
lifecycle,
(Text
"RecoveryPointTags" Text -> Sensitive (HashMap Text Text) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Sensitive (HashMap Text Text) -> Pair)
-> Maybe (Sensitive (HashMap Text Text)) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive (HashMap Text Text))
recoveryPointTags,
(Text
"CompleteWindowMinutes" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
completeWindowMinutes,
(Text
"BackupOptions" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
backupOptions,
(Text
"StartWindowMinutes" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
startWindowMinutes,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"BackupVaultName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
backupVaultName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"IamRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
iamRoleArn)
]
)
instance Core.ToPath StartBackupJob where
toPath :: StartBackupJob -> ByteString
toPath = ByteString -> StartBackupJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/backup-jobs"
instance Core.ToQuery StartBackupJob where
toQuery :: StartBackupJob -> QueryString
toQuery = QueryString -> StartBackupJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StartBackupJobResponse = StartBackupJobResponse'
{
StartBackupJobResponse -> Maybe Text
backupJobId :: Prelude.Maybe Prelude.Text,
StartBackupJobResponse -> Maybe Text
recoveryPointArn :: Prelude.Maybe Prelude.Text,
StartBackupJobResponse -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
StartBackupJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartBackupJobResponse -> StartBackupJobResponse -> Bool
(StartBackupJobResponse -> StartBackupJobResponse -> Bool)
-> (StartBackupJobResponse -> StartBackupJobResponse -> Bool)
-> Eq StartBackupJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartBackupJobResponse -> StartBackupJobResponse -> Bool
$c/= :: StartBackupJobResponse -> StartBackupJobResponse -> Bool
== :: StartBackupJobResponse -> StartBackupJobResponse -> Bool
$c== :: StartBackupJobResponse -> StartBackupJobResponse -> Bool
Prelude.Eq, ReadPrec [StartBackupJobResponse]
ReadPrec StartBackupJobResponse
Int -> ReadS StartBackupJobResponse
ReadS [StartBackupJobResponse]
(Int -> ReadS StartBackupJobResponse)
-> ReadS [StartBackupJobResponse]
-> ReadPrec StartBackupJobResponse
-> ReadPrec [StartBackupJobResponse]
-> Read StartBackupJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartBackupJobResponse]
$creadListPrec :: ReadPrec [StartBackupJobResponse]
readPrec :: ReadPrec StartBackupJobResponse
$creadPrec :: ReadPrec StartBackupJobResponse
readList :: ReadS [StartBackupJobResponse]
$creadList :: ReadS [StartBackupJobResponse]
readsPrec :: Int -> ReadS StartBackupJobResponse
$creadsPrec :: Int -> ReadS StartBackupJobResponse
Prelude.Read, Int -> StartBackupJobResponse -> ShowS
[StartBackupJobResponse] -> ShowS
StartBackupJobResponse -> String
(Int -> StartBackupJobResponse -> ShowS)
-> (StartBackupJobResponse -> String)
-> ([StartBackupJobResponse] -> ShowS)
-> Show StartBackupJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartBackupJobResponse] -> ShowS
$cshowList :: [StartBackupJobResponse] -> ShowS
show :: StartBackupJobResponse -> String
$cshow :: StartBackupJobResponse -> String
showsPrec :: Int -> StartBackupJobResponse -> ShowS
$cshowsPrec :: Int -> StartBackupJobResponse -> ShowS
Prelude.Show, (forall x. StartBackupJobResponse -> Rep StartBackupJobResponse x)
-> (forall x.
Rep StartBackupJobResponse x -> StartBackupJobResponse)
-> Generic StartBackupJobResponse
forall x. Rep StartBackupJobResponse x -> StartBackupJobResponse
forall x. StartBackupJobResponse -> Rep StartBackupJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartBackupJobResponse x -> StartBackupJobResponse
$cfrom :: forall x. StartBackupJobResponse -> Rep StartBackupJobResponse x
Prelude.Generic)
newStartBackupJobResponse ::
Prelude.Int ->
StartBackupJobResponse
newStartBackupJobResponse :: Int -> StartBackupJobResponse
newStartBackupJobResponse Int
pHttpStatus_ =
StartBackupJobResponse' :: Maybe Text
-> Maybe Text -> Maybe POSIX -> Int -> StartBackupJobResponse
StartBackupJobResponse'
{ $sel:backupJobId:StartBackupJobResponse' :: Maybe Text
backupJobId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:recoveryPointArn:StartBackupJobResponse' :: Maybe Text
recoveryPointArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationDate:StartBackupJobResponse' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartBackupJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startBackupJobResponse_backupJobId :: Lens.Lens' StartBackupJobResponse (Prelude.Maybe Prelude.Text)
startBackupJobResponse_backupJobId :: (Maybe Text -> f (Maybe Text))
-> StartBackupJobResponse -> f StartBackupJobResponse
startBackupJobResponse_backupJobId = (StartBackupJobResponse -> Maybe Text)
-> (StartBackupJobResponse -> Maybe Text -> StartBackupJobResponse)
-> Lens
StartBackupJobResponse
StartBackupJobResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartBackupJobResponse' {Maybe Text
backupJobId :: Maybe Text
$sel:backupJobId:StartBackupJobResponse' :: StartBackupJobResponse -> Maybe Text
backupJobId} -> Maybe Text
backupJobId) (\s :: StartBackupJobResponse
s@StartBackupJobResponse' {} Maybe Text
a -> StartBackupJobResponse
s {$sel:backupJobId:StartBackupJobResponse' :: Maybe Text
backupJobId = Maybe Text
a} :: StartBackupJobResponse)
startBackupJobResponse_recoveryPointArn :: Lens.Lens' StartBackupJobResponse (Prelude.Maybe Prelude.Text)
startBackupJobResponse_recoveryPointArn :: (Maybe Text -> f (Maybe Text))
-> StartBackupJobResponse -> f StartBackupJobResponse
startBackupJobResponse_recoveryPointArn = (StartBackupJobResponse -> Maybe Text)
-> (StartBackupJobResponse -> Maybe Text -> StartBackupJobResponse)
-> Lens
StartBackupJobResponse
StartBackupJobResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartBackupJobResponse' {Maybe Text
recoveryPointArn :: Maybe Text
$sel:recoveryPointArn:StartBackupJobResponse' :: StartBackupJobResponse -> Maybe Text
recoveryPointArn} -> Maybe Text
recoveryPointArn) (\s :: StartBackupJobResponse
s@StartBackupJobResponse' {} Maybe Text
a -> StartBackupJobResponse
s {$sel:recoveryPointArn:StartBackupJobResponse' :: Maybe Text
recoveryPointArn = Maybe Text
a} :: StartBackupJobResponse)
startBackupJobResponse_creationDate :: Lens.Lens' StartBackupJobResponse (Prelude.Maybe Prelude.UTCTime)
startBackupJobResponse_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StartBackupJobResponse -> f StartBackupJobResponse
startBackupJobResponse_creationDate = (StartBackupJobResponse -> Maybe POSIX)
-> (StartBackupJobResponse
-> Maybe POSIX -> StartBackupJobResponse)
-> Lens
StartBackupJobResponse
StartBackupJobResponse
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartBackupJobResponse' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:StartBackupJobResponse' :: StartBackupJobResponse -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: StartBackupJobResponse
s@StartBackupJobResponse' {} Maybe POSIX
a -> StartBackupJobResponse
s {$sel:creationDate:StartBackupJobResponse' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: StartBackupJobResponse) ((Maybe POSIX -> f (Maybe POSIX))
-> StartBackupJobResponse -> f StartBackupJobResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StartBackupJobResponse
-> f StartBackupJobResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
startBackupJobResponse_httpStatus :: Lens.Lens' StartBackupJobResponse Prelude.Int
startBackupJobResponse_httpStatus :: (Int -> f Int)
-> StartBackupJobResponse -> f StartBackupJobResponse
startBackupJobResponse_httpStatus = (StartBackupJobResponse -> Int)
-> (StartBackupJobResponse -> Int -> StartBackupJobResponse)
-> Lens StartBackupJobResponse StartBackupJobResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartBackupJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartBackupJobResponse' :: StartBackupJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartBackupJobResponse
s@StartBackupJobResponse' {} Int
a -> StartBackupJobResponse
s {$sel:httpStatus:StartBackupJobResponse' :: Int
httpStatus = Int
a} :: StartBackupJobResponse)
instance Prelude.NFData StartBackupJobResponse