{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- 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_creatorRequestId,
    createBackupVault_encryptionKeyArn,
    createBackupVault_backupVaultTags,
    createBackupVault_backupVaultName,

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

    -- * Response Lenses
    createBackupVaultResponse_backupVaultArn,
    createBackupVaultResponse_creationDate,
    createBackupVaultResponse_backupVaultName,
    createBackupVaultResponse_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

-- | /See:/ 'newCreateBackupVault' smart constructor.
data CreateBackupVault = CreateBackupVault'
  { -- | A unique string that identifies the request and allows failed requests
    -- to be retried without the risk of running the operation twice.
    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,
    -- | 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 (Core.Sensitive (Prelude.HashMap Prelude.Text 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
(CreateBackupVault -> CreateBackupVault -> Bool)
-> (CreateBackupVault -> CreateBackupVault -> Bool)
-> Eq CreateBackupVault
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
(Int -> CreateBackupVault -> ShowS)
-> (CreateBackupVault -> String)
-> ([CreateBackupVault] -> ShowS)
-> Show CreateBackupVault
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. CreateBackupVault -> Rep CreateBackupVault x)
-> (forall x. Rep CreateBackupVault x -> CreateBackupVault)
-> Generic CreateBackupVault
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:
--
-- '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.
--
-- '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@.
--
-- 'backupVaultTags', 'createBackupVault_backupVaultTags' - Metadata that you can assign to help organize the resources that you
-- create. Each tag is a key-value pair.
--
-- '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' :: Maybe Text
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Text
-> CreateBackupVault
CreateBackupVault'
    { $sel:creatorRequestId:CreateBackupVault' :: Maybe Text
creatorRequestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionKeyArn:CreateBackupVault' :: Maybe Text
encryptionKeyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backupVaultTags:CreateBackupVault' :: Maybe (Sensitive (HashMap Text Text))
backupVaultTags = Maybe (Sensitive (HashMap Text Text))
forall a. Maybe a
Prelude.Nothing,
      $sel:backupVaultName:CreateBackupVault' :: Text
backupVaultName = Text
pBackupVaultName_
    }

-- | A unique string that identifies the request and allows failed requests
-- to be retried without the risk of running the operation twice.
createBackupVault_creatorRequestId :: Lens.Lens' CreateBackupVault (Prelude.Maybe Prelude.Text)
createBackupVault_creatorRequestId :: (Maybe Text -> f (Maybe Text))
-> CreateBackupVault -> f CreateBackupVault
createBackupVault_creatorRequestId = (CreateBackupVault -> Maybe Text)
-> (CreateBackupVault -> Maybe Text -> CreateBackupVault)
-> Lens
     CreateBackupVault CreateBackupVault (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> CreateBackupVault -> f CreateBackupVault
createBackupVault_encryptionKeyArn = (CreateBackupVault -> Maybe Text)
-> (CreateBackupVault -> Maybe Text -> CreateBackupVault)
-> Lens
     CreateBackupVault CreateBackupVault (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateBackupVault -> f CreateBackupVault
createBackupVault_backupVaultTags = (CreateBackupVault -> Maybe (Sensitive (HashMap Text Text)))
-> (CreateBackupVault
    -> Maybe (Sensitive (HashMap Text Text)) -> CreateBackupVault)
-> Lens
     CreateBackupVault
     CreateBackupVault
     (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 (\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) ((Maybe (Sensitive (HashMap Text Text))
  -> f (Maybe (Sensitive (HashMap Text Text))))
 -> CreateBackupVault -> f CreateBackupVault)
-> ((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)))
-> CreateBackupVault
-> f CreateBackupVault
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)

-- | 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 :: (Text -> f Text) -> CreateBackupVault -> f CreateBackupVault
createBackupVault_backupVaultName = (CreateBackupVault -> Text)
-> (CreateBackupVault -> Text -> CreateBackupVault)
-> Lens CreateBackupVault CreateBackupVault Text Text
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 :: CreateBackupVault -> Request CreateBackupVault
request = Service -> CreateBackupVault -> Request CreateBackupVault
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateBackupVault
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateBackupVault)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateBackupVault))
-> Logger
-> Service
-> Proxy CreateBackupVault
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateBackupVault)))
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 POSIX -> Maybe Text -> Int -> CreateBackupVaultResponse
CreateBackupVaultResponse'
            (Maybe Text
 -> Maybe POSIX -> Maybe Text -> Int -> CreateBackupVaultResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX -> Maybe Text -> Int -> CreateBackupVaultResponse)
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
"BackupVaultArn")
            Either
  String
  (Maybe POSIX -> Maybe Text -> Int -> CreateBackupVaultResponse)
-> Either String (Maybe POSIX)
-> Either String (Maybe Text -> Int -> CreateBackupVaultResponse)
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 (Maybe Text -> Int -> CreateBackupVaultResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateBackupVaultResponse)
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
"BackupVaultName")
            Either String (Int -> CreateBackupVaultResponse)
-> Either String Int -> Either String CreateBackupVaultResponse
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 CreateBackupVault

instance Prelude.NFData CreateBackupVault

