{-# 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.CustomerProfiles.ListIntegrations
(
ListIntegrations (..),
newListIntegrations,
listIntegrations_nextToken,
listIntegrations_maxResults,
listIntegrations_domainName,
ListIntegrationsResponse (..),
newListIntegrationsResponse,
listIntegrationsResponse_items,
listIntegrationsResponse_nextToken,
listIntegrationsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.CustomerProfiles.Types
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 ListIntegrations = ListIntegrations'
{
ListIntegrations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListIntegrations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListIntegrations -> Text
domainName :: Prelude.Text
}
deriving (ListIntegrations -> ListIntegrations -> Bool
(ListIntegrations -> ListIntegrations -> Bool)
-> (ListIntegrations -> ListIntegrations -> Bool)
-> Eq ListIntegrations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIntegrations -> ListIntegrations -> Bool
$c/= :: ListIntegrations -> ListIntegrations -> Bool
== :: ListIntegrations -> ListIntegrations -> Bool
$c== :: ListIntegrations -> ListIntegrations -> Bool
Prelude.Eq, ReadPrec [ListIntegrations]
ReadPrec ListIntegrations
Int -> ReadS ListIntegrations
ReadS [ListIntegrations]
(Int -> ReadS ListIntegrations)
-> ReadS [ListIntegrations]
-> ReadPrec ListIntegrations
-> ReadPrec [ListIntegrations]
-> Read ListIntegrations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIntegrations]
$creadListPrec :: ReadPrec [ListIntegrations]
readPrec :: ReadPrec ListIntegrations
$creadPrec :: ReadPrec ListIntegrations
readList :: ReadS [ListIntegrations]
$creadList :: ReadS [ListIntegrations]
readsPrec :: Int -> ReadS ListIntegrations
$creadsPrec :: Int -> ReadS ListIntegrations
Prelude.Read, Int -> ListIntegrations -> ShowS
[ListIntegrations] -> ShowS
ListIntegrations -> String
(Int -> ListIntegrations -> ShowS)
-> (ListIntegrations -> String)
-> ([ListIntegrations] -> ShowS)
-> Show ListIntegrations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIntegrations] -> ShowS
$cshowList :: [ListIntegrations] -> ShowS
show :: ListIntegrations -> String
$cshow :: ListIntegrations -> String
showsPrec :: Int -> ListIntegrations -> ShowS
$cshowsPrec :: Int -> ListIntegrations -> ShowS
Prelude.Show, (forall x. ListIntegrations -> Rep ListIntegrations x)
-> (forall x. Rep ListIntegrations x -> ListIntegrations)
-> Generic ListIntegrations
forall x. Rep ListIntegrations x -> ListIntegrations
forall x. ListIntegrations -> Rep ListIntegrations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListIntegrations x -> ListIntegrations
$cfrom :: forall x. ListIntegrations -> Rep ListIntegrations x
Prelude.Generic)
newListIntegrations ::
Prelude.Text ->
ListIntegrations
newListIntegrations :: Text -> ListIntegrations
newListIntegrations Text
pDomainName_ =
ListIntegrations' :: Maybe Text -> Maybe Natural -> Text -> ListIntegrations
ListIntegrations'
{ $sel:nextToken:ListIntegrations' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListIntegrations' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:domainName:ListIntegrations' :: Text
domainName = Text
pDomainName_
}
listIntegrations_nextToken :: Lens.Lens' ListIntegrations (Prelude.Maybe Prelude.Text)
listIntegrations_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListIntegrations -> f ListIntegrations
listIntegrations_nextToken = (ListIntegrations -> Maybe Text)
-> (ListIntegrations -> Maybe Text -> ListIntegrations)
-> Lens ListIntegrations ListIntegrations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIntegrations' :: ListIntegrations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIntegrations
s@ListIntegrations' {} Maybe Text
a -> ListIntegrations
s {$sel:nextToken:ListIntegrations' :: Maybe Text
nextToken = Maybe Text
a} :: ListIntegrations)
listIntegrations_maxResults :: Lens.Lens' ListIntegrations (Prelude.Maybe Prelude.Natural)
listIntegrations_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListIntegrations -> f ListIntegrations
listIntegrations_maxResults = (ListIntegrations -> Maybe Natural)
-> (ListIntegrations -> Maybe Natural -> ListIntegrations)
-> Lens
ListIntegrations ListIntegrations (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListIntegrations' :: ListIntegrations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListIntegrations
s@ListIntegrations' {} Maybe Natural
a -> ListIntegrations
s {$sel:maxResults:ListIntegrations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListIntegrations)
listIntegrations_domainName :: Lens.Lens' ListIntegrations Prelude.Text
listIntegrations_domainName :: (Text -> f Text) -> ListIntegrations -> f ListIntegrations
listIntegrations_domainName = (ListIntegrations -> Text)
-> (ListIntegrations -> Text -> ListIntegrations)
-> Lens ListIntegrations ListIntegrations Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrations' {Text
domainName :: Text
$sel:domainName:ListIntegrations' :: ListIntegrations -> Text
domainName} -> Text
domainName) (\s :: ListIntegrations
s@ListIntegrations' {} Text
a -> ListIntegrations
s {$sel:domainName:ListIntegrations' :: Text
domainName = Text
a} :: ListIntegrations)
instance Core.AWSRequest ListIntegrations where
type
AWSResponse ListIntegrations =
ListIntegrationsResponse
request :: ListIntegrations -> Request ListIntegrations
request = Service -> ListIntegrations -> Request ListIntegrations
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListIntegrations
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListIntegrations)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListIntegrations))
-> Logger
-> Service
-> Proxy ListIntegrations
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListIntegrations)))
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 ->
Maybe [ListIntegrationItem]
-> Maybe Text -> Int -> ListIntegrationsResponse
ListIntegrationsResponse'
(Maybe [ListIntegrationItem]
-> Maybe Text -> Int -> ListIntegrationsResponse)
-> Either String (Maybe [ListIntegrationItem])
-> Either String (Maybe Text -> Int -> ListIntegrationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [ListIntegrationItem]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Items" Either String (Maybe (Maybe [ListIntegrationItem]))
-> Maybe [ListIntegrationItem]
-> Either String (Maybe [ListIntegrationItem])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ListIntegrationItem]
forall a. Monoid a => a
Prelude.mempty)
Either String (Maybe Text -> Int -> ListIntegrationsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListIntegrationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
Either String (Int -> ListIntegrationsResponse)
-> Either String Int -> Either String ListIntegrationsResponse
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 ListIntegrations
instance Prelude.NFData ListIntegrations
instance Core.ToHeaders ListIntegrations where
toHeaders :: ListIntegrations -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListIntegrations -> 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.ToPath ListIntegrations where
toPath :: ListIntegrations -> ByteString
toPath ListIntegrations' {Maybe Natural
Maybe Text
Text
domainName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:domainName:ListIntegrations' :: ListIntegrations -> Text
$sel:maxResults:ListIntegrations' :: ListIntegrations -> Maybe Natural
$sel:nextToken:ListIntegrations' :: ListIntegrations -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/domains/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
domainName, ByteString
"/integrations"]
instance Core.ToQuery ListIntegrations where
toQuery :: ListIntegrations -> QueryString
toQuery ListIntegrations' {Maybe Natural
Maybe Text
Text
domainName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:domainName:ListIntegrations' :: ListIntegrations -> Text
$sel:maxResults:ListIntegrations' :: ListIntegrations -> Maybe Natural
$sel:nextToken:ListIntegrations' :: ListIntegrations -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"next-token" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
ByteString
"max-results" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
]
data ListIntegrationsResponse = ListIntegrationsResponse'
{
ListIntegrationsResponse -> Maybe [ListIntegrationItem]
items :: Prelude.Maybe [ListIntegrationItem],
ListIntegrationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListIntegrationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListIntegrationsResponse -> ListIntegrationsResponse -> Bool
(ListIntegrationsResponse -> ListIntegrationsResponse -> Bool)
-> (ListIntegrationsResponse -> ListIntegrationsResponse -> Bool)
-> Eq ListIntegrationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIntegrationsResponse -> ListIntegrationsResponse -> Bool
$c/= :: ListIntegrationsResponse -> ListIntegrationsResponse -> Bool
== :: ListIntegrationsResponse -> ListIntegrationsResponse -> Bool
$c== :: ListIntegrationsResponse -> ListIntegrationsResponse -> Bool
Prelude.Eq, ReadPrec [ListIntegrationsResponse]
ReadPrec ListIntegrationsResponse
Int -> ReadS ListIntegrationsResponse
ReadS [ListIntegrationsResponse]
(Int -> ReadS ListIntegrationsResponse)
-> ReadS [ListIntegrationsResponse]
-> ReadPrec ListIntegrationsResponse
-> ReadPrec [ListIntegrationsResponse]
-> Read ListIntegrationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIntegrationsResponse]
$creadListPrec :: ReadPrec [ListIntegrationsResponse]
readPrec :: ReadPrec ListIntegrationsResponse
$creadPrec :: ReadPrec ListIntegrationsResponse
readList :: ReadS [ListIntegrationsResponse]
$creadList :: ReadS [ListIntegrationsResponse]
readsPrec :: Int -> ReadS ListIntegrationsResponse
$creadsPrec :: Int -> ReadS ListIntegrationsResponse
Prelude.Read, Int -> ListIntegrationsResponse -> ShowS
[ListIntegrationsResponse] -> ShowS
ListIntegrationsResponse -> String
(Int -> ListIntegrationsResponse -> ShowS)
-> (ListIntegrationsResponse -> String)
-> ([ListIntegrationsResponse] -> ShowS)
-> Show ListIntegrationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIntegrationsResponse] -> ShowS
$cshowList :: [ListIntegrationsResponse] -> ShowS
show :: ListIntegrationsResponse -> String
$cshow :: ListIntegrationsResponse -> String
showsPrec :: Int -> ListIntegrationsResponse -> ShowS
$cshowsPrec :: Int -> ListIntegrationsResponse -> ShowS
Prelude.Show, (forall x.
ListIntegrationsResponse -> Rep ListIntegrationsResponse x)
-> (forall x.
Rep ListIntegrationsResponse x -> ListIntegrationsResponse)
-> Generic ListIntegrationsResponse
forall x.
Rep ListIntegrationsResponse x -> ListIntegrationsResponse
forall x.
ListIntegrationsResponse -> Rep ListIntegrationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListIntegrationsResponse x -> ListIntegrationsResponse
$cfrom :: forall x.
ListIntegrationsResponse -> Rep ListIntegrationsResponse x
Prelude.Generic)
newListIntegrationsResponse ::
Prelude.Int ->
ListIntegrationsResponse
newListIntegrationsResponse :: Int -> ListIntegrationsResponse
newListIntegrationsResponse Int
pHttpStatus_ =
ListIntegrationsResponse' :: Maybe [ListIntegrationItem]
-> Maybe Text -> Int -> ListIntegrationsResponse
ListIntegrationsResponse'
{ $sel:items:ListIntegrationsResponse' :: Maybe [ListIntegrationItem]
items = Maybe [ListIntegrationItem]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListIntegrationsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListIntegrationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listIntegrationsResponse_items :: Lens.Lens' ListIntegrationsResponse (Prelude.Maybe [ListIntegrationItem])
listIntegrationsResponse_items :: (Maybe [ListIntegrationItem] -> f (Maybe [ListIntegrationItem]))
-> ListIntegrationsResponse -> f ListIntegrationsResponse
listIntegrationsResponse_items = (ListIntegrationsResponse -> Maybe [ListIntegrationItem])
-> (ListIntegrationsResponse
-> Maybe [ListIntegrationItem] -> ListIntegrationsResponse)
-> Lens
ListIntegrationsResponse
ListIntegrationsResponse
(Maybe [ListIntegrationItem])
(Maybe [ListIntegrationItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrationsResponse' {Maybe [ListIntegrationItem]
items :: Maybe [ListIntegrationItem]
$sel:items:ListIntegrationsResponse' :: ListIntegrationsResponse -> Maybe [ListIntegrationItem]
items} -> Maybe [ListIntegrationItem]
items) (\s :: ListIntegrationsResponse
s@ListIntegrationsResponse' {} Maybe [ListIntegrationItem]
a -> ListIntegrationsResponse
s {$sel:items:ListIntegrationsResponse' :: Maybe [ListIntegrationItem]
items = Maybe [ListIntegrationItem]
a} :: ListIntegrationsResponse) ((Maybe [ListIntegrationItem] -> f (Maybe [ListIntegrationItem]))
-> ListIntegrationsResponse -> f ListIntegrationsResponse)
-> ((Maybe [ListIntegrationItem]
-> f (Maybe [ListIntegrationItem]))
-> Maybe [ListIntegrationItem] -> f (Maybe [ListIntegrationItem]))
-> (Maybe [ListIntegrationItem] -> f (Maybe [ListIntegrationItem]))
-> ListIntegrationsResponse
-> f ListIntegrationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ListIntegrationItem]
[ListIntegrationItem]
[ListIntegrationItem]
[ListIntegrationItem]
-> Iso
(Maybe [ListIntegrationItem])
(Maybe [ListIntegrationItem])
(Maybe [ListIntegrationItem])
(Maybe [ListIntegrationItem])
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
[ListIntegrationItem]
[ListIntegrationItem]
[ListIntegrationItem]
[ListIntegrationItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listIntegrationsResponse_nextToken :: Lens.Lens' ListIntegrationsResponse (Prelude.Maybe Prelude.Text)
listIntegrationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListIntegrationsResponse -> f ListIntegrationsResponse
listIntegrationsResponse_nextToken = (ListIntegrationsResponse -> Maybe Text)
-> (ListIntegrationsResponse
-> Maybe Text -> ListIntegrationsResponse)
-> Lens
ListIntegrationsResponse
ListIntegrationsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIntegrationsResponse' :: ListIntegrationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIntegrationsResponse
s@ListIntegrationsResponse' {} Maybe Text
a -> ListIntegrationsResponse
s {$sel:nextToken:ListIntegrationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListIntegrationsResponse)
listIntegrationsResponse_httpStatus :: Lens.Lens' ListIntegrationsResponse Prelude.Int
listIntegrationsResponse_httpStatus :: (Int -> f Int)
-> ListIntegrationsResponse -> f ListIntegrationsResponse
listIntegrationsResponse_httpStatus = (ListIntegrationsResponse -> Int)
-> (ListIntegrationsResponse -> Int -> ListIntegrationsResponse)
-> Lens ListIntegrationsResponse ListIntegrationsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListIntegrationsResponse' :: ListIntegrationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListIntegrationsResponse
s@ListIntegrationsResponse' {} Int
a -> ListIntegrationsResponse
s {$sel:httpStatus:ListIntegrationsResponse' :: Int
httpStatus = Int
a} :: ListIntegrationsResponse)
instance Prelude.NFData ListIntegrationsResponse