{-# 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 #-}

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

-- |
-- Module      : Amazonka.Backup.CreateBackupVault
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a logical container where backups are stored. A
-- @CreateBackupVault@ request includes a name, optionally one or more
-- resource tags, an encryption key, and a request ID.
--
-- Do not include sensitive data, such as passport numbers, in the name of
-- a backup vault.
module Amazonka.Backup.CreateBackupVault
  ( -- * Creating a Request
    CreateBackupVault (..),
    newCreateBackupVault,

    -- * Request Lenses
    createBackupVault_backupVaultTags,
    createBackupVault_creatorRequestId,
    createBackupVault_encryptionKeyArn,
    createBackupVault_backupVaultName,

    -- * Destructuring the Response
    CreateBackupVaultResponse (..),
    newCreateBackupVaultResponse,

    -- * Response Lenses
    createBackupVaultResponse_backupVaultArn,
    createBackupVaultResponse_backupVaultName,
    createBackupVaultResponse_creationDate,
    createBackupVaultResponse_httpStatus,
  )
where

import Amazonka.Backup.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateBackupVault' smart constructor.
data CreateBackupVault = CreateBackupVault'
  { -- | Metadata that you can assign to help organize the resources that you
    -- create. Each tag is a key-value pair.
    CreateBackupVault -> Maybe (Sensitive (HashMap Text Text))
backupVaultTags :: Prelude.Maybe (Data.Sensitive (Prelude.HashMap Prelude.Text Prelude.Text)),
    -- | A unique string that identifies the request and allows failed requests
    -- to be retried without the risk of running the operation twice. This
    -- parameter is optional.
    --
    -- If used, this parameter must contain 1 to 50 alphanumeric or \'-_.\'
    -- characters.
    CreateBackupVault -> Maybe Text
creatorRequestId :: Prelude.Maybe Prelude.Text,
    -- | The server-side encryption key that is used to protect your backups; for
    -- example,
    -- @arn:aws:kms:us-west-2:111122223333:key\/1234abcd-12ab-34cd-56ef-1234567890ab@.
    CreateBackupVault -> Maybe Text
encryptionKeyArn :: Prelude.Maybe Prelude.Text,
    -- | The name of a logical container where backups are stored. Backup vaults
    -- are identified by names that are unique to the account used to create
    -- them and the Amazon Web Services Region where they are created. They
    -- consist of letters, numbers, and hyphens.
    CreateBackupVault -> Text
backupVaultName :: Prelude.Text
  }
  deriving (CreateBackupVault -> CreateBackupVault -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateBackupVault -> CreateBackupVault -> Bool
$c/= :: CreateBackupVault -> CreateBackupVault -> Bool
== :: CreateBackupVault -> CreateBackupVault -> Bool
$c== :: CreateBackupVault -> CreateBackupVault -> Bool
Prelude.Eq, Int -> CreateBackupVault -> ShowS
[CreateBackupVault] -> ShowS
CreateBackupVault -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateBackupVault] -> ShowS
$cshowList :: [CreateBackupVault] -> ShowS
show :: CreateBackupVault -> String
$cshow :: CreateBackupVault -> String
showsPrec :: Int -> CreateBackupVault -> ShowS
$cshowsPrec :: Int -> CreateBackupVault -> ShowS
Prelude.Show, forall x. Rep CreateBackupVault x -> CreateBackupVault
forall x. CreateBackupVault -> Rep CreateBackupVault x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateBackupVault x -> CreateBackupVault
$cfrom :: forall x. CreateBackupVault -> Rep CreateBackupVault x
Prelude.Generic)

-- |
-- Create a value of 'CreateBackupVault' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'backupVaultTags', 'createBackupVault_backupVaultTags' - Metadata that you can assign to help organize the resources that you
-- create. Each tag is a key-value pair.
--
-- 'creatorRequestId', 'createBackupVault_creatorRequestId' - A unique string that identifies the request and allows failed requests
-- to be retried without the risk of running the operation twice. This
-- parameter is optional.
--
-- If used, this parameter must contain 1 to 50 alphanumeric or \'-_.\'
-- characters.
--
-- 'encryptionKeyArn', 'createBackupVault_encryptionKeyArn' - The server-side encryption key that is used to protect your backups; for
-- example,
-- @arn:aws:kms:us-west-2:111122223333:key\/1234abcd-12ab-34cd-56ef-1234567890ab@.
--
-- 'backupVaultName', 'createBackupVault_backupVaultName' - The name of a logical container where backups are stored. Backup vaults
-- are identified by names that are unique to the account used to create
-- them and the Amazon Web Services Region where they are created. They
-- consist of letters, numbers, and hyphens.
newCreateBackupVault ::
  -- | 'backupVaultName'
  Prelude.Text ->
  CreateBackupVault
