{-# 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 #-}
module Amazonka.FSx.Types.Snapshot where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import {-# SOURCE #-} Amazonka.FSx.Types.AdministrativeAction
import Amazonka.FSx.Types.LifecycleTransitionReason
import Amazonka.FSx.Types.SnapshotLifecycle
import Amazonka.FSx.Types.Tag
import qualified Amazonka.Prelude as Prelude
data Snapshot = Snapshot'
{
Snapshot -> Maybe [AdministrativeAction]
administrativeActions :: Prelude.Maybe [AdministrativeAction],
Snapshot -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
Snapshot -> Maybe SnapshotLifecycle
lifecycle :: Prelude.Maybe SnapshotLifecycle,
Snapshot -> Maybe LifecycleTransitionReason
lifecycleTransitionReason :: Prelude.Maybe LifecycleTransitionReason,
Snapshot -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Snapshot -> Maybe Text
resourceARN :: Prelude.Maybe Prelude.Text,
Snapshot -> Maybe Text
snapshotId :: Prelude.Maybe Prelude.Text,
Snapshot -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
Snapshot -> Maybe Text
volumeId :: Prelude.Maybe Prelude.Text
}
deriving (Snapshot -> Snapshot -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Snapshot -> Snapshot -> Bool
$c/= :: Snapshot -> Snapshot -> Bool
== :: Snapshot -> Snapshot -> Bool
$c== :: Snapshot -> Snapshot -> Bool
Prelude.Eq, ReadPrec [Snapshot]
ReadPrec Snapshot
Int -> ReadS Snapshot
ReadS [Snapshot]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Snapshot]
$creadListPrec :: ReadPrec [Snapshot]
readPrec :: ReadPrec Snapshot
$creadPrec :: ReadPrec Snapshot
readList :: ReadS [Snapshot]
$creadList :: ReadS [Snapshot]
readsPrec :: Int -> ReadS Snapshot
$creadsPrec :: Int -> ReadS Snapshot
Prelude.Read, Int -> Snapshot -> ShowS
[Snapshot] -> ShowS
Snapshot -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Snapshot] -> ShowS
$cshowList :: [Snapshot] -> ShowS
show :: Snapshot -> String
$cshow :: Snapshot -> String
showsPrec :: Int -> Snapshot -> ShowS
$cshowsPrec :: Int -> Snapshot -> ShowS
Prelude.Show, forall x. Rep Snapshot x -> Snapshot
forall x. Snapshot -> Rep Snapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Snapshot x -> Snapshot
$cfrom :: forall x. Snapshot -> Rep Snapshot x
Prelude.Generic)
newSnapshot ::
Snapshot
newSnapshot :: Snapshot
newSnapshot =
Snapshot'
{ $sel:administrativeActions:Snapshot' :: Maybe [AdministrativeAction]
administrativeActions = forall a. Maybe a
Prelude.Nothing,
$sel:creationTime:Snapshot' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
$sel:lifecycle:Snapshot' :: Maybe SnapshotLifecycle
lifecycle = forall a. Maybe a
Prelude.Nothing,
$sel:lifecycleTransitionReason:Snapshot' :: Maybe LifecycleTransitionReason
lifecycleTransitionReason = forall a. Maybe a
Prelude.Nothing,
$sel:name:Snapshot' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:resourceARN:Snapshot' :: Maybe Text
resourceARN = forall a. Maybe a
Prelude.Nothing,
$sel:snapshotId:Snapshot' :: Maybe Text
snapshotId = forall a. Maybe a
Prelude.Nothing,
$sel:tags:Snapshot' :: Maybe (NonEmpty Tag)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:volumeId:Snapshot' :: Maybe Text
volumeId = forall a. Maybe a
Prelude.Nothing
}
snapshot_administrativeActions :: Lens.Lens' Snapshot (Prelude.Maybe [AdministrativeAction])
snapshot_administrativeActions :: Lens' Snapshot (Maybe [AdministrativeAction])
snapshot_administrativeActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe [AdministrativeAction]
administrativeActions :: Maybe [AdministrativeAction]
$sel:administrativeActions:Snapshot' :: Snapshot -> Maybe [AdministrativeAction]
administrativeActions} -> Maybe [AdministrativeAction]
administrativeActions) (\s :: Snapshot
s@Snapshot' {} Maybe [AdministrativeAction]
a -> Snapshot
s {$sel:administrativeActions:Snapshot' :: Maybe [AdministrativeAction]
administrativeActions = Maybe [AdministrativeAction]
a} :: Snapshot) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
snapshot_creationTime :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.UTCTime)
snapshot_creationTime :: Lens' Snapshot (Maybe UTCTime)
snapshot_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:Snapshot' :: Snapshot -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: Snapshot
s@Snapshot' {} Maybe POSIX
a -> Snapshot
s {$sel:creationTime:Snapshot' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: Snapshot) 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
snapshot_lifecycle :: Lens.Lens' Snapshot (Prelude.Maybe SnapshotLifecycle)
snapshot_lifecycle :: Lens' Snapshot (Maybe SnapshotLifecycle)
snapshot_lifecycle = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe SnapshotLifecycle
lifecycle :: Maybe SnapshotLifecycle
$sel:lifecycle:Snapshot' :: Snapshot -> Maybe SnapshotLifecycle
lifecycle} -> Maybe SnapshotLifecycle
lifecycle) (\s :: Snapshot
s@Snapshot' {} Maybe SnapshotLifecycle
a -> Snapshot
s {$sel:lifecycle:Snapshot' :: Maybe SnapshotLifecycle
lifecycle = Maybe SnapshotLifecycle
a} :: Snapshot)
snapshot_lifecycleTransitionReason :: Lens.Lens' Snapshot (Prelude.Maybe LifecycleTransitionReason)
snapshot_lifecycleTransitionReason :: Lens' Snapshot (Maybe LifecycleTransitionReason)
snapshot_lifecycleTransitionReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe LifecycleTransitionReason
lifecycleTransitionReason :: Maybe LifecycleTransitionReason
$sel:lifecycleTransitionReason:Snapshot' :: Snapshot -> Maybe LifecycleTransitionReason
lifecycleTransitionReason} -> Maybe LifecycleTransitionReason
lifecycleTransitionReason) (\s :: Snapshot
s@Snapshot' {} Maybe LifecycleTransitionReason
a -> Snapshot
s {$sel:lifecycleTransitionReason:Snapshot' :: Maybe LifecycleTransitionReason
lifecycleTransitionReason = Maybe LifecycleTransitionReason
a} :: Snapshot)
snapshot_name :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_name :: Lens' Snapshot (Maybe Text)
snapshot_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
name :: Maybe Text
$sel:name:Snapshot' :: Snapshot -> Maybe Text
name} -> Maybe Text
name) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:name:Snapshot' :: Maybe Text
name = Maybe Text
a} :: Snapshot)
snapshot_resourceARN :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_resourceARN :: Lens' Snapshot (Maybe Text)
snapshot_resourceARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
resourceARN :: Maybe Text
$sel:resourceARN:Snapshot' :: Snapshot -> Maybe Text
resourceARN} -> Maybe Text
resourceARN) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:resourceARN:Snapshot' :: Maybe Text
resourceARN = Maybe Text
a} :: Snapshot)
snapshot_snapshotId :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_snapshotId :: Lens' Snapshot (Maybe Text)
snapshot_snapshotId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
snapshotId :: Maybe Text
$sel:snapshotId:Snapshot' :: Snapshot -> Maybe Text
snapshotId} -> Maybe Text
snapshotId) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:snapshotId:Snapshot' :: Maybe Text
snapshotId = Maybe Text
a} :: Snapshot)
snapshot_tags :: Lens.Lens' Snapshot (Prelude.Maybe (Prelude.NonEmpty Tag))
snapshot_tags :: Lens' Snapshot (Maybe (NonEmpty Tag))
snapshot_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:Snapshot' :: Snapshot -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: Snapshot
s@Snapshot' {} Maybe (NonEmpty Tag)
a -> Snapshot
s {$sel:tags:Snapshot' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: Snapshot) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
snapshot_volumeId :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_volumeId :: Lens' Snapshot (Maybe Text)
snapshot_volumeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
volumeId :: Maybe Text
$sel:volumeId:Snapshot' :: Snapshot -> Maybe Text
volumeId} -> Maybe Text
volumeId) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:volumeId:Snapshot' :: Maybe Text
volumeId = Maybe Text
a} :: Snapshot)
instance Data.FromJSON Snapshot where
parseJSON :: Value -> Parser Snapshot
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Snapshot"
( \Object
x ->
Maybe [AdministrativeAction]
-> Maybe POSIX
-> Maybe SnapshotLifecycle
-> Maybe LifecycleTransitionReason
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Maybe Text
-> Snapshot
Snapshot'
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
"AdministrativeActions"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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
"CreationTime")
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
"Lifecycle")
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
"LifecycleTransitionReason")
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
"Name")
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
"ResourceARN")
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
"SnapshotId")
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
"Tags")
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
"VolumeId")
)
instance Prelude.Hashable Snapshot where
hashWithSalt :: Int -> Snapshot -> Int
hashWithSalt Int
_salt Snapshot' {Maybe [AdministrativeAction]
Maybe (NonEmpty Tag)
Maybe Text
Maybe POSIX
Maybe LifecycleTransitionReason
Maybe SnapshotLifecycle
volumeId :: Maybe Text
tags :: Maybe (NonEmpty Tag)
snapshotId :: Maybe Text
resourceARN :: Maybe Text
name :: Maybe Text
lifecycleTransitionReason :: Maybe LifecycleTransitionReason
lifecycle :: Maybe SnapshotLifecycle
creationTime :: Maybe POSIX
administrativeActions :: Maybe [AdministrativeAction]
$sel:volumeId:Snapshot' :: Snapshot -> Maybe Text
$sel:tags:Snapshot' :: Snapshot -> Maybe (NonEmpty Tag)
$sel:snapshotId:Snapshot' :: Snapshot -> Maybe Text
$sel:resourceARN:Snapshot' :: Snapshot -> Maybe Text
$sel:name:Snapshot' :: Snapshot -> Maybe Text
$sel:lifecycleTransitionReason:Snapshot' :: Snapshot -> Maybe LifecycleTransitionReason
$sel:lifecycle:Snapshot' :: Snapshot -> Maybe SnapshotLifecycle
$sel:creationTime:Snapshot' :: Snapshot -> Maybe POSIX
$sel:administrativeActions:Snapshot' :: Snapshot -> Maybe [AdministrativeAction]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AdministrativeAction]
administrativeActions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SnapshotLifecycle
lifecycle
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LifecycleTransitionReason
lifecycleTransitionReason
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceARN
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snapshotId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Tag)
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeId
instance Prelude.NFData Snapshot where
rnf :: Snapshot -> ()
rnf Snapshot' {Maybe [AdministrativeAction]
Maybe (NonEmpty Tag)
Maybe Text
Maybe POSIX
Maybe LifecycleTransitionReason
Maybe SnapshotLifecycle
volumeId :: Maybe Text
tags :: Maybe (NonEmpty Tag)
snapshotId :: Maybe Text
resourceARN :: Maybe Text
name :: Maybe Text
lifecycleTransitionReason :: Maybe LifecycleTransitionReason
lifecycle :: Maybe SnapshotLifecycle
creationTime :: Maybe POSIX
administrativeActions :: Maybe [AdministrativeAction]
$sel:volumeId:Snapshot' :: Snapshot -> Maybe Text
$sel:tags:Snapshot' :: Snapshot -> Maybe (NonEmpty Tag)
$sel:snapshotId:Snapshot' :: Snapshot -> Maybe Text
$sel:resourceARN:Snapshot' :: Snapshot -> Maybe Text
$sel:name:Snapshot' :: Snapshot -> Maybe Text
$sel:lifecycleTransitionReason:Snapshot' :: Snapshot -> Maybe LifecycleTransitionReason
$sel:lifecycle:Snapshot' :: Snapshot -> Maybe SnapshotLifecycle
$sel:creationTime:Snapshot' :: Snapshot -> Maybe POSIX
$sel:administrativeActions:Snapshot' :: Snapshot -> Maybe [AdministrativeAction]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [AdministrativeAction]
administrativeActions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SnapshotLifecycle
lifecycle
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LifecycleTransitionReason
lifecycleTransitionReason
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceARN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Tag)
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
volumeId