{-# 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.AccessAnalyzer.Types.EbsSnapshotConfiguration 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
data EbsSnapshotConfiguration = EbsSnapshotConfiguration'
{
EbsSnapshotConfiguration -> Maybe [Text]
groups :: Prelude.Maybe [Prelude.Text],
EbsSnapshotConfiguration -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
EbsSnapshotConfiguration -> Maybe [Text]
userIds :: Prelude.Maybe [Prelude.Text]
}
deriving (EbsSnapshotConfiguration -> EbsSnapshotConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EbsSnapshotConfiguration -> EbsSnapshotConfiguration -> Bool
$c/= :: EbsSnapshotConfiguration -> EbsSnapshotConfiguration -> Bool
== :: EbsSnapshotConfiguration -> EbsSnapshotConfiguration -> Bool
$c== :: EbsSnapshotConfiguration -> EbsSnapshotConfiguration -> Bool
Prelude.Eq, ReadPrec [EbsSnapshotConfiguration]
ReadPrec EbsSnapshotConfiguration
Int -> ReadS EbsSnapshotConfiguration
ReadS [EbsSnapshotConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EbsSnapshotConfiguration]
$creadListPrec :: ReadPrec [EbsSnapshotConfiguration]
readPrec :: ReadPrec EbsSnapshotConfiguration
$creadPrec :: ReadPrec EbsSnapshotConfiguration
readList :: ReadS [EbsSnapshotConfiguration]
$creadList :: ReadS [EbsSnapshotConfiguration]
readsPrec :: Int -> ReadS EbsSnapshotConfiguration
$creadsPrec :: Int -> ReadS EbsSnapshotConfiguration
Prelude.Read, Int -> EbsSnapshotConfiguration -> ShowS
[EbsSnapshotConfiguration] -> ShowS
EbsSnapshotConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EbsSnapshotConfiguration] -> ShowS
$cshowList :: [EbsSnapshotConfiguration] -> ShowS
show :: EbsSnapshotConfiguration -> String
$cshow :: EbsSnapshotConfiguration -> String
showsPrec :: Int -> EbsSnapshotConfiguration -> ShowS
$cshowsPrec :: Int -> EbsSnapshotConfiguration -> ShowS
Prelude.Show, forall x.
Rep EbsSnapshotConfiguration x -> EbsSnapshotConfiguration
forall x.
EbsSnapshotConfiguration -> Rep EbsSnapshotConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EbsSnapshotConfiguration x -> EbsSnapshotConfiguration
$cfrom :: forall x.
EbsSnapshotConfiguration -> Rep EbsSnapshotConfiguration x
Prelude.Generic)
newEbsSnapshotConfiguration ::
EbsSnapshotConfiguration
newEbsSnapshotConfiguration :: EbsSnapshotConfiguration
newEbsSnapshotConfiguration =
EbsSnapshotConfiguration'
{ $sel:groups:EbsSnapshotConfiguration' :: Maybe [Text]
groups = forall a. Maybe a
Prelude.Nothing,
$sel:kmsKeyId:EbsSnapshotConfiguration' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
$sel:userIds:EbsSnapshotConfiguration' :: Maybe [Text]
userIds = forall a. Maybe a
Prelude.Nothing
}
ebsSnapshotConfiguration_groups :: Lens.Lens' EbsSnapshotConfiguration (Prelude.Maybe [Prelude.Text])
ebsSnapshotConfiguration_groups :: Lens' EbsSnapshotConfiguration (Maybe [Text])
ebsSnapshotConfiguration_groups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsSnapshotConfiguration' {Maybe [Text]
groups :: Maybe [Text]
$sel:groups:EbsSnapshotConfiguration' :: EbsSnapshotConfiguration -> Maybe [Text]
groups} -> Maybe [Text]
groups) (\s :: EbsSnapshotConfiguration
s@EbsSnapshotConfiguration' {} Maybe [Text]
a -> EbsSnapshotConfiguration
s {$sel:groups:EbsSnapshotConfiguration' :: Maybe [Text]
groups = Maybe [Text]
a} :: EbsSnapshotConfiguration) 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
ebsSnapshotConfiguration_kmsKeyId :: Lens.Lens' EbsSnapshotConfiguration (Prelude.Maybe Prelude.Text)
ebsSnapshotConfiguration_kmsKeyId :: Lens' EbsSnapshotConfiguration (Maybe Text)
ebsSnapshotConfiguration_kmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsSnapshotConfiguration' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:EbsSnapshotConfiguration' :: EbsSnapshotConfiguration -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: EbsSnapshotConfiguration
s@EbsSnapshotConfiguration' {} Maybe Text
a -> EbsSnapshotConfiguration
s {$sel:kmsKeyId:EbsSnapshotConfiguration' :: Maybe Text
kmsKeyId = Maybe Text
a} :: EbsSnapshotConfiguration)
ebsSnapshotConfiguration_userIds :: Lens.Lens' EbsSnapshotConfiguration (Prelude.Maybe [Prelude.Text])
ebsSnapshotConfiguration_userIds :: Lens' EbsSnapshotConfiguration (Maybe [Text])
ebsSnapshotConfiguration_userIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsSnapshotConfiguration' {Maybe [Text]
userIds :: Maybe [Text]
$sel:userIds:EbsSnapshotConfiguration' :: EbsSnapshotConfiguration -> Maybe [Text]
userIds} -> Maybe [Text]
userIds) (\s :: EbsSnapshotConfiguration
s@EbsSnapshotConfiguration' {} Maybe [Text]
a -> EbsSnapshotConfiguration
s {$sel:userIds:EbsSnapshotConfiguration' :: Maybe [Text]
userIds = Maybe [Text]
a} :: EbsSnapshotConfiguration) 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
instance Data.FromJSON EbsSnapshotConfiguration where
parseJSON :: Value -> Parser EbsSnapshotConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EbsSnapshotConfiguration"
( \Object
x ->
Maybe [Text]
-> Maybe Text -> Maybe [Text] -> EbsSnapshotConfiguration
EbsSnapshotConfiguration'
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
"groups" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"kmsKeyId")
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
"userIds" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable EbsSnapshotConfiguration where
hashWithSalt :: Int -> EbsSnapshotConfiguration -> Int
hashWithSalt Int
_salt EbsSnapshotConfiguration' {Maybe [Text]
Maybe Text
userIds :: Maybe [Text]
kmsKeyId :: Maybe Text
groups :: Maybe [Text]
$sel:userIds:EbsSnapshotConfiguration' :: EbsSnapshotConfiguration -> Maybe [Text]
$sel:kmsKeyId:EbsSnapshotConfiguration' :: EbsSnapshotConfiguration -> Maybe Text
$sel:groups:EbsSnapshotConfiguration' :: EbsSnapshotConfiguration -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
groups
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
userIds
instance Prelude.NFData EbsSnapshotConfiguration where
rnf :: EbsSnapshotConfiguration -> ()
rnf EbsSnapshotConfiguration' {Maybe [Text]
Maybe Text
userIds :: Maybe [Text]
kmsKeyId :: Maybe Text
groups :: Maybe [Text]
$sel:userIds:EbsSnapshotConfiguration' :: EbsSnapshotConfiguration -> Maybe [Text]
$sel:kmsKeyId:EbsSnapshotConfiguration' :: EbsSnapshotConfiguration -> Maybe Text
$sel:groups:EbsSnapshotConfiguration' :: EbsSnapshotConfiguration -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
groups
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
userIds
instance Data.ToJSON EbsSnapshotConfiguration where
toJSON :: EbsSnapshotConfiguration -> Value
toJSON EbsSnapshotConfiguration' {Maybe [Text]
Maybe Text
userIds :: Maybe [Text]
kmsKeyId :: Maybe Text
groups :: Maybe [Text]
$sel:userIds:EbsSnapshotConfiguration' :: EbsSnapshotConfiguration -> Maybe [Text]
$sel:kmsKeyId:EbsSnapshotConfiguration' :: EbsSnapshotConfiguration -> Maybe Text
$sel:groups:EbsSnapshotConfiguration' :: EbsSnapshotConfiguration -> Maybe [Text]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"groups" 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]
groups,
(Key
"kmsKeyId" 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
kmsKeyId,
(Key
"userIds" 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]
userIds
]
)