newCreateBackupVault :: Text -> CreateBackupVault
newCreateBackupVault Text
pBackupVaultName_ =
  CreateBackupVault'
    { $sel:backupVaultTags:CreateBackupVault' :: Maybe (Sensitive (HashMap Text Text))
backupVaultTags =
        forall a. Maybe a
Prelude.Nothing,
      $sel:creatorRequestId:CreateBackupVault' :: Maybe Text
creatorRequestId = forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionKeyArn:CreateBackupVault' :: Maybe Text
encryptionKeyArn = forall a. Maybe a
Prelude.Nothing,
      $sel:backupVaultName:CreateBackupVault' :: Text
backupVaultName = Text
pBackupVaultName_
    }

-- | Metadata that you can assign to help organize the resources that you
-- create. Each tag is a key-value pair.
createBackupVault_backupVaultTags :: Lens.Lens' CreateBackupVault (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createBackupVault_backupVaultTags :: Lens' CreateBackupVault (Maybe (HashMap Text Text))
createBackupVault_backupVaultTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBackupVault' {Maybe (Sensitive (HashMap Text Text))
backupVaultTags :: Maybe (Sensitive (HashMap Text Text))
$sel:backupVaultTags:CreateBackupVault' :: CreateBackupVault -> Maybe (Sensitive (HashMap Text Text))
backupVaultTags} -> Maybe (Sensitive (HashMap Text Text))
backupVaultTags) (\s :: CreateBackupVault
s@CreateBackupVault' {} Maybe (Sensitive (HashMap Text Text))
a -> CreateBackupVault
s {$sel:backupVaultTags:CreateBackupVault' :: Maybe (Sensitive (HashMap Text Text))
backupVaultTags = Maybe (Sensitive (HashMap Text Text))
a} :: CreateBackupVault) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 (forall a. Iso' (Sensitive a) a
Data._Sensitive forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)

-- | A unique string that identifies the request and allows failed requests
-- to be retried without the risk of running the operation twice. This
-- parameter is optional.
--
-- If used, this parameter must contain 1 to 50 alphanumeric or \'-_.\'
-- characters.
createBackupVault_creatorRequestId :: Lens.Lens' CreateBackupVault (Prelude.Maybe Prelude.Text)
createBackupVault_creatorRequestId :: Lens' CreateBackupVault (Maybe Text)
createBackupVault_creatorRequestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBackupVault' {Maybe Text
creatorRequestId :: Maybe Text
$sel:creatorRequestId:CreateBackupVault' :: CreateBackupVault -> Maybe Text
creatorRequestId} -> Maybe Text
creatorRequestId) (\s :: CreateBackupVault
s@CreateBackupVault' {} Maybe Text
a -> CreateBackupVault
s {$sel:creatorRequestId:CreateBackupVault' :: Maybe Text
creatorRequestId = Maybe Text
a} :: CreateBackupVault)

-- | The server-side encryption key that is used to protect your backups; for
-- example,
-- @arn:aws:kms:us-west-2:111122223333:key\/1234abcd-12ab-34cd-56ef-1234567890ab@.
createBackupVault_encryptionKeyArn :: Lens.Lens' CreateBackupVault (Prelude.Maybe Prelude.Text)
createBackupVault_encryptionKeyArn :: Lens' CreateBackupVault (Maybe Text)
createBackupVault_encryptionKeyArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBackupVault' {Maybe Text
encryptionKeyArn :: Maybe Text
$sel:encryptionKeyArn:CreateBackupVault' :: CreateBackupVault -> Maybe Text
encryptionKeyArn} -> Maybe Text
encryptionKeyArn) (\s :: CreateBackupVault
s@CreateBackupVault' {} Maybe Text
a -> CreateBackupVault
s {$sel:encryptionKeyArn:CreateBackupVault' :: Maybe Text
encryptionKeyArn = Maybe Text
a} :: CreateBackupVault)

-- | The name of a logical container where backups are stored. Backup vaults
-- are identified by names that are unique to the account used to create
-- them and the Amazon Web Services Region where they are created. They
-- consist of letters, numbers, and hyphens.
createBackupVault_backupVaultName :: Lens.Lens' CreateBackupVault Prelude.Text
createBackupVault_backupVaultName :: Lens' CreateBackupVault Text
createBackupVault_backupVaultName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBackupVault' {Text
backupVaultName :: Text
$sel:backupVaultName:CreateBackupVault' :: CreateBackupVault -> Text
backupVaultName} -> Text
backupVaultName) (\s :: CreateBackupVault
s@CreateBackupVault' {} Text
a -> CreateBackupVault
s {$sel:backupVaultName:CreateBackupVault' :: Text
backupVaultName = Text
a} :: CreateBackupVault)

