{-# 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.ElasticTranscoder.ListJobsByStatus
-- 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)
--
-- The ListJobsByStatus operation gets a list of jobs that have a specified
-- status. The response body contains one element for each job that
-- satisfies the search criteria.
--
-- This operation returns paginated results.
module Amazonka.ElasticTranscoder.ListJobsByStatus
  ( -- * Creating a Request
    ListJobsByStatus (..),
    newListJobsByStatus,

    -- * Request Lenses
    listJobsByStatus_ascending,
    listJobsByStatus_pageToken,
    listJobsByStatus_status,

    -- * Destructuring the Response
    ListJobsByStatusResponse (..),
    newListJobsByStatusResponse,

    -- * Response Lenses
    listJobsByStatusResponse_nextPageToken,
    listJobsByStatusResponse_jobs,
    listJobsByStatusResponse_httpStatus,
  )
where

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

-- | The @ListJobsByStatusRequest@ structure.
--
-- /See:/ 'newListJobsByStatus' smart constructor.
data ListJobsByStatus = ListJobsByStatus'
  { -- | To list jobs in chronological order by the date and time that they were
    -- submitted, enter @true@. To list jobs in reverse chronological order,
    -- enter @false@.
    ListJobsByStatus -> Maybe Text
ascending :: Prelude.Maybe Prelude.Text,
    -- | When Elastic Transcoder returns more than one page of results, use
    -- @pageToken@ in subsequent @GET@ requests to get each successive page of
    -- results.
    ListJobsByStatus -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text,
    -- | To get information about all of the jobs associated with the current AWS
    -- account that have a given status, specify the following status:
    -- @Submitted@, @Progressing@, @Complete@, @Canceled@, or @Error@.
    ListJobsByStatus -> Text
status :: Prelude.Text
  }
  deriving (ListJobsByStatus -> ListJobsByStatus -> Bool
(ListJobsByStatus -> ListJobsByStatus -> Bool)
-> (ListJobsByStatus -> ListJobsByStatus -> Bool)
-> Eq ListJobsByStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListJobsByStatus -> ListJobsByStatus -> Bool
$c/= :: ListJobsByStatus -> ListJobsByStatus -> Bool
== :: ListJobsByStatus -> ListJobsByStatus -> Bool
$c== :: ListJobsByStatus -> ListJobsByStatus -> Bool
Prelude.Eq, ReadPrec [ListJobsByStatus]
ReadPrec ListJobsByStatus
Int -> ReadS ListJobsByStatus
ReadS [ListJobsByStatus]
(Int -> ReadS ListJobsByStatus)
-> ReadS [ListJobsByStatus]
-> ReadPrec ListJobsByStatus
-> ReadPrec [ListJobsByStatus]
-> Read ListJobsByStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListJobsByStatus]
$creadListPrec :: ReadPrec [ListJobsByStatus]
readPrec :: ReadPrec ListJobsByStatus
$creadPrec :: ReadPrec ListJobsByStatus
readList :: ReadS [ListJobsByStatus]
$creadList :: ReadS [ListJobsByStatus]
readsPrec :: Int -> ReadS ListJobsByStatus
$creadsPrec :: Int -> ReadS ListJobsByStatus
Prelude.Read, Int -> ListJobsByStatus -> ShowS
[ListJobsByStatus] -> ShowS
ListJobsByStatus -> String
(Int -> ListJobsByStatus -> ShowS)
-> (ListJobsByStatus -> String)
-> ([ListJobsByStatus] -> ShowS)
-> Show ListJobsByStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListJobsByStatus] -> ShowS
$cshowList :: [ListJobsByStatus] -> ShowS
show :: ListJobsByStatus -> String
$cshow :: ListJobsByStatus -> String
showsPrec :: Int -> ListJobsByStatus -> ShowS
$cshowsPrec :: Int -> ListJobsByStatus -> ShowS
Prelude.Show, (forall x. ListJobsByStatus -> Rep ListJobsByStatus x)
-> (forall x. Rep ListJobsByStatus x -> ListJobsByStatus)
-> Generic ListJobsByStatus
forall x. Rep ListJobsByStatus x -> ListJobsByStatus
forall x. ListJobsByStatus -> Rep ListJobsByStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListJobsByStatus x -> ListJobsByStatus
$cfrom :: forall x. ListJobsByStatus -> Rep ListJobsByStatus x
Prelude.Generic)

-- |
-- Create a value of 'ListJobsByStatus' 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:
--
-- 'ascending', 'listJobsByStatus_ascending' - To list jobs in chronological order by the date and time that they were
-- submitted, enter @true@. To list jobs in reverse chronological order,
-- enter @false@.
--
-- 'pageToken', 'listJobsByStatus_pageToken' - When Elastic Transcoder returns more than one page of results, use
-- @pageToken@ in subsequent @GET@ requests to get each successive page of
-- results.
--
-- 'status', 'listJobsByStatus_status' - To get information about all of the jobs associated with the current AWS
-- account that have a given status, specify the following status:
-- @Submitted@, @Progressing@, @Complete@, @Canceled@, or @Error@.
newListJobsByStatus ::
  -- | 'status'
  Prelude.Text ->
  ListJobsByStatus
newListJobsByStatus :: Text -> ListJobsByStatus
newListJobsByStatus Text
pStatus_ =
  ListJobsByStatus' :: Maybe Text -> Maybe Text -> Text -> ListJobsByStatus
ListJobsByStatus'
    { $sel:ascending:ListJobsByStatus' :: Maybe Text
ascending = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pageToken:ListJobsByStatus' :: Maybe Text
pageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ListJobsByStatus' :: Text
status = Text
pStatus_
    }

-- | To list jobs in chronological order by the date and time that they were
-- submitted, enter @true@. To list jobs in reverse chronological order,
-- enter @false@.
listJobsByStatus_ascending :: Lens.Lens' ListJobsByStatus (Prelude.Maybe Prelude.Text)
listJobsByStatus_ascending :: (Maybe Text -> f (Maybe Text))
-> ListJobsByStatus -> f ListJobsByStatus
listJobsByStatus_ascending = (ListJobsByStatus -> Maybe Text)
-> (ListJobsByStatus -> Maybe Text -> ListJobsByStatus)
-> Lens ListJobsByStatus ListJobsByStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJobsByStatus' {Maybe Text
ascending :: Maybe Text
$sel:ascending:ListJobsByStatus' :: ListJobsByStatus -> Maybe Text
ascending} -> Maybe Text
ascending) (\s :: ListJobsByStatus
s@ListJobsByStatus' {} Maybe Text
a -> ListJobsByStatus
s {$sel:ascending:ListJobsByStatus' :: Maybe Text
ascending = Maybe Text
a} :: ListJobsByStatus)

-- | When Elastic Transcoder returns more than one page of results, use
-- @pageToken@ in subsequent @GET@ requests to get each successive page of
-- results.
listJobsByStatus_pageToken :: Lens.Lens' ListJobsByStatus (Prelude.Maybe Prelude.Text)
listJobsByStatus_pageToken :: (Maybe Text -> f (Maybe Text))
-> ListJobsByStatus -> f ListJobsByStatus
listJobsByStatus_pageToken = (ListJobsByStatus -> Maybe Text)
-> (ListJobsByStatus -> Maybe Text -> ListJobsByStatus)
-> Lens ListJobsByStatus ListJobsByStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJobsByStatus' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:ListJobsByStatus' :: ListJobsByStatus -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: ListJobsByStatus
s@ListJobsByStatus' {} Maybe Text
a -> ListJobsByStatus
s {$sel:pageToken:ListJobsByStatus' :: Maybe Text
pageToken = Maybe Text
a} :: ListJobsByStatus)

-- | To get information about all of the jobs associated with the current AWS
-- account that have a given status, specify the following status:
-- @Submitted@, @Progressing@, @Complete@, @Canceled@, or @Error@.
listJobsByStatus_status :: Lens.Lens' ListJobsByStatus Prelude.Text
listJobsByStatus_status :: (Text -> f Text) -> ListJobsByStatus -> f ListJobsByStatus
listJobsByStatus_status = (ListJobsByStatus -> Text)
-> (ListJobsByStatus -> Text -> ListJobsByStatus)
-> Lens ListJobsByStatus ListJobsByStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJobsByStatus' {Text
status :: Text
$sel:status:ListJobsByStatus' :: ListJobsByStatus -> Text
status} -> Text
status) (\s :: ListJobsByStatus
s@ListJobsByStatus' {} Text
a -> ListJobsByStatus
s {$sel:status:ListJobsByStatus' :: Text
status = Text
a} :: ListJobsByStatus)

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

instance Prelude.NFData ListJobsByStatus

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

instance Core.ToPath ListJobsByStatus where
  toPath :: ListJobsByStatus -> ByteString
toPath ListJobsByStatus' {Maybe Text
Text
status :: Text
pageToken :: Maybe Text
ascending :: Maybe Text
$sel:status:ListJobsByStatus' :: ListJobsByStatus -> Text
$sel:pageToken:ListJobsByStatus' :: ListJobsByStatus -> Maybe Text
$sel:ascending:ListJobsByStatus' :: ListJobsByStatus -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/2012-09-25/jobsByStatus/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
status]

instance Core.ToQuery ListJobsByStatus where
  toQuery :: ListJobsByStatus -> QueryString
toQuery ListJobsByStatus' {Maybe Text
Text
status :: Text
pageToken :: Maybe Text
ascending :: Maybe Text
$sel:status:ListJobsByStatus' :: ListJobsByStatus -> Text
$sel:pageToken:ListJobsByStatus' :: ListJobsByStatus -> Maybe Text
$sel:ascending:ListJobsByStatus' :: ListJobsByStatus -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Ascending" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
ascending,
        ByteString
"PageToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
pageToken
      ]

-- | The @ListJobsByStatusResponse@ structure.
--
-- /See:/ 'newListJobsByStatusResponse' smart constructor.
data ListJobsByStatusResponse = ListJobsByStatusResponse'
  { -- | A value that you use to access the second and subsequent pages of
    -- results, if any. When the jobs in the specified pipeline fit on one page
    -- or when you\'ve reached the last page of results, the value of
    -- @NextPageToken@ is @null@.
    ListJobsByStatusResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | An array of @Job@ objects that have the specified status.
    ListJobsByStatusResponse -> Maybe [Job]
jobs :: Prelude.Maybe [Job],
    -- | The response's http status code.
    ListJobsByStatusResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListJobsByStatusResponse -> ListJobsByStatusResponse -> Bool
(ListJobsByStatusResponse -> ListJobsByStatusResponse -> Bool)
-> (ListJobsByStatusResponse -> ListJobsByStatusResponse -> Bool)
-> Eq ListJobsByStatusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListJobsByStatusResponse -> ListJobsByStatusResponse -> Bool
$c/= :: ListJobsByStatusResponse -> ListJobsByStatusResponse -> Bool
== :: ListJobsByStatusResponse -> ListJobsByStatusResponse -> Bool
$c== :: ListJobsByStatusResponse -> ListJobsByStatusResponse -> Bool
Prelude.Eq, ReadPrec [ListJobsByStatusResponse]
ReadPrec ListJobsByStatusResponse
Int -> ReadS ListJobsByStatusResponse
ReadS [ListJobsByStatusResponse]
(Int -> ReadS ListJobsByStatusResponse)
-> ReadS [ListJobsByStatusResponse]
-> ReadPrec ListJobsByStatusResponse
-> ReadPrec [ListJobsByStatusResponse]
-> Read ListJobsByStatusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListJobsByStatusResponse]
$creadListPrec :: ReadPrec [ListJobsByStatusResponse]
readPrec :: ReadPrec ListJobsByStatusResponse
$creadPrec :: ReadPrec ListJobsByStatusResponse
readList :: ReadS [ListJobsByStatusResponse]
$creadList :: ReadS [ListJobsByStatusResponse]
readsPrec :: Int -> ReadS ListJobsByStatusResponse
$creadsPrec :: Int -> ReadS ListJobsByStatusResponse
Prelude.Read, Int -> ListJobsByStatusResponse -> ShowS
[ListJobsByStatusResponse] -> ShowS
ListJobsByStatusResponse -> String
(Int -> ListJobsByStatusResponse -> ShowS)
-> (ListJobsByStatusResponse -> String)
-> ([ListJobsByStatusResponse] -> ShowS)
-> Show ListJobsByStatusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListJobsByStatusResponse] -> ShowS
$cshowList :: [ListJobsByStatusResponse] -> ShowS
show :: ListJobsByStatusResponse -> String
$cshow :: ListJobsByStatusResponse -> String
showsPrec :: Int -> ListJobsByStatusResponse -> ShowS
$cshowsPrec :: Int -> ListJobsByStatusResponse -> ShowS
Prelude.Show, (forall x.
 ListJobsByStatusResponse -> Rep ListJobsByStatusResponse x)
-> (forall x.
    Rep ListJobsByStatusResponse x -> ListJobsByStatusResponse)
-> Generic ListJobsByStatusResponse
forall x.
Rep ListJobsByStatusResponse x -> ListJobsByStatusResponse
forall x.
ListJobsByStatusResponse -> Rep ListJobsByStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListJobsByStatusResponse x -> ListJobsByStatusResponse
$cfrom :: forall x.
ListJobsByStatusResponse -> Rep ListJobsByStatusResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListJobsByStatusResponse' 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:
--
-- 'nextPageToken', 'listJobsByStatusResponse_nextPageToken' - A value that you use to access the second and subsequent pages of
-- results, if any. When the jobs in the specified pipeline fit on one page
-- or when you\'ve reached the last page of results, the value of
-- @NextPageToken@ is @null@.
--
-- 'jobs', 'listJobsByStatusResponse_jobs' - An array of @Job@ objects that have the specified status.
--
-- 'httpStatus', 'listJobsByStatusResponse_httpStatus' - The response's http status code.
newListJobsByStatusResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListJobsByStatusResponse
newListJobsByStatusResponse :: Int -> ListJobsByStatusResponse
newListJobsByStatusResponse Int
pHttpStatus_ =
  ListJobsByStatusResponse' :: Maybe Text -> Maybe [Job] -> Int -> ListJobsByStatusResponse
ListJobsByStatusResponse'
    { $sel:nextPageToken:ListJobsByStatusResponse' :: Maybe Text
nextPageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobs:ListJobsByStatusResponse' :: Maybe [Job]
jobs = Maybe [Job]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListJobsByStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A value that you use to access the second and subsequent pages of
-- results, if any. When the jobs in the specified pipeline fit on one page
-- or when you\'ve reached the last page of results, the value of
-- @NextPageToken@ is @null@.
listJobsByStatusResponse_nextPageToken :: Lens.Lens' ListJobsByStatusResponse (Prelude.Maybe Prelude.Text)
listJobsByStatusResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> ListJobsByStatusResponse -> f ListJobsByStatusResponse
listJobsByStatusResponse_nextPageToken = (ListJobsByStatusResponse -> Maybe Text)
-> (ListJobsByStatusResponse
    -> Maybe Text -> ListJobsByStatusResponse)
-> Lens' ListJobsByStatusResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJobsByStatusResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:ListJobsByStatusResponse' :: ListJobsByStatusResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: ListJobsByStatusResponse
s@ListJobsByStatusResponse' {} Maybe Text
a -> ListJobsByStatusResponse
s {$sel:nextPageToken:ListJobsByStatusResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: ListJobsByStatusResponse)

-- | An array of @Job@ objects that have the specified status.
listJobsByStatusResponse_jobs :: Lens.Lens' ListJobsByStatusResponse (Prelude.Maybe [Job])
listJobsByStatusResponse_jobs :: (Maybe [Job] -> f (Maybe [Job]))
-> ListJobsByStatusResponse -> f ListJobsByStatusResponse
listJobsByStatusResponse_jobs = (ListJobsByStatusResponse -> Maybe [Job])
-> (ListJobsByStatusResponse
    -> Maybe [Job] -> ListJobsByStatusResponse)
-> Lens' ListJobsByStatusResponse (Maybe [Job])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJobsByStatusResponse' {Maybe [Job]
jobs :: Maybe [Job]
$sel:jobs:ListJobsByStatusResponse' :: ListJobsByStatusResponse -> Maybe [Job]
jobs} -> Maybe [Job]
jobs) (\s :: ListJobsByStatusResponse
s@ListJobsByStatusResponse' {} Maybe [Job]
a -> ListJobsByStatusResponse
s {$sel:jobs:ListJobsByStatusResponse' :: Maybe [Job]
jobs = Maybe [Job]
a} :: ListJobsByStatusResponse) ((Maybe [Job] -> f (Maybe [Job]))
 -> ListJobsByStatusResponse -> f ListJobsByStatusResponse)
-> ((Maybe [Job] -> f (Maybe [Job]))
    -> Maybe [Job] -> f (Maybe [Job]))
-> (Maybe [Job] -> f (Maybe [Job]))
-> ListJobsByStatusResponse
-> f ListJobsByStatusResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Job] [Job] [Job] [Job]
-> Iso (Maybe [Job]) (Maybe [Job]) (Maybe [Job]) (Maybe [Job])
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 [Job] [Job] [Job] [Job]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListJobsByStatusResponse