{-# 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.RobOMaker.ListDeploymentJobs
-- 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 deployment jobs for a fleet. You can optionally
-- provide filters to retrieve specific deployment jobs.
--
-- This operation returns paginated results.
module Amazonka.RobOMaker.ListDeploymentJobs
  ( -- * Creating a Request
    ListDeploymentJobs (..),
    newListDeploymentJobs,

    -- * Request Lenses
    listDeploymentJobs_filters,
    listDeploymentJobs_nextToken,
    listDeploymentJobs_maxResults,

    -- * Destructuring the Response
    ListDeploymentJobsResponse (..),
    newListDeploymentJobsResponse,

    -- * Response Lenses
    listDeploymentJobsResponse_deploymentJobs,
    listDeploymentJobsResponse_nextToken,
    listDeploymentJobsResponse_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.RobOMaker.Types

-- | /See:/ 'newListDeploymentJobs' smart constructor.
data ListDeploymentJobs = ListDeploymentJobs'
  { -- | Optional filters to limit results.
    --
    -- The filter names @status@ and @fleetName@ are supported. When filtering,
    -- you must use the complete value of the filtered item. You can use up to
    -- three filters, but they must be for the same named item. For example, if
    -- you are looking for items with the status @InProgress@ or the status
    -- @Pending@.
    ListDeploymentJobs -> Maybe (NonEmpty Filter)
filters :: Prelude.Maybe (Prelude.NonEmpty Filter),
    -- | If the previous paginated request did not return all of the remaining
    -- results, the response object\'s @nextToken@ parameter value is set to a
    -- token. To retrieve the next set of results, call @ListDeploymentJobs@
    -- again and assign that token to the request object\'s @nextToken@
    -- parameter. If there are no remaining results, the previous response
    -- object\'s NextToken parameter is set to null.
    ListDeploymentJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | When this parameter is used, @ListDeploymentJobs@ only returns
    -- @maxResults@ results in a single page along with a @nextToken@ response
    -- element. The remaining results of the initial request can be seen by
    -- sending another @ListDeploymentJobs@ request with the returned
    -- @nextToken@ value. This value can be between 1 and 200. If this
    -- parameter is not used, then @ListDeploymentJobs@ returns up to 200
    -- results and a @nextToken@ value if applicable.
    ListDeploymentJobs -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (ListDeploymentJobs -> ListDeploymentJobs -> Bool
(ListDeploymentJobs -> ListDeploymentJobs -> Bool)
-> (ListDeploymentJobs -> ListDeploymentJobs -> Bool)
-> Eq ListDeploymentJobs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeploymentJobs -> ListDeploymentJobs -> Bool
$c/= :: ListDeploymentJobs -> ListDeploymentJobs -> Bool
== :: ListDeploymentJobs -> ListDeploymentJobs -> Bool
$c== :: ListDeploymentJobs -> ListDeploymentJobs -> Bool
Prelude.Eq, ReadPrec [ListDeploymentJobs]
ReadPrec ListDeploymentJobs
Int -> ReadS ListDeploymentJobs
ReadS [ListDeploymentJobs]
(Int -> ReadS ListDeploymentJobs)
-> ReadS [ListDeploymentJobs]
-> ReadPrec ListDeploymentJobs
-> ReadPrec [ListDeploymentJobs]
-> Read ListDeploymentJobs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeploymentJobs]
$creadListPrec :: ReadPrec [ListDeploymentJobs]
readPrec :: ReadPrec ListDeploymentJobs
$creadPrec :: ReadPrec ListDeploymentJobs
readList :: ReadS [ListDeploymentJobs]
$creadList :: ReadS [ListDeploymentJobs]
readsPrec :: Int -> ReadS ListDeploymentJobs
$creadsPrec :: Int -> ReadS ListDeploymentJobs
Prelude.Read, Int -> ListDeploymentJobs -> ShowS
[ListDeploymentJobs] -> ShowS
ListDeploymentJobs -> String
(Int -> ListDeploymentJobs -> ShowS)
-> (ListDeploymentJobs -> String)
-> ([ListDeploymentJobs] -> ShowS)
-> Show ListDeploymentJobs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeploymentJobs] -> ShowS
$cshowList :: [ListDeploymentJobs] -> ShowS
show :: ListDeploymentJobs -> String
$cshow :: ListDeploymentJobs -> String
showsPrec :: Int -> ListDeploymentJobs -> ShowS
$cshowsPrec :: Int -> ListDeploymentJobs -> ShowS
Prelude.Show, (forall x. ListDeploymentJobs -> Rep ListDeploymentJobs x)
-> (forall x. Rep ListDeploymentJobs x -> ListDeploymentJobs)
-> Generic ListDeploymentJobs
forall x. Rep ListDeploymentJobs x -> ListDeploymentJobs
forall x. ListDeploymentJobs -> Rep ListDeploymentJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDeploymentJobs x -> ListDeploymentJobs
$cfrom :: forall x. ListDeploymentJobs -> Rep ListDeploymentJobs x
Prelude.Generic)

-- |
-- Create a value of 'ListDeploymentJobs' 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:
--
-- 'filters', 'listDeploymentJobs_filters' - Optional filters to limit results.
--
-- The filter names @status@ and @fleetName@ are supported. When filtering,
-- you must use the complete value of the filtered item. You can use up to
-- three filters, but they must be for the same named item. For example, if
-- you are looking for items with the status @InProgress@ or the status
-- @Pending@.
--
-- 'nextToken', 'listDeploymentJobs_nextToken' - If the previous paginated request did not return all of the remaining
-- results, the response object\'s @nextToken@ parameter value is set to a
-- token. To retrieve the next set of results, call @ListDeploymentJobs@
-- again and assign that token to the request object\'s @nextToken@
-- parameter. If there are no remaining results, the previous response
-- object\'s NextToken parameter is set to null.
--
-- 'maxResults', 'listDeploymentJobs_maxResults' - When this parameter is used, @ListDeploymentJobs@ only returns
-- @maxResults@ results in a single page along with a @nextToken@ response
-- element. The remaining results of the initial request can be seen by
-- sending another @ListDeploymentJobs@ request with the returned
-- @nextToken@ value. This value can be between 1 and 200. If this
-- parameter is not used, then @ListDeploymentJobs@ returns up to 200
-- results and a @nextToken@ value if applicable.
newListDeploymentJobs ::
  ListDeploymentJobs
newListDeploymentJobs :: ListDeploymentJobs
newListDeploymentJobs =
  ListDeploymentJobs' :: Maybe (NonEmpty Filter)
-> Maybe Text -> Maybe Int -> ListDeploymentJobs
ListDeploymentJobs'
    { $sel:filters:ListDeploymentJobs' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDeploymentJobs' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDeploymentJobs' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Optional filters to limit results.
--
-- The filter names @status@ and @fleetName@ are supported. When filtering,
-- you must use the complete value of the filtered item. You can use up to
-- three filters, but they must be for the same named item. For example, if
-- you are looking for items with the status @InProgress@ or the status
-- @Pending@.
listDeploymentJobs_filters :: Lens.Lens' ListDeploymentJobs (Prelude.Maybe (Prelude.NonEmpty Filter))
listDeploymentJobs_filters :: (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListDeploymentJobs -> f ListDeploymentJobs
listDeploymentJobs_filters = (ListDeploymentJobs -> Maybe (NonEmpty Filter))
-> (ListDeploymentJobs
    -> Maybe (NonEmpty Filter) -> ListDeploymentJobs)
-> Lens
     ListDeploymentJobs
     ListDeploymentJobs
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentJobs' {Maybe (NonEmpty Filter)
filters :: Maybe (NonEmpty Filter)
$sel:filters:ListDeploymentJobs' :: ListDeploymentJobs -> Maybe (NonEmpty Filter)
filters} -> Maybe (NonEmpty Filter)
filters) (\s :: ListDeploymentJobs
s@ListDeploymentJobs' {} Maybe (NonEmpty Filter)
a -> ListDeploymentJobs
s {$sel:filters:ListDeploymentJobs' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
a} :: ListDeploymentJobs) ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
 -> ListDeploymentJobs -> f ListDeploymentJobs)
-> ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
    -> Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListDeploymentJobs
-> f ListDeploymentJobs
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
-> Iso
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
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
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the previous paginated request did not return all of the remaining
-- results, the response object\'s @nextToken@ parameter value is set to a
-- token. To retrieve the next set of results, call @ListDeploymentJobs@
-- again and assign that token to the request object\'s @nextToken@
-- parameter. If there are no remaining results, the previous response
-- object\'s NextToken parameter is set to null.
listDeploymentJobs_nextToken :: Lens.Lens' ListDeploymentJobs (Prelude.Maybe Prelude.Text)
listDeploymentJobs_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDeploymentJobs -> f ListDeploymentJobs
listDeploymentJobs_nextToken = (ListDeploymentJobs -> Maybe Text)
-> (ListDeploymentJobs -> Maybe Text -> ListDeploymentJobs)
-> Lens
     ListDeploymentJobs ListDeploymentJobs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDeploymentJobs' :: ListDeploymentJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDeploymentJobs
s@ListDeploymentJobs' {} Maybe Text
a -> ListDeploymentJobs
s {$sel:nextToken:ListDeploymentJobs' :: Maybe Text
nextToken = Maybe Text
a} :: ListDeploymentJobs)

-- | When this parameter is used, @ListDeploymentJobs@ only returns
-- @maxResults@ results in a single page along with a @nextToken@ response
-- element. The remaining results of the initial request can be seen by
-- sending another @ListDeploymentJobs@ request with the returned
-- @nextToken@ value. This value can be between 1 and 200. If this
-- parameter is not used, then @ListDeploymentJobs@ returns up to 200
-- results and a @nextToken@ value if applicable.
listDeploymentJobs_maxResults :: Lens.Lens' ListDeploymentJobs (Prelude.Maybe Prelude.Int)
listDeploymentJobs_maxResults :: (Maybe Int -> f (Maybe Int))
-> ListDeploymentJobs -> f ListDeploymentJobs
listDeploymentJobs_maxResults = (ListDeploymentJobs -> Maybe Int)
-> (ListDeploymentJobs -> Maybe Int -> ListDeploymentJobs)
-> Lens
     ListDeploymentJobs ListDeploymentJobs (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentJobs' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListDeploymentJobs' :: ListDeploymentJobs -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListDeploymentJobs
s@ListDeploymentJobs' {} Maybe Int
a -> ListDeploymentJobs
s {$sel:maxResults:ListDeploymentJobs' :: Maybe Int
maxResults = Maybe Int
a} :: ListDeploymentJobs)

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

instance Prelude.NFData ListDeploymentJobs

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

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

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

-- | /See:/ 'newListDeploymentJobsResponse' smart constructor.
data ListDeploymentJobsResponse = ListDeploymentJobsResponse'
  { -- | A list of deployment jobs that meet the criteria of the request.
    ListDeploymentJobsResponse -> Maybe [DeploymentJob]
deploymentJobs :: Prelude.Maybe [DeploymentJob],
    -- | If the previous paginated request did not return all of the remaining
    -- results, the response object\'s @nextToken@ parameter value is set to a
    -- token. To retrieve the next set of results, call @ListDeploymentJobs@
    -- again and assign that token to the request object\'s @nextToken@
    -- parameter. If there are no remaining results, the previous response
    -- object\'s NextToken parameter is set to null.
    ListDeploymentJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDeploymentJobsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDeploymentJobsResponse -> ListDeploymentJobsResponse -> Bool
(ListDeploymentJobsResponse -> ListDeploymentJobsResponse -> Bool)
-> (ListDeploymentJobsResponse
    -> ListDeploymentJobsResponse -> Bool)
-> Eq ListDeploymentJobsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeploymentJobsResponse -> ListDeploymentJobsResponse -> Bool
$c/= :: ListDeploymentJobsResponse -> ListDeploymentJobsResponse -> Bool
== :: ListDeploymentJobsResponse -> ListDeploymentJobsResponse -> Bool
$c== :: ListDeploymentJobsResponse -> ListDeploymentJobsResponse -> Bool
Prelude.Eq, ReadPrec [ListDeploymentJobsResponse]
ReadPrec ListDeploymentJobsResponse
Int -> ReadS ListDeploymentJobsResponse
ReadS [ListDeploymentJobsResponse]
(Int -> ReadS ListDeploymentJobsResponse)
-> ReadS [ListDeploymentJobsResponse]
-> ReadPrec ListDeploymentJobsResponse
-> ReadPrec [ListDeploymentJobsResponse]
-> Read ListDeploymentJobsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeploymentJobsResponse]
$creadListPrec :: ReadPrec [ListDeploymentJobsResponse]
readPrec :: ReadPrec ListDeploymentJobsResponse
$creadPrec :: ReadPrec ListDeploymentJobsResponse
readList :: ReadS [ListDeploymentJobsResponse]
$creadList :: ReadS [ListDeploymentJobsResponse]
readsPrec :: Int -> ReadS ListDeploymentJobsResponse
$creadsPrec :: Int -> ReadS ListDeploymentJobsResponse
Prelude.Read, Int -> ListDeploymentJobsResponse -> ShowS
[ListDeploymentJobsResponse] -> ShowS
ListDeploymentJobsResponse -> String
(Int -> ListDeploymentJobsResponse -> ShowS)
-> (ListDeploymentJobsResponse -> String)
-> ([ListDeploymentJobsResponse] -> ShowS)
-> Show ListDeploymentJobsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeploymentJobsResponse] -> ShowS
$cshowList :: [ListDeploymentJobsResponse] -> ShowS
show :: ListDeploymentJobsResponse -> String
$cshow :: ListDeploymentJobsResponse -> String
showsPrec :: Int -> ListDeploymentJobsResponse -> ShowS
$cshowsPrec :: Int -> ListDeploymentJobsResponse -> ShowS
Prelude.Show, (forall x.
 ListDeploymentJobsResponse -> Rep ListDeploymentJobsResponse x)
-> (forall x.
    Rep ListDeploymentJobsResponse x -> ListDeploymentJobsResponse)
-> Generic ListDeploymentJobsResponse
forall x.
Rep ListDeploymentJobsResponse x -> ListDeploymentJobsResponse
forall x.
ListDeploymentJobsResponse -> Rep ListDeploymentJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDeploymentJobsResponse x -> ListDeploymentJobsResponse
$cfrom :: forall x.
ListDeploymentJobsResponse -> Rep ListDeploymentJobsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDeploymentJobsResponse' 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:
--
-- 'deploymentJobs', 'listDeploymentJobsResponse_deploymentJobs' - A list of deployment jobs that meet the criteria of the request.
--
-- 'nextToken', 'listDeploymentJobsResponse_nextToken' - If the previous paginated request did not return all of the remaining
-- results, the response object\'s @nextToken@ parameter value is set to a
-- token. To retrieve the next set of results, call @ListDeploymentJobs@
-- again and assign that token to the request object\'s @nextToken@
-- parameter. If there are no remaining results, the previous response
-- object\'s NextToken parameter is set to null.
--
-- 'httpStatus', 'listDeploymentJobsResponse_httpStatus' - The response's http status code.
newListDeploymentJobsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDeploymentJobsResponse
newListDeploymentJobsResponse :: Int -> ListDeploymentJobsResponse
newListDeploymentJobsResponse Int
pHttpStatus_ =
  ListDeploymentJobsResponse' :: Maybe [DeploymentJob]
-> Maybe Text -> Int -> ListDeploymentJobsResponse
ListDeploymentJobsResponse'
    { $sel:deploymentJobs:ListDeploymentJobsResponse' :: Maybe [DeploymentJob]
deploymentJobs =
        Maybe [DeploymentJob]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDeploymentJobsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDeploymentJobsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of deployment jobs that meet the criteria of the request.
listDeploymentJobsResponse_deploymentJobs :: Lens.Lens' ListDeploymentJobsResponse (Prelude.Maybe [DeploymentJob])
listDeploymentJobsResponse_deploymentJobs :: (Maybe [DeploymentJob] -> f (Maybe [DeploymentJob]))
-> ListDeploymentJobsResponse -> f ListDeploymentJobsResponse
listDeploymentJobsResponse_deploymentJobs = (ListDeploymentJobsResponse -> Maybe [DeploymentJob])
-> (ListDeploymentJobsResponse
    -> Maybe [DeploymentJob] -> ListDeploymentJobsResponse)
-> Lens' ListDeploymentJobsResponse (Maybe [DeploymentJob])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentJobsResponse' {Maybe [DeploymentJob]
deploymentJobs :: Maybe [DeploymentJob]
$sel:deploymentJobs:ListDeploymentJobsResponse' :: ListDeploymentJobsResponse -> Maybe [DeploymentJob]
deploymentJobs} -> Maybe [DeploymentJob]
deploymentJobs) (\s :: ListDeploymentJobsResponse
s@ListDeploymentJobsResponse' {} Maybe [DeploymentJob]
a -> ListDeploymentJobsResponse
s {$sel:deploymentJobs:ListDeploymentJobsResponse' :: Maybe [DeploymentJob]
deploymentJobs = Maybe [DeploymentJob]
a} :: ListDeploymentJobsResponse) ((Maybe [DeploymentJob] -> f (Maybe [DeploymentJob]))
 -> ListDeploymentJobsResponse -> f ListDeploymentJobsResponse)
-> ((Maybe [DeploymentJob] -> f (Maybe [DeploymentJob]))
    -> Maybe [DeploymentJob] -> f (Maybe [DeploymentJob]))
-> (Maybe [DeploymentJob] -> f (Maybe [DeploymentJob]))
-> ListDeploymentJobsResponse
-> f ListDeploymentJobsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DeploymentJob] [DeploymentJob] [DeploymentJob] [DeploymentJob]
-> Iso
     (Maybe [DeploymentJob])
     (Maybe [DeploymentJob])
     (Maybe [DeploymentJob])
     (Maybe [DeploymentJob])
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
  [DeploymentJob] [DeploymentJob] [DeploymentJob] [DeploymentJob]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the previous paginated request did not return all of the remaining
-- results, the response object\'s @nextToken@ parameter value is set to a
-- token. To retrieve the next set of results, call @ListDeploymentJobs@
-- again and assign that token to the request object\'s @nextToken@
-- parameter. If there are no remaining results, the previous response
-- object\'s NextToken parameter is set to null.
listDeploymentJobsResponse_nextToken :: Lens.Lens' ListDeploymentJobsResponse (Prelude.Maybe Prelude.Text)
listDeploymentJobsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDeploymentJobsResponse -> f ListDeploymentJobsResponse
listDeploymentJobsResponse_nextToken = (ListDeploymentJobsResponse -> Maybe Text)
-> (ListDeploymentJobsResponse
    -> Maybe Text -> ListDeploymentJobsResponse)
-> Lens' ListDeploymentJobsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDeploymentJobsResponse' :: ListDeploymentJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDeploymentJobsResponse
s@ListDeploymentJobsResponse' {} Maybe Text
a -> ListDeploymentJobsResponse
s {$sel:nextToken:ListDeploymentJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDeploymentJobsResponse)

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

instance Prelude.NFData ListDeploymentJobsResponse