{-# 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.GuardDuty.Types.SecurityGroup where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(SecurityGroup -> SecurityGroup -> Bool)
-> (SecurityGroup -> SecurityGroup -> Bool) -> Eq SecurityGroup
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]
(Int -> ReadS SecurityGroup)
-> ReadS [SecurityGroup]
-> ReadPrec SecurityGroup
-> ReadPrec [SecurityGroup]
-> Read 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
(Int -> SecurityGroup -> ShowS)
-> (SecurityGroup -> String)
-> ([SecurityGroup] -> ShowS)
-> Show SecurityGroup
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. SecurityGroup -> Rep SecurityGroup x)
-> (forall x. Rep SecurityGroup x -> SecurityGroup)
-> Generic SecurityGroup
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' :: Maybe Text -> Maybe Text -> SecurityGroup
SecurityGroup'
{ $sel:groupId:SecurityGroup' :: Maybe Text
groupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:groupName:SecurityGroup' :: Maybe Text
groupName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
securityGroup_groupId :: Lens.Lens' SecurityGroup (Prelude.Maybe Prelude.Text)
securityGroup_groupId :: (Maybe Text -> f (Maybe Text)) -> SecurityGroup -> f SecurityGroup
securityGroup_groupId = (SecurityGroup -> Maybe Text)
-> (SecurityGroup -> Maybe Text -> SecurityGroup)
-> Lens SecurityGroup SecurityGroup (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text)) -> SecurityGroup -> f SecurityGroup
securityGroup_groupName = (SecurityGroup -> Maybe Text)
-> (SecurityGroup -> Maybe Text -> SecurityGroup)
-> Lens SecurityGroup SecurityGroup (Maybe Text) (Maybe Text)
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 Core.FromJSON SecurityGroup where
parseJSON :: Value -> Parser SecurityGroup
parseJSON =
String
-> (Object -> Parser SecurityGroup)
-> Value
-> Parser SecurityGroup
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SecurityGroup"
( \Object
x ->
Maybe Text -> Maybe Text -> SecurityGroup
SecurityGroup'
(Maybe Text -> Maybe Text -> SecurityGroup)
-> Parser (Maybe Text) -> Parser (Maybe Text -> SecurityGroup)
forall (f :: * -> *) a b. Functor 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
"groupId")
Parser (Maybe Text -> SecurityGroup)
-> Parser (Maybe Text) -> Parser SecurityGroup
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
"groupName")
)
instance Prelude.Hashable SecurityGroup
instance Prelude.NFData SecurityGroup