{-# 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.LexModels.GetBotChannelAssociations
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns a list of all of the channels associated with the specified bot.
--
-- The @GetBotChannelAssociations@ operation requires permissions for the
-- @lex:GetBotChannelAssociations@ action.
--
-- This operation returns paginated results.
module Amazonka.LexModels.GetBotChannelAssociations
  ( -- * Creating a Request
    GetBotChannelAssociations (..),
    newGetBotChannelAssociations,

    -- * Request Lenses
    getBotChannelAssociations_maxResults,
    getBotChannelAssociations_nameContains,
    getBotChannelAssociations_nextToken,
    getBotChannelAssociations_botName,
    getBotChannelAssociations_botAlias,

    -- * Destructuring the Response
    GetBotChannelAssociationsResponse (..),
    newGetBotChannelAssociationsResponse,

    -- * Response Lenses
    getBotChannelAssociationsResponse_botChannelAssociations,
    getBotChannelAssociationsResponse_nextToken,
    getBotChannelAssociationsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexModels.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetBotChannelAssociations' smart constructor.
data GetBotChannelAssociations = GetBotChannelAssociations'
  { -- | The maximum number of associations to return in the response. The
    -- default is 50.
    GetBotChannelAssociations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | Substring to match in channel association names. An association will be
    -- returned if any part of its name matches the substring. For example,
    -- \"xyz\" matches both \"xyzabc\" and \"abcxyz.\" To return all bot
    -- channel associations, use a hyphen (\"-\") as the @nameContains@
    -- parameter.
    GetBotChannelAssociations -> Maybe Text
nameContains :: Prelude.Maybe Prelude.Text,
    -- | A pagination token for fetching the next page of associations. If the
    -- response to this call is truncated, Amazon Lex returns a pagination
    -- token in the response. To fetch the next page of associations, specify
    -- the pagination token in the next request.
    GetBotChannelAssociations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the Amazon Lex bot in the association.
    GetBotChannelAssociations -> Text
botName :: Prelude.Text,
    -- | An alias pointing to the specific version of the Amazon Lex bot to which
    -- this association is being made.
    GetBotChannelAssociations -> Text
botAlias :: Prelude.Text
  }
  deriving (GetBotChannelAssociations -> GetBotChannelAssociations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBotChannelAssociations -> GetBotChannelAssociations -> Bool
$c/= :: GetBotChannelAssociations -> GetBotChannelAssociations -> Bool
== :: GetBotChannelAssociations -> GetBotChannelAssociations -> Bool
$c== :: GetBotChannelAssociations -> GetBotChannelAssociations -> Bool
Prelude.Eq, ReadPrec [GetBotChannelAssociations]
ReadPrec GetBotChannelAssociations
Int -> ReadS GetBotChannelAssociations
ReadS [GetBotChannelAssociations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBotChannelAssociations]
$creadListPrec :: ReadPrec [GetBotChannelAssociations]
readPrec :: ReadPrec GetBotChannelAssociations
$creadPrec :: ReadPrec GetBotChannelAssociations
readList :: ReadS [GetBotChannelAssociations]
$creadList :: ReadS [GetBotChannelAssociations]
readsPrec :: Int -> ReadS GetBotChannelAssociations
$creadsPrec :: Int -> ReadS GetBotChannelAssociations
Prelude.Read, Int -> GetBotChannelAssociations -> ShowS
[GetBotChannelAssociations] -> ShowS
GetBotChannelAssociations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBotChannelAssociations] -> ShowS
$cshowList :: [GetBotChannelAssociations] -> ShowS
show :: GetBotChannelAssociations -> String
$cshow :: GetBotChannelAssociations -> String
showsPrec :: Int -> GetBotChannelAssociations -> ShowS
$cshowsPrec :: Int -> GetBotChannelAssociations -> ShowS
Prelude.Show, forall x.
Rep GetBotChannelAssociations x -> GetBotChannelAssociations
forall x.
GetBotChannelAssociations -> Rep GetBotChannelAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBotChannelAssociations x -> GetBotChannelAssociations
$cfrom :: forall x.
GetBotChannelAssociations -> Rep GetBotChannelAssociations x
Prelude.Generic)

-- |
-- Create a value of 'GetBotChannelAssociations' 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:
--
-- 'maxResults', 'getBotChannelAssociations_maxResults' - The maximum number of associations to return in the response. The
-- default is 50.
--
-- 'nameContains', 'getBotChannelAssociations_nameContains' - Substring to match in channel association names. An association will be
-- returned if any part of its name matches the substring. For example,
-- \"xyz\" matches both \"xyzabc\" and \"abcxyz.\" To return all bot
-- channel associations, use a hyphen (\"-\") as the @nameContains@
-- parameter.
--
-- 'nextToken', 'getBotChannelAssociations_nextToken' - A pagination token for fetching the next page of associations. If the
-- response to this call is truncated, Amazon Lex returns a pagination
-- token in the response. To fetch the next page of associations, specify
-- the pagination token in the next request.
--
-- 'botName', 'getBotChannelAssociations_botName' - The name of the Amazon Lex bot in the association.
--
-- 'botAlias', 'getBotChannelAssociations_botAlias' - An alias pointing to the specific version of the Amazon Lex bot to which
-- this association is being made.
newGetBotChannelAssociations ::
  -- | 'botName'
  Prelude.Text ->
  -- | 'botAlias'
  Prelude.Text ->
  GetBotChannelAssociations
newGetBotChannelAssociations :: Text -> Text -> GetBotChannelAssociations
newGetBotChannelAssociations Text
pBotName_ Text
pBotAlias_ =
  GetBotChannelAssociations'
    { $sel:maxResults:GetBotChannelAssociations' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nameContains:GetBotChannelAssociations' :: Maybe Text
nameContains = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetBotChannelAssociations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:botName:GetBotChannelAssociations' :: Text
botName = Text
pBotName_,
      $sel:botAlias:GetBotChannelAssociations' :: Text
botAlias = Text
pBotAlias_
    }

-- | The maximum number of associations to return in the response. The
-- default is 50.
getBotChannelAssociations_maxResults :: Lens.Lens' GetBotChannelAssociations (Prelude.Maybe Prelude.Natural)
getBotChannelAssociations_maxResults :: Lens' GetBotChannelAssociations (Maybe Natural)
getBotChannelAssociations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotChannelAssociations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetBotChannelAssociations' :: GetBotChannelAssociations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetBotChannelAssociations
s@GetBotChannelAssociations' {} Maybe Natural
a -> GetBotChannelAssociations
s {$sel:maxResults:GetBotChannelAssociations' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetBotChannelAssociations)

-- | Substring to match in channel association names. An association will be
-- returned if any part of its name matches the substring. For example,
-- \"xyz\" matches both \"xyzabc\" and \"abcxyz.\" To return all bot
-- channel associations, use a hyphen (\"-\") as the @nameContains@
-- parameter.
getBotChannelAssociations_nameContains :: Lens.Lens' GetBotChannelAssociations (Prelude.Maybe Prelude.Text)
getBotChannelAssociations_nameContains :: Lens' GetBotChannelAssociations (Maybe Text)
getBotChannelAssociations_nameContains = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotChannelAssociations' {Maybe Text
nameContains :: Maybe Text
$sel:nameContains:GetBotChannelAssociations' :: GetBotChannelAssociations -> Maybe Text
nameContains} -> Maybe Text
nameContains) (\s :: GetBotChannelAssociations
s@GetBotChannelAssociations' {} Maybe Text
a -> GetBotChannelAssociations
s {$sel:nameContains:GetBotChannelAssociations' :: Maybe Text
nameContains = Maybe Text
a} :: GetBotChannelAssociations)

-- | A pagination token for fetching the next page of associations. If the
-- response to this call is truncated, Amazon Lex returns a pagination
-- token in the response. To fetch the next page of associations, specify
-- the pagination token in the next request.
getBotChannelAssociations_nextToken :: Lens.Lens' GetBotChannelAssociations (Prelude.Maybe Prelude.Text)
getBotChannelAssociations_nextToken :: Lens' GetBotChannelAssociations (Maybe Text)
getBotChannelAssociations_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotChannelAssociations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetBotChannelAssociations' :: GetBotChannelAssociations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetBotChannelAssociations
s@GetBotChannelAssociations' {} Maybe Text
a -> GetBotChannelAssociations
s {$sel:nextToken:GetBotChannelAssociations' :: Maybe Text
nextToken = Maybe Text
a} :: GetBotChannelAssociations)

-- | The name of the Amazon Lex bot in the association.
getBotChannelAssociations_botName :: Lens.Lens' GetBotChannelAssociations Prelude.Text
getBotChannelAssociations_botName :: Lens' GetBotChannelAssociations Text
getBotChannelAssociations_botName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotChannelAssociations' {Text
botName :: Text
$sel:botName:GetBotChannelAssociations' :: GetBotChannelAssociations -> Text
botName} -> Text
botName) (\s :: GetBotChannelAssociations
s@GetBotChannelAssociations' {} Text
a -> GetBotChannelAssociations
s {$sel:botName:GetBotChannelAssociations' :: Text
botName = Text
a} :: GetBotChannelAssociations)

-- | An alias pointing to the specific version of the Amazon Lex bot to which
-- this association is being made.
getBotChannelAssociations_botAlias :: Lens.Lens' GetBotChannelAssociations Prelude.Text
getBotChannelAssociations_botAlias :: Lens' GetBotChannelAssociations Text
getBotChannelAssociations_botAlias = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotChannelAssociations' {Text
botAlias :: Text
$sel:botAlias:GetBotChannelAssociations' :: GetBotChannelAssociations -> Text
botAlias} -> Text
botAlias) (\s :: GetBotChannelAssociations
s@GetBotChannelAssociations' {} Text
a -> GetBotChannelAssociations
s {$sel:botAlias:GetBotChannelAssociations' :: Text
botAlias = Text
a} :: GetBotChannelAssociations)

instance Core.AWSPager GetBotChannelAssociations where
  page :: GetBotChannelAssociations
-> AWSResponse GetBotChannelAssociations
-> Maybe GetBotChannelAssociations
page GetBotChannelAssociations
rq AWSResponse GetBotChannelAssociations
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetBotChannelAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetBotChannelAssociationsResponse (Maybe Text)
getBotChannelAssociationsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetBotChannelAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  GetBotChannelAssociationsResponse (Maybe [BotChannelAssociation])
getBotChannelAssociationsResponse_botChannelAssociations
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ GetBotChannelAssociations
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetBotChannelAssociations (Maybe Text)
getBotChannelAssociations_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetBotChannelAssociations
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetBotChannelAssociationsResponse (Maybe Text)
getBotChannelAssociationsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest GetBotChannelAssociations where
  type
    AWSResponse GetBotChannelAssociations =
      GetBotChannelAssociationsResponse
  request :: (Service -> Service)
