{-# 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.Greengrass.ListBulkDeploymentDetailedReports
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets a paginated list of the deployments that have been started in a
-- bulk deployment operation, and their current deployment status.
--
-- This operation returns paginated results.
module Amazonka.Greengrass.ListBulkDeploymentDetailedReports
  ( -- * Creating a Request
    ListBulkDeploymentDetailedReports (..),
    newListBulkDeploymentDetailedReports,

    -- * Request Lenses
    listBulkDeploymentDetailedReports_nextToken,
    listBulkDeploymentDetailedReports_maxResults,
    listBulkDeploymentDetailedReports_bulkDeploymentId,

    -- * Destructuring the Response
    ListBulkDeploymentDetailedReportsResponse (..),
    newListBulkDeploymentDetailedReportsResponse,

    -- * Response Lenses
    listBulkDeploymentDetailedReportsResponse_nextToken,
    listBulkDeploymentDetailedReportsResponse_deployments,
    listBulkDeploymentDetailedReportsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Greengrass.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:/ 'newListBulkDeploymentDetailedReports' smart constructor.
data ListBulkDeploymentDetailedReports = ListBulkDeploymentDetailedReports'
  { -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    ListBulkDeploymentDetailedReports -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned per request.
    ListBulkDeploymentDetailedReports -> Maybe Text
maxResults :: Prelude.Maybe Prelude.Text,
    -- | The ID of the bulk deployment.
    ListBulkDeploymentDetailedReports -> Text
bulkDeploymentId :: Prelude.Text
  }
  deriving (ListBulkDeploymentDetailedReports
-> ListBulkDeploymentDetailedReports -> Bool
(ListBulkDeploymentDetailedReports
 -> ListBulkDeploymentDetailedReports -> Bool)
-> (ListBulkDeploymentDetailedReports
    -> ListBulkDeploymentDetailedReports -> Bool)
-> Eq ListBulkDeploymentDetailedReports
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBulkDeploymentDetailedReports
-> ListBulkDeploymentDetailedReports -> Bool
$c/= :: ListBulkDeploymentDetailedReports
-> ListBulkDeploymentDetailedReports -> Bool
== :: ListBulkDeploymentDetailedReports
-> ListBulkDeploymentDetailedReports -> Bool
$c== :: ListBulkDeploymentDetailedReports
-> ListBulkDeploymentDetailedReports -> Bool
Prelude.Eq, ReadPrec [ListBulkDeploymentDetailedReports]
ReadPrec ListBulkDeploymentDetailedReports
Int -> ReadS ListBulkDeploymentDetailedReports
ReadS [ListBulkDeploymentDetailedReports]
(Int -> ReadS ListBulkDeploymentDetailedReports)
-> ReadS [ListBulkDeploymentDetailedReports]
-> ReadPrec ListBulkDeploymentDetailedReports
-> ReadPrec [ListBulkDeploymentDetailedReports]
-> Read ListBulkDeploymentDetailedReports
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBulkDeploymentDetailedReports]
$creadListPrec :: ReadPrec [ListBulkDeploymentDetailedReports]
readPrec :: ReadPrec ListBulkDeploymentDetailedReports
$creadPrec :: ReadPrec ListBulkDeploymentDetailedReports
readList :: ReadS [ListBulkDeploymentDetailedReports]
$creadList :: ReadS [ListBulkDeploymentDetailedReports]
readsPrec :: Int -> ReadS ListBulkDeploymentDetailedReports
$creadsPrec :: Int -> ReadS ListBulkDeploymentDetailedReports
Prelude.Read, Int -> ListBulkDeploymentDetailedReports -> ShowS
[ListBulkDeploymentDetailedReports] -> ShowS
ListBulkDeploymentDetailedReports -> String
(Int -> ListBulkDeploymentDetailedReports -> ShowS)
-> (ListBulkDeploymentDetailedReports -> String)
-> ([ListBulkDeploymentDetailedReports] -> ShowS)
-> Show ListBulkDeploymentDetailedReports
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBulkDeploymentDetailedReports] -> ShowS
$cshowList :: [ListBulkDeploymentDetailedReports] -> ShowS
show :: ListBulkDeploymentDetailedReports -> String
$cshow :: ListBulkDeploymentDetailedReports -> String
showsPrec :: Int -> ListBulkDeploymentDetailedReports -> ShowS
$cshowsPrec :: Int -> ListBulkDeploymentDetailedReports -> ShowS
Prelude.Show, (forall x.
 ListBulkDeploymentDetailedReports
 -> Rep ListBulkDeploymentDetailedReports x)
-> (forall x.
    Rep ListBulkDeploymentDetailedReports x
    -> ListBulkDeploymentDetailedReports)
-> Generic ListBulkDeploymentDetailedReports
forall x.
Rep ListBulkDeploymentDetailedReports x
-> ListBulkDeploymentDetailedReports
forall x.
ListBulkDeploymentDetailedReports
-> Rep ListBulkDeploymentDetailedReports x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListBulkDeploymentDetailedReports x
-> ListBulkDeploymentDetailedReports
$cfrom :: forall x.
ListBulkDeploymentDetailedReports
-> Rep ListBulkDeploymentDetailedReports x
Prelude.Generic)

-- |
-- Create a value of 'ListBulkDeploymentDetailedReports' 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', 'listBulkDeploymentDetailedReports_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'maxResults', 'listBulkDeploymentDetailedReports_maxResults' - The maximum number of results to be returned per request.
--
-- 'bulkDeploymentId', 'listBulkDeploymentDetailedReports_bulkDeploymentId' - The ID of the bulk deployment.
newListBulkDeploymentDetailedReports ::
  -- | 'bulkDeploymentId'
  Prelude.Text ->
  ListBulkDeploymentDetailedReports
newListBulkDeploymentDetailedReports :: Text -> ListBulkDeploymentDetailedReports
newListBulkDeploymentDetailedReports
  Text
pBulkDeploymentId_ =
    ListBulkDeploymentDetailedReports' :: Maybe Text
-> Maybe Text -> Text -> ListBulkDeploymentDetailedReports
ListBulkDeploymentDetailedReports'
      { $sel:nextToken:ListBulkDeploymentDetailedReports' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListBulkDeploymentDetailedReports' :: Maybe Text
maxResults = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:bulkDeploymentId:ListBulkDeploymentDetailedReports' :: Text
bulkDeploymentId = Text
pBulkDeploymentId_
      }

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

-- | The maximum number of results to be returned per request.
listBulkDeploymentDetailedReports_maxResults :: Lens.Lens' ListBulkDeploymentDetailedReports (Prelude.Maybe Prelude.Text)
listBulkDeploymentDetailedReports_maxResults :: (Maybe Text -> f (Maybe Text))
-> ListBulkDeploymentDetailedReports
-> f ListBulkDeploymentDetailedReports
listBulkDeploymentDetailedReports_maxResults = (ListBulkDeploymentDetailedReports -> Maybe Text)
-> (ListBulkDeploymentDetailedReports
    -> Maybe Text -> ListBulkDeploymentDetailedReports)
-> Lens
     ListBulkDeploymentDetailedReports
     ListBulkDeploymentDetailedReports
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBulkDeploymentDetailedReports' {Maybe Text
maxResults :: Maybe Text
$sel:maxResults:ListBulkDeploymentDetailedReports' :: ListBulkDeploymentDetailedReports -> Maybe Text
maxResults} -> Maybe Text
maxResults) (\s :: ListBulkDeploymentDetailedReports
s@ListBulkDeploymentDetailedReports' {} Maybe Text
a -> ListBulkDeploymentDetailedReports
s {$sel:maxResults:ListBulkDeploymentDetailedReports' :: Maybe Text
maxResults = Maybe Text
a} :: ListBulkDeploymentDetailedReports)

-- | The ID of the bulk deployment.
listBulkDeploymentDetailedReports_bulkDeploymentId :: Lens.Lens' ListBulkDeploymentDetailedReports Prelude.Text
listBulkDeploymentDetailedReports_bulkDeploymentId :: (Text -> f Text)
-> ListBulkDeploymentDetailedReports
-> f ListBulkDeploymentDetailedReports
listBulkDeploymentDetailedReports_bulkDeploymentId = (ListBulkDeploymentDetailedReports -> Text)
-> (ListBulkDeploymentDetailedReports
    -> Text -> ListBulkDeploymentDetailedReports)
-> Lens
     ListBulkDeploymentDetailedReports
     ListBulkDeploymentDetailedReports
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBulkDeploymentDetailedReports' {Text
bulkDeploymentId :: Text
$sel:bulkDeploymentId:ListBulkDeploymentDetailedReports' :: ListBulkDeploymentDetailedReports -> Text
bulkDeploymentId} -> Text
bulkDeploymentId) (\s :: ListBulkDeploymentDetailedReports
s@ListBulkDeploymentDetailedReports' {} Text
a -> ListBulkDeploymentDetailedReports
s {$sel:bulkDeploymentId:ListBulkDeploymentDetailedReports' :: Text
bulkDeploymentId = Text
a} :: ListBulkDeploymentDetailedReports)

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

instance
  Prelude.NFData
    ListBulkDeploymentDetailedReports

instance
  Core.ToHeaders
    ListBulkDeploymentDetailedReports
  where
  toHeaders :: ListBulkDeploymentDetailedReports -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> ListBulkDeploymentDetailedReports -> 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
    ListBulkDeploymentDetailedReports
  where
  toPath :: ListBulkDeploymentDetailedReports -> ByteString
toPath ListBulkDeploymentDetailedReports' {Maybe Text
Text
bulkDeploymentId :: Text
maxResults :: Maybe Text
nextToken :: Maybe Text
$sel:bulkDeploymentId:ListBulkDeploymentDetailedReports' :: ListBulkDeploymentDetailedReports -> Text
$sel:maxResults:ListBulkDeploymentDetailedReports' :: ListBulkDeploymentDetailedReports -> Maybe Text
$sel:nextToken:ListBulkDeploymentDetailedReports' :: ListBulkDeploymentDetailedReports -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/bulk/deployments/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
bulkDeploymentId,
        ByteString
"/detailed-reports"
      ]

instance
  Core.ToQuery
    ListBulkDeploymentDetailedReports
  where
  toQuery :: ListBulkDeploymentDetailedReports -> QueryString
toQuery ListBulkDeploymentDetailedReports' {Maybe Text
Text
bulkDeploymentId :: Text
maxResults :: Maybe Text
nextToken :: Maybe Text
$sel:bulkDeploymentId:ListBulkDeploymentDetailedReports' :: ListBulkDeploymentDetailedReports -> Text
$sel:maxResults:ListBulkDeploymentDetailedReports' :: ListBulkDeploymentDetailedReports -> Maybe Text
$sel:nextToken:ListBulkDeploymentDetailedReports' :: ListBulkDeploymentDetailedReports -> 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 Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maxResults
      ]

-- | /See:/ 'newListBulkDeploymentDetailedReportsResponse' smart constructor.
data ListBulkDeploymentDetailedReportsResponse = ListBulkDeploymentDetailedReportsResponse'
  { -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    ListBulkDeploymentDetailedReportsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of the individual group deployments in the bulk deployment
    -- operation.
    ListBulkDeploymentDetailedReportsResponse
-> Maybe [BulkDeploymentResult]
deployments :: Prelude.Maybe [BulkDeploymentResult],
    -- | The response's http status code.
    ListBulkDeploymentDetailedReportsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListBulkDeploymentDetailedReportsResponse
-> ListBulkDeploymentDetailedReportsResponse -> Bool
(ListBulkDeploymentDetailedReportsResponse
 -> ListBulkDeploymentDetailedReportsResponse -> Bool)
-> (ListBulkDeploymentDetailedReportsResponse
    -> ListBulkDeploymentDetailedReportsResponse -> Bool)
-> Eq ListBulkDeploymentDetailedReportsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBulkDeploymentDetailedReportsResponse
-> ListBulkDeploymentDetailedReportsResponse -> Bool
$c/= :: ListBulkDeploymentDetailedReportsResponse
-> ListBulkDeploymentDetailedReportsResponse -> Bool
== :: ListBulkDeploymentDetailedReportsResponse
-> ListBulkDeploymentDetailedReportsResponse -> Bool
$c== :: ListBulkDeploymentDetailedReportsResponse
-> ListBulkDeploymentDetailedReportsResponse -> Bool
Prelude.Eq, ReadPrec [ListBulkDeploymentDetailedReportsResponse]
ReadPrec ListBulkDeploymentDetailedReportsResponse
Int -> ReadS ListBulkDeploymentDetailedReportsResponse
ReadS [ListBulkDeploymentDetailedReportsResponse]
(Int -> ReadS ListBulkDeploymentDetailedReportsResponse)
-> ReadS [ListBulkDeploymentDetailedReportsResponse]
-> ReadPrec ListBulkDeploymentDetailedReportsResponse
-> ReadPrec [ListBulkDeploymentDetailedReportsResponse]
-> Read ListBulkDeploymentDetailedReportsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBulkDeploymentDetailedReportsResponse]
$creadListPrec :: ReadPrec [ListBulkDeploymentDetailedReportsResponse]
readPrec :: ReadPrec ListBulkDeploymentDetailedReportsResponse
$creadPrec :: ReadPrec ListBulkDeploymentDetailedReportsResponse
readList :: ReadS [ListBulkDeploymentDetailedReportsResponse]
$creadList :: ReadS [ListBulkDeploymentDetailedReportsResponse]
readsPrec :: Int -> ReadS ListBulkDeploymentDetailedReportsResponse
$creadsPrec :: Int -> ReadS ListBulkDeploymentDetailedReportsResponse
Prelude.Read, Int -> ListBulkDeploymentDetailedReportsResponse -> ShowS
[ListBulkDeploymentDetailedReportsResponse] -> ShowS
ListBulkDeploymentDetailedReportsResponse -> String
(Int -> ListBulkDeploymentDetailedReportsResponse -> ShowS)
-> (ListBulkDeploymentDetailedReportsResponse -> String)
-> ([ListBulkDeploymentDetailedReportsResponse] -> ShowS)
-> Show ListBulkDeploymentDetailedReportsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBulkDeploymentDetailedReportsResponse] -> ShowS
$cshowList :: [ListBulkDeploymentDetailedReportsResponse] -> ShowS
show :: ListBulkDeploymentDetailedReportsResponse -> String
$cshow :: ListBulkDeploymentDetailedReportsResponse -> String
showsPrec :: Int -> ListBulkDeploymentDetailedReportsResponse -> ShowS
$cshowsPrec :: Int -> ListBulkDeploymentDetailedReportsResponse -> ShowS
Prelude.Show, (forall x.
 ListBulkDeploymentDetailedReportsResponse
 -> Rep ListBulkDeploymentDetailedReportsResponse x)
-> (forall x.
    Rep ListBulkDeploymentDetailedReportsResponse x
    -> ListBulkDeploymentDetailedReportsResponse)
-> Generic ListBulkDeploymentDetailedReportsResponse
forall x.
Rep ListBulkDeploymentDetailedReportsResponse x
-> ListBulkDeploymentDetailedReportsResponse
forall x.
ListBulkDeploymentDetailedReportsResponse
-> Rep ListBulkDeploymentDetailedReportsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListBulkDeploymentDetailedReportsResponse x
-> ListBulkDeploymentDetailedReportsResponse
$cfrom :: forall x.
ListBulkDeploymentDetailedReportsResponse
-> Rep ListBulkDeploymentDetailedReportsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListBulkDeploymentDetailedReportsResponse' 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', 'listBulkDeploymentDetailedReportsResponse_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'deployments', 'listBulkDeploymentDetailedReportsResponse_deployments' - A list of the individual group deployments in the bulk deployment
-- operation.
--
-- 'httpStatus', 'listBulkDeploymentDetailedReportsResponse_httpStatus' - The response's http status code.
newListBulkDeploymentDetailedReportsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListBulkDeploymentDetailedReportsResponse
newListBulkDeploymentDetailedReportsResponse :: Int -> ListBulkDeploymentDetailedReportsResponse
newListBulkDeploymentDetailedReportsResponse
  Int
pHttpStatus_ =
    ListBulkDeploymentDetailedReportsResponse' :: Maybe Text
-> Maybe [BulkDeploymentResult]
-> Int
-> ListBulkDeploymentDetailedReportsResponse
ListBulkDeploymentDetailedReportsResponse'
      { $sel:nextToken:ListBulkDeploymentDetailedReportsResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:deployments:ListBulkDeploymentDetailedReportsResponse' :: Maybe [BulkDeploymentResult]
deployments = Maybe [BulkDeploymentResult]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListBulkDeploymentDetailedReportsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

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

-- | A list of the individual group deployments in the bulk deployment
-- operation.
listBulkDeploymentDetailedReportsResponse_deployments :: Lens.Lens' ListBulkDeploymentDetailedReportsResponse (Prelude.Maybe [BulkDeploymentResult])
listBulkDeploymentDetailedReportsResponse_deployments :: (Maybe [BulkDeploymentResult] -> f (Maybe [BulkDeploymentResult]))
-> ListBulkDeploymentDetailedReportsResponse
-> f ListBulkDeploymentDetailedReportsResponse
listBulkDeploymentDetailedReportsResponse_deployments = (ListBulkDeploymentDetailedReportsResponse
 -> Maybe [BulkDeploymentResult])
-> (ListBulkDeploymentDetailedReportsResponse
    -> Maybe [BulkDeploymentResult]
    -> ListBulkDeploymentDetailedReportsResponse)
-> Lens'
     ListBulkDeploymentDetailedReportsResponse
     (Maybe [BulkDeploymentResult])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBulkDeploymentDetailedReportsResponse' {Maybe [BulkDeploymentResult]
deployments :: Maybe [BulkDeploymentResult]
$sel:deployments:ListBulkDeploymentDetailedReportsResponse' :: ListBulkDeploymentDetailedReportsResponse
-> Maybe [BulkDeploymentResult]
deployments} -> Maybe [BulkDeploymentResult]
deployments) (\s :: ListBulkDeploymentDetailedReportsResponse
s@ListBulkDeploymentDetailedReportsResponse' {} Maybe [BulkDeploymentResult]
a -> ListBulkDeploymentDetailedReportsResponse
s {$sel:deployments:ListBulkDeploymentDetailedReportsResponse' :: Maybe [BulkDeploymentResult]
deployments = Maybe [BulkDeploymentResult]
a} :: ListBulkDeploymentDetailedReportsResponse) ((Maybe [BulkDeploymentResult] -> f (Maybe [BulkDeploymentResult]))
 -> ListBulkDeploymentDetailedReportsResponse
 -> f ListBulkDeploymentDetailedReportsResponse)
-> ((Maybe [BulkDeploymentResult]
     -> f (Maybe [BulkDeploymentResult]))
    -> Maybe [BulkDeploymentResult]
    -> f (Maybe [BulkDeploymentResult]))
-> (Maybe [BulkDeploymentResult]
    -> f (Maybe [BulkDeploymentResult]))
-> ListBulkDeploymentDetailedReportsResponse
-> f ListBulkDeploymentDetailedReportsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [BulkDeploymentResult]
  [BulkDeploymentResult]
  [BulkDeploymentResult]
  [BulkDeploymentResult]
-> Iso
     (Maybe [BulkDeploymentResult])
     (Maybe [BulkDeploymentResult])
     (Maybe [BulkDeploymentResult])
     (Maybe [BulkDeploymentResult])
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
  [BulkDeploymentResult]
  [BulkDeploymentResult]
  [BulkDeploymentResult]
  [BulkDeploymentResult]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListBulkDeploymentDetailedReportsResponse