{-# 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.DescribePartners
(
DescribePartners (..),
newDescribePartners,
describePartners_partnerName,
describePartners_databaseName,
describePartners_accountId,
describePartners_clusterIdentifier,
DescribePartnersResponse (..),
newDescribePartnersResponse,
describePartnersResponse_partnerIntegrationInfoList,
describePartnersResponse_httpStatus,
)
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 DescribePartners = DescribePartners'
{
DescribePartners -> Maybe Text
partnerName :: Prelude.Maybe Prelude.Text,
DescribePartners -> Maybe Text
databaseName :: Prelude.Maybe Prelude.Text,
DescribePartners -> Text
accountId :: Prelude.Text,
DescribePartners -> Text
clusterIdentifier :: Prelude.Text
}
deriving (DescribePartners -> DescribePartners -> Bool
(DescribePartners -> DescribePartners -> Bool)
-> (DescribePartners -> DescribePartners -> Bool)
-> Eq DescribePartners
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePartners -> DescribePartners -> Bool
$c/= :: DescribePartners -> DescribePartners -> Bool
== :: DescribePartners -> DescribePartners -> Bool
$c== :: DescribePartners -> DescribePartners -> Bool
Prelude.Eq, ReadPrec [DescribePartners]
ReadPrec DescribePartners
Int -> ReadS DescribePartners
ReadS [DescribePartners]
(Int -> ReadS DescribePartners)
-> ReadS [DescribePartners]
-> ReadPrec DescribePartners
-> ReadPrec [DescribePartners]
-> Read DescribePartners
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePartners]
$creadListPrec :: ReadPrec [DescribePartners]
readPrec :: ReadPrec DescribePartners
$creadPrec :: ReadPrec DescribePartners
readList :: ReadS [DescribePartners]
$creadList :: ReadS [DescribePartners]
readsPrec :: Int -> ReadS DescribePartners
$creadsPrec :: Int -> ReadS DescribePartners
Prelude.Read, Int -> DescribePartners -> ShowS
[DescribePartners] -> ShowS
DescribePartners -> String
(Int -> DescribePartners -> ShowS)
-> (DescribePartners -> String)
-> ([DescribePartners] -> ShowS)
-> Show DescribePartners
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePartners] -> ShowS
$cshowList :: [DescribePartners] -> ShowS
show :: DescribePartners -> String
$cshow :: DescribePartners -> String
showsPrec :: Int -> DescribePartners -> ShowS
$cshowsPrec :: Int -> DescribePartners -> ShowS
Prelude.Show, (forall x. DescribePartners -> Rep DescribePartners x)
-> (forall x. Rep DescribePartners x -> DescribePartners)
-> Generic DescribePartners
forall x. Rep DescribePartners x -> DescribePartners
forall x. DescribePartners -> Rep DescribePartners x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribePartners x -> DescribePartners
$cfrom :: forall x. DescribePartners -> Rep DescribePartners x
Prelude.Generic)
newDescribePartners ::
Prelude.Text ->
Prelude.Text ->
DescribePartners
newDescribePartners :: Text -> Text -> DescribePartners
newDescribePartners Text
pAccountId_ Text
pClusterIdentifier_ =
DescribePartners' :: Maybe Text -> Maybe Text -> Text -> Text -> DescribePartners
DescribePartners'
{ $sel:partnerName:DescribePartners' :: Maybe Text
partnerName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:databaseName:DescribePartners' :: Maybe Text
databaseName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:DescribePartners' :: Text
accountId = Text
pAccountId_,
$sel:clusterIdentifier:DescribePartners' :: Text
clusterIdentifier = Text
pClusterIdentifier_
}
describePartners_partnerName :: Lens.Lens' DescribePartners (Prelude.Maybe Prelude.Text)
describePartners_partnerName :: (Maybe Text -> f (Maybe Text))
-> DescribePartners -> f DescribePartners
describePartners_partnerName = (DescribePartners -> Maybe Text)
-> (DescribePartners -> Maybe Text -> DescribePartners)
-> Lens DescribePartners DescribePartners (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePartners' {Maybe Text
partnerName :: Maybe Text
$sel:partnerName:DescribePartners' :: DescribePartners -> Maybe Text
partnerName} -> Maybe Text
partnerName) (\s :: DescribePartners
s@DescribePartners' {} Maybe Text
a -> DescribePartners
s {$sel:partnerName:DescribePartners' :: Maybe Text
partnerName = Maybe Text
a} :: DescribePartners)
describePartners_databaseName :: Lens.Lens' DescribePartners (Prelude.Maybe Prelude.Text)
describePartners_databaseName :: (Maybe Text -> f (Maybe Text))
-> DescribePartners -> f DescribePartners
describePartners_databaseName = (DescribePartners -> Maybe Text)
-> (DescribePartners -> Maybe Text -> DescribePartners)
-> Lens DescribePartners DescribePartners (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePartners' {Maybe Text
databaseName :: Maybe Text
$sel:databaseName:DescribePartners' :: DescribePartners -> Maybe Text
databaseName} -> Maybe Text
databaseName) (\s :: DescribePartners
s@DescribePartners' {} Maybe Text
a -> DescribePartners
s {$sel:databaseName:DescribePartners' :: Maybe Text
databaseName = Maybe Text
a} :: DescribePartners)
describePartners_accountId :: Lens.Lens' DescribePartners Prelude.Text
describePartners_accountId :: (Text -> f Text) -> DescribePartners -> f DescribePartners
describePartners_accountId = (DescribePartners -> Text)
-> (DescribePartners -> Text -> DescribePartners)
-> Lens DescribePartners DescribePartners Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePartners' {Text
accountId :: Text
$sel:accountId:DescribePartners' :: DescribePartners -> Text
accountId} -> Text
accountId) (\s :: DescribePartners
s@DescribePartners' {} Text
a -> DescribePartners
s {$sel:accountId:DescribePartners' :: Text
accountId = Text
a} :: DescribePartners)
describePartners_clusterIdentifier :: Lens.Lens' DescribePartners Prelude.Text
describePartners_clusterIdentifier :: (Text -> f Text) -> DescribePartners -> f DescribePartners
describePartners_clusterIdentifier = (DescribePartners -> Text)
-> (DescribePartners -> Text -> DescribePartners)
-> Lens DescribePartners DescribePartners Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePartners' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:DescribePartners' :: DescribePartners -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: DescribePartners
s@DescribePartners' {} Text
a -> DescribePartners
s {$sel:clusterIdentifier:DescribePartners' :: Text
clusterIdentifier = Text
a} :: DescribePartners)
instance Core.AWSRequest DescribePartners where
type
AWSResponse DescribePartners =
DescribePartnersResponse
request :: DescribePartners -> Request DescribePartners
request = Service -> DescribePartners -> Request DescribePartners
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DescribePartners
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribePartners)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DescribePartners))
-> Logger
-> Service
-> Proxy DescribePartners
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribePartners)))
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
"DescribePartnersResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe [PartnerIntegrationInfo] -> Int -> DescribePartnersResponse
DescribePartnersResponse'
(Maybe [PartnerIntegrationInfo] -> Int -> DescribePartnersResponse)
-> Either String (Maybe [PartnerIntegrationInfo])
-> Either String (Int -> DescribePartnersResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PartnerIntegrationInfoList"
Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [PartnerIntegrationInfo]))
-> Either String (Maybe [PartnerIntegrationInfo])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [PartnerIntegrationInfo])
-> [Node] -> Either String (Maybe [PartnerIntegrationInfo])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
(Text -> [Node] -> Either String [PartnerIntegrationInfo]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"PartnerIntegrationInfo")
)
Either String (Int -> DescribePartnersResponse)
-> Either String Int -> Either String DescribePartnersResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribePartners
instance Prelude.NFData DescribePartners
instance Core.ToHeaders DescribePartners where
toHeaders :: DescribePartners -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribePartners -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribePartners where
toPath :: DescribePartners -> ByteString
toPath = ByteString -> DescribePartners -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribePartners where
toQuery :: DescribePartners -> QueryString
toQuery DescribePartners' {Maybe Text
Text
clusterIdentifier :: Text
accountId :: Text
databaseName :: Maybe Text
partnerName :: Maybe Text
$sel:clusterIdentifier:DescribePartners' :: DescribePartners -> Text
$sel:accountId:DescribePartners' :: DescribePartners -> Text
$sel:databaseName:DescribePartners' :: DescribePartners -> Maybe Text
$sel:partnerName:DescribePartners' :: DescribePartners -> 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
"DescribePartners" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"PartnerName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
partnerName,
ByteString
"DatabaseName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
databaseName,
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
]
data DescribePartnersResponse = DescribePartnersResponse'
{
DescribePartnersResponse -> Maybe [PartnerIntegrationInfo]
partnerIntegrationInfoList :: Prelude.Maybe [PartnerIntegrationInfo],
DescribePartnersResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribePartnersResponse -> DescribePartnersResponse -> Bool
(DescribePartnersResponse -> DescribePartnersResponse -> Bool)
-> (DescribePartnersResponse -> DescribePartnersResponse -> Bool)
-> Eq DescribePartnersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePartnersResponse -> DescribePartnersResponse -> Bool
$c/= :: DescribePartnersResponse -> DescribePartnersResponse -> Bool
== :: DescribePartnersResponse -> DescribePartnersResponse -> Bool
$c== :: DescribePartnersResponse -> DescribePartnersResponse -> Bool
Prelude.Eq, ReadPrec [DescribePartnersResponse]
ReadPrec DescribePartnersResponse
Int -> ReadS DescribePartnersResponse
ReadS [DescribePartnersResponse]
(Int -> ReadS DescribePartnersResponse)
-> ReadS [DescribePartnersResponse]
-> ReadPrec DescribePartnersResponse
-> ReadPrec [DescribePartnersResponse]
-> Read DescribePartnersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePartnersResponse]
$creadListPrec :: ReadPrec [DescribePartnersResponse]
readPrec :: ReadPrec DescribePartnersResponse
$creadPrec :: ReadPrec DescribePartnersResponse
readList :: ReadS [DescribePartnersResponse]
$creadList :: ReadS [DescribePartnersResponse]
readsPrec :: Int -> ReadS DescribePartnersResponse
$creadsPrec :: Int -> ReadS DescribePartnersResponse
Prelude.Read, Int -> DescribePartnersResponse -> ShowS
[DescribePartnersResponse] -> ShowS
DescribePartnersResponse -> String
(Int -> DescribePartnersResponse -> ShowS)
-> (DescribePartnersResponse -> String)
-> ([DescribePartnersResponse] -> ShowS)
-> Show DescribePartnersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePartnersResponse] -> ShowS
$cshowList :: [DescribePartnersResponse] -> ShowS
show :: DescribePartnersResponse -> String
$cshow :: DescribePartnersResponse -> String
showsPrec :: Int -> DescribePartnersResponse -> ShowS
$cshowsPrec :: Int -> DescribePartnersResponse -> ShowS
Prelude.Show, (forall x.
DescribePartnersResponse -> Rep DescribePartnersResponse x)
-> (forall x.
Rep DescribePartnersResponse x -> DescribePartnersResponse)
-> Generic DescribePartnersResponse
forall x.
Rep DescribePartnersResponse x -> DescribePartnersResponse
forall x.
DescribePartnersResponse -> Rep DescribePartnersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribePartnersResponse x -> DescribePartnersResponse
$cfrom :: forall x.
DescribePartnersResponse -> Rep DescribePartnersResponse x
Prelude.Generic)
newDescribePartnersResponse ::
Prelude.Int ->
DescribePartnersResponse
newDescribePartnersResponse :: Int -> DescribePartnersResponse
newDescribePartnersResponse Int
pHttpStatus_ =
DescribePartnersResponse' :: Maybe [PartnerIntegrationInfo] -> Int -> DescribePartnersResponse
DescribePartnersResponse'
{ $sel:partnerIntegrationInfoList:DescribePartnersResponse' :: Maybe [PartnerIntegrationInfo]
partnerIntegrationInfoList =
Maybe [PartnerIntegrationInfo]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribePartnersResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describePartnersResponse_partnerIntegrationInfoList :: Lens.Lens' DescribePartnersResponse (Prelude.Maybe [PartnerIntegrationInfo])
describePartnersResponse_partnerIntegrationInfoList :: (Maybe [PartnerIntegrationInfo]
-> f (Maybe [PartnerIntegrationInfo]))
-> DescribePartnersResponse -> f DescribePartnersResponse
describePartnersResponse_partnerIntegrationInfoList = (DescribePartnersResponse -> Maybe [PartnerIntegrationInfo])
-> (DescribePartnersResponse
-> Maybe [PartnerIntegrationInfo] -> DescribePartnersResponse)
-> Lens
DescribePartnersResponse
DescribePartnersResponse
(Maybe [PartnerIntegrationInfo])
(Maybe [PartnerIntegrationInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePartnersResponse' {Maybe [PartnerIntegrationInfo]
partnerIntegrationInfoList :: Maybe [PartnerIntegrationInfo]
$sel:partnerIntegrationInfoList:DescribePartnersResponse' :: DescribePartnersResponse -> Maybe [PartnerIntegrationInfo]
partnerIntegrationInfoList} -> Maybe [PartnerIntegrationInfo]
partnerIntegrationInfoList) (\s :: DescribePartnersResponse
s@DescribePartnersResponse' {} Maybe [PartnerIntegrationInfo]
a -> DescribePartnersResponse
s {$sel:partnerIntegrationInfoList:DescribePartnersResponse' :: Maybe [PartnerIntegrationInfo]
partnerIntegrationInfoList = Maybe [PartnerIntegrationInfo]
a} :: DescribePartnersResponse) ((Maybe [PartnerIntegrationInfo]
-> f (Maybe [PartnerIntegrationInfo]))
-> DescribePartnersResponse -> f DescribePartnersResponse)
-> ((Maybe [PartnerIntegrationInfo]
-> f (Maybe [PartnerIntegrationInfo]))
-> Maybe [PartnerIntegrationInfo]
-> f (Maybe [PartnerIntegrationInfo]))
-> (Maybe [PartnerIntegrationInfo]
-> f (Maybe [PartnerIntegrationInfo]))
-> DescribePartnersResponse
-> f DescribePartnersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[PartnerIntegrationInfo]
[PartnerIntegrationInfo]
[PartnerIntegrationInfo]
[PartnerIntegrationInfo]
-> Iso
(Maybe [PartnerIntegrationInfo])
(Maybe [PartnerIntegrationInfo])
(Maybe [PartnerIntegrationInfo])
(Maybe [PartnerIntegrationInfo])
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
[PartnerIntegrationInfo]
[PartnerIntegrationInfo]
[PartnerIntegrationInfo]
[PartnerIntegrationInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describePartnersResponse_httpStatus :: Lens.Lens' DescribePartnersResponse Prelude.Int
describePartnersResponse_httpStatus :: (Int -> f Int)
-> DescribePartnersResponse -> f DescribePartnersResponse
describePartnersResponse_httpStatus = (DescribePartnersResponse -> Int)
-> (DescribePartnersResponse -> Int -> DescribePartnersResponse)
-> Lens DescribePartnersResponse DescribePartnersResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePartnersResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribePartnersResponse' :: DescribePartnersResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribePartnersResponse
s@DescribePartnersResponse' {} Int
a -> DescribePartnersResponse
s {$sel:httpStatus:DescribePartnersResponse' :: Int
httpStatus = Int
a} :: DescribePartnersResponse)
instance Prelude.NFData DescribePartnersResponse