{-# 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.HoneyCode.StartTableDataImportJob
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- The StartTableDataImportJob API allows you to start an import job on a
-- table. This API will only return the id of the job that was started. To
-- find out the status of the import request, you need to call the
-- DescribeTableDataImportJob API.
module Amazonka.HoneyCode.StartTableDataImportJob
  ( -- * Creating a Request
    StartTableDataImportJob (..),
    newStartTableDataImportJob,

    -- * Request Lenses
    startTableDataImportJob_workbookId,
    startTableDataImportJob_dataSource,
    startTableDataImportJob_dataFormat,
    startTableDataImportJob_destinationTableId,
    startTableDataImportJob_importOptions,
    startTableDataImportJob_clientRequestToken,

    -- * Destructuring the Response
    StartTableDataImportJobResponse (..),
    newStartTableDataImportJobResponse,

    -- * Response Lenses
    startTableDataImportJobResponse_httpStatus,
    startTableDataImportJobResponse_jobId,
    startTableDataImportJobResponse_jobStatus,
  )
where

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

-- | /See:/ 'newStartTableDataImportJob' smart constructor.
data StartTableDataImportJob = StartTableDataImportJob'
  { -- | The ID of the workbook where the rows are being imported.
    --
    -- If a workbook with the specified id could not be found, this API throws
    -- ResourceNotFoundException.
    StartTableDataImportJob -> Text
workbookId :: Prelude.Text,
    -- | The source of the data that is being imported. The size of source must
    -- be no larger than 100 MB. Source must have no more than 100,000 cells
    -- and no more than 1,000 rows.
    StartTableDataImportJob -> ImportDataSource
dataSource :: ImportDataSource,
    -- | The format of the data that is being imported. Currently the only option
    -- supported is \"DELIMITED_TEXT\".
    StartTableDataImportJob -> ImportSourceDataFormat
dataFormat :: ImportSourceDataFormat,
    -- | The ID of the table where the rows are being imported.
    --
    -- If a table with the specified id could not be found, this API throws
    -- ResourceNotFoundException.
    StartTableDataImportJob -> Text
destinationTableId :: Prelude.Text,
    -- | The options for customizing this import request.
    StartTableDataImportJob -> ImportOptions
importOptions :: ImportOptions,
    -- | The request token for performing the update action. Request tokens help
    -- to identify duplicate requests. If a call times out or fails due to a
    -- transient error like a failed network connection, you can retry the call
    -- with the same request token. The service ensures that if the first call
    -- using that request token is successfully performed, the second call will
    -- not perform the action again.
    --
    -- Note that request tokens are valid only for a few minutes. You cannot
    -- use request tokens to dedupe requests spanning hours or days.
    StartTableDataImportJob -> Text
clientRequestToken :: Prelude.Text
  }
  deriving (StartTableDataImportJob -> StartTableDataImportJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartTableDataImportJob -> StartTableDataImportJob -> Bool
$c/= :: StartTableDataImportJob -> StartTableDataImportJob -> Bool
== :: StartTableDataImportJob -> StartTableDataImportJob -> Bool
$c== :: StartTableDataImportJob -> StartTableDataImportJob -> Bool
Prelude.Eq, Int -> StartTableDataImportJob -> ShowS
[StartTableDataImportJob] -> ShowS
StartTableDataImportJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartTableDataImportJob] -> ShowS
$cshowList :: [StartTableDataImportJob] -> ShowS
show :: StartTableDataImportJob -> String
$cshow :: StartTableDataImportJob -> String
showsPrec :: Int -> StartTableDataImportJob -> ShowS
$cshowsPrec :: Int -> StartTableDataImportJob -> ShowS
Prelude.Show, forall x. Rep StartTableDataImportJob x -> StartTableDataImportJob
forall x. StartTableDataImportJob -> Rep StartTableDataImportJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartTableDataImportJob x -> StartTableDataImportJob
$cfrom :: forall x. StartTableDataImportJob -> Rep StartTableDataImportJob x
Prelude.Generic)

-- |
-- Create a value of 'StartTableDataImportJob' 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:
--
-- 'workbookId', 'startTableDataImportJob_workbookId' - The ID of the workbook where the rows are being imported.
--
-- If a workbook with the specified id could not be found, this API throws
-- ResourceNotFoundException.
--
-- 'dataSource', 'startTableDataImportJob_dataSource' - The source of the data that is being imported. The size of source must
-- be no larger than 100 MB. Source must have no more than 100,000 cells
-- and no more than 1,000 rows.
--
-- 'dataFormat', 'startTableDataImportJob_dataFormat' - The format of the data that is being imported. Currently the only option
-- supported is \"DELIMITED_TEXT\".
--
-- 'destinationTableId', 'startTableDataImportJob_destinationTableId' - The ID of the table where the rows are being imported.
--
-- If a table with the specified id could not be found, this API throws
-- ResourceNotFoundException.
--
-- 'importOptions', 'startTableDataImportJob_importOptions' - The options for customizing this import request.
--
-- 'clientRequestToken', 'startTableDataImportJob_clientRequestToken' - The request token for performing the update action. Request tokens help
-- to identify duplicate requests. If a call times out or fails due to a
-- transient error like a failed network connection, you can retry the call
-- with the same request token. The service ensures that if the first call
-- using that request token is successfully performed, the second call will
-- not perform the action again.
--
-- Note that request tokens are valid only for a few minutes. You cannot
-- use request tokens to dedupe requests spanning hours or days.
newStartTableDataImportJob ::
  -- | 'workbookId'
  Prelude.Text ->
  -- | 'dataSource'
  ImportDataSource ->
  -- | 'dataFormat'
  ImportSourceDataFormat ->
  -- | 'destinationTableId'
  Prelude.Text ->
  -- | 'importOptions'
  ImportOptions ->
  -- | 'clientRequestToken'
  Prelude.Text ->
  StartTableDataImportJob
newStartTableDataImportJob :: Text
-> ImportDataSource
-> ImportSourceDataFormat
-> Text
-> ImportOptions
-> Text
-> StartTableDataImportJob
newStartTableDataImportJob
  Text
pWorkbookId_
  ImportDataSource
pDataSource_
  ImportSourceDataFormat
pDataFormat_
  Text
pDestinationTableId_
  ImportOptions
pImportOptions_
  Text
pClientRequestToken_ =
    StartTableDataImportJob'
      { $sel:workbookId:StartTableDataImportJob' :: Text
workbookId = Text
pWorkbookId_,
        $sel:dataSource:StartTableDataImportJob' :: ImportDataSource
dataSource = ImportDataSource
pDataSource_,
        $sel:dataFormat:StartTableDataImportJob' :: ImportSourceDataFormat
dataFormat = ImportSourceDataFormat
pDataFormat_,
        $sel:destinationTableId:StartTableDataImportJob' :: Text
destinationTableId = Text
pDestinationTableId_,
        $sel:importOptions:StartTableDataImportJob' :: ImportOptions
importOptions = ImportOptions
pImportOptions_,
        $sel:clientRequestToken:StartTableDataImportJob' :: Text
clientRequestToken = Text
pClientRequestToken_
      }

-- | The ID of the workbook where the rows are being imported.
--
-- If a workbook with the specified id could not be found, this API throws
-- ResourceNotFoundException.
startTableDataImportJob_workbookId :: Lens.Lens' StartTableDataImportJob Prelude.Text
startTableDataImportJob_workbookId :: Lens' StartTableDataImportJob Text
startTableDataImportJob_workbookId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTableDataImportJob' {Text
workbookId :: Text
$sel:workbookId:StartTableDataImportJob' :: StartTableDataImportJob -> Text
workbookId} -> Text
workbookId) (\s :: StartTableDataImportJob
s@StartTableDataImportJob' {} Text
a -> StartTableDataImportJob
s {$sel:workbookId:StartTableDataImportJob' :: Text
workbookId = Text
a} :: StartTableDataImportJob)

