{-# 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.SecurityHub.Types.AwsRdsDbInstanceEndpoint where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AwsRdsDbInstanceEndpoint = AwsRdsDbInstanceEndpoint'
{
AwsRdsDbInstanceEndpoint -> Maybe Text
hostedZoneId :: Prelude.Maybe Prelude.Text,
AwsRdsDbInstanceEndpoint -> Maybe Text
address :: Prelude.Maybe Prelude.Text,
AwsRdsDbInstanceEndpoint -> Maybe Int
port :: Prelude.Maybe Prelude.Int
}
deriving (AwsRdsDbInstanceEndpoint -> AwsRdsDbInstanceEndpoint -> Bool
(AwsRdsDbInstanceEndpoint -> AwsRdsDbInstanceEndpoint -> Bool)
-> (AwsRdsDbInstanceEndpoint -> AwsRdsDbInstanceEndpoint -> Bool)
-> Eq AwsRdsDbInstanceEndpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsRdsDbInstanceEndpoint -> AwsRdsDbInstanceEndpoint -> Bool
$c/= :: AwsRdsDbInstanceEndpoint -> AwsRdsDbInstanceEndpoint -> Bool
== :: AwsRdsDbInstanceEndpoint -> AwsRdsDbInstanceEndpoint -> Bool
$c== :: AwsRdsDbInstanceEndpoint -> AwsRdsDbInstanceEndpoint -> Bool
Prelude.Eq, ReadPrec [AwsRdsDbInstanceEndpoint]
ReadPrec AwsRdsDbInstanceEndpoint
Int -> ReadS AwsRdsDbInstanceEndpoint
ReadS [AwsRdsDbInstanceEndpoint]
(Int -> ReadS AwsRdsDbInstanceEndpoint)
-> ReadS [AwsRdsDbInstanceEndpoint]
-> ReadPrec AwsRdsDbInstanceEndpoint
-> ReadPrec [AwsRdsDbInstanceEndpoint]
-> Read AwsRdsDbInstanceEndpoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsRdsDbInstanceEndpoint]
$creadListPrec :: ReadPrec [AwsRdsDbInstanceEndpoint]
readPrec :: ReadPrec AwsRdsDbInstanceEndpoint
$creadPrec :: ReadPrec AwsRdsDbInstanceEndpoint
readList :: ReadS [AwsRdsDbInstanceEndpoint]
$creadList :: ReadS [AwsRdsDbInstanceEndpoint]
readsPrec :: Int -> ReadS AwsRdsDbInstanceEndpoint
$creadsPrec :: Int -> ReadS AwsRdsDbInstanceEndpoint
Prelude.Read, Int -> AwsRdsDbInstanceEndpoint -> ShowS
[AwsRdsDbInstanceEndpoint] -> ShowS
AwsRdsDbInstanceEndpoint -> String
(Int -> AwsRdsDbInstanceEndpoint -> ShowS)
-> (AwsRdsDbInstanceEndpoint -> String)
-> ([AwsRdsDbInstanceEndpoint] -> ShowS)
-> Show AwsRdsDbInstanceEndpoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsRdsDbInstanceEndpoint] -> ShowS
$cshowList :: [AwsRdsDbInstanceEndpoint] -> ShowS
show :: AwsRdsDbInstanceEndpoint -> String
$cshow :: AwsRdsDbInstanceEndpoint -> String
showsPrec :: Int -> AwsRdsDbInstanceEndpoint -> ShowS
$cshowsPrec :: Int -> AwsRdsDbInstanceEndpoint -> ShowS
Prelude.Show, (forall x.
AwsRdsDbInstanceEndpoint -> Rep AwsRdsDbInstanceEndpoint x)
-> (forall x.
Rep AwsRdsDbInstanceEndpoint x -> AwsRdsDbInstanceEndpoint)
-> Generic AwsRdsDbInstanceEndpoint
forall x.
Rep AwsRdsDbInstanceEndpoint x -> AwsRdsDbInstanceEndpoint
forall x.
AwsRdsDbInstanceEndpoint -> Rep AwsRdsDbInstanceEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsRdsDbInstanceEndpoint x -> AwsRdsDbInstanceEndpoint
$cfrom :: forall x.
AwsRdsDbInstanceEndpoint -> Rep AwsRdsDbInstanceEndpoint x
Prelude.Generic)
newAwsRdsDbInstanceEndpoint ::
AwsRdsDbInstanceEndpoint
newAwsRdsDbInstanceEndpoint :: AwsRdsDbInstanceEndpoint
newAwsRdsDbInstanceEndpoint =
AwsRdsDbInstanceEndpoint' :: Maybe Text -> Maybe Text -> Maybe Int -> AwsRdsDbInstanceEndpoint
AwsRdsDbInstanceEndpoint'
{ $sel:hostedZoneId:AwsRdsDbInstanceEndpoint' :: Maybe Text
hostedZoneId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:address:AwsRdsDbInstanceEndpoint' :: Maybe Text
address = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:port:AwsRdsDbInstanceEndpoint' :: Maybe Int
port = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
awsRdsDbInstanceEndpoint_hostedZoneId :: Lens.Lens' AwsRdsDbInstanceEndpoint (Prelude.Maybe Prelude.Text)
awsRdsDbInstanceEndpoint_hostedZoneId :: (Maybe Text -> f (Maybe Text))
-> AwsRdsDbInstanceEndpoint -> f AwsRdsDbInstanceEndpoint
awsRdsDbInstanceEndpoint_hostedZoneId = (AwsRdsDbInstanceEndpoint -> Maybe Text)
-> (AwsRdsDbInstanceEndpoint
-> Maybe Text -> AwsRdsDbInstanceEndpoint)
-> Lens
AwsRdsDbInstanceEndpoint
AwsRdsDbInstanceEndpoint
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsDbInstanceEndpoint' {Maybe Text
hostedZoneId :: Maybe Text
$sel:hostedZoneId:AwsRdsDbInstanceEndpoint' :: AwsRdsDbInstanceEndpoint -> Maybe Text
hostedZoneId} -> Maybe Text
hostedZoneId) (\s :: AwsRdsDbInstanceEndpoint
s@AwsRdsDbInstanceEndpoint' {} Maybe Text
a -> AwsRdsDbInstanceEndpoint
s {$sel:hostedZoneId:AwsRdsDbInstanceEndpoint' :: Maybe Text
hostedZoneId = Maybe Text
a} :: AwsRdsDbInstanceEndpoint)
awsRdsDbInstanceEndpoint_address :: Lens.Lens' AwsRdsDbInstanceEndpoint (Prelude.Maybe Prelude.Text)
awsRdsDbInstanceEndpoint_address :: (Maybe Text -> f (Maybe Text))
-> AwsRdsDbInstanceEndpoint -> f AwsRdsDbInstanceEndpoint
awsRdsDbInstanceEndpoint_address = (AwsRdsDbInstanceEndpoint -> Maybe Text)
-> (AwsRdsDbInstanceEndpoint
-> Maybe Text -> AwsRdsDbInstanceEndpoint)
-> Lens
AwsRdsDbInstanceEndpoint
AwsRdsDbInstanceEndpoint
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsDbInstanceEndpoint' {Maybe Text
address :: Maybe Text
$sel:address:AwsRdsDbInstanceEndpoint' :: AwsRdsDbInstanceEndpoint -> Maybe Text
address} -> Maybe Text
address) (\s :: AwsRdsDbInstanceEndpoint
s@AwsRdsDbInstanceEndpoint' {} Maybe Text
a -> AwsRdsDbInstanceEndpoint
s {$sel:address:AwsRdsDbInstanceEndpoint' :: Maybe Text
address = Maybe Text
a} :: AwsRdsDbInstanceEndpoint)
awsRdsDbInstanceEndpoint_port :: Lens.Lens' AwsRdsDbInstanceEndpoint (Prelude.Maybe Prelude.Int)
awsRdsDbInstanceEndpoint_port :: (Maybe Int -> f (Maybe Int))
-> AwsRdsDbInstanceEndpoint -> f AwsRdsDbInstanceEndpoint
awsRdsDbInstanceEndpoint_port = (AwsRdsDbInstanceEndpoint -> Maybe Int)
-> (AwsRdsDbInstanceEndpoint
-> Maybe Int -> AwsRdsDbInstanceEndpoint)
-> Lens
AwsRdsDbInstanceEndpoint
AwsRdsDbInstanceEndpoint
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsDbInstanceEndpoint' {Maybe Int
port :: Maybe Int
$sel:port:AwsRdsDbInstanceEndpoint' :: AwsRdsDbInstanceEndpoint -> Maybe Int
port} -> Maybe Int
port) (\s :: AwsRdsDbInstanceEndpoint
s@AwsRdsDbInstanceEndpoint' {} Maybe Int
a -> AwsRdsDbInstanceEndpoint
s {$sel:port:AwsRdsDbInstanceEndpoint' :: Maybe Int
port = Maybe Int
a} :: AwsRdsDbInstanceEndpoint)
instance Core.FromJSON AwsRdsDbInstanceEndpoint where
parseJSON :: Value -> Parser AwsRdsDbInstanceEndpoint
parseJSON =
String
-> (Object -> Parser AwsRdsDbInstanceEndpoint)
-> Value
-> Parser AwsRdsDbInstanceEndpoint
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsRdsDbInstanceEndpoint"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Int -> AwsRdsDbInstanceEndpoint
AwsRdsDbInstanceEndpoint'
(Maybe Text -> Maybe Text -> Maybe Int -> AwsRdsDbInstanceEndpoint)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Int -> AwsRdsDbInstanceEndpoint)
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
"HostedZoneId")
Parser (Maybe Text -> Maybe Int -> AwsRdsDbInstanceEndpoint)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> AwsRdsDbInstanceEndpoint)
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
"Address")
Parser (Maybe Int -> AwsRdsDbInstanceEndpoint)
-> Parser (Maybe Int) -> Parser AwsRdsDbInstanceEndpoint
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Port")
)
instance Prelude.Hashable AwsRdsDbInstanceEndpoint
instance Prelude.NFData AwsRdsDbInstanceEndpoint
instance Core.ToJSON AwsRdsDbInstanceEndpoint where
toJSON :: AwsRdsDbInstanceEndpoint -> Value
toJSON AwsRdsDbInstanceEndpoint' {Maybe Int
Maybe Text
port :: Maybe Int
address :: Maybe Text
hostedZoneId :: Maybe Text
$sel:port:AwsRdsDbInstanceEndpoint' :: AwsRdsDbInstanceEndpoint -> Maybe Int
$sel:address:AwsRdsDbInstanceEndpoint' :: AwsRdsDbInstanceEndpoint -> Maybe Text
$sel:hostedZoneId:AwsRdsDbInstanceEndpoint' :: AwsRdsDbInstanceEndpoint -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"HostedZoneId" 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
hostedZoneId,
(Text
"Address" 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
address,
(Text
"Port" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
port
]
)