{-# 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.GetSlotTypes
-- 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)
--
-- Returns slot type information as follows:
--
-- -   If you specify the @nameContains@ field, returns the @$LATEST@
--     version of all slot types that contain the specified string.
--
-- -   If you don\'t specify the @nameContains@ field, returns information
--     about the @$LATEST@ version of all slot types.
--
-- The operation requires permission for the @lex:GetSlotTypes@ action.
--
-- This operation returns paginated results.
module Amazonka.LexModels.GetSlotTypes
  ( -- * Creating a Request
    GetSlotTypes (..),
    newGetSlotTypes,

    -- * Request Lenses
    getSlotTypes_nameContains,
    getSlotTypes_nextToken,
    getSlotTypes_maxResults,

    -- * Destructuring the Response
    GetSlotTypesResponse (..),
    newGetSlotTypesResponse,

    -- * Response Lenses
    getSlotTypesResponse_nextToken,
    getSlotTypesResponse_slotTypes,
    getSlotTypesResponse_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:/ 'newGetSlotTypes' smart constructor.
data GetSlotTypes = GetSlotTypes'
  { -- | Substring to match in slot type names. A slot type will be returned if
    -- any part of its name matches the substring. For example, \"xyz\" matches
    -- both \"xyzabc\" and \"abcxyz.\"
    GetSlotTypes -> Maybe Text
nameContains :: Prelude.Maybe Prelude.Text,
    -- | A pagination token that fetches the next page of slot types. If the
    -- response to this API call is truncated, Amazon Lex returns a pagination
    -- token in the response. To fetch next page of slot types, specify the
    -- pagination token in the next request.
    GetSlotTypes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of slot types to return in the response. The default
    -- is 10.
    GetSlotTypes -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (GetSlotTypes -> GetSlotTypes -> Bool
(GetSlotTypes -> GetSlotTypes -> Bool)
-> (GetSlotTypes -> GetSlotTypes -> Bool) -> Eq GetSlotTypes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSlotTypes -> GetSlotTypes -> Bool
$c/= :: GetSlotTypes -> GetSlotTypes -> Bool
== :: GetSlotTypes -> GetSlotTypes -> Bool
$c== :: GetSlotTypes -> GetSlotTypes -> Bool
Prelude.Eq, ReadPrec [GetSlotTypes]
ReadPrec GetSlotTypes
Int -> ReadS GetSlotTypes
ReadS [GetSlotTypes]
(Int -> ReadS GetSlotTypes)
-> ReadS [GetSlotTypes]
-> ReadPrec GetSlotTypes
-> ReadPrec [GetSlotTypes]
-> Read GetSlotTypes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSlotTypes]
$creadListPrec :: ReadPrec [GetSlotTypes]
readPrec :: ReadPrec GetSlotTypes
$creadPrec :: ReadPrec GetSlotTypes
readList :: ReadS [GetSlotTypes]
$creadList :: ReadS [GetSlotTypes]
readsPrec :: Int -> ReadS GetSlotTypes
$creadsPrec :: Int -> ReadS GetSlotTypes
Prelude.Read, Int -> GetSlotTypes -> ShowS
[GetSlotTypes] -> ShowS
GetSlotTypes -> String
(Int -> GetSlotTypes -> ShowS)
-> (GetSlotTypes -> String)
-> ([GetSlotTypes] -> ShowS)
-> Show GetSlotTypes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSlotTypes] -> ShowS
$cshowList :: [GetSlotTypes] -> ShowS
show :: GetSlotTypes -> String
$cshow :: GetSlotTypes -> String
showsPrec :: Int -> GetSlotTypes -> ShowS
$cshowsPrec :: Int -> GetSlotTypes -> ShowS
Prelude.Show, (forall x. GetSlotTypes -> Rep GetSlotTypes x)
-> (forall x. Rep GetSlotTypes x -> GetSlotTypes)
-> Generic GetSlotTypes
forall x. Rep GetSlotTypes x -> GetSlotTypes
forall x. GetSlotTypes -> Rep GetSlotTypes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSlotTypes x -> GetSlotTypes
$cfrom :: forall x. GetSlotTypes -> Rep GetSlotTypes x
Prelude.Generic)

-- |
-- Create a value of 'GetSlotTypes' 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:
--
-- 'nameContains', 'getSlotTypes_nameContains' - Substring to match in slot type names. A slot type will be returned if
-- any part of its name matches the substring. For example, \"xyz\" matches
-- both \"xyzabc\" and \"abcxyz.\"
--
-- 'nextToken', 'getSlotTypes_nextToken' - A pagination token that fetches the next page of slot types. If the
-- response to this API call is truncated, Amazon Lex returns a pagination
-- token in the response. To fetch next page of slot types, specify the
-- pagination token in the next request.
--
-- 'maxResults', 'getSlotTypes_maxResults' - The maximum number of slot types to return in the response. The default
-- is 10.
newGetSlotTypes ::
  GetSlotTypes
newGetSlotTypes :: GetSlotTypes
newGetSlotTypes =
  GetSlotTypes' :: Maybe Text -> Maybe Text -> Maybe Natural -> GetSlotTypes
GetSlotTypes'
    { $sel:nameContains:GetSlotTypes' :: Maybe Text
nameContains = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetSlotTypes' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetSlotTypes' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Substring to match in slot type names. A slot type will be returned if
-- any part of its name matches the substring. For example, \"xyz\" matches
-- both \"xyzabc\" and \"abcxyz.\"
getSlotTypes_nameContains :: Lens.Lens' GetSlotTypes (Prelude.Maybe Prelude.Text)
getSlotTypes_nameContains :: (Maybe Text -> f (Maybe Text)) -> GetSlotTypes -> f GetSlotTypes
getSlotTypes_nameContains = (GetSlotTypes -> Maybe Text)
-> (GetSlotTypes -> Maybe Text -> GetSlotTypes)
-> Lens GetSlotTypes GetSlotTypes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSlotTypes' {Maybe Text
nameContains :: Maybe Text
$sel:nameContains:GetSlotTypes' :: GetSlotTypes -> Maybe Text
nameContains} -> Maybe Text
nameContains) (\s :: GetSlotTypes
s@GetSlotTypes' {} Maybe Text
a -> GetSlotTypes
s {$sel:nameContains:GetSlotTypes' :: Maybe Text
nameContains = Maybe Text
a} :: GetSlotTypes)

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

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

instance Core.AWSPager GetSlotTypes where
  page :: GetSlotTypes -> AWSResponse GetSlotTypes -> Maybe GetSlotTypes
page GetSlotTypes
rq AWSResponse GetSlotTypes
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetSlotTypes
GetSlotTypesResponse
rs
            GetSlotTypesResponse
-> Getting (First Text) GetSlotTypesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetSlotTypesResponse -> Const (First Text) GetSlotTypesResponse
Lens' GetSlotTypesResponse (Maybe Text)
getSlotTypesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetSlotTypesResponse -> Const (First Text) GetSlotTypesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetSlotTypesResponse 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 GetSlotTypes
forall a. Maybe a
Prelude.Nothing
    | Maybe [SlotTypeMetadata] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetSlotTypes
GetSlotTypesResponse
rs
            GetSlotTypesResponse
-> Getting
     (First [SlotTypeMetadata]) GetSlotTypesResponse [SlotTypeMetadata]
-> Maybe [SlotTypeMetadata]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [SlotTypeMetadata]
 -> Const (First [SlotTypeMetadata]) (Maybe [SlotTypeMetadata]))
-> GetSlotTypesResponse
-> Const (First [SlotTypeMetadata]) GetSlotTypesResponse
Lens' GetSlotTypesResponse (Maybe [SlotTypeMetadata])
getSlotTypesResponse_slotTypes ((Maybe [SlotTypeMetadata]
  -> Const (First [SlotTypeMetadata]) (Maybe [SlotTypeMetadata]))
 -> GetSlotTypesResponse
 -> Const (First [SlotTypeMetadata]) GetSlotTypesResponse)
-> (([SlotTypeMetadata]
     -> Const (First [SlotTypeMetadata]) [SlotTypeMetadata])
    -> Maybe [SlotTypeMetadata]
    -> Const (First [SlotTypeMetadata]) (Maybe [SlotTypeMetadata]))
-> Getting
     (First [SlotTypeMetadata]) GetSlotTypesResponse [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 GetSlotTypes
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetSlotTypes -> Maybe GetSlotTypes
forall a. a -> Maybe a
Prelude.Just (GetSlotTypes -> Maybe GetSlotTypes)
-> GetSlotTypes -> Maybe GetSlotTypes
forall a b. (a -> b) -> a -> b
Prelude.$
        GetSlotTypes
rq
          GetSlotTypes -> (GetSlotTypes -> GetSlotTypes) -> GetSlotTypes
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetSlotTypes -> Identity GetSlotTypes
Lens GetSlotTypes GetSlotTypes (Maybe Text) (Maybe Text)
getSlotTypes_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> GetSlotTypes -> Identity GetSlotTypes)
-> Maybe Text -> GetSlotTypes -> GetSlotTypes
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetSlotTypes
GetSlotTypesResponse
rs
          GetSlotTypesResponse
-> Getting (First Text) GetSlotTypesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetSlotTypesResponse -> Const (First Text) GetSlotTypesResponse
Lens' GetSlotTypesResponse (Maybe Text)
getSlotTypesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetSlotTypesResponse -> Const (First Text) GetSlotTypesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetSlotTypesResponse 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 GetSlotTypes where
  type AWSResponse GetSlotTypes = GetSlotTypesResponse
  request :: GetSlotTypes -> Request GetSlotTypes
request = Service -> GetSlotTypes -> Request GetSlotTypes
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetSlotTypes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetSlotTypes)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetSlotTypes))
-> Logger
-> Service
-> Proxy GetSlotTypes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetSlotTypes)))
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 -> GetSlotTypesResponse
GetSlotTypesResponse'
            (Maybe Text
 -> Maybe [SlotTypeMetadata] -> Int -> GetSlotTypesResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [SlotTypeMetadata] -> Int -> GetSlotTypesResponse)
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 -> GetSlotTypesResponse)
-> Either String (Maybe [SlotTypeMetadata])
-> Either String (Int -> GetSlotTypesResponse)
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 -> GetSlotTypesResponse)
-> Either String Int -> Either String GetSlotTypesResponse
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 GetSlotTypes

instance Prelude.NFData GetSlotTypes

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

instance Core.ToQuery GetSlotTypes where
  toQuery :: GetSlotTypes -> QueryString
toQuery GetSlotTypes' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
nameContains :: Maybe Text
$sel:maxResults:GetSlotTypes' :: GetSlotTypes -> Maybe Natural
$sel:nextToken:GetSlotTypes' :: GetSlotTypes -> Maybe Text
$sel:nameContains:GetSlotTypes' :: GetSlotTypes -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nameContains" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nameContains,
        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:/ 'newGetSlotTypesResponse' smart constructor.
data GetSlotTypesResponse = GetSlotTypesResponse'
  { -- | If the response is truncated, it includes a pagination token that you
    -- can specify in your next request to fetch the next page of slot types.
    GetSlotTypesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of objects, one for each slot type, that provides information
    -- such as the name of the slot type, the version, and a description.
    GetSlotTypesResponse -> Maybe [SlotTypeMetadata]
slotTypes :: Prelude.Maybe [SlotTypeMetadata],
    -- | The response's http status code.
    GetSlotTypesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetSlotTypesResponse -> GetSlotTypesResponse -> Bool
(GetSlotTypesResponse -> GetSlotTypesResponse -> Bool)
-> (GetSlotTypesResponse -> GetSlotTypesResponse -> Bool)
-> Eq GetSlotTypesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSlotTypesResponse -> GetSlotTypesResponse -> Bool
$c/= :: GetSlotTypesResponse -> GetSlotTypesResponse -> Bool
== :: GetSlotTypesResponse -> GetSlotTypesResponse -> Bool
$c== :: GetSlotTypesResponse -> GetSlotTypesResponse -> Bool
Prelude.Eq, ReadPrec [GetSlotTypesResponse]
ReadPrec GetSlotTypesResponse
Int -> ReadS GetSlotTypesResponse
ReadS [GetSlotTypesResponse]
(Int -> ReadS GetSlotTypesResponse)
-> ReadS [GetSlotTypesResponse]
-> ReadPrec GetSlotTypesResponse
-> ReadPrec [GetSlotTypesResponse]
-> Read GetSlotTypesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSlotTypesResponse]
$creadListPrec :: ReadPrec [GetSlotTypesResponse]
readPrec :: ReadPrec GetSlotTypesResponse
$creadPrec :: ReadPrec GetSlotTypesResponse
readList :: ReadS [GetSlotTypesResponse]
$creadList :: ReadS [GetSlotTypesResponse]
readsPrec :: Int -> ReadS GetSlotTypesResponse
$creadsPrec :: Int -> ReadS GetSlotTypesResponse
Prelude.Read, Int -> GetSlotTypesResponse -> ShowS
[GetSlotTypesResponse] -> ShowS
GetSlotTypesResponse -> String
(Int -> GetSlotTypesResponse -> ShowS)
-> (GetSlotTypesResponse -> String)
-> ([GetSlotTypesResponse] -> ShowS)
-> Show GetSlotTypesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSlotTypesResponse] -> ShowS
$cshowList :: [GetSlotTypesResponse] -> ShowS
show :: GetSlotTypesResponse -> String
$cshow :: GetSlotTypesResponse -> String
showsPrec :: Int -> GetSlotTypesResponse -> ShowS
$cshowsPrec :: Int -> GetSlotTypesResponse -> ShowS
Prelude.Show, (forall x. GetSlotTypesResponse -> Rep GetSlotTypesResponse x)
-> (forall x. Rep GetSlotTypesResponse x -> GetSlotTypesResponse)
-> Generic GetSlotTypesResponse
forall x. Rep GetSlotTypesResponse x -> GetSlotTypesResponse
forall x. GetSlotTypesResponse -> Rep GetSlotTypesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSlotTypesResponse x -> GetSlotTypesResponse
$cfrom :: forall x. GetSlotTypesResponse -> Rep GetSlotTypesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetSlotTypesResponse' 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', 'getSlotTypesResponse_nextToken' - If the response is truncated, it includes a pagination token that you
-- can specify in your next request to fetch the next page of slot types.
--
-- 'slotTypes', 'getSlotTypesResponse_slotTypes' - An array of objects, one for each slot type, that provides information
-- such as the name of the slot type, the version, and a description.
--
-- 'httpStatus', 'getSlotTypesResponse_httpStatus' - The response's http status code.
newGetSlotTypesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetSlotTypesResponse
newGetSlotTypesResponse :: Int -> GetSlotTypesResponse
newGetSlotTypesResponse Int
pHttpStatus_ =
  GetSlotTypesResponse' :: Maybe Text
