{-# 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.LexModels.StartMigration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Starts migrating a bot from Amazon Lex V1 to Amazon Lex V2. Migrate your
-- bot when you want to take advantage of the new features of Amazon Lex
-- V2.
--
-- For more information, see
-- <https://docs.aws.amazon.com/lex/latest/dg/migrate.html Migrating a bot>
-- in the /Amazon Lex developer guide/.
module Amazonka.LexModels.StartMigration
  ( -- * Creating a Request
    StartMigration (..),
    newStartMigration,

    -- * Request Lenses
    startMigration_v1BotName,
    startMigration_v1BotVersion,
    startMigration_v2BotName,
    startMigration_v2BotRole,
    startMigration_migrationStrategy,

    -- * Destructuring the Response
    StartMigrationResponse (..),
    newStartMigrationResponse,

    -- * Response Lenses
    startMigrationResponse_migrationId,
    startMigrationResponse_migrationStrategy,
    startMigrationResponse_migrationTimestamp,
    startMigrationResponse_v1BotLocale,
    startMigrationResponse_v1BotName,
    startMigrationResponse_v1BotVersion,
    startMigrationResponse_v2BotId,
    startMigrationResponse_v2BotRole,
    startMigrationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexModels.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newStartMigration' smart constructor.
data StartMigration = StartMigration'
  { -- | The name of the Amazon Lex V1 bot that you are migrating to Amazon Lex
    -- V2.
    StartMigration -> Text
v1BotName :: Prelude.Text,
    -- | The version of the bot to migrate to Amazon Lex V2. You can migrate the
    -- @$LATEST@ version as well as any numbered version.
    StartMigration -> Text
v1BotVersion :: Prelude.Text,
    -- | The name of the Amazon Lex V2 bot that you are migrating the Amazon Lex
    -- V1 bot to.
    --
    -- -   If the Amazon Lex V2 bot doesn\'t exist, you must use the
    --     @CREATE_NEW@ migration strategy.
    --
    -- -   If the Amazon Lex V2 bot exists, you must use the @UPDATE_EXISTING@
    --     migration strategy to change the contents of the Amazon Lex V2 bot.
    StartMigration -> Text
v2BotName :: Prelude.Text,
    -- | The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.
    StartMigration -> Text
v2BotRole :: Prelude.Text,
    -- | The strategy used to conduct the migration.
    --
    -- -   @CREATE_NEW@ - Creates a new Amazon Lex V2 bot and migrates the
    --     Amazon Lex V1 bot to the new bot.
    --
    -- -   @UPDATE_EXISTING@ - Overwrites the existing Amazon Lex V2 bot
    --     metadata and the locale being migrated. It doesn\'t change any other
    --     locales in the Amazon Lex V2 bot. If the locale doesn\'t exist, a
    --     new locale is created in the Amazon Lex V2 bot.
    StartMigration -> MigrationStrategy
migrationStrategy :: MigrationStrategy
  }
  deriving (StartMigration -> StartMigration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartMigration -> StartMigration -> Bool
$c/= :: StartMigration -> StartMigration -> Bool
== :: StartMigration -> StartMigration -> Bool
$c== :: StartMigration -> StartMigration -> Bool
Prelude.Eq, ReadPrec [StartMigration]
ReadPrec StartMigration
Int -> ReadS StartMigration
ReadS [StartMigration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartMigration]
$creadListPrec :: ReadPrec [StartMigration]
readPrec :: ReadPrec StartMigration
$creadPrec :: ReadPrec StartMigration
readList :: ReadS [StartMigration]
$creadList :: ReadS [StartMigration]
readsPrec :: Int -> ReadS StartMigration
$creadsPrec :: Int -> ReadS StartMigration
Prelude.Read, Int -> StartMigration -> ShowS
[StartMigration] -> ShowS
StartMigration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartMigration] -> ShowS
$cshowList :: [StartMigration] -> ShowS
show :: StartMigration -> String
$cshow :: StartMigration -> String
showsPrec :: Int -> StartMigration -> ShowS
$cshowsPrec :: Int -> StartMigration -> ShowS
Prelude.Show, forall x. Rep StartMigration x -> StartMigration
forall x. StartMigration -> Rep StartMigration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartMigration x -> StartMigration
$cfrom :: forall x. StartMigration -> Rep StartMigration x
Prelude.Generic)

-- |
-- Create a value of 'StartMigration' 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:
--
-- 'v1BotName', 'startMigration_v1BotName' - The name of the Amazon Lex V1 bot that you are migrating to Amazon Lex
-- V2.
--
-- 'v1BotVersion', 'startMigration_v1BotVersion' - The version of the bot to migrate to Amazon Lex V2. You can migrate the
-- @$LATEST@ version as well as any numbered version.
--
-- 'v2BotName', 'startMigration_v2BotName' - The name of the Amazon Lex V2 bot that you are migrating the Amazon Lex
-- V1 bot to.
--
-- -   If the Amazon Lex V2 bot doesn\'t exist, you must use the
--     @CREATE_NEW@ migration strategy.
--
-- -   If the Amazon Lex V2 bot exists, you must use the @UPDATE_EXISTING@
--     migration strategy to change the contents of the Amazon Lex V2 bot.
--
-- 'v2BotRole', 'startMigration_v2BotRole' - The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.
--
-- 'migrationStrategy', 'startMigration_migrationStrategy' - The strategy used to conduct the migration.
--
-- -   @CREATE_NEW@ - Creates a new Amazon Lex V2 bot and migrates the
--     Amazon Lex V1 bot to the new bot.
--
-- -   @UPDATE_EXISTING@ - Overwrites the existing Amazon Lex V2 bot
--     metadata and the locale being migrated. It doesn\'t change any other
--     locales in the Amazon Lex V2 bot. If the locale doesn\'t exist, a
--     new locale is created in the Amazon Lex V2 bot.
newStartMigration ::
  -- | 'v1BotName'
  Prelude.Text ->
  -- | 'v1BotVersion'
  Prelude.Text ->
  -- | 'v2BotName'
  Prelude.Text ->
  -- | 'v2BotRole'
  Prelude.Text ->
  -- | 'migrationStrategy'
  MigrationStrategy ->
  StartMigration
newStartMigration :: Text -> Text -> Text -> Text -> MigrationStrategy -> StartMigration
newStartMigration
  Text
pV1BotName_
  Text
pV1BotVersion_
  Text
pV2BotName_
  Text
pV2BotRole_
  MigrationStrategy
pMigrationStrategy_ =
    StartMigration'
      { $sel:v1BotName:StartMigration' :: Text
v1BotName = Text
pV1BotName_,
        $sel:v1BotVersion:StartMigration' :: Text
v1BotVersion = Text
pV1BotVersion_,
        $sel:v2BotName:StartMigration' :: Text
v2BotName = Text
pV2BotName_,
        $sel:v2BotRole:StartMigration' :: Text
v2BotRole = Text
pV2BotRole_,
        $sel:migrationStrategy:StartMigration' :: MigrationStrategy
migrationStrategy = MigrationStrategy
pMigrationStrategy_
      }

-- | The name of the Amazon Lex V1 bot that you are migrating to Amazon Lex
-- V2.
startMigration_v1BotName :: Lens.Lens' StartMigration Prelude.Text
startMigration_v1BotName :: Lens' StartMigration Text
startMigration_v1BotName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMigration' {Text
v1BotName :: Text
$sel:v1BotName:StartMigration' :: StartMigration -> Text
v1BotName} -> Text
v1BotName) (\s :: StartMigration
s@StartMigration' {} Text
a -> StartMigration
s {$sel:v1BotName:StartMigration' :: Text
v1BotName = Text
a} :: StartMigration)

