{-# 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.SecurityHub.Types.AwsEc2SecurityGroupIpRange where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AwsEc2SecurityGroupIpRange = AwsEc2SecurityGroupIpRange'
{
AwsEc2SecurityGroupIpRange -> Maybe Text
cidrIp :: Prelude.Maybe Prelude.Text
}
deriving (AwsEc2SecurityGroupIpRange -> AwsEc2SecurityGroupIpRange -> Bool
(AwsEc2SecurityGroupIpRange -> AwsEc2SecurityGroupIpRange -> Bool)
-> (AwsEc2SecurityGroupIpRange
-> AwsEc2SecurityGroupIpRange -> Bool)
-> Eq AwsEc2SecurityGroupIpRange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEc2SecurityGroupIpRange -> AwsEc2SecurityGroupIpRange -> Bool
$c/= :: AwsEc2SecurityGroupIpRange -> AwsEc2SecurityGroupIpRange -> Bool
== :: AwsEc2SecurityGroupIpRange -> AwsEc2SecurityGroupIpRange -> Bool
$c== :: AwsEc2SecurityGroupIpRange -> AwsEc2SecurityGroupIpRange -> Bool
Prelude.Eq, ReadPrec [AwsEc2SecurityGroupIpRange]
ReadPrec AwsEc2SecurityGroupIpRange
Int -> ReadS AwsEc2SecurityGroupIpRange
ReadS [AwsEc2SecurityGroupIpRange]
(Int -> ReadS AwsEc2SecurityGroupIpRange)
-> ReadS [AwsEc2SecurityGroupIpRange]
-> ReadPrec AwsEc2SecurityGroupIpRange
-> ReadPrec [AwsEc2SecurityGroupIpRange]
-> Read AwsEc2SecurityGroupIpRange
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsEc2SecurityGroupIpRange]
$creadListPrec :: ReadPrec [AwsEc2SecurityGroupIpRange]
readPrec :: ReadPrec AwsEc2SecurityGroupIpRange
$creadPrec :: ReadPrec AwsEc2SecurityGroupIpRange
readList :: ReadS [AwsEc2SecurityGroupIpRange]
$creadList :: ReadS [AwsEc2SecurityGroupIpRange]
readsPrec :: Int -> ReadS AwsEc2SecurityGroupIpRange
$creadsPrec :: Int -> ReadS AwsEc2SecurityGroupIpRange
Prelude.Read, Int -> AwsEc2SecurityGroupIpRange -> ShowS
[AwsEc2SecurityGroupIpRange] -> ShowS
AwsEc2SecurityGroupIpRange -> String
(Int -> AwsEc2SecurityGroupIpRange -> ShowS)
-> (AwsEc2SecurityGroupIpRange -> String)
-> ([AwsEc2SecurityGroupIpRange] -> ShowS)
-> Show AwsEc2SecurityGroupIpRange
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEc2SecurityGroupIpRange] -> ShowS
$cshowList :: [AwsEc2SecurityGroupIpRange] -> ShowS
show :: AwsEc2SecurityGroupIpRange -> String
$cshow :: AwsEc2SecurityGroupIpRange -> String
showsPrec :: Int -> AwsEc2SecurityGroupIpRange -> ShowS
$cshowsPrec :: Int -> AwsEc2SecurityGroupIpRange -> ShowS
Prelude.Show, (forall x.
AwsEc2SecurityGroupIpRange -> Rep AwsEc2SecurityGroupIpRange x)
-> (forall x.
Rep AwsEc2SecurityGroupIpRange x -> AwsEc2SecurityGroupIpRange)
-> Generic AwsEc2SecurityGroupIpRange
forall x.
Rep AwsEc2SecurityGroupIpRange x -> AwsEc2SecurityGroupIpRange
forall x.
AwsEc2SecurityGroupIpRange -> Rep AwsEc2SecurityGroupIpRange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsEc2SecurityGroupIpRange x -> AwsEc2SecurityGroupIpRange
$cfrom :: forall x.
AwsEc2SecurityGroupIpRange -> Rep AwsEc2SecurityGroupIpRange x
Prelude.Generic)
newAwsEc2SecurityGroupIpRange ::
AwsEc2SecurityGroupIpRange
newAwsEc2SecurityGroupIpRange :: AwsEc2SecurityGroupIpRange
newAwsEc2SecurityGroupIpRange =
AwsEc2SecurityGroupIpRange' :: Maybe Text -> AwsEc2SecurityGroupIpRange
AwsEc2SecurityGroupIpRange'
{ $sel:cidrIp:AwsEc2SecurityGroupIpRange' :: Maybe Text
cidrIp =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
awsEc2SecurityGroupIpRange_cidrIp :: Lens.Lens' AwsEc2SecurityGroupIpRange (Prelude.Maybe Prelude.Text)
awsEc2SecurityGroupIpRange_cidrIp :: (Maybe Text -> f (Maybe Text))
-> AwsEc2SecurityGroupIpRange -> f AwsEc2SecurityGroupIpRange
awsEc2SecurityGroupIpRange_cidrIp = (AwsEc2SecurityGroupIpRange -> Maybe Text)
-> (AwsEc2SecurityGroupIpRange
-> Maybe Text -> AwsEc2SecurityGroupIpRange)
-> Lens
AwsEc2SecurityGroupIpRange
AwsEc2SecurityGroupIpRange
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2SecurityGroupIpRange' {Maybe Text
cidrIp :: Maybe Text
$sel:cidrIp:AwsEc2SecurityGroupIpRange' :: AwsEc2SecurityGroupIpRange -> Maybe Text
cidrIp} -> Maybe Text
cidrIp) (\s :: AwsEc2SecurityGroupIpRange
s@AwsEc2SecurityGroupIpRange' {} Maybe Text
a -> AwsEc2SecurityGroupIpRange
s {$sel:cidrIp:AwsEc2SecurityGroupIpRange' :: Maybe Text
cidrIp = Maybe Text
a} :: AwsEc2SecurityGroupIpRange)
instance Core.FromJSON AwsEc2SecurityGroupIpRange where
parseJSON :: Value -> Parser AwsEc2SecurityGroupIpRange
parseJSON =
String
-> (Object -> Parser AwsEc2SecurityGroupIpRange)
-> Value
-> Parser AwsEc2SecurityGroupIpRange
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsEc2SecurityGroupIpRange"
( \Object
x ->
Maybe Text -> AwsEc2SecurityGroupIpRange
AwsEc2SecurityGroupIpRange'
(Maybe Text -> AwsEc2SecurityGroupIpRange)
-> Parser (Maybe Text) -> Parser AwsEc2SecurityGroupIpRange
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
"CidrIp")
)
instance Prelude.Hashable AwsEc2SecurityGroupIpRange
instance Prelude.NFData AwsEc2SecurityGroupIpRange
instance Core.ToJSON AwsEc2SecurityGroupIpRange where
toJSON :: AwsEc2SecurityGroupIpRange -> Value
toJSON AwsEc2SecurityGroupIpRange' {Maybe Text
cidrIp :: Maybe Text
$sel:cidrIp:AwsEc2SecurityGroupIpRange' :: AwsEc2SecurityGroupIpRange -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"CidrIp" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
cidrIp]
)