instance Core.AWSRequest CreateBackupVault where
  type
    AWSResponse CreateBackupVault =
      CreateBackupVaultResponse
  request :: (Service -> Service)
-> CreateBackupVault -> Request CreateBackupVault
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateBackupVault
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateBackupVault)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> 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 -> CreateBackupVaultResponse
CreateBackupVaultResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"BackupVaultArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"BackupVaultName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreationDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateBackupVault where
  hashWithSalt :: Int -> CreateBackupVault -> Int
hashWithSalt Int
_salt CreateBackupVault' {Maybe Text
Maybe (Sensitive (HashMap Text Text))
Text
backupVaultName :: Text
encryptionKeyArn :: Maybe Text
creatorRequestId :: Maybe Text
backupVaultTags :: Maybe (Sensitive (HashMap Text Text))
$sel:backupVaultName:CreateBackupVault' :: CreateBackupVault -> Text
$sel:encryptionKeyArn:CreateBackupVault' :: CreateBackupVault -> Maybe Text
$sel:creatorRequestId:CreateBackupVault' :: CreateBackupVault -> Maybe Text
$sel:backupVaultTags:CreateBackupVault' :: CreateBackupVault -> Maybe (Sensitive (HashMap Text Text))
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive (HashMap Text Text))
backupVaultTags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
creatorRequestId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
encryptionKeyArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
backupVaultName

instance Prelude.NFData CreateBackupVault where
  rnf :: CreateBackupVault -> ()
rnf CreateBackupVault' {Maybe Text
Maybe (Sensitive (HashMap Text Text))
Text
backupVaultName :: Text
encryptionKeyArn :: Maybe Text
creatorRequestId :: Maybe Text
backupVaultTags :: Maybe (Sensitive (HashMap Text Text))
$sel:backupVaultName:CreateBackupVault' :: CreateBackupVault -> Text
$sel:encryptionKeyArn:CreateBackupVault' :: CreateBackupVault -> Maybe Text
$sel:creatorRequestId:CreateBackupVault' :: CreateBackupVault -> Maybe Text
$sel:backupVaultTags:CreateBackupVault' :: CreateBackupVault -> Maybe (Sensitive (HashMap Text Text))
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive (HashMap Text Text))
backupVaultTags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
creatorRequestId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
encryptionKeyArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
backupVaultName

instance Data.ToHeaders CreateBackupVault where
  toHeaders :: CreateBackupVault -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateBackupVault where
  toJSON :: CreateBackupVault -> Value
toJSON CreateBackupVault' {Maybe Text
Maybe (Sensitive (HashMap Text Text))
Text
backupVaultName :: Text
encryptionKeyArn :: Maybe Text
creatorRequestId :: Maybe Text
backupVaultTags :: Maybe (Sensitive (HashMap Text Text))
$sel:backupVaultName:CreateBackupVault' :: CreateBackupVault -> Text
$sel:encryptionKeyArn:CreateBackupVault' :: CreateBackupVault -> Maybe Text
$sel:creatorRequestId:CreateBackupVault' :: CreateBackupVault -> Maybe Text
$sel:backupVaultTags:CreateBackupVault' :: CreateBackupVault -> Maybe (Sensitive (HashMap Text Text))
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"BackupVaultTags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive (HashMap Text Text))
backupVaultTags,
            (Key
"CreatorRequestId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
creatorRequestId,
            (Key
"EncryptionKeyArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
encryptionKeyArn
          ]
      )

instance Data.ToPath CreateBackupVault where
  toPath :: CreateBackupVault -> ByteString
toPath CreateBackupVault' {Maybe Text
Maybe (Sensitive (HashMap Text Text))
Text
backupVaultName :: Text
encryptionKeyArn :: Maybe Text
creatorRequestId :: Maybe Text
backupVaultTags :: Maybe (Sensitive (HashMap Text Text))
$sel:backupVaultName:CreateBackupVault' :: CreateBackupVault -> Text
$sel:encryptionKeyArn:CreateBackupVault' :: CreateBackupVault -> Maybe Text
$sel:creatorRequestId:CreateBackupVault' :: CreateBackupVault -> Maybe Text
$sel:backupVaultTags:CreateBackupVault' :: CreateBackupVault -> Maybe (Sensitive (HashMap Text Text))
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/backup-vaults/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
backupVaultName]

instance Data.ToQuery CreateBackupVault where
  toQuery :: CreateBackupVault -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateBackupVaultResponse' smart constructor.