-> GetBotChannelAssociations -> Request GetBotChannelAssociations
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetBotChannelAssociations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetBotChannelAssociations)))
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 [BotChannelAssociation]
-> Maybe Text -> Int -> GetBotChannelAssociationsResponse
GetBotChannelAssociationsResponse'
            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
"botChannelAssociations"
                            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 GetBotChannelAssociations where
  hashWithSalt :: Int -> GetBotChannelAssociations -> Int
hashWithSalt Int
_salt GetBotChannelAssociations' {Maybe Natural
Maybe Text
Text
botAlias :: Text
botName :: Text
nextToken :: Maybe Text
nameContains :: Maybe Text
maxResults :: Maybe Natural
$sel:botAlias:GetBotChannelAssociations' :: GetBotChannelAssociations -> Text
$sel:botName:GetBotChannelAssociations' :: GetBotChannelAssociations -> Text
$sel:nextToken:GetBotChannelAssociations' :: GetBotChannelAssociations -> Maybe Text
$sel:nameContains:GetBotChannelAssociations' :: GetBotChannelAssociations -> Maybe Text
$sel:maxResults:GetBotChannelAssociations' :: GetBotChannelAssociations -> 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
nameContains
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botAlias

instance Prelude.NFData GetBotChannelAssociations where
  rnf :: GetBotChannelAssociations -> ()
rnf GetBotChannelAssociations' {Maybe Natural
Maybe Text
Text
botAlias :: Text
botName :: Text
nextToken :: Maybe Text
nameContains :: Maybe Text
maxResults :: Maybe Natural
$sel:botAlias:GetBotChannelAssociations' :: GetBotChannelAssociations -> Text
$sel:botName:GetBotChannelAssociations' :: GetBotChannelAssociations -> Text
$sel:nextToken:GetBotChannelAssociations' :: GetBotChannelAssociations -> Maybe Text
$sel:nameContains:GetBotChannelAssociations' :: GetBotChannelAssociations -> Maybe Text
$sel:maxResults:GetBotChannelAssociations' :: GetBotChannelAssociations -> 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
nameContains
      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 Text
botName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
botAlias

instance Data.ToHeaders GetBotChannelAssociations where
  toHeaders :: GetBotChannelAssociations -> 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.ToPath GetBotChannelAssociations where
  toPath :: GetBotChannelAssociations -> ByteString
toPath GetBotChannelAssociations' {Maybe Natural
Maybe Text
Text
botAlias :: Text
botName :: Text
nextToken :: Maybe Text
nameContains :: Maybe Text
maxResults :: Maybe Natural
$sel:botAlias:GetBotChannelAssociations' :: GetBotChannelAssociations -> Text
$sel:botName:GetBotChannelAssociations' :: GetBotChannelAssociations -> Text
$sel:nextToken:GetBotChannelAssociations' :: GetBotChannelAssociations -> Maybe Text
$sel:nameContains:GetBotChannelAssociations' :: GetBotChannelAssociations -> Maybe Text
$sel:maxResults:GetBotChannelAssociations' :: GetBotChannelAssociations -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/bots/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
botName,
        ByteString
"/aliases/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
botAlias,
        ByteString
"/channels/"
      ]

instance Data.ToQuery GetBotChannelAssociations where
  toQuery :: GetBotChannelAssociations -> QueryString
toQuery GetBotChannelAssociations' {Maybe Natural
Maybe Text
Text
botAlias :: Text
botName :: Text
nextToken :: Maybe Text
nameContains :: Maybe Text
maxResults :: Maybe Natural
$sel:botAlias:GetBotChannelAssociations' :: GetBotChannelAssociations -> Text
$sel:botName:GetBotChannelAssociations' :: GetBotChannelAssociations -> Text
$sel:nextToken:GetBotChannelAssociations' :: GetBotChannelAssociations -> Maybe Text
$sel:nameContains:GetBotChannelAssociations' :: GetBotChannelAssociations -> Maybe Text
$sel:maxResults:GetBotChannelAssociations' :: GetBotChannelAssociations -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"nameContains" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nameContains,
        ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | /See:/ 'newGetBotChannelAssociationsResponse' smart constructor.
data GetBotChannelAssociationsResponse = GetBotChannelAssociationsResponse'
  { -- | An array of objects, one for each association, that provides information
    -- about the Amazon Lex bot and its association with the channel.
    GetBotChannelAssociationsResponse -> Maybe [BotChannelAssociation]
botChannelAssociations :: Prelude.Maybe [BotChannelAssociation],
    -- | A pagination token that fetches the next page of associations. If the
    -- response to this call is truncated, Amazon Lex returns a pagination
    -- token in the response. To fetch the next page of associations, specify
    -- the pagination token in the next request.
    GetBotChannelAssociationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetBotChannelAssociationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetBotChannelAssociationsResponse
-> GetBotChannelAssociationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBotChannelAssociationsResponse
-> GetBotChannelAssociationsResponse -> Bool
$c/= :: GetBotChannelAssociationsResponse
-> GetBotChannelAssociationsResponse -> Bool
== :: GetBotChannelAssociationsResponse
-> GetBotChannelAssociationsResponse -> Bool
$c== :: GetBotChannelAssociationsResponse
-> GetBotChannelAssociationsResponse -> Bool
Prelude.Eq, Int -> GetBotChannelAssociationsResponse -> ShowS
[GetBotChannelAssociationsResponse] -> ShowS
GetBotChannelAssociationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBotChannelAssociationsResponse] -> ShowS
$cshowList :: [GetBotChannelAssociationsResponse] -> ShowS
show :: GetBotChannelAssociationsResponse -> String
$cshow :: GetBotChannelAssociationsResponse -> String
showsPrec :: Int -> GetBotChannelAssociationsResponse -> ShowS
$cshowsPrec :: Int -> GetBotChannelAssociationsResponse -> ShowS
Prelude.Show, forall x.
Rep GetBotChannelAssociationsResponse x
-> GetBotChannelAssociationsResponse
forall x.
GetBotChannelAssociationsResponse
-> Rep GetBotChannelAssociationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBotChannelAssociationsResponse x
-> GetBotChannelAssociationsResponse
$cfrom :: forall x.
GetBotChannelAssociationsResponse
-> Rep GetBotChannelAssociationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetBotChannelAssociationsResponse' 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:
--
-- 'botChannelAssociations', 'getBotChannelAssociationsResponse_botChannelAssociations' - An array of objects, one for each association, that provides information
-- about the Amazon Lex bot and its association with the channel.
--
-- 'nextToken', 'getBotChannelAssociationsResponse_nextToken' - A pagination token that fetches the next page of associations. If the
-- response to this call is truncated, Amazon Lex returns a pagination
-- token in the response. To fetch the next page of associations, specify
-- the pagination token in the next request.
--
-- 'httpStatus', 'getBotChannelAssociationsResponse_httpStatus' - The response's http status code.
newGetBotChannelAssociationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetBotChannelAssociationsResponse
newGetBotChannelAssociationsResponse :: Int -> GetBotChannelAssociationsResponse
newGetBotChannelAssociationsResponse Int
pHttpStatus_ =
  GetBotChannelAssociationsResponse'
    { $sel:botChannelAssociations:GetBotChannelAssociationsResponse' :: Maybe [BotChannelAssociation]
botChannelAssociations =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetBotChannelAssociationsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetBotChannelAssociationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of objects, one for each association, that provides information
-- about the Amazon Lex bot and its association with the channel.
getBotChannelAssociationsResponse_botChannelAssociations :: Lens.Lens' GetBotChannelAssociationsResponse (Prelude.Maybe [BotChannelAssociation])
getBotChannelAssociationsResponse_botChannelAssociations :: Lens'
  GetBotChannelAssociationsResponse (Maybe [BotChannelAssociation])
getBotChannelAssociationsResponse_botChannelAssociations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotChannelAssociationsResponse' {Maybe [BotChannelAssociation]
botChannelAssociations :: Maybe [BotChannelAssociation]
$sel:botChannelAssociations:GetBotChannelAssociationsResponse' :: GetBotChannelAssociationsResponse -> Maybe [BotChannelAssociation]
botChannelAssociations} -> Maybe [BotChannelAssociation]
botChannelAssociations) (\s :: GetBotChannelAssociationsResponse
s@GetBotChannelAssociationsResponse' {} Maybe [BotChannelAssociation]
a -> GetBotChannelAssociationsResponse
s {$sel:botChannelAssociations:GetBotChannelAssociationsResponse' :: Maybe [BotChannelAssociation]
botChannelAssociations = Maybe [BotChannelAssociation]
a} :: GetBotChannelAssociationsResponse) 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

-- | A pagination token that fetches the next page of associations. If the
-- response to this call is truncated, Amazon Lex returns a pagination
-- token in the response. To fetch the next page of associations, specify
-- the pagination token in the next request.
getBotChannelAssociationsResponse_nextToken :: Lens.Lens' GetBotChannelAssociationsResponse (Prelude.Maybe Prelude.Text)
getBotChannelAssociationsResponse_nextToken :: Lens' GetBotChannelAssociationsResponse (Maybe Text)
getBotChannelAssociationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotChannelAssociationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetBotChannelAssociationsResponse' :: GetBotChannelAssociationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetBotChannelAssociationsResponse
s@GetBotChannelAssociationsResponse' {} Maybe Text
a -> GetBotChannelAssociationsResponse
s {$sel:nextToken:GetBotChannelAssociationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetBotChannelAssociationsResponse)

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

instance
  Prelude.NFData
    GetBotChannelAssociationsResponse
  where
  rnf :: GetBotChannelAssociationsResponse -> ()
rnf GetBotChannelAssociationsResponse' {Int
Maybe [BotChannelAssociation]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
botChannelAssociations :: Maybe [BotChannelAssociation]
$sel:httpStatus:GetBotChannelAssociationsResponse' :: GetBotChannelAssociationsResponse -> Int
$sel:nextToken:GetBotChannelAssociationsResponse' :: GetBotChannelAssociationsResponse -> Maybe Text
$sel:botChannelAssociations:GetBotChannelAssociationsResponse' :: GetBotChannelAssociationsResponse -> Maybe [BotChannelAssociation]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [BotChannelAssociation]
botChannelAssociations
      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