{-# 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.Lightsail.Types.DiskSnapshot
-- 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.Lightsail.Types.DiskSnapshot where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lightsail.Types.DiskSnapshotState
import Amazonka.Lightsail.Types.ResourceLocation
import Amazonka.Lightsail.Types.ResourceType
import Amazonka.Lightsail.Types.Tag
import qualified Amazonka.Prelude as Prelude

-- | Describes a block storage disk snapshot.
--
-- /See:/ 'newDiskSnapshot' smart constructor.
data DiskSnapshot = DiskSnapshot'
  { -- | The Amazon Resource Name (ARN) of the disk snapshot.
    DiskSnapshot -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date when the disk snapshot was created.
    DiskSnapshot -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
    -- | The Amazon Resource Name (ARN) of the source disk from which the disk
    -- snapshot was created.
    DiskSnapshot -> Maybe Text
fromDiskArn :: Prelude.Maybe Prelude.Text,
    -- | The unique name of the source disk from which the disk snapshot was
    -- created.
    DiskSnapshot -> Maybe Text
fromDiskName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the source instance from which the
    -- disk (system volume) snapshot was created.
    DiskSnapshot -> Maybe Text
fromInstanceArn :: Prelude.Maybe Prelude.Text,
    -- | The unique name of the source instance from which the disk (system
    -- volume) snapshot was created.
    DiskSnapshot -> Maybe Text
fromInstanceName :: Prelude.Maybe Prelude.Text,
    -- | A Boolean value indicating whether the snapshot was created from an
    -- automatic snapshot.
    DiskSnapshot -> Maybe Bool
isFromAutoSnapshot :: Prelude.Maybe Prelude.Bool,
    -- | The AWS Region and Availability Zone where the disk snapshot was
    -- created.
    DiskSnapshot -> Maybe ResourceLocation
location :: Prelude.Maybe ResourceLocation,
    -- | The name of the disk snapshot (e.g., @my-disk-snapshot@).
    DiskSnapshot -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The progress of the snapshot.
    DiskSnapshot -> Maybe Text
progress :: Prelude.Maybe Prelude.Text,
    -- | The Lightsail resource type (e.g., @DiskSnapshot@).
    DiskSnapshot -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
    -- | The size of the disk in GB.
    DiskSnapshot -> Maybe Int
sizeInGb :: Prelude.Maybe Prelude.Int,
    -- | The status of the disk snapshot operation.
    DiskSnapshot -> Maybe DiskSnapshotState
state :: Prelude.Maybe DiskSnapshotState,
    -- | The support code. Include this code in your email to support when you
    -- have questions about an instance or another resource in Lightsail. This
    -- code enables our support team to look up your Lightsail information more
    -- easily.
    DiskSnapshot -> Maybe Text
supportCode :: Prelude.Maybe Prelude.Text,
    -- | The tag keys and optional values for the resource. For more information
    -- about tags in Lightsail, see the
    -- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags Amazon Lightsail Developer Guide>.
    DiskSnapshot -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
  }
  deriving (DiskSnapshot -> DiskSnapshot -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DiskSnapshot -> DiskSnapshot -> Bool
$c/= :: DiskSnapshot -> DiskSnapshot -> Bool
== :: DiskSnapshot -> DiskSnapshot -> Bool
$c== :: DiskSnapshot -> DiskSnapshot -> Bool
Prelude.Eq, ReadPrec [DiskSnapshot]
ReadPrec DiskSnapshot
Int -> ReadS DiskSnapshot
ReadS [DiskSnapshot]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DiskSnapshot]
$creadListPrec :: ReadPrec [DiskSnapshot]
readPrec :: ReadPrec DiskSnapshot
$creadPrec :: ReadPrec DiskSnapshot
readList :: ReadS [DiskSnapshot]
$creadList :: ReadS [DiskSnapshot]
readsPrec :: Int -> ReadS DiskSnapshot
$creadsPrec :: Int -> ReadS DiskSnapshot
Prelude.Read, Int -> DiskSnapshot -> ShowS
[DiskSnapshot] -> ShowS
DiskSnapshot -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DiskSnapshot] -> ShowS
$cshowList :: [DiskSnapshot] -> ShowS
show :: DiskSnapshot -> String
$cshow :: DiskSnapshot -> String
showsPrec :: Int -> DiskSnapshot -> ShowS
$cshowsPrec :: Int -> DiskSnapshot -> ShowS
Prelude.Show, forall x. Rep DiskSnapshot x -> DiskSnapshot
forall x. DiskSnapshot -> Rep DiskSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DiskSnapshot x -> DiskSnapshot
$cfrom :: forall x. DiskSnapshot -> Rep DiskSnapshot x
Prelude.Generic)

