{-# 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.DocDbElastic.Types.ClusterSnapshotInList
-- 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.DocDbElastic.Types.ClusterSnapshotInList where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DocDbElastic.Types.Status
import qualified Amazonka.Prelude as Prelude

-- | A list of Elastic DocumentDB snapshots.
--
-- /See:/ 'newClusterSnapshotInList' smart constructor.
data ClusterSnapshotInList = ClusterSnapshotInList'
  { -- | The arn of the Elastic DocumentDB cluster.
    ClusterSnapshotInList -> Text
clusterArn :: Prelude.Text,
    -- | The arn of the Elastic DocumentDB snapshot
    ClusterSnapshotInList -> Text
snapshotArn :: Prelude.Text,
    -- | The time when the Elastic DocumentDB snapshot was created in Universal
    -- Coordinated Time (UTC).
    ClusterSnapshotInList -> Text
snapshotCreationTime :: Prelude.Text,
    -- | The name of the Elastic DocumentDB snapshot.
    ClusterSnapshotInList -> Text
snapshotName :: Prelude.Text,
    -- | The status of the Elastic DocumentDB snapshot.
    ClusterSnapshotInList -> Status
status :: Status
  }
  deriving (ClusterSnapshotInList -> ClusterSnapshotInList -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClusterSnapshotInList -> ClusterSnapshotInList -> Bool
$c/= :: ClusterSnapshotInList -> ClusterSnapshotInList -> Bool
== :: ClusterSnapshotInList -> ClusterSnapshotInList -> Bool
$c== :: ClusterSnapshotInList -> ClusterSnapshotInList -> Bool
Prelude.Eq, ReadPrec [ClusterSnapshotInList]
ReadPrec ClusterSnapshotInList
Int -> ReadS ClusterSnapshotInList
ReadS [ClusterSnapshotInList]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClusterSnapshotInList]
$creadListPrec :: ReadPrec [ClusterSnapshotInList]
readPrec :: ReadPrec ClusterSnapshotInList
$creadPrec :: ReadPrec ClusterSnapshotInList
readList :: ReadS [ClusterSnapshotInList]
$creadList :: ReadS [ClusterSnapshotInList]
readsPrec :: Int -> ReadS ClusterSnapshotInList
$creadsPrec :: Int -> ReadS ClusterSnapshotInList
Prelude.Read, Int -> ClusterSnapshotInList -> ShowS
[ClusterSnapshotInList] -> ShowS
ClusterSnapshotInList -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClusterSnapshotInList] -> ShowS
$cshowList :: [ClusterSnapshotInList] -> ShowS
show :: ClusterSnapshotInList -> String
$cshow :: ClusterSnapshotInList -> String
showsPrec :: Int -> ClusterSnapshotInList -> ShowS
$cshowsPrec :: Int -> ClusterSnapshotInList -> ShowS
Prelude.Show, forall x. Rep ClusterSnapshotInList x -> ClusterSnapshotInList
forall x. ClusterSnapshotInList -> Rep ClusterSnapshotInList x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClusterSnapshotInList x -> ClusterSnapshotInList
$cfrom :: forall x. ClusterSnapshotInList -> Rep ClusterSnapshotInList x
Prelude.Generic)

-- |
-- Create a value of 'ClusterSnapshotInList' 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:
--
-- 'clusterArn', 'clusterSnapshotInList_clusterArn' - The arn of the Elastic DocumentDB cluster.
--
-- 'snapshotArn', 'clusterSnapshotInList_snapshotArn' - The arn of the Elastic DocumentDB snapshot
--
-- 'snapshotCreationTime', 'clusterSnapshotInList_snapshotCreationTime' - The time when the Elastic DocumentDB snapshot was created in Universal
-- Coordinated Time (UTC).
--
-- 'snapshotName', 'clusterSnapshotInList_snapshotName' - The name of the Elastic DocumentDB snapshot.
--
-- 'status', 'clusterSnapshotInList_status' - The status of the Elastic DocumentDB snapshot.
newClusterSnapshotInList ::
  -- | 'clusterArn'
  Prelude.Text ->
  -- | 'snapshotArn'
  Prelude.Text ->
  -- | 'snapshotCreationTime'
  Prelude.Text ->
  -- | 'snapshotName'
  Prelude.Text ->
  -- | 'status'
  Status ->
  ClusterSnapshotInList
newClusterSnapshotInList :: Text -> Text -> Text -> Text -> Status -> ClusterSnapshotInList
newClusterSnapshotInList
  Text
pClusterArn_
  Text
pSnapshotArn_
  Text
pSnapshotCreationTime_
  Text
pSnapshotName_
  Status
pStatus_ =
    ClusterSnapshotInList'
      { $sel:clusterArn:ClusterSnapshotInList' :: Text
clusterArn = Text
pClusterArn_,
        $sel:snapshotArn:ClusterSnapshotInList' :: Text
snapshotArn = Text
pSnapshotArn_,
        $sel:snapshotCreationTime:ClusterSnapshotInList' :: Text
snapshotCreationTime = Text
pSnapshotCreationTime_,
        $sel:snapshotName:ClusterSnapshotInList' :: Text
snapshotName = Text
pSnapshotName_,
        $sel:status:ClusterSnapshotInList' :: Status
status = Status
pStatus_
      }

-- | The arn of the Elastic DocumentDB cluster.
clusterSnapshotInList_clusterArn :: Lens.Lens' ClusterSnapshotInList Prelude.Text
clusterSnapshotInList_clusterArn :: Lens' ClusterSnapshotInList Text
clusterSnapshotInList_clusterArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSnapshotInList' {Text
clusterArn :: Text
$sel:clusterArn:ClusterSnapshotInList' :: ClusterSnapshotInList -> Text
clusterArn} -> Text
clusterArn) (\s :: ClusterSnapshotInList
s@ClusterSnapshotInList' {} Text
a -> ClusterSnapshotInList
s {$sel:clusterArn:ClusterSnapshotInList' :: Text
clusterArn = Text
a} :: ClusterSnapshotInList)

-- | The arn of the Elastic DocumentDB snapshot
clusterSnapshotInList_snapshotArn :: Lens.Lens' ClusterSnapshotInList Prelude.Text
clusterSnapshotInList_snapshotArn :: Lens' ClusterSnapshotInList Text
clusterSnapshotInList_snapshotArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSnapshotInList' {Text
snapshotArn :: Text
$sel:snapshotArn:ClusterSnapshotInList' :: ClusterSnapshotInList -> Text
snapshotArn} -> Text
snapshotArn) (\s :: ClusterSnapshotInList
s@ClusterSnapshotInList' {} Text
a -> ClusterSnapshotInList
s {$sel:snapshotArn:ClusterSnapshotInList' :: Text
snapshotArn = Text
a} :: ClusterSnapshotInList)

-- | The time when the Elastic DocumentDB snapshot was created in Universal
-- Coordinated Time (UTC).
clusterSnapshotInList_snapshotCreationTime :: Lens.Lens' ClusterSnapshotInList Prelude.Text
clusterSnapshotInList_snapshotCreationTime :: Lens' ClusterSnapshotInList Text
clusterSnapshotInList_snapshotCreationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSnapshotInList' {Text
snapshotCreationTime :: Text
$sel:snapshotCreationTime:ClusterSnapshotInList' :: ClusterSnapshotInList -> Text
snapshotCreationTime} -> Text
snapshotCreationTime) (\s :: ClusterSnapshotInList
s@ClusterSnapshotInList' {} Text
a -> ClusterSnapshotInList
s {$sel:snapshotCreationTime:ClusterSnapshotInList' :: Text
snapshotCreationTime = Text
a} :: ClusterSnapshotInList)

-- | The name of the Elastic DocumentDB snapshot.
clusterSnapshotInList_snapshotName :: Lens.Lens' ClusterSnapshotInList Prelude.Text
clusterSnapshotInList_snapshotName :: Lens' ClusterSnapshotInList Text
clusterSnapshotInList_snapshotName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSnapshotInList' {Text
snapshotName :: Text
$sel:snapshotName:ClusterSnapshotInList' :: ClusterSnapshotInList -> Text
snapshotName} -> Text
snapshotName) (\s :: ClusterSnapshotInList
s@ClusterSnapshotInList' {} Text
a -> ClusterSnapshotInList
s {$sel:snapshotName:ClusterSnapshotInList' :: Text
snapshotName = Text
a} :: ClusterSnapshotInList)

-- | The status of the Elastic DocumentDB snapshot.
clusterSnapshotInList_status :: Lens.Lens' ClusterSnapshotInList Status
clusterSnapshotInList_status :: Lens' ClusterSnapshotInList Status
clusterSnapshotInList_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSnapshotInList' {Status
status :: Status
$sel:status:ClusterSnapshotInList' :: ClusterSnapshotInList -> Status
status} -> Status
status) (\s :: ClusterSnapshotInList
s@ClusterSnapshotInList' {} Status
a -> ClusterSnapshotInList
s {$sel:status:ClusterSnapshotInList' :: Status
status = Status
a} :: ClusterSnapshotInList)

instance Data.FromJSON ClusterSnapshotInList where
  parseJSON :: Value -> Parser ClusterSnapshotInList
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ClusterSnapshotInList"
      ( \Object
x ->
          Text -> Text -> Text -> Text -> Status -> ClusterSnapshotInList
ClusterSnapshotInList'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"clusterArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"snapshotArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"snapshotCreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"snapshotName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"status")
      )

instance Prelude.Hashable ClusterSnapshotInList where
  hashWithSalt :: Int -> ClusterSnapshotInList -> Int
hashWithSalt Int
_salt ClusterSnapshotInList' {Text
Status
status :: Status
snapshotName :: Text
snapshotCreationTime :: Text
snapshotArn :: Text
clusterArn :: Text
$sel:status:ClusterSnapshotInList' :: ClusterSnapshotInList -> Status
$sel:snapshotName:ClusterSnapshotInList' :: ClusterSnapshotInList -> Text
$sel:snapshotCreationTime:ClusterSnapshotInList' :: ClusterSnapshotInList -> Text
$sel:snapshotArn:ClusterSnapshotInList' :: ClusterSnapshotInList -> Text
$sel:clusterArn:ClusterSnapshotInList' :: ClusterSnapshotInList -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clusterArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
snapshotArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
snapshotCreationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
snapshotName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Status
status

instance Prelude.NFData ClusterSnapshotInList where
  rnf :: ClusterSnapshotInList -> ()
rnf ClusterSnapshotInList' {Text
Status
status :: Status
snapshotName :: Text
snapshotCreationTime :: Text
snapshotArn :: Text
clusterArn :: Text
$sel:status:ClusterSnapshotInList' :: ClusterSnapshotInList -> Status
$sel:snapshotName:ClusterSnapshotInList' :: ClusterSnapshotInList -> Text
$sel:snapshotCreationTime:ClusterSnapshotInList' :: ClusterSnapshotInList -> Text
$sel:snapshotArn:ClusterSnapshotInList' :: ClusterSnapshotInList -> Text
$sel:clusterArn:ClusterSnapshotInList' :: ClusterSnapshotInList -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
clusterArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
snapshotArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
snapshotCreationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
snapshotName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Status
status