-> Maybe [SlotTypeMetadata] -> Int -> GetSlotTypesResponse
GetSlotTypesResponse'
    { $sel:nextToken:GetSlotTypesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:slotTypes:GetSlotTypesResponse' :: Maybe [SlotTypeMetadata]
slotTypes = Maybe [SlotTypeMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetSlotTypesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If the response is truncated, it includes a pagination token that you
-- can specify in your next request to fetch the next page of slot types.
getSlotTypesResponse_nextToken :: Lens.Lens' GetSlotTypesResponse (Prelude.Maybe Prelude.Text)
getSlotTypesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetSlotTypesResponse -> f GetSlotTypesResponse
getSlotTypesResponse_nextToken = (GetSlotTypesResponse -> Maybe Text)
-> (GetSlotTypesResponse -> Maybe Text -> GetSlotTypesResponse)
-> Lens' GetSlotTypesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSlotTypesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetSlotTypesResponse' :: GetSlotTypesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetSlotTypesResponse
s@GetSlotTypesResponse' {} Maybe Text
a -> GetSlotTypesResponse
s {$sel:nextToken:GetSlotTypesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetSlotTypesResponse)

-- | An array of objects, one for each slot type, that provides information
-- such as the name of the slot type, the version, and a description.
getSlotTypesResponse_slotTypes :: Lens.Lens' GetSlotTypesResponse (Prelude.Maybe [SlotTypeMetadata])
getSlotTypesResponse_slotTypes :: (Maybe [SlotTypeMetadata] -> f (Maybe [SlotTypeMetadata]))
-> GetSlotTypesResponse -> f GetSlotTypesResponse
getSlotTypesResponse_slotTypes = (GetSlotTypesResponse -> Maybe [SlotTypeMetadata])
-> (GetSlotTypesResponse
    -> Maybe [SlotTypeMetadata] -> GetSlotTypesResponse)
-> Lens' GetSlotTypesResponse (Maybe [SlotTypeMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSlotTypesResponse' {Maybe [SlotTypeMetadata]
slotTypes :: Maybe [SlotTypeMetadata]
$sel:slotTypes:GetSlotTypesResponse' :: GetSlotTypesResponse -> Maybe [SlotTypeMetadata]
slotTypes} -> Maybe [SlotTypeMetadata]
slotTypes) (\s :: GetSlotTypesResponse
s@GetSlotTypesResponse' {} Maybe [SlotTypeMetadata]
a -> GetSlotTypesResponse
s {$sel:slotTypes:GetSlotTypesResponse' :: Maybe [SlotTypeMetadata]
slotTypes = Maybe [SlotTypeMetadata]
a} :: GetSlotTypesResponse) ((Maybe [SlotTypeMetadata] -> f (Maybe [SlotTypeMetadata]))
 -> GetSlotTypesResponse -> f GetSlotTypesResponse)
-> ((Maybe [SlotTypeMetadata] -> f (Maybe [SlotTypeMetadata]))
    -> Maybe [SlotTypeMetadata] -> f (Maybe [SlotTypeMetadata]))
-> (Maybe [SlotTypeMetadata] -> f (Maybe [SlotTypeMetadata]))
-> GetSlotTypesResponse
-> f GetSlotTypesResponse
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.
getSlotTypesResponse_httpStatus :: Lens.Lens' GetSlotTypesResponse Prelude.Int
getSlotTypesResponse_httpStatus :: (Int -> f Int) -> GetSlotTypesResponse -> f GetSlotTypesResponse
getSlotTypesResponse_httpStatus = (GetSlotTypesResponse -> Int)
-> (GetSlotTypesResponse -> Int -> GetSlotTypesResponse)
-> Lens GetSlotTypesResponse GetSlotTypesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSlotTypesResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetSlotTypesResponse' :: GetSlotTypesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetSlotTypesResponse
s@GetSlotTypesResponse' {} Int
a -> GetSlotTypesResponse
s {$sel:httpStatus:GetSlotTypesResponse' :: Int
httpStatus = Int
a} :: GetSlotTypesResponse)

instance Prelude.NFData GetSlotTypesResponse