{-# 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.Inspector.Types.PrivateIp where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PrivateIp = PrivateIp'
{
PrivateIp -> Maybe Text
privateIpAddress :: Prelude.Maybe Prelude.Text,
PrivateIp -> Maybe Text
privateDnsName :: Prelude.Maybe Prelude.Text
}
deriving (PrivateIp -> PrivateIp -> Bool
(PrivateIp -> PrivateIp -> Bool)
-> (PrivateIp -> PrivateIp -> Bool) -> Eq PrivateIp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PrivateIp -> PrivateIp -> Bool
$c/= :: PrivateIp -> PrivateIp -> Bool
== :: PrivateIp -> PrivateIp -> Bool
$c== :: PrivateIp -> PrivateIp -> Bool
Prelude.Eq, ReadPrec [PrivateIp]
ReadPrec PrivateIp
Int -> ReadS PrivateIp
ReadS [PrivateIp]
(Int -> ReadS PrivateIp)
-> ReadS [PrivateIp]
-> ReadPrec PrivateIp
-> ReadPrec [PrivateIp]
-> Read PrivateIp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PrivateIp]
$creadListPrec :: ReadPrec [PrivateIp]
readPrec :: ReadPrec PrivateIp
$creadPrec :: ReadPrec PrivateIp
readList :: ReadS [PrivateIp]
$creadList :: ReadS [PrivateIp]
readsPrec :: Int -> ReadS PrivateIp
$creadsPrec :: Int -> ReadS PrivateIp
Prelude.Read, Int -> PrivateIp -> ShowS
[PrivateIp] -> ShowS
PrivateIp -> String
(Int -> PrivateIp -> ShowS)
-> (PrivateIp -> String)
-> ([PrivateIp] -> ShowS)
-> Show PrivateIp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PrivateIp] -> ShowS
$cshowList :: [PrivateIp] -> ShowS
show :: PrivateIp -> String
$cshow :: PrivateIp -> String
showsPrec :: Int -> PrivateIp -> ShowS
$cshowsPrec :: Int -> PrivateIp -> ShowS
Prelude.Show, (forall x. PrivateIp -> Rep PrivateIp x)
-> (forall x. Rep PrivateIp x -> PrivateIp) -> Generic PrivateIp
forall x. Rep PrivateIp x -> PrivateIp
forall x. PrivateIp -> Rep PrivateIp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PrivateIp x -> PrivateIp
$cfrom :: forall x. PrivateIp -> Rep PrivateIp x
Prelude.Generic)
newPrivateIp ::
PrivateIp
newPrivateIp :: PrivateIp
newPrivateIp =
PrivateIp' :: Maybe Text -> Maybe Text -> PrivateIp
PrivateIp'
{ $sel:privateIpAddress:PrivateIp' :: Maybe Text
privateIpAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:privateDnsName:PrivateIp' :: Maybe Text
privateDnsName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
privateIp_privateIpAddress :: Lens.Lens' PrivateIp (Prelude.Maybe Prelude.Text)
privateIp_privateIpAddress :: (Maybe Text -> f (Maybe Text)) -> PrivateIp -> f PrivateIp
privateIp_privateIpAddress = (PrivateIp -> Maybe Text)
-> (PrivateIp -> Maybe Text -> PrivateIp)
-> Lens PrivateIp PrivateIp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PrivateIp' {Maybe Text
privateIpAddress :: Maybe Text
$sel:privateIpAddress:PrivateIp' :: PrivateIp -> Maybe Text
privateIpAddress} -> Maybe Text
privateIpAddress) (\s :: PrivateIp
s@PrivateIp' {} Maybe Text
a -> PrivateIp
s {$sel:privateIpAddress:PrivateIp' :: Maybe Text
privateIpAddress = Maybe Text
a} :: PrivateIp)
privateIp_privateDnsName :: Lens.Lens' PrivateIp (Prelude.Maybe Prelude.Text)
privateIp_privateDnsName :: (Maybe Text -> f (Maybe Text)) -> PrivateIp -> f PrivateIp
privateIp_privateDnsName = (PrivateIp -> Maybe Text)
-> (PrivateIp -> Maybe Text -> PrivateIp)
-> Lens PrivateIp PrivateIp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PrivateIp' {Maybe Text
privateDnsName :: Maybe Text
$sel:privateDnsName:PrivateIp' :: PrivateIp -> Maybe Text
privateDnsName} -> Maybe Text
privateDnsName) (\s :: PrivateIp
s@PrivateIp' {} Maybe Text
a -> PrivateIp
s {$sel:privateDnsName:PrivateIp' :: Maybe Text
privateDnsName = Maybe Text
a} :: PrivateIp)
instance Core.FromJSON PrivateIp where
parseJSON :: Value -> Parser PrivateIp
parseJSON =
String -> (Object -> Parser PrivateIp) -> Value -> Parser PrivateIp
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PrivateIp"
( \Object
x ->
Maybe Text -> Maybe Text -> PrivateIp
PrivateIp'
(Maybe Text -> Maybe Text -> PrivateIp)
-> Parser (Maybe Text) -> Parser (Maybe Text -> PrivateIp)
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
"privateIpAddress")
Parser (Maybe Text -> PrivateIp)
-> Parser (Maybe Text) -> Parser PrivateIp
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
"privateDnsName")
)
instance Prelude.Hashable PrivateIp
instance Prelude.NFData PrivateIp