{-# 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.RDS.Types.IPRange where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data IPRange = IPRange'
{
IPRange -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
IPRange -> Maybe Text
cidrip :: Prelude.Maybe Prelude.Text
}
deriving (IPRange -> IPRange -> Bool
(IPRange -> IPRange -> Bool)
-> (IPRange -> IPRange -> Bool) -> Eq IPRange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IPRange -> IPRange -> Bool
$c/= :: IPRange -> IPRange -> Bool
== :: IPRange -> IPRange -> Bool
$c== :: IPRange -> IPRange -> Bool
Prelude.Eq, ReadPrec [IPRange]
ReadPrec IPRange
Int -> ReadS IPRange
ReadS [IPRange]
(Int -> ReadS IPRange)
-> ReadS [IPRange]
-> ReadPrec IPRange
-> ReadPrec [IPRange]
-> Read IPRange
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IPRange]
$creadListPrec :: ReadPrec [IPRange]
readPrec :: ReadPrec IPRange
$creadPrec :: ReadPrec IPRange
readList :: ReadS [IPRange]
$creadList :: ReadS [IPRange]
readsPrec :: Int -> ReadS IPRange
$creadsPrec :: Int -> ReadS IPRange
Prelude.Read, Int -> IPRange -> ShowS
[IPRange] -> ShowS
IPRange -> String
(Int -> IPRange -> ShowS)
-> (IPRange -> String) -> ([IPRange] -> ShowS) -> Show IPRange
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IPRange] -> ShowS
$cshowList :: [IPRange] -> ShowS
show :: IPRange -> String
$cshow :: IPRange -> String
showsPrec :: Int -> IPRange -> ShowS
$cshowsPrec :: Int -> IPRange -> ShowS
Prelude.Show, (forall x. IPRange -> Rep IPRange x)
-> (forall x. Rep IPRange x -> IPRange) -> Generic IPRange
forall x. Rep IPRange x -> IPRange
forall x. IPRange -> Rep IPRange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IPRange x -> IPRange
$cfrom :: forall x. IPRange -> Rep IPRange x
Prelude.Generic)
newIPRange ::
IPRange
newIPRange :: IPRange
newIPRange =
IPRange' :: Maybe Text -> Maybe Text -> IPRange
IPRange'
{ $sel:status:IPRange' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:cidrip:IPRange' :: Maybe Text
cidrip = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
iPRange_status :: Lens.Lens' IPRange (Prelude.Maybe Prelude.Text)
iPRange_status :: (Maybe Text -> f (Maybe Text)) -> IPRange -> f IPRange
iPRange_status = (IPRange -> Maybe Text)
-> (IPRange -> Maybe Text -> IPRange)
-> Lens IPRange IPRange (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IPRange' {Maybe Text
status :: Maybe Text
$sel:status:IPRange' :: IPRange -> Maybe Text
status} -> Maybe Text
status) (\s :: IPRange
s@IPRange' {} Maybe Text
a -> IPRange
s {$sel:status:IPRange' :: Maybe Text
status = Maybe Text
a} :: IPRange)
iPRange_cidrip :: Lens.Lens' IPRange (Prelude.Maybe Prelude.Text)
iPRange_cidrip :: (Maybe Text -> f (Maybe Text)) -> IPRange -> f IPRange
iPRange_cidrip = (IPRange -> Maybe Text)
-> (IPRange -> Maybe Text -> IPRange)
-> Lens IPRange IPRange (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IPRange' {Maybe Text
cidrip :: Maybe Text
$sel:cidrip:IPRange' :: IPRange -> Maybe Text
cidrip} -> Maybe Text
cidrip) (\s :: IPRange
s@IPRange' {} Maybe Text
a -> IPRange
s {$sel:cidrip:IPRange' :: Maybe Text
cidrip = Maybe Text
a} :: IPRange)
instance Core.FromXML IPRange where
parseXML :: [Node] -> Either String IPRange
parseXML [Node]
x =
Maybe Text -> Maybe Text -> IPRange
IPRange'
(Maybe Text -> Maybe Text -> IPRange)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> IPRange)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
Either String (Maybe Text -> IPRange)
-> Either String (Maybe Text) -> Either String IPRange
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CIDRIP")
instance Prelude.Hashable IPRange
instance Prelude.NFData IPRange