{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.TableDataImportJobMetadata
-- 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)
module Amazonka.HoneyCode.Types.TableDataImportJobMetadata where

import qualified Amazonka.Core as Core
import Amazonka.HoneyCode.Types.ImportDataSource
import Amazonka.HoneyCode.Types.ImportJobSubmitter
import Amazonka.HoneyCode.Types.ImportOptions
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The metadata associated with the table data import job that was
-- submitted.
--
-- /See:/ 'newTableDataImportJobMetadata' smart constructor.
data TableDataImportJobMetadata = TableDataImportJobMetadata'
  { -- | Details about the submitter of the import request.
    TableDataImportJobMetadata -> ImportJobSubmitter
submitter :: ImportJobSubmitter,
    -- | The timestamp when the job was submitted for import.
    TableDataImportJobMetadata -> POSIX
submitTime :: Core.POSIX,
    -- | The options that was specified at the time of submitting the import
    -- request.
    TableDataImportJobMetadata -> ImportOptions
importOptions :: ImportOptions,
    -- | The source of the data that was submitted for import.
    TableDataImportJobMetadata -> ImportDataSource
dataSource :: ImportDataSource
  }
  deriving (TableDataImportJobMetadata -> TableDataImportJobMetadata -> Bool
(TableDataImportJobMetadata -> TableDataImportJobMetadata -> Bool)
-> (TableDataImportJobMetadata
    -> TableDataImportJobMetadata -> Bool)
-> Eq TableDataImportJobMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TableDataImportJobMetadata -> TableDataImportJobMetadata -> Bool
$c/= :: TableDataImportJobMetadata -> TableDataImportJobMetadata -> Bool
== :: TableDataImportJobMetadata -> TableDataImportJobMetadata -> Bool
$c== :: TableDataImportJobMetadata -> TableDataImportJobMetadata -> Bool
Prelude.Eq, Int -> TableDataImportJobMetadata -> ShowS
[TableDataImportJobMetadata] -> ShowS
TableDataImportJobMetadata -> String
(Int -> TableDataImportJobMetadata -> ShowS)
-> (TableDataImportJobMetadata -> String)
-> ([TableDataImportJobMetadata] -> ShowS)
-> Show TableDataImportJobMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TableDataImportJobMetadata] -> ShowS
$cshowList :: [TableDataImportJobMetadata] -> ShowS
show :: TableDataImportJobMetadata -> String
$cshow :: TableDataImportJobMetadata -> String
showsPrec :: Int -> TableDataImportJobMetadata -> ShowS
$cshowsPrec :: Int -> TableDataImportJobMetadata -> ShowS
Prelude.Show, (forall x.
 TableDataImportJobMetadata -> Rep TableDataImportJobMetadata x)
-> (forall x.
    Rep TableDataImportJobMetadata x -> TableDataImportJobMetadata)
-> Generic TableDataImportJobMetadata
forall x.
Rep TableDataImportJobMetadata x -> TableDataImportJobMetadata
forall x.
TableDataImportJobMetadata -> Rep TableDataImportJobMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TableDataImportJobMetadata x -> TableDataImportJobMetadata
$cfrom :: forall x.
TableDataImportJobMetadata -> Rep TableDataImportJobMetadata x
Prelude.Generic)

-- |
-- Create a value of 'TableDataImportJobMetadata' 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:
--
-- 'submitter', 'tableDataImportJobMetadata_submitter' - Details about the submitter of the import request.
--
-- 'submitTime', 'tableDataImportJobMetadata_submitTime' - The timestamp when the job was submitted for import.
--
-- 'importOptions', 'tableDataImportJobMetadata_importOptions' - The options that was specified at the time of submitting the import
-- request.
--
-- 'dataSource', 'tableDataImportJobMetadata_dataSource' - The source of the data that was submitted for import.
newTableDataImportJobMetadata ::
  -- | 'submitter'
  ImportJobSubmitter ->
  -- | 'submitTime'
  Prelude.UTCTime ->
  -- | 'importOptions'
  ImportOptions ->
  -- | 'dataSource'
  ImportDataSource ->
  TableDataImportJobMetadata
newTableDataImportJobMetadata :: ImportJobSubmitter
-> UTCTime
-> ImportOptions
-> ImportDataSource
-> TableDataImportJobMetadata
newTableDataImportJobMetadata
  ImportJobSubmitter
pSubmitter_
  UTCTime
pSubmitTime_
  ImportOptions
pImportOptions_
  ImportDataSource
pDataSource_ =
    TableDataImportJobMetadata' :: ImportJobSubmitter
-> POSIX
-> ImportOptions
-> ImportDataSource
-> TableDataImportJobMetadata
TableDataImportJobMetadata'
      { $sel:submitter:TableDataImportJobMetadata' :: ImportJobSubmitter
submitter =
          ImportJobSubmitter
pSubmitter_,
        $sel:submitTime:TableDataImportJobMetadata' :: POSIX
submitTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pSubmitTime_,
        $sel:importOptions:TableDataImportJobMetadata' :: ImportOptions
importOptions = ImportOptions
pImportOptions_,
        $sel:dataSource:TableDataImportJobMetadata' :: ImportDataSource
dataSource = ImportDataSource
pDataSource_
      }

-- | Details about the submitter of the import request.
tableDataImportJobMetadata_submitter :: Lens.Lens' TableDataImportJobMetadata ImportJobSubmitter
tableDataImportJobMetadata_submitter :: (ImportJobSubmitter -> f ImportJobSubmitter)
-> TableDataImportJobMetadata -> f TableDataImportJobMetadata
tableDataImportJobMetadata_submitter = (TableDataImportJobMetadata -> ImportJobSubmitter)
-> (TableDataImportJobMetadata
    -> ImportJobSubmitter -> TableDataImportJobMetadata)
-> Lens
     TableDataImportJobMetadata
     TableDataImportJobMetadata
     ImportJobSubmitter
     ImportJobSubmitter
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableDataImportJobMetadata' {ImportJobSubmitter
submitter :: ImportJobSubmitter
$sel:submitter:TableDataImportJobMetadata' :: TableDataImportJobMetadata -> ImportJobSubmitter
submitter} -> ImportJobSubmitter
submitter) (\s :: TableDataImportJobMetadata
s@TableDataImportJobMetadata' {} ImportJobSubmitter
a -> TableDataImportJobMetadata
s {$sel:submitter:TableDataImportJobMetadata' :: ImportJobSubmitter
submitter = ImportJobSubmitter
a} :: TableDataImportJobMetadata)

-- | The timestamp when the job was submitted for import.
tableDataImportJobMetadata_submitTime :: Lens.Lens' TableDataImportJobMetadata Prelude.UTCTime
tableDataImportJobMetadata_submitTime :: (UTCTime -> f UTCTime)
-> TableDataImportJobMetadata -> f TableDataImportJobMetadata
tableDataImportJobMetadata_submitTime = (TableDataImportJobMetadata -> POSIX)
-> (TableDataImportJobMetadata
    -> POSIX -> TableDataImportJobMetadata)
-> Lens
     TableDataImportJobMetadata TableDataImportJobMetadata POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableDataImportJobMetadata' {POSIX
submitTime :: POSIX
$sel:submitTime:TableDataImportJobMetadata' :: TableDataImportJobMetadata -> POSIX
submitTime} -> POSIX
submitTime) (\s :: TableDataImportJobMetadata
s@TableDataImportJobMetadata' {} POSIX
a -> TableDataImportJobMetadata
s {$sel:submitTime:TableDataImportJobMetadata' :: POSIX
submitTime = POSIX
a} :: TableDataImportJobMetadata) ((POSIX -> f POSIX)
 -> TableDataImportJobMetadata -> f TableDataImportJobMetadata)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> TableDataImportJobMetadata
-> f TableDataImportJobMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The options that was specified at the time of submitting the import
-- request.
tableDataImportJobMetadata_importOptions :: Lens.Lens' TableDataImportJobMetadata ImportOptions
tableDataImportJobMetadata_importOptions :: (ImportOptions -> f ImportOptions)
-> TableDataImportJobMetadata -> f TableDataImportJobMetadata
tableDataImportJobMetadata_importOptions = (TableDataImportJobMetadata -> ImportOptions)
-> (TableDataImportJobMetadata
    -> ImportOptions -> TableDataImportJobMetadata)
-> Lens
     TableDataImportJobMetadata
     TableDataImportJobMetadata
     ImportOptions
     ImportOptions
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableDataImportJobMetadata' {ImportOptions
importOptions :: ImportOptions
$sel:importOptions:TableDataImportJobMetadata' :: TableDataImportJobMetadata -> ImportOptions
importOptions} -> ImportOptions
importOptions) (\s :: TableDataImportJobMetadata
s@TableDataImportJobMetadata' {} ImportOptions
a -> TableDataImportJobMetadata
s {$sel:importOptions:TableDataImportJobMetadata' :: ImportOptions
importOptions = ImportOptions
a} :: TableDataImportJobMetadata)

-- | The source of the data that was submitted for import.
tableDataImportJobMetadata_dataSource :: Lens.Lens' TableDataImportJobMetadata ImportDataSource
tableDataImportJobMetadata_dataSource :: (ImportDataSource -> f ImportDataSource)
-> TableDataImportJobMetadata -> f TableDataImportJobMetadata
tableDataImportJobMetadata_dataSource = (TableDataImportJobMetadata -> ImportDataSource)
-> (TableDataImportJobMetadata
    -> ImportDataSource -> TableDataImportJobMetadata)
-> Lens
     TableDataImportJobMetadata
     TableDataImportJobMetadata
     ImportDataSource
     ImportDataSource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableDataImportJobMetadata' {ImportDataSource
dataSource :: ImportDataSource
$sel:dataSource:TableDataImportJobMetadata' :: TableDataImportJobMetadata -> ImportDataSource
dataSource} -> ImportDataSource
dataSource) (\s :: TableDataImportJobMetadata
s@TableDataImportJobMetadata' {} ImportDataSource
a -> TableDataImportJobMetadata
s {$sel:dataSource:TableDataImportJobMetadata' :: ImportDataSource
dataSource = ImportDataSource
a} :: TableDataImportJobMetadata)

instance Core.FromJSON TableDataImportJobMetadata where
  parseJSON :: Value -> Parser TableDataImportJobMetadata
parseJSON =
    String
-> (Object -> Parser TableDataImportJobMetadata)
-> Value
-> Parser TableDataImportJobMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TableDataImportJobMetadata"
      ( \Object
x ->
          ImportJobSubmitter
-> POSIX
-> ImportOptions
-> ImportDataSource
-> TableDataImportJobMetadata
TableDataImportJobMetadata'
            (ImportJobSubmitter
 -> POSIX
 -> ImportOptions
 -> ImportDataSource
 -> TableDataImportJobMetadata)
-> Parser ImportJobSubmitter
-> Parser
     (POSIX
      -> ImportOptions -> ImportDataSource -> TableDataImportJobMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser ImportJobSubmitter
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"submitter")
            Parser
  (POSIX
   -> ImportOptions -> ImportDataSource -> TableDataImportJobMetadata)
-> Parser POSIX
-> Parser
     (ImportOptions -> ImportDataSource -> TableDataImportJobMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"submitTime")
            Parser
  (ImportOptions -> ImportDataSource -> TableDataImportJobMetadata)
-> Parser ImportOptions
-> Parser (ImportDataSource -> TableDataImportJobMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ImportOptions
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"importOptions")
            Parser (ImportDataSource -> TableDataImportJobMetadata)
-> Parser ImportDataSource -> Parser TableDataImportJobMetadata
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ImportDataSource
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"dataSource")
      )

instance Prelude.Hashable TableDataImportJobMetadata

instance Prelude.NFData TableDataImportJobMetadata