data CreateBackupVaultResponse = CreateBackupVaultResponse'
  { -- | An Amazon Resource Name (ARN) that uniquely identifies a backup vault;
    -- for example, @arn:aws:backup:us-east-1:123456789012:vault:aBackupVault@.
    CreateBackupVaultResponse -> Maybe Text
backupVaultArn :: Prelude.Maybe Prelude.Text,
    -- | The name of a logical container where backups are stored. Backup vaults
    -- are identified by names that are unique to the account used to create
    -- them and the Region where they are created. They consist of lowercase
    -- letters, numbers, and hyphens.
    CreateBackupVaultResponse -> Maybe Text
backupVaultName :: Prelude.Maybe Prelude.Text,
    -- | The date and time a backup vault is created, in Unix format and
    -- Coordinated Universal Time (UTC). The value of @CreationDate@ is
    -- accurate to milliseconds. For example, the value 1516925490.087
    -- represents Friday, January 26, 2018 12:11:30.087 AM.
    CreateBackupVaultResponse -> Maybe POSIX
creationDate :: Prelude.Maybe Data.POSIX,
    -- | The response's http status code.
    CreateBackupVaultResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateBackupVaultResponse -> CreateBackupVaultResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateBackupVaultResponse -> CreateBackupVaultResponse -> Bool
$c/= :: CreateBackupVaultResponse -> CreateBackupVaultResponse -> Bool
== :: CreateBackupVaultResponse -> CreateBackupVaultResponse -> Bool
$c== :: CreateBackupVaultResponse -> CreateBackupVaultResponse -> Bool
Prelude.Eq, ReadPrec [CreateBackupVaultResponse]
ReadPrec CreateBackupVaultResponse
Int -> ReadS CreateBackupVaultResponse
ReadS [CreateBackupVaultResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateBackupVaultResponse]
$creadListPrec :: ReadPrec [CreateBackupVaultResponse]
readPrec :: ReadPrec CreateBackupVaultResponse
$creadPrec :: ReadPrec CreateBackupVaultResponse
readList :: ReadS [CreateBackupVaultResponse]
$creadList :: ReadS [CreateBackupVaultResponse]
readsPrec :: Int -> ReadS CreateBackupVaultResponse
$creadsPrec :: Int -> ReadS CreateBackupVaultResponse
Prelude.Read, Int -> CreateBackupVaultResponse -> ShowS
[CreateBackupVaultResponse] -> ShowS
CreateBackupVaultResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateBackupVaultResponse] -> ShowS
$cshowList :: [CreateBackupVaultResponse] -> ShowS
show :: CreateBackupVaultResponse -> String
$cshow :: CreateBackupVaultResponse -> String
showsPrec :: Int -> CreateBackupVaultResponse -> ShowS
$cshowsPrec :: Int -> CreateBackupVaultResponse -> ShowS
Prelude.Show, forall x.
Rep CreateBackupVaultResponse x -> CreateBackupVaultResponse
forall x.
CreateBackupVaultResponse -> Rep CreateBackupVaultResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateBackupVaultResponse x -> CreateBackupVaultResponse
$cfrom :: forall x.
CreateBackupVaultResponse -> Rep CreateBackupVaultResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateBackupVaultResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'backupVaultArn', 'createBackupVaultResponse_backupVaultArn' - An Amazon Resource Name (ARN) that uniquely identifies a backup vault;
-- for example, @arn:aws:backup:us-east-1:123456789012:vault:aBackupVault@.
--
-- 'backupVaultName', 'createBackupVaultResponse_backupVaultName' - The name of a logical container where backups are stored. Backup vaults
-- are identified by names that are unique to the account used to create
-- them and the Region where they are created. They consist of lowercase
-- letters, numbers, and hyphens.
--
-- 'creationDate', 'createBackupVaultResponse_creationDate' - The date and time a backup vault is created, in Unix format and
-- Coordinated Universal Time (UTC). The value of @CreationDate@ is
-- accurate to milliseconds. For example, the value 1516925490.087
-- represents Friday, January 26, 2018 12:11:30.087 AM.
--
-- 'httpStatus', 'createBackupVaultResponse_httpStatus' - The response's http status code.
newCreateBackupVaultResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateBackupVaultResponse
newCreateBackupVaultResponse :: Int -> CreateBackupVaultResponse
newCreateBackupVaultResponse Int
pHttpStatus_ =
  CreateBackupVaultResponse'
    { $sel:backupVaultArn:CreateBackupVaultResponse' :: Maybe Text
backupVaultArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:backupVaultName:CreateBackupVaultResponse' :: Maybe Text
backupVaultName = forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:CreateBackupVaultResponse' :: Maybe POSIX
creationDate = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateBackupVaultResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An Amazon Resource Name (ARN) that uniquely identifies a backup vault;
-- for example, @arn:aws:backup:us-east-1:123456789012:vault:aBackupVault@.
createBackupVaultResponse_backupVaultArn :: Lens.Lens' CreateBackupVaultResponse (Prelude.Maybe Prelude.Text)
createBackupVaultResponse_backupVaultArn :: Lens' CreateBackupVaultResponse (Maybe Text)
createBackupVaultResponse_backupVaultArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBackupVaultResponse' {Maybe Text
backupVaultArn :: Maybe Text
$sel:backupVaultArn:CreateBackupVaultResponse' :: CreateBackupVaultResponse -> Maybe Text
backupVaultArn} -> Maybe Text
backupVaultArn) (\s :: CreateBackupVaultResponse
s@CreateBackupVaultResponse' {} Maybe Text
a -> CreateBackupVaultResponse
s {$sel:backupVaultArn:CreateBackupVaultResponse' :: Maybe Text
backupVaultArn = Maybe Text
a} :: CreateBackupVaultResponse)

