{-# 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.GetMigration
-- 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)
--
-- Provides details about an ongoing or complete migration from an Amazon
-- Lex V1 bot to an Amazon Lex V2 bot. Use this operation to view the
-- migration alerts and warnings related to the migration.
module Amazonka.LexModels.GetMigration
  ( -- * Creating a Request
    GetMigration (..),
    newGetMigration,

    -- * Request Lenses
    getMigration_migrationId,

    -- * Destructuring the Response
    GetMigrationResponse (..),
    newGetMigrationResponse,

    -- * Response Lenses
    getMigrationResponse_v1BotVersion,
    getMigrationResponse_migrationStrategy,
    getMigrationResponse_migrationTimestamp,
    getMigrationResponse_alerts,
    getMigrationResponse_migrationStatus,
    getMigrationResponse_v2BotId,
    getMigrationResponse_v1BotLocale,
    getMigrationResponse_v1BotName,
    getMigrationResponse_v2BotRole,
    getMigrationResponse_migrationId,
    getMigrationResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetMigration' smart constructor.
data GetMigration = GetMigration'
  { -- | The unique identifier of the migration to view. The @migrationID@ is
    -- returned by the operation.
    GetMigration -> Text
migrationId :: Prelude.Text
  }
  deriving (GetMigration -> GetMigration -> Bool
(GetMigration -> GetMigration -> Bool)
-> (GetMigration -> GetMigration -> Bool) -> Eq GetMigration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMigration -> GetMigration -> Bool
$c/= :: GetMigration -> GetMigration -> Bool
== :: GetMigration -> GetMigration -> Bool
$c== :: GetMigration -> GetMigration -> Bool
Prelude.Eq, ReadPrec [GetMigration]
ReadPrec GetMigration
Int -> ReadS GetMigration
ReadS [GetMigration]
(Int -> ReadS GetMigration)
-> ReadS [GetMigration]
-> ReadPrec GetMigration
-> ReadPrec [GetMigration]
-> Read GetMigration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMigration]
$creadListPrec :: ReadPrec [GetMigration]
readPrec :: ReadPrec GetMigration
$creadPrec :: ReadPrec GetMigration
readList :: ReadS [GetMigration]
$creadList :: ReadS [GetMigration]
readsPrec :: Int -> ReadS GetMigration
$creadsPrec :: Int -> ReadS GetMigration
Prelude.Read, Int -> GetMigration -> ShowS
[GetMigration] -> ShowS
GetMigration -> String
(Int -> GetMigration -> ShowS)
-> (GetMigration -> String)
-> ([GetMigration] -> ShowS)
-> Show GetMigration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMigration] -> ShowS
$cshowList :: [GetMigration] -> ShowS
show :: GetMigration -> String
$cshow :: GetMigration -> String
showsPrec :: Int -> GetMigration -> ShowS
$cshowsPrec :: Int -> GetMigration -> ShowS
Prelude.Show, (forall x. GetMigration -> Rep GetMigration x)
-> (forall x. Rep GetMigration x -> GetMigration)
-> Generic GetMigration
forall x. Rep GetMigration x -> GetMigration
forall x. GetMigration -> Rep GetMigration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMigration x -> GetMigration
$cfrom :: forall x. GetMigration -> Rep GetMigration x
Prelude.Generic)

-- |
-- Create a value of 'GetMigration' 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', 'getMigration_migrationId' - The unique identifier of the migration to view. The @migrationID@ is
-- returned by the operation.
newGetMigration ::
  -- | 'migrationId'
  Prelude.Text ->
  GetMigration
newGetMigration :: Text -> GetMigration
newGetMigration Text
pMigrationId_ =
  GetMigration' :: Text -> GetMigration
GetMigration' {$sel:migrationId:GetMigration' :: Text
migrationId = Text
pMigrationId_}

