{-# 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.Ipv6CidrBlockAssociation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Ipv6CidrBlockAssociation = Ipv6CidrBlockAssociation'
{
Ipv6CidrBlockAssociation -> Maybe Text
associationId :: Prelude.Maybe Prelude.Text,
Ipv6CidrBlockAssociation -> Maybe Text
ipv6CidrBlock :: Prelude.Maybe Prelude.Text,
Ipv6CidrBlockAssociation -> Maybe Text
cidrBlockState :: Prelude.Maybe Prelude.Text
}
deriving (Ipv6CidrBlockAssociation -> Ipv6CidrBlockAssociation -> Bool
(Ipv6CidrBlockAssociation -> Ipv6CidrBlockAssociation -> Bool)
-> (Ipv6CidrBlockAssociation -> Ipv6CidrBlockAssociation -> Bool)
-> Eq Ipv6CidrBlockAssociation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Ipv6CidrBlockAssociation -> Ipv6CidrBlockAssociation -> Bool
$c/= :: Ipv6CidrBlockAssociation -> Ipv6CidrBlockAssociation -> Bool
== :: Ipv6CidrBlockAssociation -> Ipv6CidrBlockAssociation -> Bool
$c== :: Ipv6CidrBlockAssociation -> Ipv6CidrBlockAssociation -> Bool
Prelude.Eq, ReadPrec [Ipv6CidrBlockAssociation]
ReadPrec Ipv6CidrBlockAssociation
Int -> ReadS Ipv6CidrBlockAssociation
ReadS [Ipv6CidrBlockAssociation]
(Int -> ReadS Ipv6CidrBlockAssociation)
-> ReadS [Ipv6CidrBlockAssociation]
-> ReadPrec Ipv6CidrBlockAssociation
-> ReadPrec [Ipv6CidrBlockAssociation]
-> Read Ipv6CidrBlockAssociation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Ipv6CidrBlockAssociation]
$creadListPrec :: ReadPrec [Ipv6CidrBlockAssociation]
readPrec :: ReadPrec Ipv6CidrBlockAssociation
$creadPrec :: ReadPrec Ipv6CidrBlockAssociation
readList :: ReadS [Ipv6CidrBlockAssociation]
$creadList :: ReadS [Ipv6CidrBlockAssociation]
readsPrec :: Int -> ReadS Ipv6CidrBlockAssociation
$creadsPrec :: Int -> ReadS Ipv6CidrBlockAssociation
Prelude.Read, Int -> Ipv6CidrBlockAssociation -> ShowS
[Ipv6CidrBlockAssociation] -> ShowS
Ipv6CidrBlockAssociation -> String
(Int -> Ipv6CidrBlockAssociation -> ShowS)
-> (Ipv6CidrBlockAssociation -> String)
-> ([Ipv6CidrBlockAssociation] -> ShowS)
-> Show Ipv6CidrBlockAssociation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Ipv6CidrBlockAssociation] -> ShowS
$cshowList :: [Ipv6CidrBlockAssociation] -> ShowS
show :: Ipv6CidrBlockAssociation -> String
$cshow :: Ipv6CidrBlockAssociation -> String
showsPrec :: Int -> Ipv6CidrBlockAssociation -> ShowS
$cshowsPrec :: Int -> Ipv6CidrBlockAssociation -> ShowS
Prelude.Show, (forall x.
Ipv6CidrBlockAssociation -> Rep Ipv6CidrBlockAssociation x)
-> (forall x.
Rep Ipv6CidrBlockAssociation x -> Ipv6CidrBlockAssociation)
-> Generic Ipv6CidrBlockAssociation
forall x.
Rep Ipv6CidrBlockAssociation x -> Ipv6CidrBlockAssociation
forall x.
Ipv6CidrBlockAssociation -> Rep Ipv6CidrBlockAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep Ipv6CidrBlockAssociation x -> Ipv6CidrBlockAssociation
$cfrom :: forall x.
Ipv6CidrBlockAssociation -> Rep Ipv6CidrBlockAssociation x
Prelude.Generic)
newIpv6CidrBlockAssociation ::
Ipv6CidrBlockAssociation
newIpv6CidrBlockAssociation :: Ipv6CidrBlockAssociation
newIpv6CidrBlockAssociation =
Ipv6CidrBlockAssociation' :: Maybe Text -> Maybe Text -> Maybe Text -> Ipv6CidrBlockAssociation
Ipv6CidrBlockAssociation'
{ $sel:associationId:Ipv6CidrBlockAssociation' :: Maybe Text
associationId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ipv6CidrBlock:Ipv6CidrBlockAssociation' :: Maybe Text
ipv6CidrBlock = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:cidrBlockState:Ipv6CidrBlockAssociation' :: Maybe Text
cidrBlockState = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
ipv6CidrBlockAssociation_associationId :: Lens.Lens' Ipv6CidrBlockAssociation (Prelude.Maybe Prelude.Text)
ipv6CidrBlockAssociation_associationId :: (Maybe Text -> f (Maybe Text))
-> Ipv6CidrBlockAssociation -> f Ipv6CidrBlockAssociation
ipv6CidrBlockAssociation_associationId = (Ipv6CidrBlockAssociation -> Maybe Text)
-> (Ipv6CidrBlockAssociation
-> Maybe Text -> Ipv6CidrBlockAssociation)
-> Lens
Ipv6CidrBlockAssociation
Ipv6CidrBlockAssociation
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ipv6CidrBlockAssociation' {Maybe Text
associationId :: Maybe Text
$sel:associationId:Ipv6CidrBlockAssociation' :: Ipv6CidrBlockAssociation -> Maybe Text
associationId} -> Maybe Text
associationId) (\s :: Ipv6CidrBlockAssociation
s@Ipv6CidrBlockAssociation' {} Maybe Text
a -> Ipv6CidrBlockAssociation
s {$sel:associationId:Ipv6CidrBlockAssociation' :: Maybe Text
associationId = Maybe Text
a} :: Ipv6CidrBlockAssociation)
ipv6CidrBlockAssociation_ipv6CidrBlock :: Lens.Lens' Ipv6CidrBlockAssociation (Prelude.Maybe Prelude.Text)
ipv6CidrBlockAssociation_ipv6CidrBlock :: (Maybe Text -> f (Maybe Text))
-> Ipv6CidrBlockAssociation -> f Ipv6CidrBlockAssociation
ipv6CidrBlockAssociation_ipv6CidrBlock = (Ipv6CidrBlockAssociation -> Maybe Text)
-> (Ipv6CidrBlockAssociation
-> Maybe Text -> Ipv6CidrBlockAssociation)
-> Lens
Ipv6CidrBlockAssociation
Ipv6CidrBlockAssociation
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ipv6CidrBlockAssociation' {Maybe Text
ipv6CidrBlock :: Maybe Text
$sel:ipv6CidrBlock:Ipv6CidrBlockAssociation' :: Ipv6CidrBlockAssociation -> Maybe Text
ipv6CidrBlock} -> Maybe Text
ipv6CidrBlock) (\s :: Ipv6CidrBlockAssociation
s@Ipv6CidrBlockAssociation' {} Maybe Text
a -> Ipv6CidrBlockAssociation
s {$sel:ipv6CidrBlock:Ipv6CidrBlockAssociation' :: Maybe Text
ipv6CidrBlock = Maybe Text
a} :: Ipv6CidrBlockAssociation)
ipv6CidrBlockAssociation_cidrBlockState :: Lens.Lens' Ipv6CidrBlockAssociation (Prelude.Maybe Prelude.Text)
ipv6CidrBlockAssociation_cidrBlockState :: (Maybe Text -> f (Maybe Text))
-> Ipv6CidrBlockAssociation -> f Ipv6CidrBlockAssociation
ipv6CidrBlockAssociation_cidrBlockState = (Ipv6CidrBlockAssociation -> Maybe Text)
-> (Ipv6CidrBlockAssociation
-> Maybe Text -> Ipv6CidrBlockAssociation)
-> Lens
Ipv6CidrBlockAssociation
Ipv6CidrBlockAssociation
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ipv6CidrBlockAssociation' {Maybe Text
cidrBlockState :: Maybe Text
$sel:cidrBlockState:Ipv6CidrBlockAssociation' :: Ipv6CidrBlockAssociation -> Maybe Text
cidrBlockState} -> Maybe Text
cidrBlockState) (\s :: Ipv6CidrBlockAssociation
s@Ipv6CidrBlockAssociation' {} Maybe Text
a -> Ipv6CidrBlockAssociation
s {$sel:cidrBlockState:Ipv6CidrBlockAssociation' :: Maybe Text
cidrBlockState = Maybe Text
a} :: Ipv6CidrBlockAssociation)
instance Core.FromJSON Ipv6CidrBlockAssociation where
parseJSON :: Value -> Parser Ipv6CidrBlockAssociation
parseJSON =
String
-> (Object -> Parser Ipv6CidrBlockAssociation)
-> Value
-> Parser Ipv6CidrBlockAssociation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Ipv6CidrBlockAssociation"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> Ipv6CidrBlockAssociation
Ipv6CidrBlockAssociation'
(Maybe Text
-> Maybe Text -> Maybe Text -> Ipv6CidrBlockAssociation)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Ipv6CidrBlockAssociation)
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
"AssociationId")
Parser (Maybe Text -> Maybe Text -> Ipv6CidrBlockAssociation)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Ipv6CidrBlockAssociation)
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
"Ipv6CidrBlock")
Parser (Maybe Text -> Ipv6CidrBlockAssociation)
-> Parser (Maybe Text) -> Parser Ipv6CidrBlockAssociation
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
"CidrBlockState")
)
instance Prelude.Hashable Ipv6CidrBlockAssociation
instance Prelude.NFData Ipv6CidrBlockAssociation
instance Core.ToJSON Ipv6CidrBlockAssociation where
toJSON :: Ipv6CidrBlockAssociation -> Value
toJSON Ipv6CidrBlockAssociation' {Maybe Text
cidrBlockState :: Maybe Text
ipv6CidrBlock :: Maybe Text
associationId :: Maybe Text
$sel:cidrBlockState:Ipv6CidrBlockAssociation' :: Ipv6CidrBlockAssociation -> Maybe Text
$sel:ipv6CidrBlock:Ipv6CidrBlockAssociation' :: Ipv6CidrBlockAssociation -> Maybe Text
$sel:associationId:Ipv6CidrBlockAssociation' :: Ipv6CidrBlockAssociation -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AssociationId" 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
associationId,
(Text
"Ipv6CidrBlock" 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
ipv6CidrBlock,
(Text
"CidrBlockState" 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
cidrBlockState
]
)