{-# 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.ListConnectors
(
ListConnectors (..),
newListConnectors,
listConnectors_maxResults,
listConnectors_nextToken,
ListConnectorsResponse (..),
newListConnectorsResponse,
listConnectorsResponse_connectors,
listConnectorsResponse_nextToken,
listConnectorsResponse_httpStatus,
)
where
import Amazonka.AppFlow.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListConnectors = ListConnectors'
{
ListConnectors -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListConnectors -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListConnectors -> ListConnectors -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListConnectors -> ListConnectors -> Bool
$c/= :: ListConnectors -> ListConnectors -> Bool
== :: ListConnectors -> ListConnectors -> Bool
$c== :: ListConnectors -> ListConnectors -> Bool
Prelude.Eq, ReadPrec [ListConnectors]
ReadPrec ListConnectors
Int -> ReadS ListConnectors
ReadS [ListConnectors]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListConnectors]
$creadListPrec :: ReadPrec [ListConnectors]
readPrec :: ReadPrec ListConnectors
$creadPrec :: ReadPrec ListConnectors
readList :: ReadS [ListConnectors]
$creadList :: ReadS [ListConnectors]
readsPrec :: Int -> ReadS ListConnectors
$creadsPrec :: Int -> ReadS ListConnectors
Prelude.Read, Int -> ListConnectors -> ShowS
[ListConnectors] -> ShowS
ListConnectors -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListConnectors] -> ShowS
$cshowList :: [ListConnectors] -> ShowS
show :: ListConnectors -> String
$cshow :: ListConnectors -> String
showsPrec :: Int -> ListConnectors -> ShowS
$cshowsPrec :: Int -> ListConnectors -> ShowS
Prelude.Show, forall x. Rep ListConnectors x -> ListConnectors
forall x. ListConnectors -> Rep ListConnectors x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListConnectors x -> ListConnectors
$cfrom :: forall x. ListConnectors -> Rep ListConnectors x
Prelude.Generic)
newListConnectors ::
ListConnectors
newListConnectors :: ListConnectors
newListConnectors =
ListConnectors'
{ $sel:maxResults:ListConnectors' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListConnectors' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listConnectors_maxResults :: Lens.Lens' ListConnectors (Prelude.Maybe Prelude.Natural)
listConnectors_maxResults :: Lens' ListConnectors (Maybe Natural)
listConnectors_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConnectors' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListConnectors' :: ListConnectors -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListConnectors
s@ListConnectors' {} Maybe Natural
a -> ListConnectors
s {$sel:maxResults:ListConnectors' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListConnectors)
listConnectors_nextToken :: Lens.Lens' ListConnectors (Prelude.Maybe Prelude.Text)
listConnectors_nextToken :: Lens' ListConnectors (Maybe Text)
listConnectors_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConnectors' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListConnectors' :: ListConnectors -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListConnectors
s@ListConnectors' {} Maybe Text
a -> ListConnectors
s {$sel:nextToken:ListConnectors' :: Maybe Text
nextToken = Maybe Text
a} :: ListConnectors)
instance Core.AWSRequest ListConnectors where
type
AWSResponse ListConnectors =
ListConnectorsResponse
request :: (Service -> Service) -> ListConnectors -> Request ListConnectors
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListConnectors
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListConnectors)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [ConnectorDetail]
-> Maybe Text -> Int -> ListConnectorsResponse
ListConnectorsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"connectors" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListConnectors where
hashWithSalt :: Int -> ListConnectors -> Int
hashWithSalt Int
_salt ListConnectors' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListConnectors' :: ListConnectors -> Maybe Text
$sel:maxResults:ListConnectors' :: ListConnectors -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListConnectors where
rnf :: ListConnectors -> ()
rnf ListConnectors' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListConnectors' :: ListConnectors -> Maybe Text
$sel:maxResults:ListConnectors' :: ListConnectors -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
instance Data.ToHeaders ListConnectors where
toHeaders :: ListConnectors -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListConnectors where
toJSON :: ListConnectors -> Value
toJSON ListConnectors' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListConnectors' :: ListConnectors -> Maybe Text
$sel:maxResults:ListConnectors' :: ListConnectors -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
]
)
instance Data.ToPath ListConnectors where
toPath :: ListConnectors -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/list-connectors"
instance Data.ToQuery ListConnectors where
toQuery :: ListConnectors -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListConnectorsResponse = ListConnectorsResponse'
{
ListConnectorsResponse -> Maybe [ConnectorDetail]
connectors :: Prelude.Maybe [ConnectorDetail],
ListConnectorsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListConnectorsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListConnectorsResponse -> ListConnectorsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListConnectorsResponse -> ListConnectorsResponse -> Bool
$c/= :: ListConnectorsResponse -> ListConnectorsResponse -> Bool
== :: ListConnectorsResponse -> ListConnectorsResponse -> Bool
$c== :: ListConnectorsResponse -> ListConnectorsResponse -> Bool
Prelude.Eq, ReadPrec [ListConnectorsResponse]
ReadPrec ListConnectorsResponse
Int -> ReadS ListConnectorsResponse
ReadS [ListConnectorsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListConnectorsResponse]
$creadListPrec :: ReadPrec [ListConnectorsResponse]
readPrec :: ReadPrec ListConnectorsResponse
$creadPrec :: ReadPrec ListConnectorsResponse
readList :: ReadS [ListConnectorsResponse]
$creadList :: ReadS [ListConnectorsResponse]
readsPrec :: Int -> ReadS ListConnectorsResponse
$creadsPrec :: Int -> ReadS ListConnectorsResponse
Prelude.Read, Int -> ListConnectorsResponse -> ShowS
[ListConnectorsResponse] -> ShowS
ListConnectorsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListConnectorsResponse] -> ShowS
$cshowList :: [ListConnectorsResponse] -> ShowS
show :: ListConnectorsResponse -> String
$cshow :: ListConnectorsResponse -> String
showsPrec :: Int -> ListConnectorsResponse -> ShowS
$cshowsPrec :: Int -> ListConnectorsResponse -> ShowS
Prelude.Show, forall x. Rep ListConnectorsResponse x -> ListConnectorsResponse
forall x. ListConnectorsResponse -> Rep ListConnectorsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListConnectorsResponse x -> ListConnectorsResponse
$cfrom :: forall x. ListConnectorsResponse -> Rep ListConnectorsResponse x
Prelude.Generic)
newListConnectorsResponse ::
Prelude.Int ->
ListConnectorsResponse
newListConnectorsResponse :: Int -> ListConnectorsResponse
newListConnectorsResponse Int
pHttpStatus_ =
ListConnectorsResponse'
{ $sel:connectors:ListConnectorsResponse' :: Maybe [ConnectorDetail]
connectors =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListConnectorsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListConnectorsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listConnectorsResponse_connectors :: Lens.Lens' ListConnectorsResponse (Prelude.Maybe [ConnectorDetail])
listConnectorsResponse_connectors :: Lens' ListConnectorsResponse (Maybe [ConnectorDetail])
listConnectorsResponse_connectors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConnectorsResponse' {Maybe [ConnectorDetail]
connectors :: Maybe [ConnectorDetail]
$sel:connectors:ListConnectorsResponse' :: ListConnectorsResponse -> Maybe [ConnectorDetail]
connectors} -> Maybe [ConnectorDetail]
connectors) (\s :: ListConnectorsResponse
s@ListConnectorsResponse' {} Maybe [ConnectorDetail]
a -> ListConnectorsResponse
s {$sel:connectors:ListConnectorsResponse' :: Maybe [ConnectorDetail]
connectors = Maybe [ConnectorDetail]
a} :: ListConnectorsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listConnectorsResponse_nextToken :: Lens.Lens' ListConnectorsResponse (Prelude.Maybe Prelude.Text)
listConnectorsResponse_nextToken :: Lens' ListConnectorsResponse (Maybe Text)
listConnectorsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConnectorsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListConnectorsResponse' :: ListConnectorsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListConnectorsResponse
s@ListConnectorsResponse' {} Maybe Text
a -> ListConnectorsResponse
s {$sel:nextToken:ListConnectorsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListConnectorsResponse)
listConnectorsResponse_httpStatus :: Lens.Lens' ListConnectorsResponse Prelude.Int
listConnectorsResponse_httpStatus :: Lens' ListConnectorsResponse Int
listConnectorsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConnectorsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListConnectorsResponse' :: ListConnectorsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListConnectorsResponse
s@ListConnectorsResponse' {} Int
a -> ListConnectorsResponse
s {$sel:httpStatus:ListConnectorsResponse' :: Int
httpStatus = Int
a} :: ListConnectorsResponse)
instance Prelude.NFData ListConnectorsResponse where
rnf :: ListConnectorsResponse -> ()
rnf ListConnectorsResponse' {Int
Maybe [ConnectorDetail]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
connectors :: Maybe [ConnectorDetail]
$sel:httpStatus:ListConnectorsResponse' :: ListConnectorsResponse -> Int
$sel:nextToken:ListConnectorsResponse' :: ListConnectorsResponse -> Maybe Text
$sel:connectors:ListConnectorsResponse' :: ListConnectorsResponse -> Maybe [ConnectorDetail]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [ConnectorDetail]
connectors
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus