{-# 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.StorageGateway.CreateTapes
-- 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 one or more virtual tapes. You write data to the virtual tapes
-- and then archive the tapes. This operation is only supported in the tape
-- gateway type.
--
-- Cache storage must be allocated to the gateway before you can create
-- virtual tapes. Use the AddCache operation to add cache storage to a
-- gateway.
module Amazonka.StorageGateway.CreateTapes
  ( -- * Creating a Request
    CreateTapes (..),
    newCreateTapes,

    -- * Request Lenses
    createTapes_kmsEncrypted,
    createTapes_kmsKey,
    createTapes_poolId,
    createTapes_tags,
    createTapes_worm,
    createTapes_gatewayARN,
    createTapes_tapeSizeInBytes,
    createTapes_clientToken,
    createTapes_numTapesToCreate,
    createTapes_tapeBarcodePrefix,

    -- * Destructuring the Response
    CreateTapesResponse (..),
    newCreateTapesResponse,

    -- * Response Lenses
    createTapesResponse_tapeARNs,
    createTapesResponse_httpStatus,
  )
where

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
import Amazonka.StorageGateway.Types

-- | CreateTapesInput
--
-- /See:/ 'newCreateTapes' smart constructor.
data CreateTapes = CreateTapes'
  { -- | Set to @true@ to use Amazon S3 server-side encryption with your own KMS
    -- key, or @false@ to use a key managed by Amazon S3. Optional.
    --
    -- Valid Values: @true@ | @false@
    CreateTapes -> Maybe Bool
kmsEncrypted :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Resource Name (ARN) of a symmetric customer master key (CMK)
    -- used for Amazon S3 server-side encryption. Storage Gateway does not
    -- support asymmetric CMKs. This value can only be set when @KMSEncrypted@
    -- is @true@. Optional.
    CreateTapes -> Maybe Text
kmsKey :: Prelude.Maybe Prelude.Text,
    -- | The ID of the pool that you want to add your tape to for archiving. The
    -- tape in this pool is archived in the S3 storage class that is associated
    -- with the pool. When you use your backup application to eject the tape,
    -- the tape is archived directly into the storage class (S3 Glacier or S3
    -- Glacier Deep Archive) that corresponds to the pool.
    CreateTapes -> Maybe Text
poolId :: Prelude.Maybe Prelude.Text,
    -- | A list of up to 50 tags that can be assigned to a virtual tape. Each tag
    -- is a key-value pair.
    --
    -- Valid characters for key and value are letters, spaces, and numbers
    -- representable in UTF-8 format, and the following special characters: + -
    -- = . _ : \/ \@. The maximum length of a tag\'s key is 128 characters, and
    -- the maximum length for a tag\'s value is 256.
    CreateTapes -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | Set to @TRUE@ if the tape you are creating is to be configured as a
    -- write-once-read-many (WORM) tape.
    CreateTapes -> Maybe Bool
worm :: Prelude.Maybe Prelude.Bool,
    -- | The unique Amazon Resource Name (ARN) that represents the gateway to
    -- associate the virtual tapes with. Use the ListGateways operation to
    -- return a list of gateways for your account and Amazon Web Services
    -- Region.
    CreateTapes -> Text
gatewayARN :: Prelude.Text,
    -- | The size, in bytes, of the virtual tapes that you want to create.
    --
    -- The size must be aligned by gigabyte (1024*1024*1024 bytes).
    CreateTapes -> Integer
tapeSizeInBytes :: Prelude.Integer,
    -- | A unique identifier that you use to retry a request. If you retry a
    -- request, use the same @ClientToken@ you specified in the initial
    -- request.
    --
    -- Using the same @ClientToken@ prevents creating the tape multiple times.
    CreateTapes -> Text
clientToken :: Prelude.Text,
    -- | The number of virtual tapes that you want to create.
    CreateTapes -> Natural
numTapesToCreate :: Prelude.Natural,
    -- | A prefix that you append to the barcode of the virtual tape you are
    -- creating. This prefix makes the barcode unique.
    --
    -- The prefix must be 1-4 characters in length and must be one of the
    -- uppercase letters from A to Z.
    CreateTapes -> Text
tapeBarcodePrefix :: Prelude.Text
  }
  deriving (CreateTapes -> CreateTapes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTapes -> CreateTapes -> Bool
$c/= :: CreateTapes -> CreateTapes -> Bool
== :: CreateTapes -> CreateTapes -> Bool
$c== :: CreateTapes -> CreateTapes -> Bool
Prelude.Eq, ReadPrec [CreateTapes]
ReadPrec CreateTapes
Int -> ReadS CreateTapes
ReadS [CreateTapes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTapes]
$creadListPrec :: ReadPrec [CreateTapes]
readPrec :: ReadPrec CreateTapes
$creadPrec :: ReadPrec CreateTapes
readList :: ReadS [CreateTapes]
$creadList :: ReadS [CreateTapes]
readsPrec :: Int -> ReadS CreateTapes
$creadsPrec :: Int -> ReadS CreateTapes
Prelude.Read, Int -> CreateTapes -> ShowS
[CreateTapes] -> ShowS
CreateTapes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTapes] -> ShowS
$cshowList :: [CreateTapes] -> ShowS
show :: CreateTapes -> String
$cshow :: CreateTapes -> String
showsPrec :: Int -> CreateTapes -> ShowS
$cshowsPrec :: Int -> CreateTapes -> ShowS
Prelude.Show, forall x. Rep CreateTapes x -> CreateTapes
forall x. CreateTapes -> Rep CreateTapes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateTapes x -> CreateTapes
$cfrom :: forall x. CreateTapes -> Rep CreateTapes x
Prelude.Generic)

-- |
-- Create a value of 'CreateTapes' 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:
--
-- 'kmsEncrypted', 'createTapes_kmsEncrypted' - Set to @true@ to use Amazon S3 server-side encryption with your own KMS
-- key, or @false@ to use a key managed by Amazon S3. Optional.
--
-- Valid Values: @true@ | @false@
--
-- 'kmsKey', 'createTapes_kmsKey' - The Amazon Resource Name (ARN) of a symmetric customer master key (CMK)
-- used for Amazon S3 server-side encryption. Storage Gateway does not
-- support asymmetric CMKs. This value can only be set when @KMSEncrypted@
-- is @true@. Optional.
--
-- 'poolId', 'createTapes_poolId' - The ID of the pool that you want to add your tape to for archiving. The
-- tape in this pool is archived in the S3 storage class that is associated
-- with the pool. When you use your backup application to eject the tape,
-- the tape is archived directly into the storage class (S3 Glacier or S3
-- Glacier Deep Archive) that corresponds to the pool.
--
-- 'tags', 'createTapes_tags' - A list of up to 50 tags that can be assigned to a virtual tape. Each tag
-- is a key-value pair.
--
-- Valid characters for key and value are letters, spaces, and numbers
-- representable in UTF-8 format, and the following special characters: + -
-- = . _ : \/ \@. The maximum length of a tag\'s key is 128 characters, and
-- the maximum length for a tag\'s value is 256.
--
-- 'worm', 'createTapes_worm' - Set to @TRUE@ if the tape you are creating is to be configured as a
-- write-once-read-many (WORM) tape.
--
-- 'gatewayARN', 'createTapes_gatewayARN' - The unique Amazon Resource Name (ARN) that represents the gateway to
-- associate the virtual tapes with. Use the ListGateways operation to
-- return a list of gateways for your account and Amazon Web Services
-- Region.
--
-- 'tapeSizeInBytes', 'createTapes_tapeSizeInBytes' - The size, in bytes, of the virtual tapes that you want to create.
--
-- The size must be aligned by gigabyte (1024*1024*1024 bytes).
--
-- 'clientToken', 'createTapes_clientToken' - A unique identifier that you use to retry a request. If you retry a
-- request, use the same @ClientToken@ you specified in the initial
-- request.
--
-- Using the same @ClientToken@ prevents creating the tape multiple times.
--
-- 'numTapesToCreate', 'createTapes_numTapesToCreate' - The number of virtual tapes that you want to create.
--
-- 'tapeBarcodePrefix', 'createTapes_tapeBarcodePrefix' - A prefix that you append to the barcode of the virtual tape you are
-- creating. This prefix makes the barcode unique.
--
-- The prefix must be 1-4 characters in length and must be one of the
-- uppercase letters from A to Z.
newCreateTapes ::
  -- | 'gatewayARN'
  Prelude.Text ->
  -- | 'tapeSizeInBytes'
  Prelude.Integer ->
  -- | 'clientToken'
  Prelude.Text ->
  -- | 'numTapesToCreate'
  Prelude.Natural ->
  -- | 'tapeBarcodePrefix'
  Prelude.Text ->
  CreateTapes