instance Core.ToHeaders CreateBackupVault where
  toHeaders :: CreateBackupVault -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateBackupVault -> 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 CreateBackupVault where
  toJSON :: CreateBackupVault -> Value
toJSON CreateBackupVault' {Maybe Text
Maybe (Sensitive (HashMap Text Text))
Text
backupVaultName :: Text
backupVaultTags :: Maybe (Sensitive (HashMap Text Text))
encryptionKeyArn :: Maybe Text
creatorRequestId :: Maybe Text
$sel:backupVaultName:CreateBackupVault' :: CreateBackupVault -> Text
$sel:backupVaultTags:CreateBackupVault' :: CreateBackupVault -> Maybe (Sensitive (HashMap Text Text))
$sel:encryptionKeyArn:CreateBackupVault' :: CreateBackupVault -> Maybe Text
$sel:creatorRequestId:CreateBackupVault' :: CreateBackupVault -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CreatorRequestId" 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
creatorRequestId,
            (Text
"EncryptionKeyArn" 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
encryptionKeyArn,
            (Text
"BackupVaultTags" 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))
backupVaultTags
          ]
      )

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

instance Core.ToQuery CreateBackupVault where
  toQuery :: CreateBackupVault -> QueryString
toQuery = QueryString -> CreateBackupVault -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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 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 Core.POSIX,
    -- | 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 response's http status code.
    CreateBackupVaultResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateBackupVaultResponse -> CreateBackupVaultResponse -> Bool
(CreateBackupVaultResponse -> CreateBackupVaultResponse -> Bool)
-> (CreateBackupVaultResponse -> CreateBackupVaultResponse -> Bool)
-> Eq CreateBackupVaultResponse
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]
(Int -> ReadS CreateBackupVaultResponse)
-> ReadS [CreateBackupVaultResponse]
-> ReadPrec CreateBackupVaultResponse
-> ReadPrec [CreateBackupVaultResponse]
-> Read 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
(Int -> CreateBackupVaultResponse -> ShowS)
-> (CreateBackupVaultResponse -> String)
-> ([CreateBackupVaultResponse] -> ShowS)
-> Show CreateBackupVaultResponse
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.
 CreateBackupVaultResponse -> Rep CreateBackupVaultResponse x)
-> (forall x.
    Rep CreateBackupVaultResponse x -> CreateBackupVaultResponse)
-> Generic CreateBackupVaultResponse
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@.
--
-- '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.
--
-- '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.
--
-- 'httpStatus', 'createBackupVaultResponse_httpStatus' - The response's http status code.
newCreateBackupVaultResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateBackupVaultResponse
newCreateBackupVaultResponse :: Int -> CreateBackupVaultResponse
newCreateBackupVaultResponse Int
pHttpStatus_ =
  CreateBackupVaultResponse' :: Maybe Text
-> Maybe POSIX -> Maybe Text -> Int -> CreateBackupVaultResponse
CreateBackupVaultResponse'
    { $sel:backupVaultArn:CreateBackupVaultResponse' :: Maybe Text
backupVaultArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:CreateBackupVaultResponse' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:backupVaultName:CreateBackupVaultResponse' :: Maybe Text
backupVaultName = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> CreateBackupVaultResponse -> f CreateBackupVaultResponse
createBackupVaultResponse_backupVaultArn = (CreateBackupVaultResponse -> Maybe Text)
-> (CreateBackupVaultResponse
    -> Maybe Text -> CreateBackupVaultResponse)
-> Lens
     CreateBackupVaultResponse
     CreateBackupVaultResponse
     (Maybe Text)
     (Maybe Text)
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 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 :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateBackupVaultResponse -> f CreateBackupVaultResponse
createBackupVaultResponse_creationDate = (CreateBackupVaultResponse -> Maybe POSIX)
-> (CreateBackupVaultResponse
    -> Maybe POSIX -> CreateBackupVaultResponse)
-> Lens
     CreateBackupVaultResponse
     CreateBackupVaultResponse
     (Maybe POSIX)
     (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> CreateBackupVaultResponse -> f CreateBackupVaultResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateBackupVaultResponse
-> f CreateBackupVaultResponse
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

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> CreateBackupVaultResponse -> f CreateBackupVaultResponse
createBackupVaultResponse_backupVaultName = (CreateBackupVaultResponse -> Maybe Text)
-> (CreateBackupVaultResponse
    -> Maybe Text -> CreateBackupVaultResponse)
-> Lens
     CreateBackupVaultResponse
     CreateBackupVaultResponse
     (Maybe Text)
     (Maybe Text)
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 response's http status code.
createBackupVaultResponse_httpStatus :: Lens.Lens' CreateBackupVaultResponse Prelude.Int
createBackupVaultResponse_httpStatus :: (Int -> f Int)
-> CreateBackupVaultResponse -> f CreateBackupVaultResponse
createBackupVaultResponse_httpStatus = (CreateBackupVaultResponse -> Int)
-> (CreateBackupVaultResponse -> Int -> CreateBackupVaultResponse)
-> Lens CreateBackupVaultResponse CreateBackupVaultResponse Int Int
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