{-# 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 #-}
module Amazonka.StorageGateway.Types.AutomaticTapeCreationPolicyInfo 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.AutomaticTapeCreationRule
data AutomaticTapeCreationPolicyInfo = AutomaticTapeCreationPolicyInfo'
{
AutomaticTapeCreationPolicyInfo
-> Maybe (NonEmpty AutomaticTapeCreationRule)
automaticTapeCreationRules :: Prelude.Maybe (Prelude.NonEmpty AutomaticTapeCreationRule),
AutomaticTapeCreationPolicyInfo -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text
}
deriving (AutomaticTapeCreationPolicyInfo
-> AutomaticTapeCreationPolicyInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutomaticTapeCreationPolicyInfo
-> AutomaticTapeCreationPolicyInfo -> Bool
$c/= :: AutomaticTapeCreationPolicyInfo
-> AutomaticTapeCreationPolicyInfo -> Bool
== :: AutomaticTapeCreationPolicyInfo
-> AutomaticTapeCreationPolicyInfo -> Bool
$c== :: AutomaticTapeCreationPolicyInfo
-> AutomaticTapeCreationPolicyInfo -> Bool
Prelude.Eq, ReadPrec [AutomaticTapeCreationPolicyInfo]
ReadPrec AutomaticTapeCreationPolicyInfo
Int -> ReadS AutomaticTapeCreationPolicyInfo
ReadS [AutomaticTapeCreationPolicyInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutomaticTapeCreationPolicyInfo]
$creadListPrec :: ReadPrec [AutomaticTapeCreationPolicyInfo]
readPrec :: ReadPrec AutomaticTapeCreationPolicyInfo
$creadPrec :: ReadPrec AutomaticTapeCreationPolicyInfo
readList :: ReadS [AutomaticTapeCreationPolicyInfo]
$creadList :: ReadS [AutomaticTapeCreationPolicyInfo]
readsPrec :: Int -> ReadS AutomaticTapeCreationPolicyInfo
$creadsPrec :: Int -> ReadS AutomaticTapeCreationPolicyInfo
Prelude.Read, Int -> AutomaticTapeCreationPolicyInfo -> ShowS
[AutomaticTapeCreationPolicyInfo] -> ShowS
AutomaticTapeCreationPolicyInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutomaticTapeCreationPolicyInfo] -> ShowS
$cshowList :: [AutomaticTapeCreationPolicyInfo] -> ShowS
show :: AutomaticTapeCreationPolicyInfo -> String
$cshow :: AutomaticTapeCreationPolicyInfo -> String
showsPrec :: Int -> AutomaticTapeCreationPolicyInfo -> ShowS
$cshowsPrec :: Int -> AutomaticTapeCreationPolicyInfo -> ShowS
Prelude.Show, forall x.
Rep AutomaticTapeCreationPolicyInfo x
-> AutomaticTapeCreationPolicyInfo
forall x.
AutomaticTapeCreationPolicyInfo
-> Rep AutomaticTapeCreationPolicyInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AutomaticTapeCreationPolicyInfo x
-> AutomaticTapeCreationPolicyInfo
$cfrom :: forall x.
AutomaticTapeCreationPolicyInfo
-> Rep AutomaticTapeCreationPolicyInfo x
Prelude.Generic)
newAutomaticTapeCreationPolicyInfo ::
AutomaticTapeCreationPolicyInfo
newAutomaticTapeCreationPolicyInfo :: AutomaticTapeCreationPolicyInfo
newAutomaticTapeCreationPolicyInfo =
AutomaticTapeCreationPolicyInfo'
{ $sel:automaticTapeCreationRules:AutomaticTapeCreationPolicyInfo' :: Maybe (NonEmpty AutomaticTapeCreationRule)
automaticTapeCreationRules =
forall a. Maybe a
Prelude.Nothing,
$sel:gatewayARN:AutomaticTapeCreationPolicyInfo' :: Maybe Text
gatewayARN = forall a. Maybe a
Prelude.Nothing
}
automaticTapeCreationPolicyInfo_automaticTapeCreationRules :: Lens.Lens' AutomaticTapeCreationPolicyInfo (Prelude.Maybe (Prelude.NonEmpty AutomaticTapeCreationRule))
automaticTapeCreationPolicyInfo_automaticTapeCreationRules :: Lens'
AutomaticTapeCreationPolicyInfo
(Maybe (NonEmpty AutomaticTapeCreationRule))
automaticTapeCreationPolicyInfo_automaticTapeCreationRules = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutomaticTapeCreationPolicyInfo' {Maybe (NonEmpty AutomaticTapeCreationRule)
automaticTapeCreationRules :: Maybe (NonEmpty AutomaticTapeCreationRule)
$sel:automaticTapeCreationRules:AutomaticTapeCreationPolicyInfo' :: AutomaticTapeCreationPolicyInfo
-> Maybe (NonEmpty AutomaticTapeCreationRule)
automaticTapeCreationRules} -> Maybe (NonEmpty AutomaticTapeCreationRule)
automaticTapeCreationRules) (\s :: AutomaticTapeCreationPolicyInfo
s@AutomaticTapeCreationPolicyInfo' {} Maybe (NonEmpty AutomaticTapeCreationRule)
a -> AutomaticTapeCreationPolicyInfo
s {$sel:automaticTapeCreationRules:AutomaticTapeCreationPolicyInfo' :: Maybe (NonEmpty AutomaticTapeCreationRule)
automaticTapeCreationRules = Maybe (NonEmpty AutomaticTapeCreationRule)
a} :: AutomaticTapeCreationPolicyInfo) 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
automaticTapeCreationPolicyInfo_gatewayARN :: Lens.Lens' AutomaticTapeCreationPolicyInfo (Prelude.Maybe Prelude.Text)
automaticTapeCreationPolicyInfo_gatewayARN :: Lens' AutomaticTapeCreationPolicyInfo (Maybe Text)
automaticTapeCreationPolicyInfo_gatewayARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutomaticTapeCreationPolicyInfo' {Maybe Text
gatewayARN :: Maybe Text
$sel:gatewayARN:AutomaticTapeCreationPolicyInfo' :: AutomaticTapeCreationPolicyInfo -> Maybe Text
gatewayARN} -> Maybe Text
gatewayARN) (\s :: AutomaticTapeCreationPolicyInfo
s@AutomaticTapeCreationPolicyInfo' {} Maybe Text
a -> AutomaticTapeCreationPolicyInfo
s {$sel:gatewayARN:AutomaticTapeCreationPolicyInfo' :: Maybe Text
gatewayARN = Maybe Text
a} :: AutomaticTapeCreationPolicyInfo)
instance
Data.FromJSON
AutomaticTapeCreationPolicyInfo
where
parseJSON :: Value -> Parser AutomaticTapeCreationPolicyInfo
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AutomaticTapeCreationPolicyInfo"
( \Object
x ->
Maybe (NonEmpty AutomaticTapeCreationRule)
-> Maybe Text -> AutomaticTapeCreationPolicyInfo
AutomaticTapeCreationPolicyInfo'
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
"AutomaticTapeCreationRules")
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
"GatewayARN")
)
instance
Prelude.Hashable
AutomaticTapeCreationPolicyInfo
where
hashWithSalt :: Int -> AutomaticTapeCreationPolicyInfo -> Int
hashWithSalt
Int
_salt
AutomaticTapeCreationPolicyInfo' {Maybe (NonEmpty AutomaticTapeCreationRule)
Maybe Text
gatewayARN :: Maybe Text
automaticTapeCreationRules :: Maybe (NonEmpty AutomaticTapeCreationRule)
$sel:gatewayARN:AutomaticTapeCreationPolicyInfo' :: AutomaticTapeCreationPolicyInfo -> Maybe Text
$sel:automaticTapeCreationRules:AutomaticTapeCreationPolicyInfo' :: AutomaticTapeCreationPolicyInfo
-> Maybe (NonEmpty AutomaticTapeCreationRule)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty AutomaticTapeCreationRule)
automaticTapeCreationRules
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gatewayARN
instance
Prelude.NFData
AutomaticTapeCreationPolicyInfo
where
rnf :: AutomaticTapeCreationPolicyInfo -> ()
rnf AutomaticTapeCreationPolicyInfo' {Maybe (NonEmpty AutomaticTapeCreationRule)
Maybe Text
gatewayARN :: Maybe Text
automaticTapeCreationRules :: Maybe (NonEmpty AutomaticTapeCreationRule)
$sel:gatewayARN:AutomaticTapeCreationPolicyInfo' :: AutomaticTapeCreationPolicyInfo -> Maybe Text
$sel:automaticTapeCreationRules:AutomaticTapeCreationPolicyInfo' :: AutomaticTapeCreationPolicyInfo
-> Maybe (NonEmpty AutomaticTapeCreationRule)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty AutomaticTapeCreationRule)
automaticTapeCreationRules
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gatewayARN