{-# 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.GetSlotTypeVersions
-- 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 information about all versions of a slot type.
--
-- The @GetSlotTypeVersions@ operation returns a @SlotTypeMetadata@ object
-- for each version of a slot type. For example, if a slot type has three
-- numbered versions, the @GetSlotTypeVersions@ operation returns four
-- @SlotTypeMetadata@ objects in the response, one for each numbered
-- version and one for the @$LATEST@ version.
--
-- The @GetSlotTypeVersions@ operation always returns at least one version,
-- the @$LATEST@ version.
--
-- This operation requires permissions for the @lex:GetSlotTypeVersions@
-- action.
--
-- This operation returns paginated results.
module Amazonka.LexModels.GetSlotTypeVersions
  ( -- * Creating a Request
    GetSlotTypeVersions (..),
    newGetSlotTypeVersions,

    -- * Request Lenses
    getSlotTypeVersions_nextToken,
    getSlotTypeVersions_maxResults,
    getSlotTypeVersions_name,

    -- * Destructuring the Response
    GetSlotTypeVersionsResponse (..),
    newGetSlotTypeVersionsResponse,

    -- * Response Lenses
    getSlotTypeVersionsResponse_nextToken,
    getSlotTypeVersionsResponse_slotTypes,
    getSlotTypeVersionsResponse_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:/ 'newGetSlotTypeVersions' smart constructor.
data GetSlotTypeVersions = GetSlotTypeVersions'
  { -- | A pagination token for fetching the next page of slot type versions. If
    -- the response to this call is truncated, Amazon Lex returns a pagination
    -- token in the response. To fetch the next page of versions, specify the
    -- pagination token in the next request.
    GetSlotTypeVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of slot type versions to return in the response. The
    -- default is 10.
    GetSlotTypeVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the slot type for which versions should be returned.
    GetSlotTypeVersions -> Text
name :: Prelude.Text
  }
  deriving (GetSlotTypeVersions -> GetSlotTypeVersions -> Bool
(GetSlotTypeVersions -> GetSlotTypeVersions -> Bool)
-> (GetSlotTypeVersions -> GetSlotTypeVersions -> Bool)
-> Eq GetSlotTypeVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSlotTypeVersions -> GetSlotTypeVersions -> Bool
$c/= :: GetSlotTypeVersions -> GetSlotTypeVersions -> Bool
== :: GetSlotTypeVersions -> GetSlotTypeVersions -> Bool
$c== :: GetSlotTypeVersions -> GetSlotTypeVersions -> Bool
Prelude.Eq, ReadPrec [GetSlotTypeVersions]
ReadPrec GetSlotTypeVersions
Int -> ReadS GetSlotTypeVersions
ReadS [GetSlotTypeVersions]
(Int -> ReadS GetSlotTypeVersions)
-> ReadS [GetSlotTypeVersions]
-> ReadPrec GetSlotTypeVersions
-> ReadPrec [GetSlotTypeVersions]
-> Read GetSlotTypeVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSlotTypeVersions]
$creadListPrec :: ReadPrec [GetSlotTypeVersions]
readPrec :: ReadPrec GetSlotTypeVersions
$creadPrec :: ReadPrec GetSlotTypeVersions
readList :: ReadS [GetSlotTypeVersions]
$creadList :: ReadS [GetSlotTypeVersions]
readsPrec :: Int -> ReadS GetSlotTypeVersions
$creadsPrec :: Int -> ReadS GetSlotTypeVersions
Prelude.Read, Int -> GetSlotTypeVersions -> ShowS
[GetSlotTypeVersions] -> ShowS
GetSlotTypeVersions -> String
(Int -> GetSlotTypeVersions -> ShowS)
-> (GetSlotTypeVersions -> String)
-> ([GetSlotTypeVersions] -> ShowS)
-> Show GetSlotTypeVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSlotTypeVersions] -> ShowS
$cshowList :: [GetSlotTypeVersions] -> ShowS
show :: GetSlotTypeVersions -> String
$cshow :: GetSlotTypeVersions -> String
showsPrec :: Int -> GetSlotTypeVersions -> ShowS
$cshowsPrec :: Int -> GetSlotTypeVersions -> ShowS
Prelude.Show, (forall x. GetSlotTypeVersions -> Rep GetSlotTypeVersions x)
-> (forall x. Rep GetSlotTypeVersions x -> GetSlotTypeVersions)
-> Generic GetSlotTypeVersions
forall x. Rep GetSlotTypeVersions x -> GetSlotTypeVersions
forall x. GetSlotTypeVersions -> Rep GetSlotTypeVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSlotTypeVersions x -> GetSlotTypeVersions
$cfrom :: forall x. GetSlotTypeVersions -> Rep GetSlotTypeVersions x
Prelude.Generic)

