{-# 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.SMS.GetReplicationJobs
-- 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)
--
-- Describes the specified replication job or all of your replication jobs.
--
-- This operation returns paginated results.
module Amazonka.SMS.GetReplicationJobs
  ( -- * Creating a Request
    GetReplicationJobs (..),
    newGetReplicationJobs,

    -- * Request Lenses
    getReplicationJobs_replicationJobId,
    getReplicationJobs_nextToken,
    getReplicationJobs_maxResults,

    -- * Destructuring the Response
    GetReplicationJobsResponse (..),
    newGetReplicationJobsResponse,

    -- * Response Lenses
    getReplicationJobsResponse_replicationJobList,
    getReplicationJobsResponse_nextToken,
    getReplicationJobsResponse_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.SMS.Types

-- | /See:/ 'newGetReplicationJobs' smart constructor.
data GetReplicationJobs = GetReplicationJobs'
  { -- | The ID of the replication job.
    GetReplicationJobs -> Maybe Text
replicationJobId :: Prelude.Maybe Prelude.Text,
    -- | The token for the next set of results.
    GetReplicationJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return in a single call. The default
    -- value is 50. To retrieve the remaining results, make another call with
    -- the returned @NextToken@ value.
    GetReplicationJobs -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (GetReplicationJobs -> GetReplicationJobs -> Bool
(GetReplicationJobs -> GetReplicationJobs -> Bool)
-> (GetReplicationJobs -> GetReplicationJobs -> Bool)
-> Eq GetReplicationJobs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetReplicationJobs -> GetReplicationJobs -> Bool
$c/= :: GetReplicationJobs -> GetReplicationJobs -> Bool
== :: GetReplicationJobs -> GetReplicationJobs -> Bool
$c== :: GetReplicationJobs -> GetReplicationJobs -> Bool
Prelude.Eq, ReadPrec [GetReplicationJobs]
ReadPrec GetReplicationJobs
Int -> ReadS GetReplicationJobs
ReadS [GetReplicationJobs]
(Int -> ReadS GetReplicationJobs)
-> ReadS [GetReplicationJobs]
-> ReadPrec GetReplicationJobs
-> ReadPrec [GetReplicationJobs]
-> Read GetReplicationJobs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetReplicationJobs]
$creadListPrec :: ReadPrec [GetReplicationJobs]
readPrec :: ReadPrec GetReplicationJobs
$creadPrec :: ReadPrec GetReplicationJobs
readList :: ReadS [GetReplicationJobs]
$creadList :: ReadS [GetReplicationJobs]
readsPrec :: Int -> ReadS GetReplicationJobs
$creadsPrec :: Int -> ReadS GetReplicationJobs
Prelude.Read, Int -> GetReplicationJobs -> ShowS
[GetReplicationJobs] -> ShowS
GetReplicationJobs -> String
(Int -> GetReplicationJobs -> ShowS)
-> (GetReplicationJobs -> String)
-> ([GetReplicationJobs] -> ShowS)
-> Show GetReplicationJobs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReplicationJobs] -> ShowS
$cshowList :: [GetReplicationJobs] -> ShowS
show :: GetReplicationJobs -> String
$cshow :: GetReplicationJobs -> String
showsPrec :: Int -> GetReplicationJobs -> ShowS
$cshowsPrec :: Int -> GetReplicationJobs -> ShowS
Prelude.Show, (forall x. GetReplicationJobs -> Rep GetReplicationJobs x)
-> (forall x. Rep GetReplicationJobs x -> GetReplicationJobs)
-> Generic GetReplicationJobs
forall x. Rep GetReplicationJobs x -> GetReplicationJobs
forall x. GetReplicationJobs -> Rep GetReplicationJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetReplicationJobs x -> GetReplicationJobs
$cfrom :: forall x. GetReplicationJobs -> Rep GetReplicationJobs x
Prelude.Generic)

-- |
-- Create a value of 'GetReplicationJobs' 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:
--
-- 'replicationJobId', 'getReplicationJobs_replicationJobId' - The ID of the replication job.
--
-- 'nextToken', 'getReplicationJobs_nextToken' - The token for the next set of results.
--
-- 'maxResults', 'getReplicationJobs_maxResults' - The maximum number of results to return in a single call. The default
-- value is 50. To retrieve the remaining results, make another call with
-- the returned @NextToken@ value.
newGetReplicationJobs ::
  GetReplicationJobs
newGetReplicationJobs :: GetReplicationJobs
newGetReplicationJobs =
  GetReplicationJobs' :: Maybe Text -> Maybe Text -> Maybe Int -> GetReplicationJobs
GetReplicationJobs'
    { $sel:replicationJobId:GetReplicationJobs' :: Maybe Text
replicationJobId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetReplicationJobs' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetReplicationJobs' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the replication job.
getReplicationJobs_replicationJobId :: Lens.Lens' GetReplicationJobs (Prelude.Maybe Prelude.Text)
getReplicationJobs_replicationJobId :: (Maybe Text -> f (Maybe Text))
-> GetReplicationJobs -> f GetReplicationJobs
getReplicationJobs_replicationJobId = (GetReplicationJobs -> Maybe Text)
-> (GetReplicationJobs -> Maybe Text -> GetReplicationJobs)
-> Lens
     GetReplicationJobs GetReplicationJobs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReplicationJobs' {Maybe Text
replicationJobId :: Maybe Text
$sel:replicationJobId:GetReplicationJobs' :: GetReplicationJobs -> Maybe Text
replicationJobId} -> Maybe Text
replicationJobId) (\s :: GetReplicationJobs
s@GetReplicationJobs' {} Maybe Text
a -> GetReplicationJobs
s {$sel:replicationJobId:GetReplicationJobs' :: Maybe Text
replicationJobId = Maybe Text
a} :: GetReplicationJobs)

-- | The token for the next set of results.
getReplicationJobs_nextToken :: Lens.Lens' GetReplicationJobs (Prelude.Maybe Prelude.Text)
getReplicationJobs_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetReplicationJobs -> f GetReplicationJobs
getReplicationJobs_nextToken = (GetReplicationJobs -> Maybe Text)
-> (GetReplicationJobs -> Maybe Text -> GetReplicationJobs)
-> Lens
     GetReplicationJobs GetReplicationJobs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReplicationJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetReplicationJobs' :: GetReplicationJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetReplicationJobs
s@GetReplicationJobs' {} Maybe Text
a -> GetReplicationJobs
s {$sel:nextToken:GetReplicationJobs' :: Maybe Text
nextToken = Maybe Text
a} :: GetReplicationJobs)

-- | The maximum number of results to return in a single call. The default
-- value is 50. To retrieve the remaining results, make another call with
-- the returned @NextToken@ value.
getReplicationJobs_maxResults :: Lens.Lens' GetReplicationJobs (Prelude.Maybe Prelude.Int)
getReplicationJobs_maxResults :: (Maybe Int -> f (Maybe Int))
-> GetReplicationJobs -> f GetReplicationJobs
getReplicationJobs_maxResults = (GetReplicationJobs -> Maybe Int)
-> (GetReplicationJobs -> Maybe Int -> GetReplicationJobs)
-> Lens
     GetReplicationJobs GetReplicationJobs (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReplicationJobs' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:GetReplicationJobs' :: GetReplicationJobs -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: GetReplicationJobs
s@GetReplicationJobs' {} Maybe Int
a -> GetReplicationJobs
s {$sel:maxResults:GetReplicationJobs' :: Maybe Int
maxResults = Maybe Int
a} :: GetReplicationJobs)

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

instance Prelude.NFData GetReplicationJobs

instance Core.ToHeaders GetReplicationJobs where
  toHeaders :: GetReplicationJobs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetReplicationJobs -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSServerMigrationService_V2016_10_24.GetReplicationJobs" ::
                          Prelude.ByteString
                      ),
            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 GetReplicationJobs where
  toJSON :: GetReplicationJobs -> Value
toJSON GetReplicationJobs' {Maybe Int
Maybe Text
maxResults :: Maybe Int
nextToken :: Maybe Text
replicationJobId :: Maybe Text
$sel:maxResults:GetReplicationJobs' :: GetReplicationJobs -> Maybe Int
$sel:nextToken:GetReplicationJobs' :: GetReplicationJobs -> Maybe Text
$sel:replicationJobId:GetReplicationJobs' :: GetReplicationJobs -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"replicationJobId" 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
replicationJobId,
            (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 GetReplicationJobs where
  toPath :: GetReplicationJobs -> ByteString
toPath = ByteString -> GetReplicationJobs -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newGetReplicationJobsResponse' smart constructor.
data GetReplicationJobsResponse = GetReplicationJobsResponse'
  { -- | Information about the replication jobs.
    GetReplicationJobsResponse -> Maybe [ReplicationJob]
replicationJobList :: Prelude.Maybe [ReplicationJob],
    -- | The token required to retrieve the next set of results. This value is
    -- null when there are no more results to return.
    GetReplicationJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetReplicationJobsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetReplicationJobsResponse -> GetReplicationJobsResponse -> Bool
(GetReplicationJobsResponse -> GetReplicationJobsResponse -> Bool)
-> (GetReplicationJobsResponse
    -> GetReplicationJobsResponse -> Bool)
-> Eq GetReplicationJobsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetReplicationJobsResponse -> GetReplicationJobsResponse -> Bool
$c/= :: GetReplicationJobsResponse -> GetReplicationJobsResponse -> Bool
== :: GetReplicationJobsResponse -> GetReplicationJobsResponse -> Bool
$c== :: GetReplicationJobsResponse -> GetReplicationJobsResponse -> Bool
Prelude.Eq, ReadPrec [GetReplicationJobsResponse]
ReadPrec GetReplicationJobsResponse
Int -> ReadS GetReplicationJobsResponse
ReadS [GetReplicationJobsResponse]
(Int -> ReadS GetReplicationJobsResponse)
-> ReadS [GetReplicationJobsResponse]
-> ReadPrec GetReplicationJobsResponse
-> ReadPrec [GetReplicationJobsResponse]
-> Read GetReplicationJobsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetReplicationJobsResponse]
$creadListPrec :: ReadPrec [GetReplicationJobsResponse]
readPrec :: ReadPrec GetReplicationJobsResponse
$creadPrec :: ReadPrec GetReplicationJobsResponse
readList :: ReadS [GetReplicationJobsResponse]
$creadList :: ReadS [GetReplicationJobsResponse]
readsPrec :: Int -> ReadS GetReplicationJobsResponse
$creadsPrec :: Int -> ReadS GetReplicationJobsResponse
Prelude.Read, Int -> GetReplicationJobsResponse -> ShowS
[GetReplicationJobsResponse] -> ShowS
GetReplicationJobsResponse -> String
(Int -> GetReplicationJobsResponse -> ShowS)
-> (GetReplicationJobsResponse -> String)
-> ([GetReplicationJobsResponse] -> ShowS)
-> Show GetReplicationJobsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReplicationJobsResponse] -> ShowS
$cshowList :: [GetReplicationJobsResponse] -> ShowS
show :: GetReplicationJobsResponse -> String
$cshow :: GetReplicationJobsResponse -> String
showsPrec :: Int -> GetReplicationJobsResponse -> ShowS
$cshowsPrec :: Int -> GetReplicationJobsResponse -> ShowS
Prelude.Show, (forall x.
 GetReplicationJobsResponse -> Rep GetReplicationJobsResponse x)
-> (forall x.
    Rep GetReplicationJobsResponse x -> GetReplicationJobsResponse)
-> Generic GetReplicationJobsResponse
forall x.
Rep GetReplicationJobsResponse x -> GetReplicationJobsResponse
forall x.
GetReplicationJobsResponse -> Rep GetReplicationJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetReplicationJobsResponse x -> GetReplicationJobsResponse
$cfrom :: forall x.
GetReplicationJobsResponse -> Rep GetReplicationJobsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetReplicationJobsResponse' 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:
--
-- 'replicationJobList', 'getReplicationJobsResponse_replicationJobList' - Information about the replication jobs.
--
-- 'nextToken', 'getReplicationJobsResponse_nextToken' - The token required to retrieve the next set of results. This value is
-- null when there are no more results to return.
--
-- 'httpStatus', 'getReplicationJobsResponse_httpStatus' - The response's http status code.
newGetReplicationJobsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetReplicationJobsResponse
newGetReplicationJobsResponse :: Int -> GetReplicationJobsResponse
newGetReplicationJobsResponse Int
pHttpStatus_ =
  GetReplicationJobsResponse' :: Maybe [ReplicationJob]
-> Maybe Text -> Int -> GetReplicationJobsResponse
GetReplicationJobsResponse'
    { $sel:replicationJobList:GetReplicationJobsResponse' :: Maybe [ReplicationJob]
replicationJobList =
        Maybe [ReplicationJob]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetReplicationJobsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetReplicationJobsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the replication jobs.
getReplicationJobsResponse_replicationJobList :: Lens.Lens' GetReplicationJobsResponse (Prelude.Maybe [ReplicationJob])
getReplicationJobsResponse_replicationJobList :: (Maybe [ReplicationJob] -> f (Maybe [ReplicationJob]))
-> GetReplicationJobsResponse -> f GetReplicationJobsResponse
getReplicationJobsResponse_replicationJobList = (GetReplicationJobsResponse -> Maybe [ReplicationJob])
-> (GetReplicationJobsResponse
    -> Maybe [ReplicationJob] -> GetReplicationJobsResponse)
-> Lens' GetReplicationJobsResponse (Maybe [ReplicationJob])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReplicationJobsResponse' {Maybe [ReplicationJob]
replicationJobList :: Maybe [ReplicationJob]
$sel:replicationJobList:GetReplicationJobsResponse' :: GetReplicationJobsResponse -> Maybe [ReplicationJob]
replicationJobList} -> Maybe [ReplicationJob]
replicationJobList) (\s :: GetReplicationJobsResponse
s@GetReplicationJobsResponse' {} Maybe [ReplicationJob]
a -> GetReplicationJobsResponse
s {$sel:replicationJobList:GetReplicationJobsResponse' :: Maybe [ReplicationJob]
replicationJobList = Maybe [ReplicationJob]
a} :: GetReplicationJobsResponse) ((Maybe [ReplicationJob] -> f (Maybe [ReplicationJob]))
 -> GetReplicationJobsResponse -> f GetReplicationJobsResponse)
-> ((Maybe [ReplicationJob] -> f (Maybe [ReplicationJob]))
    -> Maybe [ReplicationJob] -> f (Maybe [ReplicationJob]))
-> (Maybe [ReplicationJob] -> f (Maybe [ReplicationJob]))
-> GetReplicationJobsResponse
-> f GetReplicationJobsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ReplicationJob] [ReplicationJob] [ReplicationJob] [ReplicationJob]
-> Iso
     (Maybe [ReplicationJob])
     (Maybe [ReplicationJob])
     (Maybe [ReplicationJob])
     (Maybe [ReplicationJob])
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
  [ReplicationJob] [ReplicationJob] [ReplicationJob] [ReplicationJob]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token required to retrieve the next set of results. This value is
-- null when there are no more results to return.
getReplicationJobsResponse_nextToken :: Lens.Lens' GetReplicationJobsResponse (Prelude.Maybe Prelude.Text)
getReplicationJobsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetReplicationJobsResponse -> f GetReplicationJobsResponse
getReplicationJobsResponse_nextToken = (GetReplicationJobsResponse -> Maybe Text)
-> (GetReplicationJobsResponse
    -> Maybe Text -> GetReplicationJobsResponse)
-> Lens' GetReplicationJobsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReplicationJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetReplicationJobsResponse' :: GetReplicationJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetReplicationJobsResponse
s@GetReplicationJobsResponse' {} Maybe Text
a -> GetReplicationJobsResponse
s {$sel:nextToken:GetReplicationJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetReplicationJobsResponse)

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

instance Prelude.NFData GetReplicationJobsResponse