{-# 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.GetBotAliases
-- 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)
--
-- Returns a list of aliases for a specified Amazon Lex bot.
--
-- This operation requires permissions for the @lex:GetBotAliases@ action.
--
-- This operation returns paginated results.
module Amazonka.LexModels.GetBotAliases
  ( -- * Creating a Request
    GetBotAliases (..),
    newGetBotAliases,

    -- * Request Lenses
    getBotAliases_nameContains,
    getBotAliases_nextToken,
    getBotAliases_maxResults,
    getBotAliases_botName,

    -- * Destructuring the Response
    GetBotAliasesResponse (..),
    newGetBotAliasesResponse,

    -- * Response Lenses
    getBotAliasesResponse_nextToken,
    getBotAliasesResponse_botAliases,
    getBotAliasesResponse_httpStatus,
  )
where

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

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

-- |
-- Create a value of 'GetBotAliases' 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:
--
-- 'nameContains', 'getBotAliases_nameContains' - Substring to match in bot alias names. An alias will be returned if any
-- part of its name matches the substring. For example, \"xyz\" matches
-- both \"xyzabc\" and \"abcxyz.\"
--
-- 'nextToken', 'getBotAliases_nextToken' - A pagination token for fetching the next page of aliases. If the
-- response to this call is truncated, Amazon Lex returns a pagination
-- token in the response. To fetch the next page of aliases, specify the
-- pagination token in the next request.
--
-- 'maxResults', 'getBotAliases_maxResults' - The maximum number of aliases to return in the response. The default is
-- 50. .
--
-- 'botName', 'getBotAliases_botName' - The name of the bot.
newGetBotAliases ::
  -- | 'botName'
  Prelude.Text ->
  GetBotAliases
newGetBotAliases :: Text -> GetBotAliases
newGetBotAliases Text
pBotName_ =
  GetBotAliases' :: Maybe Text -> Maybe Text -> Maybe Natural -> Text -> GetBotAliases
GetBotAliases'
    { $sel:nameContains:GetBotAliases' :: Maybe Text
nameContains = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetBotAliases' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetBotAliases' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:botName:GetBotAliases' :: Text
botName = Text
pBotName_
    }

-- | Substring to match in bot alias names. An alias will be returned if any
-- part of its name matches the substring. For example, \"xyz\" matches
-- both \"xyzabc\" and \"abcxyz.\"
getBotAliases_nameContains :: Lens.Lens' GetBotAliases (Prelude.Maybe Prelude.Text)
getBotAliases_nameContains :: (Maybe Text -> f (Maybe Text)) -> GetBotAliases -> f GetBotAliases
getBotAliases_nameContains = (GetBotAliases -> Maybe Text)
-> (GetBotAliases -> Maybe Text -> GetBotAliases)
-> Lens GetBotAliases GetBotAliases (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotAliases' {Maybe Text
nameContains :: Maybe Text
$sel:nameContains:GetBotAliases' :: GetBotAliases -> Maybe Text
nameContains} -> Maybe Text
nameContains) (\s :: GetBotAliases
s@GetBotAliases' {} Maybe Text
a -> GetBotAliases
s {$sel:nameContains:GetBotAliases' :: Maybe Text
nameContains = Maybe Text
a} :: GetBotAliases)

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

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

-- | The name of the bot.
getBotAliases_botName :: Lens.Lens' GetBotAliases Prelude.Text
getBotAliases_botName :: (Text -> f Text) -> GetBotAliases -> f GetBotAliases
getBotAliases_botName = (GetBotAliases -> Text)
-> (GetBotAliases -> Text -> GetBotAliases)
-> Lens GetBotAliases GetBotAliases Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotAliases' {Text
botName :: Text
$sel:botName:GetBotAliases' :: GetBotAliases -> Text
botName} -> Text
botName) (\s :: GetBotAliases
s@GetBotAliases' {} Text
a -> GetBotAliases
s {$sel:botName:GetBotAliases' :: Text
botName = Text
a} :: GetBotAliases)

instance Core.AWSPager GetBotAliases where
  page :: GetBotAliases -> AWSResponse GetBotAliases -> Maybe GetBotAliases
page GetBotAliases
rq AWSResponse GetBotAliases
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetBotAliases
GetBotAliasesResponse
rs
            GetBotAliasesResponse
-> Getting (First Text) GetBotAliasesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetBotAliasesResponse
-> Const (First Text) GetBotAliasesResponse
Lens' GetBotAliasesResponse (Maybe Text)
getBotAliasesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetBotAliasesResponse
 -> Const (First Text) GetBotAliasesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetBotAliasesResponse 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 GetBotAliases
forall a. Maybe a
Prelude.Nothing
    | Maybe [BotAliasMetadata] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetBotAliases
GetBotAliasesResponse
rs
            GetBotAliasesResponse
-> Getting
     (First [BotAliasMetadata]) GetBotAliasesResponse [BotAliasMetadata]
-> Maybe [BotAliasMetadata]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [BotAliasMetadata]
 -> Const (First [BotAliasMetadata]) (Maybe [BotAliasMetadata]))
-> GetBotAliasesResponse
-> Const (First [BotAliasMetadata]) GetBotAliasesResponse
Lens' GetBotAliasesResponse (Maybe [BotAliasMetadata])
getBotAliasesResponse_botAliases
              ((Maybe [BotAliasMetadata]
  -> Const (First [BotAliasMetadata]) (Maybe [BotAliasMetadata]))
 -> GetBotAliasesResponse
 -> Const (First [BotAliasMetadata]) GetBotAliasesResponse)
-> (([BotAliasMetadata]
     -> Const (First [BotAliasMetadata]) [BotAliasMetadata])
    -> Maybe [BotAliasMetadata]
    -> Const (First [BotAliasMetadata]) (Maybe [BotAliasMetadata]))
-> Getting
     (First [BotAliasMetadata]) GetBotAliasesResponse [BotAliasMetadata]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BotAliasMetadata]
 -> Const (First [BotAliasMetadata]) [BotAliasMetadata])
-> Maybe [BotAliasMetadata]
-> Const (First [BotAliasMetadata]) (Maybe [BotAliasMetadata])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetBotAliases
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetBotAliases -> Maybe GetBotAliases
forall a. a -> Maybe a
Prelude.Just (GetBotAliases -> Maybe GetBotAliases)
-> GetBotAliases -> Maybe GetBotAliases
forall a b. (a -> b) -> a -> b
Prelude.$
        GetBotAliases
rq
          GetBotAliases -> (GetBotAliases -> GetBotAliases) -> GetBotAliases
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetBotAliases -> Identity GetBotAliases
Lens GetBotAliases GetBotAliases (Maybe Text) (Maybe Text)
getBotAliases_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> GetBotAliases -> Identity GetBotAliases)
-> Maybe Text -> GetBotAliases -> GetBotAliases
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetBotAliases
GetBotAliasesResponse
rs
          GetBotAliasesResponse
-> Getting (First Text) GetBotAliasesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetBotAliasesResponse
-> Const (First Text) GetBotAliasesResponse
Lens' GetBotAliasesResponse (Maybe Text)
getBotAliasesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetBotAliasesResponse
 -> Const (First Text) GetBotAliasesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetBotAliasesResponse 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 GetBotAliases where
  type
    AWSResponse GetBotAliases =
      GetBotAliasesResponse
  request :: GetBotAliases -> Request GetBotAliases