newCreateTapes :: Text -> Integer -> Text -> Natural -> Text -> CreateTapes
newCreateTapes
  Text
pGatewayARN_
  Integer
pTapeSizeInBytes_
  Text
pClientToken_
  Natural
pNumTapesToCreate_
  Text
pTapeBarcodePrefix_ =
    CreateTapes'
      { $sel:kmsEncrypted:CreateTapes' :: Maybe Bool
kmsEncrypted = forall a. Maybe a
Prelude.Nothing,
        $sel:kmsKey:CreateTapes' :: Maybe Text
kmsKey = forall a. Maybe a
Prelude.Nothing,
        $sel:poolId:CreateTapes' :: Maybe Text
poolId = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateTapes' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:worm:CreateTapes' :: Maybe Bool
worm = forall a. Maybe a
Prelude.Nothing,
        $sel:gatewayARN:CreateTapes' :: Text
gatewayARN = Text
pGatewayARN_,
        $sel:tapeSizeInBytes:CreateTapes' :: Integer
tapeSizeInBytes = Integer
pTapeSizeInBytes_,
        $sel:clientToken:CreateTapes' :: Text
clientToken = Text
pClientToken_,
        $sel:numTapesToCreate:CreateTapes' :: Natural
numTapesToCreate = Natural
pNumTapesToCreate_,
        $sel:tapeBarcodePrefix:CreateTapes' :: Text
tapeBarcodePrefix = Text
pTapeBarcodePrefix_
      }

-- | Set to @true@ to use Amazon S3 server-side encryption with your own KMS
-- key, or @false@ to use a key managed by Amazon S3. Optional.
--
-- Valid Values: @true@ | @false@
createTapes_kmsEncrypted :: Lens.Lens' CreateTapes (Prelude.Maybe Prelude.Bool)
createTapes_kmsEncrypted :: Lens' CreateTapes (Maybe Bool)
createTapes_kmsEncrypted = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTapes' {Maybe Bool
kmsEncrypted :: Maybe Bool
$sel:kmsEncrypted:CreateTapes' :: CreateTapes -> Maybe Bool
kmsEncrypted} -> Maybe Bool
kmsEncrypted) (\s :: CreateTapes
s@CreateTapes' {} Maybe Bool
a -> CreateTapes
s {$sel:kmsEncrypted:CreateTapes' :: Maybe Bool
kmsEncrypted = Maybe Bool
a} :: CreateTapes)

-- | The Amazon Resource Name (ARN) of a symmetric customer master key (CMK)
-- used for Amazon S3 server-side encryption. Storage Gateway does not
-- support asymmetric CMKs. This value can only be set when @KMSEncrypted@
-- is @true@. Optional.
createTapes_kmsKey :: Lens.Lens' CreateTapes (Prelude.Maybe Prelude.Text)
createTapes_kmsKey :: Lens' CreateTapes (Maybe Text)
createTapes_kmsKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTapes' {Maybe Text
kmsKey :: Maybe Text
$sel:kmsKey:CreateTapes' :: CreateTapes -> Maybe Text
kmsKey} -> Maybe Text
kmsKey) (\s :: CreateTapes
s@CreateTapes' {} Maybe Text
a -> CreateTapes
s {$sel:kmsKey:CreateTapes' :: Maybe Text
kmsKey = Maybe Text
a} :: CreateTapes)

-- | The ID of the pool that you want to add your tape to for archiving. The
-- tape in this pool is archived in the S3 storage class that is associated
-- with the pool. When you use your backup application to eject the tape,
-- the tape is archived directly into the storage class (S3 Glacier or S3
-- Glacier Deep Archive) that corresponds to the pool.
createTapes_poolId :: Lens.Lens' CreateTapes (Prelude.Maybe Prelude.Text)
createTapes_poolId :: Lens' CreateTapes (Maybe Text)
createTapes_poolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTapes' {Maybe Text
poolId :: Maybe Text
$sel:poolId:CreateTapes' :: CreateTapes -> Maybe Text
poolId} -> Maybe Text
poolId) (\s :: CreateTapes
s@CreateTapes' {} Maybe Text
a -> CreateTapes
s {$sel:poolId:CreateTapes' :: Maybe Text
poolId = Maybe Text
a} :: CreateTapes)

-- | A list of up to 50 tags that can be assigned to a virtual tape. Each tag
-- is a key-value pair.
--
-- Valid characters for key and value are letters, spaces, and numbers
-- representable in UTF-8 format, and the following special characters: + -
-- = . _ : \/ \@. The maximum length of a tag\'s key is 128 characters, and
-- the maximum length for a tag\'s value is 256.
createTapes_tags :: Lens.Lens' CreateTapes (Prelude.Maybe [Tag])
createTapes_tags :: Lens' CreateTapes (Maybe [Tag])
createTapes_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTapes' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateTapes' :: CreateTapes -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateTapes
s@CreateTapes' {} Maybe [Tag]
a -> CreateTapes
s {$sel:tags:CreateTapes' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateTapes) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Set to @TRUE@ if the tape you are creating is to be configured as a
-- write-once-read-many (WORM) tape.
createTapes_worm :: Lens.Lens' CreateTapes (Prelude.Maybe Prelude.Bool)
createTapes_worm :: Lens' CreateTapes (Maybe Bool)
createTapes_worm = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTapes' {Maybe Bool
worm :: Maybe Bool
$sel:worm:CreateTapes' :: CreateTapes -> Maybe Bool
worm} -> Maybe Bool
worm) (\s :: CreateTapes
s@CreateTapes' {} Maybe Bool
a -> CreateTapes
s {$sel:worm:CreateTapes' :: Maybe Bool
worm = Maybe Bool
a} :: CreateTapes)

-- | The unique Amazon Resource Name (ARN) that represents the gateway to
-- associate the virtual tapes with. Use the ListGateways operation to
-- return a list of gateways for your account and Amazon Web Services
-- Region.
createTapes_gatewayARN :: Lens.Lens' CreateTapes Prelude.Text
createTapes_gatewayARN :: Lens' CreateTapes Text
createTapes_gatewayARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTapes' {Text
gatewayARN :: Text
$sel:gatewayARN:CreateTapes' :: CreateTapes -> Text
gatewayARN} -> Text
gatewayARN) (\s :: CreateTapes
s@CreateTapes' {} Text
a -> CreateTapes
s {$sel:gatewayARN:CreateTapes' :: Text
gatewayARN = Text
a} :: CreateTapes)

-- | The size, in bytes, of the virtual tapes that you want to create.
--
-- The size must be aligned by gigabyte (1024*1024*1024 bytes).
createTapes_tapeSizeInBytes :: Lens.Lens' CreateTapes Prelude.Integer
createTapes_tapeSizeInBytes :: Lens' CreateTapes Integer
createTapes_tapeSizeInBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTapes' {Integer
tapeSizeInBytes :: Integer
$sel:tapeSizeInBytes:CreateTapes' :: CreateTapes -> Integer
tapeSizeInBytes} -> Integer
tapeSizeInBytes) (\s :: CreateTapes
s@CreateTapes' {} Integer
a -> CreateTapes
s {$sel:tapeSizeInBytes:CreateTapes' :: Integer
tapeSizeInBytes = Integer
a} :: CreateTapes)

-- | A unique identifier that you use to retry a request. If you retry a
-- request, use the same @ClientToken@ you specified in the initial
-- request.
--
-- Using the same @ClientToken@ prevents creating the tape multiple times.
createTapes_clientToken :: Lens.Lens' CreateTapes Prelude.Text
createTapes_clientToken :: Lens' CreateTapes Text
createTapes_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTapes' {Text
clientToken :: Text
$sel:clientToken:CreateTapes' :: CreateTapes -> Text
clientToken} -> Text
clientToken) (\s :: CreateTapes
s@CreateTapes' {} Text
a -> CreateTapes
s {$sel:clientToken:CreateTapes' :: Text
clientToken = Text
a} :: CreateTapes)

-- | The number of virtual tapes that you want to create.
createTapes_numTapesToCreate :: Lens.Lens' CreateTapes Prelude.Natural
createTapes_numTapesToCreate :: Lens' CreateTapes Natural
createTapes_numTapesToCreate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTapes' {Natural
numTapesToCreate :: Natural
$sel:numTapesToCreate:CreateTapes' :: CreateTapes -> Natural
numTapesToCreate} -> Natural
numTapesToCreate) (\s :: CreateTapes
s@CreateTapes' {} Natural
a -> CreateTapes
s {$sel:numTapesToCreate:CreateTapes' :: Natural
numTapesToCreate = Natural
a} :: CreateTapes)

-- | A prefix that you append to the barcode of the virtual tape you are
-- creating. This prefix makes the barcode unique.
--
-- The prefix must be 1-4 characters in length and must be one of the
-- uppercase letters from A to Z.
createTapes_tapeBarcodePrefix :: Lens.Lens' CreateTapes Prelude.Text
createTapes_tapeBarcodePrefix :: Lens' CreateTapes Text
createTapes_tapeBarcodePrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTapes' {Text
tapeBarcodePrefix :: Text
$sel:tapeBarcodePrefix:CreateTapes' :: CreateTapes -> Text
tapeBarcodePrefix} -> Text
tapeBarcodePrefix) (\s :: CreateTapes
s@CreateTapes' {} Text
a -> CreateTapes
s {$sel:tapeBarcodePrefix:CreateTapes' :: Text
tapeBarcodePrefix = Text
a} :: CreateTapes)

instance Core.AWSRequest CreateTapes where
  type AWSResponse CreateTapes = CreateTapesResponse
  request :: (Service -> Service) -> CreateTapes -> Request CreateTapes
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateTapes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateTapes)))
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] -> Int -> CreateTapesResponse
CreateTapesResponse'
            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
"TapeARNs" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            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 CreateTapes where
  hashWithSalt :: Int -> CreateTapes -> Int
hashWithSalt Int
_salt CreateTapes' {Integer
Natural
Maybe Bool
Maybe [Tag]
Maybe Text
Text
tapeBarcodePrefix :: Text
numTapesToCreate :: Natural
clientToken :: Text
tapeSizeInBytes :: Integer
gatewayARN :: Text
worm :: Maybe Bool
tags :: Maybe [Tag]
poolId :: Maybe Text
kmsKey :: Maybe Text
kmsEncrypted :: Maybe Bool
$sel:tapeBarcodePrefix:CreateTapes' :: CreateTapes -> Text
$sel:numTapesToCreate:CreateTapes' :: CreateTapes -> Natural
$sel:clientToken:CreateTapes' :: CreateTapes -> Text
$sel:tapeSizeInBytes:CreateTapes' :: CreateTapes -> Integer
$sel:gatewayARN:CreateTapes' :: CreateTapes -> Text
$sel:worm:CreateTapes' :: CreateTapes -> Maybe Bool
$sel:tags:CreateTapes' :: CreateTapes -> Maybe [Tag]
$sel:poolId:CreateTapes' :: CreateTapes -> Maybe Text
$sel:kmsKey:CreateTapes' :: CreateTapes -> Maybe Text
$sel:kmsEncrypted:CreateTapes' :: CreateTapes -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
kmsEncrypted
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKey
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
poolId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
worm
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
gatewayARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
tapeSizeInBytes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
numTapesToCreate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
tapeBarcodePrefix

instance Prelude.NFData CreateTapes where
  rnf :: CreateTapes -> ()
rnf CreateTapes' {Integer
Natural
Maybe Bool
Maybe [Tag]
Maybe Text
Text
tapeBarcodePrefix :: Text
numTapesToCreate :: Natural
clientToken :: Text
tapeSizeInBytes :: Integer
gatewayARN :: Text
worm :: Maybe Bool
tags :: Maybe [Tag]
poolId :: Maybe Text
kmsKey :: Maybe Text
kmsEncrypted :: Maybe Bool
$sel:tapeBarcodePrefix:CreateTapes' :: CreateTapes -> Text
$sel:numTapesToCreate:CreateTapes' :: CreateTapes -> Natural
$sel:clientToken:CreateTapes' :: CreateTapes -> Text
$sel:tapeSizeInBytes:CreateTapes' :: CreateTapes -> Integer
$sel:gatewayARN:CreateTapes' :: CreateTapes -> Text
$sel:worm:CreateTapes' :: CreateTapes -> Maybe Bool
$sel:tags:CreateTapes' :: CreateTapes -> Maybe [Tag]
$sel:poolId:CreateTapes' :: CreateTapes -> Maybe Text
$sel:kmsKey:CreateTapes' :: CreateTapes -> Maybe Text
$sel:kmsEncrypted:CreateTapes' :: CreateTapes -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
kmsEncrypted
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
poolId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
worm
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
gatewayARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
tapeSizeInBytes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
numTapesToCreate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
tapeBarcodePrefix

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

instance Data.ToJSON CreateTapes where
  toJSON :: CreateTapes -> Value
toJSON CreateTapes' {Integer
Natural
Maybe Bool
Maybe [Tag]
Maybe Text
Text
tapeBarcodePrefix :: Text
numTapesToCreate :: Natural
clientToken :: Text
tapeSizeInBytes :: Integer
gatewayARN :: Text
worm :: Maybe Bool
tags :: Maybe [Tag]
poolId :: Maybe Text
kmsKey :: Maybe Text
kmsEncrypted :: Maybe Bool
$sel:tapeBarcodePrefix:CreateTapes' :: CreateTapes -> Text
$sel:numTapesToCreate:CreateTapes' :: CreateTapes -> Natural
$sel:clientToken:CreateTapes' :: CreateTapes -> Text
$sel:tapeSizeInBytes:CreateTapes' :: CreateTapes -> Integer
$sel:gatewayARN:CreateTapes' :: CreateTapes -> Text
$sel:worm:CreateTapes' :: CreateTapes -> Maybe Bool
$sel:tags:CreateTapes' :: CreateTapes -> Maybe [Tag]
$sel:poolId:CreateTapes' :: CreateTapes -> Maybe Text
$sel:kmsKey:CreateTapes' :: CreateTapes -> Maybe Text
$sel:kmsEncrypted:CreateTapes' :: CreateTapes -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"KMSEncrypted" 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 Bool
kmsEncrypted,
            (Key
"KMSKey" 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
kmsKey,
            (Key
"PoolId" 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
poolId,
            (Key
"Tags" 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 [Tag]
tags,
            (Key
"Worm" 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 Bool
worm,
            forall a. a -> Maybe a
Prelude.Just (Key
"GatewayARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
gatewayARN),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"TapeSizeInBytes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Integer
tapeSizeInBytes),
            forall a. a -> Maybe a
Prelude.Just (Key
"ClientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
clientToken),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"NumTapesToCreate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
numTapesToCreate),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"TapeBarcodePrefix" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
tapeBarcodePrefix)
          ]
      )

instance Data.ToPath CreateTapes where
  toPath :: CreateTapes -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | CreateTapeOutput
