{-# 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.AppFlow.ListConnectorEntities
(
ListConnectorEntities (..),
newListConnectorEntities,
listConnectorEntities_connectorProfileName,
listConnectorEntities_entitiesPath,
listConnectorEntities_connectorType,
ListConnectorEntitiesResponse (..),
newListConnectorEntitiesResponse,
listConnectorEntitiesResponse_httpStatus,
listConnectorEntitiesResponse_connectorEntityMap,
)
where
import Amazonka.AppFlow.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListConnectorEntities = ListConnectorEntities'
{
ListConnectorEntities -> Maybe Text
connectorProfileName :: Prelude.Maybe Prelude.Text,
ListConnectorEntities -> Maybe Text
entitiesPath :: Prelude.Maybe Prelude.Text,
ListConnectorEntities -> Maybe ConnectorType
connectorType :: Prelude.Maybe ConnectorType
}
deriving (ListConnectorEntities -> ListConnectorEntities -> Bool
(ListConnectorEntities -> ListConnectorEntities -> Bool)
-> (ListConnectorEntities -> ListConnectorEntities -> Bool)
-> Eq ListConnectorEntities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListConnectorEntities -> ListConnectorEntities -> Bool
$c/= :: ListConnectorEntities -> ListConnectorEntities -> Bool
== :: ListConnectorEntities -> ListConnectorEntities -> Bool
$c== :: ListConnectorEntities -> ListConnectorEntities -> Bool
Prelude.Eq, ReadPrec [ListConnectorEntities]
ReadPrec ListConnectorEntities
Int -> ReadS ListConnectorEntities
ReadS [ListConnectorEntities]
(Int -> ReadS ListConnectorEntities)
-> ReadS [ListConnectorEntities]
-> ReadPrec ListConnectorEntities
-> ReadPrec [ListConnectorEntities]
-> Read ListConnectorEntities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListConnectorEntities]
$creadListPrec :: ReadPrec [ListConnectorEntities]
readPrec :: ReadPrec ListConnectorEntities
$creadPrec :: ReadPrec ListConnectorEntities
readList :: ReadS [ListConnectorEntities]
$creadList :: ReadS [ListConnectorEntities]
readsPrec :: Int -> ReadS ListConnectorEntities
$creadsPrec :: Int -> ReadS ListConnectorEntities
Prelude.Read, Int -> ListConnectorEntities -> ShowS
[ListConnectorEntities] -> ShowS
ListConnectorEntities -> String
(Int -> ListConnectorEntities -> ShowS)
-> (ListConnectorEntities -> String)
-> ([ListConnectorEntities] -> ShowS)
-> Show ListConnectorEntities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListConnectorEntities] -> ShowS
$cshowList :: [ListConnectorEntities] -> ShowS
show :: ListConnectorEntities -> String
$cshow :: ListConnectorEntities -> String
showsPrec :: Int -> ListConnectorEntities -> ShowS
$cshowsPrec :: Int -> ListConnectorEntities -> ShowS
Prelude.Show, (forall x. ListConnectorEntities -> Rep ListConnectorEntities x)
-> (forall x. Rep ListConnectorEntities x -> ListConnectorEntities)
-> Generic ListConnectorEntities
forall x. Rep ListConnectorEntities x -> ListConnectorEntities
forall x. ListConnectorEntities -> Rep ListConnectorEntities x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListConnectorEntities x -> ListConnectorEntities
$cfrom :: forall x. ListConnectorEntities -> Rep ListConnectorEntities x
Prelude.Generic)
newListConnectorEntities ::
ListConnectorEntities
newListConnectorEntities :: ListConnectorEntities
newListConnectorEntities =
ListConnectorEntities' :: Maybe Text
-> Maybe Text -> Maybe ConnectorType -> ListConnectorEntities
ListConnectorEntities'
{ $sel:connectorProfileName:ListConnectorEntities' :: Maybe Text
connectorProfileName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:entitiesPath:ListConnectorEntities' :: Maybe Text
entitiesPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:connectorType:ListConnectorEntities' :: Maybe ConnectorType
connectorType = Maybe ConnectorType
forall a. Maybe a
Prelude.Nothing
}
listConnectorEntities_connectorProfileName :: Lens.Lens' ListConnectorEntities (Prelude.Maybe Prelude.Text)
listConnectorEntities_connectorProfileName :: (Maybe Text -> f (Maybe Text))
-> ListConnectorEntities -> f ListConnectorEntities
listConnectorEntities_connectorProfileName = (ListConnectorEntities -> Maybe Text)
-> (ListConnectorEntities -> Maybe Text -> ListConnectorEntities)
-> Lens
ListConnectorEntities
ListConnectorEntities
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConnectorEntities' {Maybe Text
connectorProfileName :: Maybe Text
$sel:connectorProfileName:ListConnectorEntities' :: ListConnectorEntities -> Maybe Text
connectorProfileName} -> Maybe Text
connectorProfileName) (\s :: ListConnectorEntities
s@ListConnectorEntities' {} Maybe Text
a -> ListConnectorEntities
s {$sel:connectorProfileName:ListConnectorEntities' :: Maybe Text
connectorProfileName = Maybe Text
a} :: ListConnectorEntities)
listConnectorEntities_entitiesPath :: Lens.Lens' ListConnectorEntities (Prelude.Maybe Prelude.Text)
listConnectorEntities_entitiesPath :: (Maybe Text -> f (Maybe Text))
-> ListConnectorEntities -> f ListConnectorEntities
listConnectorEntities_entitiesPath = (ListConnectorEntities -> Maybe Text)
-> (ListConnectorEntities -> Maybe Text -> ListConnectorEntities)
-> Lens
ListConnectorEntities
ListConnectorEntities
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConnectorEntities' {Maybe Text
entitiesPath :: Maybe Text
$sel:entitiesPath:ListConnectorEntities' :: ListConnectorEntities -> Maybe Text
entitiesPath} -> Maybe Text
entitiesPath) (\s :: ListConnectorEntities
s@ListConnectorEntities' {} Maybe Text
a -> ListConnectorEntities
s {$sel:entitiesPath:ListConnectorEntities' :: Maybe Text
entitiesPath = Maybe Text
a} :: ListConnectorEntities)
listConnectorEntities_connectorType :: Lens.Lens' ListConnectorEntities (Prelude.Maybe ConnectorType)
listConnectorEntities_connectorType :: (Maybe ConnectorType -> f (Maybe ConnectorType))
-> ListConnectorEntities -> f ListConnectorEntities
listConnectorEntities_connectorType = (ListConnectorEntities -> Maybe ConnectorType)
-> (ListConnectorEntities
-> Maybe ConnectorType -> ListConnectorEntities)
-> Lens
ListConnectorEntities
ListConnectorEntities
(Maybe ConnectorType)
(Maybe ConnectorType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConnectorEntities' {Maybe ConnectorType
connectorType :: Maybe ConnectorType
$sel:connectorType:ListConnectorEntities' :: ListConnectorEntities -> Maybe ConnectorType
connectorType} -> Maybe ConnectorType
connectorType) (\s :: ListConnectorEntities
s@ListConnectorEntities' {} Maybe ConnectorType
a -> ListConnectorEntities
s {$sel:connectorType:ListConnectorEntities' :: Maybe ConnectorType
connectorType = Maybe ConnectorType
a} :: ListConnectorEntities)
instance Core.AWSRequest ListConnectorEntities where
type
AWSResponse ListConnectorEntities =
ListConnectorEntitiesResponse
request :: ListConnectorEntities -> Request ListConnectorEntities
request = Service -> ListConnectorEntities -> Request ListConnectorEntities
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ListConnectorEntities
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListConnectorEntities)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListConnectorEntities))
-> Logger
-> Service
-> Proxy ListConnectorEntities
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListConnectorEntities)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int
-> HashMap Text [ConnectorEntity] -> ListConnectorEntitiesResponse
ListConnectorEntitiesResponse'
(Int
-> HashMap Text [ConnectorEntity] -> ListConnectorEntitiesResponse)
-> Either String Int
-> Either
String
(HashMap Text [ConnectorEntity] -> ListConnectorEntitiesResponse)
forall (f :: * -> *) a b. Functor 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))
Either
String
(HashMap Text [ConnectorEntity] -> ListConnectorEntitiesResponse)
-> Either String (HashMap Text [ConnectorEntity])
-> Either String ListConnectorEntitiesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (HashMap Text [ConnectorEntity]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"connectorEntityMap"
Either String (Maybe (HashMap Text [ConnectorEntity]))
-> HashMap Text [ConnectorEntity]
-> Either String (HashMap Text [ConnectorEntity])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ HashMap Text [ConnectorEntity]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable ListConnectorEntities
instance Prelude.NFData ListConnectorEntities
instance Core.ToHeaders ListConnectorEntities where
toHeaders :: ListConnectorEntities -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListConnectorEntities -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON ListConnectorEntities where
toJSON :: ListConnectorEntities -> Value
toJSON ListConnectorEntities' {Maybe Text
Maybe ConnectorType
connectorType :: Maybe ConnectorType
entitiesPath :: Maybe Text
connectorProfileName :: Maybe Text
$sel:connectorType:ListConnectorEntities' :: ListConnectorEntities -> Maybe ConnectorType
$sel:entitiesPath:ListConnectorEntities' :: ListConnectorEntities -> Maybe Text
$sel:connectorProfileName:ListConnectorEntities' :: ListConnectorEntities -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"connectorProfileName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
connectorProfileName,
(Text
"entitiesPath" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
entitiesPath,
(Text
"connectorType" Text -> ConnectorType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ConnectorType -> Pair) -> Maybe ConnectorType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConnectorType
connectorType
]
)
instance Core.ToPath ListConnectorEntities where
toPath :: ListConnectorEntities -> ByteString
toPath = ByteString -> ListConnectorEntities -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/list-connector-entities"
instance Core.ToQuery ListConnectorEntities where
toQuery :: ListConnectorEntities -> QueryString
toQuery = QueryString -> ListConnectorEntities -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ListConnectorEntitiesResponse = ListConnectorEntitiesResponse'
{
ListConnectorEntitiesResponse -> Int
httpStatus :: Prelude.Int,
ListConnectorEntitiesResponse -> HashMap Text [ConnectorEntity]
connectorEntityMap :: Prelude.HashMap Prelude.Text [ConnectorEntity]
}
deriving (ListConnectorEntitiesResponse
-> ListConnectorEntitiesResponse -> Bool
(ListConnectorEntitiesResponse
-> ListConnectorEntitiesResponse -> Bool)
-> (ListConnectorEntitiesResponse
-> ListConnectorEntitiesResponse -> Bool)
-> Eq ListConnectorEntitiesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListConnectorEntitiesResponse
-> ListConnectorEntitiesResponse -> Bool
$c/= :: ListConnectorEntitiesResponse
-> ListConnectorEntitiesResponse -> Bool
== :: ListConnectorEntitiesResponse
-> ListConnectorEntitiesResponse -> Bool
$c== :: ListConnectorEntitiesResponse
-> ListConnectorEntitiesResponse -> Bool
Prelude.Eq, ReadPrec [ListConnectorEntitiesResponse]
ReadPrec ListConnectorEntitiesResponse
Int -> ReadS ListConnectorEntitiesResponse
ReadS [ListConnectorEntitiesResponse]
(Int -> ReadS ListConnectorEntitiesResponse)
-> ReadS [ListConnectorEntitiesResponse]
-> ReadPrec ListConnectorEntitiesResponse
-> ReadPrec [ListConnectorEntitiesResponse]
-> Read ListConnectorEntitiesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListConnectorEntitiesResponse]
$creadListPrec :: ReadPrec [ListConnectorEntitiesResponse]
readPrec :: ReadPrec ListConnectorEntitiesResponse
$creadPrec :: ReadPrec ListConnectorEntitiesResponse
readList :: ReadS [ListConnectorEntitiesResponse]
$creadList :: ReadS [ListConnectorEntitiesResponse]
readsPrec :: Int -> ReadS ListConnectorEntitiesResponse
$creadsPrec :: Int -> ReadS ListConnectorEntitiesResponse
Prelude.Read, Int -> ListConnectorEntitiesResponse -> ShowS
[ListConnectorEntitiesResponse] -> ShowS
ListConnectorEntitiesResponse -> String
(Int -> ListConnectorEntitiesResponse -> ShowS)
-> (ListConnectorEntitiesResponse -> String)
-> ([ListConnectorEntitiesResponse] -> ShowS)
-> Show ListConnectorEntitiesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListConnectorEntitiesResponse] -> ShowS
$cshowList :: [ListConnectorEntitiesResponse] -> ShowS
show :: ListConnectorEntitiesResponse -> String
$cshow :: ListConnectorEntitiesResponse -> String
showsPrec :: Int -> ListConnectorEntitiesResponse -> ShowS
$cshowsPrec :: Int -> ListConnectorEntitiesResponse -> ShowS
Prelude.Show, (forall x.
ListConnectorEntitiesResponse
-> Rep ListConnectorEntitiesResponse x)
-> (forall x.
Rep ListConnectorEntitiesResponse x
-> ListConnectorEntitiesResponse)
-> Generic ListConnectorEntitiesResponse
forall x.
Rep ListConnectorEntitiesResponse x
-> ListConnectorEntitiesResponse
forall x.
ListConnectorEntitiesResponse
-> Rep ListConnectorEntitiesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListConnectorEntitiesResponse x
-> ListConnectorEntitiesResponse
$cfrom :: forall x.
ListConnectorEntitiesResponse
-> Rep ListConnectorEntitiesResponse x
Prelude.Generic)
newListConnectorEntitiesResponse ::
Prelude.Int ->
ListConnectorEntitiesResponse
newListConnectorEntitiesResponse :: Int -> ListConnectorEntitiesResponse
newListConnectorEntitiesResponse Int
pHttpStatus_ =
ListConnectorEntitiesResponse' :: Int
-> HashMap Text [ConnectorEntity] -> ListConnectorEntitiesResponse
ListConnectorEntitiesResponse'
{ $sel:httpStatus:ListConnectorEntitiesResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:connectorEntityMap:ListConnectorEntitiesResponse' :: HashMap Text [ConnectorEntity]
connectorEntityMap = HashMap Text [ConnectorEntity]
forall a. Monoid a => a
Prelude.mempty
}
listConnectorEntitiesResponse_httpStatus :: Lens.Lens' ListConnectorEntitiesResponse Prelude.Int
listConnectorEntitiesResponse_httpStatus :: (Int -> f Int)
-> ListConnectorEntitiesResponse -> f ListConnectorEntitiesResponse
listConnectorEntitiesResponse_httpStatus = (ListConnectorEntitiesResponse -> Int)
-> (ListConnectorEntitiesResponse
-> Int -> ListConnectorEntitiesResponse)
-> Lens
ListConnectorEntitiesResponse ListConnectorEntitiesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConnectorEntitiesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListConnectorEntitiesResponse' :: ListConnectorEntitiesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListConnectorEntitiesResponse
s@ListConnectorEntitiesResponse' {} Int
a -> ListConnectorEntitiesResponse
s {$sel:httpStatus:ListConnectorEntitiesResponse' :: Int
httpStatus = Int
a} :: ListConnectorEntitiesResponse)
listConnectorEntitiesResponse_connectorEntityMap :: Lens.Lens' ListConnectorEntitiesResponse (Prelude.HashMap Prelude.Text [ConnectorEntity])
listConnectorEntitiesResponse_connectorEntityMap :: (HashMap Text [ConnectorEntity]
-> f (HashMap Text [ConnectorEntity]))
-> ListConnectorEntitiesResponse -> f ListConnectorEntitiesResponse
listConnectorEntitiesResponse_connectorEntityMap = (ListConnectorEntitiesResponse -> HashMap Text [ConnectorEntity])
-> (ListConnectorEntitiesResponse
-> HashMap Text [ConnectorEntity] -> ListConnectorEntitiesResponse)
-> Lens
ListConnectorEntitiesResponse
ListConnectorEntitiesResponse
(HashMap Text [ConnectorEntity])
(HashMap Text [ConnectorEntity])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConnectorEntitiesResponse' {HashMap Text [ConnectorEntity]
connectorEntityMap :: HashMap Text [ConnectorEntity]
$sel:connectorEntityMap:ListConnectorEntitiesResponse' :: ListConnectorEntitiesResponse -> HashMap Text [ConnectorEntity]
connectorEntityMap} -> HashMap Text [ConnectorEntity]
connectorEntityMap) (\s :: ListConnectorEntitiesResponse
s@ListConnectorEntitiesResponse' {} HashMap Text [ConnectorEntity]
a -> ListConnectorEntitiesResponse
s {$sel:connectorEntityMap:ListConnectorEntitiesResponse' :: HashMap Text [ConnectorEntity]
connectorEntityMap = HashMap Text [ConnectorEntity]
a} :: ListConnectorEntitiesResponse) ((HashMap Text [ConnectorEntity]
-> f (HashMap Text [ConnectorEntity]))
-> ListConnectorEntitiesResponse
-> f ListConnectorEntitiesResponse)
-> ((HashMap Text [ConnectorEntity]
-> f (HashMap Text [ConnectorEntity]))
-> HashMap Text [ConnectorEntity]
-> f (HashMap Text [ConnectorEntity]))
-> (HashMap Text [ConnectorEntity]
-> f (HashMap Text [ConnectorEntity]))
-> ListConnectorEntitiesResponse
-> f ListConnectorEntitiesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text [ConnectorEntity]
-> f (HashMap Text [ConnectorEntity]))
-> HashMap Text [ConnectorEntity]
-> f (HashMap Text [ConnectorEntity])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData ListConnectorEntitiesResponse