{-# 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-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)
module Amazonka.StorageGateway.Types.PoolInfo where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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'
  { -- | 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,
    -- | 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,
    -- | The name of the custom tape pool. @PoolName@ can use all ASCII
    -- characters, except \'\/\' and \'\\\'.
    PoolInfo -> Maybe Text
poolName :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | Status of the custom tape pool. Pool can be @ACTIVE@ or @DELETED@.
    PoolInfo -> Maybe PoolStatus
poolStatus :: Prelude.Maybe PoolStatus,
    -- | 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
  }
  deriving (PoolInfo -> PoolInfo -> Bool
(PoolInfo -> PoolInfo -> Bool)
-> (PoolInfo -> PoolInfo -> Bool) -> Eq PoolInfo
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]
(Int -> ReadS PoolInfo)
-> ReadS [PoolInfo]
-> ReadPrec PoolInfo
-> ReadPrec [PoolInfo]
-> Read 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
(Int -> PoolInfo -> ShowS)
-> (PoolInfo -> String) -> ([PoolInfo] -> ShowS) -> Show PoolInfo
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. PoolInfo -> Rep PoolInfo x)
-> (forall x. Rep PoolInfo x -> PoolInfo) -> Generic PoolInfo
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:
--
-- '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.
--
-- '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).
--
-- 'poolName', 'poolInfo_poolName' - The name of the custom tape pool. @PoolName@ can use all ASCII
-- characters, except \'\/\' and \'\\\'.
--
-- '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.
--
-- 'poolStatus', 'poolInfo_poolStatus' - Status of the custom tape pool. Pool can be @ACTIVE@ or @DELETED@.
--
-- '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.
newPoolInfo ::
  PoolInfo
newPoolInfo :: PoolInfo
newPoolInfo =
  PoolInfo' :: Maybe RetentionLockType
-> Maybe Natural
-> Maybe Text
-> Maybe TapeStorageClass
-> Maybe PoolStatus
-> Maybe Text
-> PoolInfo
PoolInfo'
    { $sel:retentionLockType:PoolInfo' :: Maybe RetentionLockType
retentionLockType = Maybe RetentionLockType
forall a. Maybe a
Prelude.Nothing,
      $sel:retentionLockTimeInDays:PoolInfo' :: Maybe Natural
retentionLockTimeInDays = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:poolName:PoolInfo' :: Maybe Text
poolName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:storageClass:PoolInfo' :: Maybe TapeStorageClass
storageClass = Maybe TapeStorageClass
forall a. Maybe a
Prelude.Nothing,
      $sel:poolStatus:PoolInfo' :: Maybe PoolStatus
poolStatus = Maybe PoolStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:poolARN:PoolInfo' :: Maybe Text
poolARN = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe RetentionLockType -> f (Maybe RetentionLockType))
-> PoolInfo -> f PoolInfo
poolInfo_retentionLockType = (PoolInfo -> Maybe RetentionLockType)
-> (PoolInfo -> Maybe RetentionLockType -> PoolInfo)
-> Lens
     PoolInfo
     PoolInfo
     (Maybe RetentionLockType)
     (Maybe 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)

-- | 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 :: (Maybe Natural -> f (Maybe Natural)) -> PoolInfo -> f PoolInfo
poolInfo_retentionLockTimeInDays = (PoolInfo -> Maybe Natural)
-> (PoolInfo -> Maybe Natural -> PoolInfo)
-> Lens PoolInfo PoolInfo (Maybe Natural) (Maybe Natural)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> PoolInfo -> f PoolInfo
poolInfo_poolName = (PoolInfo -> Maybe Text)
-> (PoolInfo -> Maybe Text -> PoolInfo)
-> Lens PoolInfo PoolInfo (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe TapeStorageClass -> f (Maybe TapeStorageClass))
-> PoolInfo -> f PoolInfo
poolInfo_storageClass = (PoolInfo -> Maybe TapeStorageClass)
-> (PoolInfo -> Maybe TapeStorageClass -> PoolInfo)
-> Lens
     PoolInfo PoolInfo (Maybe TapeStorageClass) (Maybe TapeStorageClass)
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)

-- | Status of the custom tape pool. Pool can be @ACTIVE@ or @DELETED@.
poolInfo_poolStatus :: Lens.Lens' PoolInfo (Prelude.Maybe PoolStatus)
poolInfo_poolStatus :: (Maybe PoolStatus -> f (Maybe PoolStatus))
-> PoolInfo -> f PoolInfo
poolInfo_poolStatus = (PoolInfo -> Maybe PoolStatus)
-> (PoolInfo -> Maybe PoolStatus -> PoolInfo)
-> Lens PoolInfo PoolInfo (Maybe PoolStatus) (Maybe 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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> PoolInfo -> f PoolInfo
poolInfo_poolARN = (PoolInfo -> Maybe Text)
-> (PoolInfo -> Maybe Text -> PoolInfo)
-> Lens PoolInfo PoolInfo (Maybe Text) (Maybe Text)
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)

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

instance Prelude.Hashable PoolInfo

instance Prelude.NFData PoolInfo