{-# 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.GetReplicationRuns
-- 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 replication runs for the specified replication job.
--
-- This operation returns paginated results.
module Amazonka.SMS.GetReplicationRuns
  ( -- * Creating a Request
    GetReplicationRuns (..),
    newGetReplicationRuns,

    -- * Request Lenses
    getReplicationRuns_nextToken,
    getReplicationRuns_maxResults,
    getReplicationRuns_replicationJobId,

    -- * Destructuring the Response
    GetReplicationRunsResponse (..),
    newGetReplicationRunsResponse,

    -- * Response Lenses
    getReplicationRunsResponse_replicationJob,
    getReplicationRunsResponse_nextToken,
    getReplicationRunsResponse_replicationRunList,
    getReplicationRunsResponse_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:/ 'newGetReplicationRuns' smart constructor.
data GetReplicationRuns = GetReplicationRuns'
  { -- | The token for the next set of results.
    GetReplicationRuns -> 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.
    GetReplicationRuns -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The ID of the replication job.
    GetReplicationRuns -> Text
replicationJobId :: Prelude.Text
  }
  deriving (GetReplicationRuns -> GetReplicationRuns -> Bool
(GetReplicationRuns -> GetReplicationRuns -> Bool)
-> (GetReplicationRuns -> GetReplicationRuns -> Bool)
-> Eq GetReplicationRuns
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetReplicationRuns -> GetReplicationRuns -> Bool
$c/= :: GetReplicationRuns -> GetReplicationRuns -> Bool
== :: GetReplicationRuns -> GetReplicationRuns -> Bool
$c== :: GetReplicationRuns -> GetReplicationRuns -> Bool
Prelude.Eq, ReadPrec [GetReplicationRuns]
ReadPrec GetReplicationRuns
Int -> ReadS GetReplicationRuns
ReadS [GetReplicationRuns]
(Int -> ReadS GetReplicationRuns)
-> ReadS [GetReplicationRuns]
-> ReadPrec GetReplicationRuns
-> ReadPrec [GetReplicationRuns]
-> Read GetReplicationRuns
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetReplicationRuns]
$creadListPrec :: ReadPrec [GetReplicationRuns]
readPrec :: ReadPrec GetReplicationRuns
$creadPrec :: ReadPrec GetReplicationRuns
readList :: ReadS [GetReplicationRuns]
$creadList :: ReadS [GetReplicationRuns]
readsPrec :: Int -> ReadS GetReplicationRuns
$creadsPrec :: Int -> ReadS GetReplicationRuns
Prelude.Read, Int -> GetReplicationRuns -> ShowS
[GetReplicationRuns] -> ShowS
GetReplicationRuns -> String
(Int -> GetReplicationRuns -> ShowS)
-> (GetReplicationRuns -> String)
-> ([GetReplicationRuns] -> ShowS)
-> Show GetReplicationRuns
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReplicationRuns] -> ShowS
$cshowList :: [GetReplicationRuns] -> ShowS
show :: GetReplicationRuns -> String
$cshow :: GetReplicationRuns -> String
showsPrec :: Int -> GetReplicationRuns -> ShowS
$cshowsPrec :: Int -> GetReplicationRuns -> ShowS
Prelude.Show, (forall x. GetReplicationRuns -> Rep GetReplicationRuns x)
-> (forall x. Rep GetReplicationRuns x -> GetReplicationRuns)
-> Generic GetReplicationRuns
forall x. Rep GetReplicationRuns x -> GetReplicationRuns
forall x. GetReplicationRuns -> Rep GetReplicationRuns x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetReplicationRuns x -> GetReplicationRuns
$cfrom :: forall x. GetReplicationRuns -> Rep GetReplicationRuns x
Prelude.Generic)

-- |
-- Create a value of 'GetReplicationRuns' 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', 'getReplicationRuns_nextToken' - The token for the next set of results.
--
-- 'maxResults', 'getReplicationRuns_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.
--
-- 'replicationJobId', 'getReplicationRuns_replicationJobId' - The ID of the replication job.
newGetReplicationRuns ::
  -- | 'replicationJobId'
  Prelude.Text ->
  GetReplicationRuns
newGetReplicationRuns :: Text -> GetReplicationRuns
newGetReplicationRuns Text
pReplicationJobId_ =
  GetReplicationRuns' :: Maybe Text -> Maybe Int -> Text -> GetReplicationRuns
GetReplicationRuns'
    { $sel:nextToken:GetReplicationRuns' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetReplicationRuns' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:replicationJobId:GetReplicationRuns' :: Text
replicationJobId = Text
pReplicationJobId_
    }

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

-- | 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.
getReplicationRuns_maxResults :: Lens.Lens' GetReplicationRuns (Prelude.Maybe Prelude.Int)
getReplicationRuns_maxResults :: (Maybe Int -> f (Maybe Int))
-> GetReplicationRuns -> f GetReplicationRuns
getReplicationRuns_maxResults = (GetReplicationRuns -> Maybe Int)
-> (GetReplicationRuns -> Maybe Int -> GetReplicationRuns)
-> Lens
     GetReplicationRuns GetReplicationRuns (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReplicationRuns' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:GetReplicationRuns' :: GetReplicationRuns -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: GetReplicationRuns
s@GetReplicationRuns' {} Maybe Int
a -> GetReplicationRuns
s {$sel:maxResults:GetReplicationRuns' :: Maybe Int
maxResults = Maybe Int
a} :: GetReplicationRuns)

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

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

instance Prelude.NFData GetReplicationRuns

instance Core.ToHeaders GetReplicationRuns where
  toHeaders :: GetReplicationRuns -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetReplicationRuns -> 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.GetReplicationRuns" ::
                          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 GetReplicationRuns where
  toJSON :: GetReplicationRuns -> Value
toJSON GetReplicationRuns' {Maybe Int
Maybe Text
Text
replicationJobId :: Text
maxResults :: Maybe Int
nextToken :: Maybe Text
$sel:replicationJobId:GetReplicationRuns' :: GetReplicationRuns -> Text
$sel:maxResults:GetReplicationRuns' :: GetReplicationRuns -> Maybe Int
$sel:nextToken:GetReplicationRuns' :: GetReplicationRuns -> 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 -> 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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"replicationJobId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
replicationJobId)
          ]
      )

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

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

-- | /See:/ 'newGetReplicationRunsResponse' smart constructor.
data GetReplicationRunsResponse = GetReplicationRunsResponse'
  { -- | Information about the replication job.
    GetReplicationRunsResponse -> Maybe ReplicationJob
replicationJob :: 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.
    GetReplicationRunsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about the replication runs.
    GetReplicationRunsResponse -> Maybe [ReplicationRun]
replicationRunList :: Prelude.Maybe [ReplicationRun],
    -- | The response's http status code.
    GetReplicationRunsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetReplicationRunsResponse -> GetReplicationRunsResponse -> Bool
(GetReplicationRunsResponse -> GetReplicationRunsResponse -> Bool)
-> (GetReplicationRunsResponse
    -> GetReplicationRunsResponse -> Bool)
-> Eq GetReplicationRunsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetReplicationRunsResponse -> GetReplicationRunsResponse -> Bool
$c/= :: GetReplicationRunsResponse -> GetReplicationRunsResponse -> Bool
== :: GetReplicationRunsResponse -> GetReplicationRunsResponse -> Bool
$c== :: GetReplicationRunsResponse -> GetReplicationRunsResponse -> Bool
Prelude.Eq, ReadPrec [GetReplicationRunsResponse]
ReadPrec GetReplicationRunsResponse
Int -> ReadS GetReplicationRunsResponse
ReadS [GetReplicationRunsResponse]
(Int -> ReadS GetReplicationRunsResponse)
-> ReadS [GetReplicationRunsResponse]
-> ReadPrec GetReplicationRunsResponse
-> ReadPrec [GetReplicationRunsResponse]
-> Read GetReplicationRunsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetReplicationRunsResponse]
$creadListPrec :: ReadPrec [GetReplicationRunsResponse]
readPrec :: ReadPrec GetReplicationRunsResponse
$creadPrec :: ReadPrec GetReplicationRunsResponse
readList :: ReadS [GetReplicationRunsResponse]
$creadList :: ReadS [GetReplicationRunsResponse]
readsPrec :: Int -> ReadS GetReplicationRunsResponse
$creadsPrec :: Int -> ReadS GetReplicationRunsResponse
Prelude.Read, Int -> GetReplicationRunsResponse -> ShowS
[GetReplicationRunsResponse] -> ShowS
GetReplicationRunsResponse -> String
(Int -> GetReplicationRunsResponse -> ShowS)
-> (GetReplicationRunsResponse -> String)
-> ([GetReplicationRunsResponse] -> ShowS)
-> Show GetReplicationRunsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReplicationRunsResponse] -> ShowS
$cshowList :: [GetReplicationRunsResponse] -> ShowS
show :: GetReplicationRunsResponse -> String
$cshow :: GetReplicationRunsResponse -> String
showsPrec :: Int -> GetReplicationRunsResponse -> ShowS
$cshowsPrec :: Int -> GetReplicationRunsResponse -> ShowS
Prelude.Show, (forall x.
 GetReplicationRunsResponse -> Rep GetReplicationRunsResponse x)
-> (forall x.
    Rep GetReplicationRunsResponse x -> GetReplicationRunsResponse)
-> Generic GetReplicationRunsResponse
forall x.
Rep GetReplicationRunsResponse x -> GetReplicationRunsResponse
forall x.
GetReplicationRunsResponse -> Rep GetReplicationRunsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetReplicationRunsResponse x -> GetReplicationRunsResponse
$cfrom :: forall x.
GetReplicationRunsResponse -> Rep GetReplicationRunsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetReplicationRunsResponse' 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:
--
-- 'replicationJob', 'getReplicationRunsResponse_replicationJob' - Information about the replication job.
--
-- 'nextToken', 'getReplicationRunsResponse_nextToken' - The token required to retrieve the next set of results. This value is
-- null when there are no more results to return.
--
-- 'replicationRunList', 'getReplicationRunsResponse_replicationRunList' - Information about the replication runs.
--
-- 'httpStatus', 'getReplicationRunsResponse_httpStatus' - The response's http status code.
newGetReplicationRunsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetReplicationRunsResponse
newGetReplicationRunsResponse :: Int -> GetReplicationRunsResponse
newGetReplicationRunsResponse Int
pHttpStatus_ =
  GetReplicationRunsResponse' :: Maybe ReplicationJob
-> Maybe Text
-> Maybe [ReplicationRun]
-> Int
-> GetReplicationRunsResponse
GetReplicationRunsResponse'
    { $sel:replicationJob:GetReplicationRunsResponse' :: Maybe ReplicationJob
replicationJob =
        Maybe ReplicationJob
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetReplicationRunsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:replicationRunList:GetReplicationRunsResponse' :: Maybe [ReplicationRun]
replicationRunList = Maybe [ReplicationRun]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetReplicationRunsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the replication job.
getReplicationRunsResponse_replicationJob :: Lens.Lens' GetReplicationRunsResponse (Prelude.Maybe ReplicationJob)
getReplicationRunsResponse_replicationJob :: (Maybe ReplicationJob -> f (Maybe ReplicationJob))
-> GetReplicationRunsResponse -> f GetReplicationRunsResponse
getReplicationRunsResponse_replicationJob = (GetReplicationRunsResponse -> Maybe ReplicationJob)
-> (GetReplicationRunsResponse
    -> Maybe ReplicationJob -> GetReplicationRunsResponse)
-> Lens
     GetReplicationRunsResponse
     GetReplicationRunsResponse
     (Maybe ReplicationJob)
     (Maybe ReplicationJob)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReplicationRunsResponse' {Maybe ReplicationJob
replicationJob :: Maybe ReplicationJob
$sel:replicationJob:GetReplicationRunsResponse' :: GetReplicationRunsResponse -> Maybe ReplicationJob
replicationJob} -> Maybe ReplicationJob
replicationJob) (\s :: GetReplicationRunsResponse
s@GetReplicationRunsResponse' {} Maybe ReplicationJob
a -> GetReplicationRunsResponse
s {$sel:replicationJob:GetReplicationRunsResponse' :: Maybe ReplicationJob
replicationJob = Maybe ReplicationJob
a} :: GetReplicationRunsResponse)

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

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

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

instance Prelude.NFData GetReplicationRunsResponse