{-# 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.MGN.DescribeJobs
-- 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)
--
-- Returns a list of Jobs. Use the JobsID and fromDate and toData filters
-- to limit which jobs are returned. The response is sorted by
-- creationDataTime - latest date first. Jobs are normaly created by the
-- StartTest, StartCutover, and TerminateTargetInstances APIs. Jobs are
-- also created by DiagnosticLaunch and TerminateDiagnosticInstances, which
-- are APIs available only to *Support* and only used in response to
-- relevant support tickets.
--
-- This operation returns paginated results.
module Amazonka.MGN.DescribeJobs
  ( -- * Creating a Request
    DescribeJobs (..),
    newDescribeJobs,

    -- * Request Lenses
    describeJobs_nextToken,
    describeJobs_maxResults,
    describeJobs_filters,

    -- * Destructuring the Response
    DescribeJobsResponse (..),
    newDescribeJobsResponse,

    -- * Response Lenses
    describeJobsResponse_items,
    describeJobsResponse_nextToken,
    describeJobsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeJobs' smart constructor.
data DescribeJobs = DescribeJobs'
  { -- | Request to describe Job logby next token.
    DescribeJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Request to describe Job log by max results.
    DescribeJobs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | Request to describe Job log filters.
    DescribeJobs -> DescribeJobsRequestFilters
filters :: DescribeJobsRequestFilters
  }
  deriving (DescribeJobs -> DescribeJobs -> Bool
(DescribeJobs -> DescribeJobs -> Bool)
-> (DescribeJobs -> DescribeJobs -> Bool) -> Eq DescribeJobs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeJobs -> DescribeJobs -> Bool
$c/= :: DescribeJobs -> DescribeJobs -> Bool
== :: DescribeJobs -> DescribeJobs -> Bool
$c== :: DescribeJobs -> DescribeJobs -> Bool
Prelude.Eq, ReadPrec [DescribeJobs]
ReadPrec DescribeJobs
Int -> ReadS DescribeJobs
ReadS [DescribeJobs]
(Int -> ReadS DescribeJobs)
-> ReadS [DescribeJobs]
-> ReadPrec DescribeJobs
-> ReadPrec [DescribeJobs]
-> Read DescribeJobs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeJobs]
$creadListPrec :: ReadPrec [DescribeJobs]
readPrec :: ReadPrec DescribeJobs
$creadPrec :: ReadPrec DescribeJobs
readList :: ReadS [DescribeJobs]
$creadList :: ReadS [DescribeJobs]
readsPrec :: Int -> ReadS DescribeJobs
$creadsPrec :: Int -> ReadS DescribeJobs
Prelude.Read, Int -> DescribeJobs -> ShowS
[DescribeJobs] -> ShowS
DescribeJobs -> String
(Int -> DescribeJobs -> ShowS)
-> (DescribeJobs -> String)
-> ([DescribeJobs] -> ShowS)
-> Show DescribeJobs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeJobs] -> ShowS
$cshowList :: [DescribeJobs] -> ShowS
show :: DescribeJobs -> String
$cshow :: DescribeJobs -> String
showsPrec :: Int -> DescribeJobs -> ShowS
$cshowsPrec :: Int -> DescribeJobs -> ShowS
Prelude.Show, (forall x. DescribeJobs -> Rep DescribeJobs x)
-> (forall x. Rep DescribeJobs x -> DescribeJobs)
-> Generic DescribeJobs
forall x. Rep DescribeJobs x -> DescribeJobs
forall x. DescribeJobs -> Rep DescribeJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeJobs x -> DescribeJobs
$cfrom :: forall x. DescribeJobs -> Rep DescribeJobs x
Prelude.Generic)

-- |
-- Create a value of 'DescribeJobs' 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', 'describeJobs_nextToken' - Request to describe Job logby next token.
--
-- 'maxResults', 'describeJobs_maxResults' - Request to describe Job log by max results.
--
-- 'filters', 'describeJobs_filters' - Request to describe Job log filters.
newDescribeJobs ::
  -- | 'filters'
  DescribeJobsRequestFilters ->
  DescribeJobs
newDescribeJobs :: DescribeJobsRequestFilters -> DescribeJobs
newDescribeJobs DescribeJobsRequestFilters
pFilters_ =
  DescribeJobs' :: Maybe Text
-> Maybe Natural -> DescribeJobsRequestFilters -> DescribeJobs
DescribeJobs'
    { $sel:nextToken:DescribeJobs' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeJobs' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeJobs' :: DescribeJobsRequestFilters
filters = DescribeJobsRequestFilters
pFilters_
    }

-- | Request to describe Job logby next token.
describeJobs_nextToken :: Lens.Lens' DescribeJobs (Prelude.Maybe Prelude.Text)
describeJobs_nextToken :: (Maybe Text -> f (Maybe Text)) -> DescribeJobs -> f DescribeJobs
describeJobs_nextToken = (DescribeJobs -> Maybe Text)
-> (DescribeJobs -> Maybe Text -> DescribeJobs)
-> Lens DescribeJobs DescribeJobs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeJobs' :: DescribeJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeJobs
s@DescribeJobs' {} Maybe Text
a -> DescribeJobs
s {$sel:nextToken:DescribeJobs' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeJobs)

-- | Request to describe Job log by max results.
describeJobs_maxResults :: Lens.Lens' DescribeJobs (Prelude.Maybe Prelude.Natural)
describeJobs_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeJobs -> f DescribeJobs
describeJobs_maxResults = (DescribeJobs -> Maybe Natural)
-> (DescribeJobs -> Maybe Natural -> DescribeJobs)
-> Lens DescribeJobs DescribeJobs (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeJobs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeJobs' :: DescribeJobs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeJobs
s@DescribeJobs' {} Maybe Natural
a -> DescribeJobs
s {$sel:maxResults:DescribeJobs' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeJobs)

-- | Request to describe Job log filters.
describeJobs_filters :: Lens.Lens' DescribeJobs DescribeJobsRequestFilters
describeJobs_filters :: (DescribeJobsRequestFilters -> f DescribeJobsRequestFilters)
-> DescribeJobs -> f DescribeJobs
describeJobs_filters = (DescribeJobs -> DescribeJobsRequestFilters)
-> (DescribeJobs -> DescribeJobsRequestFilters -> DescribeJobs)
-> Lens
     DescribeJobs
     DescribeJobs
     DescribeJobsRequestFilters
     DescribeJobsRequestFilters
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeJobs' {DescribeJobsRequestFilters
filters :: DescribeJobsRequestFilters
$sel:filters:DescribeJobs' :: DescribeJobs -> DescribeJobsRequestFilters
filters} -> DescribeJobsRequestFilters
filters) (\s :: DescribeJobs
s@DescribeJobs' {} DescribeJobsRequestFilters
a -> DescribeJobs
s {$sel:filters:DescribeJobs' :: DescribeJobsRequestFilters
filters = DescribeJobsRequestFilters
a} :: DescribeJobs)

instance Core.AWSPager DescribeJobs where
  page :: DescribeJobs -> AWSResponse DescribeJobs -> Maybe DescribeJobs
page DescribeJobs
rq AWSResponse DescribeJobs
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeJobs
DescribeJobsResponse
rs
            DescribeJobsResponse
-> Getting (First Text) DescribeJobsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeJobsResponse -> Const (First Text) DescribeJobsResponse
Lens' DescribeJobsResponse (Maybe Text)
describeJobsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeJobsResponse -> Const (First Text) DescribeJobsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeJobsResponse 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 DescribeJobs
forall a. Maybe a
Prelude.Nothing
    | Maybe [Job] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeJobs
DescribeJobsResponse
rs
            DescribeJobsResponse
-> Getting (First [Job]) DescribeJobsResponse [Job] -> Maybe [Job]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Job] -> Const (First [Job]) (Maybe [Job]))
-> DescribeJobsResponse -> Const (First [Job]) DescribeJobsResponse
Lens' DescribeJobsResponse (Maybe [Job])
describeJobsResponse_items ((Maybe [Job] -> Const (First [Job]) (Maybe [Job]))
 -> DescribeJobsResponse
 -> Const (First [Job]) DescribeJobsResponse)
-> (([Job] -> Const (First [Job]) [Job])
    -> Maybe [Job] -> Const (First [Job]) (Maybe [Job]))
-> Getting (First [Job]) DescribeJobsResponse [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 DescribeJobs
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeJobs -> Maybe DescribeJobs
forall a. a -> Maybe a
Prelude.Just (DescribeJobs -> Maybe DescribeJobs)
-> DescribeJobs -> Maybe DescribeJobs
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeJobs
rq
          DescribeJobs -> (DescribeJobs -> DescribeJobs) -> DescribeJobs
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeJobs -> Identity DescribeJobs
Lens DescribeJobs DescribeJobs (Maybe Text) (Maybe Text)
describeJobs_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeJobs -> Identity DescribeJobs)
-> Maybe Text -> DescribeJobs -> DescribeJobs
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeJobs
DescribeJobsResponse
rs
          DescribeJobsResponse
-> Getting (First Text) DescribeJobsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeJobsResponse -> Const (First Text) DescribeJobsResponse
Lens' DescribeJobsResponse (Maybe Text)
describeJobsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeJobsResponse -> Const (First Text) DescribeJobsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeJobsResponse 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 DescribeJobs where
  type AWSResponse DescribeJobs = DescribeJobsResponse
  request :: DescribeJobs -> Request DescribeJobs
request = Service -> DescribeJobs -> Request DescribeJobs
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeJobs
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeJobs)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeJobs))
-> Logger
-> Service
-> Proxy DescribeJobs
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeJobs)))
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 [Job] -> Maybe Text -> Int -> DescribeJobsResponse
DescribeJobsResponse'
            (Maybe [Job] -> Maybe Text -> Int -> DescribeJobsResponse)
-> Either String (Maybe [Job])
-> Either String (Maybe Text -> Int -> DescribeJobsResponse)
forall (f :: * -> *) a b. Functor 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
"items" 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 (Maybe Text -> Int -> DescribeJobsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeJobsResponse)
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 -> DescribeJobsResponse)
-> Either String Int -> Either String DescribeJobsResponse
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 DescribeJobs

instance Prelude.NFData DescribeJobs

instance Core.ToHeaders DescribeJobs where
  toHeaders :: DescribeJobs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeJobs -> 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.ToJSON DescribeJobs where
  toJSON :: DescribeJobs -> Value
toJSON DescribeJobs' {Maybe Natural
Maybe Text
DescribeJobsRequestFilters
filters :: DescribeJobsRequestFilters
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:filters:DescribeJobs' :: DescribeJobs -> DescribeJobsRequestFilters
$sel:maxResults:DescribeJobs' :: DescribeJobs -> Maybe Natural
$sel:nextToken:DescribeJobs' :: DescribeJobs -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"nextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"maxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"filters" Text -> DescribeJobsRequestFilters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DescribeJobsRequestFilters
filters)
          ]
      )

instance Core.ToPath DescribeJobs where
  toPath :: DescribeJobs -> ByteString
toPath = ByteString -> DescribeJobs -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/DescribeJobs"

instance Core.ToQuery DescribeJobs where
  toQuery :: DescribeJobs -> QueryString
toQuery = QueryString -> DescribeJobs -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeJobsResponse' smart constructor.
data DescribeJobsResponse = DescribeJobsResponse'
  { -- | Request to describe Job log items.
    DescribeJobsResponse -> Maybe [Job]
items :: Prelude.Maybe [Job],
    -- | Request to describe Job response by next token.
    DescribeJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeJobsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeJobsResponse -> DescribeJobsResponse -> Bool
(DescribeJobsResponse -> DescribeJobsResponse -> Bool)
-> (DescribeJobsResponse -> DescribeJobsResponse -> Bool)
-> Eq DescribeJobsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeJobsResponse -> DescribeJobsResponse -> Bool
$c/= :: DescribeJobsResponse -> DescribeJobsResponse -> Bool
== :: DescribeJobsResponse -> DescribeJobsResponse -> Bool
$c== :: DescribeJobsResponse -> DescribeJobsResponse -> Bool
Prelude.Eq, Int -> DescribeJobsResponse -> ShowS
[DescribeJobsResponse] -> ShowS
DescribeJobsResponse -> String
(Int -> DescribeJobsResponse -> ShowS)
-> (DescribeJobsResponse -> String)
-> ([DescribeJobsResponse] -> ShowS)
-> Show DescribeJobsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeJobsResponse] -> ShowS
$cshowList :: [DescribeJobsResponse] -> ShowS
show :: DescribeJobsResponse -> String
$cshow :: DescribeJobsResponse -> String
showsPrec :: Int -> DescribeJobsResponse -> ShowS
$cshowsPrec :: Int -> DescribeJobsResponse -> ShowS
Prelude.Show, (forall x. DescribeJobsResponse -> Rep DescribeJobsResponse x)
-> (forall x. Rep DescribeJobsResponse x -> DescribeJobsResponse)
-> Generic DescribeJobsResponse
forall x. Rep DescribeJobsResponse x -> DescribeJobsResponse
forall x. DescribeJobsResponse -> Rep DescribeJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeJobsResponse x -> DescribeJobsResponse
$cfrom :: forall x. DescribeJobsResponse -> Rep DescribeJobsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeJobsResponse' 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:
--
-- 'items', 'describeJobsResponse_items' - Request to describe Job log items.
--
-- 'nextToken', 'describeJobsResponse_nextToken' - Request to describe Job response by next token.
--
-- 'httpStatus', 'describeJobsResponse_httpStatus' - The response's http status code.
newDescribeJobsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeJobsResponse
newDescribeJobsResponse :: Int -> DescribeJobsResponse
newDescribeJobsResponse Int
pHttpStatus_ =
  DescribeJobsResponse' :: Maybe [Job] -> Maybe Text -> Int -> DescribeJobsResponse
DescribeJobsResponse'
    { $sel:items:DescribeJobsResponse' :: Maybe [Job]
items = Maybe [Job]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeJobsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeJobsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Request to describe Job log items.
describeJobsResponse_items :: Lens.Lens' DescribeJobsResponse (Prelude.Maybe [Job])
describeJobsResponse_items :: (Maybe [Job] -> f (Maybe [Job]))
-> DescribeJobsResponse -> f DescribeJobsResponse
describeJobsResponse_items = (DescribeJobsResponse -> Maybe [Job])
-> (DescribeJobsResponse -> Maybe [Job] -> DescribeJobsResponse)
-> Lens' DescribeJobsResponse (Maybe [Job])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeJobsResponse' {Maybe [Job]
items :: Maybe [Job]
$sel:items:DescribeJobsResponse' :: DescribeJobsResponse -> Maybe [Job]
items} -> Maybe [Job]
items) (\s :: DescribeJobsResponse
s@DescribeJobsResponse' {} Maybe [Job]
a -> DescribeJobsResponse
s {$sel:items:DescribeJobsResponse' :: Maybe [Job]
items = Maybe [Job]
a} :: DescribeJobsResponse) ((Maybe [Job] -> f (Maybe [Job]))
 -> DescribeJobsResponse -> f DescribeJobsResponse)
-> ((Maybe [Job] -> f (Maybe [Job]))
    -> Maybe [Job] -> f (Maybe [Job]))
-> (Maybe [Job] -> f (Maybe [Job]))
-> DescribeJobsResponse
-> f DescribeJobsResponse
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

-- | Request to describe Job response by next token.
describeJobsResponse_nextToken :: Lens.Lens' DescribeJobsResponse (Prelude.Maybe Prelude.Text)
describeJobsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeJobsResponse -> f DescribeJobsResponse
describeJobsResponse_nextToken = (DescribeJobsResponse -> Maybe Text)
-> (DescribeJobsResponse -> Maybe Text -> DescribeJobsResponse)
-> Lens' DescribeJobsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeJobsResponse' :: DescribeJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeJobsResponse
s@DescribeJobsResponse' {} Maybe Text
a -> DescribeJobsResponse
s {$sel:nextToken:DescribeJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeJobsResponse)

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

instance Prelude.NFData DescribeJobsResponse