{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Redshift.CreateEndpointAccess
(
CreateEndpointAccess (..),
newCreateEndpointAccess,
createEndpointAccess_clusterIdentifier,
createEndpointAccess_vpcSecurityGroupIds,
createEndpointAccess_resourceOwner,
createEndpointAccess_endpointName,
createEndpointAccess_subnetGroupName,
EndpointAccess (..),
newEndpointAccess,
endpointAccess_endpointName,
endpointAccess_endpointCreateTime,
endpointAccess_subnetGroupName,
endpointAccess_address,
endpointAccess_clusterIdentifier,
endpointAccess_endpointStatus,
endpointAccess_vpcSecurityGroups,
endpointAccess_resourceOwner,
endpointAccess_vpcEndpoint,
endpointAccess_port,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateEndpointAccess = CreateEndpointAccess'
{
CreateEndpointAccess -> Maybe Text
clusterIdentifier :: Prelude.Maybe Prelude.Text,
CreateEndpointAccess -> Maybe [Text]
vpcSecurityGroupIds :: Prelude.Maybe [Prelude.Text],
CreateEndpointAccess -> Maybe Text
resourceOwner :: Prelude.Maybe Prelude.Text,
CreateEndpointAccess -> Text
endpointName :: Prelude.Text,
CreateEndpointAccess -> Text
subnetGroupName :: Prelude.Text
}
deriving (CreateEndpointAccess -> CreateEndpointAccess -> Bool
(CreateEndpointAccess -> CreateEndpointAccess -> Bool)
-> (CreateEndpointAccess -> CreateEndpointAccess -> Bool)
-> Eq CreateEndpointAccess
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEndpointAccess -> CreateEndpointAccess -> Bool
$c/= :: CreateEndpointAccess -> CreateEndpointAccess -> Bool
== :: CreateEndpointAccess -> CreateEndpointAccess -> Bool
$c== :: CreateEndpointAccess -> CreateEndpointAccess -> Bool
Prelude.Eq, ReadPrec [CreateEndpointAccess]
ReadPrec CreateEndpointAccess
Int -> ReadS CreateEndpointAccess
ReadS [CreateEndpointAccess]
(Int -> ReadS CreateEndpointAccess)
-> ReadS [CreateEndpointAccess]
-> ReadPrec CreateEndpointAccess
-> ReadPrec [CreateEndpointAccess]
-> Read CreateEndpointAccess
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateEndpointAccess]
$creadListPrec :: ReadPrec [CreateEndpointAccess]
readPrec :: ReadPrec CreateEndpointAccess
$creadPrec :: ReadPrec CreateEndpointAccess
readList :: ReadS [CreateEndpointAccess]
$creadList :: ReadS [CreateEndpointAccess]
readsPrec :: Int -> ReadS CreateEndpointAccess
$creadsPrec :: Int -> ReadS CreateEndpointAccess
Prelude.Read, Int -> CreateEndpointAccess -> ShowS
[CreateEndpointAccess] -> ShowS
CreateEndpointAccess -> String
(Int -> CreateEndpointAccess -> ShowS)
-> (CreateEndpointAccess -> String)
-> ([CreateEndpointAccess] -> ShowS)
-> Show CreateEndpointAccess
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEndpointAccess] -> ShowS
$cshowList :: [CreateEndpointAccess] -> ShowS
show :: CreateEndpointAccess -> String
$cshow :: CreateEndpointAccess -> String
showsPrec :: Int -> CreateEndpointAccess -> ShowS
$cshowsPrec :: Int -> CreateEndpointAccess -> ShowS
Prelude.Show, (forall x. CreateEndpointAccess -> Rep CreateEndpointAccess x)
-> (forall x. Rep CreateEndpointAccess x -> CreateEndpointAccess)
-> Generic CreateEndpointAccess
forall x. Rep CreateEndpointAccess x -> CreateEndpointAccess
forall x. CreateEndpointAccess -> Rep CreateEndpointAccess x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateEndpointAccess x -> CreateEndpointAccess
$cfrom :: forall x. CreateEndpointAccess -> Rep CreateEndpointAccess x
Prelude.Generic)
newCreateEndpointAccess ::
Prelude.Text ->
Prelude.Text ->
CreateEndpointAccess
newCreateEndpointAccess :: Text -> Text -> CreateEndpointAccess
newCreateEndpointAccess
Text
pEndpointName_
Text
pSubnetGroupName_ =
CreateEndpointAccess' :: Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Text
-> Text
-> CreateEndpointAccess
CreateEndpointAccess'
{ $sel:clusterIdentifier:CreateEndpointAccess' :: Maybe Text
clusterIdentifier =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:vpcSecurityGroupIds:CreateEndpointAccess' :: Maybe [Text]
vpcSecurityGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:resourceOwner:CreateEndpointAccess' :: Maybe Text
resourceOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endpointName:CreateEndpointAccess' :: Text
endpointName = Text
pEndpointName_,
$sel:subnetGroupName:CreateEndpointAccess' :: Text
subnetGroupName = Text
pSubnetGroupName_
}
createEndpointAccess_clusterIdentifier :: Lens.Lens' CreateEndpointAccess (Prelude.Maybe Prelude.Text)
createEndpointAccess_clusterIdentifier :: (Maybe Text -> f (Maybe Text))
-> CreateEndpointAccess -> f CreateEndpointAccess
createEndpointAccess_clusterIdentifier = (CreateEndpointAccess -> Maybe Text)
-> (CreateEndpointAccess -> Maybe Text -> CreateEndpointAccess)
-> Lens
CreateEndpointAccess CreateEndpointAccess (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointAccess' {Maybe Text
clusterIdentifier :: Maybe Text
$sel:clusterIdentifier:CreateEndpointAccess' :: CreateEndpointAccess -> Maybe Text
clusterIdentifier} -> Maybe Text
clusterIdentifier) (\s :: CreateEndpointAccess
s@CreateEndpointAccess' {} Maybe Text
a -> CreateEndpointAccess
s {$sel:clusterIdentifier:CreateEndpointAccess' :: Maybe Text
clusterIdentifier = Maybe Text
a} :: CreateEndpointAccess)
createEndpointAccess_vpcSecurityGroupIds :: Lens.Lens' CreateEndpointAccess (Prelude.Maybe [Prelude.Text])
createEndpointAccess_vpcSecurityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateEndpointAccess -> f CreateEndpointAccess
createEndpointAccess_vpcSecurityGroupIds = (CreateEndpointAccess -> Maybe [Text])
-> (CreateEndpointAccess -> Maybe [Text] -> CreateEndpointAccess)
-> Lens
CreateEndpointAccess
CreateEndpointAccess
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointAccess' {Maybe [Text]
vpcSecurityGroupIds :: Maybe [Text]
$sel:vpcSecurityGroupIds:CreateEndpointAccess' :: CreateEndpointAccess -> Maybe [Text]
vpcSecurityGroupIds} -> Maybe [Text]
vpcSecurityGroupIds) (\s :: CreateEndpointAccess
s@CreateEndpointAccess' {} Maybe [Text]
a -> CreateEndpointAccess
s {$sel:vpcSecurityGroupIds:CreateEndpointAccess' :: Maybe [Text]
vpcSecurityGroupIds = Maybe [Text]
a} :: CreateEndpointAccess) ((Maybe [Text] -> f (Maybe [Text]))
-> CreateEndpointAccess -> f CreateEndpointAccess)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateEndpointAccess
-> f CreateEndpointAccess
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createEndpointAccess_resourceOwner :: Lens.Lens' CreateEndpointAccess (Prelude.Maybe Prelude.Text)
createEndpointAccess_resourceOwner :: (Maybe Text -> f (Maybe Text))
-> CreateEndpointAccess -> f CreateEndpointAccess
createEndpointAccess_resourceOwner = (CreateEndpointAccess -> Maybe Text)
-> (CreateEndpointAccess -> Maybe Text -> CreateEndpointAccess)
-> Lens
CreateEndpointAccess CreateEndpointAccess (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointAccess' {Maybe Text
resourceOwner :: Maybe Text
$sel:resourceOwner:CreateEndpointAccess' :: CreateEndpointAccess -> Maybe Text
resourceOwner} -> Maybe Text
resourceOwner) (\s :: CreateEndpointAccess
s@CreateEndpointAccess' {} Maybe Text
a -> CreateEndpointAccess
s {$sel:resourceOwner:CreateEndpointAccess' :: Maybe Text
resourceOwner = Maybe Text
a} :: CreateEndpointAccess)
createEndpointAccess_endpointName :: Lens.Lens' CreateEndpointAccess Prelude.Text
createEndpointAccess_endpointName :: (Text -> f Text) -> CreateEndpointAccess -> f CreateEndpointAccess
createEndpointAccess_endpointName = (CreateEndpointAccess -> Text)
-> (CreateEndpointAccess -> Text -> CreateEndpointAccess)
-> Lens CreateEndpointAccess CreateEndpointAccess Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointAccess' {Text
endpointName :: Text
$sel:endpointName:CreateEndpointAccess' :: CreateEndpointAccess -> Text
endpointName} -> Text
endpointName) (\s :: CreateEndpointAccess
s@CreateEndpointAccess' {} Text
a -> CreateEndpointAccess
s {$sel:endpointName:CreateEndpointAccess' :: Text
endpointName = Text
a} :: CreateEndpointAccess)
createEndpointAccess_subnetGroupName :: Lens.Lens' CreateEndpointAccess Prelude.Text
createEndpointAccess_subnetGroupName :: (Text -> f Text) -> CreateEndpointAccess -> f CreateEndpointAccess
createEndpointAccess_subnetGroupName = (CreateEndpointAccess -> Text)
-> (CreateEndpointAccess -> Text -> CreateEndpointAccess)
-> Lens CreateEndpointAccess CreateEndpointAccess Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointAccess' {Text
subnetGroupName :: Text
$sel:subnetGroupName:CreateEndpointAccess' :: CreateEndpointAccess -> Text
subnetGroupName} -> Text
subnetGroupName) (\s :: CreateEndpointAccess
s@CreateEndpointAccess' {} Text
a -> CreateEndpointAccess
s {$sel:subnetGroupName:CreateEndpointAccess' :: Text
subnetGroupName = Text
a} :: CreateEndpointAccess)
instance Core.AWSRequest CreateEndpointAccess where
type
AWSResponse CreateEndpointAccess =
EndpointAccess
request :: CreateEndpointAccess -> Request CreateEndpointAccess
request = Service -> CreateEndpointAccess -> Request CreateEndpointAccess
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy CreateEndpointAccess
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateEndpointAccess)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse CreateEndpointAccess))
-> Logger
-> Service
-> Proxy CreateEndpointAccess
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateEndpointAccess)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"CreateEndpointAccessResult"
(\Int
s ResponseHeaders
h [Node]
x -> [Node] -> Either String EndpointAccess
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
instance Prelude.Hashable CreateEndpointAccess
instance Prelude.NFData CreateEndpointAccess
instance Core.ToHeaders CreateEndpointAccess where
toHeaders :: CreateEndpointAccess -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateEndpointAccess -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath CreateEndpointAccess where
toPath :: CreateEndpointAccess -> ByteString
toPath = ByteString -> CreateEndpointAccess -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateEndpointAccess where
toQuery :: CreateEndpointAccess -> QueryString
toQuery CreateEndpointAccess' {Maybe [Text]
Maybe Text
Text
subnetGroupName :: Text
endpointName :: Text
resourceOwner :: Maybe Text
vpcSecurityGroupIds :: Maybe [Text]
clusterIdentifier :: Maybe Text
$sel:subnetGroupName:CreateEndpointAccess' :: CreateEndpointAccess -> Text
$sel:endpointName:CreateEndpointAccess' :: CreateEndpointAccess -> Text
$sel:resourceOwner:CreateEndpointAccess' :: CreateEndpointAccess -> Maybe Text
$sel:vpcSecurityGroupIds:CreateEndpointAccess' :: CreateEndpointAccess -> Maybe [Text]
$sel:clusterIdentifier:CreateEndpointAccess' :: CreateEndpointAccess -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"CreateEndpointAccess" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"ClusterIdentifier" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
clusterIdentifier,
ByteString
"VpcSecurityGroupIds"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"VpcSecurityGroupId"
([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
vpcSecurityGroupIds
),
ByteString
"ResourceOwner" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
resourceOwner,
ByteString
"EndpointName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
endpointName,
ByteString
"SubnetGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
subnetGroupName
]