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