{-# 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.DisassociateDataShareConsumer
(
DisassociateDataShareConsumer (..),
newDisassociateDataShareConsumer,
disassociateDataShareConsumer_disassociateEntireAccount,
disassociateDataShareConsumer_consumerArn,
disassociateDataShareConsumer_dataShareArn,
DataShare (..),
newDataShare,
dataShare_producerArn,
dataShare_dataShareAssociations,
dataShare_dataShareArn,
dataShare_allowPubliclyAccessibleConsumers,
)
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 DisassociateDataShareConsumer = DisassociateDataShareConsumer'
{
DisassociateDataShareConsumer -> Maybe Bool
disassociateEntireAccount :: Prelude.Maybe Prelude.Bool,
DisassociateDataShareConsumer -> Maybe Text
consumerArn :: Prelude.Maybe Prelude.Text,
DisassociateDataShareConsumer -> Text
dataShareArn :: Prelude.Text
}
deriving (DisassociateDataShareConsumer
-> DisassociateDataShareConsumer -> Bool
(DisassociateDataShareConsumer
-> DisassociateDataShareConsumer -> Bool)
-> (DisassociateDataShareConsumer
-> DisassociateDataShareConsumer -> Bool)
-> Eq DisassociateDataShareConsumer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateDataShareConsumer
-> DisassociateDataShareConsumer -> Bool
$c/= :: DisassociateDataShareConsumer
-> DisassociateDataShareConsumer -> Bool
== :: DisassociateDataShareConsumer
-> DisassociateDataShareConsumer -> Bool
$c== :: DisassociateDataShareConsumer
-> DisassociateDataShareConsumer -> Bool
Prelude.Eq, ReadPrec [DisassociateDataShareConsumer]
ReadPrec DisassociateDataShareConsumer
Int -> ReadS DisassociateDataShareConsumer
ReadS [DisassociateDataShareConsumer]
(Int -> ReadS DisassociateDataShareConsumer)
-> ReadS [DisassociateDataShareConsumer]
-> ReadPrec DisassociateDataShareConsumer
-> ReadPrec [DisassociateDataShareConsumer]
-> Read DisassociateDataShareConsumer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateDataShareConsumer]
$creadListPrec :: ReadPrec [DisassociateDataShareConsumer]
readPrec :: ReadPrec DisassociateDataShareConsumer
$creadPrec :: ReadPrec DisassociateDataShareConsumer
readList :: ReadS [DisassociateDataShareConsumer]
$creadList :: ReadS [DisassociateDataShareConsumer]
readsPrec :: Int -> ReadS DisassociateDataShareConsumer
$creadsPrec :: Int -> ReadS DisassociateDataShareConsumer
Prelude.Read, Int -> DisassociateDataShareConsumer -> ShowS
[DisassociateDataShareConsumer] -> ShowS
DisassociateDataShareConsumer -> String
(Int -> DisassociateDataShareConsumer -> ShowS)
-> (DisassociateDataShareConsumer -> String)
-> ([DisassociateDataShareConsumer] -> ShowS)
-> Show DisassociateDataShareConsumer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateDataShareConsumer] -> ShowS
$cshowList :: [DisassociateDataShareConsumer] -> ShowS
show :: DisassociateDataShareConsumer -> String
$cshow :: DisassociateDataShareConsumer -> String
showsPrec :: Int -> DisassociateDataShareConsumer -> ShowS
$cshowsPrec :: Int -> DisassociateDataShareConsumer -> ShowS
Prelude.Show, (forall x.
DisassociateDataShareConsumer
-> Rep DisassociateDataShareConsumer x)
-> (forall x.
Rep DisassociateDataShareConsumer x
-> DisassociateDataShareConsumer)
-> Generic DisassociateDataShareConsumer
forall x.
Rep DisassociateDataShareConsumer x
-> DisassociateDataShareConsumer
forall x.
DisassociateDataShareConsumer
-> Rep DisassociateDataShareConsumer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateDataShareConsumer x
-> DisassociateDataShareConsumer
$cfrom :: forall x.
DisassociateDataShareConsumer
-> Rep DisassociateDataShareConsumer x
Prelude.Generic)
newDisassociateDataShareConsumer ::
Prelude.Text ->
DisassociateDataShareConsumer
newDisassociateDataShareConsumer :: Text -> DisassociateDataShareConsumer
newDisassociateDataShareConsumer Text
pDataShareArn_ =
DisassociateDataShareConsumer' :: Maybe Bool -> Maybe Text -> Text -> DisassociateDataShareConsumer
DisassociateDataShareConsumer'
{ $sel:disassociateEntireAccount:DisassociateDataShareConsumer' :: Maybe Bool
disassociateEntireAccount =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:consumerArn:DisassociateDataShareConsumer' :: Maybe Text
consumerArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dataShareArn:DisassociateDataShareConsumer' :: Text
dataShareArn = Text
pDataShareArn_
}
disassociateDataShareConsumer_disassociateEntireAccount :: Lens.Lens' DisassociateDataShareConsumer (Prelude.Maybe Prelude.Bool)
disassociateDataShareConsumer_disassociateEntireAccount :: (Maybe Bool -> f (Maybe Bool))
-> DisassociateDataShareConsumer -> f DisassociateDataShareConsumer
disassociateDataShareConsumer_disassociateEntireAccount = (DisassociateDataShareConsumer -> Maybe Bool)
-> (DisassociateDataShareConsumer
-> Maybe Bool -> DisassociateDataShareConsumer)
-> Lens
DisassociateDataShareConsumer
DisassociateDataShareConsumer
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateDataShareConsumer' {Maybe Bool
disassociateEntireAccount :: Maybe Bool
$sel:disassociateEntireAccount:DisassociateDataShareConsumer' :: DisassociateDataShareConsumer -> Maybe Bool
disassociateEntireAccount} -> Maybe Bool
disassociateEntireAccount) (\s :: DisassociateDataShareConsumer
s@DisassociateDataShareConsumer' {} Maybe Bool
a -> DisassociateDataShareConsumer
s {$sel:disassociateEntireAccount:DisassociateDataShareConsumer' :: Maybe Bool
disassociateEntireAccount = Maybe Bool
a} :: DisassociateDataShareConsumer)
disassociateDataShareConsumer_consumerArn :: Lens.Lens' DisassociateDataShareConsumer (Prelude.Maybe Prelude.Text)
disassociateDataShareConsumer_consumerArn :: (Maybe Text -> f (Maybe Text))
-> DisassociateDataShareConsumer -> f DisassociateDataShareConsumer
disassociateDataShareConsumer_consumerArn = (DisassociateDataShareConsumer -> Maybe Text)
-> (DisassociateDataShareConsumer
-> Maybe Text -> DisassociateDataShareConsumer)
-> Lens
DisassociateDataShareConsumer
DisassociateDataShareConsumer
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateDataShareConsumer' {Maybe Text
consumerArn :: Maybe Text
$sel:consumerArn:DisassociateDataShareConsumer' :: DisassociateDataShareConsumer -> Maybe Text
consumerArn} -> Maybe Text
consumerArn) (\s :: DisassociateDataShareConsumer
s@DisassociateDataShareConsumer' {} Maybe Text
a -> DisassociateDataShareConsumer
s {$sel:consumerArn:DisassociateDataShareConsumer' :: Maybe Text
consumerArn = Maybe Text
a} :: DisassociateDataShareConsumer)
disassociateDataShareConsumer_dataShareArn :: Lens.Lens' DisassociateDataShareConsumer Prelude.Text
disassociateDataShareConsumer_dataShareArn :: (Text -> f Text)
-> DisassociateDataShareConsumer -> f DisassociateDataShareConsumer
disassociateDataShareConsumer_dataShareArn = (DisassociateDataShareConsumer -> Text)
-> (DisassociateDataShareConsumer
-> Text -> DisassociateDataShareConsumer)
-> Lens
DisassociateDataShareConsumer
DisassociateDataShareConsumer
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateDataShareConsumer' {Text
dataShareArn :: Text
$sel:dataShareArn:DisassociateDataShareConsumer' :: DisassociateDataShareConsumer -> Text
dataShareArn} -> Text
dataShareArn) (\s :: DisassociateDataShareConsumer
s@DisassociateDataShareConsumer' {} Text
a -> DisassociateDataShareConsumer
s {$sel:dataShareArn:DisassociateDataShareConsumer' :: Text
dataShareArn = Text
a} :: DisassociateDataShareConsumer)
instance
Core.AWSRequest
DisassociateDataShareConsumer
where
type
AWSResponse DisassociateDataShareConsumer =
DataShare
request :: DisassociateDataShareConsumer
-> Request DisassociateDataShareConsumer
request = Service
-> DisassociateDataShareConsumer
-> Request DisassociateDataShareConsumer
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DisassociateDataShareConsumer
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateDataShareConsumer)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DisassociateDataShareConsumer))
-> Logger
-> Service
-> Proxy DisassociateDataShareConsumer
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateDataShareConsumer)))
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
"DisassociateDataShareConsumerResult"
(\Int
s ResponseHeaders
h [Node]
x -> [Node] -> Either String DataShare
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
instance
Prelude.Hashable
DisassociateDataShareConsumer
instance Prelude.NFData DisassociateDataShareConsumer
instance Core.ToHeaders DisassociateDataShareConsumer where
toHeaders :: DisassociateDataShareConsumer -> ResponseHeaders
toHeaders = ResponseHeaders -> DisassociateDataShareConsumer -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DisassociateDataShareConsumer where
toPath :: DisassociateDataShareConsumer -> ByteString
toPath = ByteString -> DisassociateDataShareConsumer -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DisassociateDataShareConsumer where
toQuery :: DisassociateDataShareConsumer -> QueryString
toQuery DisassociateDataShareConsumer' {Maybe Bool
Maybe Text
Text
dataShareArn :: Text
consumerArn :: Maybe Text
disassociateEntireAccount :: Maybe Bool
$sel:dataShareArn:DisassociateDataShareConsumer' :: DisassociateDataShareConsumer -> Text
$sel:consumerArn:DisassociateDataShareConsumer' :: DisassociateDataShareConsumer -> Maybe Text
$sel:disassociateEntireAccount:DisassociateDataShareConsumer' :: DisassociateDataShareConsumer -> Maybe Bool
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"DisassociateDataShareConsumer" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"DisassociateEntireAccount"
ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
disassociateEntireAccount,
ByteString
"ConsumerArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
consumerArn,
ByteString
"DataShareArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dataShareArn
]