-- | The unique identifier of the migration to view. The @migrationID@ is
-- returned by the operation.
getMigration_migrationId :: Lens.Lens' GetMigration Prelude.Text
getMigration_migrationId :: (Text -> f Text) -> GetMigration -> f GetMigration
getMigration_migrationId = (GetMigration -> Text)
-> (GetMigration -> Text -> GetMigration)
-> Lens GetMigration GetMigration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigration' {Text
migrationId :: Text
$sel:migrationId:GetMigration' :: GetMigration -> Text
migrationId} -> Text
migrationId) (\s :: GetMigration
s@GetMigration' {} Text
a -> GetMigration
s {$sel:migrationId:GetMigration' :: Text
migrationId = Text
a} :: GetMigration)

instance Core.AWSRequest GetMigration where
  type AWSResponse GetMigration = GetMigrationResponse
  request :: GetMigration -> Request GetMigration
request = Service -> GetMigration -> Request GetMigration
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetMigration
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetMigration)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetMigration))
-> Logger
-> Service
-> Proxy GetMigration
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetMigration)))
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 Text
-> Maybe MigrationStrategy
-> Maybe POSIX
-> Maybe [MigrationAlert]
-> Maybe MigrationStatus
-> Maybe Text
-> Maybe Locale
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetMigrationResponse
GetMigrationResponse'
            (Maybe Text
 -> Maybe MigrationStrategy
 -> Maybe POSIX
 -> Maybe [MigrationAlert]
 -> Maybe MigrationStatus
 -> Maybe Text
 -> Maybe Locale
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> GetMigrationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe MigrationStrategy
      -> Maybe POSIX
      -> Maybe [MigrationAlert]
      -> Maybe MigrationStatus
      -> Maybe Text
      -> Maybe Locale
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetMigrationResponse)
forall (f :: * -> *) a b. Functor 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
"v1BotVersion")
            Either
  String
  (Maybe MigrationStrategy
   -> Maybe POSIX
   -> Maybe [MigrationAlert]
   -> Maybe MigrationStatus
   -> Maybe Text
   -> Maybe Locale
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetMigrationResponse)
-> Either String (Maybe MigrationStrategy)
-> Either
     String
     (Maybe POSIX
      -> Maybe [MigrationAlert]
      -> Maybe MigrationStatus
      -> Maybe Text
      -> Maybe Locale
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetMigrationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe MigrationStrategy)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"migrationStrategy")
            Either
  String
  (Maybe POSIX
   -> Maybe [MigrationAlert]
   -> Maybe MigrationStatus
   -> Maybe Text
   -> Maybe Locale
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetMigrationResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe [MigrationAlert]
      -> Maybe MigrationStatus
      -> Maybe Text
      -> Maybe Locale
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetMigrationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"migrationTimestamp")
            Either
  String
  (Maybe [MigrationAlert]
   -> Maybe MigrationStatus
   -> Maybe Text
   -> Maybe Locale
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetMigrationResponse)
-> Either String (Maybe [MigrationAlert])
-> Either
     String
     (Maybe MigrationStatus
      -> Maybe Text
      -> Maybe Locale
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetMigrationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [MigrationAlert]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"alerts" Either String (Maybe (Maybe [MigrationAlert]))
-> Maybe [MigrationAlert] -> Either String (Maybe [MigrationAlert])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [MigrationAlert]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe MigrationStatus
   -> Maybe Text
   -> Maybe Locale
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetMigrationResponse)
-> Either String (Maybe MigrationStatus)
-> Either
     String
     (Maybe Text
      -> Maybe Locale
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetMigrationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe MigrationStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"migrationStatus")
            Either
  String
  (Maybe Text
   -> Maybe Locale
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetMigrationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Locale
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetMigrationResponse)
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
"v2BotId")
            Either
  String
  (Maybe Locale
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetMigrationResponse)
-> Either String (Maybe Locale)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Int -> GetMigrationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Locale)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"v1BotLocale")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Int -> GetMigrationResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Maybe Text -> Int -> GetMigrationResponse)
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
"v1BotName")
            Either
  String (Maybe Text -> Maybe Text -> Int -> GetMigrationResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> GetMigrationResponse)
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
"v2BotRole")
            Either String (Maybe Text -> Int -> GetMigrationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetMigrationResponse)
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
"migrationId")
            Either String (Int -> GetMigrationResponse)
-> Either String Int -> Either String GetMigrationResponse
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 GetMigration

instance Prelude.NFData GetMigration

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

instance Core.ToPath GetMigration where
  toPath :: GetMigration -> ByteString
toPath GetMigration' {Text
migrationId :: Text
$sel:migrationId:GetMigration' :: GetMigration -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/migrations/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
migrationId]

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

-- | /See:/ 'newGetMigrationResponse' smart constructor.
data GetMigrationResponse = GetMigrationResponse'
  { -- | The version of the Amazon Lex V1 bot migrated to Amazon Lex V2.
    GetMigrationResponse -> Maybe Text
v1BotVersion :: Prelude.Maybe 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.
    GetMigrationResponse -> Maybe MigrationStrategy
migrationStrategy :: Prelude.Maybe MigrationStrategy,
    -- | The date and time that the migration started.
    GetMigrationResponse -> Maybe POSIX
migrationTimestamp :: Prelude.Maybe Core.POSIX,
    -- | A list of alerts and warnings that indicate issues with the migration
    -- for the Amazon Lex V1 bot to Amazon Lex V2. You receive a warning when
    -- an Amazon Lex V1 feature has a different implementation if Amazon Lex
    -- V2.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/lexv2/latest/dg/migrate.html Migrating a bot>
    -- in the /Amazon Lex V2 developer guide/.
    GetMigrationResponse -> Maybe [MigrationAlert]
alerts :: Prelude.Maybe [MigrationAlert],
    -- | Indicates the status of the migration. When the status is @COMPLETE@ the
    -- migration is finished and the bot is available in Amazon Lex V2. There
    -- may be alerts and warnings that need to be resolved to complete the
    -- migration.
    GetMigrationResponse -> Maybe MigrationStatus
migrationStatus :: Prelude.Maybe MigrationStatus,
    -- | The unique identifier of the Amazon Lex V2 bot that the Amazon Lex V1 is
    -- being migrated to.
    GetMigrationResponse -> Maybe Text
v2BotId :: Prelude.Maybe Prelude.Text,
    -- | The locale of the Amazon Lex V1 bot migrated to Amazon Lex V2.
    GetMigrationResponse -> Maybe Locale
v1BotLocale :: Prelude.Maybe Locale,
    -- | The name of the Amazon Lex V1 bot migrated to Amazon Lex V2.
    GetMigrationResponse -> Maybe Text
v1BotName :: Prelude.Maybe Prelude.Text,
    -- | The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.
    GetMigrationResponse -> Maybe Text
v2BotRole :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the migration. This is the same as the
    -- identifier used when calling the @GetMigration@ operation.
    GetMigrationResponse -> Maybe Text
migrationId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetMigrationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetMigrationResponse -> GetMigrationResponse -> Bool
(GetMigrationResponse -> GetMigrationResponse -> Bool)
-> (GetMigrationResponse -> GetMigrationResponse -> Bool)
-> Eq GetMigrationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMigrationResponse -> GetMigrationResponse -> Bool
$c/= :: GetMigrationResponse -> GetMigrationResponse -> Bool
== :: GetMigrationResponse -> GetMigrationResponse -> Bool
$c== :: GetMigrationResponse -> GetMigrationResponse -> Bool
Prelude.Eq, ReadPrec [GetMigrationResponse]
ReadPrec GetMigrationResponse
Int -> ReadS GetMigrationResponse
ReadS [GetMigrationResponse]
(Int -> ReadS GetMigrationResponse)
-> ReadS [GetMigrationResponse]
-> ReadPrec GetMigrationResponse
-> ReadPrec [GetMigrationResponse]
-> Read GetMigrationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMigrationResponse]
$creadListPrec :: ReadPrec [GetMigrationResponse]
readPrec :: ReadPrec GetMigrationResponse
$creadPrec :: ReadPrec GetMigrationResponse
readList :: ReadS [GetMigrationResponse]
$creadList :: ReadS [GetMigrationResponse]
readsPrec :: Int -> ReadS GetMigrationResponse
$creadsPrec :: Int -> ReadS GetMigrationResponse
Prelude.Read, Int -> GetMigrationResponse -> ShowS
[GetMigrationResponse] -> ShowS
GetMigrationResponse -> String
(Int -> GetMigrationResponse -> ShowS)
-> (GetMigrationResponse -> String)
-> ([GetMigrationResponse] -> ShowS)
-> Show GetMigrationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMigrationResponse] -> ShowS
$cshowList :: [GetMigrationResponse] -> ShowS
show :: GetMigrationResponse -> String
$cshow :: GetMigrationResponse -> String
showsPrec :: Int -> GetMigrationResponse -> ShowS
$cshowsPrec :: Int -> GetMigrationResponse -> ShowS
Prelude.Show, (forall x. GetMigrationResponse -> Rep GetMigrationResponse x)
-> (forall x. Rep GetMigrationResponse x -> GetMigrationResponse)
-> Generic GetMigrationResponse
forall x. Rep GetMigrationResponse x -> GetMigrationResponse
forall x. GetMigrationResponse -> Rep GetMigrationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMigrationResponse x -> GetMigrationResponse
$cfrom :: forall x. GetMigrationResponse -> Rep GetMigrationResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetMigrationResponse' 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:
--
-- 'v1BotVersion', 'getMigrationResponse_v1BotVersion' - The version of the Amazon Lex V1 bot migrated to Amazon Lex V2.
--
-- 'migrationStrategy', 'getMigrationResponse_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.
--
-- 'migrationTimestamp', 'getMigrationResponse_migrationTimestamp' - The date and time that the migration started.
--
-- 'alerts', 'getMigrationResponse_alerts' - A list of alerts and warnings that indicate issues with the migration
-- for the Amazon Lex V1 bot to Amazon Lex V2. You receive a warning when
-- an Amazon Lex V1 feature has a different implementation if Amazon Lex
-- V2.
--
-- For more information, see
-- <https://docs.aws.amazon.com/lexv2/latest/dg/migrate.html Migrating a bot>
-- in the /Amazon Lex V2 developer guide/.
--
-- 'migrationStatus', 'getMigrationResponse_migrationStatus' - Indicates the status of the migration. When the status is @COMPLETE@ the
-- migration is finished and the bot is available in Amazon Lex V2. There
-- may be alerts and warnings that need to be resolved to complete the
-- migration.
--
-- 'v2BotId', 'getMigrationResponse_v2BotId' - The unique identifier of the Amazon Lex V2 bot that the Amazon Lex V1 is
-- being migrated to.
--
-- 'v1BotLocale', 'getMigrationResponse_v1BotLocale' - The locale of the Amazon Lex V1 bot migrated to Amazon Lex V2.
--
-- 'v1BotName', 'getMigrationResponse_v1BotName' - The name of the Amazon Lex V1 bot migrated to Amazon Lex V2.
--
-- 'v2BotRole', 'getMigrationResponse_v2BotRole' - The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.
--
-- 'migrationId', 'getMigrationResponse_migrationId' - The unique identifier of the migration. This is the same as the
-- identifier used when calling the @GetMigration@ operation.
--
-- 'httpStatus', 'getMigrationResponse_httpStatus' - The response's http status code.
newGetMigrationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetMigrationResponse
newGetMigrationResponse :: Int -> GetMigrationResponse
newGetMigrationResponse Int
pHttpStatus_ =
  GetMigrationResponse' :: Maybe Text
-> Maybe MigrationStrategy
-> Maybe POSIX
-> Maybe [MigrationAlert]
-> Maybe MigrationStatus
-> Maybe Text
-> Maybe Locale
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetMigrationResponse
GetMigrationResponse'
    { $sel:v1BotVersion:GetMigrationResponse' :: Maybe Text
v1BotVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:migrationStrategy:GetMigrationResponse' :: Maybe MigrationStrategy
migrationStrategy = Maybe MigrationStrategy
forall a. Maybe a
Prelude.Nothing,
      $sel:migrationTimestamp:GetMigrationResponse' :: Maybe POSIX
migrationTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:alerts:GetMigrationResponse' :: Maybe [MigrationAlert]
alerts = Maybe [MigrationAlert]
forall a. Maybe a
Prelude.Nothing,
      $sel:migrationStatus:GetMigrationResponse' :: Maybe MigrationStatus
migrationStatus = Maybe MigrationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:v2BotId:GetMigrationResponse' :: Maybe Text
v2BotId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:v1BotLocale:GetMigrationResponse' :: Maybe Locale
v1BotLocale = Maybe Locale
forall a. Maybe a
Prelude.Nothing,
      $sel:v1BotName:GetMigrationResponse' :: Maybe Text
v1BotName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:v2BotRole:GetMigrationResponse' :: Maybe Text
v2BotRole = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:migrationId:GetMigrationResponse' :: Maybe Text
migrationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetMigrationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | 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.
getMigrationResponse_migrationStrategy :: Lens.Lens' GetMigrationResponse (Prelude.Maybe MigrationStrategy)
getMigrationResponse_migrationStrategy :: (Maybe MigrationStrategy -> f (Maybe MigrationStrategy))
-> GetMigrationResponse -> f GetMigrationResponse
getMigrationResponse_migrationStrategy = (GetMigrationResponse -> Maybe MigrationStrategy)
-> (GetMigrationResponse
    -> Maybe MigrationStrategy -> GetMigrationResponse)
-> Lens
     GetMigrationResponse
     GetMigrationResponse
     (Maybe MigrationStrategy)
     (Maybe MigrationStrategy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigrationResponse' {Maybe MigrationStrategy
migrationStrategy :: Maybe MigrationStrategy
$sel:migrationStrategy:GetMigrationResponse' :: GetMigrationResponse -> Maybe MigrationStrategy
migrationStrategy} -> Maybe MigrationStrategy
migrationStrategy) (\s :: GetMigrationResponse
s@GetMigrationResponse' {} Maybe MigrationStrategy
a -> GetMigrationResponse
s {$sel:migrationStrategy:GetMigrationResponse' :: Maybe MigrationStrategy
migrationStrategy = Maybe MigrationStrategy
a} :: GetMigrationResponse)

-- | The date and time that the migration started.
getMigrationResponse_migrationTimestamp :: Lens.Lens' GetMigrationResponse (Prelude.Maybe Prelude.UTCTime)
getMigrationResponse_migrationTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetMigrationResponse -> f GetMigrationResponse
getMigrationResponse_migrationTimestamp = (GetMigrationResponse -> Maybe POSIX)
-> (GetMigrationResponse -> Maybe POSIX -> GetMigrationResponse)
-> Lens
     GetMigrationResponse
     GetMigrationResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigrationResponse' {Maybe POSIX
migrationTimestamp :: Maybe POSIX
$sel:migrationTimestamp:GetMigrationResponse' :: GetMigrationResponse -> Maybe POSIX
migrationTimestamp} -> Maybe POSIX
migrationTimestamp) (\s :: GetMigrationResponse
s@GetMigrationResponse' {} Maybe POSIX
a -> GetMigrationResponse
s {$sel:migrationTimestamp:GetMigrationResponse' :: Maybe POSIX
migrationTimestamp = Maybe POSIX
a} :: GetMigrationResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetMigrationResponse -> f GetMigrationResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetMigrationResponse
-> f GetMigrationResponse
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

-- | A list of alerts and warnings that indicate issues with the migration
-- for the Amazon Lex V1 bot to Amazon Lex V2. You receive a warning when
-- an Amazon Lex V1 feature has a different implementation if Amazon Lex
-- V2.
--
-- For more information, see
-- <https://docs.aws.amazon.com/lexv2/latest/dg/migrate.html Migrating a bot>
-- in the /Amazon Lex V2 developer guide/.
getMigrationResponse_alerts :: Lens.Lens' GetMigrationResponse (Prelude.Maybe [MigrationAlert])
getMigrationResponse_alerts :: (Maybe [MigrationAlert] -> f (Maybe [MigrationAlert]))
-> GetMigrationResponse -> f GetMigrationResponse
getMigrationResponse_alerts = (GetMigrationResponse -> Maybe [MigrationAlert])
-> (GetMigrationResponse
    -> Maybe [MigrationAlert] -> GetMigrationResponse)
-> Lens
     GetMigrationResponse
     GetMigrationResponse
     (Maybe [MigrationAlert])
     (Maybe [MigrationAlert])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigrationResponse' {Maybe [MigrationAlert]
alerts :: Maybe [MigrationAlert]
$sel:alerts:GetMigrationResponse' :: GetMigrationResponse -> Maybe [MigrationAlert]
alerts} -> Maybe [MigrationAlert]
alerts) (\s :: GetMigrationResponse
s@GetMigrationResponse' {} Maybe [MigrationAlert]
a -> GetMigrationResponse
s {$sel:alerts:GetMigrationResponse' :: Maybe [MigrationAlert]
alerts = Maybe [MigrationAlert]
a} :: GetMigrationResponse) ((Maybe [MigrationAlert] -> f (Maybe [MigrationAlert]))
 -> GetMigrationResponse -> f GetMigrationResponse)
