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