{-# 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.MediaLive.Types.InputSecurityGroup where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.InputSecurityGroupState
import Amazonka.MediaLive.Types.InputWhitelistRule
import qualified Amazonka.Prelude as Prelude
data InputSecurityGroup = InputSecurityGroup'
{
InputSecurityGroup -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
InputSecurityGroup -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
InputSecurityGroup -> Maybe [Text]
inputs :: Prelude.Maybe [Prelude.Text],
InputSecurityGroup -> Maybe InputSecurityGroupState
state :: Prelude.Maybe InputSecurityGroupState,
InputSecurityGroup -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
InputSecurityGroup -> Maybe [InputWhitelistRule]
whitelistRules :: Prelude.Maybe [InputWhitelistRule]
}
deriving (InputSecurityGroup -> InputSecurityGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputSecurityGroup -> InputSecurityGroup -> Bool
$c/= :: InputSecurityGroup -> InputSecurityGroup -> Bool
== :: InputSecurityGroup -> InputSecurityGroup -> Bool
$c== :: InputSecurityGroup -> InputSecurityGroup -> Bool
Prelude.Eq, ReadPrec [InputSecurityGroup]
ReadPrec InputSecurityGroup
Int -> ReadS InputSecurityGroup
ReadS [InputSecurityGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputSecurityGroup]
$creadListPrec :: ReadPrec [InputSecurityGroup]
readPrec :: ReadPrec InputSecurityGroup
$creadPrec :: ReadPrec InputSecurityGroup
readList :: ReadS [InputSecurityGroup]
$creadList :: ReadS [InputSecurityGroup]
readsPrec :: Int -> ReadS InputSecurityGroup
$creadsPrec :: Int -> ReadS InputSecurityGroup
Prelude.Read, Int -> InputSecurityGroup -> ShowS
[InputSecurityGroup] -> ShowS
InputSecurityGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputSecurityGroup] -> ShowS
$cshowList :: [InputSecurityGroup] -> ShowS
show :: InputSecurityGroup -> String
$cshow :: InputSecurityGroup -> String
showsPrec :: Int -> InputSecurityGroup -> ShowS
$cshowsPrec :: Int -> InputSecurityGroup -> ShowS
Prelude.Show, forall x. Rep InputSecurityGroup x -> InputSecurityGroup
forall x. InputSecurityGroup -> Rep InputSecurityGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputSecurityGroup x -> InputSecurityGroup
$cfrom :: forall x. InputSecurityGroup -> Rep InputSecurityGroup x
Prelude.Generic)
newInputSecurityGroup ::
InputSecurityGroup
newInputSecurityGroup :: InputSecurityGroup
newInputSecurityGroup =
InputSecurityGroup'
{ $sel:arn:InputSecurityGroup' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:id:InputSecurityGroup' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
$sel:inputs:InputSecurityGroup' :: Maybe [Text]
inputs = forall a. Maybe a
Prelude.Nothing,
$sel:state:InputSecurityGroup' :: Maybe InputSecurityGroupState
state = forall a. Maybe a
Prelude.Nothing,
$sel:tags:InputSecurityGroup' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:whitelistRules:InputSecurityGroup' :: Maybe [InputWhitelistRule]
whitelistRules = forall a. Maybe a
Prelude.Nothing
}
inputSecurityGroup_arn :: Lens.Lens' InputSecurityGroup (Prelude.Maybe Prelude.Text)
inputSecurityGroup_arn :: Lens' InputSecurityGroup (Maybe Text)
inputSecurityGroup_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSecurityGroup' {Maybe Text
arn :: Maybe Text
$sel:arn:InputSecurityGroup' :: InputSecurityGroup -> Maybe Text
arn} -> Maybe Text
arn) (\s :: InputSecurityGroup
s@InputSecurityGroup' {} Maybe Text
a -> InputSecurityGroup
s {$sel:arn:InputSecurityGroup' :: Maybe Text
arn = Maybe Text
a} :: InputSecurityGroup)
inputSecurityGroup_id :: Lens.Lens' InputSecurityGroup (Prelude.Maybe Prelude.Text)
inputSecurityGroup_id :: Lens' InputSecurityGroup (Maybe Text)
inputSecurityGroup_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSecurityGroup' {Maybe Text
id :: Maybe Text
$sel:id:InputSecurityGroup' :: InputSecurityGroup -> Maybe Text
id} -> Maybe Text
id) (\s :: InputSecurityGroup
s@InputSecurityGroup' {} Maybe Text
a -> InputSecurityGroup
s {$sel:id:InputSecurityGroup' :: Maybe Text
id = Maybe Text
a} :: InputSecurityGroup)
inputSecurityGroup_inputs :: Lens.Lens' InputSecurityGroup (Prelude.Maybe [Prelude.Text])
inputSecurityGroup_inputs :: Lens' InputSecurityGroup (Maybe [Text])
inputSecurityGroup_inputs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSecurityGroup' {Maybe [Text]
inputs :: Maybe [Text]
$sel:inputs:InputSecurityGroup' :: InputSecurityGroup -> Maybe [Text]
inputs} -> Maybe [Text]
inputs) (\s :: InputSecurityGroup
s@InputSecurityGroup' {} Maybe [Text]
a -> InputSecurityGroup
s {$sel:inputs:InputSecurityGroup' :: Maybe [Text]
inputs = Maybe [Text]
a} :: InputSecurityGroup) 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
inputSecurityGroup_state :: Lens.Lens' InputSecurityGroup (Prelude.Maybe InputSecurityGroupState)
inputSecurityGroup_state :: Lens' InputSecurityGroup (Maybe InputSecurityGroupState)
inputSecurityGroup_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSecurityGroup' {Maybe InputSecurityGroupState
state :: Maybe InputSecurityGroupState
$sel:state:InputSecurityGroup' :: InputSecurityGroup -> Maybe InputSecurityGroupState
state} -> Maybe InputSecurityGroupState
state) (\s :: InputSecurityGroup
s@InputSecurityGroup' {} Maybe InputSecurityGroupState
a -> InputSecurityGroup
s {$sel:state:InputSecurityGroup' :: Maybe InputSecurityGroupState
state = Maybe InputSecurityGroupState
a} :: InputSecurityGroup)
inputSecurityGroup_tags :: Lens.Lens' InputSecurityGroup (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
inputSecurityGroup_tags :: Lens' InputSecurityGroup (Maybe (HashMap Text Text))
inputSecurityGroup_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSecurityGroup' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:InputSecurityGroup' :: InputSecurityGroup -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: InputSecurityGroup
s@InputSecurityGroup' {} Maybe (HashMap Text Text)
a -> InputSecurityGroup
s {$sel:tags:InputSecurityGroup' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: InputSecurityGroup) 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
inputSecurityGroup_whitelistRules :: Lens.Lens' InputSecurityGroup (Prelude.Maybe [InputWhitelistRule])
inputSecurityGroup_whitelistRules :: Lens' InputSecurityGroup (Maybe [InputWhitelistRule])
inputSecurityGroup_whitelistRules = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSecurityGroup' {Maybe [InputWhitelistRule]
whitelistRules :: Maybe [InputWhitelistRule]
$sel:whitelistRules:InputSecurityGroup' :: InputSecurityGroup -> Maybe [InputWhitelistRule]
whitelistRules} -> Maybe [InputWhitelistRule]
whitelistRules) (\s :: InputSecurityGroup
s@InputSecurityGroup' {} Maybe [InputWhitelistRule]
a -> InputSecurityGroup
s {$sel:whitelistRules:InputSecurityGroup' :: Maybe [InputWhitelistRule]
whitelistRules = Maybe [InputWhitelistRule]
a} :: InputSecurityGroup) 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 InputSecurityGroup where
parseJSON :: Value -> Parser InputSecurityGroup
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"InputSecurityGroup"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe InputSecurityGroupState
-> Maybe (HashMap Text Text)
-> Maybe [InputWhitelistRule]
-> InputSecurityGroup
InputSecurityGroup'
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
"arn")
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
"id")
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
"inputs" 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
"state")
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
"tags" 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
"whitelistRules"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable InputSecurityGroup where
hashWithSalt :: Int -> InputSecurityGroup -> Int
hashWithSalt Int
_salt InputSecurityGroup' {Maybe [Text]
Maybe [InputWhitelistRule]
Maybe Text
Maybe (HashMap Text Text)
Maybe InputSecurityGroupState
whitelistRules :: Maybe [InputWhitelistRule]
tags :: Maybe (HashMap Text Text)
state :: Maybe InputSecurityGroupState
inputs :: Maybe [Text]
id :: Maybe Text
arn :: Maybe Text
$sel:whitelistRules:InputSecurityGroup' :: InputSecurityGroup -> Maybe [InputWhitelistRule]
$sel:tags:InputSecurityGroup' :: InputSecurityGroup -> Maybe (HashMap Text Text)
$sel:state:InputSecurityGroup' :: InputSecurityGroup -> Maybe InputSecurityGroupState
$sel:inputs:InputSecurityGroup' :: InputSecurityGroup -> Maybe [Text]
$sel:id:InputSecurityGroup' :: InputSecurityGroup -> Maybe Text
$sel:arn:InputSecurityGroup' :: InputSecurityGroup -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
inputs
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InputSecurityGroupState
state
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [InputWhitelistRule]
whitelistRules
instance Prelude.NFData InputSecurityGroup where
rnf :: InputSecurityGroup -> ()
rnf InputSecurityGroup' {Maybe [Text]
Maybe [InputWhitelistRule]
Maybe Text
Maybe (HashMap Text Text)
Maybe InputSecurityGroupState
whitelistRules :: Maybe [InputWhitelistRule]
tags :: Maybe (HashMap Text Text)
state :: Maybe InputSecurityGroupState
inputs :: Maybe [Text]
id :: Maybe Text
arn :: Maybe Text
$sel:whitelistRules:InputSecurityGroup' :: InputSecurityGroup -> Maybe [InputWhitelistRule]
$sel:tags:InputSecurityGroup' :: InputSecurityGroup -> Maybe (HashMap Text Text)
$sel:state:InputSecurityGroup' :: InputSecurityGroup -> Maybe InputSecurityGroupState
$sel:inputs:InputSecurityGroup' :: InputSecurityGroup -> Maybe [Text]
$sel:id:InputSecurityGroup' :: InputSecurityGroup -> Maybe Text
$sel:arn:InputSecurityGroup' :: InputSecurityGroup -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
inputs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InputSecurityGroupState
state
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [InputWhitelistRule]
whitelistRules