{-# 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.LexV2Models.StartImport
-- 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 importing a bot, bot locale, or custom vocabulary from a zip
-- archive that you uploaded to an S3 bucket.
module Amazonka.LexV2Models.StartImport
  ( -- * Creating a Request
    StartImport (..),
    newStartImport,

    -- * Request Lenses
    startImport_filePassword,
    startImport_importId,
    startImport_resourceSpecification,
    startImport_mergeStrategy,

    -- * Destructuring the Response
    StartImportResponse (..),
    newStartImportResponse,

    -- * Response Lenses
    startImportResponse_creationDateTime,
    startImportResponse_importId,
    startImportResponse_importStatus,
    startImportResponse_mergeStrategy,
    startImportResponse_resourceSpecification,
    startImportResponse_httpStatus,
  )
where

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

-- | /See:/ 'newStartImport' smart constructor.
data StartImport = StartImport'
  { -- | The password used to encrypt the zip archive that contains the resource
    -- definition. You should always encrypt the zip archive to protect it
    -- during transit between your site and Amazon Lex.
    StartImport -> Maybe (Sensitive Text)
filePassword :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The unique identifier for the import. It is included in the response
    -- from the
    -- <https://docs.aws.amazon.com/lexv2/latest/dg/API_CreateUploadUrl.html CreateUploadUrl>
    -- operation.
    StartImport -> Text
importId :: Prelude.Text,
    -- | Parameters for creating the bot, bot locale or custom vocabulary.
    StartImport -> ImportResourceSpecification
resourceSpecification :: ImportResourceSpecification,
    -- | The strategy to use when there is a name conflict between the imported
    -- resource and an existing resource. When the merge strategy is
    -- @FailOnConflict@ existing resources are not overwritten and the import
    -- fails.
    StartImport -> MergeStrategy
mergeStrategy :: MergeStrategy
  }
  deriving (StartImport -> StartImport -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartImport -> StartImport -> Bool
$c/= :: StartImport -> StartImport -> Bool
== :: StartImport -> StartImport -> Bool
$c== :: StartImport -> StartImport -> Bool
Prelude.Eq, Int -> StartImport -> ShowS
[StartImport] -> ShowS
StartImport -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartImport] -> ShowS
$cshowList :: [StartImport] -> ShowS
show :: StartImport -> String
$cshow :: StartImport -> String
showsPrec :: Int -> StartImport -> ShowS
$cshowsPrec :: Int -> StartImport -> ShowS
Prelude.Show, forall x. Rep StartImport x -> StartImport
forall x. StartImport -> Rep StartImport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartImport x -> StartImport
$cfrom :: forall x. StartImport -> Rep StartImport x
Prelude.Generic)

-- |
-- Create a value of 'StartImport' 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:
--
-- 'filePassword', 'startImport_filePassword' - The password used to encrypt the zip archive that contains the resource
-- definition. You should always encrypt the zip archive to protect it
-- during transit between your site and Amazon Lex.
--
-- 'importId', 'startImport_importId' - The unique identifier for the import. It is included in the response
-- from the
-- <https://docs.aws.amazon.com/lexv2/latest/dg/API_CreateUploadUrl.html CreateUploadUrl>
-- operation.
--
-- 'resourceSpecification', 'startImport_resourceSpecification' - Parameters for creating the bot, bot locale or custom vocabulary.
--
-- 'mergeStrategy', 'startImport_mergeStrategy' - The strategy to use when there is a name conflict between the imported
-- resource and an existing resource. When the merge strategy is
-- @FailOnConflict@ existing resources are not overwritten and the import
-- fails.
newStartImport ::
  -- | 'importId'
  Prelude.Text ->
  -- | 'resourceSpecification'
  ImportResourceSpecification ->
  -- | 'mergeStrategy'
  MergeStrategy ->
  StartImport
newStartImport :: Text -> ImportResourceSpecification -> MergeStrategy -> StartImport
newStartImport
  Text
pImportId_
  ImportResourceSpecification
pResourceSpecification_
  MergeStrategy
pMergeStrategy_ =
    StartImport'
      { $sel:filePassword:StartImport' :: Maybe (Sensitive Text)
filePassword = forall a. Maybe a
Prelude.Nothing,
        $sel:importId:StartImport' :: Text
importId = Text
pImportId_,
        $sel:resourceSpecification:StartImport' :: ImportResourceSpecification
resourceSpecification = ImportResourceSpecification
pResourceSpecification_,
        $sel:mergeStrategy:StartImport' :: MergeStrategy
mergeStrategy = MergeStrategy
pMergeStrategy_
      }

-- | The password used to encrypt the zip archive that contains the resource
-- definition. You should always encrypt the zip archive to protect it
-- during transit between your site and Amazon Lex.
startImport_filePassword :: Lens.Lens' StartImport (Prelude.Maybe Prelude.Text)
startImport_filePassword :: Lens' StartImport (Maybe Text)
startImport_filePassword = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartImport' {Maybe (Sensitive Text)
filePassword :: Maybe (Sensitive Text)
$sel:filePassword:StartImport' :: StartImport -> Maybe (Sensitive Text)
filePassword} -> Maybe (Sensitive Text)
filePassword) (\s :: StartImport
s@StartImport' {} Maybe (Sensitive Text)
a -> StartImport
s {$sel:filePassword:StartImport' :: Maybe (Sensitive Text)
filePassword = Maybe (Sensitive Text)
a} :: StartImport) 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. Iso' (Sensitive a) a
Data._Sensitive

-- | The unique identifier for the import. It is included in the response
-- from the
-- <https://docs.aws.amazon.com/lexv2/latest/dg/API_CreateUploadUrl.html CreateUploadUrl>
-- operation.
startImport_importId :: Lens.Lens' StartImport Prelude.Text
startImport_importId :: Lens' StartImport Text
startImport_importId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartImport' {Text
importId :: Text
$sel:importId:StartImport' :: StartImport -> Text
importId} -> Text
importId) (\s :: StartImport
s@StartImport' {} Text
a -> StartImport
s {$sel:importId:StartImport' :: Text
importId = Text
a} :: StartImport)

-- | Parameters for creating the bot, bot locale or custom vocabulary.
startImport_resourceSpecification :: Lens.Lens' StartImport ImportResourceSpecification
startImport_resourceSpecification :: Lens' StartImport ImportResourceSpecification
startImport_resourceSpecification = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartImport' {ImportResourceSpecification
resourceSpecification :: ImportResourceSpecification
$sel:resourceSpecification:StartImport' :: StartImport -> ImportResourceSpecification
resourceSpecification} -> ImportResourceSpecification
resourceSpecification) (\s :: StartImport
s@StartImport' {} ImportResourceSpecification
a -> StartImport
s {$sel:resourceSpecification:StartImport' :: ImportResourceSpecification
resourceSpecification = ImportResourceSpecification
a} :: StartImport)

-- | The strategy to use when there is a name conflict between the imported
-- resource and an existing resource. When the merge strategy is
-- @FailOnConflict@ existing resources are not overwritten and the import
-- fails.
startImport_mergeStrategy :: Lens.Lens' StartImport MergeStrategy
startImport_mergeStrategy :: Lens' StartImport MergeStrategy
startImport_mergeStrategy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartImport' {MergeStrategy
mergeStrategy :: MergeStrategy
$sel:mergeStrategy:StartImport' :: StartImport -> MergeStrategy
mergeStrategy} -> MergeStrategy
mergeStrategy) (\s :: StartImport
s@StartImport' {} MergeStrategy
a -> StartImport
s {$sel:mergeStrategy:StartImport' :: MergeStrategy
mergeStrategy = MergeStrategy
a} :: StartImport)

instance Core.AWSRequest StartImport where
  type AWSResponse StartImport = StartImportResponse
  request :: (Service -> Service) -> StartImport -> Request StartImport
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StartImport
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartImport)))
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 POSIX
-> Maybe Text
-> Maybe ImportStatus
-> Maybe MergeStrategy
-> Maybe ImportResourceSpecification
-> Int
-> StartImportResponse
StartImportResponse'
            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
"creationDateTime")
            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
"importId")
            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
"importStatus")
            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
"mergeStrategy")
            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
"resourceSpecification")
            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 StartImport where
  hashWithSalt :: Int -> StartImport -> Int
hashWithSalt Int
_salt StartImport' {Maybe (Sensitive Text)
Text
MergeStrategy
ImportResourceSpecification
mergeStrategy :: MergeStrategy
resourceSpecification :: ImportResourceSpecification
importId :: Text
filePassword :: Maybe (Sensitive Text)
$sel:mergeStrategy:StartImport' :: StartImport -> MergeStrategy
$sel:resourceSpecification:StartImport' :: StartImport -> ImportResourceSpecification
$sel:importId:StartImport' :: StartImport -> Text
$sel:filePassword:StartImport' :: StartImport -> Maybe (Sensitive Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
filePassword
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
importId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ImportResourceSpecification
resourceSpecification
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` MergeStrategy
mergeStrategy

instance Prelude.NFData StartImport where
  rnf :: StartImport -> ()
rnf StartImport' {Maybe (Sensitive Text)
Text
MergeStrategy
ImportResourceSpecification
mergeStrategy :: MergeStrategy
resourceSpecification :: ImportResourceSpecification
importId :: Text
filePassword :: Maybe (Sensitive Text)
$sel:mergeStrategy:StartImport' :: StartImport -> MergeStrategy
$sel:resourceSpecification:StartImport' :: StartImport -> ImportResourceSpecification
$sel:importId:StartImport' :: StartImport -> Text
$sel:filePassword:StartImport' :: StartImport -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
filePassword
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
importId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ImportResourceSpecification
resourceSpecification
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf MergeStrategy
mergeStrategy

instance Data.ToHeaders StartImport where
  toHeaders :: StartImport -> 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 StartImport where
  toJSON :: StartImport -> Value
toJSON StartImport' {Maybe (Sensitive Text)
Text
MergeStrategy
ImportResourceSpecification
mergeStrategy :: MergeStrategy
resourceSpecification :: ImportResourceSpecification
importId :: Text
filePassword :: Maybe (Sensitive Text)
$sel:mergeStrategy:StartImport' :: StartImport -> MergeStrategy
$sel:resourceSpecification:StartImport' :: StartImport -> ImportResourceSpecification
$sel:importId:StartImport' :: StartImport -> Text
$sel:filePassword:StartImport' :: StartImport -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"filePassword" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
filePassword,
            forall a. a -> Maybe a
Prelude.Just (Key
"importId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
importId),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"resourceSpecification"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ImportResourceSpecification
resourceSpecification
              ),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"mergeStrategy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= MergeStrategy
mergeStrategy)
          ]
      )

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

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

-- | /See:/ 'newStartImportResponse' smart constructor.
data StartImportResponse = StartImportResponse'
  { -- | The date and time that the import request was created.
    StartImportResponse -> Maybe POSIX
creationDateTime :: Prelude.Maybe Data.POSIX,
    -- | A unique identifier for the import.
    StartImportResponse -> Maybe Text
importId :: Prelude.Maybe Prelude.Text,
    -- | The current status of the import. When the status is @Complete@ the bot,
    -- bot alias, or custom vocabulary is ready to use.
    StartImportResponse -> Maybe ImportStatus
importStatus :: Prelude.Maybe ImportStatus,
    -- | The strategy used when there was a name conflict between the imported
    -- resource and an existing resource. When the merge strategy is
    -- @FailOnConflict@ existing resources are not overwritten and the import
    -- fails.
    StartImportResponse -> Maybe MergeStrategy
mergeStrategy :: Prelude.Maybe MergeStrategy,
    -- | The parameters used when importing the resource.
    StartImportResponse -> Maybe ImportResourceSpecification
resourceSpecification :: Prelude.Maybe ImportResourceSpecification,
    -- | The response's http status code.
    StartImportResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartImportResponse -> StartImportResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartImportResponse -> StartImportResponse -> Bool
$c/= :: StartImportResponse -> StartImportResponse -> Bool
== :: StartImportResponse -> StartImportResponse -> Bool
$c== :: StartImportResponse -> StartImportResponse -> Bool
Prelude.Eq, ReadPrec [StartImportResponse]
ReadPrec StartImportResponse
Int -> ReadS StartImportResponse
ReadS [StartImportResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartImportResponse]
$creadListPrec :: ReadPrec [StartImportResponse]
readPrec :: ReadPrec StartImportResponse
$creadPrec :: ReadPrec StartImportResponse
readList :: ReadS [StartImportResponse]
$creadList :: ReadS [StartImportResponse]
readsPrec :: Int -> ReadS StartImportResponse
$creadsPrec :: Int -> ReadS StartImportResponse
Prelude.Read, Int -> StartImportResponse -> ShowS
[StartImportResponse] -> ShowS
StartImportResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartImportResponse] -> ShowS
$cshowList :: [StartImportResponse] -> ShowS
show :: StartImportResponse -> String
$cshow :: StartImportResponse -> String
showsPrec :: Int -> StartImportResponse -> ShowS
$cshowsPrec :: Int -> StartImportResponse -> ShowS
Prelude.Show, forall x. Rep StartImportResponse x -> StartImportResponse
forall x. StartImportResponse -> Rep StartImportResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartImportResponse x -> StartImportResponse
$cfrom :: forall x. StartImportResponse -> Rep StartImportResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartImportResponse' 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:
--
-- 'creationDateTime', 'startImportResponse_creationDateTime' - The date and time that the import request was created.
--
-- 'importId', 'startImportResponse_importId' - A unique identifier for the import.
--
-- 'importStatus', 'startImportResponse_importStatus' - The current status of the import. When the status is @Complete@ the bot,
-- bot alias, or custom vocabulary is ready to use.
--
-- 'mergeStrategy', 'startImportResponse_mergeStrategy' - The strategy used when there was a name conflict between the imported
-- resource and an existing resource. When the merge strategy is
-- @FailOnConflict@ existing resources are not overwritten and the import
-- fails.
--
-- 'resourceSpecification', 'startImportResponse_resourceSpecification' - The parameters used when importing the resource.
--
-- 'httpStatus', 'startImportResponse_httpStatus' - The response's http status code.
newStartImportResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartImportResponse
newStartImportResponse :: Int -> StartImportResponse
newStartImportResponse Int
pHttpStatus_ =
  StartImportResponse'
    { $sel:creationDateTime:StartImportResponse' :: Maybe POSIX
creationDateTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:importId:StartImportResponse' :: Maybe Text
importId = forall a. Maybe a
Prelude.Nothing,
      $sel:importStatus:StartImportResponse' :: Maybe ImportStatus
importStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:mergeStrategy:StartImportResponse' :: Maybe MergeStrategy
mergeStrategy = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceSpecification:StartImportResponse' :: Maybe ImportResourceSpecification
resourceSpecification = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartImportResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The date and time that the import request was created.
startImportResponse_creationDateTime :: Lens.Lens' StartImportResponse (Prelude.Maybe Prelude.UTCTime)
startImportResponse_creationDateTime :: Lens' StartImportResponse (Maybe UTCTime)
startImportResponse_creationDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartImportResponse' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:StartImportResponse' :: StartImportResponse -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: StartImportResponse
s@StartImportResponse' {} Maybe POSIX
a -> StartImportResponse
s {$sel:creationDateTime:StartImportResponse' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: StartImportResponse) 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

-- | A unique identifier for the import.
startImportResponse_importId :: Lens.Lens' StartImportResponse (Prelude.Maybe Prelude.Text)
startImportResponse_importId :: Lens' StartImportResponse (Maybe Text)
startImportResponse_importId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartImportResponse' {Maybe Text
importId :: Maybe Text
$sel:importId:StartImportResponse' :: StartImportResponse -> Maybe Text
importId} -> Maybe Text
importId) (\s :: StartImportResponse
s@StartImportResponse' {} Maybe Text
a -> StartImportResponse
s {$sel:importId:StartImportResponse' :: Maybe Text
importId = Maybe Text
a} :: StartImportResponse)

-- | The current status of the import. When the status is @Complete@ the bot,
-- bot alias, or custom vocabulary is ready to use.
startImportResponse_importStatus :: Lens.Lens' StartImportResponse (Prelude.Maybe ImportStatus)
startImportResponse_importStatus :: Lens' StartImportResponse (Maybe ImportStatus)
startImportResponse_importStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartImportResponse' {Maybe ImportStatus
importStatus :: Maybe ImportStatus
$sel:importStatus:StartImportResponse' :: StartImportResponse -> Maybe ImportStatus
importStatus} -> Maybe ImportStatus
importStatus) (\s :: StartImportResponse
s@StartImportResponse' {} Maybe ImportStatus
a -> StartImportResponse
s {$sel:importStatus:StartImportResponse' :: Maybe ImportStatus
importStatus = Maybe ImportStatus
a} :: StartImportResponse)

-- | The strategy used when there was a name conflict between the imported
-- resource and an existing resource. When the merge strategy is
-- @FailOnConflict@ existing resources are not overwritten and the import
-- fails.
startImportResponse_mergeStrategy :: Lens.Lens' StartImportResponse (Prelude.Maybe MergeStrategy)
startImportResponse_mergeStrategy :: Lens' StartImportResponse (Maybe MergeStrategy)
startImportResponse_mergeStrategy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartImportResponse' {Maybe MergeStrategy
mergeStrategy :: Maybe MergeStrategy
$sel:mergeStrategy:StartImportResponse' :: StartImportResponse -> Maybe MergeStrategy
mergeStrategy} -> Maybe MergeStrategy
mergeStrategy) (\s :: StartImportResponse
s@StartImportResponse' {} Maybe MergeStrategy
a -> StartImportResponse
s {$sel:mergeStrategy:StartImportResponse' :: Maybe MergeStrategy
mergeStrategy = Maybe MergeStrategy
a} :: StartImportResponse)

-- | The parameters used when importing the resource.
startImportResponse_resourceSpecification :: Lens.Lens' StartImportResponse (Prelude.Maybe ImportResourceSpecification)
startImportResponse_resourceSpecification :: Lens' StartImportResponse (Maybe ImportResourceSpecification)
startImportResponse_resourceSpecification = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartImportResponse' {Maybe ImportResourceSpecification
resourceSpecification :: Maybe ImportResourceSpecification
$sel:resourceSpecification:StartImportResponse' :: StartImportResponse -> Maybe ImportResourceSpecification
resourceSpecification} -> Maybe ImportResourceSpecification
resourceSpecification) (\s :: StartImportResponse
s@StartImportResponse' {} Maybe ImportResourceSpecification
a -> StartImportResponse
s {$sel:resourceSpecification:StartImportResponse' :: Maybe ImportResourceSpecification
resourceSpecification = Maybe ImportResourceSpecification
a} :: StartImportResponse)

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

instance Prelude.NFData StartImportResponse where
  rnf :: StartImportResponse -> ()
rnf StartImportResponse' {Int
Maybe Text
Maybe POSIX
Maybe ImportStatus
Maybe MergeStrategy
Maybe ImportResourceSpecification
httpStatus :: Int
resourceSpecification :: Maybe ImportResourceSpecification
mergeStrategy :: Maybe MergeStrategy
importStatus :: Maybe ImportStatus
importId :: Maybe Text
creationDateTime :: Maybe POSIX
$sel:httpStatus:StartImportResponse' :: StartImportResponse -> Int
$sel:resourceSpecification:StartImportResponse' :: StartImportResponse -> Maybe ImportResourceSpecification
$sel:mergeStrategy:StartImportResponse' :: StartImportResponse -> Maybe MergeStrategy
$sel:importStatus:StartImportResponse' :: StartImportResponse -> Maybe ImportStatus
$sel:importId:StartImportResponse' :: StartImportResponse -> Maybe Text
$sel:creationDateTime:StartImportResponse' :: StartImportResponse -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
importId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ImportStatus
importStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MergeStrategy
mergeStrategy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ImportResourceSpecification
resourceSpecification
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus