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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 unique name of the source disk from which the disk snapshot was
    -- created.
    DiskSnapshot -> Maybe Text
fromDiskName :: 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 status of the disk snapshot operation.
    DiskSnapshot -> Maybe DiskSnapshotState
state :: Prelude.Maybe DiskSnapshotState,
    -- | The Lightsail resource type (e.g., @DiskSnapshot@).
    DiskSnapshot -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
    -- | 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 Core.POSIX,
    -- | The AWS Region and Availability Zone where the disk snapshot was
    -- created.
    DiskSnapshot -> Maybe ResourceLocation
location :: Prelude.Maybe ResourceLocation,
    -- | The progress of the snapshot.
    DiskSnapshot -> Maybe Text
progress :: Prelude.Maybe Prelude.Text,
    -- | The name of the disk snapshot (e.g., @my-disk-snapshot@).
    DiskSnapshot -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The size of the disk in GB.
    DiskSnapshot -> Maybe Int
sizeInGb :: Prelude.Maybe Prelude.Int,
    -- | 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 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,
    -- | 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 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
(DiskSnapshot -> DiskSnapshot -> Bool)
-> (DiskSnapshot -> DiskSnapshot -> Bool) -> Eq DiskSnapshot
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]
(Int -> ReadS DiskSnapshot)
-> ReadS [DiskSnapshot]
-> ReadPrec DiskSnapshot
-> ReadPrec [DiskSnapshot]
-> Read 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
(Int -> DiskSnapshot -> ShowS)
-> (DiskSnapshot -> String)
-> ([DiskSnapshot] -> ShowS)
-> Show DiskSnapshot
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. DiskSnapshot -> Rep DiskSnapshot x)
-> (forall x. Rep DiskSnapshot x -> DiskSnapshot)
-> Generic DiskSnapshot
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:
--
-- 'fromDiskName', 'diskSnapshot_fromDiskName' - The unique name of the source disk from which the disk snapshot was
-- created.
--
-- 'isFromAutoSnapshot', 'diskSnapshot_isFromAutoSnapshot' - A Boolean value indicating whether the snapshot was created from an
-- automatic snapshot.
--
-- 'state', 'diskSnapshot_state' - The status of the disk snapshot operation.
--
-- 'resourceType', 'diskSnapshot_resourceType' - The Lightsail resource type (e.g., @DiskSnapshot@).
--
-- 'arn', 'diskSnapshot_arn' - The Amazon Resource Name (ARN) of the disk snapshot.
--
-- 'createdAt', 'diskSnapshot_createdAt' - The date when the disk snapshot was created.
--
-- 'location', 'diskSnapshot_location' - The AWS Region and Availability Zone where the disk snapshot was
-- created.
--
-- 'progress', 'diskSnapshot_progress' - The progress of the snapshot.
--
-- 'name', 'diskSnapshot_name' - The name of the disk snapshot (e.g., @my-disk-snapshot@).
--
-- 'sizeInGb', 'diskSnapshot_sizeInGb' - The size of the disk in GB.
--
-- '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.
--
-- '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.
--
-- 'fromDiskArn', 'diskSnapshot_fromDiskArn' - The Amazon Resource Name (ARN) of the source disk from which the disk
-- snapshot was created.
--
-- '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' :: Maybe Text
-> Maybe Bool
-> Maybe DiskSnapshotState
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> DiskSnapshot
DiskSnapshot'
    { $sel:fromDiskName:DiskSnapshot' :: Maybe Text
fromDiskName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isFromAutoSnapshot:DiskSnapshot' :: Maybe Bool
isFromAutoSnapshot = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:state:DiskSnapshot' :: Maybe DiskSnapshotState
state = Maybe DiskSnapshotState
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceType:DiskSnapshot' :: Maybe ResourceType
resourceType = Maybe ResourceType
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:DiskSnapshot' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:DiskSnapshot' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:location:DiskSnapshot' :: Maybe ResourceLocation
location = Maybe ResourceLocation
forall a. Maybe a
Prelude.Nothing,
      $sel:progress:DiskSnapshot' :: Maybe Text
progress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:DiskSnapshot' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sizeInGb:DiskSnapshot' :: Maybe Int
sizeInGb = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:supportCode:DiskSnapshot' :: Maybe Text
supportCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fromInstanceArn:DiskSnapshot' :: Maybe Text
fromInstanceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fromInstanceName:DiskSnapshot' :: Maybe Text
fromInstanceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fromDiskArn:DiskSnapshot' :: Maybe Text
fromDiskArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:DiskSnapshot' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> DiskSnapshot -> f DiskSnapshot
diskSnapshot_fromDiskName = (DiskSnapshot -> Maybe Text)
-> (DiskSnapshot -> Maybe Text -> DiskSnapshot)
-> Lens DiskSnapshot DiskSnapshot (Maybe Text) (Maybe Text)
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)

-- | A Boolean value indicating whether the snapshot was created from an
-- automatic snapshot.
diskSnapshot_isFromAutoSnapshot :: Lens.Lens' DiskSnapshot (Prelude.Maybe Prelude.Bool)
diskSnapshot_isFromAutoSnapshot :: (Maybe Bool -> f (Maybe Bool)) -> DiskSnapshot -> f DiskSnapshot
diskSnapshot_isFromAutoSnapshot = (DiskSnapshot -> Maybe Bool)
-> (DiskSnapshot -> Maybe Bool -> DiskSnapshot)
-> Lens DiskSnapshot DiskSnapshot (Maybe Bool) (Maybe Bool)
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 status of the disk snapshot operation.
diskSnapshot_state :: Lens.Lens' DiskSnapshot (Prelude.Maybe DiskSnapshotState)
diskSnapshot_state :: (Maybe DiskSnapshotState -> f (Maybe DiskSnapshotState))
-> DiskSnapshot -> f DiskSnapshot
diskSnapshot_state = (DiskSnapshot -> Maybe DiskSnapshotState)
-> (DiskSnapshot -> Maybe DiskSnapshotState -> DiskSnapshot)
-> Lens
     DiskSnapshot
     DiskSnapshot
     (Maybe DiskSnapshotState)
     (Maybe DiskSnapshotState)
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 Lightsail resource type (e.g., @DiskSnapshot@).
diskSnapshot_resourceType :: Lens.Lens' DiskSnapshot (Prelude.Maybe ResourceType)
diskSnapshot_resourceType :: (Maybe ResourceType -> f (Maybe ResourceType))
-> DiskSnapshot -> f DiskSnapshot
diskSnapshot_resourceType = (DiskSnapshot -> Maybe ResourceType)
-> (DiskSnapshot -> Maybe ResourceType -> DiskSnapshot)
-> Lens
     DiskSnapshot DiskSnapshot (Maybe ResourceType) (Maybe 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 Amazon Resource Name (ARN) of the disk snapshot.
diskSnapshot_arn :: Lens.Lens' DiskSnapshot (Prelude.Maybe Prelude.Text)
diskSnapshot_arn :: (Maybe Text -> f (Maybe Text)) -> DiskSnapshot -> f DiskSnapshot
diskSnapshot_arn = (DiskSnapshot -> Maybe Text)
-> (DiskSnapshot -> Maybe Text -> DiskSnapshot)
-> Lens DiskSnapshot DiskSnapshot (Maybe Text) (Maybe Text)
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 :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DiskSnapshot -> f DiskSnapshot
diskSnapshot_createdAt = (DiskSnapshot -> Maybe POSIX)
-> (DiskSnapshot -> Maybe POSIX -> DiskSnapshot)
-> Lens DiskSnapshot DiskSnapshot (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> DiskSnapshot -> f DiskSnapshot)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DiskSnapshot
-> f DiskSnapshot
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The AWS Region and Availability Zone where the disk snapshot was
-- created.
diskSnapshot_location :: Lens.Lens' DiskSnapshot (Prelude.Maybe ResourceLocation)
diskSnapshot_location :: (Maybe ResourceLocation -> f (Maybe ResourceLocation))
-> DiskSnapshot -> f DiskSnapshot
diskSnapshot_location = (DiskSnapshot -> Maybe ResourceLocation)
-> (DiskSnapshot -> Maybe ResourceLocation -> DiskSnapshot)
-> Lens
     DiskSnapshot
     DiskSnapshot
     (Maybe ResourceLocation)
     (Maybe ResourceLocation)
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 progress of the snapshot.
diskSnapshot_progress :: Lens.Lens' DiskSnapshot (Prelude.Maybe Prelude.Text)
diskSnapshot_progress :: (Maybe Text -> f (Maybe Text)) -> DiskSnapshot -> f DiskSnapshot
diskSnapshot_progress = (DiskSnapshot -> Maybe Text)
-> (DiskSnapshot -> Maybe Text -> DiskSnapshot)
-> Lens DiskSnapshot DiskSnapshot (Maybe Text) (Maybe Text)
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 name of the disk snapshot (e.g., @my-disk-snapshot@).
diskSnapshot_name :: Lens.Lens' DiskSnapshot (Prelude.Maybe Prelude.Text)
diskSnapshot_name :: (Maybe Text -> f (Maybe Text)) -> DiskSnapshot -> f DiskSnapshot
diskSnapshot_name = (DiskSnapshot -> Maybe Text)
-> (DiskSnapshot -> Maybe Text -> DiskSnapshot)
-> Lens DiskSnapshot DiskSnapshot (Maybe Text) (Maybe Text)
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 size of the disk in GB.
diskSnapshot_sizeInGb :: Lens.Lens' DiskSnapshot (Prelude.Maybe Prelude.Int)
diskSnapshot_sizeInGb :: (Maybe Int -> f (Maybe Int)) -> DiskSnapshot -> f DiskSnapshot
diskSnapshot_sizeInGb = (DiskSnapshot -> Maybe Int)
-> (DiskSnapshot -> Maybe Int -> DiskSnapshot)
-> Lens DiskSnapshot DiskSnapshot (Maybe Int) (Maybe Int)
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 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 :: (Maybe Text -> f (Maybe Text)) -> DiskSnapshot -> f DiskSnapshot
diskSnapshot_supportCode = (DiskSnapshot -> Maybe Text)
-> (DiskSnapshot -> Maybe Text -> DiskSnapshot)
-> Lens DiskSnapshot DiskSnapshot (Maybe Text) (Maybe Text)
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 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 :: (Maybe Text -> f (Maybe Text)) -> DiskSnapshot -> f DiskSnapshot
diskSnapshot_fromInstanceArn = (DiskSnapshot -> Maybe Text)
-> (DiskSnapshot -> Maybe Text -> DiskSnapshot)
-> Lens DiskSnapshot DiskSnapshot (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text)) -> DiskSnapshot -> f DiskSnapshot
diskSnapshot_fromInstanceName = (DiskSnapshot -> Maybe Text)
-> (DiskSnapshot -> Maybe Text -> DiskSnapshot)
-> Lens DiskSnapshot DiskSnapshot (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> DiskSnapshot -> f DiskSnapshot
diskSnapshot_fromDiskArn = (DiskSnapshot -> Maybe Text)
-> (DiskSnapshot -> Maybe Text -> DiskSnapshot)
-> Lens DiskSnapshot DiskSnapshot (Maybe Text) (Maybe Text)
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 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 :: (Maybe [Tag] -> f (Maybe [Tag])) -> DiskSnapshot -> f DiskSnapshot
diskSnapshot_tags = (DiskSnapshot -> Maybe [Tag])
-> (DiskSnapshot -> Maybe [Tag] -> DiskSnapshot)
-> Lens DiskSnapshot DiskSnapshot (Maybe [Tag]) (Maybe [Tag])
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) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> DiskSnapshot -> f DiskSnapshot)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> DiskSnapshot
-> f DiskSnapshot
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable DiskSnapshot

instance Prelude.NFData DiskSnapshot