{-# 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.DynamoDB.Types.ExportSummary
-- 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.DynamoDB.Types.ExportSummary where

import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.Types.ExportStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Summary information about an export task.
--
-- /See:/ 'newExportSummary' smart constructor.
data ExportSummary = ExportSummary'
  { -- | Export can be in one of the following states: IN_PROGRESS, COMPLETED, or
    -- FAILED.
    ExportSummary -> Maybe ExportStatus
exportStatus :: Prelude.Maybe ExportStatus,
    -- | The Amazon Resource Name (ARN) of the export.
    ExportSummary -> Maybe Text
exportArn :: Prelude.Maybe Prelude.Text
  }
  deriving (ExportSummary -> ExportSummary -> Bool
(ExportSummary -> ExportSummary -> Bool)
-> (ExportSummary -> ExportSummary -> Bool) -> Eq ExportSummary
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]
(Int -> ReadS ExportSummary)
-> ReadS [ExportSummary]
-> ReadPrec ExportSummary
-> ReadPrec [ExportSummary]
-> Read 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
(Int -> ExportSummary -> ShowS)
-> (ExportSummary -> String)
-> ([ExportSummary] -> ShowS)
-> Show ExportSummary
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. ExportSummary -> Rep ExportSummary x)
-> (forall x. Rep ExportSummary x -> ExportSummary)
-> Generic ExportSummary
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:
--
-- 'exportStatus', 'exportSummary_exportStatus' - Export can be in one of the following states: IN_PROGRESS, COMPLETED, or
-- FAILED.
--
-- 'exportArn', 'exportSummary_exportArn' - The Amazon Resource Name (ARN) of the export.
newExportSummary ::
  ExportSummary
newExportSummary :: ExportSummary
newExportSummary =
  ExportSummary' :: Maybe ExportStatus -> Maybe Text -> ExportSummary
ExportSummary'
    { $sel:exportStatus:ExportSummary' :: Maybe ExportStatus
exportStatus = Maybe ExportStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:exportArn:ExportSummary' :: Maybe Text
exportArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Export can be in one of the following states: IN_PROGRESS, COMPLETED, or
-- FAILED.
exportSummary_exportStatus :: Lens.Lens' ExportSummary (Prelude.Maybe ExportStatus)
exportSummary_exportStatus :: (Maybe ExportStatus -> f (Maybe ExportStatus))
-> ExportSummary -> f ExportSummary
exportSummary_exportStatus = (ExportSummary -> Maybe ExportStatus)
-> (ExportSummary -> Maybe ExportStatus -> ExportSummary)
-> Lens
     ExportSummary
     ExportSummary
     (Maybe ExportStatus)
     (Maybe 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 Amazon Resource Name (ARN) of the export.
exportSummary_exportArn :: Lens.Lens' ExportSummary (Prelude.Maybe Prelude.Text)
exportSummary_exportArn :: (Maybe Text -> f (Maybe Text)) -> ExportSummary -> f ExportSummary
exportSummary_exportArn = (ExportSummary -> Maybe Text)
-> (ExportSummary -> Maybe Text -> ExportSummary)
-> Lens ExportSummary ExportSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSummary' {Maybe Text
exportArn :: Maybe Text
$sel:exportArn:ExportSummary' :: ExportSummary -> Maybe Text
exportArn} -> Maybe Text
exportArn) (\s :: ExportSummary
s@ExportSummary' {} Maybe Text
a -> ExportSummary
s {$sel:exportArn:ExportSummary' :: Maybe Text
exportArn = Maybe Text
a} :: ExportSummary)

instance Core.FromJSON ExportSummary where
  parseJSON :: Value -> Parser ExportSummary
parseJSON =
    String
-> (Object -> Parser ExportSummary)
-> Value
-> Parser ExportSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ExportSummary"
      ( \Object
x ->
          Maybe ExportStatus -> Maybe Text -> ExportSummary
ExportSummary'
            (Maybe ExportStatus -> Maybe Text -> ExportSummary)
-> Parser (Maybe ExportStatus)
-> Parser (Maybe Text -> ExportSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ExportStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExportStatus")
            Parser (Maybe Text -> ExportSummary)
-> Parser (Maybe Text) -> Parser ExportSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExportArn")
      )

instance Prelude.Hashable ExportSummary

instance Prelude.NFData ExportSummary