-- |
-- Create a value of 'DiskSnapshot' 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:
--
-- 'arn', 'diskSnapshot_arn' - The Amazon Resource Name (ARN) of the disk snapshot.
--
-- 'createdAt', 'diskSnapshot_createdAt' - The date when the disk snapshot was created.
--
-- 'fromDiskArn', 'diskSnapshot_fromDiskArn' - The Amazon Resource Name (ARN) of the source disk from which the disk
-- snapshot was created.
--
-- 'fromDiskName', 'diskSnapshot_fromDiskName' - The unique name of the source disk from which the disk snapshot was
-- created.
--
-- 'fromInstanceArn', 'diskSnapshot_fromInstanceArn' - The Amazon Resource Name (ARN) of the source instance from which the
-- disk (system volume) snapshot was created.
--
-- 'fromInstanceName', 'diskSnapshot_fromInstanceName' - The unique name of the source instance from which the disk (system
-- volume) snapshot was created.
--
-- 'isFromAutoSnapshot', 'diskSnapshot_isFromAutoSnapshot' - A Boolean value indicating whether the snapshot was created from an
-- automatic snapshot.
--
-- 'location', 'diskSnapshot_location' - The AWS Region and Availability Zone where the disk snapshot was
-- created.
--
-- 'name', 'diskSnapshot_name' - The name of the disk snapshot (e.g., @my-disk-snapshot@).
--
-- 'progress', 'diskSnapshot_progress' - The progress of the snapshot.
--
-- 'resourceType', 'diskSnapshot_resourceType' - The Lightsail resource type (e.g., @DiskSnapshot@).
--
-- 'sizeInGb', 'diskSnapshot_sizeInGb' - The size of the disk in GB.
--
-- 'state', 'diskSnapshot_state' - The status of the disk snapshot operation.
--
-- 'supportCode', 'diskSnapshot_supportCode' - The support code. Include this code in your email to support when you
-- have questions about an instance or another resource in Lightsail. This
-- code enables our support team to look up your Lightsail information more
-- easily.
--
-- 'tags', 'diskSnapshot_tags' - The tag keys and optional values for the resource. For more information
-- about tags in Lightsail, see the
-- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags Amazon Lightsail Developer Guide>.
newDiskSnapshot ::
  DiskSnapshot
newDiskSnapshot :: DiskSnapshot
newDiskSnapshot =
  DiskSnapshot'
    { $sel:arn:DiskSnapshot' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:DiskSnapshot' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
      $sel:fromDiskArn:DiskSnapshot' :: Maybe Text
fromDiskArn = forall a. Maybe a
Prelude.Nothing,
      $sel:fromDiskName:DiskSnapshot' :: Maybe Text
fromDiskName = forall a. Maybe a
Prelude.Nothing,
      $sel:fromInstanceArn:DiskSnapshot' :: Maybe Text
fromInstanceArn = forall a. Maybe a
Prelude.Nothing,
      $sel:fromInstanceName:DiskSnapshot' :: Maybe Text
fromInstanceName = forall a. Maybe a
Prelude.Nothing,
      $sel:isFromAutoSnapshot:DiskSnapshot' :: Maybe Bool
isFromAutoSnapshot = forall a. Maybe a
Prelude.Nothing,
      $sel:location:DiskSnapshot' :: Maybe ResourceLocation
location = forall a. Maybe a
Prelude.Nothing,
      $sel:name:DiskSnapshot' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:progress:DiskSnapshot' :: Maybe Text
progress = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceType:DiskSnapshot' :: Maybe ResourceType
resourceType = forall a. Maybe a
Prelude.Nothing,
      $sel:sizeInGb:DiskSnapshot' :: Maybe Int
sizeInGb = forall a. Maybe a
Prelude.Nothing,
      $sel:state:DiskSnapshot' :: Maybe DiskSnapshotState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:supportCode:DiskSnapshot' :: Maybe Text
supportCode = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:DiskSnapshot' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the disk snapshot.
diskSnapshot_arn :: Lens.Lens' DiskSnapshot (Prelude.Maybe Prelude.Text)
diskSnapshot_arn :: Lens' DiskSnapshot (Maybe Text)
diskSnapshot_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskSnapshot' {Maybe Text
arn :: Maybe Text
$sel:arn:DiskSnapshot' :: DiskSnapshot -> Maybe Text
arn} -> Maybe Text
arn) (\s :: DiskSnapshot
s@DiskSnapshot' {} Maybe Text
a -> DiskSnapshot
s {$sel:arn:DiskSnapshot' :: Maybe Text
arn = Maybe Text
a} :: DiskSnapshot)

-- | The date when the disk snapshot was created.
diskSnapshot_createdAt :: Lens.Lens' DiskSnapshot (Prelude.Maybe Prelude.UTCTime)
diskSnapshot_createdAt :: Lens' DiskSnapshot (Maybe UTCTime)
diskSnapshot_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskSnapshot' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:DiskSnapshot' :: DiskSnapshot -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: DiskSnapshot
s@DiskSnapshot' {} Maybe POSIX
a -> DiskSnapshot
s {$sel:createdAt:DiskSnapshot' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: DiskSnapshot) 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 Amazon Resource Name (ARN) of the source disk from which the disk
-- snapshot was created.
diskSnapshot_fromDiskArn :: Lens.Lens' DiskSnapshot (Prelude.Maybe Prelude.Text)
diskSnapshot_fromDiskArn :: Lens' DiskSnapshot (Maybe Text)
diskSnapshot_fromDiskArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskSnapshot' {Maybe Text
fromDiskArn :: Maybe Text
$sel:fromDiskArn:DiskSnapshot' :: DiskSnapshot -> Maybe Text
fromDiskArn} -> Maybe Text
fromDiskArn) (\s :: DiskSnapshot
s@DiskSnapshot' {} Maybe Text
a -> DiskSnapshot
s {$sel:fromDiskArn:DiskSnapshot' :: Maybe Text
fromDiskArn = Maybe Text
a} :: DiskSnapshot)

-- | The unique name of the source disk from which the disk snapshot was
-- created.
diskSnapshot_fromDiskName :: Lens.Lens' DiskSnapshot (Prelude.Maybe Prelude.Text)
diskSnapshot_fromDiskName :: Lens' DiskSnapshot (Maybe Text)
diskSnapshot_fromDiskName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskSnapshot' {Maybe Text
fromDiskName :: Maybe Text
$sel:fromDiskName:DiskSnapshot' :: DiskSnapshot -> Maybe Text
fromDiskName} -> Maybe Text
fromDiskName) (\s :: DiskSnapshot
s@DiskSnapshot' {} Maybe Text
a -> DiskSnapshot
s {$sel:fromDiskName:DiskSnapshot' :: Maybe Text
fromDiskName = Maybe Text
a} :: DiskSnapshot)

-- | The Amazon Resource Name (ARN) of the source instance from which the
-- disk (system volume) snapshot was created.
diskSnapshot_fromInstanceArn :: Lens.Lens' DiskSnapshot (Prelude.Maybe Prelude.Text)
diskSnapshot_fromInstanceArn :: Lens' DiskSnapshot (Maybe Text)
diskSnapshot_fromInstanceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskSnapshot' {Maybe Text
fromInstanceArn :: Maybe Text
$sel:fromInstanceArn:DiskSnapshot' :: DiskSnapshot -> Maybe Text
fromInstanceArn} -> Maybe Text
fromInstanceArn) (\s :: DiskSnapshot
s@DiskSnapshot' {} Maybe Text
a -> DiskSnapshot
s {$sel:fromInstanceArn:DiskSnapshot' :: Maybe Text
fromInstanceArn = Maybe Text
a} :: DiskSnapshot)

-- | The unique name of the source instance from which the disk (system
-- volume) snapshot was created.
diskSnapshot_fromInstanceName :: Lens.Lens' DiskSnapshot (Prelude.Maybe Prelude.Text)
diskSnapshot_fromInstanceName :: Lens' DiskSnapshot (Maybe Text)
diskSnapshot_fromInstanceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskSnapshot' {Maybe Text
fromInstanceName :: Maybe Text
$sel:fromInstanceName:DiskSnapshot' :: DiskSnapshot -> Maybe Text
fromInstanceName} -> Maybe Text
fromInstanceName) (\s :: DiskSnapshot
s@DiskSnapshot' {} Maybe Text
a -> DiskSnapshot
s {$sel:fromInstanceName:DiskSnapshot' :: Maybe Text
fromInstanceName = Maybe Text
a} :: DiskSnapshot)

-- | A Boolean value indicating whether the snapshot was created from an
-- automatic snapshot.
diskSnapshot_isFromAutoSnapshot :: Lens.Lens' DiskSnapshot (Prelude.Maybe Prelude.Bool)
diskSnapshot_isFromAutoSnapshot :: Lens' DiskSnapshot (Maybe Bool)
diskSnapshot_isFromAutoSnapshot = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskSnapshot' {Maybe Bool
isFromAutoSnapshot :: Maybe Bool
$sel:isFromAutoSnapshot:DiskSnapshot' :: DiskSnapshot -> Maybe Bool
isFromAutoSnapshot} -> Maybe Bool
isFromAutoSnapshot) (\s :: DiskSnapshot
s@DiskSnapshot' {} Maybe Bool
a -> DiskSnapshot
s {$sel:isFromAutoSnapshot:DiskSnapshot' :: Maybe Bool
isFromAutoSnapshot = Maybe Bool
a} :: DiskSnapshot)

-- | The AWS Region and Availability Zone where the disk snapshot was
-- created.
diskSnapshot_location :: Lens.Lens' DiskSnapshot (Prelude.Maybe ResourceLocation)
diskSnapshot_location :: Lens' DiskSnapshot (Maybe ResourceLocation)
diskSnapshot_location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskSnapshot' {Maybe ResourceLocation
location :: Maybe ResourceLocation
$sel:location:DiskSnapshot' :: DiskSnapshot -> Maybe ResourceLocation
location} -> Maybe ResourceLocation
location) (\s :: DiskSnapshot
s@DiskSnapshot' {} Maybe ResourceLocation
a -> DiskSnapshot
s {$sel:location:DiskSnapshot' :: Maybe ResourceLocation
location = Maybe ResourceLocation
a} :: DiskSnapshot)

-- | The name of the disk snapshot (e.g., @my-disk-snapshot@).
diskSnapshot_name :: Lens.Lens' DiskSnapshot (Prelude.Maybe Prelude.Text)
diskSnapshot_name :: Lens' DiskSnapshot (Maybe Text)
diskSnapshot_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskSnapshot' {Maybe Text
name :: Maybe Text
$sel:name:DiskSnapshot' :: DiskSnapshot -> Maybe Text
name} -> Maybe Text
name) (\s :: DiskSnapshot
s@DiskSnapshot' {} Maybe Text
a -> DiskSnapshot
s {$sel:name:DiskSnapshot' :: Maybe Text
name = Maybe Text
a} :: DiskSnapshot)

-- | The progress of the snapshot.
diskSnapshot_progress :: Lens.Lens' DiskSnapshot (Prelude.Maybe Prelude.Text)
diskSnapshot_progress :: Lens' DiskSnapshot (Maybe Text)
diskSnapshot_progress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskSnapshot' {Maybe Text
progress :: Maybe Text
$sel:progress:DiskSnapshot' :: DiskSnapshot -> Maybe Text
progress} -> Maybe Text
progress) (\s :: DiskSnapshot
s@DiskSnapshot' {} Maybe Text
a -> DiskSnapshot
s {$sel:progress:DiskSnapshot' :: Maybe Text
progress = Maybe Text
a} :: DiskSnapshot)

-- | The Lightsail resource type (e.g., @DiskSnapshot@).
diskSnapshot_resourceType :: Lens.Lens' DiskSnapshot (Prelude.Maybe ResourceType)
diskSnapshot_resourceType :: Lens' DiskSnapshot (Maybe ResourceType)
diskSnapshot_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskSnapshot' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:DiskSnapshot' :: DiskSnapshot -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: DiskSnapshot
s@DiskSnapshot' {} Maybe ResourceType
a -> DiskSnapshot
s {$sel:resourceType:DiskSnapshot' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: DiskSnapshot)

-- | The size of the disk in GB.
diskSnapshot_sizeInGb :: Lens.Lens' DiskSnapshot (Prelude.Maybe Prelude.Int)
diskSnapshot_sizeInGb :: Lens' DiskSnapshot (Maybe Int)
diskSnapshot_sizeInGb = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskSnapshot' {Maybe Int
sizeInGb :: Maybe Int
$sel:sizeInGb:DiskSnapshot' :: DiskSnapshot -> Maybe Int
sizeInGb} -> Maybe Int
sizeInGb) (\s :: DiskSnapshot
s@DiskSnapshot' {} Maybe Int
a -> DiskSnapshot
s {$sel:sizeInGb:DiskSnapshot' :: Maybe Int
sizeInGb = Maybe Int
a} :: DiskSnapshot)

-- | The status of the disk snapshot operation.
diskSnapshot_state :: Lens.Lens' DiskSnapshot (Prelude.Maybe DiskSnapshotState)
diskSnapshot_state :: Lens' DiskSnapshot (Maybe DiskSnapshotState)
diskSnapshot_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskSnapshot' {Maybe DiskSnapshotState
state :: Maybe DiskSnapshotState
$sel:state:DiskSnapshot' :: DiskSnapshot -> Maybe DiskSnapshotState
state} -> Maybe DiskSnapshotState
state) (\s :: DiskSnapshot
s@DiskSnapshot' {} Maybe DiskSnapshotState
a -> DiskSnapshot
s {$sel:state:DiskSnapshot' :: Maybe DiskSnapshotState
state = Maybe DiskSnapshotState
a} :: DiskSnapshot)

-- | The support code. Include this code in your email to support when you
-- have questions about an instance or another resource in Lightsail. This
-- code enables our support team to look up your Lightsail information more
-- easily.
diskSnapshot_supportCode :: Lens.Lens' DiskSnapshot (Prelude.Maybe Prelude.Text)
diskSnapshot_supportCode :: Lens' DiskSnapshot (Maybe Text)
diskSnapshot_supportCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskSnapshot' {Maybe Text
supportCode :: Maybe Text
$sel:supportCode:DiskSnapshot' :: DiskSnapshot -> Maybe Text
supportCode} -> Maybe Text
supportCode) (\s :: DiskSnapshot
s@DiskSnapshot' {} Maybe Text
a -> DiskSnapshot
s {$sel:supportCode:DiskSnapshot' :: Maybe Text
supportCode = Maybe Text
a} :: DiskSnapshot)

-- | The tag keys and optional values for the resource. For more information
-- about tags in Lightsail, see the
-- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags Amazon Lightsail Developer Guide>.
diskSnapshot_tags :: Lens.Lens' DiskSnapshot (Prelude.Maybe [Tag])
diskSnapshot_tags :: Lens' DiskSnapshot (Maybe [Tag])
diskSnapshot_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskSnapshot' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:DiskSnapshot' :: DiskSnapshot -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: DiskSnapshot
s@DiskSnapshot' {} Maybe [Tag]
a -> DiskSnapshot
s {$sel:tags:DiskSnapshot' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: DiskSnapshot) 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

instance Data.FromJSON DiskSnapshot where
  parseJSON :: Value -> Parser DiskSnapshot
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DiskSnapshot"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe ResourceType
-> Maybe Int
-> Maybe DiskSnapshotState
-> Maybe Text
-> Maybe [Tag]
-> DiskSnapshot
DiskSnapshot'
            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
"arn")
            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
"createdAt")
            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
"fromDiskArn")
            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
"fromDiskName")
            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
"fromInstanceArn")
            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
"fromInstanceName")
            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
"isFromAutoSnapshot")
            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
"location")
            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
"progress")
            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
"resourceType")
            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
"sizeInGb")
            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
"state")
            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
"supportCode")
            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 a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable DiskSnapshot where
  hashWithSalt :: Int -> DiskSnapshot -> Int
hashWithSalt Int
_salt DiskSnapshot' {Maybe Bool
Maybe Int
Maybe [Tag]
Maybe Text
Maybe POSIX
Maybe DiskSnapshotState
Maybe ResourceLocation
Maybe ResourceType
tags :: Maybe [Tag]
supportCode :: Maybe Text
state :: Maybe DiskSnapshotState
sizeInGb :: Maybe Int
resourceType :: Maybe ResourceType
progress :: Maybe Text
name :: Maybe Text
location :: Maybe ResourceLocation
isFromAutoSnapshot :: Maybe Bool
fromInstanceName :: Maybe Text
fromInstanceArn :: Maybe Text
fromDiskName :: Maybe Text
fromDiskArn :: Maybe Text
createdAt :: Maybe POSIX
arn :: Maybe Text
$sel:tags:DiskSnapshot' :: DiskSnapshot -> Maybe [Tag]
$sel:supportCode:DiskSnapshot' :: DiskSnapshot -> Maybe Text
$sel:state:DiskSnapshot' :: DiskSnapshot -> Maybe DiskSnapshotState
$sel:sizeInGb:DiskSnapshot' :: DiskSnapshot -> Maybe Int
$sel:resourceType:DiskSnapshot' :: DiskSnapshot -> Maybe ResourceType
$sel:progress:DiskSnapshot' :: DiskSnapshot -> Maybe Text
$sel:name:DiskSnapshot' :: DiskSnapshot -> Maybe Text
$sel:location:DiskSnapshot' :: DiskSnapshot -> Maybe ResourceLocation
$sel:isFromAutoSnapshot:DiskSnapshot' :: DiskSnapshot -> Maybe Bool
$sel:fromInstanceName:DiskSnapshot' :: DiskSnapshot -> Maybe Text
$sel:fromInstanceArn:DiskSnapshot' :: DiskSnapshot -> Maybe Text
$sel:fromDiskName:DiskSnapshot' :: DiskSnapshot -> Maybe Text
$sel:fromDiskArn:DiskSnapshot' :: DiskSnapshot -> Maybe Text
$sel:createdAt:DiskSnapshot' :: DiskSnapshot -> Maybe POSIX
$sel:arn:DiskSnapshot' :: DiskSnapshot -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fromDiskArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fromDiskName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fromInstanceArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fromInstanceName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isFromAutoSnapshot
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceLocation
location
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
progress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceType
resourceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
sizeInGb
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DiskSnapshotState
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
supportCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags

instance Prelude.NFData DiskSnapshot where
  rnf :: DiskSnapshot -> ()
rnf DiskSnapshot' {Maybe Bool
Maybe Int
Maybe [Tag]
Maybe Text
Maybe POSIX
Maybe DiskSnapshotState
Maybe ResourceLocation
Maybe ResourceType
tags :: Maybe [Tag]
supportCode :: Maybe Text
state :: Maybe DiskSnapshotState
sizeInGb :: Maybe Int
resourceType :: Maybe ResourceType
progress :: Maybe Text
name :: Maybe Text
location :: Maybe ResourceLocation
isFromAutoSnapshot :: Maybe Bool
fromInstanceName :: Maybe Text
fromInstanceArn :: Maybe Text
fromDiskName :: Maybe Text
fromDiskArn :: Maybe Text
createdAt :: Maybe POSIX
arn :: Maybe Text
$sel:tags:DiskSnapshot' :: DiskSnapshot -> Maybe [Tag]
$sel:supportCode:DiskSnapshot' :: DiskSnapshot -> Maybe Text
$sel:state:DiskSnapshot' :: DiskSnapshot -> Maybe DiskSnapshotState
$sel:sizeInGb:DiskSnapshot' :: DiskSnapshot -> Maybe Int
$sel:resourceType:DiskSnapshot' :: DiskSnapshot -> Maybe ResourceType
$sel:progress:DiskSnapshot' :: DiskSnapshot -> Maybe Text
$sel:name:DiskSnapshot' :: DiskSnapshot -> Maybe Text
$sel:location:DiskSnapshot' :: DiskSnapshot -> Maybe ResourceLocation
$sel:isFromAutoSnapshot:DiskSnapshot' :: DiskSnapshot -> Maybe Bool
$sel:fromInstanceName:DiskSnapshot' :: DiskSnapshot -> Maybe Text
$sel:fromInstanceArn:DiskSnapshot' :: DiskSnapshot -> Maybe Text
$sel:fromDiskName:DiskSnapshot' :: DiskSnapshot -> Maybe Text
$sel:fromDiskArn:DiskSnapshot' :: DiskSnapshot -> Maybe Text
$sel:createdAt:DiskSnapshot' :: DiskSnapshot -> Maybe POSIX
$sel:arn:DiskSnapshot' :: DiskSnapshot -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fromDiskArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fromDiskName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fromInstanceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fromInstanceName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isFromAutoSnapshot
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceLocation
location
      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
progress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceType
resourceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
sizeInGb
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DiskSnapshotState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
supportCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags