{-# 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.AuthorizeDataShare
(
AuthorizeDataShare (..),
newAuthorizeDataShare,
authorizeDataShare_dataShareArn,
authorizeDataShare_consumerIdentifier,
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 AuthorizeDataShare = AuthorizeDataShare'
{
AuthorizeDataShare -> Text
dataShareArn :: Prelude.Text,
AuthorizeDataShare -> Text
consumerIdentifier :: Prelude.Text
}
deriving (AuthorizeDataShare -> AuthorizeDataShare -> Bool
(AuthorizeDataShare -> AuthorizeDataShare -> Bool)
-> (AuthorizeDataShare -> AuthorizeDataShare -> Bool)
-> Eq AuthorizeDataShare
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuthorizeDataShare -> AuthorizeDataShare -> Bool
$c/= :: AuthorizeDataShare -> AuthorizeDataShare -> Bool
== :: AuthorizeDataShare -> AuthorizeDataShare -> Bool
$c== :: AuthorizeDataShare -> AuthorizeDataShare -> Bool
Prelude.Eq, ReadPrec [AuthorizeDataShare]
ReadPrec AuthorizeDataShare
Int -> ReadS AuthorizeDataShare
ReadS [AuthorizeDataShare]
(Int -> ReadS AuthorizeDataShare)
-> ReadS [AuthorizeDataShare]
-> ReadPrec AuthorizeDataShare
-> ReadPrec [AuthorizeDataShare]
-> Read AuthorizeDataShare
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AuthorizeDataShare]
$creadListPrec :: ReadPrec [AuthorizeDataShare]
readPrec :: ReadPrec AuthorizeDataShare
$creadPrec :: ReadPrec AuthorizeDataShare
readList :: ReadS [AuthorizeDataShare]
$creadList :: ReadS [AuthorizeDataShare]
readsPrec :: Int -> ReadS AuthorizeDataShare
$creadsPrec :: Int -> ReadS AuthorizeDataShare
Prelude.Read, Int -> AuthorizeDataShare -> ShowS
[AuthorizeDataShare] -> ShowS
AuthorizeDataShare -> String
(Int -> AuthorizeDataShare -> ShowS)
-> (AuthorizeDataShare -> String)
-> ([AuthorizeDataShare] -> ShowS)
-> Show AuthorizeDataShare
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuthorizeDataShare] -> ShowS
$cshowList :: [AuthorizeDataShare] -> ShowS
show :: AuthorizeDataShare -> String
$cshow :: AuthorizeDataShare -> String
showsPrec :: Int -> AuthorizeDataShare -> ShowS
$cshowsPrec :: Int -> AuthorizeDataShare -> ShowS
Prelude.Show, (forall x. AuthorizeDataShare -> Rep AuthorizeDataShare x)
-> (forall x. Rep AuthorizeDataShare x -> AuthorizeDataShare)
-> Generic AuthorizeDataShare
forall x. Rep AuthorizeDataShare x -> AuthorizeDataShare
forall x. AuthorizeDataShare -> Rep AuthorizeDataShare x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AuthorizeDataShare x -> AuthorizeDataShare
$cfrom :: forall x. AuthorizeDataShare -> Rep AuthorizeDataShare x
Prelude.Generic)
newAuthorizeDataShare ::
Prelude.Text ->
Prelude.Text ->
AuthorizeDataShare
newAuthorizeDataShare :: Text -> Text -> AuthorizeDataShare
newAuthorizeDataShare
Text
pDataShareArn_
Text
pConsumerIdentifier_ =
AuthorizeDataShare' :: Text -> Text -> AuthorizeDataShare
AuthorizeDataShare'
{ $sel:dataShareArn:AuthorizeDataShare' :: Text
dataShareArn = Text
pDataShareArn_,
$sel:consumerIdentifier:AuthorizeDataShare' :: Text
consumerIdentifier = Text
pConsumerIdentifier_
}
authorizeDataShare_dataShareArn :: Lens.Lens' AuthorizeDataShare Prelude.Text
authorizeDataShare_dataShareArn :: (Text -> f Text) -> AuthorizeDataShare -> f AuthorizeDataShare
authorizeDataShare_dataShareArn = (AuthorizeDataShare -> Text)
-> (AuthorizeDataShare -> Text -> AuthorizeDataShare)
-> Lens AuthorizeDataShare AuthorizeDataShare Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthorizeDataShare' {Text
dataShareArn :: Text
$sel:dataShareArn:AuthorizeDataShare' :: AuthorizeDataShare -> Text
dataShareArn} -> Text
dataShareArn) (\s :: AuthorizeDataShare
s@AuthorizeDataShare' {} Text
a -> AuthorizeDataShare
s {$sel:dataShareArn:AuthorizeDataShare' :: Text
dataShareArn = Text
a} :: AuthorizeDataShare)
authorizeDataShare_consumerIdentifier :: Lens.Lens' AuthorizeDataShare Prelude.Text
authorizeDataShare_consumerIdentifier :: (Text -> f Text) -> AuthorizeDataShare -> f AuthorizeDataShare
authorizeDataShare_consumerIdentifier = (AuthorizeDataShare -> Text)
-> (AuthorizeDataShare -> Text -> AuthorizeDataShare)
-> Lens AuthorizeDataShare AuthorizeDataShare Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthorizeDataShare' {Text
consumerIdentifier :: Text
$sel:consumerIdentifier:AuthorizeDataShare' :: AuthorizeDataShare -> Text
consumerIdentifier} -> Text
consumerIdentifier) (\s :: AuthorizeDataShare
s@AuthorizeDataShare' {} Text
a -> AuthorizeDataShare
s {$sel:consumerIdentifier:AuthorizeDataShare' :: Text
consumerIdentifier = Text
a} :: AuthorizeDataShare)
instance Core.AWSRequest AuthorizeDataShare where
type AWSResponse AuthorizeDataShare = DataShare
request :: AuthorizeDataShare -> Request AuthorizeDataShare
request = Service -> AuthorizeDataShare -> Request AuthorizeDataShare
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy AuthorizeDataShare
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AuthorizeDataShare)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse AuthorizeDataShare))
-> Logger
-> Service
-> Proxy AuthorizeDataShare
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AuthorizeDataShare)))
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
"AuthorizeDataShareResult"
(\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 AuthorizeDataShare
instance Prelude.NFData AuthorizeDataShare
instance Core.ToHeaders AuthorizeDataShare where
toHeaders :: AuthorizeDataShare -> ResponseHeaders
toHeaders = ResponseHeaders -> AuthorizeDataShare -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath AuthorizeDataShare where
toPath :: AuthorizeDataShare -> ByteString
toPath = ByteString -> AuthorizeDataShare -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AuthorizeDataShare where
toQuery :: AuthorizeDataShare -> QueryString
toQuery AuthorizeDataShare' {Text
consumerIdentifier :: Text
dataShareArn :: Text
$sel:consumerIdentifier:AuthorizeDataShare' :: AuthorizeDataShare -> Text
$sel:dataShareArn:AuthorizeDataShare' :: AuthorizeDataShare -> 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
"AuthorizeDataShare" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"DataShareArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dataShareArn,
ByteString
"ConsumerIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
consumerIdentifier
]