-- | The version of the bot to migrate to Amazon Lex V2. You can migrate the
-- @$LATEST@ version as well as any numbered version.
startMigration_v1BotVersion :: Lens.Lens' StartMigration Prelude.Text
startMigration_v1BotVersion :: Lens' StartMigration Text
startMigration_v1BotVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMigration' {Text
v1BotVersion :: Text
$sel:v1BotVersion:StartMigration' :: StartMigration -> Text
v1BotVersion} -> Text
v1BotVersion) (\s :: StartMigration
s@StartMigration' {} Text
a -> StartMigration
s {$sel:v1BotVersion:StartMigration' :: Text
v1BotVersion = Text
a} :: StartMigration)

-- | The name of the Amazon Lex V2 bot that you are migrating the Amazon Lex
-- V1 bot to.
--
-- -   If the Amazon Lex V2 bot doesn\'t exist, you must use the
--     @CREATE_NEW@ migration strategy.
--
-- -   If the Amazon Lex V2 bot exists, you must use the @UPDATE_EXISTING@
--     migration strategy to change the contents of the Amazon Lex V2 bot.
startMigration_v2BotName :: Lens.Lens' StartMigration Prelude.Text
startMigration_v2BotName :: Lens' StartMigration Text
startMigration_v2BotName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMigration' {Text
v2BotName :: Text
$sel:v2BotName:StartMigration' :: StartMigration -> Text
v2BotName} -> Text
v2BotName) (\s :: StartMigration
s@StartMigration' {} Text
a -> StartMigration
s {$sel:v2BotName:StartMigration' :: Text
v2BotName = Text
a} :: StartMigration)

-- | The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.
startMigration_v2BotRole :: Lens.Lens' StartMigration Prelude.Text
startMigration_v2BotRole :: Lens' StartMigration Text
startMigration_v2BotRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMigration' {Text
v2BotRole :: Text
$sel:v2BotRole:StartMigration' :: StartMigration -> Text
v2BotRole} -> Text
v2BotRole) (\s :: StartMigration
s@StartMigration' {} Text
a -> StartMigration
s {$sel:v2BotRole:StartMigration' :: Text
v2BotRole = Text
a} :: StartMigration)

-- | The strategy used to conduct the migration.
--
-- -   @CREATE_NEW@ - Creates a new Amazon Lex V2 bot and migrates the
--     Amazon Lex V1 bot to the new bot.
--
-- -   @UPDATE_EXISTING@ - Overwrites the existing Amazon Lex V2 bot
--     metadata and the locale being migrated. It doesn\'t change any other
--     locales in the Amazon Lex V2 bot. If the locale doesn\'t exist, a
--     new locale is created in the Amazon Lex V2 bot.
startMigration_migrationStrategy :: Lens.Lens' StartMigration MigrationStrategy
startMigration_migrationStrategy :: Lens' StartMigration MigrationStrategy
startMigration_migrationStrategy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMigration' {MigrationStrategy
migrationStrategy :: MigrationStrategy
$sel:migrationStrategy:StartMigration' :: StartMigration -> MigrationStrategy
migrationStrategy} -> MigrationStrategy
migrationStrategy) (\s :: StartMigration
s@StartMigration' {} MigrationStrategy
a -> StartMigration
s {$sel:migrationStrategy:StartMigration' :: MigrationStrategy
migrationStrategy = MigrationStrategy
a} :: StartMigration)

instance Core.AWSRequest StartMigration where
  type
    AWSResponse StartMigration =
      StartMigrationResponse
  request :: (Service -> Service) -> StartMigration -> Request StartMigration
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StartMigration
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartMigration)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe MigrationStrategy
-> Maybe POSIX
-> Maybe Locale
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> StartMigrationResponse
StartMigrationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"migrationId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"migrationStrategy")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"migrationTimestamp")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"v1BotLocale")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"v1BotName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"v1BotVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"v2BotId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"v2BotRole")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable StartMigration where
  hashWithSalt :: Int -> StartMigration -> Int
hashWithSalt Int
_salt StartMigration' {Text
MigrationStrategy
migrationStrategy :: MigrationStrategy
v2BotRole :: Text
v2BotName :: Text
v1BotVersion :: Text
v1BotName :: Text
$sel:migrationStrategy:StartMigration' :: StartMigration -> MigrationStrategy
$sel:v2BotRole:StartMigration' :: StartMigration -> Text
$sel:v2BotName:StartMigration' :: StartMigration -> Text
$sel:v1BotVersion:StartMigration' :: StartMigration -> Text
$sel:v1BotName:StartMigration' :: StartMigration -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
v1BotName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
v1BotVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
v2BotName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
v2BotRole
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` MigrationStrategy
migrationStrategy

instance Prelude.NFData StartMigration where
  rnf :: StartMigration -> ()
rnf StartMigration' {Text
MigrationStrategy
migrationStrategy :: MigrationStrategy
v2BotRole :: Text
v2BotName :: Text
v1BotVersion :: Text
v1BotName :: Text
$sel:migrationStrategy:StartMigration' :: StartMigration -> MigrationStrategy
$sel:v2BotRole:StartMigration' :: StartMigration -> Text
$sel:v2BotName:StartMigration' :: StartMigration -> Text
$sel:v1BotVersion:StartMigration' :: StartMigration -> Text
$sel:v1BotName:StartMigration' :: StartMigration -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
v1BotName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
v1BotVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
v2BotName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
v2BotRole
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf MigrationStrategy
migrationStrategy

instance Data.ToHeaders StartMigration where
  toHeaders :: StartMigration -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON StartMigration where
  toJSON :: StartMigration -> Value
toJSON StartMigration' {Text
MigrationStrategy
migrationStrategy :: MigrationStrategy
v2BotRole :: Text
v2BotName :: Text
v1BotVersion :: Text
v1BotName :: Text
$sel:migrationStrategy:StartMigration' :: StartMigration -> MigrationStrategy
$sel:v2BotRole:StartMigration' :: StartMigration -> Text
$sel:v2BotName:StartMigration' :: StartMigration -> Text
$sel:v1BotVersion:StartMigration' :: StartMigration -> Text
$sel:v1BotName:StartMigration' :: StartMigration -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just (Key
"v1BotName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
v1BotName),
            forall a. a -> Maybe a
Prelude.Just (Key
"v1BotVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
v1BotVersion),
            forall a. a -> Maybe a
Prelude.Just (Key
"v2BotName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
v2BotName),
            forall a. a -> Maybe a
Prelude.Just (Key
"v2BotRole" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
v2BotRole),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"migrationStrategy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= MigrationStrategy
migrationStrategy)
          ]
      )

instance Data.ToPath StartMigration where
  toPath :: StartMigration -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/migrations"

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

-- | /See:/ 'newStartMigrationResponse' smart constructor.
data StartMigrationResponse = StartMigrationResponse'
  { -- | The unique identifier that Amazon Lex assigned to the migration.
    StartMigrationResponse -> Maybe Text
migrationId :: Prelude.Maybe Prelude.Text,
    -- | The strategy used to conduct the migration.
    StartMigrationResponse -> Maybe MigrationStrategy
migrationStrategy :: Prelude.Maybe MigrationStrategy,
    -- | The date and time that the migration started.
    StartMigrationResponse -> Maybe POSIX
migrationTimestamp :: Prelude.Maybe Data.POSIX,
    -- | The locale used for the Amazon Lex V1 bot.
    StartMigrationResponse -> Maybe Locale
v1BotLocale :: Prelude.Maybe Locale,
    -- | The name of the Amazon Lex V1 bot that you are migrating to Amazon Lex
    -- V2.
    StartMigrationResponse -> Maybe Text
v1BotName :: Prelude.Maybe Prelude.Text,
    -- | The version of the bot to migrate to Amazon Lex V2.
    StartMigrationResponse -> Maybe Text
v1BotVersion :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the Amazon Lex V2 bot.
    StartMigrationResponse -> Maybe Text
v2BotId :: Prelude.Maybe Prelude.Text,
    -- | The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.
    StartMigrationResponse -> Maybe Text
v2BotRole :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    StartMigrationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartMigrationResponse -> StartMigrationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartMigrationResponse -> StartMigrationResponse -> Bool
$c/= :: StartMigrationResponse -> StartMigrationResponse -> Bool
== :: StartMigrationResponse -> StartMigrationResponse -> Bool
$c== :: StartMigrationResponse -> StartMigrationResponse -> Bool
Prelude.Eq, ReadPrec [StartMigrationResponse]
ReadPrec StartMigrationResponse
Int -> ReadS StartMigrationResponse
ReadS [StartMigrationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartMigrationResponse]
$creadListPrec :: ReadPrec [StartMigrationResponse]
readPrec :: ReadPrec StartMigrationResponse
$creadPrec :: ReadPrec StartMigrationResponse
readList :: ReadS [StartMigrationResponse]
$creadList :: ReadS [StartMigrationResponse]
readsPrec :: Int -> ReadS StartMigrationResponse
$creadsPrec :: Int -> ReadS StartMigrationResponse
Prelude.Read, Int -> StartMigrationResponse -> ShowS
[StartMigrationResponse] -> ShowS
StartMigrationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartMigrationResponse] -> ShowS
$cshowList :: [StartMigrationResponse] -> ShowS
show :: StartMigrationResponse -> String
$cshow :: StartMigrationResponse -> String
showsPrec :: Int -> StartMigrationResponse -> ShowS
$cshowsPrec :: Int -> StartMigrationResponse -> ShowS
Prelude.Show, forall x. Rep StartMigrationResponse x -> StartMigrationResponse
forall x. StartMigrationResponse -> Rep StartMigrationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartMigrationResponse x -> StartMigrationResponse
$cfrom :: forall x. StartMigrationResponse -> Rep StartMigrationResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartMigrationResponse' 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:
--
-- 'migrationId', 'startMigrationResponse_migrationId' - The unique identifier that Amazon Lex assigned to the migration.
--
-- 'migrationStrategy', 'startMigrationResponse_migrationStrategy' - The strategy used to conduct the migration.
--
-- 'migrationTimestamp', 'startMigrationResponse_migrationTimestamp' - The date and time that the migration started.
--
-- 'v1BotLocale', 'startMigrationResponse_v1BotLocale' - The locale used for the Amazon Lex V1 bot.
--
-- 'v1BotName', 'startMigrationResponse_v1BotName' - The name of the Amazon Lex V1 bot that you are migrating to Amazon Lex
-- V2.
--
-- 'v1BotVersion', 'startMigrationResponse_v1BotVersion' - The version of the bot to migrate to Amazon Lex V2.
--
-- 'v2BotId', 'startMigrationResponse_v2BotId' - The unique identifier for the Amazon Lex V2 bot.
--
-- 'v2BotRole', 'startMigrationResponse_v2BotRole' - The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.
--
-- 'httpStatus', 'startMigrationResponse_httpStatus' - The response's http status code.
newStartMigrationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartMigrationResponse
newStartMigrationResponse :: Int -> StartMigrationResponse
newStartMigrationResponse Int
pHttpStatus_ =
  StartMigrationResponse'
    { $sel:migrationId:StartMigrationResponse' :: Maybe Text
migrationId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:migrationStrategy:StartMigrationResponse' :: Maybe MigrationStrategy
migrationStrategy = forall a. Maybe a
Prelude.Nothing,
      $sel:migrationTimestamp:StartMigrationResponse' :: Maybe POSIX
migrationTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:v1BotLocale:StartMigrationResponse' :: Maybe Locale
v1BotLocale = forall a. Maybe a
Prelude.Nothing,
      $sel:v1BotName:StartMigrationResponse' :: Maybe Text
v1BotName = forall a. Maybe a
Prelude.Nothing,
      $sel:v1BotVersion:StartMigrationResponse' :: Maybe Text
v1BotVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:v2BotId:StartMigrationResponse' :: Maybe Text
v2BotId = forall a. Maybe a
Prelude.Nothing,
      $sel:v2BotRole:StartMigrationResponse' :: Maybe Text
v2BotRole = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartMigrationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The unique identifier that Amazon Lex assigned to the migration.
startMigrationResponse_migrationId :: Lens.Lens' StartMigrationResponse (Prelude.Maybe Prelude.Text)
startMigrationResponse_migrationId :: Lens' StartMigrationResponse (Maybe Text)
startMigrationResponse_migrationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMigrationResponse' {Maybe Text
migrationId :: Maybe Text
$sel:migrationId:StartMigrationResponse' :: StartMigrationResponse -> Maybe Text
migrationId} -> Maybe Text
migrationId) (\s :: StartMigrationResponse
s@StartMigrationResponse' {} Maybe Text
a -> StartMigrationResponse
s {$sel:migrationId:StartMigrationResponse' :: Maybe Text
migrationId = Maybe Text
a} :: StartMigrationResponse)

-- | The strategy used to conduct the migration.
startMigrationResponse_migrationStrategy :: Lens.Lens' StartMigrationResponse (Prelude.Maybe MigrationStrategy)
startMigrationResponse_migrationStrategy :: Lens' StartMigrationResponse (Maybe MigrationStrategy)
startMigrationResponse_migrationStrategy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMigrationResponse' {Maybe MigrationStrategy
migrationStrategy :: Maybe MigrationStrategy
$sel:migrationStrategy:StartMigrationResponse' :: StartMigrationResponse -> Maybe MigrationStrategy
migrationStrategy} -> Maybe MigrationStrategy
migrationStrategy) (\s :: StartMigrationResponse
s@StartMigrationResponse' {} Maybe MigrationStrategy
a -> StartMigrationResponse
s {$sel:migrationStrategy:StartMigrationResponse' :: Maybe MigrationStrategy
migrationStrategy = Maybe MigrationStrategy
a} :: StartMigrationResponse)

-- | The date and time that the migration started.
startMigrationResponse_migrationTimestamp :: Lens.Lens' StartMigrationResponse (Prelude.Maybe Prelude.UTCTime)
startMigrationResponse_migrationTimestamp :: Lens' StartMigrationResponse (Maybe UTCTime)
startMigrationResponse_migrationTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMigrationResponse' {Maybe POSIX
migrationTimestamp :: Maybe POSIX
$sel:migrationTimestamp:StartMigrationResponse' :: StartMigrationResponse -> Maybe POSIX
migrationTimestamp} -> Maybe POSIX
migrationTimestamp) (\s :: StartMigrationResponse
s@StartMigrationResponse' {} Maybe POSIX
a -> StartMigrationResponse
s {$sel:migrationTimestamp:StartMigrationResponse' :: Maybe POSIX
migrationTimestamp = Maybe POSIX
a} :: StartMigrationResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The locale used for the Amazon Lex V1 bot.
startMigrationResponse_v1BotLocale :: Lens.Lens' StartMigrationResponse (Prelude.Maybe Locale)
startMigrationResponse_v1BotLocale :: Lens' StartMigrationResponse (Maybe Locale)
startMigrationResponse_v1BotLocale = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMigrationResponse' {Maybe Locale
v1BotLocale :: Maybe Locale
$sel:v1BotLocale:StartMigrationResponse' :: StartMigrationResponse -> Maybe Locale
v1BotLocale} -> Maybe Locale
v1BotLocale) (\s :: StartMigrationResponse
s@StartMigrationResponse' {} Maybe Locale
a -> StartMigrationResponse
s {$sel:v1BotLocale:StartMigrationResponse' :: Maybe Locale
v1BotLocale = Maybe Locale
a} :: StartMigrationResponse)

-- | The name of the Amazon Lex V1 bot that you are migrating to Amazon Lex
-- V2.
startMigrationResponse_v1BotName :: Lens.Lens' StartMigrationResponse (Prelude.Maybe Prelude.Text)
startMigrationResponse_v1BotName :: Lens' StartMigrationResponse (Maybe Text)
startMigrationResponse_v1BotName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMigrationResponse' {Maybe Text
v1BotName :: Maybe Text
$sel:v1BotName:StartMigrationResponse' :: StartMigrationResponse -> Maybe Text
v1BotName} -> Maybe Text
v1BotName) (\s :: StartMigrationResponse
s@StartMigrationResponse' {} Maybe Text
a -> StartMigrationResponse
s {$sel:v1BotName:StartMigrationResponse' :: Maybe Text
v1BotName = Maybe Text
a} :: StartMigrationResponse)

-- | The version of the bot to migrate to Amazon Lex V2.
startMigrationResponse_v1BotVersion :: Lens.Lens' StartMigrationResponse (Prelude.Maybe Prelude.Text)
startMigrationResponse_v1BotVersion :: Lens' StartMigrationResponse (Maybe Text)
startMigrationResponse_v1BotVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMigrationResponse' {Maybe Text
v1BotVersion :: Maybe Text
$sel:v1BotVersion:StartMigrationResponse' :: StartMigrationResponse -> Maybe Text
v1BotVersion} -> Maybe Text
v1BotVersion) (\s :: StartMigrationResponse
s@StartMigrationResponse' {} Maybe Text
a -> StartMigrationResponse
s {$sel:v1BotVersion:StartMigrationResponse' :: Maybe Text
v1BotVersion = Maybe Text
a} :: StartMigrationResponse)

-- | The unique identifier for the Amazon Lex V2 bot.
startMigrationResponse_v2BotId :: Lens.Lens' StartMigrationResponse (Prelude.Maybe Prelude.Text)
startMigrationResponse_v2BotId :: Lens' StartMigrationResponse (Maybe Text)
startMigrationResponse_v2BotId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMigrationResponse' {Maybe Text
v2BotId :: Maybe Text
$sel:v2BotId:StartMigrationResponse' :: StartMigrationResponse -> Maybe Text
v2BotId} -> Maybe Text
v2BotId) (\s :: StartMigrationResponse
s@StartMigrationResponse' {} Maybe Text
a -> StartMigrationResponse
s {$sel:v2BotId:StartMigrationResponse' :: Maybe Text
v2BotId = Maybe Text
a} :: StartMigrationResponse)

-- | The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.
startMigrationResponse_v2BotRole :: Lens.Lens' StartMigrationResponse (Prelude.Maybe Prelude.Text)
startMigrationResponse_v2BotRole :: Lens' StartMigrationResponse (Maybe Text)
startMigrationResponse_v2BotRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMigrationResponse' {Maybe Text
v2BotRole :: Maybe Text
$sel:v2BotRole:StartMigrationResponse' :: StartMigrationResponse -> Maybe Text
v2BotRole} -> Maybe Text
v2BotRole) (\s :: StartMigrationResponse
s@StartMigrationResponse' {} Maybe Text
a -> StartMigrationResponse
s {$sel:v2BotRole:StartMigrationResponse' :: Maybe Text
v2BotRole = Maybe Text
a} :: StartMigrationResponse)

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

instance Prelude.NFData StartMigrationResponse where
  rnf :: StartMigrationResponse -> ()
rnf StartMigrationResponse' {Int
Maybe Text
Maybe POSIX
Maybe Locale
Maybe MigrationStrategy
httpStatus :: Int
v2BotRole :: Maybe Text
v2BotId :: Maybe Text
v1BotVersion :: Maybe Text
v1BotName :: Maybe Text
v1BotLocale :: Maybe Locale
migrationTimestamp :: Maybe POSIX
migrationStrategy :: Maybe MigrationStrategy
migrationId :: Maybe Text
$sel:httpStatus:StartMigrationResponse' :: StartMigrationResponse -> Int
$sel:v2BotRole:StartMigrationResponse' :: StartMigrationResponse -> Maybe Text
$sel:v2BotId:StartMigrationResponse' :: StartMigrationResponse -> Maybe Text
$sel:v1BotVersion:StartMigrationResponse' :: StartMigrationResponse -> Maybe Text
$sel:v1BotName:StartMigrationResponse' :: StartMigrationResponse -> Maybe Text
$sel:v1BotLocale:StartMigrationResponse' :: StartMigrationResponse -> Maybe Locale
$sel:migrationTimestamp:StartMigrationResponse' :: StartMigrationResponse -> Maybe POSIX
$sel:migrationStrategy:StartMigrationResponse' :: StartMigrationResponse -> Maybe MigrationStrategy
$sel:migrationId:StartMigrationResponse' :: StartMigrationResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
migrationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MigrationStrategy
migrationStrategy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
migrationTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Locale
v1BotLocale
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
v1BotName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
v1BotVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
v2BotId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
v2BotRole
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus