{-# 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.DMS.CreateReplicationTask
-- 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)
--
-- Creates a replication task using the specified parameters.
module Amazonka.DMS.CreateReplicationTask
  ( -- * Creating a Request
    CreateReplicationTask (..),
    newCreateReplicationTask,

    -- * Request Lenses
    createReplicationTask_replicationTaskSettings,
    createReplicationTask_cdcStartPosition,
    createReplicationTask_taskData,
    createReplicationTask_cdcStopPosition,
    createReplicationTask_resourceIdentifier,
    createReplicationTask_tags,
    createReplicationTask_cdcStartTime,
    createReplicationTask_replicationTaskIdentifier,
    createReplicationTask_sourceEndpointArn,
    createReplicationTask_targetEndpointArn,
    createReplicationTask_replicationInstanceArn,
    createReplicationTask_migrationType,
    createReplicationTask_tableMappings,

    -- * Destructuring the Response
    CreateReplicationTaskResponse (..),
    newCreateReplicationTaskResponse,

    -- * Response Lenses
    createReplicationTaskResponse_replicationTask,
    createReplicationTaskResponse_httpStatus,
  )
where

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

-- |
--
-- /See:/ 'newCreateReplicationTask' smart constructor.
data CreateReplicationTask = CreateReplicationTask'
  { -- | Overall settings for the task, in JSON format. For more information, see
    -- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html Specifying Task Settings for Database Migration Service Tasks>
    -- in the /Database Migration Service User Guide./
    CreateReplicationTask -> Maybe Text
replicationTaskSettings :: Prelude.Maybe Prelude.Text,
    -- | Indicates when you want a change data capture (CDC) operation to start.
    -- Use either CdcStartPosition or CdcStartTime to specify when you want a
    -- CDC operation to start. Specifying both values results in an error.
    --
    -- The value can be in date, checkpoint, or LSN\/SCN format.
    --
    -- Date Example: --cdc-start-position “2018-03-08T12:12:12”
    --
    -- Checkpoint Example: --cdc-start-position
    -- \"checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93\"
    --
    -- LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”
    --
    -- When you use this task setting with a source PostgreSQL database, a
    -- logical replication slot should already be created and associated with
    -- the source endpoint. You can verify this by setting the @slotName@ extra
    -- connection attribute to the name of this logical replication slot. For
    -- more information, see
    -- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html#CHAP_Source.PostgreSQL.ConnectionAttrib Extra Connection Attributes When Using PostgreSQL as a Source for DMS>.
    CreateReplicationTask -> Maybe Text
cdcStartPosition :: Prelude.Maybe Prelude.Text,
    -- | Supplemental information that the task requires to migrate the data for
    -- certain source and target endpoints. For more information, see
    -- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.TaskData.html Specifying Supplemental Data for Task Settings>
    -- in the /Database Migration Service User Guide./
    CreateReplicationTask -> Maybe Text
taskData :: Prelude.Maybe Prelude.Text,
    -- | Indicates when you want a change data capture (CDC) operation to stop.
    -- The value can be either server time or commit time.
    --
    -- Server time example: --cdc-stop-position
    -- “server_time:2018-02-09T12:12:12”
    --
    -- Commit time example: --cdc-stop-position “commit_time:
    -- 2018-02-09T12:12:12 “
    CreateReplicationTask -> Maybe Text
cdcStopPosition :: Prelude.Maybe Prelude.Text,
    -- | A friendly name for the resource identifier at the end of the
    -- @EndpointArn@ response parameter that is returned in the created
    -- @Endpoint@ object. The value for this parameter can have up to 31
    -- characters. It can contain only ASCII letters, digits, and hyphen
    -- (\'-\'). Also, it can\'t end with a hyphen or contain two consecutive
    -- hyphens, and can only begin with a letter, such as @Example-App-ARN1@.
    -- For example, this value might result in the @EndpointArn@ value
    -- @arn:aws:dms:eu-west-1:012345678901:rep:Example-App-ARN1@. If you don\'t
    -- specify a @ResourceIdentifier@ value, DMS generates a default identifier
    -- value for the end of @EndpointArn@.
    CreateReplicationTask -> Maybe Text
resourceIdentifier :: Prelude.Maybe Prelude.Text,
    -- | One or more tags to be assigned to the replication task.
    CreateReplicationTask -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | Indicates the start time for a change data capture (CDC) operation. Use
    -- either CdcStartTime or CdcStartPosition to specify when you want a CDC
    -- operation to start. Specifying both values results in an error.
    --
    -- Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”
    CreateReplicationTask -> Maybe POSIX
cdcStartTime :: Prelude.Maybe Core.POSIX,
    -- | An identifier for the replication task.
    --
    -- Constraints:
    --
    -- -   Must contain 1-255 alphanumeric characters or hyphens.
    --
    -- -   First character must be a letter.
    --
    -- -   Cannot end with a hyphen or contain two consecutive hyphens.
    CreateReplicationTask -> Text
replicationTaskIdentifier :: Prelude.Text,
    -- | An Amazon Resource Name (ARN) that uniquely identifies the source
    -- endpoint.
    CreateReplicationTask -> Text
sourceEndpointArn :: Prelude.Text,
    -- | An Amazon Resource Name (ARN) that uniquely identifies the target
    -- endpoint.
    CreateReplicationTask -> Text
targetEndpointArn :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of a replication instance.
    CreateReplicationTask -> Text
replicationInstanceArn :: Prelude.Text,
    -- | The migration type. Valid values: @full-load@ | @cdc@ |
    -- @full-load-and-cdc@
    CreateReplicationTask -> MigrationTypeValue
migrationType :: MigrationTypeValue,
    -- | The table mappings for the task, in JSON format. For more information,
    -- see
    -- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.html Using Table Mapping to Specify Task Settings>
    -- in the /Database Migration Service User Guide./
    CreateReplicationTask -> Text
tableMappings :: Prelude.Text
  }
  deriving (CreateReplicationTask -> CreateReplicationTask -> Bool
(CreateReplicationTask -> CreateReplicationTask -> Bool)
-> (CreateReplicationTask -> CreateReplicationTask -> Bool)
-> Eq CreateReplicationTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateReplicationTask -> CreateReplicationTask -> Bool
$c/= :: CreateReplicationTask -> CreateReplicationTask -> Bool
== :: CreateReplicationTask -> CreateReplicationTask -> Bool
$c== :: CreateReplicationTask -> CreateReplicationTask -> Bool
Prelude.Eq, ReadPrec [CreateReplicationTask]
ReadPrec CreateReplicationTask
Int -> ReadS CreateReplicationTask
ReadS [CreateReplicationTask]
(Int -> ReadS CreateReplicationTask)
-> ReadS [CreateReplicationTask]
-> ReadPrec CreateReplicationTask
-> ReadPrec [CreateReplicationTask]
-> Read CreateReplicationTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateReplicationTask]
$creadListPrec :: ReadPrec [CreateReplicationTask]
readPrec :: ReadPrec CreateReplicationTask
$creadPrec :: ReadPrec CreateReplicationTask
readList :: ReadS [CreateReplicationTask]
$creadList :: ReadS [CreateReplicationTask]
readsPrec :: Int -> ReadS CreateReplicationTask
$creadsPrec :: Int -> ReadS CreateReplicationTask
Prelude.Read, Int -> CreateReplicationTask -> ShowS
[CreateReplicationTask] -> ShowS
CreateReplicationTask -> String
(Int -> CreateReplicationTask -> ShowS)
-> (CreateReplicationTask -> String)
-> ([CreateReplicationTask] -> ShowS)
-> Show CreateReplicationTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateReplicationTask] -> ShowS
$cshowList :: [CreateReplicationTask] -> ShowS
show :: CreateReplicationTask -> String
$cshow :: CreateReplicationTask -> String
showsPrec :: Int -> CreateReplicationTask -> ShowS
$cshowsPrec :: Int -> CreateReplicationTask -> ShowS
Prelude.Show, (forall x. CreateReplicationTask -> Rep CreateReplicationTask x)
-> (forall x. Rep CreateReplicationTask x -> CreateReplicationTask)
-> Generic CreateReplicationTask
forall x. Rep CreateReplicationTask x -> CreateReplicationTask
forall x. CreateReplicationTask -> Rep CreateReplicationTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateReplicationTask x -> CreateReplicationTask
$cfrom :: forall x. CreateReplicationTask -> Rep CreateReplicationTask x
Prelude.Generic)

-- |
-- Create a value of 'CreateReplicationTask' 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:
--
-- 'replicationTaskSettings', 'createReplicationTask_replicationTaskSettings' - Overall settings for the task, in JSON format. For more information, see
-- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html Specifying Task Settings for Database Migration Service Tasks>
-- in the /Database Migration Service User Guide./
--
-- 'cdcStartPosition', 'createReplicationTask_cdcStartPosition' - Indicates when you want a change data capture (CDC) operation to start.
-- Use either CdcStartPosition or CdcStartTime to specify when you want a
-- CDC operation to start. Specifying both values results in an error.
--
-- The value can be in date, checkpoint, or LSN\/SCN format.
--
-- Date Example: --cdc-start-position “2018-03-08T12:12:12”
--
-- Checkpoint Example: --cdc-start-position
-- \"checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93\"
--
-- LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”
--
-- When you use this task setting with a source PostgreSQL database, a
-- logical replication slot should already be created and associated with
-- the source endpoint. You can verify this by setting the @slotName@ extra
-- connection attribute to the name of this logical replication slot. For
-- more information, see
-- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html#CHAP_Source.PostgreSQL.ConnectionAttrib Extra Connection Attributes When Using PostgreSQL as a Source for DMS>.
--
-- 'taskData', 'createReplicationTask_taskData' - Supplemental information that the task requires to migrate the data for
-- certain source and target endpoints. For more information, see
-- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.TaskData.html Specifying Supplemental Data for Task Settings>
-- in the /Database Migration Service User Guide./
--
-- 'cdcStopPosition', 'createReplicationTask_cdcStopPosition' - Indicates when you want a change data capture (CDC) operation to stop.
-- The value can be either server time or commit time.
--
-- Server time example: --cdc-stop-position
-- “server_time:2018-02-09T12:12:12”
--
-- Commit time example: --cdc-stop-position “commit_time:
-- 2018-02-09T12:12:12 “
--
-- 'resourceIdentifier', 'createReplicationTask_resourceIdentifier' - A friendly name for the resource identifier at the end of the
-- @EndpointArn@ response parameter that is returned in the created
-- @Endpoint@ object. The value for this parameter can have up to 31
-- characters. It can contain only ASCII letters, digits, and hyphen
-- (\'-\'). Also, it can\'t end with a hyphen or contain two consecutive
-- hyphens, and can only begin with a letter, such as @Example-App-ARN1@.
-- For example, this value might result in the @EndpointArn@ value
-- @arn:aws:dms:eu-west-1:012345678901:rep:Example-App-ARN1@. If you don\'t
-- specify a @ResourceIdentifier@ value, DMS generates a default identifier
-- value for the end of @EndpointArn@.
--
-- 'tags', 'createReplicationTask_tags' - One or more tags to be assigned to the replication task.
--
-- 'cdcStartTime', 'createReplicationTask_cdcStartTime' - Indicates the start time for a change data capture (CDC) operation. Use
-- either CdcStartTime or CdcStartPosition to specify when you want a CDC
-- operation to start. Specifying both values results in an error.
--
-- Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”
--
-- 'replicationTaskIdentifier', 'createReplicationTask_replicationTaskIdentifier' - An identifier for the replication task.
--
-- Constraints:
--
-- -   Must contain 1-255 alphanumeric characters or hyphens.
--
-- -   First character must be a letter.
--
-- -   Cannot end with a hyphen or contain two consecutive hyphens.
--
-- 'sourceEndpointArn', 'createReplicationTask_sourceEndpointArn' - An Amazon Resource Name (ARN) that uniquely identifies the source
-- endpoint.
--
-- 'targetEndpointArn', 'createReplicationTask_targetEndpointArn' - An Amazon Resource Name (ARN) that uniquely identifies the target
-- endpoint.
--
-- 'replicationInstanceArn', 'createReplicationTask_replicationInstanceArn' - The Amazon Resource Name (ARN) of a replication instance.
--
-- 'migrationType', 'createReplicationTask_migrationType' - The migration type. Valid values: @full-load@ | @cdc@ |
-- @full-load-and-cdc@
--
-- 'tableMappings', 'createReplicationTask_tableMappings' - The table mappings for the task, in JSON format. For more information,
-- see
-- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.html Using Table Mapping to Specify Task Settings>
-- in the /Database Migration Service User Guide./
newCreateReplicationTask ::
  -- | 'replicationTaskIdentifier'
  Prelude.Text ->
  -- | 'sourceEndpointArn'
  Prelude.Text ->
  -- | 'targetEndpointArn'
  Prelude.Text ->
  -- | 'replicationInstanceArn'
  Prelude.Text ->
  -- | 'migrationType'
  MigrationTypeValue ->
  -- | 'tableMappings'
  Prelude.Text ->
  CreateReplicationTask
newCreateReplicationTask :: Text
-> Text
-> Text
-> Text
-> MigrationTypeValue
-> Text
-> CreateReplicationTask
newCreateReplicationTask
  Text
pReplicationTaskIdentifier_
  Text
pSourceEndpointArn_
  Text
pTargetEndpointArn_
  Text
pReplicationInstanceArn_
  MigrationTypeValue
pMigrationType_
  Text
pTableMappings_ =
    CreateReplicationTask' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Maybe POSIX
-> Text
-> Text
-> Text
-> Text
-> MigrationTypeValue
-> Text
-> CreateReplicationTask
CreateReplicationTask'
      { $sel:replicationTaskSettings:CreateReplicationTask' :: Maybe Text
replicationTaskSettings =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:cdcStartPosition:CreateReplicationTask' :: Maybe Text
cdcStartPosition = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:taskData:CreateReplicationTask' :: Maybe Text
taskData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:cdcStopPosition:CreateReplicationTask' :: Maybe Text
cdcStopPosition = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:resourceIdentifier:CreateReplicationTask' :: Maybe Text
resourceIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateReplicationTask' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:cdcStartTime:CreateReplicationTask' :: Maybe POSIX
cdcStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:replicationTaskIdentifier:CreateReplicationTask' :: Text
replicationTaskIdentifier =
          Text
pReplicationTaskIdentifier_,
        $sel:sourceEndpointArn:CreateReplicationTask' :: Text
sourceEndpointArn = Text
pSourceEndpointArn_,
        $sel:targetEndpointArn:CreateReplicationTask' :: Text
targetEndpointArn = Text
pTargetEndpointArn_,
        $sel:replicationInstanceArn:CreateReplicationTask' :: Text
replicationInstanceArn = Text
pReplicationInstanceArn_,
        $sel:migrationType:CreateReplicationTask' :: MigrationTypeValue
migrationType = MigrationTypeValue
pMigrationType_,
        $sel:tableMappings:CreateReplicationTask' :: Text
tableMappings = Text
pTableMappings_
      }

-- | Overall settings for the task, in JSON format. For more information, see
-- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html Specifying Task Settings for Database Migration Service Tasks>
-- in the /Database Migration Service User Guide./
createReplicationTask_replicationTaskSettings :: Lens.Lens' CreateReplicationTask (Prelude.Maybe Prelude.Text)
createReplicationTask_replicationTaskSettings :: (Maybe Text -> f (Maybe Text))
-> CreateReplicationTask -> f CreateReplicationTask
createReplicationTask_replicationTaskSettings = (CreateReplicationTask -> Maybe Text)
-> (CreateReplicationTask -> Maybe Text -> CreateReplicationTask)
-> Lens
     CreateReplicationTask
     CreateReplicationTask
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationTask' {Maybe Text
replicationTaskSettings :: Maybe Text
$sel:replicationTaskSettings:CreateReplicationTask' :: CreateReplicationTask -> Maybe Text
replicationTaskSettings} -> Maybe Text
replicationTaskSettings) (\s :: CreateReplicationTask
s@CreateReplicationTask' {} Maybe Text
a -> CreateReplicationTask
s {$sel:replicationTaskSettings:CreateReplicationTask' :: Maybe Text
replicationTaskSettings = Maybe Text
a} :: CreateReplicationTask)

-- | Indicates when you want a change data capture (CDC) operation to start.
-- Use either CdcStartPosition or CdcStartTime to specify when you want a
-- CDC operation to start. Specifying both values results in an error.
--
-- The value can be in date, checkpoint, or LSN\/SCN format.
--
-- Date Example: --cdc-start-position “2018-03-08T12:12:12”
--
-- Checkpoint Example: --cdc-start-position
-- \"checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93\"
--
-- LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”
--
-- When you use this task setting with a source PostgreSQL database, a
-- logical replication slot should already be created and associated with
-- the source endpoint. You can verify this by setting the @slotName@ extra
-- connection attribute to the name of this logical replication slot. For
-- more information, see
-- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html#CHAP_Source.PostgreSQL.ConnectionAttrib Extra Connection Attributes When Using PostgreSQL as a Source for DMS>.
createReplicationTask_cdcStartPosition :: Lens.Lens' CreateReplicationTask (Prelude.Maybe Prelude.Text)
createReplicationTask_cdcStartPosition :: (Maybe Text -> f (Maybe Text))
-> CreateReplicationTask -> f CreateReplicationTask
createReplicationTask_cdcStartPosition = (CreateReplicationTask -> Maybe Text)
-> (CreateReplicationTask -> Maybe Text -> CreateReplicationTask)
-> Lens
     CreateReplicationTask
     CreateReplicationTask
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationTask' {Maybe Text
cdcStartPosition :: Maybe Text
$sel:cdcStartPosition:CreateReplicationTask' :: CreateReplicationTask -> Maybe Text
cdcStartPosition} -> Maybe Text
cdcStartPosition) (\s :: CreateReplicationTask
s@CreateReplicationTask' {} Maybe Text
a -> CreateReplicationTask
s {$sel:cdcStartPosition:CreateReplicationTask' :: Maybe Text
cdcStartPosition = Maybe Text
a} :: CreateReplicationTask)

-- | Supplemental information that the task requires to migrate the data for
-- certain source and target endpoints. For more information, see
-- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.TaskData.html Specifying Supplemental Data for Task Settings>
-- in the /Database Migration Service User Guide./
createReplicationTask_taskData :: Lens.Lens' CreateReplicationTask (Prelude.Maybe Prelude.Text)
createReplicationTask_taskData :: (Maybe Text -> f (Maybe Text))
-> CreateReplicationTask -> f CreateReplicationTask
createReplicationTask_taskData = (CreateReplicationTask -> Maybe Text)
-> (CreateReplicationTask -> Maybe Text -> CreateReplicationTask)
-> Lens
     CreateReplicationTask
     CreateReplicationTask
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationTask' {Maybe Text
taskData :: Maybe Text
$sel:taskData:CreateReplicationTask' :: CreateReplicationTask -> Maybe Text
taskData} -> Maybe Text
taskData) (\s :: CreateReplicationTask
s@CreateReplicationTask' {} Maybe Text
a -> CreateReplicationTask
s {$sel:taskData:CreateReplicationTask' :: Maybe Text
taskData = Maybe Text
a} :: CreateReplicationTask)

-- | Indicates when you want a change data capture (CDC) operation to stop.
-- The value can be either server time or commit time.
--
-- Server time example: --cdc-stop-position
-- “server_time:2018-02-09T12:12:12”
--
-- Commit time example: --cdc-stop-position “commit_time:
-- 2018-02-09T12:12:12 “
createReplicationTask_cdcStopPosition :: Lens.Lens' CreateReplicationTask (Prelude.Maybe Prelude.Text)
createReplicationTask_cdcStopPosition :: (Maybe Text -> f (Maybe Text))
-> CreateReplicationTask -> f CreateReplicationTask
createReplicationTask_cdcStopPosition = (CreateReplicationTask -> Maybe Text)
-> (CreateReplicationTask -> Maybe Text -> CreateReplicationTask)
-> Lens
     CreateReplicationTask
     CreateReplicationTask
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationTask' {Maybe Text
cdcStopPosition :: Maybe Text
$sel:cdcStopPosition:CreateReplicationTask' :: CreateReplicationTask -> Maybe Text
cdcStopPosition} -> Maybe Text
cdcStopPosition) (\s :: CreateReplicationTask
s@CreateReplicationTask' {} Maybe Text
a -> CreateReplicationTask
s {$sel:cdcStopPosition:CreateReplicationTask' :: Maybe Text
cdcStopPosition = Maybe Text
a} :: CreateReplicationTask)

-- | A friendly name for the resource identifier at the end of the
-- @EndpointArn@ response parameter that is returned in the created
-- @Endpoint@ object. The value for this parameter can have up to 31
-- characters. It can contain only ASCII letters, digits, and hyphen
-- (\'-\'). Also, it can\'t end with a hyphen or contain two consecutive
-- hyphens, and can only begin with a letter, such as @Example-App-ARN1@.
-- For example, this value might result in the @EndpointArn@ value
-- @arn:aws:dms:eu-west-1:012345678901:rep:Example-App-ARN1@. If you don\'t
-- specify a @ResourceIdentifier@ value, DMS generates a default identifier
-- value for the end of @EndpointArn@.
createReplicationTask_resourceIdentifier :: Lens.Lens' CreateReplicationTask (Prelude.Maybe Prelude.Text)
createReplicationTask_resourceIdentifier :: (Maybe Text -> f (Maybe Text))
-> CreateReplicationTask -> f CreateReplicationTask
createReplicationTask_resourceIdentifier = (CreateReplicationTask -> Maybe Text)
-> (CreateReplicationTask -> Maybe Text -> CreateReplicationTask)
-> Lens
     CreateReplicationTask
     CreateReplicationTask
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationTask' {Maybe Text
resourceIdentifier :: Maybe Text
$sel:resourceIdentifier:CreateReplicationTask' :: CreateReplicationTask -> Maybe Text
resourceIdentifier} -> Maybe Text
resourceIdentifier) (\s :: CreateReplicationTask
s@CreateReplicationTask' {} Maybe Text
a -> CreateReplicationTask
s {$sel:resourceIdentifier:CreateReplicationTask' :: Maybe Text
resourceIdentifier = Maybe Text
a} :: CreateReplicationTask)

-- | One or more tags to be assigned to the replication task.
createReplicationTask_tags :: Lens.Lens' CreateReplicationTask (Prelude.Maybe [Tag])
createReplicationTask_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateReplicationTask -> f CreateReplicationTask
createReplicationTask_tags = (CreateReplicationTask -> Maybe [Tag])
-> (CreateReplicationTask -> Maybe [Tag] -> CreateReplicationTask)
-> Lens
     CreateReplicationTask
     CreateReplicationTask
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationTask' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateReplicationTask' :: CreateReplicationTask -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateReplicationTask
s@CreateReplicationTask' {} Maybe [Tag]
a -> CreateReplicationTask
s {$sel:tags:CreateReplicationTask' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateReplicationTask) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateReplicationTask -> f CreateReplicationTask)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateReplicationTask
-> f CreateReplicationTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates the start time for a change data capture (CDC) operation. Use
-- either CdcStartTime or CdcStartPosition to specify when you want a CDC
-- operation to start. Specifying both values results in an error.
--
-- Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”
createReplicationTask_cdcStartTime :: Lens.Lens' CreateReplicationTask (Prelude.Maybe Prelude.UTCTime)
createReplicationTask_cdcStartTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateReplicationTask -> f CreateReplicationTask
createReplicationTask_cdcStartTime = (CreateReplicationTask -> Maybe POSIX)
-> (CreateReplicationTask -> Maybe POSIX -> CreateReplicationTask)
-> Lens
     CreateReplicationTask
     CreateReplicationTask
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationTask' {Maybe POSIX
cdcStartTime :: Maybe POSIX
$sel:cdcStartTime:CreateReplicationTask' :: CreateReplicationTask -> Maybe POSIX
cdcStartTime} -> Maybe POSIX
cdcStartTime) (\s :: CreateReplicationTask
s@CreateReplicationTask' {} Maybe POSIX
a -> CreateReplicationTask
s {$sel:cdcStartTime:CreateReplicationTask' :: Maybe POSIX
cdcStartTime = Maybe POSIX
a} :: CreateReplicationTask) ((Maybe POSIX -> f (Maybe POSIX))
 -> CreateReplicationTask -> f CreateReplicationTask)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateReplicationTask
-> f CreateReplicationTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | An identifier for the replication task.
--
-- Constraints:
--
-- -   Must contain 1-255 alphanumeric characters or hyphens.
--
-- -   First character must be a letter.
--
-- -   Cannot end with a hyphen or contain two consecutive hyphens.
createReplicationTask_replicationTaskIdentifier :: Lens.Lens' CreateReplicationTask Prelude.Text
createReplicationTask_replicationTaskIdentifier :: (Text -> f Text)
-> CreateReplicationTask -> f CreateReplicationTask
createReplicationTask_replicationTaskIdentifier = (CreateReplicationTask -> Text)
-> (CreateReplicationTask -> Text -> CreateReplicationTask)
-> Lens CreateReplicationTask CreateReplicationTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationTask' {Text
replicationTaskIdentifier :: Text
$sel:replicationTaskIdentifier:CreateReplicationTask' :: CreateReplicationTask -> Text
replicationTaskIdentifier} -> Text
replicationTaskIdentifier) (\s :: CreateReplicationTask
s@CreateReplicationTask' {} Text
a -> CreateReplicationTask
s {$sel:replicationTaskIdentifier:CreateReplicationTask' :: Text
replicationTaskIdentifier = Text
a} :: CreateReplicationTask)

-- | An Amazon Resource Name (ARN) that uniquely identifies the source
-- endpoint.
createReplicationTask_sourceEndpointArn :: Lens.Lens' CreateReplicationTask Prelude.Text
createReplicationTask_sourceEndpointArn :: (Text -> f Text)
-> CreateReplicationTask -> f CreateReplicationTask
createReplicationTask_sourceEndpointArn = (CreateReplicationTask -> Text)
-> (CreateReplicationTask -> Text -> CreateReplicationTask)
-> Lens CreateReplicationTask CreateReplicationTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationTask' {Text
sourceEndpointArn :: Text
$sel:sourceEndpointArn:CreateReplicationTask' :: CreateReplicationTask -> Text
sourceEndpointArn} -> Text
sourceEndpointArn) (\s :: CreateReplicationTask
s@CreateReplicationTask' {} Text
a -> CreateReplicationTask
s {$sel:sourceEndpointArn:CreateReplicationTask' :: Text
sourceEndpointArn = Text
a} :: CreateReplicationTask)

-- | An Amazon Resource Name (ARN) that uniquely identifies the target
-- endpoint.
createReplicationTask_targetEndpointArn :: Lens.Lens' CreateReplicationTask Prelude.Text
createReplicationTask_targetEndpointArn :: (Text -> f Text)
-> CreateReplicationTask -> f CreateReplicationTask
createReplicationTask_targetEndpointArn = (CreateReplicationTask -> Text)
-> (CreateReplicationTask -> Text -> CreateReplicationTask)
-> Lens CreateReplicationTask CreateReplicationTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationTask' {Text
targetEndpointArn :: Text
$sel:targetEndpointArn:CreateReplicationTask' :: CreateReplicationTask -> Text
targetEndpointArn} -> Text
targetEndpointArn) (\s :: CreateReplicationTask
s@CreateReplicationTask' {} Text
a -> CreateReplicationTask
s {$sel:targetEndpointArn:CreateReplicationTask' :: Text
targetEndpointArn = Text
a} :: CreateReplicationTask)

-- | The Amazon Resource Name (ARN) of a replication instance.
createReplicationTask_replicationInstanceArn :: Lens.Lens' CreateReplicationTask Prelude.Text
createReplicationTask_replicationInstanceArn :: (Text -> f Text)
-> CreateReplicationTask -> f CreateReplicationTask
createReplicationTask_replicationInstanceArn = (CreateReplicationTask -> Text)
-> (CreateReplicationTask -> Text -> CreateReplicationTask)
-> Lens CreateReplicationTask CreateReplicationTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationTask' {Text
replicationInstanceArn :: Text
$sel:replicationInstanceArn:CreateReplicationTask' :: CreateReplicationTask -> Text
replicationInstanceArn} -> Text
replicationInstanceArn) (\s :: CreateReplicationTask
s@CreateReplicationTask' {} Text
a -> CreateReplicationTask
s {$sel:replicationInstanceArn:CreateReplicationTask' :: Text
replicationInstanceArn = Text
a} :: CreateReplicationTask)

-- | The migration type. Valid values: @full-load@ | @cdc@ |
-- @full-load-and-cdc@
createReplicationTask_migrationType :: Lens.Lens' CreateReplicationTask MigrationTypeValue
createReplicationTask_migrationType :: (MigrationTypeValue -> f MigrationTypeValue)
-> CreateReplicationTask -> f CreateReplicationTask
createReplicationTask_migrationType = (CreateReplicationTask -> MigrationTypeValue)
-> (CreateReplicationTask
    -> MigrationTypeValue -> CreateReplicationTask)
-> Lens
     CreateReplicationTask
     CreateReplicationTask
     MigrationTypeValue
     MigrationTypeValue
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationTask' {MigrationTypeValue
migrationType :: MigrationTypeValue
$sel:migrationType:CreateReplicationTask' :: CreateReplicationTask -> MigrationTypeValue
migrationType} -> MigrationTypeValue
migrationType) (\s :: CreateReplicationTask
s@CreateReplicationTask' {} MigrationTypeValue
a -> CreateReplicationTask
s {$sel:migrationType:CreateReplicationTask' :: MigrationTypeValue
migrationType = MigrationTypeValue
a} :: CreateReplicationTask)

-- | The table mappings for the task, in JSON format. For more information,
-- see
-- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.html Using Table Mapping to Specify Task Settings>
-- in the /Database Migration Service User Guide./
createReplicationTask_tableMappings :: Lens.Lens' CreateReplicationTask Prelude.Text
createReplicationTask_tableMappings :: (Text -> f Text)
-> CreateReplicationTask -> f CreateReplicationTask
createReplicationTask_tableMappings = (CreateReplicationTask -> Text)
-> (CreateReplicationTask -> Text -> CreateReplicationTask)
-> Lens CreateReplicationTask CreateReplicationTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationTask' {Text
tableMappings :: Text
$sel:tableMappings:CreateReplicationTask' :: CreateReplicationTask -> Text
tableMappings} -> Text
tableMappings) (\s :: CreateReplicationTask
s@CreateReplicationTask' {} Text
a -> CreateReplicationTask
s {$sel:tableMappings:CreateReplicationTask' :: Text
tableMappings = Text
a} :: CreateReplicationTask)

instance Core.AWSRequest CreateReplicationTask where
  type
    AWSResponse CreateReplicationTask =
      CreateReplicationTaskResponse
  request :: CreateReplicationTask -> Request CreateReplicationTask
request = Service -> CreateReplicationTask -> Request CreateReplicationTask
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateReplicationTask
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateReplicationTask)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateReplicationTask))
-> Logger
-> Service
-> Proxy CreateReplicationTask
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateReplicationTask)))
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 ReplicationTask -> Int -> CreateReplicationTaskResponse
CreateReplicationTaskResponse'
            (Maybe ReplicationTask -> Int -> CreateReplicationTaskResponse)
-> Either String (Maybe ReplicationTask)
-> Either String (Int -> CreateReplicationTaskResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ReplicationTask)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ReplicationTask")
            Either String (Int -> CreateReplicationTaskResponse)
-> Either String Int -> Either String CreateReplicationTaskResponse
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 CreateReplicationTask

instance Prelude.NFData CreateReplicationTask

instance Core.ToHeaders CreateReplicationTask where
  toHeaders :: CreateReplicationTask -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateReplicationTask -> 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
"AmazonDMSv20160101.CreateReplicationTask" ::
                          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 CreateReplicationTask where
  toJSON :: CreateReplicationTask -> Value
toJSON CreateReplicationTask' {Maybe [Tag]
Maybe Text
Maybe POSIX
Text
MigrationTypeValue
tableMappings :: Text
migrationType :: MigrationTypeValue
replicationInstanceArn :: Text
targetEndpointArn :: Text
sourceEndpointArn :: Text
replicationTaskIdentifier :: Text
cdcStartTime :: Maybe POSIX
tags :: Maybe [Tag]
resourceIdentifier :: Maybe Text
cdcStopPosition :: Maybe Text
taskData :: Maybe Text
cdcStartPosition :: Maybe Text
replicationTaskSettings :: Maybe Text
$sel:tableMappings:CreateReplicationTask' :: CreateReplicationTask -> Text
$sel:migrationType:CreateReplicationTask' :: CreateReplicationTask -> MigrationTypeValue
$sel:replicationInstanceArn:CreateReplicationTask' :: CreateReplicationTask -> Text
$sel:targetEndpointArn:CreateReplicationTask' :: CreateReplicationTask -> Text
$sel:sourceEndpointArn:CreateReplicationTask' :: CreateReplicationTask -> Text
$sel:replicationTaskIdentifier:CreateReplicationTask' :: CreateReplicationTask -> Text
$sel:cdcStartTime:CreateReplicationTask' :: CreateReplicationTask -> Maybe POSIX
$sel:tags:CreateReplicationTask' :: CreateReplicationTask -> Maybe [Tag]
$sel:resourceIdentifier:CreateReplicationTask' :: CreateReplicationTask -> Maybe Text
$sel:cdcStopPosition:CreateReplicationTask' :: CreateReplicationTask -> Maybe Text
$sel:taskData:CreateReplicationTask' :: CreateReplicationTask -> Maybe Text
$sel:cdcStartPosition:CreateReplicationTask' :: CreateReplicationTask -> Maybe Text
$sel:replicationTaskSettings:CreateReplicationTask' :: CreateReplicationTask -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ReplicationTaskSettings" 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
replicationTaskSettings,
            (Text
"CdcStartPosition" 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
cdcStartPosition,
            (Text
"TaskData" 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
taskData,
            (Text
"CdcStopPosition" 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
cdcStopPosition,
            (Text
"ResourceIdentifier" 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
resourceIdentifier,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            (Text
"CdcStartTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
cdcStartTime,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"ReplicationTaskIdentifier"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
replicationTaskIdentifier
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"SourceEndpointArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sourceEndpointArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TargetEndpointArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
targetEndpointArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"ReplicationInstanceArn"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
replicationInstanceArn
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"MigrationType" Text -> MigrationTypeValue -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= MigrationTypeValue
migrationType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TableMappings" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
tableMappings)
          ]
      )

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

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

-- |
--
-- /See:/ 'newCreateReplicationTaskResponse' smart constructor.
data CreateReplicationTaskResponse = CreateReplicationTaskResponse'
  { -- | The replication task that was created.
    CreateReplicationTaskResponse -> Maybe ReplicationTask
replicationTask :: Prelude.Maybe ReplicationTask,
    -- | The response's http status code.
    CreateReplicationTaskResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateReplicationTaskResponse
-> CreateReplicationTaskResponse -> Bool
(CreateReplicationTaskResponse
 -> CreateReplicationTaskResponse -> Bool)
-> (CreateReplicationTaskResponse
    -> CreateReplicationTaskResponse -> Bool)
-> Eq CreateReplicationTaskResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateReplicationTaskResponse
-> CreateReplicationTaskResponse -> Bool
$c/= :: CreateReplicationTaskResponse
-> CreateReplicationTaskResponse -> Bool
== :: CreateReplicationTaskResponse
-> CreateReplicationTaskResponse -> Bool
$c== :: CreateReplicationTaskResponse
-> CreateReplicationTaskResponse -> Bool
Prelude.Eq, ReadPrec [CreateReplicationTaskResponse]
ReadPrec CreateReplicationTaskResponse
Int -> ReadS CreateReplicationTaskResponse
ReadS [CreateReplicationTaskResponse]
(Int -> ReadS CreateReplicationTaskResponse)
-> ReadS [CreateReplicationTaskResponse]
-> ReadPrec CreateReplicationTaskResponse
-> ReadPrec [CreateReplicationTaskResponse]
-> Read CreateReplicationTaskResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateReplicationTaskResponse]
$creadListPrec :: ReadPrec [CreateReplicationTaskResponse]
readPrec :: ReadPrec CreateReplicationTaskResponse
$creadPrec :: ReadPrec CreateReplicationTaskResponse
readList :: ReadS [CreateReplicationTaskResponse]
$creadList :: ReadS [CreateReplicationTaskResponse]
readsPrec :: Int -> ReadS CreateReplicationTaskResponse
$creadsPrec :: Int -> ReadS CreateReplicationTaskResponse
Prelude.Read, Int -> CreateReplicationTaskResponse -> ShowS
[CreateReplicationTaskResponse] -> ShowS
CreateReplicationTaskResponse -> String
(Int -> CreateReplicationTaskResponse -> ShowS)
-> (CreateReplicationTaskResponse -> String)
-> ([CreateReplicationTaskResponse] -> ShowS)
-> Show CreateReplicationTaskResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateReplicationTaskResponse] -> ShowS
$cshowList :: [CreateReplicationTaskResponse] -> ShowS
show :: CreateReplicationTaskResponse -> String
$cshow :: CreateReplicationTaskResponse -> String
showsPrec :: Int -> CreateReplicationTaskResponse -> ShowS
$cshowsPrec :: Int -> CreateReplicationTaskResponse -> ShowS
Prelude.Show, (forall x.
 CreateReplicationTaskResponse
 -> Rep CreateReplicationTaskResponse x)
-> (forall x.
    Rep CreateReplicationTaskResponse x
    -> CreateReplicationTaskResponse)
-> Generic CreateReplicationTaskResponse
forall x.
Rep CreateReplicationTaskResponse x
-> CreateReplicationTaskResponse
forall x.
CreateReplicationTaskResponse
-> Rep CreateReplicationTaskResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateReplicationTaskResponse x
-> CreateReplicationTaskResponse
$cfrom :: forall x.
CreateReplicationTaskResponse
-> Rep CreateReplicationTaskResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateReplicationTaskResponse' 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:
--
-- 'replicationTask', 'createReplicationTaskResponse_replicationTask' - The replication task that was created.
--
-- 'httpStatus', 'createReplicationTaskResponse_httpStatus' - The response's http status code.
newCreateReplicationTaskResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateReplicationTaskResponse
newCreateReplicationTaskResponse :: Int -> CreateReplicationTaskResponse
newCreateReplicationTaskResponse Int
pHttpStatus_ =
  CreateReplicationTaskResponse' :: Maybe ReplicationTask -> Int -> CreateReplicationTaskResponse
CreateReplicationTaskResponse'
    { $sel:replicationTask:CreateReplicationTaskResponse' :: Maybe ReplicationTask
replicationTask =
        Maybe ReplicationTask
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateReplicationTaskResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The replication task that was created.
createReplicationTaskResponse_replicationTask :: Lens.Lens' CreateReplicationTaskResponse (Prelude.Maybe ReplicationTask)
createReplicationTaskResponse_replicationTask :: (Maybe ReplicationTask -> f (Maybe ReplicationTask))
-> CreateReplicationTaskResponse -> f CreateReplicationTaskResponse
createReplicationTaskResponse_replicationTask = (CreateReplicationTaskResponse -> Maybe ReplicationTask)
-> (CreateReplicationTaskResponse
    -> Maybe ReplicationTask -> CreateReplicationTaskResponse)
-> Lens
     CreateReplicationTaskResponse
     CreateReplicationTaskResponse
     (Maybe ReplicationTask)
     (Maybe ReplicationTask)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationTaskResponse' {Maybe ReplicationTask
replicationTask :: Maybe ReplicationTask
$sel:replicationTask:CreateReplicationTaskResponse' :: CreateReplicationTaskResponse -> Maybe ReplicationTask
replicationTask} -> Maybe ReplicationTask
replicationTask) (\s :: CreateReplicationTaskResponse
s@CreateReplicationTaskResponse' {} Maybe ReplicationTask
a -> CreateReplicationTaskResponse
s {$sel:replicationTask:CreateReplicationTaskResponse' :: Maybe ReplicationTask
replicationTask = Maybe ReplicationTask
a} :: CreateReplicationTaskResponse)

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

instance Prelude.NFData CreateReplicationTaskResponse