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