--
-- /See:/ 'newCreateTapesResponse' smart constructor.
data CreateTapesResponse = CreateTapesResponse'
  { -- | A list of unique Amazon Resource Names (ARNs) that represents the
    -- virtual tapes that were created.
    CreateTapesResponse -> Maybe [Text]
tapeARNs :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    CreateTapesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateTapesResponse -> CreateTapesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTapesResponse -> CreateTapesResponse -> Bool
$c/= :: CreateTapesResponse -> CreateTapesResponse -> Bool
== :: CreateTapesResponse -> CreateTapesResponse -> Bool
$c== :: CreateTapesResponse -> CreateTapesResponse -> Bool
Prelude.Eq, ReadPrec [CreateTapesResponse]
ReadPrec CreateTapesResponse
Int -> ReadS CreateTapesResponse
ReadS [CreateTapesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTapesResponse]
$creadListPrec :: ReadPrec [CreateTapesResponse]
readPrec :: ReadPrec CreateTapesResponse
$creadPrec :: ReadPrec CreateTapesResponse
readList :: ReadS [CreateTapesResponse]
$creadList :: ReadS [CreateTapesResponse]
readsPrec :: Int -> ReadS CreateTapesResponse
$creadsPrec :: Int -> ReadS CreateTapesResponse
Prelude.Read, Int -> CreateTapesResponse -> ShowS
[CreateTapesResponse] -> ShowS
CreateTapesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTapesResponse] -> ShowS
$cshowList :: [CreateTapesResponse] -> ShowS
show :: CreateTapesResponse -> String
$cshow :: CreateTapesResponse -> String
showsPrec :: Int -> CreateTapesResponse -> ShowS
$cshowsPrec :: Int -> CreateTapesResponse -> ShowS
Prelude.Show, forall x. Rep CreateTapesResponse x -> CreateTapesResponse
forall x. CreateTapesResponse -> Rep CreateTapesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateTapesResponse x -> CreateTapesResponse
$cfrom :: forall x. CreateTapesResponse -> Rep CreateTapesResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateTapesResponse' 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:
--
-- 'tapeARNs', 'createTapesResponse_tapeARNs' - A list of unique Amazon Resource Names (ARNs) that represents the
-- virtual tapes that were created.
--
-- 'httpStatus', 'createTapesResponse_httpStatus' - The response's http status code.
newCreateTapesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateTapesResponse
newCreateTapesResponse :: Int -> CreateTapesResponse
newCreateTapesResponse Int
pHttpStatus_ =
  CreateTapesResponse'
    { $sel:tapeARNs:CreateTapesResponse' :: Maybe [Text]
tapeARNs = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateTapesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of unique Amazon Resource Names (ARNs) that represents the
-- virtual tapes that were created.
createTapesResponse_tapeARNs :: Lens.Lens' CreateTapesResponse (Prelude.Maybe [Prelude.Text])
createTapesResponse_tapeARNs :: Lens' CreateTapesResponse (Maybe [Text])
createTapesResponse_tapeARNs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTapesResponse' {Maybe [Text]
tapeARNs :: Maybe [Text]
$sel:tapeARNs:CreateTapesResponse' :: CreateTapesResponse -> Maybe [Text]
tapeARNs} -> Maybe [Text]
tapeARNs) (\s :: CreateTapesResponse
s@CreateTapesResponse' {} Maybe [Text]
a -> CreateTapesResponse
s {$sel:tapeARNs:CreateTapesResponse' :: Maybe [Text]
tapeARNs = Maybe [Text]
a} :: CreateTapesResponse) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData CreateTapesResponse where
  rnf :: CreateTapesResponse -> ()
rnf CreateTapesResponse' {Int
Maybe [Text]
httpStatus :: Int
tapeARNs :: Maybe [Text]
$sel:httpStatus:CreateTapesResponse' :: CreateTapesResponse -> Int
$sel:tapeARNs:CreateTapesResponse' :: CreateTapesResponse -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
tapeARNs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus