{-# 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.LexV2Models.ListIntents
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Get a list of intents that meet the specified criteria.
module Amazonka.LexV2Models.ListIntents
  ( -- * Creating a Request
    ListIntents (..),
    newListIntents,

    -- * Request Lenses
    listIntents_filters,
    listIntents_maxResults,
    listIntents_nextToken,
    listIntents_sortBy,
    listIntents_botId,
    listIntents_botVersion,
    listIntents_localeId,

    -- * Destructuring the Response
    ListIntentsResponse (..),
    newListIntentsResponse,

    -- * Response Lenses
    listIntentsResponse_botId,
    listIntentsResponse_botVersion,
    listIntentsResponse_intentSummaries,
    listIntentsResponse_localeId,
    listIntentsResponse_nextToken,
    listIntentsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListIntents' smart constructor.
data ListIntents = ListIntents'
  { -- | Provides the specification of a filter used to limit the intents in the
    -- response to only those that match the filter specification. You can only
    -- specify one filter and only one string to filter on.
    ListIntents -> Maybe (NonEmpty IntentFilter)
filters :: Prelude.Maybe (Prelude.NonEmpty IntentFilter),
    -- | The maximum number of intents to return in each page of results. If
    -- there are fewer results than the max page size, only the actual number
    -- of results are returned.
    ListIntents -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | If the response from the @ListIntents@ operation contains more results
    -- than specified in the @maxResults@ parameter, a token is returned in the
    -- response.
    --
    -- Use the returned token in the @nextToken@ parameter of a @ListIntents@
    -- request to return the next page of results. For a complete set of
    -- results, call the @ListIntents@ operation until the @nextToken@ returned
    -- in the response is null.
    ListIntents -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Determines the sort order for the response from the @ListIntents@
    -- operation. You can choose to sort by the intent name or last updated
    -- date in either ascending or descending order.
    ListIntents -> Maybe IntentSortBy
sortBy :: Prelude.Maybe IntentSortBy,
    -- | The unique identifier of the bot that contains the intent.
    ListIntents -> Text
botId :: Prelude.Text,
    -- | The version of the bot that contains the intent.
    ListIntents -> Text
botVersion :: Prelude.Text,
    -- | The identifier of the language and locale of the intents to list. The
    -- string must match one of the supported locales. For more information,
    -- see
    -- <https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html Supported languages>.
    ListIntents -> Text
localeId :: Prelude.Text
  }
  deriving (ListIntents -> ListIntents -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIntents -> ListIntents -> Bool
$c/= :: ListIntents -> ListIntents -> Bool
== :: ListIntents -> ListIntents -> Bool
$c== :: ListIntents -> ListIntents -> Bool
Prelude.Eq, ReadPrec [ListIntents]
ReadPrec ListIntents
Int -> ReadS ListIntents
ReadS [ListIntents]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIntents]
$creadListPrec :: ReadPrec [ListIntents]
readPrec :: ReadPrec ListIntents
$creadPrec :: ReadPrec ListIntents
readList :: ReadS [ListIntents]
$creadList :: ReadS [ListIntents]
readsPrec :: Int -> ReadS ListIntents
$creadsPrec :: Int -> ReadS ListIntents
Prelude.Read, Int -> ListIntents -> ShowS
[ListIntents] -> ShowS
ListIntents -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIntents] -> ShowS
$cshowList :: [ListIntents] -> ShowS
show :: ListIntents -> String
$cshow :: ListIntents -> String
showsPrec :: Int -> ListIntents -> ShowS
$cshowsPrec :: Int -> ListIntents -> ShowS
Prelude.Show, forall x. Rep ListIntents x -> ListIntents
forall x. ListIntents -> Rep ListIntents x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListIntents x -> ListIntents
$cfrom :: forall x. ListIntents -> Rep ListIntents x
Prelude.Generic)

-- |
-- Create a value of 'ListIntents' 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:
--
-- 'filters', 'listIntents_filters' - Provides the specification of a filter used to limit the intents in the
-- response to only those that match the filter specification. You can only
-- specify one filter and only one string to filter on.
--
-- 'maxResults', 'listIntents_maxResults' - The maximum number of intents to return in each page of results. If
-- there are fewer results than the max page size, only the actual number
-- of results are returned.
--
-- 'nextToken', 'listIntents_nextToken' - If the response from the @ListIntents@ operation contains more results
-- than specified in the @maxResults@ parameter, a token is returned in the
-- response.
--
-- Use the returned token in the @nextToken@ parameter of a @ListIntents@
-- request to return the next page of results. For a complete set of
-- results, call the @ListIntents@ operation until the @nextToken@ returned
-- in the response is null.
--
-- 'sortBy', 'listIntents_sortBy' - Determines the sort order for the response from the @ListIntents@
-- operation. You can choose to sort by the intent name or last updated
-- date in either ascending or descending order.
--
-- 'botId', 'listIntents_botId' - The unique identifier of the bot that contains the intent.
--
-- 'botVersion', 'listIntents_botVersion' - The version of the bot that contains the intent.
--
-- 'localeId', 'listIntents_localeId' - The identifier of the language and locale of the intents to list. The
-- string must match one of the supported locales. For more information,
-- see
-- <https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html Supported languages>.
newListIntents ::
  -- | 'botId'
  Prelude.Text ->
  -- | 'botVersion'
  Prelude.Text ->
  -- | 'localeId'
  Prelude.Text ->
  ListIntents
newListIntents :: Text -> Text -> Text -> ListIntents
newListIntents Text
pBotId_ Text
pBotVersion_ Text
pLocaleId_ =
  ListIntents'
    { $sel:filters:ListIntents' :: Maybe (NonEmpty IntentFilter)
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListIntents' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListIntents' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:ListIntents' :: Maybe IntentSortBy
sortBy = forall a. Maybe a
Prelude.Nothing,
      $sel:botId:ListIntents' :: Text
botId = Text
pBotId_,
      $sel:botVersion:ListIntents' :: Text
botVersion = Text
pBotVersion_,
      $sel:localeId:ListIntents' :: Text
localeId = Text
pLocaleId_
    }

-- | Provides the specification of a filter used to limit the intents in the
-- response to only those that match the filter specification. You can only
-- specify one filter and only one string to filter on.
listIntents_filters :: Lens.Lens' ListIntents (Prelude.Maybe (Prelude.NonEmpty IntentFilter))
listIntents_filters :: Lens' ListIntents (Maybe (NonEmpty IntentFilter))
listIntents_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntents' {Maybe (NonEmpty IntentFilter)
filters :: Maybe (NonEmpty IntentFilter)
$sel:filters:ListIntents' :: ListIntents -> Maybe (NonEmpty IntentFilter)
filters} -> Maybe (NonEmpty IntentFilter)
filters) (\s :: ListIntents
s@ListIntents' {} Maybe (NonEmpty IntentFilter)
a -> ListIntents
s {$sel:filters:ListIntents' :: Maybe (NonEmpty IntentFilter)
filters = Maybe (NonEmpty IntentFilter)
a} :: ListIntents) 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

-- | The maximum number of intents to return in each page of results. If
-- there are fewer results than the max page size, only the actual number
-- of results are returned.
listIntents_maxResults :: Lens.Lens' ListIntents (Prelude.Maybe Prelude.Natural)
listIntents_maxResults :: Lens' ListIntents (Maybe Natural)
listIntents_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntents' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListIntents' :: ListIntents -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListIntents
s@ListIntents' {} Maybe Natural
a -> ListIntents
s {$sel:maxResults:ListIntents' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListIntents)

-- | If the response from the @ListIntents@ operation contains more results
-- than specified in the @maxResults@ parameter, a token is returned in the
-- response.
--
-- Use the returned token in the @nextToken@ parameter of a @ListIntents@
-- request to return the next page of results. For a complete set of
-- results, call the @ListIntents@ operation until the @nextToken@ returned
-- in the response is null.
listIntents_nextToken :: Lens.Lens' ListIntents (Prelude.Maybe Prelude.Text)
listIntents_nextToken :: Lens' ListIntents (Maybe Text)
listIntents_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntents' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIntents' :: ListIntents -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIntents
s@ListIntents' {} Maybe Text
a -> ListIntents
s {$sel:nextToken:ListIntents' :: Maybe Text
nextToken = Maybe Text
a} :: ListIntents)

-- | Determines the sort order for the response from the @ListIntents@
-- operation. You can choose to sort by the intent name or last updated
-- date in either ascending or descending order.
listIntents_sortBy :: Lens.Lens' ListIntents (Prelude.Maybe IntentSortBy)
listIntents_sortBy :: Lens' ListIntents (Maybe IntentSortBy)
listIntents_sortBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntents' {Maybe IntentSortBy
sortBy :: Maybe IntentSortBy
$sel:sortBy:ListIntents' :: ListIntents -> Maybe IntentSortBy
sortBy} -> Maybe IntentSortBy
sortBy) (\s :: ListIntents
s@ListIntents' {} Maybe IntentSortBy
a -> ListIntents
s {$sel:sortBy:ListIntents' :: Maybe IntentSortBy
sortBy = Maybe IntentSortBy
a} :: ListIntents)

-- | The unique identifier of the bot that contains the intent.
listIntents_botId :: Lens.Lens' ListIntents Prelude.Text
listIntents_botId :: Lens' ListIntents Text
listIntents_botId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntents' {Text
botId :: Text
$sel:botId:ListIntents' :: ListIntents -> Text
botId} -> Text
botId) (\s :: ListIntents
s@ListIntents' {} Text
a -> ListIntents
s {$sel:botId:ListIntents' :: Text
botId = Text
a} :: ListIntents)

-- | The version of the bot that contains the intent.
listIntents_botVersion :: Lens.Lens' ListIntents Prelude.Text
listIntents_botVersion :: Lens' ListIntents Text
listIntents_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntents' {Text
botVersion :: Text
$sel:botVersion:ListIntents' :: ListIntents -> Text
botVersion} -> Text
botVersion) (\s :: ListIntents
s@ListIntents' {} Text
a -> ListIntents
s {$sel:botVersion:ListIntents' :: Text
botVersion = Text
a} :: ListIntents)

-- | The identifier of the language and locale of the intents to list. The
-- string must match one of the supported locales. For more information,
-- see
-- <https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html Supported languages>.
listIntents_localeId :: Lens.Lens' ListIntents Prelude.Text
listIntents_localeId :: Lens' ListIntents Text
listIntents_localeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntents' {Text
localeId :: Text
$sel:localeId:ListIntents' :: ListIntents -> Text
localeId} -> Text
localeId) (\s :: ListIntents
s@ListIntents' {} Text
a -> ListIntents
s {$sel:localeId:ListIntents' :: Text
localeId = Text
a} :: ListIntents)

instance Core.AWSRequest ListIntents where
  type AWSResponse ListIntents = ListIntentsResponse
  request :: (Service -> Service) -> ListIntents -> Request ListIntents
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListIntents
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListIntents)))
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 Text
-> Maybe Text
-> Maybe [IntentSummary]
-> Maybe Text
-> Maybe Text
-> Int
-> ListIntentsResponse
ListIntentsResponse'
            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
"botId")
            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
"botVersion")
            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
"intentSummaries"
                            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
"localeId")
            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 ListIntents where
  hashWithSalt :: Int -> ListIntents -> Int
hashWithSalt Int
_salt ListIntents' {Maybe Natural
Maybe (NonEmpty IntentFilter)
Maybe Text
Maybe IntentSortBy
Text
localeId :: Text
botVersion :: Text
botId :: Text
sortBy :: Maybe IntentSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty IntentFilter)
$sel:localeId:ListIntents' :: ListIntents -> Text
$sel:botVersion:ListIntents' :: ListIntents -> Text
$sel:botId:ListIntents' :: ListIntents -> Text
$sel:sortBy:ListIntents' :: ListIntents -> Maybe IntentSortBy
$sel:nextToken:ListIntents' :: ListIntents -> Maybe Text
$sel:maxResults:ListIntents' :: ListIntents -> Maybe Natural
$sel:filters:ListIntents' :: ListIntents -> Maybe (NonEmpty IntentFilter)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty IntentFilter)
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IntentSortBy
sortBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
localeId

instance Prelude.NFData ListIntents where
  rnf :: ListIntents -> ()
rnf ListIntents' {Maybe Natural
Maybe (NonEmpty IntentFilter)
Maybe Text
Maybe IntentSortBy
Text
localeId :: Text
botVersion :: Text
botId :: Text
sortBy :: Maybe IntentSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty IntentFilter)
$sel:localeId:ListIntents' :: ListIntents -> Text
$sel:botVersion:ListIntents' :: ListIntents -> Text
$sel:botId:ListIntents' :: ListIntents -> Text
$sel:sortBy:ListIntents' :: ListIntents -> Maybe IntentSortBy
$sel:nextToken:ListIntents' :: ListIntents -> Maybe Text
$sel:maxResults:ListIntents' :: ListIntents -> Maybe Natural
$sel:filters:ListIntents' :: ListIntents -> Maybe (NonEmpty IntentFilter)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty IntentFilter)
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IntentSortBy
sortBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
botId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
botVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
localeId

instance Data.ToHeaders ListIntents where
  toHeaders :: ListIntents -> 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.ToJSON ListIntents where
  toJSON :: ListIntents -> Value
toJSON ListIntents' {Maybe Natural
Maybe (NonEmpty IntentFilter)
Maybe Text
Maybe IntentSortBy
Text
localeId :: Text
botVersion :: Text
botId :: Text
sortBy :: Maybe IntentSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty IntentFilter)
$sel:localeId:ListIntents' :: ListIntents -> Text
$sel:botVersion:ListIntents' :: ListIntents -> Text
$sel:botId:ListIntents' :: ListIntents -> Text
$sel:sortBy:ListIntents' :: ListIntents -> Maybe IntentSortBy
$sel:nextToken:ListIntents' :: ListIntents -> Maybe Text
$sel:maxResults:ListIntents' :: ListIntents -> Maybe Natural
$sel:filters:ListIntents' :: ListIntents -> Maybe (NonEmpty IntentFilter)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty IntentFilter)
filters,
            (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"sortBy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IntentSortBy
sortBy
          ]
      )

instance Data.ToPath ListIntents where
  toPath :: ListIntents -> ByteString
toPath ListIntents' {Maybe Natural
Maybe (NonEmpty IntentFilter)
Maybe Text
Maybe IntentSortBy
Text
localeId :: Text
botVersion :: Text
botId :: Text
sortBy :: Maybe IntentSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty IntentFilter)
$sel:localeId:ListIntents' :: ListIntents -> Text
$sel:botVersion:ListIntents' :: ListIntents -> Text
$sel:botId:ListIntents' :: ListIntents -> Text
$sel:sortBy:ListIntents' :: ListIntents -> Maybe IntentSortBy
$sel:nextToken:ListIntents' :: ListIntents -> Maybe Text
$sel:maxResults:ListIntents' :: ListIntents -> Maybe Natural
$sel:filters:ListIntents' :: ListIntents -> Maybe (NonEmpty IntentFilter)
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/bots/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
botId,
        ByteString
"/botversions/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
botVersion,
        ByteString
"/botlocales/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
localeId,
        ByteString
"/intents/"
      ]

instance Data.ToQuery ListIntents where
  toQuery :: ListIntents -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListIntentsResponse' smart constructor.
data ListIntentsResponse = ListIntentsResponse'
  { -- | The identifier of the bot that contains the intent.
    ListIntentsResponse -> Maybe Text
botId :: Prelude.Maybe Prelude.Text,
    -- | The version of the bot that contains the intent.
    ListIntentsResponse -> Maybe Text
botVersion :: Prelude.Maybe Prelude.Text,
    -- | Summary information for the intents that meet the filter criteria
    -- specified in the request. The length of the list is specified in the
    -- @maxResults@ parameter of the request. If there are more intents
    -- available, the @nextToken@ field contains a token to get the next page
    -- of results.
    ListIntentsResponse -> Maybe [IntentSummary]
intentSummaries :: Prelude.Maybe [IntentSummary],
    -- | The language and locale of the intents in the list.
    ListIntentsResponse -> Maybe Text
localeId :: Prelude.Maybe Prelude.Text,
    -- | A token that indicates whether there are more results to return in a
    -- response to the @ListIntents@ operation. If the @nextToken@ field is
    -- present, you send the contents as the @nextToken@ parameter of a
    -- @ListIntents@ operation request to get the next page of results.
    ListIntentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListIntentsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListIntentsResponse -> ListIntentsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIntentsResponse -> ListIntentsResponse -> Bool
$c/= :: ListIntentsResponse -> ListIntentsResponse -> Bool
== :: ListIntentsResponse -> ListIntentsResponse -> Bool
$c== :: ListIntentsResponse -> ListIntentsResponse -> Bool
Prelude.Eq, ReadPrec [ListIntentsResponse]
ReadPrec ListIntentsResponse
Int -> ReadS ListIntentsResponse
ReadS [ListIntentsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIntentsResponse]
$creadListPrec :: ReadPrec [ListIntentsResponse]
readPrec :: ReadPrec ListIntentsResponse
$creadPrec :: ReadPrec ListIntentsResponse
readList :: ReadS [ListIntentsResponse]
$creadList :: ReadS [ListIntentsResponse]
readsPrec :: Int -> ReadS ListIntentsResponse
$creadsPrec :: Int -> ReadS ListIntentsResponse
Prelude.Read, Int -> ListIntentsResponse -> ShowS
[ListIntentsResponse] -> ShowS
ListIntentsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIntentsResponse] -> ShowS
$cshowList :: [ListIntentsResponse] -> ShowS
show :: ListIntentsResponse -> String
$cshow :: ListIntentsResponse -> String
showsPrec :: Int -> ListIntentsResponse -> ShowS
$cshowsPrec :: Int -> ListIntentsResponse -> ShowS
Prelude.Show, forall x. Rep ListIntentsResponse x -> ListIntentsResponse
forall x. ListIntentsResponse -> Rep ListIntentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListIntentsResponse x -> ListIntentsResponse
$cfrom :: forall x. ListIntentsResponse -> Rep ListIntentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListIntentsResponse' 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:
--
-- 'botId', 'listIntentsResponse_botId' - The identifier of the bot that contains the intent.
--
-- 'botVersion', 'listIntentsResponse_botVersion' - The version of the bot that contains the intent.
--
-- 'intentSummaries', 'listIntentsResponse_intentSummaries' - Summary information for the intents that meet the filter criteria
-- specified in the request. The length of the list is specified in the
-- @maxResults@ parameter of the request. If there are more intents
-- available, the @nextToken@ field contains a token to get the next page
-- of results.
--
-- 'localeId', 'listIntentsResponse_localeId' - The language and locale of the intents in the list.
--
-- 'nextToken', 'listIntentsResponse_nextToken' - A token that indicates whether there are more results to return in a
-- response to the @ListIntents@ operation. If the @nextToken@ field is
-- present, you send the contents as the @nextToken@ parameter of a
-- @ListIntents@ operation request to get the next page of results.
--
-- 'httpStatus', 'listIntentsResponse_httpStatus' - The response's http status code.
newListIntentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListIntentsResponse
newListIntentsResponse :: Int -> ListIntentsResponse
newListIntentsResponse Int
pHttpStatus_ =
  ListIntentsResponse'
    { $sel:botId:ListIntentsResponse' :: Maybe Text
botId = forall a. Maybe a
Prelude.Nothing,
      $sel:botVersion:ListIntentsResponse' :: Maybe Text
botVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:intentSummaries:ListIntentsResponse' :: Maybe [IntentSummary]
intentSummaries = forall a. Maybe a
Prelude.Nothing,
      $sel:localeId:ListIntentsResponse' :: Maybe Text
localeId = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListIntentsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListIntentsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The identifier of the bot that contains the intent.
listIntentsResponse_botId :: Lens.Lens' ListIntentsResponse (Prelude.Maybe Prelude.Text)
listIntentsResponse_botId :: Lens' ListIntentsResponse (Maybe Text)
listIntentsResponse_botId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntentsResponse' {Maybe Text
botId :: Maybe Text
$sel:botId:ListIntentsResponse' :: ListIntentsResponse -> Maybe Text
botId} -> Maybe Text
botId) (\s :: ListIntentsResponse
s@ListIntentsResponse' {} Maybe Text
a -> ListIntentsResponse
s {$sel:botId:ListIntentsResponse' :: Maybe Text
botId = Maybe Text
a} :: ListIntentsResponse)

-- | The version of the bot that contains the intent.
listIntentsResponse_botVersion :: Lens.Lens' ListIntentsResponse (Prelude.Maybe Prelude.Text)
listIntentsResponse_botVersion :: Lens' ListIntentsResponse (Maybe Text)
listIntentsResponse_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntentsResponse' {Maybe Text
botVersion :: Maybe Text
$sel:botVersion:ListIntentsResponse' :: ListIntentsResponse -> Maybe Text
botVersion} -> Maybe Text
botVersion) (\s :: ListIntentsResponse
s@ListIntentsResponse' {} Maybe Text
a -> ListIntentsResponse
s {$sel:botVersion:ListIntentsResponse' :: Maybe Text
botVersion = Maybe Text
a} :: ListIntentsResponse)

-- | Summary information for the intents that meet the filter criteria
-- specified in the request. The length of the list is specified in the
-- @maxResults@ parameter of the request. If there are more intents
-- available, the @nextToken@ field contains a token to get the next page
-- of results.
listIntentsResponse_intentSummaries :: Lens.Lens' ListIntentsResponse (Prelude.Maybe [IntentSummary])
listIntentsResponse_intentSummaries :: Lens' ListIntentsResponse (Maybe [IntentSummary])
listIntentsResponse_intentSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntentsResponse' {Maybe [IntentSummary]
intentSummaries :: Maybe [IntentSummary]
$sel:intentSummaries:ListIntentsResponse' :: ListIntentsResponse -> Maybe [IntentSummary]
intentSummaries} -> Maybe [IntentSummary]
intentSummaries) (\s :: ListIntentsResponse
s@ListIntentsResponse' {} Maybe [IntentSummary]
a -> ListIntentsResponse
s {$sel:intentSummaries:ListIntentsResponse' :: Maybe [IntentSummary]
intentSummaries = Maybe [IntentSummary]
a} :: ListIntentsResponse) 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

-- | The language and locale of the intents in the list.
listIntentsResponse_localeId :: Lens.Lens' ListIntentsResponse (Prelude.Maybe Prelude.Text)
listIntentsResponse_localeId :: Lens' ListIntentsResponse (Maybe Text)
listIntentsResponse_localeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntentsResponse' {Maybe Text
localeId :: Maybe Text
$sel:localeId:ListIntentsResponse' :: ListIntentsResponse -> Maybe Text
localeId} -> Maybe Text
localeId) (\s :: ListIntentsResponse
s@ListIntentsResponse' {} Maybe Text
a -> ListIntentsResponse
s {$sel:localeId:ListIntentsResponse' :: Maybe Text
localeId = Maybe Text
a} :: ListIntentsResponse)

-- | A token that indicates whether there are more results to return in a
-- response to the @ListIntents@ operation. If the @nextToken@ field is
-- present, you send the contents as the @nextToken@ parameter of a
-- @ListIntents@ operation request to get the next page of results.
listIntentsResponse_nextToken :: Lens.Lens' ListIntentsResponse (Prelude.Maybe Prelude.Text)
listIntentsResponse_nextToken :: Lens' ListIntentsResponse (Maybe Text)
listIntentsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIntentsResponse' :: ListIntentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIntentsResponse
s@ListIntentsResponse' {} Maybe Text
a -> ListIntentsResponse
s {$sel:nextToken:ListIntentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListIntentsResponse)

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

instance Prelude.NFData ListIntentsResponse where
  rnf :: ListIntentsResponse -> ()
rnf ListIntentsResponse' {Int
Maybe [IntentSummary]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
localeId :: Maybe Text
intentSummaries :: Maybe [IntentSummary]
botVersion :: Maybe Text
botId :: Maybe Text
$sel:httpStatus:ListIntentsResponse' :: ListIntentsResponse -> Int
$sel:nextToken:ListIntentsResponse' :: ListIntentsResponse -> Maybe Text
$sel:localeId:ListIntentsResponse' :: ListIntentsResponse -> Maybe Text
$sel:intentSummaries:ListIntentsResponse' :: ListIntentsResponse -> Maybe [IntentSummary]
$sel:botVersion:ListIntentsResponse' :: ListIntentsResponse -> Maybe Text
$sel:botId:ListIntentsResponse' :: ListIntentsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [IntentSummary]
intentSummaries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
localeId
      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