{-# 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.LexV2Models.Types.ExportSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.LexV2Models.Types.ExportSummary 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.ExportResourceSpecification
import Amazonka.LexV2Models.Types.ExportStatus
import Amazonka.LexV2Models.Types.ImportExportFileFormat
import qualified Amazonka.Prelude as Prelude

-- | Provides summary information about an export in an export list.
--
-- /See:/ 'newExportSummary' smart constructor.
data ExportSummary = ExportSummary'
  { -- | The date and time that the export was created.
    ExportSummary -> Maybe POSIX
creationDateTime :: Prelude.Maybe Data.POSIX,
    -- | The unique identifier that Amazon Lex assigned to the export.
    ExportSummary -> Maybe Text
exportId :: Prelude.Maybe Prelude.Text,
    -- | The status of the export. When the status is @Completed@ the export is
    -- ready to download.
    ExportSummary -> Maybe ExportStatus
exportStatus :: Prelude.Maybe ExportStatus,
    -- | The file format used in the export files.
    ExportSummary -> Maybe ImportExportFileFormat
fileFormat :: Prelude.Maybe ImportExportFileFormat,
    -- | The date and time that the export was last updated.
    ExportSummary -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Data.POSIX,
    -- | Information about the bot or bot locale that was exported.
    ExportSummary -> Maybe ExportResourceSpecification
resourceSpecification :: Prelude.Maybe ExportResourceSpecification
  }
  deriving (ExportSummary -> ExportSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportSummary -> ExportSummary -> Bool
$c/= :: ExportSummary -> ExportSummary -> Bool
== :: ExportSummary -> ExportSummary -> Bool
$c== :: ExportSummary -> ExportSummary -> Bool
Prelude.Eq, ReadPrec [ExportSummary]
ReadPrec ExportSummary
Int -> ReadS ExportSummary
ReadS [ExportSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportSummary]
$creadListPrec :: ReadPrec [ExportSummary]
readPrec :: ReadPrec ExportSummary
$creadPrec :: ReadPrec ExportSummary
readList :: ReadS [ExportSummary]
$creadList :: ReadS [ExportSummary]
readsPrec :: Int -> ReadS ExportSummary
$creadsPrec :: Int -> ReadS ExportSummary
Prelude.Read, Int -> ExportSummary -> ShowS
[ExportSummary] -> ShowS
ExportSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportSummary] -> ShowS
$cshowList :: [ExportSummary] -> ShowS
show :: ExportSummary -> String
$cshow :: ExportSummary -> String
showsPrec :: Int -> ExportSummary -> ShowS
$cshowsPrec :: Int -> ExportSummary -> ShowS
Prelude.Show, forall x. Rep ExportSummary x -> ExportSummary
forall x. ExportSummary -> Rep ExportSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExportSummary x -> ExportSummary
$cfrom :: forall x. ExportSummary -> Rep ExportSummary x
Prelude.Generic)

-- |
-- Create a value of 'ExportSummary' 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', 'exportSummary_creationDateTime' - The date and time that the export was created.
--
-- 'exportId', 'exportSummary_exportId' - The unique identifier that Amazon Lex assigned to the export.
--
-- 'exportStatus', 'exportSummary_exportStatus' - The status of the export. When the status is @Completed@ the export is
-- ready to download.
--
-- 'fileFormat', 'exportSummary_fileFormat' - The file format used in the export files.
--
-- 'lastUpdatedDateTime', 'exportSummary_lastUpdatedDateTime' - The date and time that the export was last updated.
--
-- 'resourceSpecification', 'exportSummary_resourceSpecification' - Information about the bot or bot locale that was exported.
newExportSummary ::
  ExportSummary
newExportSummary :: ExportSummary
newExportSummary =
  ExportSummary'
    { $sel:creationDateTime:ExportSummary' :: Maybe POSIX
creationDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:exportId:ExportSummary' :: Maybe Text
exportId = forall a. Maybe a
Prelude.Nothing,
      $sel:exportStatus:ExportSummary' :: Maybe ExportStatus
exportStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:fileFormat:ExportSummary' :: Maybe ImportExportFileFormat
fileFormat = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:ExportSummary' :: Maybe POSIX
lastUpdatedDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceSpecification:ExportSummary' :: Maybe ExportResourceSpecification
resourceSpecification = forall a. Maybe a
Prelude.Nothing
    }

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

-- | The unique identifier that Amazon Lex assigned to the export.
exportSummary_exportId :: Lens.Lens' ExportSummary (Prelude.Maybe Prelude.Text)
exportSummary_exportId :: Lens' ExportSummary (Maybe Text)
exportSummary_exportId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSummary' {Maybe Text
exportId :: Maybe Text
$sel:exportId:ExportSummary' :: ExportSummary -> Maybe Text
exportId} -> Maybe Text
exportId) (\s :: ExportSummary
s@ExportSummary' {} Maybe Text
a -> ExportSummary
s {$sel:exportId:ExportSummary' :: Maybe Text
exportId = Maybe Text
a} :: ExportSummary)

-- | The status of the export. When the status is @Completed@ the export is
-- ready to download.
exportSummary_exportStatus :: Lens.Lens' ExportSummary (Prelude.Maybe ExportStatus)
exportSummary_exportStatus :: Lens' ExportSummary (Maybe ExportStatus)
exportSummary_exportStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSummary' {Maybe ExportStatus
exportStatus :: Maybe ExportStatus
$sel:exportStatus:ExportSummary' :: ExportSummary -> Maybe ExportStatus
exportStatus} -> Maybe ExportStatus
exportStatus) (\s :: ExportSummary
s@ExportSummary' {} Maybe ExportStatus
a -> ExportSummary
s {$sel:exportStatus:ExportSummary' :: Maybe ExportStatus
exportStatus = Maybe ExportStatus
a} :: ExportSummary)

-- | The file format used in the export files.
exportSummary_fileFormat :: Lens.Lens' ExportSummary (Prelude.Maybe ImportExportFileFormat)
exportSummary_fileFormat :: Lens' ExportSummary (Maybe ImportExportFileFormat)
exportSummary_fileFormat = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSummary' {Maybe ImportExportFileFormat
fileFormat :: Maybe ImportExportFileFormat
$sel:fileFormat:ExportSummary' :: ExportSummary -> Maybe ImportExportFileFormat
fileFormat} -> Maybe ImportExportFileFormat
fileFormat) (\s :: ExportSummary
s@ExportSummary' {} Maybe ImportExportFileFormat
a -> ExportSummary
s {$sel:fileFormat:ExportSummary' :: Maybe ImportExportFileFormat
fileFormat = Maybe ImportExportFileFormat
a} :: ExportSummary)

-- | The date and time that the export was last updated.
exportSummary_lastUpdatedDateTime :: Lens.Lens' ExportSummary (Prelude.Maybe Prelude.UTCTime)
exportSummary_lastUpdatedDateTime :: Lens' ExportSummary (Maybe UTCTime)
exportSummary_lastUpdatedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSummary' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:ExportSummary' :: ExportSummary -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: ExportSummary
s@ExportSummary' {} Maybe POSIX
a -> ExportSummary
s {$sel:lastUpdatedDateTime:ExportSummary' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: ExportSummary) 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

-- | Information about the bot or bot locale that was exported.
exportSummary_resourceSpecification :: Lens.Lens' ExportSummary (Prelude.Maybe ExportResourceSpecification)
exportSummary_resourceSpecification :: Lens' ExportSummary (Maybe ExportResourceSpecification)
exportSummary_resourceSpecification = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSummary' {Maybe ExportResourceSpecification
resourceSpecification :: Maybe ExportResourceSpecification
$sel:resourceSpecification:ExportSummary' :: ExportSummary -> Maybe ExportResourceSpecification
resourceSpecification} -> Maybe ExportResourceSpecification
resourceSpecification) (\s :: ExportSummary
s@ExportSummary' {} Maybe ExportResourceSpecification
a -> ExportSummary
s {$sel:resourceSpecification:ExportSummary' :: Maybe ExportResourceSpecification
resourceSpecification = Maybe ExportResourceSpecification
a} :: ExportSummary)

instance Data.FromJSON ExportSummary where
  parseJSON :: Value -> Parser ExportSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ExportSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe ExportStatus
-> Maybe ImportExportFileFormat
-> Maybe POSIX
-> Maybe ExportResourceSpecification
-> ExportSummary
ExportSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (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 -> Parser (Maybe a)
Data..:? Key
"exportId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"exportStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"fileFormat")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lastUpdatedDateTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"resourceSpecification")
      )

instance Prelude.Hashable ExportSummary where
  hashWithSalt :: Int -> ExportSummary -> Int
hashWithSalt Int
_salt ExportSummary' {Maybe Text
Maybe POSIX
Maybe ExportResourceSpecification
Maybe ExportStatus
Maybe ImportExportFileFormat
resourceSpecification :: Maybe ExportResourceSpecification
lastUpdatedDateTime :: Maybe POSIX
fileFormat :: Maybe ImportExportFileFormat
exportStatus :: Maybe ExportStatus
exportId :: Maybe Text
creationDateTime :: Maybe POSIX
$sel:resourceSpecification:ExportSummary' :: ExportSummary -> Maybe ExportResourceSpecification
$sel:lastUpdatedDateTime:ExportSummary' :: ExportSummary -> Maybe POSIX
$sel:fileFormat:ExportSummary' :: ExportSummary -> Maybe ImportExportFileFormat
$sel:exportStatus:ExportSummary' :: ExportSummary -> Maybe ExportStatus
$sel:exportId:ExportSummary' :: ExportSummary -> Maybe Text
$sel:creationDateTime:ExportSummary' :: ExportSummary -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
exportId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ExportStatus
exportStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ImportExportFileFormat
fileFormat
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ExportResourceSpecification
resourceSpecification

instance Prelude.NFData ExportSummary where
  rnf :: ExportSummary -> ()
rnf ExportSummary' {Maybe Text
Maybe POSIX
Maybe ExportResourceSpecification
Maybe ExportStatus
Maybe ImportExportFileFormat
resourceSpecification :: Maybe ExportResourceSpecification
lastUpdatedDateTime :: Maybe POSIX
fileFormat :: Maybe ImportExportFileFormat
exportStatus :: Maybe ExportStatus
exportId :: Maybe Text
creationDateTime :: Maybe POSIX
$sel:resourceSpecification:ExportSummary' :: ExportSummary -> Maybe ExportResourceSpecification
$sel:lastUpdatedDateTime:ExportSummary' :: ExportSummary -> Maybe POSIX
$sel:fileFormat:ExportSummary' :: ExportSummary -> Maybe ImportExportFileFormat
$sel:exportStatus:ExportSummary' :: ExportSummary -> Maybe ExportStatus
$sel:exportId:ExportSummary' :: ExportSummary -> Maybe Text
$sel:creationDateTime:ExportSummary' :: ExportSummary -> 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
exportId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ExportStatus
exportStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ImportExportFileFormat
fileFormat
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ExportResourceSpecification
resourceSpecification