-- | The name of a logical container where backups are stored. Backup vaults
-- are identified by names that are unique to the account used to create
-- them and the Region where they are created. They consist of lowercase
-- letters, numbers, and hyphens.
createBackupVaultResponse_backupVaultName :: Lens.Lens' CreateBackupVaultResponse (Prelude.Maybe Prelude.Text)
createBackupVaultResponse_backupVaultName :: Lens' CreateBackupVaultResponse (Maybe Text)
createBackupVaultResponse_backupVaultName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBackupVaultResponse' {Maybe Text
backupVaultName :: Maybe Text
$sel:backupVaultName:CreateBackupVaultResponse' :: CreateBackupVaultResponse -> Maybe Text
backupVaultName} -> Maybe Text
backupVaultName) (\s :: CreateBackupVaultResponse
s@CreateBackupVaultResponse' {} Maybe Text
a -> CreateBackupVaultResponse
s {$sel:backupVaultName:CreateBackupVaultResponse' :: Maybe Text
backupVaultName = Maybe Text
a} :: CreateBackupVaultResponse)

-- | The date and time a backup vault is created, in Unix format and
-- Coordinated Universal Time (UTC). The value of @CreationDate@ is
-- accurate to milliseconds. For example, the value 1516925490.087
-- represents Friday, January 26, 2018 12:11:30.087 AM.
createBackupVaultResponse_creationDate :: Lens.Lens' CreateBackupVaultResponse (Prelude.Maybe Prelude.UTCTime)
createBackupVaultResponse_creationDate :: Lens' CreateBackupVaultResponse (Maybe UTCTime)
createBackupVaultResponse_creationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBackupVaultResponse' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:CreateBackupVaultResponse' :: CreateBackupVaultResponse -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: CreateBackupVaultResponse
s@CreateBackupVaultResponse' {} Maybe POSIX
a -> CreateBackupVaultResponse
s {$sel:creationDate:CreateBackupVaultResponse' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: CreateBackupVaultResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The response's http status code.
createBackupVaultResponse_httpStatus :: Lens.Lens' CreateBackupVaultResponse Prelude.Int
createBackupVaultResponse_httpStatus :: Lens' CreateBackupVaultResponse Int
createBackupVaultResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBackupVaultResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateBackupVaultResponse' :: CreateBackupVaultResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateBackupVaultResponse
s@CreateBackupVaultResponse' {} Int
a -> CreateBackupVaultResponse
s {$sel:httpStatus:CreateBackupVaultResponse' :: Int
httpStatus = Int
a} :: CreateBackupVaultResponse)

instance Prelude.NFData CreateBackupVaultResponse where
  rnf :: CreateBackupVaultResponse -> ()
rnf CreateBackupVaultResponse' {Int
Maybe Text
Maybe POSIX
httpStatus :: Int
creationDate :: Maybe POSIX
backupVaultName :: Maybe Text
backupVaultArn :: Maybe Text
$sel:httpStatus:CreateBackupVaultResponse' :: CreateBackupVaultResponse -> Int
$sel:creationDate:CreateBackupVaultResponse' :: CreateBackupVaultResponse -> Maybe POSIX
$sel:backupVaultName:CreateBackupVaultResponse' :: CreateBackupVaultResponse -> Maybe Text
$sel:backupVaultArn:CreateBackupVaultResponse' :: CreateBackupVaultResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
backupVaultArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
backupVaultName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus