{-# 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.GetBots
-- 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 bot information as follows:
--
-- -   If you provide the @nameContains@ field, the response includes
--     information for the @$LATEST@ version of all bots whose name
--     contains the specified string.
--
-- -   If you don\'t specify the @nameContains@ field, the operation
--     returns information about the @$LATEST@ version of all of your bots.
--
-- This operation requires permission for the @lex:GetBots@ action.
--
-- This operation returns paginated results.
module Amazonka.LexModels.GetBots
  ( -- * Creating a Request
    GetBots (..),
    newGetBots,

    -- * Request Lenses
    getBots_nameContains,
    getBots_nextToken,
    getBots_maxResults,

    -- * Destructuring the Response
    GetBotsResponse (..),
    newGetBotsResponse,

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

-- |
-- Create a value of 'GetBots' 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', 'getBots_nameContains' - Substring to match in bot names. A bot will be returned if any part of
-- its name matches the substring. For example, \"xyz\" matches both
-- \"xyzabc\" and \"abcxyz.\"
--
-- 'nextToken', 'getBots_nextToken' - A pagination token that fetches the next page of bots. If the response
-- to this call is truncated, Amazon Lex returns a pagination token in the
-- response. To fetch the next page of bots, specify the pagination token
-- in the next request.
--
-- 'maxResults', 'getBots_maxResults' - The maximum number of bots to return in the response that the request
-- will return. The default is 10.
newGetBots ::
  GetBots
newGetBots :: GetBots
newGetBots =
  GetBots' :: Maybe Text -> Maybe Text -> Maybe Natural -> GetBots
GetBots'
    { $sel:nameContains:GetBots' :: Maybe Text
nameContains = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetBots' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetBots' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

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

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

-- | The maximum number of bots to return in the response that the request
-- will return. The default is 10.
getBots_maxResults :: Lens.Lens' GetBots (Prelude.Maybe Prelude.Natural)
getBots_maxResults :: (Maybe Natural -> f (Maybe Natural)) -> GetBots -> f GetBots
getBots_maxResults = (GetBots -> Maybe Natural)
-> (GetBots -> Maybe Natural -> GetBots)
-> Lens GetBots GetBots (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBots' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetBots' :: GetBots -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetBots
s@GetBots' {} Maybe Natural
a -> GetBots
s {$sel:maxResults:GetBots' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetBots)

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

instance Prelude.NFData GetBots

instance Core.ToHeaders GetBots where
  toHeaders :: GetBots -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetBots -> 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 GetBots where
  toPath :: GetBots -> ByteString
toPath = ByteString -> GetBots -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/bots/"

instance Core.ToQuery GetBots where
  toQuery :: GetBots -> QueryString
toQuery GetBots' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
nameContains :: Maybe Text
$sel:maxResults:GetBots' :: GetBots -> Maybe Natural
$sel:nextToken:GetBots' :: GetBots -> Maybe Text
$sel:nameContains:GetBots' :: GetBots -> 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:/ 'newGetBotsResponse' smart constructor.
data GetBotsResponse = GetBotsResponse'
  { -- | An array of @botMetadata@ objects, with one entry for each bot.
    GetBotsResponse -> Maybe [BotMetadata]
bots :: Prelude.Maybe [BotMetadata],
    -- | If the response is truncated, it includes a pagination token that you
    -- can specify in your next request to fetch the next page of bots.
    GetBotsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetBotsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetBotsResponse -> GetBotsResponse -> Bool
(GetBotsResponse -> GetBotsResponse -> Bool)
-> (GetBotsResponse -> GetBotsResponse -> Bool)
-> Eq GetBotsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBotsResponse -> GetBotsResponse -> Bool
$c/= :: GetBotsResponse -> GetBotsResponse -> Bool
== :: GetBotsResponse -> GetBotsResponse -> Bool
$c== :: GetBotsResponse -> GetBotsResponse -> Bool
Prelude.Eq, ReadPrec [GetBotsResponse]
ReadPrec GetBotsResponse
Int -> ReadS GetBotsResponse
ReadS [GetBotsResponse]
(Int -> ReadS GetBotsResponse)
-> ReadS [GetBotsResponse]
-> ReadPrec GetBotsResponse
-> ReadPrec [GetBotsResponse]
-> Read GetBotsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBotsResponse]
$creadListPrec :: ReadPrec [GetBotsResponse]
readPrec :: ReadPrec GetBotsResponse
$creadPrec :: ReadPrec GetBotsResponse
readList :: ReadS [GetBotsResponse]
$creadList :: ReadS [GetBotsResponse]
readsPrec :: Int -> ReadS GetBotsResponse
$creadsPrec :: Int -> ReadS GetBotsResponse
Prelude.Read, Int -> GetBotsResponse -> ShowS
[GetBotsResponse] -> ShowS
GetBotsResponse -> String
(Int -> GetBotsResponse -> ShowS)
-> (GetBotsResponse -> String)
-> ([GetBotsResponse] -> ShowS)
-> Show GetBotsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBotsResponse] -> ShowS
$cshowList :: [GetBotsResponse] -> ShowS
show :: GetBotsResponse -> String
$cshow :: GetBotsResponse -> String
showsPrec :: Int -> GetBotsResponse -> ShowS
$cshowsPrec :: Int -> GetBotsResponse -> ShowS
Prelude.Show, (forall x. GetBotsResponse -> Rep GetBotsResponse x)
-> (forall x. Rep GetBotsResponse x -> GetBotsResponse)
-> Generic GetBotsResponse
forall x. Rep GetBotsResponse x -> GetBotsResponse
forall x. GetBotsResponse -> Rep GetBotsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetBotsResponse x -> GetBotsResponse
$cfrom :: forall x. GetBotsResponse -> Rep GetBotsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetBotsResponse' 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:
--
-- 'bots', 'getBotsResponse_bots' - An array of @botMetadata@ objects, with one entry for each bot.
--
-- 'nextToken', 'getBotsResponse_nextToken' - If the response is truncated, it includes a pagination token that you
-- can specify in your next request to fetch the next page of bots.
--
-- 'httpStatus', 'getBotsResponse_httpStatus' - The response's http status code.
newGetBotsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetBotsResponse
newGetBotsResponse :: Int -> GetBotsResponse
newGetBotsResponse Int
pHttpStatus_ =
  GetBotsResponse' :: Maybe [BotMetadata] -> Maybe Text -> Int -> GetBotsResponse
GetBotsResponse'
    { $sel:bots:GetBotsResponse' :: Maybe [BotMetadata]
bots = Maybe [BotMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetBotsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetBotsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of @botMetadata@ objects, with one entry for each bot.
getBotsResponse_bots :: Lens.Lens' GetBotsResponse (Prelude.Maybe [BotMetadata])
getBotsResponse_bots :: (Maybe [BotMetadata] -> f (Maybe [BotMetadata]))
-> GetBotsResponse -> f GetBotsResponse
getBotsResponse_bots = (GetBotsResponse -> Maybe [BotMetadata])
-> (GetBotsResponse -> Maybe [BotMetadata] -> GetBotsResponse)
-> Lens' GetBotsResponse (Maybe [BotMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotsResponse' {Maybe [BotMetadata]
bots :: Maybe [BotMetadata]
$sel:bots:GetBotsResponse' :: GetBotsResponse -> Maybe [BotMetadata]
bots} -> Maybe [BotMetadata]
bots) (\s :: GetBotsResponse
s@GetBotsResponse' {} Maybe [BotMetadata]
a -> GetBotsResponse
s {$sel:bots:GetBotsResponse' :: Maybe [BotMetadata]
bots = Maybe [BotMetadata]
a} :: GetBotsResponse) ((Maybe [BotMetadata] -> f (Maybe [BotMetadata]))
 -> GetBotsResponse -> f GetBotsResponse)
-> ((Maybe [BotMetadata] -> f (Maybe [BotMetadata]))
    -> Maybe [BotMetadata] -> f (Maybe [BotMetadata]))
-> (Maybe [BotMetadata] -> f (Maybe [BotMetadata]))
-> GetBotsResponse
-> f GetBotsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [BotMetadata] [BotMetadata] [BotMetadata] [BotMetadata]
-> Iso
     (Maybe [BotMetadata])
     (Maybe [BotMetadata])
     (Maybe [BotMetadata])
     (Maybe [BotMetadata])
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 [BotMetadata] [BotMetadata] [BotMetadata] [BotMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the response is truncated, it includes a pagination token that you
-- can specify in your next request to fetch the next page of bots.
getBotsResponse_nextToken :: Lens.Lens' GetBotsResponse (Prelude.Maybe Prelude.Text)
getBotsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetBotsResponse -> f GetBotsResponse
getBotsResponse_nextToken = (GetBotsResponse -> Maybe Text)
-> (GetBotsResponse -> Maybe Text -> GetBotsResponse)
-> Lens' GetBotsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetBotsResponse' :: GetBotsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetBotsResponse
s@GetBotsResponse' {} Maybe Text
a -> GetBotsResponse
s {$sel:nextToken:GetBotsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetBotsResponse)

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

instance Prelude.NFData GetBotsResponse