{-# 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.Route53Resolver.Types.IpAddressUpdate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data IpAddressUpdate = IpAddressUpdate'
{
IpAddressUpdate -> Maybe Text
subnetId :: Prelude.Maybe Prelude.Text,
IpAddressUpdate -> Maybe Text
ip :: Prelude.Maybe Prelude.Text,
IpAddressUpdate -> Maybe Text
ipId :: Prelude.Maybe Prelude.Text
}
deriving (IpAddressUpdate -> IpAddressUpdate -> Bool
(IpAddressUpdate -> IpAddressUpdate -> Bool)
-> (IpAddressUpdate -> IpAddressUpdate -> Bool)
-> Eq IpAddressUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IpAddressUpdate -> IpAddressUpdate -> Bool
$c/= :: IpAddressUpdate -> IpAddressUpdate -> Bool
== :: IpAddressUpdate -> IpAddressUpdate -> Bool
$c== :: IpAddressUpdate -> IpAddressUpdate -> Bool
Prelude.Eq, ReadPrec [IpAddressUpdate]
ReadPrec IpAddressUpdate
Int -> ReadS IpAddressUpdate
ReadS [IpAddressUpdate]
(Int -> ReadS IpAddressUpdate)
-> ReadS [IpAddressUpdate]
-> ReadPrec IpAddressUpdate
-> ReadPrec [IpAddressUpdate]
-> Read IpAddressUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IpAddressUpdate]
$creadListPrec :: ReadPrec [IpAddressUpdate]
readPrec :: ReadPrec IpAddressUpdate
$creadPrec :: ReadPrec IpAddressUpdate
readList :: ReadS [IpAddressUpdate]
$creadList :: ReadS [IpAddressUpdate]
readsPrec :: Int -> ReadS IpAddressUpdate
$creadsPrec :: Int -> ReadS IpAddressUpdate
Prelude.Read, Int -> IpAddressUpdate -> ShowS
[IpAddressUpdate] -> ShowS
IpAddressUpdate -> String
(Int -> IpAddressUpdate -> ShowS)
-> (IpAddressUpdate -> String)
-> ([IpAddressUpdate] -> ShowS)
-> Show IpAddressUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IpAddressUpdate] -> ShowS
$cshowList :: [IpAddressUpdate] -> ShowS
show :: IpAddressUpdate -> String
$cshow :: IpAddressUpdate -> String
showsPrec :: Int -> IpAddressUpdate -> ShowS
$cshowsPrec :: Int -> IpAddressUpdate -> ShowS
Prelude.Show, (forall x. IpAddressUpdate -> Rep IpAddressUpdate x)
-> (forall x. Rep IpAddressUpdate x -> IpAddressUpdate)
-> Generic IpAddressUpdate
forall x. Rep IpAddressUpdate x -> IpAddressUpdate
forall x. IpAddressUpdate -> Rep IpAddressUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IpAddressUpdate x -> IpAddressUpdate
$cfrom :: forall x. IpAddressUpdate -> Rep IpAddressUpdate x
Prelude.Generic)
newIpAddressUpdate ::
IpAddressUpdate
newIpAddressUpdate :: IpAddressUpdate
newIpAddressUpdate =
IpAddressUpdate' :: Maybe Text -> Maybe Text -> Maybe Text -> IpAddressUpdate
IpAddressUpdate'
{ $sel:subnetId:IpAddressUpdate' :: Maybe Text
subnetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ip:IpAddressUpdate' :: Maybe Text
ip = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ipId:IpAddressUpdate' :: Maybe Text
ipId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
ipAddressUpdate_subnetId :: Lens.Lens' IpAddressUpdate (Prelude.Maybe Prelude.Text)
ipAddressUpdate_subnetId :: (Maybe Text -> f (Maybe Text))
-> IpAddressUpdate -> f IpAddressUpdate
ipAddressUpdate_subnetId = (IpAddressUpdate -> Maybe Text)
-> (IpAddressUpdate -> Maybe Text -> IpAddressUpdate)
-> Lens IpAddressUpdate IpAddressUpdate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpAddressUpdate' {Maybe Text
subnetId :: Maybe Text
$sel:subnetId:IpAddressUpdate' :: IpAddressUpdate -> Maybe Text
subnetId} -> Maybe Text
subnetId) (\s :: IpAddressUpdate
s@IpAddressUpdate' {} Maybe Text
a -> IpAddressUpdate
s {$sel:subnetId:IpAddressUpdate' :: Maybe Text
subnetId = Maybe Text
a} :: IpAddressUpdate)
ipAddressUpdate_ip :: Lens.Lens' IpAddressUpdate (Prelude.Maybe Prelude.Text)
ipAddressUpdate_ip :: (Maybe Text -> f (Maybe Text))
-> IpAddressUpdate -> f IpAddressUpdate
ipAddressUpdate_ip = (IpAddressUpdate -> Maybe Text)
-> (IpAddressUpdate -> Maybe Text -> IpAddressUpdate)
-> Lens IpAddressUpdate IpAddressUpdate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpAddressUpdate' {Maybe Text
ip :: Maybe Text
$sel:ip:IpAddressUpdate' :: IpAddressUpdate -> Maybe Text
ip} -> Maybe Text
ip) (\s :: IpAddressUpdate
s@IpAddressUpdate' {} Maybe Text
a -> IpAddressUpdate
s {$sel:ip:IpAddressUpdate' :: Maybe Text
ip = Maybe Text
a} :: IpAddressUpdate)
ipAddressUpdate_ipId :: Lens.Lens' IpAddressUpdate (Prelude.Maybe Prelude.Text)
ipAddressUpdate_ipId :: (Maybe Text -> f (Maybe Text))
-> IpAddressUpdate -> f IpAddressUpdate
ipAddressUpdate_ipId = (IpAddressUpdate -> Maybe Text)
-> (IpAddressUpdate -> Maybe Text -> IpAddressUpdate)
-> Lens IpAddressUpdate IpAddressUpdate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpAddressUpdate' {Maybe Text
ipId :: Maybe Text
$sel:ipId:IpAddressUpdate' :: IpAddressUpdate -> Maybe Text
ipId} -> Maybe Text
ipId) (\s :: IpAddressUpdate
s@IpAddressUpdate' {} Maybe Text
a -> IpAddressUpdate
s {$sel:ipId:IpAddressUpdate' :: Maybe Text
ipId = Maybe Text
a} :: IpAddressUpdate)
instance Prelude.Hashable IpAddressUpdate
instance Prelude.NFData IpAddressUpdate
instance Core.ToJSON IpAddressUpdate where
toJSON :: IpAddressUpdate -> Value
toJSON IpAddressUpdate' {Maybe Text
ipId :: Maybe Text
ip :: Maybe Text
subnetId :: Maybe Text
$sel:ipId:IpAddressUpdate' :: IpAddressUpdate -> Maybe Text
$sel:ip:IpAddressUpdate' :: IpAddressUpdate -> Maybe Text
$sel:subnetId:IpAddressUpdate' :: IpAddressUpdate -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SubnetId" 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
subnetId,
(Text
"Ip" 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
ip,
(Text
"IpId" 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
ipId
]
)