request = Service -> GetBotAliases -> Request GetBotAliases
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetBotAliases
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetBotAliases)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetBotAliases))
-> Logger
-> Service
-> Proxy GetBotAliases
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetBotAliases)))
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 [BotAliasMetadata] -> Int -> GetBotAliasesResponse
GetBotAliasesResponse'
            (Maybe Text
 -> Maybe [BotAliasMetadata] -> Int -> GetBotAliasesResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [BotAliasMetadata] -> Int -> GetBotAliasesResponse)
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 [BotAliasMetadata] -> Int -> GetBotAliasesResponse)
-> Either String (Maybe [BotAliasMetadata])
-> Either String (Int -> GetBotAliasesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [BotAliasMetadata]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"BotAliases" Either String (Maybe (Maybe [BotAliasMetadata]))
-> Maybe [BotAliasMetadata]
-> Either String (Maybe [BotAliasMetadata])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [BotAliasMetadata]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> GetBotAliasesResponse)
-> Either String Int -> Either String GetBotAliasesResponse
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 GetBotAliases

instance Prelude.NFData GetBotAliases

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

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

-- | /See:/ 'newGetBotAliasesResponse' smart constructor.
data GetBotAliasesResponse = GetBotAliasesResponse'
  { -- | A pagination token for fetching next page of aliases. If the response to
    -- this call is truncated, Amazon Lex returns a pagination token in the
    -- response. To fetch the next page of aliases, specify the pagination
    -- token in the next request.
    GetBotAliasesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of @BotAliasMetadata@ objects, each describing a bot alias.
    GetBotAliasesResponse -> Maybe [BotAliasMetadata]
botAliases :: Prelude.Maybe [BotAliasMetadata],
    -- | The response's http status code.
    GetBotAliasesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetBotAliasesResponse -> GetBotAliasesResponse -> Bool
(GetBotAliasesResponse -> GetBotAliasesResponse -> Bool)
-> (GetBotAliasesResponse -> GetBotAliasesResponse -> Bool)
-> Eq GetBotAliasesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBotAliasesResponse -> GetBotAliasesResponse -> Bool
$c/= :: GetBotAliasesResponse -> GetBotAliasesResponse -> Bool
== :: GetBotAliasesResponse -> GetBotAliasesResponse -> Bool
$c== :: GetBotAliasesResponse -> GetBotAliasesResponse -> Bool
Prelude.Eq, ReadPrec [GetBotAliasesResponse]
ReadPrec GetBotAliasesResponse
Int -> ReadS GetBotAliasesResponse
ReadS [GetBotAliasesResponse]
(Int -> ReadS GetBotAliasesResponse)
-> ReadS [GetBotAliasesResponse]
-> ReadPrec GetBotAliasesResponse
-> ReadPrec [GetBotAliasesResponse]
-> Read GetBotAliasesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBotAliasesResponse]
$creadListPrec :: ReadPrec [GetBotAliasesResponse]
readPrec :: ReadPrec GetBotAliasesResponse
$creadPrec :: ReadPrec GetBotAliasesResponse
readList :: ReadS [GetBotAliasesResponse]
$creadList :: ReadS [GetBotAliasesResponse]
readsPrec :: Int -> ReadS GetBotAliasesResponse
$creadsPrec :: Int -> ReadS GetBotAliasesResponse
Prelude.Read, Int -> GetBotAliasesResponse -> ShowS
[GetBotAliasesResponse] -> ShowS
GetBotAliasesResponse -> String
(Int -> GetBotAliasesResponse -> ShowS)
-> (GetBotAliasesResponse -> String)
-> ([GetBotAliasesResponse] -> ShowS)
-> Show GetBotAliasesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBotAliasesResponse] -> ShowS
$cshowList :: [GetBotAliasesResponse] -> ShowS
show :: GetBotAliasesResponse -> String
$cshow :: GetBotAliasesResponse -> String
showsPrec :: Int -> GetBotAliasesResponse -> ShowS
$cshowsPrec :: Int -> GetBotAliasesResponse -> ShowS
Prelude.Show, (forall x. GetBotAliasesResponse -> Rep GetBotAliasesResponse x)
-> (forall x. Rep GetBotAliasesResponse x -> GetBotAliasesResponse)
-> Generic GetBotAliasesResponse
forall x. Rep GetBotAliasesResponse x -> GetBotAliasesResponse
forall x. GetBotAliasesResponse -> Rep GetBotAliasesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetBotAliasesResponse x -> GetBotAliasesResponse
$cfrom :: forall x. GetBotAliasesResponse -> Rep GetBotAliasesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetBotAliasesResponse' 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', 'getBotAliasesResponse_nextToken' - A pagination token for fetching next page of aliases. If the response to
-- this call is truncated, Amazon Lex returns a pagination token in the
-- response. To fetch the next page of aliases, specify the pagination
-- token in the next request.
--
-- 'botAliases', 'getBotAliasesResponse_botAliases' - An array of @BotAliasMetadata@ objects, each describing a bot alias.
--
-- 'httpStatus', 'getBotAliasesResponse_httpStatus' - The response's http status code.
newGetBotAliasesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetBotAliasesResponse
newGetBotAliasesResponse :: Int -> GetBotAliasesResponse
newGetBotAliasesResponse Int
pHttpStatus_ =
  GetBotAliasesResponse' :: Maybe Text
-> Maybe [BotAliasMetadata] -> Int -> GetBotAliasesResponse
GetBotAliasesResponse'
    { $sel:nextToken:GetBotAliasesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:botAliases:GetBotAliasesResponse' :: Maybe [BotAliasMetadata]
botAliases = Maybe [BotAliasMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetBotAliasesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | An array of @BotAliasMetadata@ objects, each describing a bot alias.
getBotAliasesResponse_botAliases :: Lens.Lens' GetBotAliasesResponse (Prelude.Maybe [BotAliasMetadata])
getBotAliasesResponse_botAliases :: (Maybe [BotAliasMetadata] -> f (Maybe [BotAliasMetadata]))
-> GetBotAliasesResponse -> f GetBotAliasesResponse
getBotAliasesResponse_botAliases = (GetBotAliasesResponse -> Maybe [BotAliasMetadata])
-> (GetBotAliasesResponse
    -> Maybe [BotAliasMetadata] -> GetBotAliasesResponse)
-> Lens' GetBotAliasesResponse (Maybe [BotAliasMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotAliasesResponse' {Maybe [BotAliasMetadata]
botAliases :: Maybe [BotAliasMetadata]
$sel:botAliases:GetBotAliasesResponse' :: GetBotAliasesResponse -> Maybe [BotAliasMetadata]
botAliases} -> Maybe [BotAliasMetadata]
botAliases) (\s :: GetBotAliasesResponse
s@GetBotAliasesResponse' {} Maybe [BotAliasMetadata]
a -> GetBotAliasesResponse
s {$sel:botAliases:GetBotAliasesResponse' :: Maybe [BotAliasMetadata]
botAliases = Maybe [BotAliasMetadata]
a} :: GetBotAliasesResponse) ((Maybe [BotAliasMetadata] -> f (Maybe [BotAliasMetadata]))
 -> GetBotAliasesResponse -> f GetBotAliasesResponse)
-> ((Maybe [BotAliasMetadata] -> f (Maybe [BotAliasMetadata]))
    -> Maybe [BotAliasMetadata] -> f (Maybe [BotAliasMetadata]))
-> (Maybe [BotAliasMetadata] -> f (Maybe [BotAliasMetadata]))
-> GetBotAliasesResponse
-> f GetBotAliasesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [BotAliasMetadata]
  [BotAliasMetadata]
  [BotAliasMetadata]
  [BotAliasMetadata]
-> Iso
     (Maybe [BotAliasMetadata])
     (Maybe [BotAliasMetadata])
     (Maybe [BotAliasMetadata])
     (Maybe [BotAliasMetadata])
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
  [BotAliasMetadata]
  [BotAliasMetadata]
  [BotAliasMetadata]
  [BotAliasMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetBotAliasesResponse