{-# 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.InstanceSnapshot
-- 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.InstanceSnapshot 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.Disk
import Amazonka.Lightsail.Types.InstanceSnapshotState
import Amazonka.Lightsail.Types.ResourceLocation
import Amazonka.Lightsail.Types.ResourceType
import Amazonka.Lightsail.Types.Tag
import qualified Amazonka.Prelude as Prelude

-- | Describes an instance snapshot.
--
-- /See:/ 'newInstanceSnapshot' smart constructor.
data InstanceSnapshot = InstanceSnapshot'
  { -- | The Amazon Resource Name (ARN) of the snapshot (e.g.,
    -- @arn:aws:lightsail:us-east-2:123456789101:InstanceSnapshot\/d23b5706-3322-4d83-81e5-12345EXAMPLE@).
    InstanceSnapshot -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when the snapshot was created (e.g., @1479907467.024@).
    InstanceSnapshot -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
    -- | An array of disk objects containing information about all block storage
    -- disks.
    InstanceSnapshot -> Maybe [Disk]
fromAttachedDisks :: Prelude.Maybe [Disk],
    -- | The blueprint ID from which you created the snapshot (e.g.,
    -- @os_debian_8_3@). A blueprint is a virtual private server (or
    -- /instance/) image used to create instances quickly.
    InstanceSnapshot -> Maybe Text
fromBlueprintId :: Prelude.Maybe Prelude.Text,
    -- | The bundle ID from which you created the snapshot (e.g., @micro_1_0@).
    InstanceSnapshot -> Maybe Text
fromBundleId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the instance from which the snapshot
    -- was created (e.g.,
    -- @arn:aws:lightsail:us-east-2:123456789101:Instance\/64b8404c-ccb1-430b-8daf-12345EXAMPLE@).
    InstanceSnapshot -> Maybe Text
fromInstanceArn :: Prelude.Maybe Prelude.Text,
    -- | The instance from which the snapshot was created.
    InstanceSnapshot -> Maybe Text
fromInstanceName :: Prelude.Maybe Prelude.Text,
    -- | A Boolean value indicating whether the snapshot was created from an
    -- automatic snapshot.
    InstanceSnapshot -> Maybe Bool
isFromAutoSnapshot :: Prelude.Maybe Prelude.Bool,
    -- | The region name and Availability Zone where you created the snapshot.
    InstanceSnapshot -> Maybe ResourceLocation
location :: Prelude.Maybe ResourceLocation,
    -- | The name of the snapshot.
    InstanceSnapshot -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The progress of the snapshot.
    --
    -- This is populated only for disk snapshots, and is @null@ for instance
    -- snapshots.
    InstanceSnapshot -> Maybe Text
progress :: Prelude.Maybe Prelude.Text,
    -- | The type of resource (usually @InstanceSnapshot@).
    InstanceSnapshot -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
    -- | The size in GB of the SSD.
    InstanceSnapshot -> Maybe Int
sizeInGb :: Prelude.Maybe Prelude.Int,
    -- | The state the snapshot is in.
    InstanceSnapshot -> Maybe InstanceSnapshotState
state :: Prelude.Maybe InstanceSnapshotState,
    -- | 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.
    InstanceSnapshot -> 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>.
    InstanceSnapshot -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
  }
  deriving (InstanceSnapshot -> InstanceSnapshot -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceSnapshot -> InstanceSnapshot -> Bool
$c/= :: InstanceSnapshot -> InstanceSnapshot -> Bool
== :: InstanceSnapshot -> InstanceSnapshot -> Bool
$c== :: InstanceSnapshot -> InstanceSnapshot -> Bool
Prelude.Eq, ReadPrec [InstanceSnapshot]
ReadPrec InstanceSnapshot
Int -> ReadS InstanceSnapshot
ReadS [InstanceSnapshot]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceSnapshot]
$creadListPrec :: ReadPrec [InstanceSnapshot]
readPrec :: ReadPrec InstanceSnapshot
$creadPrec :: ReadPrec InstanceSnapshot
readList :: ReadS [InstanceSnapshot]
$creadList :: ReadS [InstanceSnapshot]
readsPrec :: Int -> ReadS InstanceSnapshot
$creadsPrec :: Int -> ReadS InstanceSnapshot
Prelude.Read, Int -> InstanceSnapshot -> ShowS
[InstanceSnapshot] -> ShowS
InstanceSnapshot -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceSnapshot] -> ShowS
$cshowList :: [InstanceSnapshot] -> ShowS
show :: InstanceSnapshot -> String
$cshow :: InstanceSnapshot -> String
showsPrec :: Int -> InstanceSnapshot -> ShowS
$cshowsPrec :: Int -> InstanceSnapshot -> ShowS
Prelude.Show, forall x. Rep InstanceSnapshot x -> InstanceSnapshot
forall x. InstanceSnapshot -> Rep InstanceSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceSnapshot x -> InstanceSnapshot
$cfrom :: forall x. InstanceSnapshot -> Rep InstanceSnapshot x
Prelude.Generic)

-- |
-- Create a value of 'InstanceSnapshot' 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', 'instanceSnapshot_arn' - The Amazon Resource Name (ARN) of the snapshot (e.g.,
-- @arn:aws:lightsail:us-east-2:123456789101:InstanceSnapshot\/d23b5706-3322-4d83-81e5-12345EXAMPLE@).
--
-- 'createdAt', 'instanceSnapshot_createdAt' - The timestamp when the snapshot was created (e.g., @1479907467.024@).
--
-- 'fromAttachedDisks', 'instanceSnapshot_fromAttachedDisks' - An array of disk objects containing information about all block storage
-- disks.
--
-- 'fromBlueprintId', 'instanceSnapshot_fromBlueprintId' - The blueprint ID from which you created the snapshot (e.g.,
-- @os_debian_8_3@). A blueprint is a virtual private server (or
-- /instance/) image used to create instances quickly.
--
-- 'fromBundleId', 'instanceSnapshot_fromBundleId' - The bundle ID from which you created the snapshot (e.g., @micro_1_0@).
--
-- 'fromInstanceArn', 'instanceSnapshot_fromInstanceArn' - The Amazon Resource Name (ARN) of the instance from which the snapshot
-- was created (e.g.,
-- @arn:aws:lightsail:us-east-2:123456789101:Instance\/64b8404c-ccb1-430b-8daf-12345EXAMPLE@).
--
-- 'fromInstanceName', 'instanceSnapshot_fromInstanceName' - The instance from which the snapshot was created.
--
-- 'isFromAutoSnapshot', 'instanceSnapshot_isFromAutoSnapshot' - A Boolean value indicating whether the snapshot was created from an
-- automatic snapshot.
--
-- 'location', 'instanceSnapshot_location' - The region name and Availability Zone where you created the snapshot.
--
-- 'name', 'instanceSnapshot_name' - The name of the snapshot.
--
-- 'progress', 'instanceSnapshot_progress' - The progress of the snapshot.
--
-- This is populated only for disk snapshots, and is @null@ for instance
-- snapshots.
--
-- 'resourceType', 'instanceSnapshot_resourceType' - The type of resource (usually @InstanceSnapshot@).
--
-- 'sizeInGb', 'instanceSnapshot_sizeInGb' - The size in GB of the SSD.
--
-- 'state', 'instanceSnapshot_state' - The state the snapshot is in.
--
-- 'supportCode', 'instanceSnapshot_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', 'instanceSnapshot_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>.
newInstanceSnapshot ::
  InstanceSnapshot
newInstanceSnapshot :: InstanceSnapshot
newInstanceSnapshot =
  InstanceSnapshot'
    { $sel:arn:InstanceSnapshot' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:InstanceSnapshot' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
      $sel:fromAttachedDisks:InstanceSnapshot' :: Maybe [Disk]
fromAttachedDisks = forall a. Maybe a
Prelude.Nothing,
      $sel:fromBlueprintId:InstanceSnapshot' :: Maybe Text
fromBlueprintId = forall a. Maybe a
Prelude.Nothing,
      $sel:fromBundleId:InstanceSnapshot' :: Maybe Text
fromBundleId = forall a. Maybe a
Prelude.Nothing,
      $sel:fromInstanceArn:InstanceSnapshot' :: Maybe Text
fromInstanceArn = forall a. Maybe a
Prelude.Nothing,
      $sel:fromInstanceName:InstanceSnapshot' :: Maybe Text
fromInstanceName = forall a. Maybe a
Prelude.Nothing,
      $sel:isFromAutoSnapshot:InstanceSnapshot' :: Maybe Bool
isFromAutoSnapshot = forall a. Maybe a
Prelude.Nothing,
      $sel:location:InstanceSnapshot' :: Maybe ResourceLocation
location = forall a. Maybe a
Prelude.Nothing,
      $sel:name:InstanceSnapshot' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:progress:InstanceSnapshot' :: Maybe Text
progress = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceType:InstanceSnapshot' :: Maybe ResourceType
resourceType = forall a. Maybe a
Prelude.Nothing,
      $sel:sizeInGb:InstanceSnapshot' :: Maybe Int
sizeInGb = forall a. Maybe a
Prelude.Nothing,
      $sel:state:InstanceSnapshot' :: Maybe InstanceSnapshotState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:supportCode:InstanceSnapshot' :: Maybe Text
supportCode = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:InstanceSnapshot' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the snapshot (e.g.,
-- @arn:aws:lightsail:us-east-2:123456789101:InstanceSnapshot\/d23b5706-3322-4d83-81e5-12345EXAMPLE@).
instanceSnapshot_arn :: Lens.Lens' InstanceSnapshot (Prelude.Maybe Prelude.Text)
instanceSnapshot_arn :: Lens' InstanceSnapshot (Maybe Text)
instanceSnapshot_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSnapshot' {Maybe Text
arn :: Maybe Text
$sel:arn:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
arn} -> Maybe Text
arn) (\s :: InstanceSnapshot
s@InstanceSnapshot' {} Maybe Text
a -> InstanceSnapshot
s {$sel:arn:InstanceSnapshot' :: Maybe Text
arn = Maybe Text
a} :: InstanceSnapshot)

-- | The timestamp when the snapshot was created (e.g., @1479907467.024@).
instanceSnapshot_createdAt :: Lens.Lens' InstanceSnapshot (Prelude.Maybe Prelude.UTCTime)
instanceSnapshot_createdAt :: Lens' InstanceSnapshot (Maybe UTCTime)
instanceSnapshot_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSnapshot' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:InstanceSnapshot' :: InstanceSnapshot -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: InstanceSnapshot
s@InstanceSnapshot' {} Maybe POSIX
a -> InstanceSnapshot
s {$sel:createdAt:InstanceSnapshot' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: InstanceSnapshot) 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

-- | An array of disk objects containing information about all block storage
-- disks.
instanceSnapshot_fromAttachedDisks :: Lens.Lens' InstanceSnapshot (Prelude.Maybe [Disk])
instanceSnapshot_fromAttachedDisks :: Lens' InstanceSnapshot (Maybe [Disk])
instanceSnapshot_fromAttachedDisks = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSnapshot' {Maybe [Disk]
fromAttachedDisks :: Maybe [Disk]
$sel:fromAttachedDisks:InstanceSnapshot' :: InstanceSnapshot -> Maybe [Disk]
fromAttachedDisks} -> Maybe [Disk]
fromAttachedDisks) (\s :: InstanceSnapshot
s@InstanceSnapshot' {} Maybe [Disk]
a -> InstanceSnapshot
s {$sel:fromAttachedDisks:InstanceSnapshot' :: Maybe [Disk]
fromAttachedDisks = Maybe [Disk]
a} :: InstanceSnapshot) 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

-- | The blueprint ID from which you created the snapshot (e.g.,
-- @os_debian_8_3@). A blueprint is a virtual private server (or
-- /instance/) image used to create instances quickly.
instanceSnapshot_fromBlueprintId :: Lens.Lens' InstanceSnapshot (Prelude.Maybe Prelude.Text)
instanceSnapshot_fromBlueprintId :: Lens' InstanceSnapshot (Maybe Text)
instanceSnapshot_fromBlueprintId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSnapshot' {Maybe Text
fromBlueprintId :: Maybe Text
$sel:fromBlueprintId:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
fromBlueprintId} -> Maybe Text
fromBlueprintId) (\s :: InstanceSnapshot
s@InstanceSnapshot' {} Maybe Text
a -> InstanceSnapshot
s {$sel:fromBlueprintId:InstanceSnapshot' :: Maybe Text
fromBlueprintId = Maybe Text
a} :: InstanceSnapshot)

-- | The bundle ID from which you created the snapshot (e.g., @micro_1_0@).
instanceSnapshot_fromBundleId :: Lens.Lens' InstanceSnapshot (Prelude.Maybe Prelude.Text)
instanceSnapshot_fromBundleId :: Lens' InstanceSnapshot (Maybe Text)
instanceSnapshot_fromBundleId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSnapshot' {Maybe Text
fromBundleId :: Maybe Text
$sel:fromBundleId:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
fromBundleId} -> Maybe Text
fromBundleId) (\s :: InstanceSnapshot
s@InstanceSnapshot' {} Maybe Text
a -> InstanceSnapshot
s {$sel:fromBundleId:InstanceSnapshot' :: Maybe Text
fromBundleId = Maybe Text
a} :: InstanceSnapshot)

-- | The Amazon Resource Name (ARN) of the instance from which the snapshot
-- was created (e.g.,
-- @arn:aws:lightsail:us-east-2:123456789101:Instance\/64b8404c-ccb1-430b-8daf-12345EXAMPLE@).
instanceSnapshot_fromInstanceArn :: Lens.Lens' InstanceSnapshot (Prelude.Maybe Prelude.Text)
instanceSnapshot_fromInstanceArn :: Lens' InstanceSnapshot (Maybe Text)
instanceSnapshot_fromInstanceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSnapshot' {Maybe Text
fromInstanceArn :: Maybe Text
$sel:fromInstanceArn:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
fromInstanceArn} -> Maybe Text
fromInstanceArn) (\s :: InstanceSnapshot
s@InstanceSnapshot' {} Maybe Text
a -> InstanceSnapshot
s {$sel:fromInstanceArn:InstanceSnapshot' :: Maybe Text
fromInstanceArn = Maybe Text
a} :: InstanceSnapshot)

-- | The instance from which the snapshot was created.
instanceSnapshot_fromInstanceName :: Lens.Lens' InstanceSnapshot (Prelude.Maybe Prelude.Text)
instanceSnapshot_fromInstanceName :: Lens' InstanceSnapshot (Maybe Text)
instanceSnapshot_fromInstanceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSnapshot' {Maybe Text
fromInstanceName :: Maybe Text
$sel:fromInstanceName:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
fromInstanceName} -> Maybe Text
fromInstanceName) (\s :: InstanceSnapshot
s@InstanceSnapshot' {} Maybe Text
a -> InstanceSnapshot
s {$sel:fromInstanceName:InstanceSnapshot' :: Maybe Text
fromInstanceName = Maybe Text
a} :: InstanceSnapshot)

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

-- | The region name and Availability Zone where you created the snapshot.
instanceSnapshot_location :: Lens.Lens' InstanceSnapshot (Prelude.Maybe ResourceLocation)
instanceSnapshot_location :: Lens' InstanceSnapshot (Maybe ResourceLocation)
instanceSnapshot_location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSnapshot' {Maybe ResourceLocation
location :: Maybe ResourceLocation
$sel:location:InstanceSnapshot' :: InstanceSnapshot -> Maybe ResourceLocation
location} -> Maybe ResourceLocation
location) (\s :: InstanceSnapshot
s@InstanceSnapshot' {} Maybe ResourceLocation
a -> InstanceSnapshot
s {$sel:location:InstanceSnapshot' :: Maybe ResourceLocation
location = Maybe ResourceLocation
a} :: InstanceSnapshot)

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

-- | The progress of the snapshot.
--
-- This is populated only for disk snapshots, and is @null@ for instance
-- snapshots.
instanceSnapshot_progress :: Lens.Lens' InstanceSnapshot (Prelude.Maybe Prelude.Text)
instanceSnapshot_progress :: Lens' InstanceSnapshot (Maybe Text)
instanceSnapshot_progress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSnapshot' {Maybe Text
progress :: Maybe Text
$sel:progress:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
progress} -> Maybe Text
progress) (\s :: InstanceSnapshot
s@InstanceSnapshot' {} Maybe Text
a -> InstanceSnapshot
s {$sel:progress:InstanceSnapshot' :: Maybe Text
progress = Maybe Text
a} :: InstanceSnapshot)

-- | The type of resource (usually @InstanceSnapshot@).
instanceSnapshot_resourceType :: Lens.Lens' InstanceSnapshot (Prelude.Maybe ResourceType)
instanceSnapshot_resourceType :: Lens' InstanceSnapshot (Maybe ResourceType)
instanceSnapshot_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSnapshot' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:InstanceSnapshot' :: InstanceSnapshot -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: InstanceSnapshot
s@InstanceSnapshot' {} Maybe ResourceType
a -> InstanceSnapshot
s {$sel:resourceType:InstanceSnapshot' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: InstanceSnapshot)

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

-- | The state the snapshot is in.
instanceSnapshot_state :: Lens.Lens' InstanceSnapshot (Prelude.Maybe InstanceSnapshotState)
instanceSnapshot_state :: Lens' InstanceSnapshot (Maybe InstanceSnapshotState)
instanceSnapshot_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSnapshot' {Maybe InstanceSnapshotState
state :: Maybe InstanceSnapshotState
$sel:state:InstanceSnapshot' :: InstanceSnapshot -> Maybe InstanceSnapshotState
state} -> Maybe InstanceSnapshotState
state) (\s :: InstanceSnapshot
s@InstanceSnapshot' {} Maybe InstanceSnapshotState
a -> InstanceSnapshot
s {$sel:state:InstanceSnapshot' :: Maybe InstanceSnapshotState
state = Maybe InstanceSnapshotState
a} :: InstanceSnapshot)

-- | 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.
instanceSnapshot_supportCode :: Lens.Lens' InstanceSnapshot (Prelude.Maybe Prelude.Text)
instanceSnapshot_supportCode :: Lens' InstanceSnapshot (Maybe Text)
instanceSnapshot_supportCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSnapshot' {Maybe Text
supportCode :: Maybe Text
$sel:supportCode:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
supportCode} -> Maybe Text
supportCode) (\s :: InstanceSnapshot
s@InstanceSnapshot' {} Maybe Text
a -> InstanceSnapshot
s {$sel:supportCode:InstanceSnapshot' :: Maybe Text
supportCode = Maybe Text
a} :: InstanceSnapshot)

-- | 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>.
instanceSnapshot_tags :: Lens.Lens' InstanceSnapshot (Prelude.Maybe [Tag])
instanceSnapshot_tags :: Lens' InstanceSnapshot (Maybe [Tag])
instanceSnapshot_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSnapshot' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:InstanceSnapshot' :: InstanceSnapshot -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: InstanceSnapshot
s@InstanceSnapshot' {} Maybe [Tag]
a -> InstanceSnapshot
s {$sel:tags:InstanceSnapshot' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: InstanceSnapshot) 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 InstanceSnapshot where
  parseJSON :: Value -> Parser InstanceSnapshot
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"InstanceSnapshot"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe [Disk]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe ResourceType
-> Maybe Int
-> Maybe InstanceSnapshotState
-> Maybe Text
-> Maybe [Tag]
-> InstanceSnapshot
InstanceSnapshot'
            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
"fromAttachedDisks"
                            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
"fromBlueprintId")
            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
"fromBundleId")
            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 InstanceSnapshot where
  hashWithSalt :: Int -> InstanceSnapshot -> Int
hashWithSalt Int
_salt InstanceSnapshot' {Maybe Bool
Maybe Int
Maybe [Tag]
Maybe [Disk]
Maybe Text
Maybe POSIX
Maybe InstanceSnapshotState
Maybe ResourceLocation
Maybe ResourceType
tags :: Maybe [Tag]
supportCode :: Maybe Text
state :: Maybe InstanceSnapshotState
sizeInGb :: Maybe Int
resourceType :: Maybe ResourceType
progress :: Maybe Text
name :: Maybe Text
location :: Maybe ResourceLocation
isFromAutoSnapshot :: Maybe Bool
fromInstanceName :: Maybe Text
fromInstanceArn :: Maybe Text
fromBundleId :: Maybe Text
fromBlueprintId :: Maybe Text
fromAttachedDisks :: Maybe [Disk]
createdAt :: Maybe POSIX
arn :: Maybe Text
$sel:tags:InstanceSnapshot' :: InstanceSnapshot -> Maybe [Tag]
$sel:supportCode:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
$sel:state:InstanceSnapshot' :: InstanceSnapshot -> Maybe InstanceSnapshotState
$sel:sizeInGb:InstanceSnapshot' :: InstanceSnapshot -> Maybe Int
$sel:resourceType:InstanceSnapshot' :: InstanceSnapshot -> Maybe ResourceType
$sel:progress:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
$sel:name:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
$sel:location:InstanceSnapshot' :: InstanceSnapshot -> Maybe ResourceLocation
$sel:isFromAutoSnapshot:InstanceSnapshot' :: InstanceSnapshot -> Maybe Bool
$sel:fromInstanceName:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
$sel:fromInstanceArn:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
$sel:fromBundleId:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
$sel:fromBlueprintId:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
$sel:fromAttachedDisks:InstanceSnapshot' :: InstanceSnapshot -> Maybe [Disk]
$sel:createdAt:InstanceSnapshot' :: InstanceSnapshot -> Maybe POSIX
$sel:arn:InstanceSnapshot' :: InstanceSnapshot -> 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 [Disk]
fromAttachedDisks
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fromBlueprintId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fromBundleId
      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 InstanceSnapshotState
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 InstanceSnapshot where
  rnf :: InstanceSnapshot -> ()
rnf InstanceSnapshot' {Maybe Bool
Maybe Int
Maybe [Tag]
Maybe [Disk]
Maybe Text
Maybe POSIX
Maybe InstanceSnapshotState
Maybe ResourceLocation
Maybe ResourceType
tags :: Maybe [Tag]
supportCode :: Maybe Text
state :: Maybe InstanceSnapshotState
sizeInGb :: Maybe Int
resourceType :: Maybe ResourceType
progress :: Maybe Text
name :: Maybe Text
location :: Maybe ResourceLocation
isFromAutoSnapshot :: Maybe Bool
fromInstanceName :: Maybe Text
fromInstanceArn :: Maybe Text
fromBundleId :: Maybe Text
fromBlueprintId :: Maybe Text
fromAttachedDisks :: Maybe [Disk]
createdAt :: Maybe POSIX
arn :: Maybe Text
$sel:tags:InstanceSnapshot' :: InstanceSnapshot -> Maybe [Tag]
$sel:supportCode:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
$sel:state:InstanceSnapshot' :: InstanceSnapshot -> Maybe InstanceSnapshotState
$sel:sizeInGb:InstanceSnapshot' :: InstanceSnapshot -> Maybe Int
$sel:resourceType:InstanceSnapshot' :: InstanceSnapshot -> Maybe ResourceType
$sel:progress:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
$sel:name:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
$sel:location:InstanceSnapshot' :: InstanceSnapshot -> Maybe ResourceLocation
$sel:isFromAutoSnapshot:InstanceSnapshot' :: InstanceSnapshot -> Maybe Bool
$sel:fromInstanceName:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
$sel:fromInstanceArn:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
$sel:fromBundleId:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
$sel:fromBlueprintId:InstanceSnapshot' :: InstanceSnapshot -> Maybe Text
$sel:fromAttachedDisks:InstanceSnapshot' :: InstanceSnapshot -> Maybe [Disk]
$sel:createdAt:InstanceSnapshot' :: InstanceSnapshot -> Maybe POSIX
$sel:arn:InstanceSnapshot' :: InstanceSnapshot -> 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 [Disk]
fromAttachedDisks
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fromBlueprintId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fromBundleId
      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 InstanceSnapshotState
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