{-# 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.GlobalAccelerator.Types.ByoipCidr where
import qualified Amazonka.Core as Core
import Amazonka.GlobalAccelerator.Types.ByoipCidrEvent
import Amazonka.GlobalAccelerator.Types.ByoipCidrState
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ByoipCidr = ByoipCidr'
{
ByoipCidr -> Maybe ByoipCidrState
state :: Prelude.Maybe ByoipCidrState,
ByoipCidr -> Maybe Text
cidr :: Prelude.Maybe Prelude.Text,
ByoipCidr -> Maybe [ByoipCidrEvent]
events :: Prelude.Maybe [ByoipCidrEvent]
}
deriving (ByoipCidr -> ByoipCidr -> Bool
(ByoipCidr -> ByoipCidr -> Bool)
-> (ByoipCidr -> ByoipCidr -> Bool) -> Eq ByoipCidr
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ByoipCidr -> ByoipCidr -> Bool
$c/= :: ByoipCidr -> ByoipCidr -> Bool
== :: ByoipCidr -> ByoipCidr -> Bool
$c== :: ByoipCidr -> ByoipCidr -> Bool
Prelude.Eq, ReadPrec [ByoipCidr]
ReadPrec ByoipCidr
Int -> ReadS ByoipCidr
ReadS [ByoipCidr]
(Int -> ReadS ByoipCidr)
-> ReadS [ByoipCidr]
-> ReadPrec ByoipCidr
-> ReadPrec [ByoipCidr]
-> Read ByoipCidr
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ByoipCidr]
$creadListPrec :: ReadPrec [ByoipCidr]
readPrec :: ReadPrec ByoipCidr
$creadPrec :: ReadPrec ByoipCidr
readList :: ReadS [ByoipCidr]
$creadList :: ReadS [ByoipCidr]
readsPrec :: Int -> ReadS ByoipCidr
$creadsPrec :: Int -> ReadS ByoipCidr
Prelude.Read, Int -> ByoipCidr -> ShowS
[ByoipCidr] -> ShowS
ByoipCidr -> String
(Int -> ByoipCidr -> ShowS)
-> (ByoipCidr -> String)
-> ([ByoipCidr] -> ShowS)
-> Show ByoipCidr
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ByoipCidr] -> ShowS
$cshowList :: [ByoipCidr] -> ShowS
show :: ByoipCidr -> String
$cshow :: ByoipCidr -> String
showsPrec :: Int -> ByoipCidr -> ShowS
$cshowsPrec :: Int -> ByoipCidr -> ShowS
Prelude.Show, (forall x. ByoipCidr -> Rep ByoipCidr x)
-> (forall x. Rep ByoipCidr x -> ByoipCidr) -> Generic ByoipCidr
forall x. Rep ByoipCidr x -> ByoipCidr
forall x. ByoipCidr -> Rep ByoipCidr x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ByoipCidr x -> ByoipCidr
$cfrom :: forall x. ByoipCidr -> Rep ByoipCidr x
Prelude.Generic)
newByoipCidr ::
ByoipCidr
newByoipCidr :: ByoipCidr
newByoipCidr =
ByoipCidr' :: Maybe ByoipCidrState
-> Maybe Text -> Maybe [ByoipCidrEvent] -> ByoipCidr
ByoipCidr'
{ $sel:state:ByoipCidr' :: Maybe ByoipCidrState
state = Maybe ByoipCidrState
forall a. Maybe a
Prelude.Nothing,
$sel:cidr:ByoipCidr' :: Maybe Text
cidr = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:events:ByoipCidr' :: Maybe [ByoipCidrEvent]
events = Maybe [ByoipCidrEvent]
forall a. Maybe a
Prelude.Nothing
}
byoipCidr_state :: Lens.Lens' ByoipCidr (Prelude.Maybe ByoipCidrState)
byoipCidr_state :: (Maybe ByoipCidrState -> f (Maybe ByoipCidrState))
-> ByoipCidr -> f ByoipCidr
byoipCidr_state = (ByoipCidr -> Maybe ByoipCidrState)
-> (ByoipCidr -> Maybe ByoipCidrState -> ByoipCidr)
-> Lens
ByoipCidr ByoipCidr (Maybe ByoipCidrState) (Maybe ByoipCidrState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ByoipCidr' {Maybe ByoipCidrState
state :: Maybe ByoipCidrState
$sel:state:ByoipCidr' :: ByoipCidr -> Maybe ByoipCidrState
state} -> Maybe ByoipCidrState
state) (\s :: ByoipCidr
s@ByoipCidr' {} Maybe ByoipCidrState
a -> ByoipCidr
s {$sel:state:ByoipCidr' :: Maybe ByoipCidrState
state = Maybe ByoipCidrState
a} :: ByoipCidr)
byoipCidr_cidr :: Lens.Lens' ByoipCidr (Prelude.Maybe Prelude.Text)
byoipCidr_cidr :: (Maybe Text -> f (Maybe Text)) -> ByoipCidr -> f ByoipCidr
byoipCidr_cidr = (ByoipCidr -> Maybe Text)
-> (ByoipCidr -> Maybe Text -> ByoipCidr)
-> Lens ByoipCidr ByoipCidr (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ByoipCidr' {Maybe Text
cidr :: Maybe Text
$sel:cidr:ByoipCidr' :: ByoipCidr -> Maybe Text
cidr} -> Maybe Text
cidr) (\s :: ByoipCidr
s@ByoipCidr' {} Maybe Text
a -> ByoipCidr
s {$sel:cidr:ByoipCidr' :: Maybe Text
cidr = Maybe Text
a} :: ByoipCidr)
byoipCidr_events :: Lens.Lens' ByoipCidr (Prelude.Maybe [ByoipCidrEvent])
byoipCidr_events :: (Maybe [ByoipCidrEvent] -> f (Maybe [ByoipCidrEvent]))
-> ByoipCidr -> f ByoipCidr
byoipCidr_events = (ByoipCidr -> Maybe [ByoipCidrEvent])
-> (ByoipCidr -> Maybe [ByoipCidrEvent] -> ByoipCidr)
-> Lens
ByoipCidr
ByoipCidr
(Maybe [ByoipCidrEvent])
(Maybe [ByoipCidrEvent])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ByoipCidr' {Maybe [ByoipCidrEvent]
events :: Maybe [ByoipCidrEvent]
$sel:events:ByoipCidr' :: ByoipCidr -> Maybe [ByoipCidrEvent]
events} -> Maybe [ByoipCidrEvent]
events) (\s :: ByoipCidr
s@ByoipCidr' {} Maybe [ByoipCidrEvent]
a -> ByoipCidr
s {$sel:events:ByoipCidr' :: Maybe [ByoipCidrEvent]
events = Maybe [ByoipCidrEvent]
a} :: ByoipCidr) ((Maybe [ByoipCidrEvent] -> f (Maybe [ByoipCidrEvent]))
-> ByoipCidr -> f ByoipCidr)
-> ((Maybe [ByoipCidrEvent] -> f (Maybe [ByoipCidrEvent]))
-> Maybe [ByoipCidrEvent] -> f (Maybe [ByoipCidrEvent]))
-> (Maybe [ByoipCidrEvent] -> f (Maybe [ByoipCidrEvent]))
-> ByoipCidr
-> f ByoipCidr
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ByoipCidrEvent] [ByoipCidrEvent] [ByoipCidrEvent] [ByoipCidrEvent]
-> Iso
(Maybe [ByoipCidrEvent])
(Maybe [ByoipCidrEvent])
(Maybe [ByoipCidrEvent])
(Maybe [ByoipCidrEvent])
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 AnIso
[ByoipCidrEvent] [ByoipCidrEvent] [ByoipCidrEvent] [ByoipCidrEvent]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON ByoipCidr where
parseJSON :: Value -> Parser ByoipCidr
parseJSON =
String -> (Object -> Parser ByoipCidr) -> Value -> Parser ByoipCidr
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ByoipCidr"
( \Object
x ->
Maybe ByoipCidrState
-> Maybe Text -> Maybe [ByoipCidrEvent] -> ByoipCidr
ByoipCidr'
(Maybe ByoipCidrState
-> Maybe Text -> Maybe [ByoipCidrEvent] -> ByoipCidr)
-> Parser (Maybe ByoipCidrState)
-> Parser (Maybe Text -> Maybe [ByoipCidrEvent] -> ByoipCidr)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ByoipCidrState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
Parser (Maybe Text -> Maybe [ByoipCidrEvent] -> ByoipCidr)
-> Parser (Maybe Text)
-> Parser (Maybe [ByoipCidrEvent] -> ByoipCidr)
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
"Cidr")
Parser (Maybe [ByoipCidrEvent] -> ByoipCidr)
-> Parser (Maybe [ByoipCidrEvent]) -> Parser ByoipCidr
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [ByoipCidrEvent]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Events" Parser (Maybe (Maybe [ByoipCidrEvent]))
-> Maybe [ByoipCidrEvent] -> Parser (Maybe [ByoipCidrEvent])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ByoipCidrEvent]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ByoipCidr
instance Prelude.NFData ByoipCidr