-> ((Maybe [MigrationAlert] -> f (Maybe [MigrationAlert]))
    -> Maybe [MigrationAlert] -> f (Maybe [MigrationAlert]))
-> (Maybe [MigrationAlert] -> f (Maybe [MigrationAlert]))
-> GetMigrationResponse
-> f GetMigrationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MigrationAlert] [MigrationAlert] [MigrationAlert] [MigrationAlert]
-> Iso
     (Maybe [MigrationAlert])
     (Maybe [MigrationAlert])
     (Maybe [MigrationAlert])
     (Maybe [MigrationAlert])
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
  [MigrationAlert] [MigrationAlert] [MigrationAlert] [MigrationAlert]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates the status of the migration. When the status is @COMPLETE@ the
-- migration is finished and the bot is available in Amazon Lex V2. There
-- may be alerts and warnings that need to be resolved to complete the
-- migration.
getMigrationResponse_migrationStatus :: Lens.Lens' GetMigrationResponse (Prelude.Maybe MigrationStatus)
getMigrationResponse_migrationStatus :: (Maybe MigrationStatus -> f (Maybe MigrationStatus))
-> GetMigrationResponse -> f GetMigrationResponse
getMigrationResponse_migrationStatus = (GetMigrationResponse -> Maybe MigrationStatus)
-> (GetMigrationResponse
    -> Maybe MigrationStatus -> GetMigrationResponse)
-> Lens
     GetMigrationResponse
     GetMigrationResponse
     (Maybe MigrationStatus)
     (Maybe MigrationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigrationResponse' {Maybe MigrationStatus
migrationStatus :: Maybe MigrationStatus
$sel:migrationStatus:GetMigrationResponse' :: GetMigrationResponse -> Maybe MigrationStatus
migrationStatus} -> Maybe MigrationStatus
migrationStatus) (\s :: GetMigrationResponse
s@GetMigrationResponse' {} Maybe MigrationStatus
a -> GetMigrationResponse
s {$sel:migrationStatus:GetMigrationResponse' :: Maybe MigrationStatus
migrationStatus = Maybe MigrationStatus
a} :: GetMigrationResponse)

-- | The unique identifier of the Amazon Lex V2 bot that the Amazon Lex V1 is
-- being migrated to.
getMigrationResponse_v2BotId :: Lens.Lens' GetMigrationResponse (Prelude.Maybe Prelude.Text)
getMigrationResponse_v2BotId :: (Maybe Text -> f (Maybe Text))
-> GetMigrationResponse -> f GetMigrationResponse
getMigrationResponse_v2BotId = (GetMigrationResponse -> Maybe Text)
-> (GetMigrationResponse -> Maybe Text -> GetMigrationResponse)
-> Lens
     GetMigrationResponse GetMigrationResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigrationResponse' {Maybe Text
v2BotId :: Maybe Text
$sel:v2BotId:GetMigrationResponse' :: GetMigrationResponse -> Maybe Text
v2BotId} -> Maybe Text
v2BotId) (\s :: GetMigrationResponse
s@GetMigrationResponse' {} Maybe Text
a -> GetMigrationResponse
s {$sel:v2BotId:GetMigrationResponse' :: Maybe Text
v2BotId = Maybe Text
a} :: GetMigrationResponse)

-- | The locale of the Amazon Lex V1 bot migrated to Amazon Lex V2.
getMigrationResponse_v1BotLocale :: Lens.Lens' GetMigrationResponse (Prelude.Maybe Locale)
getMigrationResponse_v1BotLocale :: (Maybe Locale -> f (Maybe Locale))
-> GetMigrationResponse -> f GetMigrationResponse
getMigrationResponse_v1BotLocale = (GetMigrationResponse -> Maybe Locale)
-> (GetMigrationResponse -> Maybe Locale -> GetMigrationResponse)
-> Lens
     GetMigrationResponse
     GetMigrationResponse
     (Maybe Locale)
     (Maybe Locale)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigrationResponse' {Maybe Locale
v1BotLocale :: Maybe Locale
$sel:v1BotLocale:GetMigrationResponse' :: GetMigrationResponse -> Maybe Locale
v1BotLocale} -> Maybe Locale
v1BotLocale) (\s :: GetMigrationResponse
s@GetMigrationResponse' {} Maybe Locale
a -> GetMigrationResponse
s {$sel:v1BotLocale:GetMigrationResponse' :: Maybe Locale
v1BotLocale = Maybe Locale
a} :: GetMigrationResponse)

-- | The name of the Amazon Lex V1 bot migrated to Amazon Lex V2.
getMigrationResponse_v1BotName :: Lens.Lens' GetMigrationResponse (Prelude.Maybe Prelude.Text)
getMigrationResponse_v1BotName :: (Maybe Text -> f (Maybe Text))
-> GetMigrationResponse -> f GetMigrationResponse
getMigrationResponse_v1BotName = (GetMigrationResponse -> Maybe Text)
-> (GetMigrationResponse -> Maybe Text -> GetMigrationResponse)
-> Lens
     GetMigrationResponse GetMigrationResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigrationResponse' {Maybe Text
v1BotName :: Maybe Text
$sel:v1BotName:GetMigrationResponse' :: GetMigrationResponse -> Maybe Text
v1BotName} -> Maybe Text
v1BotName) (\s :: GetMigrationResponse
s@GetMigrationResponse' {} Maybe Text
a -> GetMigrationResponse
s {$sel:v1BotName:GetMigrationResponse' :: Maybe Text
v1BotName = Maybe Text
a} :: GetMigrationResponse)

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

-- | The unique identifier of the migration. This is the same as the
-- identifier used when calling the @GetMigration@ operation.
getMigrationResponse_migrationId :: Lens.Lens' GetMigrationResponse (Prelude.Maybe Prelude.Text)
getMigrationResponse_migrationId :: (Maybe Text -> f (Maybe Text))
-> GetMigrationResponse -> f GetMigrationResponse
getMigrationResponse_migrationId = (GetMigrationResponse -> Maybe Text)
-> (GetMigrationResponse -> Maybe Text -> GetMigrationResponse)
-> Lens
     GetMigrationResponse GetMigrationResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigrationResponse' {Maybe Text
migrationId :: Maybe Text
$sel:migrationId:GetMigrationResponse' :: GetMigrationResponse -> Maybe Text
migrationId} -> Maybe Text
migrationId) (\s :: GetMigrationResponse
s@GetMigrationResponse' {} Maybe Text
a -> GetMigrationResponse
s {$sel:migrationId:GetMigrationResponse' :: Maybe Text
migrationId = Maybe Text
a} :: GetMigrationResponse)

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

instance Prelude.NFData GetMigrationResponse