{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Connect.ListIntegrationAssociations
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Provides summary information about the AWS resource associations for the
-- specified Amazon Connect instance.
--
-- This operation returns paginated results.
module Amazonka.Connect.ListIntegrationAssociations
  ( -- * Creating a Request
    ListIntegrationAssociations (..),
    newListIntegrationAssociations,

    -- * Request Lenses
    listIntegrationAssociations_nextToken,
    listIntegrationAssociations_integrationType,
    listIntegrationAssociations_maxResults,
    listIntegrationAssociations_instanceId,

    -- * Destructuring the Response
    ListIntegrationAssociationsResponse (..),
    newListIntegrationAssociationsResponse,

    -- * Response Lenses
    listIntegrationAssociationsResponse_nextToken,
    listIntegrationAssociationsResponse_integrationAssociationSummaryList,
    listIntegrationAssociationsResponse_httpStatus,
  )
where

import Amazonka.Connect.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

-- | /See:/ 'newListIntegrationAssociations' smart constructor.
data ListIntegrationAssociations = ListIntegrationAssociations'
  { -- | The token for the next set of results. Use the value returned in the
    -- previous response in the next request to retrieve the next set of
    -- results.
    ListIntegrationAssociations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    ListIntegrationAssociations -> Maybe IntegrationType
integrationType :: Prelude.Maybe IntegrationType,
    -- | The maximum number of results to return per page.
    ListIntegrationAssociations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    ListIntegrationAssociations -> Text
instanceId :: Prelude.Text
  }
  deriving (ListIntegrationAssociations -> ListIntegrationAssociations -> Bool
(ListIntegrationAssociations
 -> ListIntegrationAssociations -> Bool)
-> (ListIntegrationAssociations
    -> ListIntegrationAssociations -> Bool)
-> Eq ListIntegrationAssociations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIntegrationAssociations -> ListIntegrationAssociations -> Bool
$c/= :: ListIntegrationAssociations -> ListIntegrationAssociations -> Bool
== :: ListIntegrationAssociations -> ListIntegrationAssociations -> Bool
$c== :: ListIntegrationAssociations -> ListIntegrationAssociations -> Bool
Prelude.Eq, ReadPrec [ListIntegrationAssociations]
ReadPrec ListIntegrationAssociations
Int -> ReadS ListIntegrationAssociations
ReadS [ListIntegrationAssociations]
(Int -> ReadS ListIntegrationAssociations)
-> ReadS [ListIntegrationAssociations]
-> ReadPrec ListIntegrationAssociations
-> ReadPrec [ListIntegrationAssociations]
-> Read ListIntegrationAssociations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIntegrationAssociations]
$creadListPrec :: ReadPrec [ListIntegrationAssociations]
readPrec :: ReadPrec ListIntegrationAssociations
$creadPrec :: ReadPrec ListIntegrationAssociations
readList :: ReadS [ListIntegrationAssociations]
$creadList :: ReadS [ListIntegrationAssociations]
readsPrec :: Int -> ReadS ListIntegrationAssociations
$creadsPrec :: Int -> ReadS ListIntegrationAssociations
Prelude.Read, Int -> ListIntegrationAssociations -> ShowS
[ListIntegrationAssociations] -> ShowS
ListIntegrationAssociations -> String
(Int -> ListIntegrationAssociations -> ShowS)
-> (ListIntegrationAssociations -> String)
-> ([ListIntegrationAssociations] -> ShowS)
-> Show ListIntegrationAssociations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIntegrationAssociations] -> ShowS
$cshowList :: [ListIntegrationAssociations] -> ShowS
show :: ListIntegrationAssociations -> String
$cshow :: ListIntegrationAssociations -> String
showsPrec :: Int -> ListIntegrationAssociations -> ShowS
$cshowsPrec :: Int -> ListIntegrationAssociations -> ShowS
Prelude.Show, (forall x.
 ListIntegrationAssociations -> Rep ListIntegrationAssociations x)
