{-# 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.IoT.ListThingTypes
-- 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)
--
-- Lists the existing thing types.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions ListThingTypes>
-- action.
--
-- This operation returns paginated results.
module Amazonka.IoT.ListThingTypes
  ( -- * Creating a Request
    ListThingTypes (..),
    newListThingTypes,

    -- * Request Lenses
    listThingTypes_thingTypeName,
    listThingTypes_nextToken,
    listThingTypes_maxResults,

    -- * Destructuring the Response
    ListThingTypesResponse (..),
    newListThingTypesResponse,

    -- * Response Lenses
    listThingTypesResponse_thingTypes,
    listThingTypesResponse_nextToken,
    listThingTypesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | The input for the ListThingTypes operation.
--
-- /See:/ 'newListThingTypes' smart constructor.
data ListThingTypes = ListThingTypes'
  { -- | The name of the thing type.
    ListThingTypes -> Maybe Text
thingTypeName :: Prelude.Maybe Prelude.Text,
    -- | To retrieve the next set of results, the @nextToken@ value from a
    -- previous response; otherwise __null__ to receive the first set of
    -- results.
    ListThingTypes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return in this operation.
    ListThingTypes -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListThingTypes -> ListThingTypes -> Bool
(ListThingTypes -> ListThingTypes -> Bool)
-> (ListThingTypes -> ListThingTypes -> Bool) -> Eq ListThingTypes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListThingTypes -> ListThingTypes -> Bool
$c/= :: ListThingTypes -> ListThingTypes -> Bool
== :: ListThingTypes -> ListThingTypes -> Bool
$c== :: ListThingTypes -> ListThingTypes -> Bool
Prelude.Eq, ReadPrec [ListThingTypes]
ReadPrec ListThingTypes
Int -> ReadS ListThingTypes
ReadS [ListThingTypes]
(Int -> ReadS ListThingTypes)
-> ReadS [ListThingTypes]
-> ReadPrec ListThingTypes
-> ReadPrec [ListThingTypes]
-> Read ListThingTypes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListThingTypes]
$creadListPrec :: ReadPrec [ListThingTypes]
readPrec :: ReadPrec ListThingTypes
$creadPrec :: ReadPrec ListThingTypes
readList :: ReadS [ListThingTypes]
$creadList :: ReadS [ListThingTypes]
readsPrec :: Int -> ReadS ListThingTypes
$creadsPrec :: Int -> ReadS ListThingTypes
Prelude.Read, Int -> ListThingTypes -> ShowS
[ListThingTypes] -> ShowS
ListThingTypes -> String
(Int -> ListThingTypes -> ShowS)
-> (ListThingTypes -> String)
-> ([ListThingTypes] -> ShowS)
-> Show ListThingTypes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListThingTypes] -> ShowS
$cshowList :: [ListThingTypes] -> ShowS
show :: ListThingTypes -> String
$cshow :: ListThingTypes -> String
showsPrec :: Int -> ListThingTypes -> ShowS
$cshowsPrec :: Int -> ListThingTypes -> ShowS
Prelude.Show, (forall x. ListThingTypes -> Rep ListThingTypes x)
-> (forall x. Rep ListThingTypes x -> ListThingTypes)
-> Generic ListThingTypes
forall x. Rep ListThingTypes x -> ListThingTypes
forall x. ListThingTypes -> Rep ListThingTypes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListThingTypes x -> ListThingTypes
$cfrom :: forall x. ListThingTypes -> Rep ListThingTypes x
Prelude.Generic)

-- |
-- Create a value of 'ListThingTypes' 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:
--
-- 'thingTypeName', 'listThingTypes_thingTypeName' - The name of the thing type.
--
-- 'nextToken', 'listThingTypes_nextToken' - To retrieve the next set of results, the @nextToken@ value from a
-- previous response; otherwise __null__ to receive the first set of
-- results.
--
-- 'maxResults', 'listThingTypes_maxResults' - The maximum number of results to return in this operation.
newListThingTypes ::
  ListThingTypes
newListThingTypes :: ListThingTypes
newListThingTypes =
  ListThingTypes' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListThingTypes
ListThingTypes'
    { $sel:thingTypeName:ListThingTypes' :: Maybe Text
thingTypeName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListThingTypes' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListThingTypes' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the thing type.
listThingTypes_thingTypeName :: Lens.Lens' ListThingTypes (Prelude.Maybe Prelude.Text)
listThingTypes_thingTypeName :: (Maybe Text -> f (Maybe Text))
-> ListThingTypes -> f ListThingTypes
listThingTypes_thingTypeName = (ListThingTypes -> Maybe Text)
-> (ListThingTypes -> Maybe Text -> ListThingTypes)
-> Lens ListThingTypes ListThingTypes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingTypes' {Maybe Text
thingTypeName :: Maybe Text
$sel:thingTypeName:ListThingTypes' :: ListThingTypes -> Maybe Text
thingTypeName} -> Maybe Text
thingTypeName) (\s :: ListThingTypes
s@ListThingTypes' {} Maybe Text
a -> ListThingTypes
s {$sel:thingTypeName:ListThingTypes' :: Maybe Text
thingTypeName = Maybe Text
a} :: ListThingTypes)

-- | To retrieve the next set of results, the @nextToken@ value from a
-- previous response; otherwise __null__ to receive the first set of
-- results.
listThingTypes_nextToken :: Lens.Lens' ListThingTypes (Prelude.Maybe Prelude.Text)
listThingTypes_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListThingTypes -> f ListThingTypes
listThingTypes_nextToken = (ListThingTypes -> Maybe Text)
-> (ListThingTypes -> Maybe Text -> ListThingTypes)
-> Lens ListThingTypes ListThingTypes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingTypes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListThingTypes' :: ListThingTypes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListThingTypes
s@ListThingTypes' {} Maybe Text
a -> ListThingTypes
s {$sel:nextToken:ListThingTypes' :: Maybe Text
nextToken = Maybe Text
a} :: ListThingTypes)

-- | The maximum number of results to return in this operation.
listThingTypes_maxResults :: Lens.Lens' ListThingTypes (Prelude.Maybe Prelude.Natural)
listThingTypes_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListThingTypes -> f ListThingTypes
listThingTypes_maxResults = (ListThingTypes -> Maybe Natural)
-> (ListThingTypes -> Maybe Natural -> ListThingTypes)
-> Lens
     ListThingTypes ListThingTypes (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingTypes' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListThingTypes' :: ListThingTypes -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListThingTypes
s@ListThingTypes' {} Maybe Natural
a -> ListThingTypes
s {$sel:maxResults:ListThingTypes' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListThingTypes)

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

instance Prelude.NFData ListThingTypes

instance Core.ToHeaders ListThingTypes where
  toHeaders :: ListThingTypes -> ResponseHeaders
toHeaders = ResponseHeaders -> ListThingTypes -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath ListThingTypes where
  toPath :: ListThingTypes -> ByteString
toPath = ByteString -> ListThingTypes -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/thing-types"

instance Core.ToQuery ListThingTypes where
  toQuery :: ListThingTypes -> QueryString
toQuery ListThingTypes' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
thingTypeName :: Maybe Text
$sel:maxResults:ListThingTypes' :: ListThingTypes -> Maybe Natural
$sel:nextToken:ListThingTypes' :: ListThingTypes -> Maybe Text
$sel:thingTypeName:ListThingTypes' :: ListThingTypes -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"thingTypeName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
thingTypeName,
        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
      ]

-- | The output for the ListThingTypes operation.
--
-- /See:/ 'newListThingTypesResponse' smart constructor.
data ListThingTypesResponse = ListThingTypesResponse'
  { -- | The thing types.
    ListThingTypesResponse -> Maybe [ThingTypeDefinition]
thingTypes :: Prelude.Maybe [ThingTypeDefinition],
    -- | The token for the next set of results. Will not be returned if operation
    -- has returned all results.
    ListThingTypesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListThingTypesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListThingTypesResponse -> ListThingTypesResponse -> Bool
(ListThingTypesResponse -> ListThingTypesResponse -> Bool)
-> (ListThingTypesResponse -> ListThingTypesResponse -> Bool)
-> Eq ListThingTypesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListThingTypesResponse -> ListThingTypesResponse -> Bool
$c/= :: ListThingTypesResponse -> ListThingTypesResponse -> Bool
== :: ListThingTypesResponse -> ListThingTypesResponse -> Bool
$c== :: ListThingTypesResponse -> ListThingTypesResponse -> Bool
Prelude.Eq, ReadPrec [ListThingTypesResponse]
ReadPrec ListThingTypesResponse
Int -> ReadS ListThingTypesResponse
ReadS [ListThingTypesResponse]
(Int -> ReadS ListThingTypesResponse)
-> ReadS [ListThingTypesResponse]
-> ReadPrec ListThingTypesResponse
-> ReadPrec [ListThingTypesResponse]
-> Read ListThingTypesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListThingTypesResponse]
$creadListPrec :: ReadPrec [ListThingTypesResponse]
readPrec :: ReadPrec ListThingTypesResponse
$creadPrec :: ReadPrec ListThingTypesResponse
readList :: ReadS [ListThingTypesResponse]
$creadList :: ReadS [ListThingTypesResponse]
readsPrec :: Int -> ReadS ListThingTypesResponse
$creadsPrec :: Int -> ReadS ListThingTypesResponse
Prelude.Read, Int -> ListThingTypesResponse -> ShowS
[ListThingTypesResponse] -> ShowS
ListThingTypesResponse -> String
(Int -> ListThingTypesResponse -> ShowS)
-> (ListThingTypesResponse -> String)
-> ([ListThingTypesResponse] -> ShowS)
-> Show ListThingTypesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListThingTypesResponse] -> ShowS
$cshowList :: [ListThingTypesResponse] -> ShowS
show :: ListThingTypesResponse -> String
$cshow :: ListThingTypesResponse -> String
showsPrec :: Int -> ListThingTypesResponse -> ShowS
$cshowsPrec :: Int -> ListThingTypesResponse -> ShowS
Prelude.Show, (forall x. ListThingTypesResponse -> Rep ListThingTypesResponse x)
-> (forall x.
    Rep ListThingTypesResponse x -> ListThingTypesResponse)
-> Generic ListThingTypesResponse
forall x. Rep ListThingTypesResponse x -> ListThingTypesResponse
forall x. ListThingTypesResponse -> Rep ListThingTypesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListThingTypesResponse x -> ListThingTypesResponse
$cfrom :: forall x. ListThingTypesResponse -> Rep ListThingTypesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListThingTypesResponse' 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:
--
-- 'thingTypes', 'listThingTypesResponse_thingTypes' - The thing types.
--
-- 'nextToken', 'listThingTypesResponse_nextToken' - The token for the next set of results. Will not be returned if operation
-- has returned all results.
--
-- 'httpStatus', 'listThingTypesResponse_httpStatus' - The response's http status code.
newListThingTypesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListThingTypesResponse
newListThingTypesResponse :: Int -> ListThingTypesResponse
newListThingTypesResponse Int
pHttpStatus_ =
  ListThingTypesResponse' :: Maybe [ThingTypeDefinition]
-> Maybe Text -> Int -> ListThingTypesResponse
ListThingTypesResponse'
    { $sel:thingTypes:ListThingTypesResponse' :: Maybe [ThingTypeDefinition]
thingTypes =
        Maybe [ThingTypeDefinition]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListThingTypesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListThingTypesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The thing types.
listThingTypesResponse_thingTypes :: Lens.Lens' ListThingTypesResponse (Prelude.Maybe [ThingTypeDefinition])
listThingTypesResponse_thingTypes :: (Maybe [ThingTypeDefinition] -> f (Maybe [ThingTypeDefinition]))
-> ListThingTypesResponse -> f ListThingTypesResponse
listThingTypesResponse_thingTypes = (ListThingTypesResponse -> Maybe [ThingTypeDefinition])
-> (ListThingTypesResponse
    -> Maybe [ThingTypeDefinition] -> ListThingTypesResponse)
-> Lens' ListThingTypesResponse (Maybe [ThingTypeDefinition])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingTypesResponse' {Maybe [ThingTypeDefinition]
thingTypes :: Maybe [ThingTypeDefinition]
$sel:thingTypes:ListThingTypesResponse' :: ListThingTypesResponse -> Maybe [ThingTypeDefinition]
thingTypes} -> Maybe [ThingTypeDefinition]
thingTypes) (\s :: ListThingTypesResponse
s@ListThingTypesResponse' {} Maybe [ThingTypeDefinition]
a -> ListThingTypesResponse
s {$sel:thingTypes:ListThingTypesResponse' :: Maybe [ThingTypeDefinition]
thingTypes = Maybe [ThingTypeDefinition]
a} :: ListThingTypesResponse) ((Maybe [ThingTypeDefinition] -> f (Maybe [ThingTypeDefinition]))
 -> ListThingTypesResponse -> f ListThingTypesResponse)
-> ((Maybe [ThingTypeDefinition]
     -> f (Maybe [ThingTypeDefinition]))
    -> Maybe [ThingTypeDefinition] -> f (Maybe [ThingTypeDefinition]))
-> (Maybe [ThingTypeDefinition] -> f (Maybe [ThingTypeDefinition]))
-> ListThingTypesResponse
-> f ListThingTypesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ThingTypeDefinition]
  [ThingTypeDefinition]
  [ThingTypeDefinition]
  [ThingTypeDefinition]
-> Iso
     (Maybe [ThingTypeDefinition])
     (Maybe [ThingTypeDefinition])
     (Maybe [ThingTypeDefinition])
     (Maybe [ThingTypeDefinition])
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
  [ThingTypeDefinition]
  [ThingTypeDefinition]
  [ThingTypeDefinition]
  [ThingTypeDefinition]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token for the next set of results. Will not be returned if operation
-- has returned all results.
listThingTypesResponse_nextToken :: Lens.Lens' ListThingTypesResponse (Prelude.Maybe Prelude.Text)
listThingTypesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListThingTypesResponse -> f ListThingTypesResponse
listThingTypesResponse_nextToken = (ListThingTypesResponse -> Maybe Text)
-> (ListThingTypesResponse -> Maybe Text -> ListThingTypesResponse)
-> Lens' ListThingTypesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingTypesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListThingTypesResponse' :: ListThingTypesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListThingTypesResponse
s@ListThingTypesResponse' {} Maybe Text
a -> ListThingTypesResponse
s {$sel:nextToken:ListThingTypesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListThingTypesResponse)

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

instance Prelude.NFData ListThingTypesResponse