{-# 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.ListThingRegistrationTaskReports
-- 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)
--
-- Information about the thing registration tasks.
--
-- This operation returns paginated results.
module Amazonka.IoT.ListThingRegistrationTaskReports
  ( -- * Creating a Request
    ListThingRegistrationTaskReports (..),
    newListThingRegistrationTaskReports,

    -- * Request Lenses
    listThingRegistrationTaskReports_nextToken,
    listThingRegistrationTaskReports_maxResults,
    listThingRegistrationTaskReports_taskId,
    listThingRegistrationTaskReports_reportType,

    -- * Destructuring the Response
    ListThingRegistrationTaskReportsResponse (..),
    newListThingRegistrationTaskReportsResponse,

    -- * Response Lenses
    listThingRegistrationTaskReportsResponse_resourceLinks,
    listThingRegistrationTaskReportsResponse_nextToken,
    listThingRegistrationTaskReportsResponse_reportType,
    listThingRegistrationTaskReportsResponse_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:/ 'newListThingRegistrationTaskReports' smart constructor.
data ListThingRegistrationTaskReports = ListThingRegistrationTaskReports'
  { -- | To retrieve the next set of results, the @nextToken@ value from a
    -- previous response; otherwise __null__ to receive the first set of
    -- results.
    ListThingRegistrationTaskReports -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return per request.
    ListThingRegistrationTaskReports -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The id of the task.
    ListThingRegistrationTaskReports -> Text
taskId :: Prelude.Text,
    -- | The type of task report.
    ListThingRegistrationTaskReports -> ReportType
reportType :: ReportType
  }
  deriving (ListThingRegistrationTaskReports
-> ListThingRegistrationTaskReports -> Bool
(ListThingRegistrationTaskReports
 -> ListThingRegistrationTaskReports -> Bool)
-> (ListThingRegistrationTaskReports
    -> ListThingRegistrationTaskReports -> Bool)
-> Eq ListThingRegistrationTaskReports
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListThingRegistrationTaskReports
-> ListThingRegistrationTaskReports -> Bool
$c/= :: ListThingRegistrationTaskReports
-> ListThingRegistrationTaskReports -> Bool
== :: ListThingRegistrationTaskReports
-> ListThingRegistrationTaskReports -> Bool
$c== :: ListThingRegistrationTaskReports
-> ListThingRegistrationTaskReports -> Bool
Prelude.Eq, ReadPrec [ListThingRegistrationTaskReports]
ReadPrec ListThingRegistrationTaskReports
Int -> ReadS ListThingRegistrationTaskReports
ReadS [ListThingRegistrationTaskReports]
(Int -> ReadS ListThingRegistrationTaskReports)
-> ReadS [ListThingRegistrationTaskReports]
-> ReadPrec ListThingRegistrationTaskReports
-> ReadPrec [ListThingRegistrationTaskReports]
-> Read ListThingRegistrationTaskReports
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListThingRegistrationTaskReports]
$creadListPrec :: ReadPrec [ListThingRegistrationTaskReports]
readPrec :: ReadPrec ListThingRegistrationTaskReports
$creadPrec :: ReadPrec ListThingRegistrationTaskReports
readList :: ReadS [ListThingRegistrationTaskReports]
$creadList :: ReadS [ListThingRegistrationTaskReports]
readsPrec :: Int -> ReadS ListThingRegistrationTaskReports
$creadsPrec :: Int -> ReadS ListThingRegistrationTaskReports
Prelude.Read, Int -> ListThingRegistrationTaskReports -> ShowS
[ListThingRegistrationTaskReports] -> ShowS
ListThingRegistrationTaskReports -> String
(Int -> ListThingRegistrationTaskReports -> ShowS)
-> (ListThingRegistrationTaskReports -> String)
-> ([ListThingRegistrationTaskReports] -> ShowS)
-> Show ListThingRegistrationTaskReports
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListThingRegistrationTaskReports] -> ShowS
$cshowList :: [ListThingRegistrationTaskReports] -> ShowS
show :: ListThingRegistrationTaskReports -> String
$cshow :: ListThingRegistrationTaskReports -> String
showsPrec :: Int -> ListThingRegistrationTaskReports -> ShowS
$cshowsPrec :: Int -> ListThingRegistrationTaskReports -> ShowS
Prelude.Show, (forall x.
 ListThingRegistrationTaskReports
 -> Rep ListThingRegistrationTaskReports x)
-> (forall x.
    Rep ListThingRegistrationTaskReports x
    -> ListThingRegistrationTaskReports)
-> Generic ListThingRegistrationTaskReports
forall x.
Rep ListThingRegistrationTaskReports x
-> ListThingRegistrationTaskReports
forall x.
ListThingRegistrationTaskReports
-> Rep ListThingRegistrationTaskReports x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListThingRegistrationTaskReports x
-> ListThingRegistrationTaskReports
$cfrom :: forall x.
ListThingRegistrationTaskReports
-> Rep ListThingRegistrationTaskReports x
Prelude.Generic)

-- |
-- Create a value of 'ListThingRegistrationTaskReports' 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', 'listThingRegistrationTaskReports_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', 'listThingRegistrationTaskReports_maxResults' - The maximum number of results to return per request.
--
-- 'taskId', 'listThingRegistrationTaskReports_taskId' - The id of the task.
--
-- 'reportType', 'listThingRegistrationTaskReports_reportType' - The type of task report.
newListThingRegistrationTaskReports ::
  -- | 'taskId'
  Prelude.Text ->
  -- | 'reportType'
  ReportType ->
  ListThingRegistrationTaskReports
newListThingRegistrationTaskReports :: Text -> ReportType -> ListThingRegistrationTaskReports
newListThingRegistrationTaskReports
  Text
pTaskId_
  ReportType
pReportType_ =
    ListThingRegistrationTaskReports' :: Maybe Text
-> Maybe Natural
-> Text
-> ReportType
-> ListThingRegistrationTaskReports
ListThingRegistrationTaskReports'
      { $sel:nextToken:ListThingRegistrationTaskReports' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListThingRegistrationTaskReports' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:taskId:ListThingRegistrationTaskReports' :: Text
taskId = Text
pTaskId_,
        $sel:reportType:ListThingRegistrationTaskReports' :: ReportType
reportType = ReportType
pReportType_
      }

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

-- | The maximum number of results to return per request.
listThingRegistrationTaskReports_maxResults :: Lens.Lens' ListThingRegistrationTaskReports (Prelude.Maybe Prelude.Natural)
listThingRegistrationTaskReports_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListThingRegistrationTaskReports
-> f ListThingRegistrationTaskReports
listThingRegistrationTaskReports_maxResults = (ListThingRegistrationTaskReports -> Maybe Natural)
-> (ListThingRegistrationTaskReports
    -> Maybe Natural -> ListThingRegistrationTaskReports)
-> Lens
     ListThingRegistrationTaskReports
     ListThingRegistrationTaskReports
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingRegistrationTaskReports' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListThingRegistrationTaskReports' :: ListThingRegistrationTaskReports -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListThingRegistrationTaskReports
s@ListThingRegistrationTaskReports' {} Maybe Natural
a -> ListThingRegistrationTaskReports
s {$sel:maxResults:ListThingRegistrationTaskReports' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListThingRegistrationTaskReports)

-- | The id of the task.
listThingRegistrationTaskReports_taskId :: Lens.Lens' ListThingRegistrationTaskReports Prelude.Text
listThingRegistrationTaskReports_taskId :: (Text -> f Text)
-> ListThingRegistrationTaskReports
-> f ListThingRegistrationTaskReports
listThingRegistrationTaskReports_taskId = (ListThingRegistrationTaskReports -> Text)
-> (ListThingRegistrationTaskReports
    -> Text -> ListThingRegistrationTaskReports)
-> Lens
     ListThingRegistrationTaskReports
     ListThingRegistrationTaskReports
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingRegistrationTaskReports' {Text
taskId :: Text
$sel:taskId:ListThingRegistrationTaskReports' :: ListThingRegistrationTaskReports -> Text
taskId} -> Text
taskId) (\s :: ListThingRegistrationTaskReports
s@ListThingRegistrationTaskReports' {} Text
a -> ListThingRegistrationTaskReports
s {$sel:taskId:ListThingRegistrationTaskReports' :: Text
taskId = Text
a} :: ListThingRegistrationTaskReports)

-- | The type of task report.
listThingRegistrationTaskReports_reportType :: Lens.Lens' ListThingRegistrationTaskReports ReportType
listThingRegistrationTaskReports_reportType :: (ReportType -> f ReportType)
-> ListThingRegistrationTaskReports
-> f ListThingRegistrationTaskReports
listThingRegistrationTaskReports_reportType = (ListThingRegistrationTaskReports -> ReportType)
-> (ListThingRegistrationTaskReports
    -> ReportType -> ListThingRegistrationTaskReports)
-> Lens
     ListThingRegistrationTaskReports
     ListThingRegistrationTaskReports
     ReportType
     ReportType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingRegistrationTaskReports' {ReportType
reportType :: ReportType
$sel:reportType:ListThingRegistrationTaskReports' :: ListThingRegistrationTaskReports -> ReportType
reportType} -> ReportType
reportType) (\s :: ListThingRegistrationTaskReports
s@ListThingRegistrationTaskReports' {} ReportType
a -> ListThingRegistrationTaskReports
s {$sel:reportType:ListThingRegistrationTaskReports' :: ReportType
reportType = ReportType
a} :: ListThingRegistrationTaskReports)

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

instance
  Prelude.NFData
    ListThingRegistrationTaskReports

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

instance Core.ToPath ListThingRegistrationTaskReports where
  toPath :: ListThingRegistrationTaskReports -> ByteString
toPath ListThingRegistrationTaskReports' {Maybe Natural
Maybe Text
Text
ReportType
reportType :: ReportType
taskId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:reportType:ListThingRegistrationTaskReports' :: ListThingRegistrationTaskReports -> ReportType
$sel:taskId:ListThingRegistrationTaskReports' :: ListThingRegistrationTaskReports -> Text
$sel:maxResults:ListThingRegistrationTaskReports' :: ListThingRegistrationTaskReports -> Maybe Natural
$sel:nextToken:ListThingRegistrationTaskReports' :: ListThingRegistrationTaskReports -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/thing-registration-tasks/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
taskId,
        ByteString
"/reports"
      ]

instance
  Core.ToQuery
    ListThingRegistrationTaskReports
  where
  toQuery :: ListThingRegistrationTaskReports -> QueryString
toQuery ListThingRegistrationTaskReports' {Maybe Natural
Maybe Text
Text
ReportType
reportType :: ReportType
taskId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:reportType:ListThingRegistrationTaskReports' :: ListThingRegistrationTaskReports -> ReportType
$sel:taskId:ListThingRegistrationTaskReports' :: ListThingRegistrationTaskReports -> Text
$sel:maxResults:ListThingRegistrationTaskReports' :: ListThingRegistrationTaskReports -> Maybe Natural
$sel:nextToken:ListThingRegistrationTaskReports' :: ListThingRegistrationTaskReports -> 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,
        ByteString
"reportType" ByteString -> ReportType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ReportType
reportType
      ]

-- | /See:/ 'newListThingRegistrationTaskReportsResponse' smart constructor.
data ListThingRegistrationTaskReportsResponse = ListThingRegistrationTaskReportsResponse'
  { -- | Links to the task resources.
    ListThingRegistrationTaskReportsResponse -> Maybe [Text]
resourceLinks :: Prelude.Maybe [Prelude.Text],
    -- | The token to use to get the next set of results, or __null__ if there
    -- are no additional results.
    ListThingRegistrationTaskReportsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The type of task report.
    ListThingRegistrationTaskReportsResponse -> Maybe ReportType
reportType :: Prelude.Maybe ReportType,
    -- | The response's http status code.
    ListThingRegistrationTaskReportsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListThingRegistrationTaskReportsResponse
-> ListThingRegistrationTaskReportsResponse -> Bool
(ListThingRegistrationTaskReportsResponse
 -> ListThingRegistrationTaskReportsResponse -> Bool)
-> (ListThingRegistrationTaskReportsResponse
    -> ListThingRegistrationTaskReportsResponse -> Bool)
-> Eq ListThingRegistrationTaskReportsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListThingRegistrationTaskReportsResponse
-> ListThingRegistrationTaskReportsResponse -> Bool
$c/= :: ListThingRegistrationTaskReportsResponse
-> ListThingRegistrationTaskReportsResponse -> Bool
== :: ListThingRegistrationTaskReportsResponse
-> ListThingRegistrationTaskReportsResponse -> Bool
$c== :: ListThingRegistrationTaskReportsResponse
-> ListThingRegistrationTaskReportsResponse -> Bool
Prelude.Eq, ReadPrec [ListThingRegistrationTaskReportsResponse]
ReadPrec ListThingRegistrationTaskReportsResponse
Int -> ReadS ListThingRegistrationTaskReportsResponse
ReadS [ListThingRegistrationTaskReportsResponse]
(Int -> ReadS ListThingRegistrationTaskReportsResponse)
-> ReadS [ListThingRegistrationTaskReportsResponse]
-> ReadPrec ListThingRegistrationTaskReportsResponse
-> ReadPrec [ListThingRegistrationTaskReportsResponse]
-> Read ListThingRegistrationTaskReportsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListThingRegistrationTaskReportsResponse]
$creadListPrec :: ReadPrec [ListThingRegistrationTaskReportsResponse]
readPrec :: ReadPrec ListThingRegistrationTaskReportsResponse
$creadPrec :: ReadPrec ListThingRegistrationTaskReportsResponse
readList :: ReadS [ListThingRegistrationTaskReportsResponse]
$creadList :: ReadS [ListThingRegistrationTaskReportsResponse]
readsPrec :: Int -> ReadS ListThingRegistrationTaskReportsResponse
$creadsPrec :: Int -> ReadS ListThingRegistrationTaskReportsResponse
Prelude.Read, Int -> ListThingRegistrationTaskReportsResponse -> ShowS
[ListThingRegistrationTaskReportsResponse] -> ShowS
ListThingRegistrationTaskReportsResponse -> String
(Int -> ListThingRegistrationTaskReportsResponse -> ShowS)
-> (ListThingRegistrationTaskReportsResponse -> String)
-> ([ListThingRegistrationTaskReportsResponse] -> ShowS)
-> Show ListThingRegistrationTaskReportsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListThingRegistrationTaskReportsResponse] -> ShowS
$cshowList :: [ListThingRegistrationTaskReportsResponse] -> ShowS
show :: ListThingRegistrationTaskReportsResponse -> String
$cshow :: ListThingRegistrationTaskReportsResponse -> String
showsPrec :: Int -> ListThingRegistrationTaskReportsResponse -> ShowS
$cshowsPrec :: Int -> ListThingRegistrationTaskReportsResponse -> ShowS
Prelude.Show, (forall x.
 ListThingRegistrationTaskReportsResponse
 -> Rep ListThingRegistrationTaskReportsResponse x)
-> (forall x.
    Rep ListThingRegistrationTaskReportsResponse x
    -> ListThingRegistrationTaskReportsResponse)
-> Generic ListThingRegistrationTaskReportsResponse
forall x.
Rep ListThingRegistrationTaskReportsResponse x
-> ListThingRegistrationTaskReportsResponse
forall x.
ListThingRegistrationTaskReportsResponse
-> Rep ListThingRegistrationTaskReportsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListThingRegistrationTaskReportsResponse x
-> ListThingRegistrationTaskReportsResponse
$cfrom :: forall x.
ListThingRegistrationTaskReportsResponse
-> Rep ListThingRegistrationTaskReportsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListThingRegistrationTaskReportsResponse' 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:
--
-- 'resourceLinks', 'listThingRegistrationTaskReportsResponse_resourceLinks' - Links to the task resources.
--
-- 'nextToken', 'listThingRegistrationTaskReportsResponse_nextToken' - The token to use to get the next set of results, or __null__ if there
-- are no additional results.
--
-- 'reportType', 'listThingRegistrationTaskReportsResponse_reportType' - The type of task report.
--
-- 'httpStatus', 'listThingRegistrationTaskReportsResponse_httpStatus' - The response's http status code.
newListThingRegistrationTaskReportsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListThingRegistrationTaskReportsResponse
newListThingRegistrationTaskReportsResponse :: Int -> ListThingRegistrationTaskReportsResponse
newListThingRegistrationTaskReportsResponse
  Int
pHttpStatus_ =
    ListThingRegistrationTaskReportsResponse' :: Maybe [Text]
-> Maybe Text
-> Maybe ReportType
-> Int
-> ListThingRegistrationTaskReportsResponse
ListThingRegistrationTaskReportsResponse'
      { $sel:resourceLinks:ListThingRegistrationTaskReportsResponse' :: Maybe [Text]
resourceLinks =
          Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListThingRegistrationTaskReportsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:reportType:ListThingRegistrationTaskReportsResponse' :: Maybe ReportType
reportType = Maybe ReportType
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListThingRegistrationTaskReportsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Links to the task resources.
listThingRegistrationTaskReportsResponse_resourceLinks :: Lens.Lens' ListThingRegistrationTaskReportsResponse (Prelude.Maybe [Prelude.Text])
listThingRegistrationTaskReportsResponse_resourceLinks :: (Maybe [Text] -> f (Maybe [Text]))
-> ListThingRegistrationTaskReportsResponse
-> f ListThingRegistrationTaskReportsResponse
listThingRegistrationTaskReportsResponse_resourceLinks = (ListThingRegistrationTaskReportsResponse -> Maybe [Text])
-> (ListThingRegistrationTaskReportsResponse
    -> Maybe [Text] -> ListThingRegistrationTaskReportsResponse)
-> Lens' ListThingRegistrationTaskReportsResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingRegistrationTaskReportsResponse' {Maybe [Text]
resourceLinks :: Maybe [Text]
$sel:resourceLinks:ListThingRegistrationTaskReportsResponse' :: ListThingRegistrationTaskReportsResponse -> Maybe [Text]
resourceLinks} -> Maybe [Text]
resourceLinks) (\s :: ListThingRegistrationTaskReportsResponse
s@ListThingRegistrationTaskReportsResponse' {} Maybe [Text]
a -> ListThingRegistrationTaskReportsResponse
s {$sel:resourceLinks:ListThingRegistrationTaskReportsResponse' :: Maybe [Text]
resourceLinks = Maybe [Text]
a} :: ListThingRegistrationTaskReportsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListThingRegistrationTaskReportsResponse
 -> f ListThingRegistrationTaskReportsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListThingRegistrationTaskReportsResponse
-> f ListThingRegistrationTaskReportsResponse
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 token to use to get the next set of results, or __null__ if there
-- are no additional results.
listThingRegistrationTaskReportsResponse_nextToken :: Lens.Lens' ListThingRegistrationTaskReportsResponse (Prelude.Maybe Prelude.Text)
listThingRegistrationTaskReportsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListThingRegistrationTaskReportsResponse
-> f ListThingRegistrationTaskReportsResponse
listThingRegistrationTaskReportsResponse_nextToken = (ListThingRegistrationTaskReportsResponse -> Maybe Text)
-> (ListThingRegistrationTaskReportsResponse
    -> Maybe Text -> ListThingRegistrationTaskReportsResponse)
-> Lens' ListThingRegistrationTaskReportsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingRegistrationTaskReportsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListThingRegistrationTaskReportsResponse' :: ListThingRegistrationTaskReportsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListThingRegistrationTaskReportsResponse
s@ListThingRegistrationTaskReportsResponse' {} Maybe Text
a -> ListThingRegistrationTaskReportsResponse
s {$sel:nextToken:ListThingRegistrationTaskReportsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListThingRegistrationTaskReportsResponse)

-- | The type of task report.
listThingRegistrationTaskReportsResponse_reportType :: Lens.Lens' ListThingRegistrationTaskReportsResponse (Prelude.Maybe ReportType)
listThingRegistrationTaskReportsResponse_reportType :: (Maybe ReportType -> f (Maybe ReportType))
-> ListThingRegistrationTaskReportsResponse
-> f ListThingRegistrationTaskReportsResponse
listThingRegistrationTaskReportsResponse_reportType = (ListThingRegistrationTaskReportsResponse -> Maybe ReportType)
-> (ListThingRegistrationTaskReportsResponse
    -> Maybe ReportType -> ListThingRegistrationTaskReportsResponse)
-> Lens
     ListThingRegistrationTaskReportsResponse
     ListThingRegistrationTaskReportsResponse
     (Maybe ReportType)
     (Maybe ReportType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingRegistrationTaskReportsResponse' {Maybe ReportType
reportType :: Maybe ReportType
$sel:reportType:ListThingRegistrationTaskReportsResponse' :: ListThingRegistrationTaskReportsResponse -> Maybe ReportType
reportType} -> Maybe ReportType
reportType) (\s :: ListThingRegistrationTaskReportsResponse
s@ListThingRegistrationTaskReportsResponse' {} Maybe ReportType
a -> ListThingRegistrationTaskReportsResponse
s {$sel:reportType:ListThingRegistrationTaskReportsResponse' :: Maybe ReportType
reportType = Maybe ReportType
a} :: ListThingRegistrationTaskReportsResponse)

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

instance
  Prelude.NFData
    ListThingRegistrationTaskReportsResponse