-- | The source of the data that is being imported. The size of source must
-- be no larger than 100 MB. Source must have no more than 100,000 cells
-- and no more than 1,000 rows.
startTableDataImportJob_dataSource :: Lens.Lens' StartTableDataImportJob ImportDataSource
startTableDataImportJob_dataSource :: Lens' StartTableDataImportJob ImportDataSource
startTableDataImportJob_dataSource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTableDataImportJob' {ImportDataSource
dataSource :: ImportDataSource
$sel:dataSource:StartTableDataImportJob' :: StartTableDataImportJob -> ImportDataSource
dataSource} -> ImportDataSource
dataSource) (\s :: StartTableDataImportJob
s@StartTableDataImportJob' {} ImportDataSource
a -> StartTableDataImportJob
s {$sel:dataSource:StartTableDataImportJob' :: ImportDataSource
dataSource = ImportDataSource
a} :: StartTableDataImportJob)

-- | The format of the data that is being imported. Currently the only option
-- supported is \"DELIMITED_TEXT\".
startTableDataImportJob_dataFormat :: Lens.Lens' StartTableDataImportJob ImportSourceDataFormat
startTableDataImportJob_dataFormat :: Lens' StartTableDataImportJob ImportSourceDataFormat
startTableDataImportJob_dataFormat = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTableDataImportJob' {ImportSourceDataFormat
dataFormat :: ImportSourceDataFormat
$sel:dataFormat:StartTableDataImportJob' :: StartTableDataImportJob -> ImportSourceDataFormat
dataFormat} -> ImportSourceDataFormat
dataFormat) (\s :: StartTableDataImportJob
s@StartTableDataImportJob' {} ImportSourceDataFormat
a -> StartTableDataImportJob
s {$sel:dataFormat:StartTableDataImportJob' :: ImportSourceDataFormat
dataFormat = ImportSourceDataFormat
a} :: StartTableDataImportJob)

-- | The ID of the table where the rows are being imported.
--
-- If a table with the specified id could not be found, this API throws
-- ResourceNotFoundException.
startTableDataImportJob_destinationTableId :: Lens.Lens' StartTableDataImportJob Prelude.Text
startTableDataImportJob_destinationTableId :: Lens' StartTableDataImportJob Text
startTableDataImportJob_destinationTableId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTableDataImportJob' {Text
destinationTableId :: Text
$sel:destinationTableId:StartTableDataImportJob' :: StartTableDataImportJob -> Text
destinationTableId} -> Text
destinationTableId) (\s :: StartTableDataImportJob
s@StartTableDataImportJob' {} Text
a -> StartTableDataImportJob
s {$sel:destinationTableId:StartTableDataImportJob' :: Text
destinationTableId = Text
a} :: StartTableDataImportJob)

-- | The options for customizing this import request.
startTableDataImportJob_importOptions :: Lens.Lens' StartTableDataImportJob ImportOptions
startTableDataImportJob_importOptions :: Lens' StartTableDataImportJob ImportOptions
startTableDataImportJob_importOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTableDataImportJob' {ImportOptions
importOptions :: ImportOptions
$sel:importOptions:StartTableDataImportJob' :: StartTableDataImportJob -> ImportOptions
importOptions} -> ImportOptions
importOptions) (\s :: StartTableDataImportJob
s@StartTableDataImportJob' {} ImportOptions
a -> StartTableDataImportJob
s {$sel:importOptions:StartTableDataImportJob' :: ImportOptions
importOptions = ImportOptions
a} :: StartTableDataImportJob)

-- | The request token for performing the update action. Request tokens help
-- to identify duplicate requests. If a call times out or fails due to a
-- transient error like a failed network connection, you can retry the call
-- with the same request token. The service ensures that if the first call
-- using that request token is successfully performed, the second call will
-- not perform the action again.
--
-- Note that request tokens are valid only for a few minutes. You cannot
-- use request tokens to dedupe requests spanning hours or days.
startTableDataImportJob_clientRequestToken :: Lens.Lens' StartTableDataImportJob Prelude.Text
startTableDataImportJob_clientRequestToken :: Lens' StartTableDataImportJob Text
startTableDataImportJob_clientRequestToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTableDataImportJob' {Text
clientRequestToken :: Text
$sel:clientRequestToken:StartTableDataImportJob' :: StartTableDataImportJob -> Text
clientRequestToken} -> Text
clientRequestToken) (\s :: StartTableDataImportJob
s@StartTableDataImportJob' {} Text
a -> StartTableDataImportJob
s {$sel:clientRequestToken:StartTableDataImportJob' :: Text
clientRequestToken = Text
a} :: StartTableDataImportJob)

instance Core.AWSRequest StartTableDataImportJob where
  type
    AWSResponse StartTableDataImportJob =
      StartTableDataImportJobResponse
  request :: (Service -> Service)
-> StartTableDataImportJob -> Request StartTableDataImportJob
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StartTableDataImportJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartTableDataImportJob)))
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 ->
          Int
-> Text
-> TableDataImportJobStatus
-> StartTableDataImportJobResponse
StartTableDataImportJobResponse'
            forall (f :: * -> *) a b. Functor 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))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"jobId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"jobStatus")
      )

instance Prelude.Hashable StartTableDataImportJob where
  hashWithSalt :: Int -> StartTableDataImportJob -> Int
hashWithSalt Int
_salt StartTableDataImportJob' {Text
ImportDataSource
ImportSourceDataFormat
ImportOptions
clientRequestToken :: Text
importOptions :: ImportOptions
destinationTableId :: Text
dataFormat :: ImportSourceDataFormat
dataSource :: ImportDataSource
workbookId :: Text
$sel:clientRequestToken:StartTableDataImportJob' :: StartTableDataImportJob -> Text
$sel:importOptions:StartTableDataImportJob' :: StartTableDataImportJob -> ImportOptions
$sel:destinationTableId:StartTableDataImportJob' :: StartTableDataImportJob -> Text
$sel:dataFormat:StartTableDataImportJob' :: StartTableDataImportJob -> ImportSourceDataFormat
$sel:dataSource:StartTableDataImportJob' :: StartTableDataImportJob -> ImportDataSource
$sel:workbookId:StartTableDataImportJob' :: StartTableDataImportJob -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workbookId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ImportDataSource
dataSource
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ImportSourceDataFormat
dataFormat
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
destinationTableId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ImportOptions
importOptions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clientRequestToken

instance Prelude.NFData StartTableDataImportJob where
  rnf :: StartTableDataImportJob -> ()
rnf StartTableDataImportJob' {Text
ImportDataSource
ImportSourceDataFormat
ImportOptions
clientRequestToken :: Text
importOptions :: ImportOptions
destinationTableId :: Text
dataFormat :: ImportSourceDataFormat
dataSource :: ImportDataSource
workbookId :: Text
$sel:clientRequestToken:StartTableDataImportJob' :: StartTableDataImportJob -> Text
$sel:importOptions:StartTableDataImportJob' :: StartTableDataImportJob -> ImportOptions
$sel:destinationTableId:StartTableDataImportJob' :: StartTableDataImportJob -> Text
$sel:dataFormat:StartTableDataImportJob' :: StartTableDataImportJob -> ImportSourceDataFormat
$sel:dataSource:StartTableDataImportJob' :: StartTableDataImportJob -> ImportDataSource
$sel:workbookId:StartTableDataImportJob' :: StartTableDataImportJob -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
workbookId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ImportDataSource
dataSource
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ImportSourceDataFormat
dataFormat
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
destinationTableId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ImportOptions
importOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clientRequestToken

instance Data.ToHeaders StartTableDataImportJob where
  toHeaders :: StartTableDataImportJob -> 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 StartTableDataImportJob where
  toJSON :: StartTableDataImportJob -> Value
toJSON StartTableDataImportJob' {Text
ImportDataSource
ImportSourceDataFormat
ImportOptions
clientRequestToken :: Text
importOptions :: ImportOptions
destinationTableId :: Text
dataFormat :: ImportSourceDataFormat
dataSource :: ImportDataSource
workbookId :: Text
$sel:clientRequestToken:StartTableDataImportJob' :: StartTableDataImportJob -> Text
$sel:importOptions:StartTableDataImportJob' :: StartTableDataImportJob -> ImportOptions
$sel:destinationTableId:StartTableDataImportJob' :: StartTableDataImportJob -> Text
$sel:dataFormat:StartTableDataImportJob' :: StartTableDataImportJob -> ImportSourceDataFormat
$sel:dataSource:StartTableDataImportJob' :: StartTableDataImportJob -> ImportDataSource
$sel:workbookId:StartTableDataImportJob' :: StartTableDataImportJob -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just (Key
"dataSource" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ImportDataSource
dataSource),
            forall a. a -> Maybe a
Prelude.Just (Key
"dataFormat" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ImportSourceDataFormat
dataFormat),
            forall a. a -> Maybe a
Prelude.Just (Key
"importOptions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ImportOptions
importOptions),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"clientRequestToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
clientRequestToken)
          ]
      )

instance Data.ToPath StartTableDataImportJob where
  toPath :: StartTableDataImportJob -> ByteString
toPath StartTableDataImportJob' {Text
ImportDataSource
ImportSourceDataFormat
ImportOptions
clientRequestToken :: Text
importOptions :: ImportOptions
destinationTableId :: Text
dataFormat :: ImportSourceDataFormat
dataSource :: ImportDataSource
workbookId :: Text
$sel:clientRequestToken:StartTableDataImportJob' :: StartTableDataImportJob -> Text
$sel:importOptions:StartTableDataImportJob' :: StartTableDataImportJob -> ImportOptions
$sel:destinationTableId:StartTableDataImportJob' :: StartTableDataImportJob -> Text
$sel:dataFormat:StartTableDataImportJob' :: StartTableDataImportJob -> ImportSourceDataFormat
$sel:dataSource:StartTableDataImportJob' :: StartTableDataImportJob -> ImportDataSource
$sel:workbookId:StartTableDataImportJob' :: StartTableDataImportJob -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/workbooks/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
workbookId,
        ByteString
"/tables/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
destinationTableId,
        ByteString
"/import"
      ]

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

-- | /See:/ 'newStartTableDataImportJobResponse' smart constructor.
data StartTableDataImportJobResponse = StartTableDataImportJobResponse'
  { -- | The response's http status code.
    StartTableDataImportJobResponse -> Int
httpStatus :: Prelude.Int,
    -- | The id that is assigned to this import job. Future requests to find out
    -- the status of this import job need to send this id in the appropriate
    -- parameter in the request.
    StartTableDataImportJobResponse -> Text
jobId :: Prelude.Text,
    -- | The status of the import job immediately after submitting the request.
    StartTableDataImportJobResponse -> TableDataImportJobStatus
jobStatus :: TableDataImportJobStatus
  }
  deriving (StartTableDataImportJobResponse
-> StartTableDataImportJobResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartTableDataImportJobResponse
-> StartTableDataImportJobResponse -> Bool
$c/= :: StartTableDataImportJobResponse
-> StartTableDataImportJobResponse -> Bool
== :: StartTableDataImportJobResponse
-> StartTableDataImportJobResponse -> Bool
$c== :: StartTableDataImportJobResponse
-> StartTableDataImportJobResponse -> Bool
Prelude.Eq, ReadPrec [StartTableDataImportJobResponse]
ReadPrec StartTableDataImportJobResponse
Int -> ReadS StartTableDataImportJobResponse
ReadS [StartTableDataImportJobResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartTableDataImportJobResponse]
$creadListPrec :: ReadPrec [StartTableDataImportJobResponse]
readPrec :: ReadPrec StartTableDataImportJobResponse
$creadPrec :: ReadPrec StartTableDataImportJobResponse
readList :: ReadS [StartTableDataImportJobResponse]
$creadList :: ReadS [StartTableDataImportJobResponse]
readsPrec :: Int -> ReadS StartTableDataImportJobResponse
$creadsPrec :: Int -> ReadS StartTableDataImportJobResponse
Prelude.Read, Int -> StartTableDataImportJobResponse -> ShowS
[StartTableDataImportJobResponse] -> ShowS
StartTableDataImportJobResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartTableDataImportJobResponse] -> ShowS
$cshowList :: [StartTableDataImportJobResponse] -> ShowS
show :: StartTableDataImportJobResponse -> String
$cshow :: StartTableDataImportJobResponse -> String
showsPrec :: Int -> StartTableDataImportJobResponse -> ShowS
$cshowsPrec :: Int -> StartTableDataImportJobResponse -> ShowS
Prelude.Show, forall x.
Rep StartTableDataImportJobResponse x
-> StartTableDataImportJobResponse
forall x.
StartTableDataImportJobResponse
-> Rep StartTableDataImportJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartTableDataImportJobResponse x
-> StartTableDataImportJobResponse
$cfrom :: forall x.
StartTableDataImportJobResponse
-> Rep StartTableDataImportJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartTableDataImportJobResponse' 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:
--
-- 'httpStatus', 'startTableDataImportJobResponse_httpStatus' - The response's http status code.
--
-- 'jobId', 'startTableDataImportJobResponse_jobId' - The id that is assigned to this import job. Future requests to find out
-- the status of this import job need to send this id in the appropriate
-- parameter in the request.
--
-- 'jobStatus', 'startTableDataImportJobResponse_jobStatus' - The status of the import job immediately after submitting the request.
newStartTableDataImportJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'jobId'
  Prelude.Text ->
  -- | 'jobStatus'
  TableDataImportJobStatus ->
  StartTableDataImportJobResponse
newStartTableDataImportJobResponse :: Int
-> Text
-> TableDataImportJobStatus
-> StartTableDataImportJobResponse
newStartTableDataImportJobResponse
  Int
pHttpStatus_
  Text
pJobId_
  TableDataImportJobStatus
pJobStatus_ =
    StartTableDataImportJobResponse'
      { $sel:httpStatus:StartTableDataImportJobResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:jobId:StartTableDataImportJobResponse' :: Text
jobId = Text
pJobId_,
        $sel:jobStatus:StartTableDataImportJobResponse' :: TableDataImportJobStatus
jobStatus = TableDataImportJobStatus
pJobStatus_
      }

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

-- | The id that is assigned to this import job. Future requests to find out
-- the status of this import job need to send this id in the appropriate
-- parameter in the request.
startTableDataImportJobResponse_jobId :: Lens.Lens' StartTableDataImportJobResponse Prelude.Text
startTableDataImportJobResponse_jobId :: Lens' StartTableDataImportJobResponse Text
startTableDataImportJobResponse_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTableDataImportJobResponse' {Text
jobId :: Text
$sel:jobId:StartTableDataImportJobResponse' :: StartTableDataImportJobResponse -> Text
jobId} -> Text
jobId) (\s :: StartTableDataImportJobResponse
s@StartTableDataImportJobResponse' {} Text
a -> StartTableDataImportJobResponse
s {$sel:jobId:StartTableDataImportJobResponse' :: Text
jobId = Text
a} :: StartTableDataImportJobResponse)

-- | The status of the import job immediately after submitting the request.
startTableDataImportJobResponse_jobStatus :: Lens.Lens' StartTableDataImportJobResponse TableDataImportJobStatus
startTableDataImportJobResponse_jobStatus :: Lens' StartTableDataImportJobResponse TableDataImportJobStatus
startTableDataImportJobResponse_jobStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTableDataImportJobResponse' {TableDataImportJobStatus
jobStatus :: TableDataImportJobStatus
$sel:jobStatus:StartTableDataImportJobResponse' :: StartTableDataImportJobResponse -> TableDataImportJobStatus
jobStatus} -> TableDataImportJobStatus
jobStatus) (\s :: StartTableDataImportJobResponse
s@StartTableDataImportJobResponse' {} TableDataImportJobStatus
a -> StartTableDataImportJobResponse
s {$sel:jobStatus:StartTableDataImportJobResponse' :: TableDataImportJobStatus
jobStatus = TableDataImportJobStatus
a} :: StartTableDataImportJobResponse)

instance
  Prelude.NFData
    StartTableDataImportJobResponse
  where
  rnf :: StartTableDataImportJobResponse -> ()
rnf StartTableDataImportJobResponse' {Int
Text
TableDataImportJobStatus
jobStatus :: TableDataImportJobStatus
jobId :: Text
httpStatus :: Int
$sel:jobStatus:StartTableDataImportJobResponse' :: StartTableDataImportJobResponse -> TableDataImportJobStatus
$sel:jobId:StartTableDataImportJobResponse' :: StartTableDataImportJobResponse -> Text
$sel:httpStatus:StartTableDataImportJobResponse' :: StartTableDataImportJobResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
jobId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf TableDataImportJobStatus
jobStatus