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

    -- * Request Lenses
    listSlots_filters,
    listSlots_maxResults,
    listSlots_nextToken,
    listSlots_sortBy,
    listSlots_botId,
    listSlots_botVersion,
    listSlots_localeId,
    listSlots_intentId,

    -- * Destructuring the Response
    ListSlotsResponse (..),
    newListSlotsResponse,

    -- * Response Lenses
    listSlotsResponse_botId,
    listSlotsResponse_botVersion,
    listSlotsResponse_intentId,
    listSlotsResponse_localeId,
    listSlotsResponse_nextToken,
    listSlotsResponse_slotSummaries,
    listSlotsResponse_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:/ 'newListSlots' smart constructor.
data ListSlots = ListSlots'
  { -- | Provides the specification of a filter used to limit the slots in the
    -- response to only those that match the filter specification. You can only
    -- specify one filter and only one string to filter on.
    ListSlots -> Maybe (NonEmpty SlotFilter)
filters :: Prelude.Maybe (Prelude.NonEmpty SlotFilter),
    -- | The maximum number of slots 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.
    ListSlots -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | If the response from the @ListSlots@ operation contains more results
    -- than specified in the @maxResults@ parameter, a token is returned in the
    -- response. Use that token in the @nextToken@ parameter to return the next
    -- page of results.
    ListSlots -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Determines the sort order for the response from the @ListSlots@
    -- operation. You can choose to sort by the slot name or last updated date
    -- in either ascending or descending order.
    ListSlots -> Maybe SlotSortBy
sortBy :: Prelude.Maybe SlotSortBy,
    -- | The identifier of the bot that contains the slot.
    ListSlots -> Text
botId :: Prelude.Text,
    -- | The version of the bot that contains the slot.
    ListSlots -> Text
botVersion :: Prelude.Text,
    -- | The identifier of the language and locale of the slots 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>.
    ListSlots -> Text
localeId :: Prelude.Text,
    -- | The unique identifier of the intent that contains the slot.
    ListSlots -> Text
intentId :: Prelude.Text
  }
  deriving (ListSlots -> ListSlots -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSlots -> ListSlots -> Bool
$c/= :: ListSlots -> ListSlots -> Bool
== :: ListSlots -> ListSlots -> Bool
$c== :: ListSlots -> ListSlots -> Bool
Prelude.Eq, ReadPrec [ListSlots]
ReadPrec ListSlots
Int -> ReadS ListSlots
ReadS [ListSlots]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSlots]
$creadListPrec :: ReadPrec [ListSlots]
readPrec :: ReadPrec ListSlots
$creadPrec :: ReadPrec ListSlots
readList :: ReadS [ListSlots]
$creadList :: ReadS [ListSlots]
readsPrec :: Int -> ReadS ListSlots
$creadsPrec :: Int -> ReadS ListSlots
Prelude.Read, Int -> ListSlots -> ShowS
[ListSlots] -> ShowS
ListSlots -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSlots] -> ShowS
$cshowList :: [ListSlots] -> ShowS
show :: ListSlots -> String
$cshow :: ListSlots -> String
showsPrec :: Int -> ListSlots -> ShowS
$cshowsPrec :: Int -> ListSlots -> ShowS
Prelude.Show, forall x. Rep ListSlots x -> ListSlots
forall x. ListSlots -> Rep ListSlots x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSlots x -> ListSlots
$cfrom :: forall x. ListSlots -> Rep ListSlots x
Prelude.Generic)

-- |
-- Create a value of 'ListSlots' 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', 'listSlots_filters' - Provides the specification of a filter used to limit the slots 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', 'listSlots_maxResults' - The maximum number of slots 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', 'listSlots_nextToken' - If the response from the @ListSlots@ operation contains more results
-- than specified in the @maxResults@ parameter, a token is returned in the
-- response. Use that token in the @nextToken@ parameter to return the next
-- page of results.
--
-- 'sortBy', 'listSlots_sortBy' - Determines the sort order for the response from the @ListSlots@
-- operation. You can choose to sort by the slot name or last updated date
-- in either ascending or descending order.
--
-- 'botId', 'listSlots_botId' - The identifier of the bot that contains the slot.
--
-- 'botVersion', 'listSlots_botVersion' - The version of the bot that contains the slot.
--
-- 'localeId', 'listSlots_localeId' - The identifier of the language and locale of the slots 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>.
--
-- 'intentId', 'listSlots_intentId' - The unique identifier of the intent that contains the slot.
newListSlots ::
  -- | 'botId'
  Prelude.Text ->
  -- | 'botVersion'
  Prelude.Text ->
  -- | 'localeId'
  Prelude.Text ->
  -- | 'intentId'
  Prelude.Text ->
  ListSlots
newListSlots :: Text -> Text -> Text -> Text -> ListSlots
newListSlots
  Text
pBotId_
  Text
pBotVersion_
  Text
pLocaleId_
  Text
pIntentId_ =
    ListSlots'
      { $sel:filters:ListSlots' :: Maybe (NonEmpty SlotFilter)
filters = forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListSlots' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListSlots' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:sortBy:ListSlots' :: Maybe SlotSortBy
sortBy = forall a. Maybe a
Prelude.Nothing,
        $sel:botId:ListSlots' :: Text
botId = Text
pBotId_,
        $sel:botVersion:ListSlots' :: Text
botVersion = Text
pBotVersion_,
        $sel:localeId:ListSlots' :: Text
localeId = Text
pLocaleId_,
        $sel:intentId:ListSlots' :: Text
intentId = Text
pIntentId_
      }

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

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

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

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

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

-- | The identifier of the language and locale of the slots 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>.
listSlots_localeId :: Lens.Lens' ListSlots Prelude.Text
listSlots_localeId :: Lens' ListSlots Text
listSlots_localeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSlots' {Text
localeId :: Text
$sel:localeId:ListSlots' :: ListSlots -> Text
localeId} -> Text
localeId) (\s :: ListSlots
s@ListSlots' {} Text
a -> ListSlots
s {$sel:localeId:ListSlots' :: Text
localeId = Text
a} :: ListSlots)

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

instance Core.AWSRequest ListSlots where
  type AWSResponse ListSlots = ListSlotsResponse
  request :: (Service -> Service) -> ListSlots -> Request ListSlots
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 ListSlots
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListSlots)))
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 Text
-> Maybe Text
-> Maybe Text
-> Maybe [SlotSummary]
-> Int
-> ListSlotsResponse
ListSlotsResponse'
            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
"intentId")
            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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"slotSummaries" 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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListSlots where
  hashWithSalt :: Int -> ListSlots -> Int
hashWithSalt Int
_salt ListSlots' {Maybe Natural
Maybe (NonEmpty SlotFilter)
Maybe Text
Maybe SlotSortBy
Text
intentId :: Text
localeId :: Text
botVersion :: Text
botId :: Text
sortBy :: Maybe SlotSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty SlotFilter)
$sel:intentId:ListSlots' :: ListSlots -> Text
$sel:localeId:ListSlots' :: ListSlots -> Text
$sel:botVersion:ListSlots' :: ListSlots -> Text
$sel:botId:ListSlots' :: ListSlots -> Text
$sel:sortBy:ListSlots' :: ListSlots -> Maybe SlotSortBy
$sel:nextToken:ListSlots' :: ListSlots -> Maybe Text
$sel:maxResults:ListSlots' :: ListSlots -> Maybe Natural
$sel:filters:ListSlots' :: ListSlots -> Maybe (NonEmpty SlotFilter)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty SlotFilter)
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 SlotSortBy
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
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
intentId

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

instance Data.ToHeaders ListSlots where
  toHeaders :: ListSlots -> 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 ListSlots where
  toJSON :: ListSlots -> Value
toJSON ListSlots' {Maybe Natural
Maybe (NonEmpty SlotFilter)
Maybe Text
Maybe SlotSortBy
Text
intentId :: Text
localeId :: Text
botVersion :: Text
botId :: Text
sortBy :: Maybe SlotSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty SlotFilter)
$sel:intentId:ListSlots' :: ListSlots -> Text
$sel:localeId:ListSlots' :: ListSlots -> Text
$sel:botVersion:ListSlots' :: ListSlots -> Text
$sel:botId:ListSlots' :: ListSlots -> Text
$sel:sortBy:ListSlots' :: ListSlots -> Maybe SlotSortBy
$sel:nextToken:ListSlots' :: ListSlots -> Maybe Text
$sel:maxResults:ListSlots' :: ListSlots -> Maybe Natural
$sel:filters:ListSlots' :: ListSlots -> Maybe (NonEmpty SlotFilter)
..} =
    [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 SlotFilter)
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 SlotSortBy
sortBy
          ]
      )

instance Data.ToPath ListSlots where
  toPath :: ListSlots -> ByteString
toPath ListSlots' {Maybe Natural
Maybe (NonEmpty SlotFilter)
Maybe Text
Maybe SlotSortBy
Text
intentId :: Text
localeId :: Text
botVersion :: Text
botId :: Text
sortBy :: Maybe SlotSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty SlotFilter)
$sel:intentId:ListSlots' :: ListSlots -> Text
$sel:localeId:ListSlots' :: ListSlots -> Text
$sel:botVersion:ListSlots' :: ListSlots -> Text
$sel:botId:ListSlots' :: ListSlots -> Text
$sel:sortBy:ListSlots' :: ListSlots -> Maybe SlotSortBy
$sel:nextToken:ListSlots' :: ListSlots -> Maybe Text
$sel:maxResults:ListSlots' :: ListSlots -> Maybe Natural
$sel:filters:ListSlots' :: ListSlots -> Maybe (NonEmpty SlotFilter)
..} =
    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/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
intentId,
        ByteString
"/slots/"
      ]

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

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

-- |
-- Create a value of 'ListSlotsResponse' 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', 'listSlotsResponse_botId' - The identifier of the bot that contains the slots.
--
-- 'botVersion', 'listSlotsResponse_botVersion' - The version of the bot that contains the slots.
--
-- 'intentId', 'listSlotsResponse_intentId' - The identifier of the intent that contains the slots.
--
-- 'localeId', 'listSlotsResponse_localeId' - The language and locale of the slots in the list.
--
-- 'nextToken', 'listSlotsResponse_nextToken' - A token that indicates whether there are more results to return in a
-- response to the @ListSlots@ operation. If the @nextToken@ field is
-- present, you send the contents as the @nextToken@ parameter of a
-- @ListSlots@ operation request to get the next page of results.
--
-- 'slotSummaries', 'listSlotsResponse_slotSummaries' - Summary information for the slots 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 slots
-- available, the @nextToken@ field contains a token to get the next page
-- of results.
--
-- 'httpStatus', 'listSlotsResponse_httpStatus' - The response's http status code.
newListSlotsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSlotsResponse
newListSlotsResponse :: Int -> ListSlotsResponse
newListSlotsResponse Int
pHttpStatus_ =
  ListSlotsResponse'
    { $sel:botId:ListSlotsResponse' :: Maybe Text
botId = forall a. Maybe a
Prelude.Nothing,
      $sel:botVersion:ListSlotsResponse' :: Maybe Text
botVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:intentId:ListSlotsResponse' :: Maybe Text
intentId = forall a. Maybe a
Prelude.Nothing,
      $sel:localeId:ListSlotsResponse' :: Maybe Text
localeId = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSlotsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:slotSummaries:ListSlotsResponse' :: Maybe [SlotSummary]
slotSummaries = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSlotsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

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

-- | Summary information for the slots 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 slots
-- available, the @nextToken@ field contains a token to get the next page
-- of results.
listSlotsResponse_slotSummaries :: Lens.Lens' ListSlotsResponse (Prelude.Maybe [SlotSummary])
listSlotsResponse_slotSummaries :: Lens' ListSlotsResponse (Maybe [SlotSummary])
listSlotsResponse_slotSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSlotsResponse' {Maybe [SlotSummary]
slotSummaries :: Maybe [SlotSummary]
$sel:slotSummaries:ListSlotsResponse' :: ListSlotsResponse -> Maybe [SlotSummary]
slotSummaries} -> Maybe [SlotSummary]
slotSummaries) (\s :: ListSlotsResponse
s@ListSlotsResponse' {} Maybe [SlotSummary]
a -> ListSlotsResponse
s {$sel:slotSummaries:ListSlotsResponse' :: Maybe [SlotSummary]
slotSummaries = Maybe [SlotSummary]
a} :: ListSlotsResponse) 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 response's http status code.
listSlotsResponse_httpStatus :: Lens.Lens' ListSlotsResponse Prelude.Int
listSlotsResponse_httpStatus :: Lens' ListSlotsResponse Int
listSlotsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSlotsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListSlotsResponse' :: ListSlotsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListSlotsResponse
s@ListSlotsResponse' {} Int
a -> ListSlotsResponse
s {$sel:httpStatus:ListSlotsResponse' :: Int
httpStatus = Int
a} :: ListSlotsResponse)

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