{-# 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.RedshiftServerLess.Types.Endpoint where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.RedshiftServerLess.Types.VpcEndpoint
data Endpoint = Endpoint'
{
Endpoint -> Maybe Text
address :: Prelude.Maybe Prelude.Text,
Endpoint -> Maybe Int
port :: Prelude.Maybe Prelude.Int,
Endpoint -> Maybe [VpcEndpoint]
vpcEndpoints :: Prelude.Maybe [VpcEndpoint]
}
deriving (Endpoint -> Endpoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Endpoint -> Endpoint -> Bool
$c/= :: Endpoint -> Endpoint -> Bool
== :: Endpoint -> Endpoint -> Bool
$c== :: Endpoint -> Endpoint -> Bool
Prelude.Eq, ReadPrec [Endpoint]
ReadPrec Endpoint
Int -> ReadS Endpoint
ReadS [Endpoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Endpoint]
$creadListPrec :: ReadPrec [Endpoint]
readPrec :: ReadPrec Endpoint
$creadPrec :: ReadPrec Endpoint
readList :: ReadS [Endpoint]
$creadList :: ReadS [Endpoint]
readsPrec :: Int -> ReadS Endpoint
$creadsPrec :: Int -> ReadS Endpoint
Prelude.Read, Int -> Endpoint -> ShowS
[Endpoint] -> ShowS
Endpoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Endpoint] -> ShowS
$cshowList :: [Endpoint] -> ShowS
show :: Endpoint -> String
$cshow :: Endpoint -> String
showsPrec :: Int -> Endpoint -> ShowS
$cshowsPrec :: Int -> Endpoint -> ShowS
Prelude.Show, forall x. Rep Endpoint x -> Endpoint
forall x. Endpoint -> Rep Endpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Endpoint x -> Endpoint
$cfrom :: forall x. Endpoint -> Rep Endpoint x
Prelude.Generic)
newEndpoint ::
Endpoint
newEndpoint :: Endpoint
newEndpoint =
Endpoint'
{ $sel:address:Endpoint' :: Maybe Text
address = forall a. Maybe a
Prelude.Nothing,
$sel:port:Endpoint' :: Maybe Int
port = forall a. Maybe a
Prelude.Nothing,
$sel:vpcEndpoints:Endpoint' :: Maybe [VpcEndpoint]
vpcEndpoints = forall a. Maybe a
Prelude.Nothing
}
endpoint_address :: Lens.Lens' Endpoint (Prelude.Maybe Prelude.Text)
endpoint_address :: Lens' Endpoint (Maybe Text)
endpoint_address = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Endpoint' {Maybe Text
address :: Maybe Text
$sel:address:Endpoint' :: Endpoint -> Maybe Text
address} -> Maybe Text
address) (\s :: Endpoint
s@Endpoint' {} Maybe Text
a -> Endpoint
s {$sel:address:Endpoint' :: Maybe Text
address = Maybe Text
a} :: Endpoint)
endpoint_port :: Lens.Lens' Endpoint (Prelude.Maybe Prelude.Int)
endpoint_port :: Lens' Endpoint (Maybe Int)
endpoint_port = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Endpoint' {Maybe Int
port :: Maybe Int
$sel:port:Endpoint' :: Endpoint -> Maybe Int
port} -> Maybe Int
port) (\s :: Endpoint
s@Endpoint' {} Maybe Int
a -> Endpoint
s {$sel:port:Endpoint' :: Maybe Int
port = Maybe Int
a} :: Endpoint)
endpoint_vpcEndpoints :: Lens.Lens' Endpoint (Prelude.Maybe [VpcEndpoint])
endpoint_vpcEndpoints :: Lens' Endpoint (Maybe [VpcEndpoint])
endpoint_vpcEndpoints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Endpoint' {Maybe [VpcEndpoint]
vpcEndpoints :: Maybe [VpcEndpoint]
$sel:vpcEndpoints:Endpoint' :: Endpoint -> Maybe [VpcEndpoint]
vpcEndpoints} -> Maybe [VpcEndpoint]
vpcEndpoints) (\s :: Endpoint
s@Endpoint' {} Maybe [VpcEndpoint]
a -> Endpoint
s {$sel:vpcEndpoints:Endpoint' :: Maybe [VpcEndpoint]
vpcEndpoints = Maybe [VpcEndpoint]
a} :: Endpoint) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON Endpoint where
parseJSON :: Value -> Parser Endpoint
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Endpoint"
( \Object
x ->
Maybe Text -> Maybe Int -> Maybe [VpcEndpoint] -> Endpoint
Endpoint'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"address")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"port")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"vpcEndpoints" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable Endpoint where
hashWithSalt :: Int -> Endpoint -> Int
hashWithSalt Int
_salt Endpoint' {Maybe Int
Maybe [VpcEndpoint]
Maybe Text
vpcEndpoints :: Maybe [VpcEndpoint]
port :: Maybe Int
address :: Maybe Text
$sel:vpcEndpoints:Endpoint' :: Endpoint -> Maybe [VpcEndpoint]
$sel:port:Endpoint' :: Endpoint -> Maybe Int
$sel:address:Endpoint' :: Endpoint -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
address
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
port
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [VpcEndpoint]
vpcEndpoints
instance Prelude.NFData Endpoint where
rnf :: Endpoint -> ()
rnf Endpoint' {Maybe Int
Maybe [VpcEndpoint]
Maybe Text
vpcEndpoints :: Maybe [VpcEndpoint]
port :: Maybe Int
address :: Maybe Text
$sel:vpcEndpoints:Endpoint' :: Endpoint -> Maybe [VpcEndpoint]
$sel:port:Endpoint' :: Endpoint -> Maybe Int
$sel:address:Endpoint' :: Endpoint -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
address
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
port
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [VpcEndpoint]
vpcEndpoints