{-# 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.GetBuiltinIntents
-- 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)
--
-- Gets a list of built-in intents that meet the specified criteria.
--
-- This operation requires permission for the @lex:GetBuiltinIntents@
-- action.
--
-- This operation returns paginated results.
module Amazonka.LexModels.GetBuiltinIntents
  ( -- * Creating a Request
    GetBuiltinIntents (..),
    newGetBuiltinIntents,

    -- * Request Lenses
    getBuiltinIntents_locale,
    getBuiltinIntents_nextToken,
    getBuiltinIntents_signatureContains,
    getBuiltinIntents_maxResults,

    -- * Destructuring the Response
    GetBuiltinIntentsResponse (..),
    newGetBuiltinIntentsResponse,

    -- * Response Lenses
    getBuiltinIntentsResponse_intents,
    getBuiltinIntentsResponse_nextToken,
    getBuiltinIntentsResponse_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:/ 'newGetBuiltinIntents' smart constructor.
data GetBuiltinIntents = GetBuiltinIntents'
  { -- | A list of locales that the intent supports.
    GetBuiltinIntents -> Maybe Locale
locale :: Prelude.Maybe Locale,
    -- | A pagination token that fetches the next page of intents. If this API
    -- call is truncated, Amazon Lex returns a pagination token in the
    -- response. To fetch the next page of intents, use the pagination token in
    -- the next request.
    GetBuiltinIntents -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Substring to match in built-in intent signatures. An intent will be
    -- returned if any part of its signature matches the substring. For
    -- example, \"xyz\" matches both \"xyzabc\" and \"abcxyz.\" To find the
    -- signature for an intent, see
    -- <https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents Standard Built-in Intents>
    -- in the /Alexa Skills Kit/.
    GetBuiltinIntents -> Maybe Text
signatureContains :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of intents to return in the response. The default is
    -- 10.
    GetBuiltinIntents -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (GetBuiltinIntents -> GetBuiltinIntents -> Bool
(GetBuiltinIntents -> GetBuiltinIntents -> Bool)
-> (GetBuiltinIntents -> GetBuiltinIntents -> Bool)
-> Eq GetBuiltinIntents
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBuiltinIntents -> GetBuiltinIntents -> Bool
$c/= :: GetBuiltinIntents -> GetBuiltinIntents -> Bool
== :: GetBuiltinIntents -> GetBuiltinIntents -> Bool
$c== :: GetBuiltinIntents -> GetBuiltinIntents -> Bool
Prelude.Eq, ReadPrec [GetBuiltinIntents]
ReadPrec GetBuiltinIntents
Int -> ReadS GetBuiltinIntents
ReadS [GetBuiltinIntents]
(Int -> ReadS GetBuiltinIntents)
-> ReadS [GetBuiltinIntents]
-> ReadPrec GetBuiltinIntents
-> ReadPrec [GetBuiltinIntents]
-> Read GetBuiltinIntents
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBuiltinIntents]
$creadListPrec :: ReadPrec [GetBuiltinIntents]
readPrec :: ReadPrec GetBuiltinIntents
$creadPrec :: ReadPrec GetBuiltinIntents
readList :: ReadS [GetBuiltinIntents]
$creadList :: ReadS [GetBuiltinIntents]
readsPrec :: Int -> ReadS GetBuiltinIntents
$creadsPrec :: Int -> ReadS GetBuiltinIntents
Prelude.Read, Int -> GetBuiltinIntents -> ShowS
[GetBuiltinIntents] -> ShowS
GetBuiltinIntents -> String
(Int -> GetBuiltinIntents -> ShowS)
-> (GetBuiltinIntents -> String)
-> ([GetBuiltinIntents] -> ShowS)
-> Show GetBuiltinIntents
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBuiltinIntents] -> ShowS
$cshowList :: [GetBuiltinIntents] -> ShowS
show :: GetBuiltinIntents -> String
$cshow :: GetBuiltinIntents -> String
showsPrec :: Int -> GetBuiltinIntents -> ShowS
$cshowsPrec :: Int -> GetBuiltinIntents -> ShowS
Prelude.Show, (forall x. GetBuiltinIntents -> Rep GetBuiltinIntents x)
-> (forall x. Rep GetBuiltinIntents x -> GetBuiltinIntents)
-> Generic GetBuiltinIntents
forall x. Rep GetBuiltinIntents x -> GetBuiltinIntents
forall x. GetBuiltinIntents -> Rep GetBuiltinIntents x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetBuiltinIntents x -> GetBuiltinIntents
$cfrom :: forall x. GetBuiltinIntents -> Rep GetBuiltinIntents x
Prelude.Generic)

-- |
-- Create a value of 'GetBuiltinIntents' 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:
--
-- 'locale', 'getBuiltinIntents_locale' - A list of locales that the intent supports.
--
-- 'nextToken', 'getBuiltinIntents_nextToken' - A pagination token that fetches the next page of intents. If this API
-- call is truncated, Amazon Lex returns a pagination token in the
-- response. To fetch the next page of intents, use the pagination token in
-- the next request.
--
-- 'signatureContains', 'getBuiltinIntents_signatureContains' - Substring to match in built-in intent signatures. An intent will be
-- returned if any part of its signature matches the substring. For
-- example, \"xyz\" matches both \"xyzabc\" and \"abcxyz.\" To find the
-- signature for an intent, see
-- <https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents Standard Built-in Intents>
-- in the /Alexa Skills Kit/.
--
-- 'maxResults', 'getBuiltinIntents_maxResults' - The maximum number of intents to return in the response. The default is
-- 10.
newGetBuiltinIntents ::
  GetBuiltinIntents
newGetBuiltinIntents :: GetBuiltinIntents
newGetBuiltinIntents =
  GetBuiltinIntents' :: Maybe Locale
-> Maybe Text -> Maybe Text -> Maybe Natural -> GetBuiltinIntents
GetBuiltinIntents'
    { $sel:locale:GetBuiltinIntents' :: Maybe Locale
locale = Maybe Locale
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetBuiltinIntents' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:signatureContains:GetBuiltinIntents' :: Maybe Text
signatureContains = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetBuiltinIntents' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A list of locales that the intent supports.
getBuiltinIntents_locale :: Lens.Lens' GetBuiltinIntents (Prelude.Maybe Locale)
getBuiltinIntents_locale :: (Maybe Locale -> f (Maybe Locale))
-> GetBuiltinIntents -> f GetBuiltinIntents
getBuiltinIntents_locale = (GetBuiltinIntents -> Maybe Locale)
-> (GetBuiltinIntents -> Maybe Locale -> GetBuiltinIntents)
-> Lens
     GetBuiltinIntents GetBuiltinIntents (Maybe Locale) (Maybe Locale)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBuiltinIntents' {Maybe Locale
locale :: Maybe Locale
$sel:locale:GetBuiltinIntents' :: GetBuiltinIntents -> Maybe Locale
locale} -> Maybe Locale
locale) (\s :: GetBuiltinIntents
s@GetBuiltinIntents' {} Maybe Locale
a -> GetBuiltinIntents
s {$sel:locale:GetBuiltinIntents' :: Maybe Locale
locale = Maybe Locale
a} :: GetBuiltinIntents)

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

-- | Substring to match in built-in intent signatures. An intent will be
-- returned if any part of its signature matches the substring. For
-- example, \"xyz\" matches both \"xyzabc\" and \"abcxyz.\" To find the
-- signature for an intent, see
-- <https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents Standard Built-in Intents>
-- in the /Alexa Skills Kit/.
getBuiltinIntents_signatureContains :: Lens.Lens' GetBuiltinIntents (Prelude.Maybe Prelude.Text)
getBuiltinIntents_signatureContains :: (Maybe Text -> f (Maybe Text))
-> GetBuiltinIntents -> f GetBuiltinIntents
getBuiltinIntents_signatureContains = (GetBuiltinIntents -> Maybe Text)
-> (GetBuiltinIntents -> Maybe Text -> GetBuiltinIntents)
-> Lens
     GetBuiltinIntents GetBuiltinIntents (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBuiltinIntents' {Maybe Text
signatureContains :: Maybe Text
$sel:signatureContains:GetBuiltinIntents' :: GetBuiltinIntents -> Maybe Text
signatureContains} -> Maybe Text
signatureContains) (\s :: GetBuiltinIntents
s@GetBuiltinIntents' {} Maybe Text
a -> GetBuiltinIntents
s {$sel:signatureContains:GetBuiltinIntents' :: Maybe Text
signatureContains = Maybe Text
a} :: GetBuiltinIntents)

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

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

instance Prelude.NFData GetBuiltinIntents

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

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

-- | /See:/ 'newGetBuiltinIntentsResponse' smart constructor.
data GetBuiltinIntentsResponse = GetBuiltinIntentsResponse'
  { -- | An array of @builtinIntentMetadata@ objects, one for each intent in the
    -- response.
    GetBuiltinIntentsResponse -> Maybe [BuiltinIntentMetadata]
intents :: Prelude.Maybe [BuiltinIntentMetadata],
    -- | 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.
    GetBuiltinIntentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetBuiltinIntentsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetBuiltinIntentsResponse -> GetBuiltinIntentsResponse -> Bool
(GetBuiltinIntentsResponse -> GetBuiltinIntentsResponse -> Bool)
-> (GetBuiltinIntentsResponse -> GetBuiltinIntentsResponse -> Bool)
-> Eq GetBuiltinIntentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBuiltinIntentsResponse -> GetBuiltinIntentsResponse -> Bool
$c/= :: GetBuiltinIntentsResponse -> GetBuiltinIntentsResponse -> Bool
== :: GetBuiltinIntentsResponse -> GetBuiltinIntentsResponse -> Bool
$c== :: GetBuiltinIntentsResponse -> GetBuiltinIntentsResponse -> Bool
Prelude.Eq, ReadPrec [GetBuiltinIntentsResponse]
ReadPrec GetBuiltinIntentsResponse
Int -> ReadS GetBuiltinIntentsResponse
ReadS [GetBuiltinIntentsResponse]
(Int -> ReadS GetBuiltinIntentsResponse)
-> ReadS [GetBuiltinIntentsResponse]
-> ReadPrec GetBuiltinIntentsResponse
-> ReadPrec [GetBuiltinIntentsResponse]
-> Read GetBuiltinIntentsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBuiltinIntentsResponse]
$creadListPrec :: ReadPrec [GetBuiltinIntentsResponse]
readPrec :: ReadPrec GetBuiltinIntentsResponse
$creadPrec :: ReadPrec GetBuiltinIntentsResponse
readList :: ReadS [GetBuiltinIntentsResponse]
$creadList :: ReadS [GetBuiltinIntentsResponse]
readsPrec :: Int -> ReadS GetBuiltinIntentsResponse
$creadsPrec :: Int -> ReadS GetBuiltinIntentsResponse
Prelude.Read, Int -> GetBuiltinIntentsResponse -> ShowS
[GetBuiltinIntentsResponse] -> ShowS
GetBuiltinIntentsResponse -> String
(Int -> GetBuiltinIntentsResponse -> ShowS)
-> (GetBuiltinIntentsResponse -> String)
-> ([GetBuiltinIntentsResponse] -> ShowS)
-> Show GetBuiltinIntentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBuiltinIntentsResponse] -> ShowS
$cshowList :: [GetBuiltinIntentsResponse] -> ShowS
show :: GetBuiltinIntentsResponse -> String
$cshow :: GetBuiltinIntentsResponse -> String
showsPrec :: Int -> GetBuiltinIntentsResponse -> ShowS
$cshowsPrec :: Int -> GetBuiltinIntentsResponse -> ShowS
Prelude.Show, (forall x.
 GetBuiltinIntentsResponse -> Rep GetBuiltinIntentsResponse x)
-> (forall x.
    Rep GetBuiltinIntentsResponse x -> GetBuiltinIntentsResponse)
-> Generic GetBuiltinIntentsResponse
forall x.
Rep GetBuiltinIntentsResponse x -> GetBuiltinIntentsResponse
forall x.
GetBuiltinIntentsResponse -> Rep GetBuiltinIntentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBuiltinIntentsResponse x -> GetBuiltinIntentsResponse
$cfrom :: forall x.
GetBuiltinIntentsResponse -> Rep GetBuiltinIntentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetBuiltinIntentsResponse' 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', 'getBuiltinIntentsResponse_intents' - An array of @builtinIntentMetadata@ objects, one for each intent in the
-- response.
--
-- 'nextToken', 'getBuiltinIntentsResponse_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.
--
-- 'httpStatus', 'getBuiltinIntentsResponse_httpStatus' - The response's http status code.
newGetBuiltinIntentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetBuiltinIntentsResponse
newGetBuiltinIntentsResponse :: Int -> GetBuiltinIntentsResponse
newGetBuiltinIntentsResponse Int
pHttpStatus_ =
  GetBuiltinIntentsResponse' :: Maybe [BuiltinIntentMetadata]
