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

    -- * Request Lenses
    listThingRegistrationTasks_status,
    listThingRegistrationTasks_nextToken,
    listThingRegistrationTasks_maxResults,

    -- * Destructuring the Response
    ListThingRegistrationTasksResponse (..),
    newListThingRegistrationTasksResponse,

    -- * Response Lenses
    listThingRegistrationTasksResponse_nextToken,
    listThingRegistrationTasksResponse_taskIds,
    listThingRegistrationTasksResponse_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

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

-- |
-- Create a value of 'ListThingRegistrationTasks' 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:
--
-- 'status', 'listThingRegistrationTasks_status' - The status of the bulk thing provisioning task.
--
-- 'nextToken', 'listThingRegistrationTasks_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', 'listThingRegistrationTasks_maxResults' - The maximum number of results to return at one time.
newListThingRegistrationTasks ::
  ListThingRegistrationTasks
newListThingRegistrationTasks :: ListThingRegistrationTasks
newListThingRegistrationTasks =
  ListThingRegistrationTasks' :: Maybe TaskStatus
-> Maybe Text -> Maybe Natural -> ListThingRegistrationTasks
ListThingRegistrationTasks'
    { $sel:status:ListThingRegistrationTasks' :: Maybe TaskStatus
status =
        Maybe TaskStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListThingRegistrationTasks' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListThingRegistrationTasks' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the bulk thing provisioning task.
listThingRegistrationTasks_status :: Lens.Lens' ListThingRegistrationTasks (Prelude.Maybe TaskStatus)
listThingRegistrationTasks_status :: (Maybe TaskStatus -> f (Maybe TaskStatus))
-> ListThingRegistrationTasks -> f ListThingRegistrationTasks
listThingRegistrationTasks_status = (ListThingRegistrationTasks -> Maybe TaskStatus)
-> (ListThingRegistrationTasks
    -> Maybe TaskStatus -> ListThingRegistrationTasks)
-> Lens
     ListThingRegistrationTasks
     ListThingRegistrationTasks
     (Maybe TaskStatus)
     (Maybe TaskStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingRegistrationTasks' {Maybe TaskStatus
status :: Maybe TaskStatus
$sel:status:ListThingRegistrationTasks' :: ListThingRegistrationTasks -> Maybe TaskStatus
status} -> Maybe TaskStatus
status) (\s :: ListThingRegistrationTasks
s@ListThingRegistrationTasks' {} Maybe TaskStatus
a -> ListThingRegistrationTasks
s {$sel:status:ListThingRegistrationTasks' :: Maybe TaskStatus
status = Maybe TaskStatus
a} :: ListThingRegistrationTasks)

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

-- | The maximum number of results to return at one time.
listThingRegistrationTasks_maxResults :: Lens.Lens' ListThingRegistrationTasks (Prelude.Maybe Prelude.Natural)
listThingRegistrationTasks_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListThingRegistrationTasks -> f ListThingRegistrationTasks
listThingRegistrationTasks_maxResults = (ListThingRegistrationTasks -> Maybe Natural)
-> (ListThingRegistrationTasks
    -> Maybe Natural -> ListThingRegistrationTasks)
-> Lens
     ListThingRegistrationTasks
     ListThingRegistrationTasks
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingRegistrationTasks' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListThingRegistrationTasks' :: ListThingRegistrationTasks -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListThingRegistrationTasks
s@ListThingRegistrationTasks' {} Maybe Natural
a -> ListThingRegistrationTasks
s {$sel:maxResults:ListThingRegistrationTasks' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListThingRegistrationTasks)

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

instance Prelude.NFData ListThingRegistrationTasks

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

instance Core.ToPath ListThingRegistrationTasks where
  toPath :: ListThingRegistrationTasks -> ByteString
toPath = ByteString -> ListThingRegistrationTasks -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/thing-registration-tasks"

instance Core.ToQuery ListThingRegistrationTasks where
  toQuery :: ListThingRegistrationTasks -> QueryString
toQuery ListThingRegistrationTasks' {Maybe Natural
Maybe Text
Maybe TaskStatus
maxResults :: Maybe Natural
nextToken :: Maybe Text
status :: Maybe TaskStatus
$sel:maxResults:ListThingRegistrationTasks' :: ListThingRegistrationTasks -> Maybe Natural
$sel:nextToken:ListThingRegistrationTasks' :: ListThingRegistrationTasks -> Maybe Text
$sel:status:ListThingRegistrationTasks' :: ListThingRegistrationTasks -> Maybe TaskStatus
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"status" ByteString -> Maybe TaskStatus -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe TaskStatus
status,
        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:/ 'newListThingRegistrationTasksResponse' smart constructor.
data ListThingRegistrationTasksResponse = ListThingRegistrationTasksResponse'
  { -- | The token to use to get the next set of results, or __null__ if there
    -- are no additional results.
    ListThingRegistrationTasksResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of bulk thing provisioning task IDs.
    ListThingRegistrationTasksResponse -> Maybe [Text]
taskIds :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    ListThingRegistrationTasksResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListThingRegistrationTasksResponse
-> ListThingRegistrationTasksResponse -> Bool
(ListThingRegistrationTasksResponse
 -> ListThingRegistrationTasksResponse -> Bool)
-> (ListThingRegistrationTasksResponse
    -> ListThingRegistrationTasksResponse -> Bool)
-> Eq ListThingRegistrationTasksResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListThingRegistrationTasksResponse
-> ListThingRegistrationTasksResponse -> Bool
$c/= :: ListThingRegistrationTasksResponse
-> ListThingRegistrationTasksResponse -> Bool
== :: ListThingRegistrationTasksResponse
-> ListThingRegistrationTasksResponse -> Bool
$c== :: ListThingRegistrationTasksResponse
-> ListThingRegistrationTasksResponse -> Bool
Prelude.Eq, ReadPrec [ListThingRegistrationTasksResponse]
ReadPrec ListThingRegistrationTasksResponse
Int -> ReadS ListThingRegistrationTasksResponse
ReadS [ListThingRegistrationTasksResponse]
(Int -> ReadS ListThingRegistrationTasksResponse)
-> ReadS [ListThingRegistrationTasksResponse]
-> ReadPrec ListThingRegistrationTasksResponse
-> ReadPrec [ListThingRegistrationTasksResponse]
-> Read ListThingRegistrationTasksResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListThingRegistrationTasksResponse]
$creadListPrec :: ReadPrec [ListThingRegistrationTasksResponse]
readPrec :: ReadPrec ListThingRegistrationTasksResponse
$creadPrec :: ReadPrec ListThingRegistrationTasksResponse
readList :: ReadS [ListThingRegistrationTasksResponse]
$creadList :: ReadS [ListThingRegistrationTasksResponse]
readsPrec :: Int -> ReadS ListThingRegistrationTasksResponse
$creadsPrec :: Int -> ReadS ListThingRegistrationTasksResponse
Prelude.Read, Int -> ListThingRegistrationTasksResponse -> ShowS
[ListThingRegistrationTasksResponse] -> ShowS
ListThingRegistrationTasksResponse -> String
(Int -> ListThingRegistrationTasksResponse -> ShowS)
-> (ListThingRegistrationTasksResponse -> String)
-> ([ListThingRegistrationTasksResponse] -> ShowS)
-> Show ListThingRegistrationTasksResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListThingRegistrationTasksResponse] -> ShowS
$cshowList :: [ListThingRegistrationTasksResponse] -> ShowS
show :: ListThingRegistrationTasksResponse -> String
$cshow :: ListThingRegistrationTasksResponse -> String
showsPrec :: Int -> ListThingRegistrationTasksResponse -> ShowS
$cshowsPrec :: Int -> ListThingRegistrationTasksResponse -> ShowS
Prelude.Show, (forall x.
 ListThingRegistrationTasksResponse
 -> Rep ListThingRegistrationTasksResponse x)
-> (forall x.
    Rep ListThingRegistrationTasksResponse x
    -> ListThingRegistrationTasksResponse)
-> Generic ListThingRegistrationTasksResponse
forall x.
Rep ListThingRegistrationTasksResponse x
-> ListThingRegistrationTasksResponse
forall x.
ListThingRegistrationTasksResponse
-> Rep ListThingRegistrationTasksResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListThingRegistrationTasksResponse x
-> ListThingRegistrationTasksResponse
$cfrom :: forall x.
ListThingRegistrationTasksResponse
-> Rep ListThingRegistrationTasksResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListThingRegistrationTasksResponse' 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', 'listThingRegistrationTasksResponse_nextToken' - The token to use to get the next set of results, or __null__ if there
-- are no additional results.
--
-- 'taskIds', 'listThingRegistrationTasksResponse_taskIds' - A list of bulk thing provisioning task IDs.
--
-- 'httpStatus', 'listThingRegistrationTasksResponse_httpStatus' - The response's http status code.
newListThingRegistrationTasksResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListThingRegistrationTasksResponse
newListThingRegistrationTasksResponse :: Int -> ListThingRegistrationTasksResponse
newListThingRegistrationTasksResponse Int
pHttpStatus_ =
  ListThingRegistrationTasksResponse' :: Maybe Text
-> Maybe [Text] -> Int -> ListThingRegistrationTasksResponse
ListThingRegistrationTasksResponse'
    { $sel:nextToken:ListThingRegistrationTasksResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:taskIds:ListThingRegistrationTasksResponse' :: Maybe [Text]
taskIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListThingRegistrationTasksResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token to use to get the next set of results, or __null__ if there
-- are no additional results.
listThingRegistrationTasksResponse_nextToken :: Lens.Lens' ListThingRegistrationTasksResponse (Prelude.Maybe Prelude.Text)
listThingRegistrationTasksResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListThingRegistrationTasksResponse
-> f ListThingRegistrationTasksResponse
listThingRegistrationTasksResponse_nextToken = (ListThingRegistrationTasksResponse -> Maybe Text)
-> (ListThingRegistrationTasksResponse
    -> Maybe Text -> ListThingRegistrationTasksResponse)
-> Lens' ListThingRegistrationTasksResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingRegistrationTasksResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListThingRegistrationTasksResponse' :: ListThingRegistrationTasksResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListThingRegistrationTasksResponse
s@ListThingRegistrationTasksResponse' {} Maybe Text
a -> ListThingRegistrationTasksResponse
s {$sel:nextToken:ListThingRegistrationTasksResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListThingRegistrationTasksResponse)

-- | A list of bulk thing provisioning task IDs.
listThingRegistrationTasksResponse_taskIds :: Lens.Lens' ListThingRegistrationTasksResponse (Prelude.Maybe [Prelude.Text])
listThingRegistrationTasksResponse_taskIds :: (Maybe [Text] -> f (Maybe [Text]))
-> ListThingRegistrationTasksResponse
-> f ListThingRegistrationTasksResponse
listThingRegistrationTasksResponse_taskIds = (ListThingRegistrationTasksResponse -> Maybe [Text])
-> (ListThingRegistrationTasksResponse
    -> Maybe [Text] -> ListThingRegistrationTasksResponse)
-> Lens' ListThingRegistrationTasksResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingRegistrationTasksResponse' {Maybe [Text]
taskIds :: Maybe [Text]
$sel:taskIds:ListThingRegistrationTasksResponse' :: ListThingRegistrationTasksResponse -> Maybe [Text]
taskIds} -> Maybe [Text]
taskIds) (\s :: ListThingRegistrationTasksResponse
s@ListThingRegistrationTasksResponse' {} Maybe [Text]
a -> ListThingRegistrationTasksResponse
s {$sel:taskIds:ListThingRegistrationTasksResponse' :: Maybe [Text]
taskIds = Maybe [Text]
a} :: ListThingRegistrationTasksResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListThingRegistrationTasksResponse
 -> f ListThingRegistrationTasksResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListThingRegistrationTasksResponse
-> f ListThingRegistrationTasksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListThingRegistrationTasksResponse