{-# 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.GetIntents
-- 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 intent information as follows:
--
-- -   If you specify the @nameContains@ field, returns the @$LATEST@
--     version of all intents that contain the specified string.
--
-- -   If you don\'t specify the @nameContains@ field, returns information
--     about the @$LATEST@ version of all intents.
--
-- The operation requires permission for the @lex:GetIntents@ action.
--
-- This operation returns paginated results.
module Amazonka.LexModels.GetIntents
  ( -- * Creating a Request
    GetIntents (..),
    newGetIntents,

    -- * Request Lenses
    getIntents_nameContains,
    getIntents_nextToken,
    getIntents_maxResults,

    -- * Destructuring the Response
    GetIntentsResponse (..),
    newGetIntentsResponse,

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

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

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

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

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

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

instance Prelude.NFData GetIntents

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

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

-- |
-- Create a value of 'GetIntentsResponse' 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:
--
-- 'intents', 'getIntentsResponse_intents' - An array of @Intent@ objects. For more information, see PutBot.
--
-- 'nextToken', 'getIntentsResponse_nextToken' - If the response is truncated, the response includes a pagination token
-- that you can specify in your next request to fetch the next page of
-- intents.
--
-- 'httpStatus', 'getIntentsResponse_httpStatus' - The response's http status code.
newGetIntentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetIntentsResponse
newGetIntentsResponse :: Int -> GetIntentsResponse
newGetIntentsResponse Int
pHttpStatus_ =
  GetIntentsResponse' :: Maybe [IntentMetadata] -> Maybe Text -> Int -> GetIntentsResponse
GetIntentsResponse'
    { $sel:intents:GetIntentsResponse' :: Maybe [IntentMetadata]
intents = Maybe [IntentMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetIntentsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetIntentsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of @Intent@ objects. For more information, see PutBot.
getIntentsResponse_intents :: Lens.Lens' GetIntentsResponse (Prelude.Maybe [IntentMetadata])
getIntentsResponse_intents :: (Maybe [IntentMetadata] -> f (Maybe [IntentMetadata]))
-> GetIntentsResponse -> f GetIntentsResponse
getIntentsResponse_intents = (GetIntentsResponse -> Maybe [IntentMetadata])
-> (GetIntentsResponse
    -> Maybe [IntentMetadata] -> GetIntentsResponse)
-> Lens' GetIntentsResponse (Maybe [IntentMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntentsResponse' {Maybe [IntentMetadata]
intents :: Maybe [IntentMetadata]
$sel:intents:GetIntentsResponse' :: GetIntentsResponse -> Maybe [IntentMetadata]
intents} -> Maybe [IntentMetadata]
intents) (\s :: GetIntentsResponse
s@GetIntentsResponse' {} Maybe [IntentMetadata]
a -> GetIntentsResponse
s {$sel:intents:GetIntentsResponse' :: Maybe [IntentMetadata]
intents = Maybe [IntentMetadata]
a} :: GetIntentsResponse) ((Maybe [IntentMetadata] -> f (Maybe [IntentMetadata]))
 -> GetIntentsResponse -> f GetIntentsResponse)
-> ((Maybe [IntentMetadata] -> f (Maybe [IntentMetadata]))
    -> Maybe [IntentMetadata] -> f (Maybe [IntentMetadata]))
-> (Maybe [IntentMetadata] -> f (Maybe [IntentMetadata]))
-> GetIntentsResponse
-> f GetIntentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [IntentMetadata] [IntentMetadata] [IntentMetadata] [IntentMetadata]
-> Iso
     (Maybe [IntentMetadata])
     (Maybe [IntentMetadata])
     (Maybe [IntentMetadata])
     (Maybe [IntentMetadata])
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
  [IntentMetadata] [IntentMetadata] [IntentMetadata] [IntentMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance Prelude.NFData GetIntentsResponse