-> Maybe Text -> Int -> GetBuiltinIntentsResponse
GetBuiltinIntentsResponse'
    { $sel:intents:GetBuiltinIntentsResponse' :: Maybe [BuiltinIntentMetadata]
intents =
        Maybe [BuiltinIntentMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetBuiltinIntentsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetBuiltinIntentsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of @builtinIntentMetadata@ objects, one for each intent in the
-- response.
getBuiltinIntentsResponse_intents :: Lens.Lens' GetBuiltinIntentsResponse (Prelude.Maybe [BuiltinIntentMetadata])
getBuiltinIntentsResponse_intents :: (Maybe [BuiltinIntentMetadata]
 -> f (Maybe [BuiltinIntentMetadata]))
-> GetBuiltinIntentsResponse -> f GetBuiltinIntentsResponse
getBuiltinIntentsResponse_intents = (GetBuiltinIntentsResponse -> Maybe [BuiltinIntentMetadata])
-> (GetBuiltinIntentsResponse
    -> Maybe [BuiltinIntentMetadata] -> GetBuiltinIntentsResponse)
-> Lens' GetBuiltinIntentsResponse (Maybe [BuiltinIntentMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBuiltinIntentsResponse' {Maybe [BuiltinIntentMetadata]
intents :: Maybe [BuiltinIntentMetadata]
$sel:intents:GetBuiltinIntentsResponse' :: GetBuiltinIntentsResponse -> Maybe [BuiltinIntentMetadata]
intents} -> Maybe [BuiltinIntentMetadata]
intents) (\s :: GetBuiltinIntentsResponse
s@GetBuiltinIntentsResponse' {} Maybe [BuiltinIntentMetadata]
a -> GetBuiltinIntentsResponse
s {$sel:intents:GetBuiltinIntentsResponse' :: Maybe [BuiltinIntentMetadata]
intents = Maybe [BuiltinIntentMetadata]
a} :: GetBuiltinIntentsResponse) ((Maybe [BuiltinIntentMetadata]
  -> f (Maybe [BuiltinIntentMetadata]))
 -> GetBuiltinIntentsResponse -> f GetBuiltinIntentsResponse)
-> ((Maybe [BuiltinIntentMetadata]
     -> f (Maybe [BuiltinIntentMetadata]))
    -> Maybe [BuiltinIntentMetadata]
    -> f (Maybe [BuiltinIntentMetadata]))
-> (Maybe [BuiltinIntentMetadata]
    -> f (Maybe [BuiltinIntentMetadata]))
-> GetBuiltinIntentsResponse
-> f GetBuiltinIntentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [BuiltinIntentMetadata]
  [BuiltinIntentMetadata]
  [BuiltinIntentMetadata]
  [BuiltinIntentMetadata]
-> Iso
     (Maybe [BuiltinIntentMetadata])
     (Maybe [BuiltinIntentMetadata])
     (Maybe [BuiltinIntentMetadata])
     (Maybe [BuiltinIntentMetadata])
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
  [BuiltinIntentMetadata]
  [BuiltinIntentMetadata]
  [BuiltinIntentMetadata]
  [BuiltinIntentMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A pagination token that fetches the next page of 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.
getBuiltinIntentsResponse_nextToken :: Lens.Lens' GetBuiltinIntentsResponse (Prelude.Maybe Prelude.Text)
getBuiltinIntentsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetBuiltinIntentsResponse -> f GetBuiltinIntentsResponse
getBuiltinIntentsResponse_nextToken = (GetBuiltinIntentsResponse -> Maybe Text)
-> (GetBuiltinIntentsResponse
    -> Maybe Text -> GetBuiltinIntentsResponse)
-> Lens' GetBuiltinIntentsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBuiltinIntentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetBuiltinIntentsResponse' :: GetBuiltinIntentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetBuiltinIntentsResponse
s@GetBuiltinIntentsResponse' {} Maybe Text
a -> GetBuiltinIntentsResponse
s {$sel:nextToken:GetBuiltinIntentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetBuiltinIntentsResponse)

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

instance Prelude.NFData GetBuiltinIntentsResponse