{-# 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.AddPartner
(
AddPartner (..),
newAddPartner,
addPartner_accountId,
addPartner_clusterIdentifier,
addPartner_databaseName,
addPartner_partnerName,
PartnerIntegrationOutputMessage (..),
newPartnerIntegrationOutputMessage,
partnerIntegrationOutputMessage_partnerName,
partnerIntegrationOutputMessage_databaseName,
)
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 AddPartner = AddPartner'
{
AddPartner -> Text
accountId :: Prelude.Text,
AddPartner -> Text
clusterIdentifier :: Prelude.Text,
AddPartner -> Text
databaseName :: Prelude.Text,
AddPartner -> Text
partnerName :: Prelude.Text
}
deriving (AddPartner -> AddPartner -> Bool
(AddPartner -> AddPartner -> Bool)
-> (AddPartner -> AddPartner -> Bool) -> Eq AddPartner
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddPartner -> AddPartner -> Bool
$c/= :: AddPartner -> AddPartner -> Bool
== :: AddPartner -> AddPartner -> Bool
$c== :: AddPartner -> AddPartner -> Bool
Prelude.Eq, ReadPrec [AddPartner]
ReadPrec AddPartner
Int -> ReadS AddPartner
ReadS [AddPartner]
(Int -> ReadS AddPartner)
-> ReadS [AddPartner]
-> ReadPrec AddPartner
-> ReadPrec [AddPartner]
-> Read AddPartner
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddPartner]
$creadListPrec :: ReadPrec [AddPartner]
readPrec :: ReadPrec AddPartner
$creadPrec :: ReadPrec AddPartner
readList :: ReadS [AddPartner]
$creadList :: ReadS [AddPartner]
readsPrec :: Int -> ReadS AddPartner
$creadsPrec :: Int -> ReadS AddPartner
Prelude.Read, Int -> AddPartner -> ShowS
[AddPartner] -> ShowS
AddPartner -> String
(Int -> AddPartner -> ShowS)
-> (AddPartner -> String)
-> ([AddPartner] -> ShowS)
-> Show AddPartner
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddPartner] -> ShowS
$cshowList :: [AddPartner] -> ShowS
show :: AddPartner -> String
$cshow :: AddPartner -> String
showsPrec :: Int -> AddPartner -> ShowS
$cshowsPrec :: Int -> AddPartner -> ShowS
Prelude.Show, (forall x. AddPartner -> Rep AddPartner x)
-> (forall x. Rep AddPartner x -> AddPartner) -> Generic AddPartner
forall x. Rep AddPartner x -> AddPartner
forall x. AddPartner -> Rep AddPartner x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddPartner x -> AddPartner
$cfrom :: forall x. AddPartner -> Rep AddPartner x
Prelude.Generic)
newAddPartner ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
AddPartner
newAddPartner :: Text -> Text -> Text -> Text -> AddPartner
newAddPartner
Text
pAccountId_
Text
pClusterIdentifier_
Text
pDatabaseName_
Text
pPartnerName_ =
AddPartner' :: Text -> Text -> Text -> Text -> AddPartner
AddPartner'
{ $sel:accountId:AddPartner' :: Text
accountId = Text
pAccountId_,
$sel:clusterIdentifier:AddPartner' :: Text
clusterIdentifier = Text
pClusterIdentifier_,
$sel:databaseName:AddPartner' :: Text
databaseName = Text
pDatabaseName_,
$sel:partnerName:AddPartner' :: Text
partnerName = Text
pPartnerName_
}
addPartner_accountId :: Lens.Lens' AddPartner Prelude.Text
addPartner_accountId :: (Text -> f Text) -> AddPartner -> f AddPartner
addPartner_accountId = (AddPartner -> Text)
-> (AddPartner -> Text -> AddPartner)
-> Lens AddPartner AddPartner Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddPartner' {Text
accountId :: Text
$sel:accountId:AddPartner' :: AddPartner -> Text
accountId} -> Text
accountId) (\s :: AddPartner
s@AddPartner' {} Text
a -> AddPartner
s {$sel:accountId:AddPartner' :: Text
accountId = Text
a} :: AddPartner)
addPartner_clusterIdentifier :: Lens.Lens' AddPartner Prelude.Text
addPartner_clusterIdentifier :: (Text -> f Text) -> AddPartner -> f AddPartner
addPartner_clusterIdentifier = (AddPartner -> Text)
-> (AddPartner -> Text -> AddPartner)
-> Lens AddPartner AddPartner Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddPartner' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:AddPartner' :: AddPartner -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: AddPartner
s@AddPartner' {} Text
a -> AddPartner
s {$sel:clusterIdentifier:AddPartner' :: Text
clusterIdentifier = Text
a} :: AddPartner)
addPartner_databaseName :: Lens.Lens' AddPartner Prelude.Text
addPartner_databaseName :: (Text -> f Text) -> AddPartner -> f AddPartner
addPartner_databaseName = (AddPartner -> Text)
-> (AddPartner -> Text -> AddPartner)
-> Lens AddPartner AddPartner Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddPartner' {Text
databaseName :: Text
$sel:databaseName:AddPartner' :: AddPartner -> Text
databaseName} -> Text
databaseName) (\s :: AddPartner
s@AddPartner' {} Text
a -> AddPartner
s {$sel:databaseName:AddPartner' :: Text
databaseName = Text
a} :: AddPartner)
addPartner_partnerName :: Lens.Lens' AddPartner Prelude.Text
addPartner_partnerName :: (Text -> f Text) -> AddPartner -> f AddPartner
addPartner_partnerName = (AddPartner -> Text)
-> (AddPartner -> Text -> AddPartner)
-> Lens AddPartner AddPartner Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddPartner' {Text
partnerName :: Text
$sel:partnerName:AddPartner' :: AddPartner -> Text
partnerName} -> Text
partnerName) (\s :: AddPartner
s@AddPartner' {} Text
a -> AddPartner
s {$sel:partnerName:AddPartner' :: Text
partnerName = Text
a} :: AddPartner)
instance Core.AWSRequest AddPartner where
type
AWSResponse AddPartner =
PartnerIntegrationOutputMessage
request :: AddPartner -> Request AddPartner
request = Service -> AddPartner -> Request AddPartner
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy AddPartner
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AddPartner)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse AddPartner))
-> Logger
-> Service
-> Proxy AddPartner
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AddPartner)))
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
"AddPartnerResult"
(\Int
s ResponseHeaders
h [Node]
x -> [Node] -> Either String PartnerIntegrationOutputMessage
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
instance Prelude.Hashable AddPartner
instance Prelude.NFData AddPartner
instance Core.ToHeaders AddPartner where
toHeaders :: AddPartner -> ResponseHeaders
toHeaders = ResponseHeaders -> AddPartner -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath AddPartner where
toPath :: AddPartner -> ByteString
toPath = ByteString -> AddPartner -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AddPartner where
toQuery :: AddPartner -> QueryString
toQuery AddPartner' {Text
partnerName :: Text
databaseName :: Text
clusterIdentifier :: Text
accountId :: Text
$sel:partnerName:AddPartner' :: AddPartner -> Text
$sel:databaseName:AddPartner' :: AddPartner -> Text
$sel:clusterIdentifier:AddPartner' :: AddPartner -> Text
$sel:accountId:AddPartner' :: AddPartner -> 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
"AddPartner" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"AccountId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
accountId,
ByteString
"ClusterIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
clusterIdentifier,
ByteString
"DatabaseName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
databaseName,
ByteString
"PartnerName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
partnerName
]