-- |
-- Create a value of 'GetSlotTypeVersions' 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:
--
-- 'nextToken', 'getSlotTypeVersions_nextToken' - A pagination token for fetching the next page of slot type versions. If
-- the response to this call is truncated, Amazon Lex returns a pagination
-- token in the response. To fetch the next page of versions, specify the
-- pagination token in the next request.
--
-- 'maxResults', 'getSlotTypeVersions_maxResults' - The maximum number of slot type versions to return in the response. The
-- default is 10.
--
-- 'name', 'getSlotTypeVersions_name' - The name of the slot type for which versions should be returned.
newGetSlotTypeVersions ::
  -- | 'name'
  Prelude.Text ->
  GetSlotTypeVersions
newGetSlotTypeVersions :: Text -> GetSlotTypeVersions
newGetSlotTypeVersions Text
pName_ =
  GetSlotTypeVersions' :: Maybe Text -> Maybe Natural -> Text -> GetSlotTypeVersions
GetSlotTypeVersions'
    { $sel:nextToken:GetSlotTypeVersions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetSlotTypeVersions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetSlotTypeVersions' :: Text
name = Text
pName_
    }

-- | A pagination token for fetching the next page of slot type versions. If
-- the response to this call is truncated, Amazon Lex returns a pagination
-- token in the response. To fetch the next page of versions, specify the
-- pagination token in the next request.
getSlotTypeVersions_nextToken :: Lens.Lens' GetSlotTypeVersions (Prelude.Maybe Prelude.Text)
getSlotTypeVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetSlotTypeVersions -> f GetSlotTypeVersions
getSlotTypeVersions_nextToken = (GetSlotTypeVersions -> Maybe Text)
-> (GetSlotTypeVersions -> Maybe Text -> GetSlotTypeVersions)
-> Lens
     GetSlotTypeVersions GetSlotTypeVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSlotTypeVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetSlotTypeVersions' :: GetSlotTypeVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetSlotTypeVersions
s@GetSlotTypeVersions' {} Maybe Text
a -> GetSlotTypeVersions
s {$sel:nextToken:GetSlotTypeVersions' :: Maybe Text
nextToken = Maybe Text
a} :: GetSlotTypeVersions)

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

-- | The name of the slot type for which versions should be returned.
getSlotTypeVersions_name :: Lens.Lens' GetSlotTypeVersions Prelude.Text
getSlotTypeVersions_name :: (Text -> f Text) -> GetSlotTypeVersions -> f GetSlotTypeVersions
getSlotTypeVersions_name = (GetSlotTypeVersions -> Text)
-> (GetSlotTypeVersions -> Text -> GetSlotTypeVersions)
-> Lens GetSlotTypeVersions GetSlotTypeVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSlotTypeVersions' {Text
name :: Text
$sel:name:GetSlotTypeVersions' :: GetSlotTypeVersions -> Text
name} -> Text
name) (\s :: GetSlotTypeVersions
s@GetSlotTypeVersions' {} Text
a -> GetSlotTypeVersions
s {$sel:name:GetSlotTypeVersions' :: Text
name = Text
a} :: GetSlotTypeVersions)

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

instance Prelude.NFData GetSlotTypeVersions

instance Core.ToHeaders GetSlotTypeVersions where
  toHeaders :: GetSlotTypeVersions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetSlotTypeVersions -> 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 GetSlotTypeVersions where
  toPath :: GetSlotTypeVersions -> ByteString
toPath GetSlotTypeVersions' {Maybe Natural
Maybe Text
Text
name :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:name:GetSlotTypeVersions' :: GetSlotTypeVersions -> Text
$sel:maxResults:GetSlotTypeVersions' :: GetSlotTypeVersions -> Maybe Natural
$sel:nextToken:GetSlotTypeVersions' :: GetSlotTypeVersions -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/slottypes/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name, ByteString
"/versions/"]

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

-- | /See:/ 'newGetSlotTypeVersionsResponse' smart constructor.
data GetSlotTypeVersionsResponse = GetSlotTypeVersionsResponse'
  { -- | A pagination token for fetching the next page of slot type versions. If
    -- the response to this call is truncated, Amazon Lex returns a pagination
    -- token in the response. To fetch the next page of versions, specify the
    -- pagination token in the next request.
    GetSlotTypeVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of @SlotTypeMetadata@ objects, one for each numbered version of
    -- the slot type plus one for the @$LATEST@ version.
    GetSlotTypeVersionsResponse -> Maybe [SlotTypeMetadata]
slotTypes :: Prelude.Maybe [SlotTypeMetadata],
    -- | The response's http status code.
    GetSlotTypeVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetSlotTypeVersionsResponse -> GetSlotTypeVersionsResponse -> Bool
(GetSlotTypeVersionsResponse
 -> GetSlotTypeVersionsResponse -> Bool)
-> (GetSlotTypeVersionsResponse
    -> GetSlotTypeVersionsResponse -> Bool)
-> Eq GetSlotTypeVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSlotTypeVersionsResponse -> GetSlotTypeVersionsResponse -> Bool
$c/= :: GetSlotTypeVersionsResponse -> GetSlotTypeVersionsResponse -> Bool
== :: GetSlotTypeVersionsResponse -> GetSlotTypeVersionsResponse -> Bool
$c== :: GetSlotTypeVersionsResponse -> GetSlotTypeVersionsResponse -> Bool
Prelude.Eq, ReadPrec [GetSlotTypeVersionsResponse]
ReadPrec GetSlotTypeVersionsResponse
Int -> ReadS GetSlotTypeVersionsResponse
ReadS [GetSlotTypeVersionsResponse]
(Int -> ReadS GetSlotTypeVersionsResponse)
-> ReadS [GetSlotTypeVersionsResponse]
-> ReadPrec GetSlotTypeVersionsResponse
-> ReadPrec [GetSlotTypeVersionsResponse]
-> Read GetSlotTypeVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSlotTypeVersionsResponse]
$creadListPrec :: ReadPrec [GetSlotTypeVersionsResponse]
readPrec :: ReadPrec GetSlotTypeVersionsResponse
$creadPrec :: ReadPrec GetSlotTypeVersionsResponse
readList :: ReadS [GetSlotTypeVersionsResponse]
$creadList :: ReadS [GetSlotTypeVersionsResponse]
readsPrec :: Int -> ReadS GetSlotTypeVersionsResponse
$creadsPrec :: Int -> ReadS GetSlotTypeVersionsResponse
Prelude.Read, Int -> GetSlotTypeVersionsResponse -> ShowS
[GetSlotTypeVersionsResponse] -> ShowS
GetSlotTypeVersionsResponse -> String
(Int -> GetSlotTypeVersionsResponse -> ShowS)
-> (GetSlotTypeVersionsResponse -> String)
-> ([GetSlotTypeVersionsResponse] -> ShowS)
-> Show GetSlotTypeVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSlotTypeVersionsResponse] -> ShowS
$cshowList :: [GetSlotTypeVersionsResponse] -> ShowS
show :: GetSlotTypeVersionsResponse -> String
$cshow :: GetSlotTypeVersionsResponse -> String
showsPrec :: Int -> GetSlotTypeVersionsResponse -> ShowS
$cshowsPrec :: Int -> GetSlotTypeVersionsResponse -> ShowS
Prelude.Show, (forall x.
 GetSlotTypeVersionsResponse -> Rep GetSlotTypeVersionsResponse x)
-> (forall x.
    Rep GetSlotTypeVersionsResponse x -> GetSlotTypeVersionsResponse)
-> Generic GetSlotTypeVersionsResponse
forall x.
Rep GetSlotTypeVersionsResponse x -> GetSlotTypeVersionsResponse
forall x.
GetSlotTypeVersionsResponse -> Rep GetSlotTypeVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSlotTypeVersionsResponse x -> GetSlotTypeVersionsResponse
$cfrom :: forall x.
GetSlotTypeVersionsResponse -> Rep GetSlotTypeVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetSlotTypeVersionsResponse' 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:
--
-- 'nextToken', 'getSlotTypeVersionsResponse_nextToken' - A pagination token for fetching the next page of slot type versions. If
-- the response to this call is truncated, Amazon Lex returns a pagination
-- token in the response. To fetch the next page of versions, specify the
-- pagination token in the next request.
--
-- 'slotTypes', 'getSlotTypeVersionsResponse_slotTypes' - An array of @SlotTypeMetadata@ objects, one for each numbered version of
-- the slot type plus one for the @$LATEST@ version.
--
-- 'httpStatus', 'getSlotTypeVersionsResponse_httpStatus' - The response's http status code.
newGetSlotTypeVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetSlotTypeVersionsResponse
newGetSlotTypeVersionsResponse :: Int -> GetSlotTypeVersionsResponse
newGetSlotTypeVersionsResponse Int
pHttpStatus_ =
  GetSlotTypeVersionsResponse' :: Maybe Text
-> Maybe [SlotTypeMetadata] -> Int -> GetSlotTypeVersionsResponse
GetSlotTypeVersionsResponse'
    { $sel:nextToken:GetSlotTypeVersionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:slotTypes:GetSlotTypeVersionsResponse' :: Maybe [SlotTypeMetadata]
slotTypes = Maybe [SlotTypeMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetSlotTypeVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A pagination token for fetching the next page of slot type versions. If
-- the response to this call is truncated, Amazon Lex returns a pagination
-- token in the response. To fetch the next page of versions, specify the
-- pagination token in the next request.
getSlotTypeVersionsResponse_nextToken :: Lens.Lens' GetSlotTypeVersionsResponse (Prelude.Maybe Prelude.Text)
getSlotTypeVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetSlotTypeVersionsResponse -> f GetSlotTypeVersionsResponse
getSlotTypeVersionsResponse_nextToken = (GetSlotTypeVersionsResponse -> Maybe Text)
-> (GetSlotTypeVersionsResponse
    -> Maybe Text -> GetSlotTypeVersionsResponse)
-> Lens' GetSlotTypeVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSlotTypeVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetSlotTypeVersionsResponse' :: GetSlotTypeVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetSlotTypeVersionsResponse
s@GetSlotTypeVersionsResponse' {} Maybe Text
a -> GetSlotTypeVersionsResponse
s {$sel:nextToken:GetSlotTypeVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetSlotTypeVersionsResponse)

-- | An array of @SlotTypeMetadata@ objects, one for each numbered version of
-- the slot type plus one for the @$LATEST@ version.
getSlotTypeVersionsResponse_slotTypes :: Lens.Lens' GetSlotTypeVersionsResponse (Prelude.Maybe [SlotTypeMetadata])
getSlotTypeVersionsResponse_slotTypes :: (Maybe [SlotTypeMetadata] -> f (Maybe [SlotTypeMetadata]))
-> GetSlotTypeVersionsResponse -> f GetSlotTypeVersionsResponse
getSlotTypeVersionsResponse_slotTypes = (GetSlotTypeVersionsResponse -> Maybe [SlotTypeMetadata])
-> (GetSlotTypeVersionsResponse
    -> Maybe [SlotTypeMetadata] -> GetSlotTypeVersionsResponse)
-> Lens' GetSlotTypeVersionsResponse (Maybe [SlotTypeMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSlotTypeVersionsResponse' {Maybe [SlotTypeMetadata]
slotTypes :: Maybe [SlotTypeMetadata]
$sel:slotTypes:GetSlotTypeVersionsResponse' :: GetSlotTypeVersionsResponse -> Maybe [SlotTypeMetadata]
slotTypes} -> Maybe [SlotTypeMetadata]
slotTypes) (\s :: GetSlotTypeVersionsResponse
s@GetSlotTypeVersionsResponse' {} Maybe [SlotTypeMetadata]
a -> GetSlotTypeVersionsResponse
s {$sel:slotTypes:GetSlotTypeVersionsResponse' :: Maybe [SlotTypeMetadata]
slotTypes = Maybe [SlotTypeMetadata]
a} :: GetSlotTypeVersionsResponse) ((Maybe [SlotTypeMetadata] -> f (Maybe [SlotTypeMetadata]))
 -> GetSlotTypeVersionsResponse -> f GetSlotTypeVersionsResponse)
-> ((Maybe [SlotTypeMetadata] -> f (Maybe [SlotTypeMetadata]))
    -> Maybe [SlotTypeMetadata] -> f (Maybe [SlotTypeMetadata]))
-> (Maybe [SlotTypeMetadata] -> f (Maybe [SlotTypeMetadata]))
-> GetSlotTypeVersionsResponse
-> f GetSlotTypeVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SlotTypeMetadata]
  [SlotTypeMetadata]
  [SlotTypeMetadata]
  [SlotTypeMetadata]
-> Iso
     (Maybe [SlotTypeMetadata])
     (Maybe [SlotTypeMetadata])
     (Maybe [SlotTypeMetadata])
     (Maybe [SlotTypeMetadata])
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
  [SlotTypeMetadata]
  [SlotTypeMetadata]
  [SlotTypeMetadata]
  [SlotTypeMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetSlotTypeVersionsResponse