{-# 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.Signer.ListSigningJobs
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists all your signing jobs. You can use the @maxResults@ parameter to
-- limit the number of signing jobs that are returned in the response. If
-- additional jobs remain to be listed, code signing returns a @nextToken@
-- value. Use this value in subsequent calls to @ListSigningJobs@ to fetch
-- the remaining values. You can continue calling @ListSigningJobs@ with
-- your @maxResults@ parameter and with new values that code signing
-- returns in the @nextToken@ parameter until all of your signing jobs have
-- been returned.
--
-- This operation returns paginated results.
module Amazonka.Signer.ListSigningJobs
  ( -- * Creating a Request
    ListSigningJobs (..),
    newListSigningJobs,

    -- * Request Lenses
    listSigningJobs_status,
    listSigningJobs_signatureExpiresAfter,
    listSigningJobs_requestedBy,
    listSigningJobs_isRevoked,
    listSigningJobs_nextToken,
    listSigningJobs_platformId,
    listSigningJobs_jobInvoker,
    listSigningJobs_signatureExpiresBefore,
    listSigningJobs_maxResults,

    -- * Destructuring the Response
    ListSigningJobsResponse (..),
    newListSigningJobsResponse,

    -- * Response Lenses
    listSigningJobsResponse_jobs,
    listSigningJobsResponse_nextToken,
    listSigningJobsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListSigningJobs' smart constructor.
data ListSigningJobs = ListSigningJobs'
  { -- | A status value with which to filter your results.
    ListSigningJobs -> Maybe SigningStatus
status :: Prelude.Maybe SigningStatus,
    -- | Filters results to return only signing jobs with signatures expiring
    -- after a specified timestamp.
    ListSigningJobs -> Maybe POSIX
signatureExpiresAfter :: Prelude.Maybe Core.POSIX,
    -- | The IAM principal that requested the signing job.
    ListSigningJobs -> Maybe Text
requestedBy :: Prelude.Maybe Prelude.Text,
    -- | Filters results to return only signing jobs with revoked signatures.
    ListSigningJobs -> Maybe Bool
isRevoked :: Prelude.Maybe Prelude.Bool,
    -- | String for specifying the next set of paginated results to return. After
    -- you receive a response with truncated results, use this parameter in a
    -- subsequent request. Set it to the value of @nextToken@ from the response
    -- that you just received.
    ListSigningJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of microcontroller platform that you specified for the
    -- distribution of your code image.
    ListSigningJobs -> Maybe Text
platformId :: Prelude.Maybe Prelude.Text,
    -- | Filters results to return only signing jobs initiated by a specified IAM
    -- entity.
    ListSigningJobs -> Maybe Text
jobInvoker :: Prelude.Maybe Prelude.Text,
    -- | Filters results to return only signing jobs with signatures expiring
    -- before a specified timestamp.
    ListSigningJobs -> Maybe POSIX
signatureExpiresBefore :: Prelude.Maybe Core.POSIX,
    -- | Specifies the maximum number of items to return in the response. Use
    -- this parameter when paginating results. If additional items exist beyond
    -- the number you specify, the @nextToken@ element is set in the response.
    -- Use the @nextToken@ value in a subsequent request to retrieve additional
    -- items.
    ListSigningJobs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListSigningJobs -> ListSigningJobs -> Bool
(ListSigningJobs -> ListSigningJobs -> Bool)
-> (ListSigningJobs -> ListSigningJobs -> Bool)
-> Eq ListSigningJobs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSigningJobs -> ListSigningJobs -> Bool
$c/= :: ListSigningJobs -> ListSigningJobs -> Bool
== :: ListSigningJobs -> ListSigningJobs -> Bool
$c== :: ListSigningJobs -> ListSigningJobs -> Bool
Prelude.Eq, ReadPrec [ListSigningJobs]
ReadPrec ListSigningJobs
Int -> ReadS ListSigningJobs
ReadS [ListSigningJobs]
(Int -> ReadS ListSigningJobs)
-> ReadS [ListSigningJobs]
-> ReadPrec ListSigningJobs
-> ReadPrec [ListSigningJobs]
-> Read ListSigningJobs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSigningJobs]
$creadListPrec :: ReadPrec [ListSigningJobs]
readPrec :: ReadPrec ListSigningJobs
$creadPrec :: ReadPrec ListSigningJobs
readList :: ReadS [ListSigningJobs]
$creadList :: ReadS [ListSigningJobs]
readsPrec :: Int -> ReadS ListSigningJobs
$creadsPrec :: Int -> ReadS ListSigningJobs
Prelude.Read, Int -> ListSigningJobs -> ShowS
[ListSigningJobs] -> ShowS
ListSigningJobs -> String
(Int -> ListSigningJobs -> ShowS)
-> (ListSigningJobs -> String)
-> ([ListSigningJobs] -> ShowS)
-> Show ListSigningJobs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSigningJobs] -> ShowS
$cshowList :: [ListSigningJobs] -> ShowS
show :: ListSigningJobs -> String
$cshow :: ListSigningJobs -> String
showsPrec :: Int -> ListSigningJobs -> ShowS
$cshowsPrec :: Int -> ListSigningJobs -> ShowS
Prelude.Show, (forall x. ListSigningJobs -> Rep ListSigningJobs x)
-> (forall x. Rep ListSigningJobs x -> ListSigningJobs)
-> Generic ListSigningJobs
forall x. Rep ListSigningJobs x -> ListSigningJobs
forall x. ListSigningJobs -> Rep ListSigningJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSigningJobs x -> ListSigningJobs
$cfrom :: forall x. ListSigningJobs -> Rep ListSigningJobs x
Prelude.Generic)

-- |
-- Create a value of 'ListSigningJobs' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'listSigningJobs_status' - A status value with which to filter your results.
--
-- 'signatureExpiresAfter', 'listSigningJobs_signatureExpiresAfter' - Filters results to return only signing jobs with signatures expiring
-- after a specified timestamp.
--
-- 'requestedBy', 'listSigningJobs_requestedBy' - The IAM principal that requested the signing job.
--
-- 'isRevoked', 'listSigningJobs_isRevoked' - Filters results to return only signing jobs with revoked signatures.
--
-- 'nextToken', 'listSigningJobs_nextToken' - String for specifying the next set of paginated results to return. After
-- you receive a response with truncated results, use this parameter in a
-- subsequent request. Set it to the value of @nextToken@ from the response
-- that you just received.
--
-- 'platformId', 'listSigningJobs_platformId' - The ID of microcontroller platform that you specified for the
-- distribution of your code image.
--
-- 'jobInvoker', 'listSigningJobs_jobInvoker' - Filters results to return only signing jobs initiated by a specified IAM
-- entity.
--
-- 'signatureExpiresBefore', 'listSigningJobs_signatureExpiresBefore' - Filters results to return only signing jobs with signatures expiring
-- before a specified timestamp.
--
-- 'maxResults', 'listSigningJobs_maxResults' - Specifies the maximum number of items to return in the response. Use
-- this parameter when paginating results. If additional items exist beyond
-- the number you specify, the @nextToken@ element is set in the response.
-- Use the @nextToken@ value in a subsequent request to retrieve additional
-- items.
newListSigningJobs ::
  ListSigningJobs
newListSigningJobs :: ListSigningJobs
newListSigningJobs =
  ListSigningJobs' :: Maybe SigningStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> ListSigningJobs
ListSigningJobs'
    { $sel:status:ListSigningJobs' :: Maybe SigningStatus
status = Maybe SigningStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:signatureExpiresAfter:ListSigningJobs' :: Maybe POSIX
signatureExpiresAfter = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:requestedBy:ListSigningJobs' :: Maybe Text
requestedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isRevoked:ListSigningJobs' :: Maybe Bool
isRevoked = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSigningJobs' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:platformId:ListSigningJobs' :: Maybe Text
platformId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobInvoker:ListSigningJobs' :: Maybe Text
jobInvoker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:signatureExpiresBefore:ListSigningJobs' :: Maybe POSIX
signatureExpiresBefore = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSigningJobs' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A status value with which to filter your results.
listSigningJobs_status :: Lens.Lens' ListSigningJobs (Prelude.Maybe SigningStatus)
listSigningJobs_status :: (Maybe SigningStatus -> f (Maybe SigningStatus))
-> ListSigningJobs -> f ListSigningJobs
listSigningJobs_status = (ListSigningJobs -> Maybe SigningStatus)
-> (ListSigningJobs -> Maybe SigningStatus -> ListSigningJobs)
-> Lens
     ListSigningJobs
     ListSigningJobs
     (Maybe SigningStatus)
     (Maybe SigningStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningJobs' {Maybe SigningStatus
status :: Maybe SigningStatus
$sel:status:ListSigningJobs' :: ListSigningJobs -> Maybe SigningStatus
status} -> Maybe SigningStatus
status) (\s :: ListSigningJobs
s@ListSigningJobs' {} Maybe SigningStatus
a -> ListSigningJobs
s {$sel:status:ListSigningJobs' :: Maybe SigningStatus
status = Maybe SigningStatus
a} :: ListSigningJobs)

