{-# 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.GetMigrations
-- 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)
--
-- Gets a list of migrations between Amazon Lex V1 and Amazon Lex V2.
module Amazonka.LexModels.GetMigrations
  ( -- * Creating a Request
    GetMigrations (..),
    newGetMigrations,

    -- * Request Lenses
    getMigrations_sortByOrder,
    getMigrations_sortByAttribute,
    getMigrations_nextToken,
    getMigrations_migrationStatusEquals,
    getMigrations_v1BotNameContains,
    getMigrations_maxResults,

    -- * Destructuring the Response
    GetMigrationsResponse (..),
    newGetMigrationsResponse,

    -- * Response Lenses
    getMigrationsResponse_migrationSummaries,
    getMigrationsResponse_nextToken,
    getMigrationsResponse_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:/ 'newGetMigrations' smart constructor.
data GetMigrations = GetMigrations'
  { -- | The order so sort the list.
    GetMigrations -> Maybe SortOrder
sortByOrder :: Prelude.Maybe SortOrder,
    -- | The field to sort the list of migrations by. You can sort by the Amazon
    -- Lex V1 bot name or the date and time that the migration was started.
    GetMigrations -> Maybe MigrationSortAttribute
sortByAttribute :: Prelude.Maybe MigrationSortAttribute,
    -- | A pagination token that fetches the next page of migrations. If the
    -- response to this operation is truncated, Amazon Lex returns a pagination
    -- token in the response. To fetch the next page of migrations, specify the
    -- pagination token in the request.
    GetMigrations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Filters the list to contain only migrations in the specified state.
    GetMigrations -> Maybe MigrationStatus
migrationStatusEquals :: Prelude.Maybe MigrationStatus,
    -- | Filters the list to contain only bots whose name contains the specified
    -- string. The string is matched anywhere in bot name.
    GetMigrations -> Maybe Text
v1BotNameContains :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of migrations to return in the response. The default
    -- is 10.
    GetMigrations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (GetMigrations -> GetMigrations -> Bool
(GetMigrations -> GetMigrations -> Bool)
-> (GetMigrations -> GetMigrations -> Bool) -> Eq GetMigrations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMigrations -> GetMigrations -> Bool
$c/= :: GetMigrations -> GetMigrations -> Bool
== :: GetMigrations -> GetMigrations -> Bool
$c== :: GetMigrations -> GetMigrations -> Bool
Prelude.Eq, ReadPrec [GetMigrations]
ReadPrec GetMigrations
Int -> ReadS GetMigrations
ReadS [GetMigrations]
(Int -> ReadS GetMigrations)
-> ReadS [GetMigrations]
-> ReadPrec GetMigrations
-> ReadPrec [GetMigrations]
-> Read GetMigrations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMigrations]
$creadListPrec :: ReadPrec [GetMigrations]
readPrec :: ReadPrec GetMigrations
$creadPrec :: ReadPrec GetMigrations
readList :: ReadS [GetMigrations]
$creadList :: ReadS [GetMigrations]
readsPrec :: Int -> ReadS GetMigrations
$creadsPrec :: Int -> ReadS GetMigrations
Prelude.Read, Int -> GetMigrations -> ShowS
[GetMigrations] -> ShowS
GetMigrations -> String
(Int -> GetMigrations -> ShowS)
-> (GetMigrations -> String)
-> ([GetMigrations] -> ShowS)
-> Show GetMigrations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMigrations] -> ShowS
$cshowList :: [GetMigrations] -> ShowS
show :: GetMigrations -> String
$cshow :: GetMigrations -> String
showsPrec :: Int -> GetMigrations -> ShowS
$cshowsPrec :: Int -> GetMigrations -> ShowS
Prelude.Show, (forall x. GetMigrations -> Rep GetMigrations x)
-> (forall x. Rep GetMigrations x -> GetMigrations)
-> Generic GetMigrations
forall x. Rep GetMigrations x -> GetMigrations
forall x. GetMigrations -> Rep GetMigrations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMigrations x -> GetMigrations
$cfrom :: forall x. GetMigrations -> Rep GetMigrations x
Prelude.Generic)

-- |
-- Create a value of 'GetMigrations' 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:
--
-- 'sortByOrder', 'getMigrations_sortByOrder' - The order so sort the list.
--
-- 'sortByAttribute', 'getMigrations_sortByAttribute' - The field to sort the list of migrations by. You can sort by the Amazon
-- Lex V1 bot name or the date and time that the migration was started.
--
-- 'nextToken', 'getMigrations_nextToken' - A pagination token that fetches the next page of migrations. If the
-- response to this operation is truncated, Amazon Lex returns a pagination
-- token in the response. To fetch the next page of migrations, specify the
-- pagination token in the request.
--
-- 'migrationStatusEquals', 'getMigrations_migrationStatusEquals' - Filters the list to contain only migrations in the specified state.
--
-- 'v1BotNameContains', 'getMigrations_v1BotNameContains' - Filters the list to contain only bots whose name contains the specified
-- string. The string is matched anywhere in bot name.
--
-- 'maxResults', 'getMigrations_maxResults' - The maximum number of migrations to return in the response. The default
-- is 10.
newGetMigrations ::
  GetMigrations
newGetMigrations :: GetMigrations
newGetMigrations =
  GetMigrations' :: Maybe SortOrder
-> Maybe MigrationSortAttribute
-> Maybe Text
-> Maybe MigrationStatus
-> Maybe Text
-> Maybe Natural
-> GetMigrations
GetMigrations'
    { $sel:sortByOrder:GetMigrations' :: Maybe SortOrder
sortByOrder = Maybe SortOrder
forall a. Maybe a
Prelude.Nothing,
      $sel:sortByAttribute:GetMigrations' :: Maybe MigrationSortAttribute
sortByAttribute = Maybe MigrationSortAttribute
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetMigrations' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:migrationStatusEquals:GetMigrations' :: Maybe MigrationStatus
migrationStatusEquals = Maybe MigrationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:v1BotNameContains:GetMigrations' :: Maybe Text
v1BotNameContains = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetMigrations' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The order so sort the list.
getMigrations_sortByOrder :: Lens.Lens' GetMigrations (Prelude.Maybe SortOrder)
getMigrations_sortByOrder :: (Maybe SortOrder -> f (Maybe SortOrder))
-> GetMigrations -> f GetMigrations
getMigrations_sortByOrder = (GetMigrations -> Maybe SortOrder)
-> (GetMigrations -> Maybe SortOrder -> GetMigrations)
-> Lens
     GetMigrations GetMigrations (Maybe SortOrder) (Maybe SortOrder)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigrations' {Maybe SortOrder
sortByOrder :: Maybe SortOrder
$sel:sortByOrder:GetMigrations' :: GetMigrations -> Maybe SortOrder
sortByOrder} -> Maybe SortOrder
sortByOrder) (\s :: GetMigrations
s@GetMigrations' {} Maybe SortOrder
a -> GetMigrations
s {$sel:sortByOrder:GetMigrations' :: Maybe SortOrder
sortByOrder = Maybe SortOrder
a} :: GetMigrations)

-- | The field to sort the list of migrations by. You can sort by the Amazon
-- Lex V1 bot name or the date and time that the migration was started.
getMigrations_sortByAttribute :: Lens.Lens' GetMigrations (Prelude.Maybe MigrationSortAttribute)
getMigrations_sortByAttribute :: (Maybe MigrationSortAttribute -> f (Maybe MigrationSortAttribute))
-> GetMigrations -> f GetMigrations
getMigrations_sortByAttribute = (GetMigrations -> Maybe MigrationSortAttribute)
-> (GetMigrations -> Maybe MigrationSortAttribute -> GetMigrations)
-> Lens
     GetMigrations
     GetMigrations
     (Maybe MigrationSortAttribute)
     (Maybe MigrationSortAttribute)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigrations' {Maybe MigrationSortAttribute
sortByAttribute :: Maybe MigrationSortAttribute
$sel:sortByAttribute:GetMigrations' :: GetMigrations -> Maybe MigrationSortAttribute
sortByAttribute} -> Maybe MigrationSortAttribute
sortByAttribute) (\s :: GetMigrations
s@GetMigrations' {} Maybe MigrationSortAttribute
a -> GetMigrations
s {$sel:sortByAttribute:GetMigrations' :: Maybe MigrationSortAttribute
sortByAttribute = Maybe MigrationSortAttribute
a} :: GetMigrations)

-- | A pagination token that fetches the next page of migrations. If the
-- response to this operation is truncated, Amazon Lex returns a pagination
-- token in the response. To fetch the next page of migrations, specify the
-- pagination token in the request.
getMigrations_nextToken :: Lens.Lens' GetMigrations (Prelude.Maybe Prelude.Text)
getMigrations_nextToken :: (Maybe Text -> f (Maybe Text)) -> GetMigrations -> f GetMigrations
getMigrations_nextToken = (GetMigrations -> Maybe Text)
-> (GetMigrations -> Maybe Text -> GetMigrations)
-> Lens GetMigrations GetMigrations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigrations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetMigrations' :: GetMigrations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetMigrations
s@GetMigrations' {} Maybe Text
a -> GetMigrations
s {$sel:nextToken:GetMigrations' :: Maybe Text
nextToken = Maybe Text
a} :: GetMigrations)

-- | Filters the list to contain only migrations in the specified state.
getMigrations_migrationStatusEquals :: Lens.Lens' GetMigrations (Prelude.Maybe MigrationStatus)
getMigrations_migrationStatusEquals :: (Maybe MigrationStatus -> f (Maybe MigrationStatus))
-> GetMigrations -> f GetMigrations
getMigrations_migrationStatusEquals = (GetMigrations -> Maybe MigrationStatus)
-> (GetMigrations -> Maybe MigrationStatus -> GetMigrations)
-> Lens
     GetMigrations
     GetMigrations
     (Maybe MigrationStatus)
     (Maybe MigrationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigrations' {Maybe MigrationStatus
migrationStatusEquals :: Maybe MigrationStatus
$sel:migrationStatusEquals:GetMigrations' :: GetMigrations -> Maybe MigrationStatus
migrationStatusEquals} -> Maybe MigrationStatus
migrationStatusEquals) (\s :: GetMigrations
s@GetMigrations' {} Maybe MigrationStatus
a -> GetMigrations
s {$sel:migrationStatusEquals:GetMigrations' :: Maybe MigrationStatus
migrationStatusEquals = Maybe MigrationStatus
a} :: GetMigrations)

-- | Filters the list to contain only bots whose name contains the specified
-- string. The string is matched anywhere in bot name.
getMigrations_v1BotNameContains :: Lens.Lens' GetMigrations (Prelude.Maybe Prelude.Text)
getMigrations_v1BotNameContains :: (Maybe Text -> f (Maybe Text)) -> GetMigrations -> f GetMigrations
getMigrations_v1BotNameContains = (GetMigrations -> Maybe Text)
-> (GetMigrations -> Maybe Text -> GetMigrations)
-> Lens GetMigrations GetMigrations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigrations' {Maybe Text
v1BotNameContains :: Maybe Text
$sel:v1BotNameContains:GetMigrations' :: GetMigrations -> Maybe Text
v1BotNameContains} -> Maybe Text
v1BotNameContains) (\s :: GetMigrations
s@GetMigrations' {} Maybe Text
a -> GetMigrations
s {$sel:v1BotNameContains:GetMigrations' :: Maybe Text
v1BotNameContains = Maybe Text
a} :: GetMigrations)

-- | The maximum number of migrations to return in the response. The default
-- is 10.
getMigrations_maxResults :: Lens.Lens' GetMigrations (Prelude.Maybe Prelude.Natural)
getMigrations_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetMigrations -> f GetMigrations
getMigrations_maxResults = (GetMigrations -> Maybe Natural)
-> (GetMigrations -> Maybe Natural -> GetMigrations)
-> Lens GetMigrations GetMigrations (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigrations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetMigrations' :: GetMigrations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetMigrations
s@GetMigrations' {} Maybe Natural
a -> GetMigrations
s {$sel:maxResults:GetMigrations' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetMigrations)

instance Core.AWSRequest GetMigrations where
  type
    AWSResponse GetMigrations =
      GetMigrationsResponse
  request :: GetMigrations -> Request GetMigrations
request = Service -> GetMigrations -> Request GetMigrations
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetMigrations
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetMigrations)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetMigrations))
-> Logger
-> Service
-> Proxy GetMigrations
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetMigrations)))
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 [MigrationSummary]
-> Maybe Text -> Int -> GetMigrationsResponse
GetMigrationsResponse'
            (Maybe [MigrationSummary]
 -> Maybe Text -> Int -> GetMigrationsResponse)
-> Either String (Maybe [MigrationSummary])
-> Either String (Maybe Text -> Int -> GetMigrationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [MigrationSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"migrationSummaries"
                            Either String (Maybe (Maybe [MigrationSummary]))
-> Maybe [MigrationSummary]
-> Either String (Maybe [MigrationSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [MigrationSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Maybe Text -> Int -> GetMigrationsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetMigrationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
            Either String (Int -> GetMigrationsResponse)
-> Either String Int -> Either String GetMigrationsResponse
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 GetMigrations

instance Prelude.NFData GetMigrations

instance Core.ToHeaders GetMigrations where
  toHeaders :: GetMigrations -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetMigrations -> 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 GetMigrations where
  toPath :: GetMigrations -> ByteString
toPath = ByteString -> GetMigrations -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/migrations"

instance Core.ToQuery GetMigrations where
  toQuery :: GetMigrations -> QueryString
toQuery GetMigrations' {Maybe Natural
Maybe Text
Maybe MigrationSortAttribute
Maybe MigrationStatus
Maybe SortOrder
maxResults :: Maybe Natural
v1BotNameContains :: Maybe Text
migrationStatusEquals :: Maybe MigrationStatus
nextToken :: Maybe Text
sortByAttribute :: Maybe MigrationSortAttribute
sortByOrder :: Maybe SortOrder
$sel:maxResults:GetMigrations' :: GetMigrations -> Maybe Natural
$sel:v1BotNameContains:GetMigrations' :: GetMigrations -> Maybe Text
$sel:migrationStatusEquals:GetMigrations' :: GetMigrations -> Maybe MigrationStatus
$sel:nextToken:GetMigrations' :: GetMigrations -> Maybe Text
$sel:sortByAttribute:GetMigrations' :: GetMigrations -> Maybe MigrationSortAttribute
$sel:sortByOrder:GetMigrations' :: GetMigrations -> Maybe SortOrder
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"sortByOrder" ByteString -> Maybe SortOrder -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe SortOrder
sortByOrder,
        ByteString
"sortByAttribute" ByteString -> Maybe MigrationSortAttribute -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe MigrationSortAttribute
sortByAttribute,
        ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"migrationStatusEquals"
          ByteString -> Maybe MigrationStatus -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe MigrationStatus
migrationStatusEquals,
        ByteString
"v1BotNameContains" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
v1BotNameContains,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newGetMigrationsResponse' smart constructor.
data GetMigrationsResponse = GetMigrationsResponse'
  { -- | An array of summaries for migrations from Amazon Lex V1 to Amazon Lex
    -- V2. To see details of the migration, use the @migrationId@ from the
    -- summary in a call to the operation.
    GetMigrationsResponse -> Maybe [MigrationSummary]
migrationSummaries :: Prelude.Maybe [MigrationSummary],
    -- | If the response is truncated, it includes a pagination token that you
    -- can specify in your next request to fetch the next page of migrations.
    GetMigrationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetMigrationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetMigrationsResponse -> GetMigrationsResponse -> Bool
(GetMigrationsResponse -> GetMigrationsResponse -> Bool)
-> (GetMigrationsResponse -> GetMigrationsResponse -> Bool)
-> Eq GetMigrationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMigrationsResponse -> GetMigrationsResponse -> Bool
$c/= :: GetMigrationsResponse -> GetMigrationsResponse -> Bool
== :: GetMigrationsResponse -> GetMigrationsResponse -> Bool
$c== :: GetMigrationsResponse -> GetMigrationsResponse -> Bool
Prelude.Eq, ReadPrec [GetMigrationsResponse]
ReadPrec GetMigrationsResponse
Int -> ReadS GetMigrationsResponse
ReadS [GetMigrationsResponse]
(Int -> ReadS GetMigrationsResponse)
-> ReadS [GetMigrationsResponse]
-> ReadPrec GetMigrationsResponse
-> ReadPrec [GetMigrationsResponse]
-> Read GetMigrationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMigrationsResponse]
$creadListPrec :: ReadPrec [GetMigrationsResponse]
readPrec :: ReadPrec GetMigrationsResponse
$creadPrec :: ReadPrec GetMigrationsResponse
readList :: ReadS [GetMigrationsResponse]
$creadList :: ReadS [GetMigrationsResponse]
readsPrec :: Int -> ReadS GetMigrationsResponse
$creadsPrec :: Int -> ReadS GetMigrationsResponse
Prelude.Read, Int -> GetMigrationsResponse -> ShowS
[GetMigrationsResponse] -> ShowS
GetMigrationsResponse -> String
(Int -> GetMigrationsResponse -> ShowS)
-> (GetMigrationsResponse -> String)
-> ([GetMigrationsResponse] -> ShowS)
-> Show GetMigrationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMigrationsResponse] -> ShowS
$cshowList :: [GetMigrationsResponse] -> ShowS
show :: GetMigrationsResponse -> String
$cshow :: GetMigrationsResponse -> String
showsPrec :: Int -> GetMigrationsResponse -> ShowS
$cshowsPrec :: Int -> GetMigrationsResponse -> ShowS
Prelude.Show, (forall x. GetMigrationsResponse -> Rep GetMigrationsResponse x)
-> (forall x. Rep GetMigrationsResponse x -> GetMigrationsResponse)
-> Generic GetMigrationsResponse
forall x. Rep GetMigrationsResponse x -> GetMigrationsResponse
forall x. GetMigrationsResponse -> Rep GetMigrationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMigrationsResponse x -> GetMigrationsResponse
$cfrom :: forall x. GetMigrationsResponse -> Rep GetMigrationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetMigrationsResponse' 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:
--
-- 'migrationSummaries', 'getMigrationsResponse_migrationSummaries' - An array of summaries for migrations from Amazon Lex V1 to Amazon Lex
-- V2. To see details of the migration, use the @migrationId@ from the
-- summary in a call to the operation.
--
-- 'nextToken', 'getMigrationsResponse_nextToken' - If the response is truncated, it includes a pagination token that you
-- can specify in your next request to fetch the next page of migrations.
--
-- 'httpStatus', 'getMigrationsResponse_httpStatus' - The response's http status code.
newGetMigrationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetMigrationsResponse
newGetMigrationsResponse :: Int -> GetMigrationsResponse
newGetMigrationsResponse Int
pHttpStatus_ =
  GetMigrationsResponse' :: Maybe [MigrationSummary]
-> Maybe Text -> Int -> GetMigrationsResponse
GetMigrationsResponse'
    { $sel:migrationSummaries:GetMigrationsResponse' :: Maybe [MigrationSummary]
migrationSummaries =
        Maybe [MigrationSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetMigrationsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetMigrationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of summaries for migrations from Amazon Lex V1 to Amazon Lex
-- V2. To see details of the migration, use the @migrationId@ from the
-- summary in a call to the operation.
getMigrationsResponse_migrationSummaries :: Lens.Lens' GetMigrationsResponse (Prelude.Maybe [MigrationSummary])
getMigrationsResponse_migrationSummaries :: (Maybe [MigrationSummary] -> f (Maybe [MigrationSummary]))
-> GetMigrationsResponse -> f GetMigrationsResponse
getMigrationsResponse_migrationSummaries = (GetMigrationsResponse -> Maybe [MigrationSummary])
-> (GetMigrationsResponse
    -> Maybe [MigrationSummary] -> GetMigrationsResponse)
-> Lens
     GetMigrationsResponse
     GetMigrationsResponse
     (Maybe [MigrationSummary])
     (Maybe [MigrationSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigrationsResponse' {Maybe [MigrationSummary]
migrationSummaries :: Maybe [MigrationSummary]
$sel:migrationSummaries:GetMigrationsResponse' :: GetMigrationsResponse -> Maybe [MigrationSummary]
migrationSummaries} -> Maybe [MigrationSummary]
migrationSummaries) (\s :: GetMigrationsResponse
s@GetMigrationsResponse' {} Maybe [MigrationSummary]
a -> GetMigrationsResponse
s {$sel:migrationSummaries:GetMigrationsResponse' :: Maybe [MigrationSummary]
migrationSummaries = Maybe [MigrationSummary]
a} :: GetMigrationsResponse) ((Maybe [MigrationSummary] -> f (Maybe [MigrationSummary]))
 -> GetMigrationsResponse -> f GetMigrationsResponse)
-> ((Maybe [MigrationSummary] -> f (Maybe [MigrationSummary]))
    -> Maybe [MigrationSummary] -> f (Maybe [MigrationSummary]))
-> (Maybe [MigrationSummary] -> f (Maybe [MigrationSummary]))
-> GetMigrationsResponse
-> f GetMigrationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MigrationSummary]
  [MigrationSummary]
  [MigrationSummary]
  [MigrationSummary]
-> Iso
     (Maybe [MigrationSummary])
     (Maybe [MigrationSummary])
     (Maybe [MigrationSummary])
     (Maybe [MigrationSummary])
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
  [MigrationSummary]
  [MigrationSummary]
  [MigrationSummary]
  [MigrationSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the response is truncated, it includes a pagination token that you
-- can specify in your next request to fetch the next page of migrations.
getMigrationsResponse_nextToken :: Lens.Lens' GetMigrationsResponse (Prelude.Maybe Prelude.Text)
getMigrationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetMigrationsResponse -> f GetMigrationsResponse
getMigrationsResponse_nextToken = (GetMigrationsResponse -> Maybe Text)
-> (GetMigrationsResponse -> Maybe Text -> GetMigrationsResponse)
-> Lens
     GetMigrationsResponse
     GetMigrationsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMigrationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetMigrationsResponse' :: GetMigrationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetMigrationsResponse
s@GetMigrationsResponse' {} Maybe Text
a -> GetMigrationsResponse
s {$sel:nextToken:GetMigrationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetMigrationsResponse)

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

instance Prelude.NFData GetMigrationsResponse