{-# 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.ListSlotTypes
-- 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 slot types that match the specified criteria.
module Amazonka.LexV2Models.ListSlotTypes
  ( -- * Creating a Request
    ListSlotTypes (..),
    newListSlotTypes,

    -- * Request Lenses
    listSlotTypes_filters,
    listSlotTypes_maxResults,
    listSlotTypes_nextToken,
    listSlotTypes_sortBy,
    listSlotTypes_botId,
    listSlotTypes_botVersion,
    listSlotTypes_localeId,

    -- * Destructuring the Response
    ListSlotTypesResponse (..),
    newListSlotTypesResponse,

    -- * Response Lenses
    listSlotTypesResponse_botId,
    listSlotTypesResponse_botVersion,
    listSlotTypesResponse_localeId,
    listSlotTypesResponse_nextToken,
    listSlotTypesResponse_slotTypeSummaries,
    listSlotTypesResponse_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:/ 'newListSlotTypes' smart constructor.
data ListSlotTypes = ListSlotTypes'
  { -- | Provides the specification of a filter used to limit the slot types in
    -- the response to only those that match the filter specification. You can
    -- only specify one filter and only one string to filter on.
    ListSlotTypes -> Maybe (NonEmpty SlotTypeFilter)
filters :: Prelude.Maybe (Prelude.NonEmpty SlotTypeFilter),
    -- | The maximum number of slot types 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.
    ListSlotTypes -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | If the response from the @ListSlotTypes@ 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.
    ListSlotTypes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Determines the sort order for the response from the @ListSlotTypes@
    -- operation. You can choose to sort by the slot type name or last updated
    -- date in either ascending or descending order.
    ListSlotTypes -> Maybe SlotTypeSortBy
sortBy :: Prelude.Maybe SlotTypeSortBy,
    -- | The unique identifier of the bot that contains the slot types.
    ListSlotTypes -> Text
botId :: Prelude.Text,
    -- | The version of the bot that contains the slot type.
    ListSlotTypes -> Text
botVersion :: Prelude.Text,
    -- | The identifier of the language and locale of the slot types 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>.
    ListSlotTypes -> Text
localeId :: Prelude.Text
  }
  deriving (ListSlotTypes -> ListSlotTypes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSlotTypes -> ListSlotTypes -> Bool
$c/= :: ListSlotTypes -> ListSlotTypes -> Bool
== :: ListSlotTypes -> ListSlotTypes -> Bool
$c== :: ListSlotTypes -> ListSlotTypes -> Bool
Prelude.Eq, ReadPrec [ListSlotTypes]
ReadPrec ListSlotTypes
Int -> ReadS ListSlotTypes
ReadS [ListSlotTypes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSlotTypes]
$creadListPrec :: ReadPrec [ListSlotTypes]
readPrec :: ReadPrec ListSlotTypes
$creadPrec :: ReadPrec ListSlotTypes
readList :: ReadS [ListSlotTypes]
$creadList :: ReadS [ListSlotTypes]
readsPrec :: Int -> ReadS ListSlotTypes
$creadsPrec :: Int -> ReadS ListSlotTypes
Prelude.Read, Int -> ListSlotTypes -> ShowS
[ListSlotTypes] -> ShowS
ListSlotTypes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSlotTypes] -> ShowS
$cshowList :: [ListSlotTypes] -> ShowS
show :: ListSlotTypes -> String
$cshow :: ListSlotTypes -> String
showsPrec :: Int -> ListSlotTypes -> ShowS
$cshowsPrec :: Int -> ListSlotTypes -> ShowS
Prelude.Show, forall x. Rep ListSlotTypes x -> ListSlotTypes
forall x. ListSlotTypes -> Rep ListSlotTypes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSlotTypes x -> ListSlotTypes
$cfrom :: forall x. ListSlotTypes -> Rep ListSlotTypes x
Prelude.Generic)

-- |
-- Create a value of 'ListSlotTypes' 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', 'listSlotTypes_filters' - Provides the specification of a filter used to limit the slot types 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', 'listSlotTypes_maxResults' - The maximum number of slot types 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', 'listSlotTypes_nextToken' - If the response from the @ListSlotTypes@ 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', 'listSlotTypes_sortBy' - Determines the sort order for the response from the @ListSlotTypes@
-- operation. You can choose to sort by the slot type name or last updated
-- date in either ascending or descending order.
--
-- 'botId', 'listSlotTypes_botId' - The unique identifier of the bot that contains the slot types.
--
-- 'botVersion', 'listSlotTypes_botVersion' - The version of the bot that contains the slot type.
--
-- 'localeId', 'listSlotTypes_localeId' - The identifier of the language and locale of the slot types 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>.
newListSlotTypes ::
  -- | 'botId'
  Prelude.Text ->
  -- | 'botVersion'
  Prelude.Text ->
  -- | 'localeId'
  Prelude.Text ->
  ListSlotTypes
newListSlotTypes :: Text -> Text -> Text -> ListSlotTypes
newListSlotTypes Text
pBotId_ Text
pBotVersion_ Text
pLocaleId_ =
  ListSlotTypes'
    { $sel:filters:ListSlotTypes' :: Maybe (NonEmpty SlotTypeFilter)
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSlotTypes' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSlotTypes' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:ListSlotTypes' :: Maybe SlotTypeSortBy
sortBy = forall a. Maybe a
Prelude.Nothing,
      $sel:botId:ListSlotTypes' :: Text
botId = Text
pBotId_,
      $sel:botVersion:ListSlotTypes' :: Text
botVersion = Text
pBotVersion_,
      $sel:localeId:ListSlotTypes' :: Text
localeId = Text
pLocaleId_
    }

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

-- | If the response from the @ListSlotTypes@ 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.
listSlotTypes_nextToken :: Lens.Lens' ListSlotTypes (Prelude.Maybe Prelude.Text)
listSlotTypes_nextToken :: Lens' ListSlotTypes (Maybe Text)
listSlotTypes_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSlotTypes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSlotTypes' :: ListSlotTypes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSlotTypes
s@ListSlotTypes' {} Maybe Text
a -> ListSlotTypes
s {$sel:nextToken:ListSlotTypes' :: Maybe Text
nextToken = Maybe Text
a} :: ListSlotTypes)

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

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

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

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

instance Core.AWSRequest ListSlotTypes where
  type
    AWSResponse ListSlotTypes =
      ListSlotTypesResponse
  request :: (Service -> Service) -> ListSlotTypes -> Request ListSlotTypes
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 ListSlotTypes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListSlotTypes)))
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 [SlotTypeSummary]
-> Int
-> ListSlotTypesResponse
ListSlotTypesResponse'
            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
"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
"slotTypeSummaries"
                            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 ListSlotTypes where
  hashWithSalt :: Int -> ListSlotTypes -> Int
hashWithSalt Int
_salt ListSlotTypes' {Maybe Natural
Maybe (NonEmpty SlotTypeFilter)
Maybe Text
Maybe SlotTypeSortBy
Text
localeId :: Text
botVersion :: Text
botId :: Text
sortBy :: Maybe SlotTypeSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty SlotTypeFilter)
$sel:localeId:ListSlotTypes' :: ListSlotTypes -> Text
$sel:botVersion:ListSlotTypes' :: ListSlotTypes -> Text
$sel:botId:ListSlotTypes' :: ListSlotTypes -> Text
$sel:sortBy:ListSlotTypes' :: ListSlotTypes -> Maybe SlotTypeSortBy
$sel:nextToken:ListSlotTypes' :: ListSlotTypes -> Maybe Text
$sel:maxResults:ListSlotTypes' :: ListSlotTypes -> Maybe Natural
$sel:filters:ListSlotTypes' :: ListSlotTypes -> Maybe (NonEmpty SlotTypeFilter)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty SlotTypeFilter)
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 SlotTypeSortBy
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 ListSlotTypes where
  rnf :: ListSlotTypes -> ()
rnf ListSlotTypes' {Maybe Natural
Maybe (NonEmpty SlotTypeFilter)
Maybe Text
Maybe SlotTypeSortBy
Text
localeId :: Text
botVersion :: Text
botId :: Text
sortBy :: Maybe SlotTypeSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty SlotTypeFilter)
$sel:localeId:ListSlotTypes' :: ListSlotTypes -> Text
$sel:botVersion:ListSlotTypes' :: ListSlotTypes -> Text
$sel:botId:ListSlotTypes' :: ListSlotTypes -> Text
$sel:sortBy:ListSlotTypes' :: ListSlotTypes -> Maybe SlotTypeSortBy
$sel:nextToken:ListSlotTypes' :: ListSlotTypes -> Maybe Text
$sel:maxResults:ListSlotTypes' :: ListSlotTypes -> Maybe Natural
$sel:filters:ListSlotTypes' :: ListSlotTypes -> Maybe (NonEmpty SlotTypeFilter)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty SlotTypeFilter)
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 SlotTypeSortBy
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 ListSlotTypes where
  toHeaders :: ListSlotTypes -> 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 ListSlotTypes where
  toJSON :: ListSlotTypes -> Value
toJSON ListSlotTypes' {Maybe Natural
Maybe (NonEmpty SlotTypeFilter)
Maybe Text
Maybe SlotTypeSortBy
Text
localeId :: Text
botVersion :: Text
botId :: Text
sortBy :: Maybe SlotTypeSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty SlotTypeFilter)
$sel:localeId:ListSlotTypes' :: ListSlotTypes -> Text
$sel:botVersion:ListSlotTypes' :: ListSlotTypes -> Text
$sel:botId:ListSlotTypes' :: ListSlotTypes -> Text
$sel:sortBy:ListSlotTypes' :: ListSlotTypes -> Maybe SlotTypeSortBy
$sel:nextToken:ListSlotTypes' :: ListSlotTypes -> Maybe Text
$sel:maxResults:ListSlotTypes' :: ListSlotTypes -> Maybe Natural
$sel:filters:ListSlotTypes' :: ListSlotTypes -> Maybe (NonEmpty SlotTypeFilter)
..} =
    [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 SlotTypeFilter)
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 SlotTypeSortBy
sortBy
          ]
      )

instance Data.ToPath ListSlotTypes where
  toPath :: ListSlotTypes -> ByteString
toPath ListSlotTypes' {Maybe Natural
Maybe (NonEmpty SlotTypeFilter)
Maybe Text
Maybe SlotTypeSortBy
Text
localeId :: Text
botVersion :: Text
botId :: Text
sortBy :: Maybe SlotTypeSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty SlotTypeFilter)
$sel:localeId:ListSlotTypes' :: ListSlotTypes -> Text
$sel:botVersion:ListSlotTypes' :: ListSlotTypes -> Text
$sel:botId:ListSlotTypes' :: ListSlotTypes -> Text
$sel:sortBy:ListSlotTypes' :: ListSlotTypes -> Maybe SlotTypeSortBy
$sel:nextToken:ListSlotTypes' :: ListSlotTypes -> Maybe Text
$sel:maxResults:ListSlotTypes' :: ListSlotTypes -> Maybe Natural
$sel:filters:ListSlotTypes' :: ListSlotTypes -> Maybe (NonEmpty SlotTypeFilter)
..} =
    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
"/slottypes/"
      ]

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

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

-- |
-- Create a value of 'ListSlotTypesResponse' 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', 'listSlotTypesResponse_botId' - The identifier of the bot that contains the slot types.
--
-- 'botVersion', 'listSlotTypesResponse_botVersion' - The version of the bot that contains the slot types.
--
-- 'localeId', 'listSlotTypesResponse_localeId' - The language and local of the slot types in the list.
--
-- 'nextToken', 'listSlotTypesResponse_nextToken' - A token that indicates whether there are more results to return in a
-- response to the @ListSlotTypes@ operation. If the @nextToken@ field is
-- present, you send the contents as the @nextToken@ parameter of a
-- @ListSlotTypes@ operation request to get the next page of results.
--
-- 'slotTypeSummaries', 'listSlotTypesResponse_slotTypeSummaries' - Summary information for the slot types 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 slot types
-- available, the @nextToken@ field contains a token to get the next page
-- of results.
--
-- 'httpStatus', 'listSlotTypesResponse_httpStatus' - The response's http status code.
newListSlotTypesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSlotTypesResponse
newListSlotTypesResponse :: Int -> ListSlotTypesResponse
newListSlotTypesResponse Int
pHttpStatus_ =
  ListSlotTypesResponse'
    { $sel:botId:ListSlotTypesResponse' :: Maybe Text
botId = forall a. Maybe a
Prelude.Nothing,
      $sel:botVersion:ListSlotTypesResponse' :: Maybe Text
botVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:localeId:ListSlotTypesResponse' :: Maybe Text
localeId = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSlotTypesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:slotTypeSummaries:ListSlotTypesResponse' :: Maybe [SlotTypeSummary]
slotTypeSummaries = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSlotTypesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

-- | The language and local of the slot types in the list.
listSlotTypesResponse_localeId :: Lens.Lens' ListSlotTypesResponse (Prelude.Maybe Prelude.Text)
listSlotTypesResponse_localeId :: Lens' ListSlotTypesResponse (Maybe Text)
listSlotTypesResponse_localeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSlotTypesResponse' {Maybe Text
localeId :: Maybe Text
$sel:localeId:ListSlotTypesResponse' :: ListSlotTypesResponse -> Maybe Text
localeId} -> Maybe Text
localeId) (\s :: ListSlotTypesResponse
s@ListSlotTypesResponse' {} Maybe Text
a -> ListSlotTypesResponse
s {$sel:localeId:ListSlotTypesResponse' :: Maybe Text
localeId = Maybe Text
a} :: ListSlotTypesResponse)

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

-- | Summary information for the slot types 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 slot types
-- available, the @nextToken@ field contains a token to get the next page
-- of results.
listSlotTypesResponse_slotTypeSummaries :: Lens.Lens' ListSlotTypesResponse (Prelude.Maybe [SlotTypeSummary])
listSlotTypesResponse_slotTypeSummaries :: Lens' ListSlotTypesResponse (Maybe [SlotTypeSummary])
listSlotTypesResponse_slotTypeSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSlotTypesResponse' {Maybe [SlotTypeSummary]
slotTypeSummaries :: Maybe [SlotTypeSummary]
$sel:slotTypeSummaries:ListSlotTypesResponse' :: ListSlotTypesResponse -> Maybe [SlotTypeSummary]
slotTypeSummaries} -> Maybe [SlotTypeSummary]
slotTypeSummaries) (\s :: ListSlotTypesResponse
s@ListSlotTypesResponse' {} Maybe [SlotTypeSummary]
a -> ListSlotTypesResponse
s {$sel:slotTypeSummaries:ListSlotTypesResponse' :: Maybe [SlotTypeSummary]
slotTypeSummaries = Maybe [SlotTypeSummary]
a} :: ListSlotTypesResponse) 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.
listSlotTypesResponse_httpStatus :: Lens.Lens' ListSlotTypesResponse Prelude.Int
listSlotTypesResponse_httpStatus :: Lens' ListSlotTypesResponse Int
listSlotTypesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSlotTypesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListSlotTypesResponse' :: ListSlotTypesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListSlotTypesResponse
s@ListSlotTypesResponse' {} Int
a -> ListSlotTypesResponse
s {$sel:httpStatus:ListSlotTypesResponse' :: Int
httpStatus = Int
a} :: ListSlotTypesResponse)

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