-> (forall x.
    Rep ListIntegrationAssociations x -> ListIntegrationAssociations)
-> Generic ListIntegrationAssociations
forall x.
Rep ListIntegrationAssociations x -> ListIntegrationAssociations
forall x.
ListIntegrationAssociations -> Rep ListIntegrationAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListIntegrationAssociations x -> ListIntegrationAssociations
$cfrom :: forall x.
ListIntegrationAssociations -> Rep ListIntegrationAssociations x
Prelude.Generic)

-- |
-- Create a value of 'ListIntegrationAssociations' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listIntegrationAssociations_nextToken' - The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
--
-- 'integrationType', 'listIntegrationAssociations_integrationType' -
--
-- 'maxResults', 'listIntegrationAssociations_maxResults' - The maximum number of results to return per page.
--
-- 'instanceId', 'listIntegrationAssociations_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
newListIntegrationAssociations ::
  -- | 'instanceId'
  Prelude.Text ->
  ListIntegrationAssociations
newListIntegrationAssociations :: Text -> ListIntegrationAssociations
newListIntegrationAssociations Text
pInstanceId_ =
  ListIntegrationAssociations' :: Maybe Text
-> Maybe IntegrationType
-> Maybe Natural
-> Text
-> ListIntegrationAssociations
ListIntegrationAssociations'
    { $sel:nextToken:ListIntegrationAssociations' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:integrationType:ListIntegrationAssociations' :: Maybe IntegrationType
integrationType = Maybe IntegrationType
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListIntegrationAssociations' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceId:ListIntegrationAssociations' :: Text
instanceId = Text
pInstanceId_
    }

-- | The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
listIntegrationAssociations_nextToken :: Lens.Lens' ListIntegrationAssociations (Prelude.Maybe Prelude.Text)
listIntegrationAssociations_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListIntegrationAssociations -> f ListIntegrationAssociations
listIntegrationAssociations_nextToken = (ListIntegrationAssociations -> Maybe Text)
-> (ListIntegrationAssociations
    -> Maybe Text -> ListIntegrationAssociations)
-> Lens
     ListIntegrationAssociations
     ListIntegrationAssociations
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrationAssociations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIntegrationAssociations' :: ListIntegrationAssociations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIntegrationAssociations
s@ListIntegrationAssociations' {} Maybe Text
a -> ListIntegrationAssociations
s {$sel:nextToken:ListIntegrationAssociations' :: Maybe Text
nextToken = Maybe Text
a} :: ListIntegrationAssociations)

-- |
listIntegrationAssociations_integrationType :: Lens.Lens' ListIntegrationAssociations (Prelude.Maybe IntegrationType)
listIntegrationAssociations_integrationType :: (Maybe IntegrationType -> f (Maybe IntegrationType))
-> ListIntegrationAssociations -> f ListIntegrationAssociations
listIntegrationAssociations_integrationType = (ListIntegrationAssociations -> Maybe IntegrationType)
-> (ListIntegrationAssociations
    -> Maybe IntegrationType -> ListIntegrationAssociations)
-> Lens
     ListIntegrationAssociations
     ListIntegrationAssociations
     (Maybe IntegrationType)
     (Maybe IntegrationType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrationAssociations' {Maybe IntegrationType
integrationType :: Maybe IntegrationType
$sel:integrationType:ListIntegrationAssociations' :: ListIntegrationAssociations -> Maybe IntegrationType
integrationType} -> Maybe IntegrationType
integrationType) (\s :: ListIntegrationAssociations
s@ListIntegrationAssociations' {} Maybe IntegrationType
a -> ListIntegrationAssociations
s {$sel:integrationType:ListIntegrationAssociations' :: Maybe IntegrationType
integrationType = Maybe IntegrationType
a} :: ListIntegrationAssociations)

-- | The maximum number of results to return per page.
listIntegrationAssociations_maxResults :: Lens.Lens' ListIntegrationAssociations (Prelude.Maybe Prelude.Natural)
listIntegrationAssociations_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListIntegrationAssociations -> f ListIntegrationAssociations
listIntegrationAssociations_maxResults = (ListIntegrationAssociations -> Maybe Natural)
-> (ListIntegrationAssociations
    -> Maybe Natural -> ListIntegrationAssociations)
-> Lens
     ListIntegrationAssociations
     ListIntegrationAssociations
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrationAssociations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListIntegrationAssociations' :: ListIntegrationAssociations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListIntegrationAssociations
s@ListIntegrationAssociations' {} Maybe Natural
a -> ListIntegrationAssociations
s {$sel:maxResults:ListIntegrationAssociations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListIntegrationAssociations)

-- | The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
listIntegrationAssociations_instanceId :: Lens.Lens' ListIntegrationAssociations Prelude.Text
listIntegrationAssociations_instanceId :: (Text -> f Text)
-> ListIntegrationAssociations -> f ListIntegrationAssociations
listIntegrationAssociations_instanceId = (ListIntegrationAssociations -> Text)
-> (ListIntegrationAssociations
    -> Text -> ListIntegrationAssociations)
-> Lens
     ListIntegrationAssociations ListIntegrationAssociations Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrationAssociations' {Text
instanceId :: Text
$sel:instanceId:ListIntegrationAssociations' :: ListIntegrationAssociations -> Text
instanceId} -> Text
instanceId) (\s :: ListIntegrationAssociations
s@ListIntegrationAssociations' {} Text
a -> ListIntegrationAssociations
s {$sel:instanceId:ListIntegrationAssociations' :: Text
instanceId = Text
a} :: ListIntegrationAssociations)

instance Core.AWSPager ListIntegrationAssociations where
  page :: ListIntegrationAssociations
-> AWSResponse ListIntegrationAssociations
-> Maybe ListIntegrationAssociations
page ListIntegrationAssociations
rq AWSResponse ListIntegrationAssociations
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListIntegrationAssociations
ListIntegrationAssociationsResponse
rs
            ListIntegrationAssociationsResponse
-> Getting (First Text) ListIntegrationAssociationsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListIntegrationAssociationsResponse
-> Const (First Text) ListIntegrationAssociationsResponse
Lens' ListIntegrationAssociationsResponse (Maybe Text)
listIntegrationAssociationsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListIntegrationAssociationsResponse
 -> Const (First Text) ListIntegrationAssociationsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListIntegrationAssociationsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListIntegrationAssociations
forall a. Maybe a
Prelude.Nothing
    | Maybe [IntegrationAssociationSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListIntegrationAssociations
ListIntegrationAssociationsResponse
rs
            ListIntegrationAssociationsResponse
-> Getting
     (First [IntegrationAssociationSummary])
     ListIntegrationAssociationsResponse
     [IntegrationAssociationSummary]
-> Maybe [IntegrationAssociationSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [IntegrationAssociationSummary]
 -> Const
      (First [IntegrationAssociationSummary])
      (Maybe [IntegrationAssociationSummary]))
-> ListIntegrationAssociationsResponse
-> Const
     (First [IntegrationAssociationSummary])
     ListIntegrationAssociationsResponse
Lens'
  ListIntegrationAssociationsResponse
  (Maybe [IntegrationAssociationSummary])
listIntegrationAssociationsResponse_integrationAssociationSummaryList
              ((Maybe [IntegrationAssociationSummary]
  -> Const
       (First [IntegrationAssociationSummary])
       (Maybe [IntegrationAssociationSummary]))
 -> ListIntegrationAssociationsResponse
 -> Const
      (First [IntegrationAssociationSummary])
      ListIntegrationAssociationsResponse)
-> (([IntegrationAssociationSummary]
     -> Const
          (First [IntegrationAssociationSummary])
          [IntegrationAssociationSummary])
    -> Maybe [IntegrationAssociationSummary]
    -> Const
         (First [IntegrationAssociationSummary])
         (Maybe [IntegrationAssociationSummary]))
-> Getting
     (First [IntegrationAssociationSummary])
     ListIntegrationAssociationsResponse
     [IntegrationAssociationSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([IntegrationAssociationSummary]
 -> Const
      (First [IntegrationAssociationSummary])
      [IntegrationAssociationSummary])
-> Maybe [IntegrationAssociationSummary]
-> Const
     (First [IntegrationAssociationSummary])
     (Maybe [IntegrationAssociationSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListIntegrationAssociations
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListIntegrationAssociations -> Maybe ListIntegrationAssociations
forall a. a -> Maybe a
Prelude.Just (ListIntegrationAssociations -> Maybe ListIntegrationAssociations)
-> ListIntegrationAssociations -> Maybe ListIntegrationAssociations
forall a b. (a -> b) -> a -> b
Prelude.$
        ListIntegrationAssociations
rq
          ListIntegrationAssociations
-> (ListIntegrationAssociations -> ListIntegrationAssociations)
-> ListIntegrationAssociations
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListIntegrationAssociations
-> Identity ListIntegrationAssociations
Lens
  ListIntegrationAssociations
  ListIntegrationAssociations
  (Maybe Text)
  (Maybe Text)
listIntegrationAssociations_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListIntegrationAssociations
 -> Identity ListIntegrationAssociations)
-> Maybe Text
-> ListIntegrationAssociations
-> ListIntegrationAssociations
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListIntegrationAssociations
ListIntegrationAssociationsResponse
rs
          ListIntegrationAssociationsResponse
-> Getting (First Text) ListIntegrationAssociationsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListIntegrationAssociationsResponse
-> Const (First Text) ListIntegrationAssociationsResponse
Lens' ListIntegrationAssociationsResponse (Maybe Text)
listIntegrationAssociationsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListIntegrationAssociationsResponse
 -> Const (First Text) ListIntegrationAssociationsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListIntegrationAssociationsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListIntegrationAssociations where
  type
    AWSResponse ListIntegrationAssociations =
      ListIntegrationAssociationsResponse
  request :: ListIntegrationAssociations -> Request ListIntegrationAssociations
request = Service
-> ListIntegrationAssociations
-> Request ListIntegrationAssociations
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListIntegrationAssociations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListIntegrationAssociations)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListIntegrationAssociations))
-> Logger
-> Service
-> Proxy ListIntegrationAssociations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListIntegrationAssociations)))
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 Text
-> Maybe [IntegrationAssociationSummary]
-> Int
-> ListIntegrationAssociationsResponse
ListIntegrationAssociationsResponse'
            (Maybe Text
 -> Maybe [IntegrationAssociationSummary]
 -> Int
 -> ListIntegrationAssociationsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [IntegrationAssociationSummary]
      -> Int -> ListIntegrationAssociationsResponse)
forall (f :: * -> *) a b. Functor 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
  (Maybe [IntegrationAssociationSummary]
   -> Int -> ListIntegrationAssociationsResponse)
-> Either String (Maybe [IntegrationAssociationSummary])
-> Either String (Int -> ListIntegrationAssociationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [IntegrationAssociationSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"IntegrationAssociationSummaryList"
                            Either String (Maybe (Maybe [IntegrationAssociationSummary]))
-> Maybe [IntegrationAssociationSummary]
-> Either String (Maybe [IntegrationAssociationSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [IntegrationAssociationSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListIntegrationAssociationsResponse)
-> Either String Int
-> Either String ListIntegrationAssociationsResponse
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 ListIntegrationAssociations

instance Prelude.NFData ListIntegrationAssociations

instance Core.ToHeaders ListIntegrationAssociations where
  toHeaders :: ListIntegrationAssociations -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListIntegrationAssociations -> 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 ListIntegrationAssociations where
  toPath :: ListIntegrationAssociations -> ByteString
toPath ListIntegrationAssociations' {Maybe Natural
Maybe Text
Maybe IntegrationType
Text
instanceId :: Text
maxResults :: Maybe Natural
integrationType :: Maybe IntegrationType
nextToken :: Maybe Text
$sel:instanceId:ListIntegrationAssociations' :: ListIntegrationAssociations -> Text
$sel:maxResults:ListIntegrationAssociations' :: ListIntegrationAssociations -> Maybe Natural
$sel:integrationType:ListIntegrationAssociations' :: ListIntegrationAssociations -> Maybe IntegrationType
$sel:nextToken:ListIntegrationAssociations' :: ListIntegrationAssociations -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/instance/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId,
        ByteString
"/integration-associations"
      ]

instance Core.ToQuery ListIntegrationAssociations where
  toQuery :: ListIntegrationAssociations -> QueryString
toQuery ListIntegrationAssociations' {Maybe Natural
Maybe Text
Maybe IntegrationType
Text
instanceId :: Text
maxResults :: Maybe Natural
integrationType :: Maybe IntegrationType
nextToken :: Maybe Text
$sel:instanceId:ListIntegrationAssociations' :: ListIntegrationAssociations -> Text
$sel:maxResults:ListIntegrationAssociations' :: ListIntegrationAssociations -> Maybe Natural
$sel:integrationType:ListIntegrationAssociations' :: ListIntegrationAssociations -> Maybe IntegrationType
$sel:nextToken:ListIntegrationAssociations' :: ListIntegrationAssociations -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"integrationType" ByteString -> Maybe IntegrationType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe IntegrationType
integrationType,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListIntegrationAssociationsResponse' smart constructor.
data ListIntegrationAssociationsResponse = ListIntegrationAssociationsResponse'
  { -- | If there are additional results, this is the token for the next set of
    -- results.
    ListIntegrationAssociationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The associations.
    ListIntegrationAssociationsResponse
-> Maybe [IntegrationAssociationSummary]
integrationAssociationSummaryList :: Prelude.Maybe [IntegrationAssociationSummary],
    -- | The response's http status code.
    ListIntegrationAssociationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListIntegrationAssociationsResponse
-> ListIntegrationAssociationsResponse -> Bool
(ListIntegrationAssociationsResponse
 -> ListIntegrationAssociationsResponse -> Bool)
-> (ListIntegrationAssociationsResponse
    -> ListIntegrationAssociationsResponse -> Bool)
-> Eq ListIntegrationAssociationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIntegrationAssociationsResponse
-> ListIntegrationAssociationsResponse -> Bool
$c/= :: ListIntegrationAssociationsResponse
-> ListIntegrationAssociationsResponse -> Bool
== :: ListIntegrationAssociationsResponse
-> ListIntegrationAssociationsResponse -> Bool
$c== :: ListIntegrationAssociationsResponse
-> ListIntegrationAssociationsResponse -> Bool
Prelude.Eq, ReadPrec [ListIntegrationAssociationsResponse]
ReadPrec ListIntegrationAssociationsResponse
Int -> ReadS ListIntegrationAssociationsResponse
ReadS [ListIntegrationAssociationsResponse]
(Int -> ReadS ListIntegrationAssociationsResponse)
-> ReadS [ListIntegrationAssociationsResponse]
-> ReadPrec ListIntegrationAssociationsResponse
-> ReadPrec [ListIntegrationAssociationsResponse]
-> Read ListIntegrationAssociationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIntegrationAssociationsResponse]
$creadListPrec :: ReadPrec [ListIntegrationAssociationsResponse]
readPrec :: ReadPrec ListIntegrationAssociationsResponse
$creadPrec :: ReadPrec ListIntegrationAssociationsResponse
readList :: ReadS [ListIntegrationAssociationsResponse]
$creadList :: ReadS [ListIntegrationAssociationsResponse]
readsPrec :: Int -> ReadS ListIntegrationAssociationsResponse
$creadsPrec :: Int -> ReadS ListIntegrationAssociationsResponse
Prelude.Read, Int -> ListIntegrationAssociationsResponse -> ShowS
[ListIntegrationAssociationsResponse] -> ShowS
ListIntegrationAssociationsResponse -> String
(Int -> ListIntegrationAssociationsResponse -> ShowS)
-> (ListIntegrationAssociationsResponse -> String)
-> ([ListIntegrationAssociationsResponse] -> ShowS)
-> Show ListIntegrationAssociationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIntegrationAssociationsResponse] -> ShowS
$cshowList :: [ListIntegrationAssociationsResponse] -> ShowS
show :: ListIntegrationAssociationsResponse -> String
$cshow :: ListIntegrationAssociationsResponse -> String
showsPrec :: Int -> ListIntegrationAssociationsResponse -> ShowS
$cshowsPrec :: Int -> ListIntegrationAssociationsResponse -> ShowS
Prelude.Show, (forall x.
 ListIntegrationAssociationsResponse
 -> Rep ListIntegrationAssociationsResponse x)
-> (forall x.
    Rep ListIntegrationAssociationsResponse x
    -> ListIntegrationAssociationsResponse)
-> Generic ListIntegrationAssociationsResponse
forall x.
Rep ListIntegrationAssociationsResponse x
-> ListIntegrationAssociationsResponse
forall x.
ListIntegrationAssociationsResponse
-> Rep ListIntegrationAssociationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListIntegrationAssociationsResponse x
-> ListIntegrationAssociationsResponse
$cfrom :: forall x.
ListIntegrationAssociationsResponse
-> Rep ListIntegrationAssociationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListIntegrationAssociationsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listIntegrationAssociationsResponse_nextToken' - If there are additional results, this is the token for the next set of
-- results.
--
-- 'integrationAssociationSummaryList', 'listIntegrationAssociationsResponse_integrationAssociationSummaryList' - The associations.
--
-- 'httpStatus', 'listIntegrationAssociationsResponse_httpStatus' - The response's http status code.
newListIntegrationAssociationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListIntegrationAssociationsResponse
newListIntegrationAssociationsResponse :: Int -> ListIntegrationAssociationsResponse
newListIntegrationAssociationsResponse Int
pHttpStatus_ =
  ListIntegrationAssociationsResponse' :: Maybe Text
-> Maybe [IntegrationAssociationSummary]
-> Int
-> ListIntegrationAssociationsResponse
ListIntegrationAssociationsResponse'
    { $sel:nextToken:ListIntegrationAssociationsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:integrationAssociationSummaryList:ListIntegrationAssociationsResponse' :: Maybe [IntegrationAssociationSummary]
integrationAssociationSummaryList =
        Maybe [IntegrationAssociationSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListIntegrationAssociationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If there are additional results, this is the token for the next set of
-- results.
listIntegrationAssociationsResponse_nextToken :: Lens.Lens' ListIntegrationAssociationsResponse (Prelude.Maybe Prelude.Text)
listIntegrationAssociationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListIntegrationAssociationsResponse
-> f ListIntegrationAssociationsResponse
listIntegrationAssociationsResponse_nextToken = (ListIntegrationAssociationsResponse -> Maybe Text)
-> (ListIntegrationAssociationsResponse
    -> Maybe Text -> ListIntegrationAssociationsResponse)
-> Lens' ListIntegrationAssociationsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrationAssociationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIntegrationAssociationsResponse' :: ListIntegrationAssociationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIntegrationAssociationsResponse
s@ListIntegrationAssociationsResponse' {} Maybe Text
a -> ListIntegrationAssociationsResponse
s {$sel:nextToken:ListIntegrationAssociationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListIntegrationAssociationsResponse)

-- | The associations.
listIntegrationAssociationsResponse_integrationAssociationSummaryList :: Lens.Lens' ListIntegrationAssociationsResponse (Prelude.Maybe [IntegrationAssociationSummary])
listIntegrationAssociationsResponse_integrationAssociationSummaryList :: (Maybe [IntegrationAssociationSummary]
 -> f (Maybe [IntegrationAssociationSummary]))
-> ListIntegrationAssociationsResponse
-> f ListIntegrationAssociationsResponse
listIntegrationAssociationsResponse_integrationAssociationSummaryList = (ListIntegrationAssociationsResponse
 -> Maybe [IntegrationAssociationSummary])
-> (ListIntegrationAssociationsResponse
    -> Maybe [IntegrationAssociationSummary]
    -> ListIntegrationAssociationsResponse)
-> Lens'
     ListIntegrationAssociationsResponse
     (Maybe [IntegrationAssociationSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrationAssociationsResponse' {Maybe [IntegrationAssociationSummary]
integrationAssociationSummaryList :: Maybe [IntegrationAssociationSummary]
$sel:integrationAssociationSummaryList:ListIntegrationAssociationsResponse' :: ListIntegrationAssociationsResponse
-> Maybe [IntegrationAssociationSummary]
integrationAssociationSummaryList} -> Maybe [IntegrationAssociationSummary]
integrationAssociationSummaryList) (\s :: ListIntegrationAssociationsResponse
s@ListIntegrationAssociationsResponse' {} Maybe [IntegrationAssociationSummary]
a -> ListIntegrationAssociationsResponse
s {$sel:integrationAssociationSummaryList:ListIntegrationAssociationsResponse' :: Maybe [IntegrationAssociationSummary]
integrationAssociationSummaryList = Maybe [IntegrationAssociationSummary]
a} :: ListIntegrationAssociationsResponse) ((Maybe [IntegrationAssociationSummary]
  -> f (Maybe [IntegrationAssociationSummary]))
 -> ListIntegrationAssociationsResponse
 -> f ListIntegrationAssociationsResponse)
-> ((Maybe [IntegrationAssociationSummary]
     -> f (Maybe [IntegrationAssociationSummary]))
    -> Maybe [IntegrationAssociationSummary]
    -> f (Maybe [IntegrationAssociationSummary]))
-> (Maybe [IntegrationAssociationSummary]
    -> f (Maybe [IntegrationAssociationSummary]))
-> ListIntegrationAssociationsResponse
-> f ListIntegrationAssociationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [IntegrationAssociationSummary]
  [IntegrationAssociationSummary]
  [IntegrationAssociationSummary]
  [IntegrationAssociationSummary]
-> Iso
     (Maybe [IntegrationAssociationSummary])
     (Maybe [IntegrationAssociationSummary])
     (Maybe [IntegrationAssociationSummary])
     (Maybe [IntegrationAssociationSummary])
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
  [IntegrationAssociationSummary]
  [IntegrationAssociationSummary]
  [IntegrationAssociationSummary]
  [IntegrationAssociationSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listIntegrationAssociationsResponse_httpStatus :: Lens.Lens' ListIntegrationAssociationsResponse Prelude.Int
listIntegrationAssociationsResponse_httpStatus :: (Int -> f Int)
-> ListIntegrationAssociationsResponse
-> f ListIntegrationAssociationsResponse
listIntegrationAssociationsResponse_httpStatus = (ListIntegrationAssociationsResponse -> Int)
-> (ListIntegrationAssociationsResponse
    -> Int -> ListIntegrationAssociationsResponse)
-> Lens
     ListIntegrationAssociationsResponse
     ListIntegrationAssociationsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrationAssociationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListIntegrationAssociationsResponse' :: ListIntegrationAssociationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListIntegrationAssociationsResponse
s@ListIntegrationAssociationsResponse' {} Int
a -> ListIntegrationAssociationsResponse
s {$sel:httpStatus:ListIntegrationAssociationsResponse' :: Int
httpStatus = Int
a} :: ListIntegrationAssociationsResponse)

instance
  Prelude.NFData
    ListIntegrationAssociationsResponse