-- | Filters results to return only signing jobs with signatures expiring
-- after a specified timestamp.
listSigningJobs_signatureExpiresAfter :: Lens.Lens' ListSigningJobs (Prelude.Maybe Prelude.UTCTime)
listSigningJobs_signatureExpiresAfter :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListSigningJobs -> f ListSigningJobs
listSigningJobs_signatureExpiresAfter = (ListSigningJobs -> Maybe POSIX)
-> (ListSigningJobs -> Maybe POSIX -> ListSigningJobs)
-> Lens ListSigningJobs ListSigningJobs (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningJobs' {Maybe POSIX
signatureExpiresAfter :: Maybe POSIX
$sel:signatureExpiresAfter:ListSigningJobs' :: ListSigningJobs -> Maybe POSIX
signatureExpiresAfter} -> Maybe POSIX
signatureExpiresAfter) (\s :: ListSigningJobs
s@ListSigningJobs' {} Maybe POSIX
a -> ListSigningJobs
s {$sel:signatureExpiresAfter:ListSigningJobs' :: Maybe POSIX
signatureExpiresAfter = Maybe POSIX
a} :: ListSigningJobs) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListSigningJobs -> f ListSigningJobs)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListSigningJobs
-> f ListSigningJobs
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The IAM principal that requested the signing job.
listSigningJobs_requestedBy :: Lens.Lens' ListSigningJobs (Prelude.Maybe Prelude.Text)
listSigningJobs_requestedBy :: (Maybe Text -> f (Maybe Text))
-> ListSigningJobs -> f ListSigningJobs
listSigningJobs_requestedBy = (ListSigningJobs -> Maybe Text)
-> (ListSigningJobs -> Maybe Text -> ListSigningJobs)
-> Lens ListSigningJobs ListSigningJobs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningJobs' {Maybe Text
requestedBy :: Maybe Text
$sel:requestedBy:ListSigningJobs' :: ListSigningJobs -> Maybe Text
requestedBy} -> Maybe Text
requestedBy) (\s :: ListSigningJobs
s@ListSigningJobs' {} Maybe Text
a -> ListSigningJobs
s {$sel:requestedBy:ListSigningJobs' :: Maybe Text
requestedBy = Maybe Text
a} :: ListSigningJobs)

-- | Filters results to return only signing jobs with revoked signatures.
listSigningJobs_isRevoked :: Lens.Lens' ListSigningJobs (Prelude.Maybe Prelude.Bool)
listSigningJobs_isRevoked :: (Maybe Bool -> f (Maybe Bool))
-> ListSigningJobs -> f ListSigningJobs
listSigningJobs_isRevoked = (ListSigningJobs -> Maybe Bool)
-> (ListSigningJobs -> Maybe Bool -> ListSigningJobs)
-> Lens ListSigningJobs ListSigningJobs (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningJobs' {Maybe Bool
isRevoked :: Maybe Bool
$sel:isRevoked:ListSigningJobs' :: ListSigningJobs -> Maybe Bool
isRevoked} -> Maybe Bool
isRevoked) (\s :: ListSigningJobs
s@ListSigningJobs' {} Maybe Bool
a -> ListSigningJobs
s {$sel:isRevoked:ListSigningJobs' :: Maybe Bool
isRevoked = Maybe Bool
a} :: ListSigningJobs)

-- | String for specifying the next set of paginated results to return. After
-- you receive a response with truncated results, use this parameter in a
-- subsequent request. Set it to the value of @nextToken@ from the response
-- that you just received.
listSigningJobs_nextToken :: Lens.Lens' ListSigningJobs (Prelude.Maybe Prelude.Text)
listSigningJobs_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSigningJobs -> f ListSigningJobs
listSigningJobs_nextToken = (ListSigningJobs -> Maybe Text)
-> (ListSigningJobs -> Maybe Text -> ListSigningJobs)
-> Lens ListSigningJobs ListSigningJobs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSigningJobs' :: ListSigningJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSigningJobs
s@ListSigningJobs' {} Maybe Text
a -> ListSigningJobs
s {$sel:nextToken:ListSigningJobs' :: Maybe Text
nextToken = Maybe Text
a} :: ListSigningJobs)

-- | The ID of microcontroller platform that you specified for the
-- distribution of your code image.
listSigningJobs_platformId :: Lens.Lens' ListSigningJobs (Prelude.Maybe Prelude.Text)
listSigningJobs_platformId :: (Maybe Text -> f (Maybe Text))
-> ListSigningJobs -> f ListSigningJobs
listSigningJobs_platformId = (ListSigningJobs -> Maybe Text)
-> (ListSigningJobs -> Maybe Text -> ListSigningJobs)
-> Lens ListSigningJobs ListSigningJobs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningJobs' {Maybe Text
platformId :: Maybe Text
$sel:platformId:ListSigningJobs' :: ListSigningJobs -> Maybe Text
platformId} -> Maybe Text
platformId) (\s :: ListSigningJobs
s@ListSigningJobs' {} Maybe Text
a -> ListSigningJobs
s {$sel:platformId:ListSigningJobs' :: Maybe Text
platformId = Maybe Text
a} :: ListSigningJobs)

-- | Filters results to return only signing jobs initiated by a specified IAM
-- entity.
listSigningJobs_jobInvoker :: Lens.Lens' ListSigningJobs (Prelude.Maybe Prelude.Text)
listSigningJobs_jobInvoker :: (Maybe Text -> f (Maybe Text))
-> ListSigningJobs -> f ListSigningJobs
listSigningJobs_jobInvoker = (ListSigningJobs -> Maybe Text)
-> (ListSigningJobs -> Maybe Text -> ListSigningJobs)
-> Lens ListSigningJobs ListSigningJobs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningJobs' {Maybe Text
jobInvoker :: Maybe Text
$sel:jobInvoker:ListSigningJobs' :: ListSigningJobs -> Maybe Text
jobInvoker} -> Maybe Text
jobInvoker) (\s :: ListSigningJobs
s@ListSigningJobs' {} Maybe Text
a -> ListSigningJobs
s {$sel:jobInvoker:ListSigningJobs' :: Maybe Text
jobInvoker = Maybe Text
a} :: ListSigningJobs)

-- | Filters results to return only signing jobs with signatures expiring
-- before a specified timestamp.
listSigningJobs_signatureExpiresBefore :: Lens.Lens' ListSigningJobs (Prelude.Maybe Prelude.UTCTime)
listSigningJobs_signatureExpiresBefore :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListSigningJobs -> f ListSigningJobs
listSigningJobs_signatureExpiresBefore = (ListSigningJobs -> Maybe POSIX)
-> (ListSigningJobs -> Maybe POSIX -> ListSigningJobs)
-> Lens ListSigningJobs ListSigningJobs (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningJobs' {Maybe POSIX
signatureExpiresBefore :: Maybe POSIX
$sel:signatureExpiresBefore:ListSigningJobs' :: ListSigningJobs -> Maybe POSIX
signatureExpiresBefore} -> Maybe POSIX
signatureExpiresBefore) (\s :: ListSigningJobs
s@ListSigningJobs' {} Maybe POSIX
a -> ListSigningJobs
s {$sel:signatureExpiresBefore:ListSigningJobs' :: Maybe POSIX
signatureExpiresBefore = Maybe POSIX
a} :: ListSigningJobs) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListSigningJobs -> f ListSigningJobs)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListSigningJobs
-> f ListSigningJobs
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Specifies the maximum number of items to return in the response. Use
-- this parameter when paginating results. If additional items exist beyond
-- the number you specify, the @nextToken@ element is set in the response.
-- Use the @nextToken@ value in a subsequent request to retrieve additional
-- items.
listSigningJobs_maxResults :: Lens.Lens' ListSigningJobs (Prelude.Maybe Prelude.Natural)
listSigningJobs_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListSigningJobs -> f ListSigningJobs
listSigningJobs_maxResults = (ListSigningJobs -> Maybe Natural)
-> (ListSigningJobs -> Maybe Natural -> ListSigningJobs)
-> Lens
     ListSigningJobs ListSigningJobs (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningJobs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListSigningJobs' :: ListSigningJobs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListSigningJobs
s@ListSigningJobs' {} Maybe Natural
a -> ListSigningJobs
s {$sel:maxResults:ListSigningJobs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListSigningJobs)

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

instance Prelude.NFData ListSigningJobs

instance Core.ToHeaders ListSigningJobs where
  toHeaders :: ListSigningJobs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListSigningJobs -> 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 ListSigningJobs where
  toPath :: ListSigningJobs -> ByteString
toPath = ByteString -> ListSigningJobs -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/signing-jobs"

instance Core.ToQuery ListSigningJobs where
  toQuery :: ListSigningJobs -> QueryString
toQuery ListSigningJobs' {Maybe Bool
Maybe Natural
Maybe Text
Maybe POSIX
Maybe SigningStatus
maxResults :: Maybe Natural
signatureExpiresBefore :: Maybe POSIX
jobInvoker :: Maybe Text
platformId :: Maybe Text
nextToken :: Maybe Text
isRevoked :: Maybe Bool
requestedBy :: Maybe Text
signatureExpiresAfter :: Maybe POSIX
status :: Maybe SigningStatus
$sel:maxResults:ListSigningJobs' :: ListSigningJobs -> Maybe Natural
$sel:signatureExpiresBefore:ListSigningJobs' :: ListSigningJobs -> Maybe POSIX
$sel:jobInvoker:ListSigningJobs' :: ListSigningJobs -> Maybe Text
$sel:platformId:ListSigningJobs' :: ListSigningJobs -> Maybe Text
$sel:nextToken:ListSigningJobs' :: ListSigningJobs -> Maybe Text
$sel:isRevoked:ListSigningJobs' :: ListSigningJobs -> Maybe Bool
$sel:requestedBy:ListSigningJobs' :: ListSigningJobs -> Maybe Text
$sel:signatureExpiresAfter:ListSigningJobs' :: ListSigningJobs -> Maybe POSIX
$sel:status:ListSigningJobs' :: ListSigningJobs -> Maybe SigningStatus
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"status" ByteString -> Maybe SigningStatus -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe SigningStatus
status,
        ByteString
"signatureExpiresAfter"
          ByteString -> Maybe POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe POSIX
signatureExpiresAfter,
        ByteString
"requestedBy" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
requestedBy,
        ByteString
"isRevoked" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
isRevoked,
        ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"platformId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
platformId,
        ByteString
"jobInvoker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
jobInvoker,
        ByteString
"signatureExpiresBefore"
          ByteString -> Maybe POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe POSIX
signatureExpiresBefore,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListSigningJobsResponse' smart constructor.
data ListSigningJobsResponse = ListSigningJobsResponse'
  { -- | A list of your signing jobs.
    ListSigningJobsResponse -> Maybe [SigningJob]
jobs :: Prelude.Maybe [SigningJob],
    -- | String for specifying the next set of paginated results.
    ListSigningJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListSigningJobsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListSigningJobsResponse -> ListSigningJobsResponse -> Bool
(ListSigningJobsResponse -> ListSigningJobsResponse -> Bool)
-> (ListSigningJobsResponse -> ListSigningJobsResponse -> Bool)
-> Eq ListSigningJobsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSigningJobsResponse -> ListSigningJobsResponse -> Bool
$c/= :: ListSigningJobsResponse -> ListSigningJobsResponse -> Bool
== :: ListSigningJobsResponse -> ListSigningJobsResponse -> Bool
$c== :: ListSigningJobsResponse -> ListSigningJobsResponse -> Bool
Prelude.Eq, ReadPrec [ListSigningJobsResponse]
ReadPrec ListSigningJobsResponse
Int -> ReadS ListSigningJobsResponse
ReadS [ListSigningJobsResponse]
(Int -> ReadS ListSigningJobsResponse)
-> ReadS [ListSigningJobsResponse]
-> ReadPrec ListSigningJobsResponse
-> ReadPrec [ListSigningJobsResponse]
-> Read ListSigningJobsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSigningJobsResponse]
$creadListPrec :: ReadPrec [ListSigningJobsResponse]
readPrec :: ReadPrec ListSigningJobsResponse
$creadPrec :: ReadPrec ListSigningJobsResponse
readList :: ReadS [ListSigningJobsResponse]
$creadList :: ReadS [ListSigningJobsResponse]
readsPrec :: Int -> ReadS ListSigningJobsResponse
$creadsPrec :: Int -> ReadS ListSigningJobsResponse
Prelude.Read, Int -> ListSigningJobsResponse -> ShowS
[ListSigningJobsResponse] -> ShowS
ListSigningJobsResponse -> String
(Int -> ListSigningJobsResponse -> ShowS)
-> (ListSigningJobsResponse -> String)
-> ([ListSigningJobsResponse] -> ShowS)
-> Show ListSigningJobsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSigningJobsResponse] -> ShowS
$cshowList :: [ListSigningJobsResponse] -> ShowS
show :: ListSigningJobsResponse -> String
$cshow :: ListSigningJobsResponse -> String
showsPrec :: Int -> ListSigningJobsResponse -> ShowS
$cshowsPrec :: Int -> ListSigningJobsResponse -> ShowS
Prelude.Show, (forall x.
 ListSigningJobsResponse -> Rep ListSigningJobsResponse x)
-> (forall x.
    Rep ListSigningJobsResponse x -> ListSigningJobsResponse)
-> Generic ListSigningJobsResponse
forall x. Rep ListSigningJobsResponse x -> ListSigningJobsResponse
forall x. ListSigningJobsResponse -> Rep ListSigningJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSigningJobsResponse x -> ListSigningJobsResponse
$cfrom :: forall x. ListSigningJobsResponse -> Rep ListSigningJobsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSigningJobsResponse' 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:
--
-- 'jobs', 'listSigningJobsResponse_jobs' - A list of your signing jobs.
--
-- 'nextToken', 'listSigningJobsResponse_nextToken' - String for specifying the next set of paginated results.
--
-- 'httpStatus', 'listSigningJobsResponse_httpStatus' - The response's http status code.
newListSigningJobsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSigningJobsResponse
newListSigningJobsResponse :: Int -> ListSigningJobsResponse
newListSigningJobsResponse Int
pHttpStatus_ =
  ListSigningJobsResponse' :: Maybe [SigningJob] -> Maybe Text -> Int -> ListSigningJobsResponse
ListSigningJobsResponse'
    { $sel:jobs:ListSigningJobsResponse' :: Maybe [SigningJob]
jobs = Maybe [SigningJob]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSigningJobsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSigningJobsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of your signing jobs.
listSigningJobsResponse_jobs :: Lens.Lens' ListSigningJobsResponse (Prelude.Maybe [SigningJob])
listSigningJobsResponse_jobs :: (Maybe [SigningJob] -> f (Maybe [SigningJob]))
-> ListSigningJobsResponse -> f ListSigningJobsResponse
listSigningJobsResponse_jobs = (ListSigningJobsResponse -> Maybe [SigningJob])
-> (ListSigningJobsResponse
    -> Maybe [SigningJob] -> ListSigningJobsResponse)
-> Lens' ListSigningJobsResponse (Maybe [SigningJob])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningJobsResponse' {Maybe [SigningJob]
jobs :: Maybe [SigningJob]
$sel:jobs:ListSigningJobsResponse' :: ListSigningJobsResponse -> Maybe [SigningJob]
jobs} -> Maybe [SigningJob]
jobs) (\s :: ListSigningJobsResponse
s@ListSigningJobsResponse' {} Maybe [SigningJob]
a -> ListSigningJobsResponse
s {$sel:jobs:ListSigningJobsResponse' :: Maybe [SigningJob]
jobs = Maybe [SigningJob]
a} :: ListSigningJobsResponse) ((Maybe [SigningJob] -> f (Maybe [SigningJob]))
 -> ListSigningJobsResponse -> f ListSigningJobsResponse)
-> ((Maybe [SigningJob] -> f (Maybe [SigningJob]))
    -> Maybe [SigningJob] -> f (Maybe [SigningJob]))
-> (Maybe [SigningJob] -> f (Maybe [SigningJob]))
-> ListSigningJobsResponse
-> f ListSigningJobsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [SigningJob] [SigningJob] [SigningJob] [SigningJob]
-> Iso
     (Maybe [SigningJob])
     (Maybe [SigningJob])
     (Maybe [SigningJob])
     (Maybe [SigningJob])
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 [SigningJob] [SigningJob] [SigningJob] [SigningJob]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | String for specifying the next set of paginated results.
listSigningJobsResponse_nextToken :: Lens.Lens' ListSigningJobsResponse (Prelude.Maybe Prelude.Text)
listSigningJobsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSigningJobsResponse -> f ListSigningJobsResponse
listSigningJobsResponse_nextToken = (ListSigningJobsResponse -> Maybe Text)
-> (ListSigningJobsResponse
    -> Maybe Text -> ListSigningJobsResponse)
-> Lens' ListSigningJobsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSigningJobsResponse' :: ListSigningJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSigningJobsResponse
s@ListSigningJobsResponse' {} Maybe Text
a -> ListSigningJobsResponse
s {$sel:nextToken:ListSigningJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSigningJobsResponse)

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

instance Prelude.NFData ListSigningJobsResponse