{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.PoolInfo
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.StorageGateway.Types.PoolInfo 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 Amazonka.StorageGateway.Types.PoolStatus
import Amazonka.StorageGateway.Types.RetentionLockType
import Amazonka.StorageGateway.Types.TapeStorageClass

-- | Describes a custom tape pool.
--
-- /See:/ 'newPoolInfo' smart constructor.
data PoolInfo = PoolInfo'
  { -- | The Amazon Resource Name (ARN) of the custom tape pool. Use the
    -- ListTapePools operation to return a list of custom tape pools for your
    -- account and Amazon Web Services Region.
    PoolInfo -> Maybe Text
poolARN :: Prelude.Maybe Prelude.Text,
    -- | The name of the custom tape pool. @PoolName@ can use all ASCII
    -- characters, except \'\/\' and \'\\\'.
    PoolInfo -> Maybe Text
poolName :: Prelude.Maybe Prelude.Text,
    -- | Status of the custom tape pool. Pool can be @ACTIVE@ or @DELETED@.
    PoolInfo -> Maybe PoolStatus
poolStatus :: Prelude.Maybe PoolStatus,
    -- | Tape retention lock time is set in days. Tape retention lock can be
    -- enabled for up to 100 years (36,500 days).
    PoolInfo -> Maybe Natural
retentionLockTimeInDays :: Prelude.Maybe Prelude.Natural,
    -- | Tape retention lock type, which can be configured in two modes. When
    -- configured in governance mode, Amazon Web Services accounts with
    -- specific IAM permissions are authorized to remove the tape retention
    -- lock from archived virtual tapes. When configured in compliance mode,
    -- the tape retention lock cannot be removed by any user, including the
    -- root Amazon Web Services account.
    PoolInfo -> Maybe RetentionLockType
retentionLockType :: Prelude.Maybe RetentionLockType,
    -- | The storage class that is associated with the custom 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.
    PoolInfo -> Maybe TapeStorageClass
storageClass :: Prelude.Maybe TapeStorageClass
  }
  deriving (PoolInfo -> PoolInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PoolInfo -> PoolInfo -> Bool
$c/= :: PoolInfo -> PoolInfo -> Bool
== :: PoolInfo -> PoolInfo -> Bool
$c== :: PoolInfo -> PoolInfo -> Bool
Prelude.Eq, ReadPrec [PoolInfo]
ReadPrec PoolInfo
Int -> ReadS PoolInfo
ReadS [PoolInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PoolInfo]
$creadListPrec :: ReadPrec [PoolInfo]
readPrec :: ReadPrec PoolInfo
$creadPrec :: ReadPrec PoolInfo
readList :: ReadS [PoolInfo]
$creadList :: ReadS [PoolInfo]
readsPrec :: Int -> ReadS PoolInfo
$creadsPrec :: Int -> ReadS PoolInfo
Prelude.Read, Int -> PoolInfo -> ShowS
[PoolInfo] -> ShowS
PoolInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PoolInfo] -> ShowS
$cshowList :: [PoolInfo] -> ShowS
show :: PoolInfo -> String
$cshow :: PoolInfo -> String
showsPrec :: Int -> PoolInfo -> ShowS
$cshowsPrec :: Int -> PoolInfo -> ShowS
Prelude.Show, forall x. Rep PoolInfo x -> PoolInfo
forall x. PoolInfo -> Rep PoolInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PoolInfo x -> PoolInfo
$cfrom :: forall x. PoolInfo -> Rep PoolInfo x
Prelude.Generic)

-- |
-- Create a value of 'PoolInfo' 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:
--
-- 'poolARN', 'poolInfo_poolARN' - The Amazon Resource Name (ARN) of the custom tape pool. Use the
-- ListTapePools operation to return a list of custom tape pools for your
-- account and Amazon Web Services Region.
--
-- 'poolName', 'poolInfo_poolName' - The name of the custom tape pool. @PoolName@ can use all ASCII
-- characters, except \'\/\' and \'\\\'.
--
-- 'poolStatus', 'poolInfo_poolStatus' - Status of the custom tape pool. Pool can be @ACTIVE@ or @DELETED@.
--
-- 'retentionLockTimeInDays', 'poolInfo_retentionLockTimeInDays' - Tape retention lock time is set in days. Tape retention lock can be
-- enabled for up to 100 years (36,500 days).
--
-- 'retentionLockType', 'poolInfo_retentionLockType' - Tape retention lock type, which can be configured in two modes. When
-- configured in governance mode, Amazon Web Services accounts with
-- specific IAM permissions are authorized to remove the tape retention
-- lock from archived virtual tapes. When configured in compliance mode,
-- the tape retention lock cannot be removed by any user, including the
-- root Amazon Web Services account.
--
-- 'storageClass', 'poolInfo_storageClass' - The storage class that is associated with the custom 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.
newPoolInfo ::
  PoolInfo
newPoolInfo :: PoolInfo
newPoolInfo =
  PoolInfo'
    { $sel:poolARN:PoolInfo' :: Maybe Text
poolARN = forall a. Maybe a
Prelude.Nothing,
      $sel:poolName:PoolInfo' :: Maybe Text
poolName = forall a. Maybe a
Prelude.Nothing,
      $sel:poolStatus:PoolInfo' :: Maybe PoolStatus
poolStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:retentionLockTimeInDays:PoolInfo' :: Maybe Natural
retentionLockTimeInDays = forall a. Maybe a
Prelude.Nothing,
      $sel:retentionLockType:PoolInfo' :: Maybe RetentionLockType
retentionLockType = forall a. Maybe a
Prelude.Nothing,
      $sel:storageClass:PoolInfo' :: Maybe TapeStorageClass
storageClass = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the custom tape pool. Use the
-- ListTapePools operation to return a list of custom tape pools for your
-- account and Amazon Web Services Region.
poolInfo_poolARN :: Lens.Lens' PoolInfo (Prelude.Maybe Prelude.Text)
poolInfo_poolARN :: Lens' PoolInfo (Maybe Text)
poolInfo_poolARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PoolInfo' {Maybe Text
poolARN :: Maybe Text
$sel:poolARN:PoolInfo' :: PoolInfo -> Maybe Text
poolARN} -> Maybe Text
poolARN) (\s :: PoolInfo
s@PoolInfo' {} Maybe Text
a -> PoolInfo
s {$sel:poolARN:PoolInfo' :: Maybe Text
poolARN = Maybe Text
a} :: PoolInfo)

-- | The name of the custom tape pool. @PoolName@ can use all ASCII
-- characters, except \'\/\' and \'\\\'.
poolInfo_poolName :: Lens.Lens' PoolInfo (Prelude.Maybe Prelude.Text)
poolInfo_poolName :: Lens' PoolInfo (Maybe Text)
poolInfo_poolName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PoolInfo' {Maybe Text
poolName :: Maybe Text
$sel:poolName:PoolInfo' :: PoolInfo -> Maybe Text
poolName} -> Maybe Text
poolName) (\s :: PoolInfo
s@PoolInfo' {} Maybe Text
a -> PoolInfo
s {$sel:poolName:PoolInfo' :: Maybe Text
poolName = Maybe Text
a} :: PoolInfo)

-- | Status of the custom tape pool. Pool can be @ACTIVE@ or @DELETED@.
poolInfo_poolStatus :: Lens.Lens' PoolInfo (Prelude.Maybe PoolStatus)
poolInfo_poolStatus :: Lens' PoolInfo (Maybe PoolStatus)
poolInfo_poolStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PoolInfo' {Maybe PoolStatus
poolStatus :: Maybe PoolStatus
$sel:poolStatus:PoolInfo' :: PoolInfo -> Maybe PoolStatus
poolStatus} -> Maybe PoolStatus
poolStatus) (\s :: PoolInfo
s@PoolInfo' {} Maybe PoolStatus
a -> PoolInfo
s {$sel:poolStatus:PoolInfo' :: Maybe PoolStatus
poolStatus = Maybe PoolStatus
a} :: PoolInfo)

-- | Tape retention lock time is set in days. Tape retention lock can be
-- enabled for up to 100 years (36,500 days).
poolInfo_retentionLockTimeInDays :: Lens.Lens' PoolInfo (Prelude.Maybe Prelude.Natural)
poolInfo_retentionLockTimeInDays :: Lens' PoolInfo (Maybe Natural)
poolInfo_retentionLockTimeInDays = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PoolInfo' {Maybe Natural
retentionLockTimeInDays :: Maybe Natural
$sel:retentionLockTimeInDays:PoolInfo' :: PoolInfo -> Maybe Natural
retentionLockTimeInDays} -> Maybe Natural
retentionLockTimeInDays) (\s :: PoolInfo
s@PoolInfo' {} Maybe Natural
a -> PoolInfo
s {$sel:retentionLockTimeInDays:PoolInfo' :: Maybe Natural
retentionLockTimeInDays = Maybe Natural
a} :: PoolInfo)

-- | Tape retention lock type, which can be configured in two modes. When
-- configured in governance mode, Amazon Web Services accounts with
-- specific IAM permissions are authorized to remove the tape retention
-- lock from archived virtual tapes. When configured in compliance mode,
-- the tape retention lock cannot be removed by any user, including the
-- root Amazon Web Services account.
poolInfo_retentionLockType :: Lens.Lens' PoolInfo (Prelude.Maybe RetentionLockType)
poolInfo_retentionLockType :: Lens' PoolInfo (Maybe RetentionLockType)
poolInfo_retentionLockType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PoolInfo' {Maybe RetentionLockType
retentionLockType :: Maybe RetentionLockType
$sel:retentionLockType:PoolInfo' :: PoolInfo -> Maybe RetentionLockType
retentionLockType} -> Maybe RetentionLockType
retentionLockType) (\s :: PoolInfo
s@PoolInfo' {} Maybe RetentionLockType
a -> PoolInfo
s {$sel:retentionLockType:PoolInfo' :: Maybe RetentionLockType
retentionLockType = Maybe RetentionLockType
a} :: PoolInfo)

-- | The storage class that is associated with the custom 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.
poolInfo_storageClass :: Lens.Lens' PoolInfo (Prelude.Maybe TapeStorageClass)
poolInfo_storageClass :: Lens' PoolInfo (Maybe TapeStorageClass)
poolInfo_storageClass = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PoolInfo' {Maybe TapeStorageClass
storageClass :: Maybe TapeStorageClass
$sel:storageClass:PoolInfo' :: PoolInfo -> Maybe TapeStorageClass
storageClass} -> Maybe TapeStorageClass
storageClass) (\s :: PoolInfo
s@PoolInfo' {} Maybe TapeStorageClass
a -> PoolInfo
s {$sel:storageClass:PoolInfo' :: Maybe TapeStorageClass
storageClass = Maybe TapeStorageClass
a} :: PoolInfo)

instance Data.FromJSON PoolInfo where
  parseJSON :: Value -> Parser PoolInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PoolInfo"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe PoolStatus
-> Maybe Natural
-> Maybe RetentionLockType
-> Maybe TapeStorageClass
-> PoolInfo
PoolInfo'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PoolARN")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PoolName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PoolStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RetentionLockTimeInDays")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RetentionLockType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StorageClass")
      )

instance Prelude.Hashable PoolInfo where
  hashWithSalt :: Int -> PoolInfo -> Int
hashWithSalt Int
_salt PoolInfo' {Maybe Natural
Maybe Text
Maybe PoolStatus
Maybe RetentionLockType
Maybe TapeStorageClass
storageClass :: Maybe TapeStorageClass
retentionLockType :: Maybe RetentionLockType
retentionLockTimeInDays :: Maybe Natural
poolStatus :: Maybe PoolStatus
poolName :: Maybe Text
poolARN :: Maybe Text
$sel:storageClass:PoolInfo' :: PoolInfo -> Maybe TapeStorageClass
$sel:retentionLockType:PoolInfo' :: PoolInfo -> Maybe RetentionLockType
$sel:retentionLockTimeInDays:PoolInfo' :: PoolInfo -> Maybe Natural
$sel:poolStatus:PoolInfo' :: PoolInfo -> Maybe PoolStatus
$sel:poolName:PoolInfo' :: PoolInfo -> Maybe Text
$sel:poolARN:PoolInfo' :: PoolInfo -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
poolARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
poolName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PoolStatus
poolStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
retentionLockTimeInDays
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RetentionLockType
retentionLockType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TapeStorageClass
storageClass

instance Prelude.NFData PoolInfo where
  rnf :: PoolInfo -> ()
rnf PoolInfo' {Maybe Natural
Maybe Text
Maybe PoolStatus
Maybe RetentionLockType
Maybe TapeStorageClass
storageClass :: Maybe TapeStorageClass
retentionLockType :: Maybe RetentionLockType
retentionLockTimeInDays :: Maybe Natural
poolStatus :: Maybe PoolStatus
poolName :: Maybe Text
poolARN :: Maybe Text
$sel:storageClass:PoolInfo' :: PoolInfo -> Maybe TapeStorageClass
$sel:retentionLockType:PoolInfo' :: PoolInfo -> Maybe RetentionLockType
$sel:retentionLockTimeInDays:PoolInfo' :: PoolInfo -> Maybe Natural
$sel:poolStatus:PoolInfo' :: PoolInfo -> Maybe PoolStatus
$sel:poolName:PoolInfo' :: PoolInfo -> Maybe Text
$sel:poolARN:PoolInfo' :: PoolInfo -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
poolARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
poolName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PoolStatus
poolStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
retentionLockTimeInDays
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RetentionLockType
retentionLockType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TapeStorageClass
storageClass