{-# 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.DeletePartner
(
DeletePartner (..),
newDeletePartner,
deletePartner_accountId,
deletePartner_clusterIdentifier,
deletePartner_databaseName,
deletePartner_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 DeletePartner = DeletePartner'
{
DeletePartner -> Text
accountId :: Prelude.Text,
DeletePartner -> Text
clusterIdentifier :: Prelude.Text,
DeletePartner -> Text
databaseName :: Prelude.Text,
DeletePartner -> Text
partnerName :: Prelude.Text
}
deriving (DeletePartner -> DeletePartner -> Bool
(DeletePartner -> DeletePartner -> Bool)
-> (DeletePartner -> DeletePartner -> Bool) -> Eq DeletePartner
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePartner -> DeletePartner -> Bool
$c/= :: DeletePartner -> DeletePartner -> Bool
== :: DeletePartner -> DeletePartner -> Bool
$c== :: DeletePartner -> DeletePartner -> Bool
Prelude.Eq, ReadPrec [DeletePartner]
ReadPrec DeletePartner
Int -> ReadS DeletePartner
ReadS [DeletePartner]
(Int -> ReadS DeletePartner)
-> ReadS [DeletePartner]
-> ReadPrec DeletePartner
-> ReadPrec [DeletePartner]
-> Read DeletePartner
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePartner]
$creadListPrec :: ReadPrec [DeletePartner]
readPrec :: ReadPrec DeletePartner
$creadPrec :: ReadPrec DeletePartner
readList :: ReadS [DeletePartner]
$creadList :: ReadS [DeletePartner]
readsPrec :: Int -> ReadS DeletePartner
$creadsPrec :: Int -> ReadS DeletePartner
Prelude.Read, Int -> DeletePartner -> ShowS
[DeletePartner] -> ShowS
DeletePartner -> String
(Int -> DeletePartner -> ShowS)
-> (DeletePartner -> String)
-> ([DeletePartner] -> ShowS)
-> Show DeletePartner
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePartner] -> ShowS
$cshowList :: [DeletePartner] -> ShowS
show :: DeletePartner -> String
$cshow :: DeletePartner -> String
showsPrec :: Int -> DeletePartner -> ShowS
$cshowsPrec :: Int -> DeletePartner -> ShowS
Prelude.Show, (forall x. DeletePartner -> Rep DeletePartner x)
-> (forall x. Rep DeletePartner x -> DeletePartner)
-> Generic DeletePartner
forall x. Rep DeletePartner x -> DeletePartner
forall x. DeletePartner -> Rep DeletePartner x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeletePartner x -> DeletePartner
$cfrom :: forall x. DeletePartner -> Rep DeletePartner x
Prelude.Generic)
newDeletePartner ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DeletePartner
newDeletePartner :: Text -> Text -> Text -> Text -> DeletePartner
newDeletePartner
Text
pAccountId_
Text
pClusterIdentifier_
Text
pDatabaseName_
Text
pPartnerName_ =
DeletePartner' :: Text -> Text -> Text -> Text -> DeletePartner
DeletePartner'
{ $sel:accountId:DeletePartner' :: Text
accountId = Text
pAccountId_,
$sel:clusterIdentifier:DeletePartner' :: Text
clusterIdentifier = Text
pClusterIdentifier_,
$sel:databaseName:DeletePartner' :: Text
databaseName = Text
pDatabaseName_,
$sel:partnerName:DeletePartner' :: Text
partnerName = Text
pPartnerName_
}
deletePartner_accountId :: Lens.Lens' DeletePartner Prelude.Text
deletePartner_accountId :: (Text -> f Text) -> DeletePartner -> f DeletePartner
deletePartner_accountId = (DeletePartner -> Text)
-> (DeletePartner -> Text -> DeletePartner)
-> Lens DeletePartner DeletePartner Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePartner' {Text
accountId :: Text
$sel:accountId:DeletePartner' :: DeletePartner -> Text
accountId} -> Text
accountId) (\s :: DeletePartner
s@DeletePartner' {} Text
a -> DeletePartner
s {$sel:accountId:DeletePartner' :: Text
accountId = Text
a} :: DeletePartner)
deletePartner_clusterIdentifier :: Lens.Lens' DeletePartner Prelude.Text
deletePartner_clusterIdentifier :: (Text -> f Text) -> DeletePartner -> f DeletePartner
deletePartner_clusterIdentifier = (DeletePartner -> Text)
-> (DeletePartner -> Text -> DeletePartner)
-> Lens DeletePartner DeletePartner Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePartner' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:DeletePartner' :: DeletePartner -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: DeletePartner
s@DeletePartner' {} Text
a -> DeletePartner
s {$sel:clusterIdentifier:DeletePartner' :: Text
clusterIdentifier = Text
a} :: DeletePartner)
deletePartner_databaseName :: Lens.Lens' DeletePartner Prelude.Text
deletePartner_databaseName :: (Text -> f Text) -> DeletePartner -> f DeletePartner
deletePartner_databaseName = (DeletePartner -> Text)
-> (DeletePartner -> Text -> DeletePartner)
-> Lens DeletePartner DeletePartner Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePartner' {Text
databaseName :: Text
$sel:databaseName:DeletePartner' :: DeletePartner -> Text
databaseName} -> Text
databaseName) (\s :: DeletePartner
s@DeletePartner' {} Text
a -> DeletePartner
s {$sel:databaseName:DeletePartner' :: Text
databaseName = Text
a} :: DeletePartner)
deletePartner_partnerName :: Lens.Lens' DeletePartner Prelude.Text
deletePartner_partnerName :: (Text -> f Text) -> DeletePartner -> f DeletePartner
deletePartner_partnerName = (DeletePartner -> Text)
-> (DeletePartner -> Text -> DeletePartner)
-> Lens DeletePartner DeletePartner Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePartner' {Text
partnerName :: Text
$sel:partnerName:DeletePartner' :: DeletePartner -> Text
partnerName} -> Text
partnerName) (\s :: DeletePartner
s@DeletePartner' {} Text
a -> DeletePartner
s {$sel:partnerName:DeletePartner' :: Text
partnerName = Text
a} :: DeletePartner)
instance Core.AWSRequest DeletePartner where
type
AWSResponse DeletePartner =
PartnerIntegrationOutputMessage
request :: DeletePartner -> Request DeletePartner
request = Service -> DeletePartner -> Request DeletePartner
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeletePartner
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeletePartner)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DeletePartner))
-> Logger
-> Service
-> Proxy DeletePartner
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeletePartner)))
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
"DeletePartnerResult"
(\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 DeletePartner
instance Prelude.NFData DeletePartner
instance Core.ToHeaders DeletePartner where
toHeaders :: DeletePartner -> ResponseHeaders
toHeaders = ResponseHeaders -> DeletePartner -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeletePartner where
toPath :: DeletePartner -> ByteString
toPath = ByteString -> DeletePartner -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeletePartner where
toQuery :: DeletePartner -> QueryString
toQuery DeletePartner' {Text
partnerName :: Text
databaseName :: Text
clusterIdentifier :: Text
accountId :: Text
$sel:partnerName:DeletePartner' :: DeletePartner -> Text
$sel:databaseName:DeletePartner' :: DeletePartner -> Text
$sel:clusterIdentifier:DeletePartner' :: DeletePartner -> Text
$sel:accountId:DeletePartner' :: DeletePartner -> 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
"DeletePartner" :: 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
]