{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.CreateDiskFromSnapshot
-- 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)
--
-- Creates a block storage disk from a manual or automatic snapshot of a
-- disk. The resulting disk can be attached to an Amazon Lightsail instance
-- in the same Availability Zone (e.g., @us-east-2a@).
--
-- The @create disk from snapshot@ operation supports tag-based access
-- control via request tags and resource tags applied to the resource
-- identified by @disk snapshot name@. For more information, see the
-- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-controlling-access-using-tags Amazon Lightsail Developer Guide>.
module Amazonka.Lightsail.CreateDiskFromSnapshot
  ( -- * Creating a Request
    CreateDiskFromSnapshot (..),
    newCreateDiskFromSnapshot,

    -- * Request Lenses
    createDiskFromSnapshot_useLatestRestorableAutoSnapshot,
    createDiskFromSnapshot_sourceDiskName,
    createDiskFromSnapshot_addOns,
    createDiskFromSnapshot_diskSnapshotName,
    createDiskFromSnapshot_restoreDate,
    createDiskFromSnapshot_tags,
    createDiskFromSnapshot_diskName,
    createDiskFromSnapshot_availabilityZone,
    createDiskFromSnapshot_sizeInGb,

    -- * Destructuring the Response
    CreateDiskFromSnapshotResponse (..),
    newCreateDiskFromSnapshotResponse,

    -- * Response Lenses
    createDiskFromSnapshotResponse_operations,
    createDiskFromSnapshotResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateDiskFromSnapshot' smart constructor.
data CreateDiskFromSnapshot = CreateDiskFromSnapshot'
  { -- | A Boolean value to indicate whether to use the latest available
    -- automatic snapshot.
    --
    -- Constraints:
    --
    -- -   This parameter cannot be defined together with the @restore date@
    --     parameter. The @use latest restorable auto snapshot@ and
    --     @restore date@ parameters are mutually exclusive.
    --
    -- -   Define this parameter only when creating a new disk from an
    --     automatic snapshot. For more information, see the
    --     <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots Amazon Lightsail Developer Guide>.
    CreateDiskFromSnapshot -> Maybe Bool
useLatestRestorableAutoSnapshot :: Prelude.Maybe Prelude.Bool,
    -- | The name of the source disk from which the source automatic snapshot was
    -- created.
    --
    -- Constraints:
    --
    -- -   This parameter cannot be defined together with the
    --     @disk snapshot name@ parameter. The @source disk name@ and
    --     @disk snapshot name@ parameters are mutually exclusive.
    --
    -- -   Define this parameter only when creating a new disk from an
    --     automatic snapshot. For more information, see the
    --     <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots Amazon Lightsail Developer Guide>.
    CreateDiskFromSnapshot -> Maybe Text
sourceDiskName :: Prelude.Maybe Prelude.Text,
    -- | An array of objects that represent the add-ons to enable for the new
    -- disk.
    CreateDiskFromSnapshot -> Maybe [AddOnRequest]
addOns :: Prelude.Maybe [AddOnRequest],
    -- | The name of the disk snapshot (e.g., @my-snapshot@) from which to create
    -- the new storage disk.
    --
    -- Constraint:
    --
    -- -   This parameter cannot be defined together with the
    --     @source disk name@ parameter. The @disk snapshot name@ and
    --     @source disk name@ parameters are mutually exclusive.
    CreateDiskFromSnapshot -> Maybe Text
diskSnapshotName :: Prelude.Maybe Prelude.Text,
    -- | The date of the automatic snapshot to use for the new disk. Use the
    -- @get auto snapshots@ operation to identify the dates of the available
    -- automatic snapshots.
    --
    -- Constraints:
    --
    -- -   Must be specified in @YYYY-MM-DD@ format.
    --
    -- -   This parameter cannot be defined together with the
    --     @use latest restorable auto snapshot@ parameter. The @restore date@
    --     and @use latest restorable auto snapshot@ parameters are mutually
    --     exclusive.
    --
    -- -   Define this parameter only when creating a new disk from an
    --     automatic snapshot. For more information, see the
    --     <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots Amazon Lightsail Developer Guide>.
    CreateDiskFromSnapshot -> Maybe Text
restoreDate :: Prelude.Maybe Prelude.Text,
    -- | The tag keys and optional values to add to the resource during create.
    --
    -- Use the @TagResource@ action to tag a resource after it\'s created.
    CreateDiskFromSnapshot -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The unique Lightsail disk name (e.g., @my-disk@).
    CreateDiskFromSnapshot -> Text
diskName :: Prelude.Text,
    -- | The Availability Zone where you want to create the disk (e.g.,
    -- @us-east-2a@). Choose the same Availability Zone as the Lightsail
    -- instance where you want to create the disk.
    --
    -- Use the GetRegions operation to list the Availability Zones where
    -- Lightsail is currently available.
    CreateDiskFromSnapshot -> Text
availabilityZone :: Prelude.Text,
    -- | The size of the disk in GB (e.g., @32@).
    CreateDiskFromSnapshot -> Int
sizeInGb :: Prelude.Int
  }
  deriving (CreateDiskFromSnapshot -> CreateDiskFromSnapshot -> Bool
(CreateDiskFromSnapshot -> CreateDiskFromSnapshot -> Bool)
-> (CreateDiskFromSnapshot -> CreateDiskFromSnapshot -> Bool)
-> Eq CreateDiskFromSnapshot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDiskFromSnapshot -> CreateDiskFromSnapshot -> Bool
$c/= :: CreateDiskFromSnapshot -> CreateDiskFromSnapshot -> Bool
== :: CreateDiskFromSnapshot -> CreateDiskFromSnapshot -> Bool
$c== :: CreateDiskFromSnapshot -> CreateDiskFromSnapshot -> Bool
Prelude.Eq, ReadPrec [CreateDiskFromSnapshot]
ReadPrec CreateDiskFromSnapshot
Int -> ReadS CreateDiskFromSnapshot
ReadS [CreateDiskFromSnapshot]
(Int -> ReadS CreateDiskFromSnapshot)
-> ReadS [CreateDiskFromSnapshot]
-> ReadPrec CreateDiskFromSnapshot
-> ReadPrec [CreateDiskFromSnapshot]
-> Read CreateDiskFromSnapshot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDiskFromSnapshot]
$creadListPrec :: ReadPrec [CreateDiskFromSnapshot]
readPrec :: ReadPrec CreateDiskFromSnapshot
$creadPrec :: ReadPrec CreateDiskFromSnapshot
readList :: ReadS [CreateDiskFromSnapshot]
$creadList :: ReadS [CreateDiskFromSnapshot]
readsPrec :: Int -> ReadS CreateDiskFromSnapshot
$creadsPrec :: Int -> ReadS CreateDiskFromSnapshot
Prelude.Read, Int -> CreateDiskFromSnapshot -> ShowS
[CreateDiskFromSnapshot] -> ShowS
CreateDiskFromSnapshot -> String
(Int -> CreateDiskFromSnapshot -> ShowS)
-> (CreateDiskFromSnapshot -> String)
-> ([CreateDiskFromSnapshot] -> ShowS)
-> Show CreateDiskFromSnapshot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDiskFromSnapshot] -> ShowS
$cshowList :: [CreateDiskFromSnapshot] -> ShowS
show :: CreateDiskFromSnapshot -> String
$cshow :: CreateDiskFromSnapshot -> String
showsPrec :: Int -> CreateDiskFromSnapshot -> ShowS
$cshowsPrec :: Int -> CreateDiskFromSnapshot -> ShowS
Prelude.Show, (forall x. CreateDiskFromSnapshot -> Rep CreateDiskFromSnapshot x)
-> (forall x.
    Rep CreateDiskFromSnapshot x -> CreateDiskFromSnapshot)
-> Generic CreateDiskFromSnapshot
forall x. Rep CreateDiskFromSnapshot x -> CreateDiskFromSnapshot
forall x. CreateDiskFromSnapshot -> Rep CreateDiskFromSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDiskFromSnapshot x -> CreateDiskFromSnapshot
$cfrom :: forall x. CreateDiskFromSnapshot -> Rep CreateDiskFromSnapshot x
Prelude.Generic)

-- |
-- Create a value of 'CreateDiskFromSnapshot' 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:
--
-- 'useLatestRestorableAutoSnapshot', 'createDiskFromSnapshot_useLatestRestorableAutoSnapshot' - A Boolean value to indicate whether to use the latest available
-- automatic snapshot.
--
-- Constraints:
--
-- -   This parameter cannot be defined together with the @restore date@
--     parameter. The @use latest restorable auto snapshot@ and
--     @restore date@ parameters are mutually exclusive.
--
-- -   Define this parameter only when creating a new disk from an
--     automatic snapshot. For more information, see the
--     <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots Amazon Lightsail Developer Guide>.
--
-- 'sourceDiskName', 'createDiskFromSnapshot_sourceDiskName' - The name of the source disk from which the source automatic snapshot was
-- created.
--
-- Constraints:
--
-- -   This parameter cannot be defined together with the
--     @disk snapshot name@ parameter. The @source disk name@ and
--     @disk snapshot name@ parameters are mutually exclusive.
--
-- -   Define this parameter only when creating a new disk from an
--     automatic snapshot. For more information, see the
--     <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots Amazon Lightsail Developer Guide>.
--
-- 'addOns', 'createDiskFromSnapshot_addOns' - An array of objects that represent the add-ons to enable for the new
-- disk.
--
-- 'diskSnapshotName', 'createDiskFromSnapshot_diskSnapshotName' - The name of the disk snapshot (e.g., @my-snapshot@) from which to create
-- the new storage disk.
--
-- Constraint:
--
-- -   This parameter cannot be defined together with the
--     @source disk name@ parameter. The @disk snapshot name@ and
--     @source disk name@ parameters are mutually exclusive.
--
-- 'restoreDate', 'createDiskFromSnapshot_restoreDate' - The date of the automatic snapshot to use for the new disk. Use the
-- @get auto snapshots@ operation to identify the dates of the available
-- automatic snapshots.
--
-- Constraints:
--
-- -   Must be specified in @YYYY-MM-DD@ format.
--
-- -   This parameter cannot be defined together with the
--     @use latest restorable auto snapshot@ parameter. The @restore date@
--     and @use latest restorable auto snapshot@ parameters are mutually
--     exclusive.
--
-- -   Define this parameter only when creating a new disk from an
--     automatic snapshot. For more information, see the
--     <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots Amazon Lightsail Developer Guide>.
--
-- 'tags', 'createDiskFromSnapshot_tags' - The tag keys and optional values to add to the resource during create.
--
-- Use the @TagResource@ action to tag a resource after it\'s created.
--
-- 'diskName', 'createDiskFromSnapshot_diskName' - The unique Lightsail disk name (e.g., @my-disk@).
--
-- 'availabilityZone', 'createDiskFromSnapshot_availabilityZone' - The Availability Zone where you want to create the disk (e.g.,
-- @us-east-2a@). Choose the same Availability Zone as the Lightsail
-- instance where you want to create the disk.
--
-- Use the GetRegions operation to list the Availability Zones where
-- Lightsail is currently available.
--
-- 'sizeInGb', 'createDiskFromSnapshot_sizeInGb' - The size of the disk in GB (e.g., @32@).
newCreateDiskFromSnapshot ::
  -- | 'diskName'
  Prelude.Text ->
  -- | 'availabilityZone'
  Prelude.Text ->
  -- | 'sizeInGb'
  Prelude.Int ->
  CreateDiskFromSnapshot
newCreateDiskFromSnapshot :: Text -> Text -> Int -> CreateDiskFromSnapshot
newCreateDiskFromSnapshot
  Text
pDiskName_
  Text
pAvailabilityZone_
  Int
pSizeInGb_ =
    CreateDiskFromSnapshot' :: Maybe Bool
-> Maybe Text
-> Maybe [AddOnRequest]
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Text
-> Text
-> Int
-> CreateDiskFromSnapshot
CreateDiskFromSnapshot'
      { $sel:useLatestRestorableAutoSnapshot:CreateDiskFromSnapshot' :: Maybe Bool
useLatestRestorableAutoSnapshot =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:sourceDiskName:CreateDiskFromSnapshot' :: Maybe Text
sourceDiskName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:addOns:CreateDiskFromSnapshot' :: Maybe [AddOnRequest]
addOns = Maybe [AddOnRequest]
forall a. Maybe a
Prelude.Nothing,
        $sel:diskSnapshotName:CreateDiskFromSnapshot' :: Maybe Text
diskSnapshotName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:restoreDate:CreateDiskFromSnapshot' :: Maybe Text
restoreDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateDiskFromSnapshot' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:diskName:CreateDiskFromSnapshot' :: Text
diskName = Text
pDiskName_,
        $sel:availabilityZone:CreateDiskFromSnapshot' :: Text
availabilityZone = Text
pAvailabilityZone_,
        $sel:sizeInGb:CreateDiskFromSnapshot' :: Int
sizeInGb = Int
pSizeInGb_
      }

-- | A Boolean value to indicate whether to use the latest available
-- automatic snapshot.
--
-- Constraints:
--
-- -   This parameter cannot be defined together with the @restore date@
--     parameter. The @use latest restorable auto snapshot@ and
--     @restore date@ parameters are mutually exclusive.
--
-- -   Define this parameter only when creating a new disk from an
--     automatic snapshot. For more information, see the
--     <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots Amazon Lightsail Developer Guide>.
createDiskFromSnapshot_useLatestRestorableAutoSnapshot :: Lens.Lens' CreateDiskFromSnapshot (Prelude.Maybe Prelude.Bool)
createDiskFromSnapshot_useLatestRestorableAutoSnapshot :: (Maybe Bool -> f (Maybe Bool))
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_useLatestRestorableAutoSnapshot = (CreateDiskFromSnapshot -> Maybe Bool)
-> (CreateDiskFromSnapshot -> Maybe Bool -> CreateDiskFromSnapshot)
-> Lens
     CreateDiskFromSnapshot
     CreateDiskFromSnapshot
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Maybe Bool
useLatestRestorableAutoSnapshot :: Maybe Bool
$sel:useLatestRestorableAutoSnapshot:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe Bool
useLatestRestorableAutoSnapshot} -> Maybe Bool
useLatestRestorableAutoSnapshot) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Maybe Bool
a -> CreateDiskFromSnapshot
s {$sel:useLatestRestorableAutoSnapshot:CreateDiskFromSnapshot' :: Maybe Bool
useLatestRestorableAutoSnapshot = Maybe Bool
a} :: CreateDiskFromSnapshot)

-- | The name of the source disk from which the source automatic snapshot was
-- created.
--
-- Constraints:
--
-- -   This parameter cannot be defined together with the
--     @disk snapshot name@ parameter. The @source disk name@ and
--     @disk snapshot name@ parameters are mutually exclusive.
--
-- -   Define this parameter only when creating a new disk from an
--     automatic snapshot. For more information, see the
--     <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots Amazon Lightsail Developer Guide>.
createDiskFromSnapshot_sourceDiskName :: Lens.Lens' CreateDiskFromSnapshot (Prelude.Maybe Prelude.Text)
createDiskFromSnapshot_sourceDiskName :: (Maybe Text -> f (Maybe Text))
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_sourceDiskName = (CreateDiskFromSnapshot -> Maybe Text)
-> (CreateDiskFromSnapshot -> Maybe Text -> CreateDiskFromSnapshot)
-> Lens
     CreateDiskFromSnapshot
     CreateDiskFromSnapshot
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Maybe Text
sourceDiskName :: Maybe Text
$sel:sourceDiskName:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe Text
sourceDiskName} -> Maybe Text
sourceDiskName) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Maybe Text
a -> CreateDiskFromSnapshot
s {$sel:sourceDiskName:CreateDiskFromSnapshot' :: Maybe Text
sourceDiskName = Maybe Text
a} :: CreateDiskFromSnapshot)

-- | An array of objects that represent the add-ons to enable for the new
-- disk.
createDiskFromSnapshot_addOns :: Lens.Lens' CreateDiskFromSnapshot (Prelude.Maybe [AddOnRequest])
createDiskFromSnapshot_addOns :: (Maybe [AddOnRequest] -> f (Maybe [AddOnRequest]))
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_addOns = (CreateDiskFromSnapshot -> Maybe [AddOnRequest])
-> (CreateDiskFromSnapshot
    -> Maybe [AddOnRequest] -> CreateDiskFromSnapshot)
-> Lens
     CreateDiskFromSnapshot
     CreateDiskFromSnapshot
     (Maybe [AddOnRequest])
     (Maybe [AddOnRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Maybe [AddOnRequest]
addOns :: Maybe [AddOnRequest]
$sel:addOns:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe [AddOnRequest]
addOns} -> Maybe [AddOnRequest]
addOns) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Maybe [AddOnRequest]
a -> CreateDiskFromSnapshot
s {$sel:addOns:CreateDiskFromSnapshot' :: Maybe [AddOnRequest]
addOns = Maybe [AddOnRequest]
a} :: CreateDiskFromSnapshot) ((Maybe [AddOnRequest] -> f (Maybe [AddOnRequest]))
 -> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot)
-> ((Maybe [AddOnRequest] -> f (Maybe [AddOnRequest]))
    -> Maybe [AddOnRequest] -> f (Maybe [AddOnRequest]))
-> (Maybe [AddOnRequest] -> f (Maybe [AddOnRequest]))
-> CreateDiskFromSnapshot
-> f CreateDiskFromSnapshot
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [AddOnRequest] [AddOnRequest] [AddOnRequest] [AddOnRequest]
-> Iso
     (Maybe [AddOnRequest])
     (Maybe [AddOnRequest])
     (Maybe [AddOnRequest])
     (Maybe [AddOnRequest])
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 [AddOnRequest] [AddOnRequest] [AddOnRequest] [AddOnRequest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the disk snapshot (e.g., @my-snapshot@) from which to create
-- the new storage disk.
--
-- Constraint:
--
-- -   This parameter cannot be defined together with the
--     @source disk name@ parameter. The @disk snapshot name@ and
--     @source disk name@ parameters are mutually exclusive.
createDiskFromSnapshot_diskSnapshotName :: Lens.Lens' CreateDiskFromSnapshot (Prelude.Maybe Prelude.Text)
createDiskFromSnapshot_diskSnapshotName :: (Maybe Text -> f (Maybe Text))
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_diskSnapshotName = (CreateDiskFromSnapshot -> Maybe Text)
-> (CreateDiskFromSnapshot -> Maybe Text -> CreateDiskFromSnapshot)
-> Lens
     CreateDiskFromSnapshot
     CreateDiskFromSnapshot
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Maybe Text
diskSnapshotName :: Maybe Text
$sel:diskSnapshotName:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe Text
diskSnapshotName} -> Maybe Text
diskSnapshotName) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Maybe Text
a -> CreateDiskFromSnapshot
s {$sel:diskSnapshotName:CreateDiskFromSnapshot' :: Maybe Text
diskSnapshotName = Maybe Text
a} :: CreateDiskFromSnapshot)

-- | The date of the automatic snapshot to use for the new disk. Use the
-- @get auto snapshots@ operation to identify the dates of the available
-- automatic snapshots.
--
-- Constraints:
--
-- -   Must be specified in @YYYY-MM-DD@ format.
--
-- -   This parameter cannot be defined together with the
--     @use latest restorable auto snapshot@ parameter. The @restore date@
--     and @use latest restorable auto snapshot@ parameters are mutually
--     exclusive.
--
-- -   Define this parameter only when creating a new disk from an
--     automatic snapshot. For more information, see the
--     <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots Amazon Lightsail Developer Guide>.
createDiskFromSnapshot_restoreDate :: Lens.Lens' CreateDiskFromSnapshot (Prelude.Maybe Prelude.Text)
createDiskFromSnapshot_restoreDate :: (Maybe Text -> f (Maybe Text))
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_restoreDate = (CreateDiskFromSnapshot -> Maybe Text)
-> (CreateDiskFromSnapshot -> Maybe Text -> CreateDiskFromSnapshot)
-> Lens
     CreateDiskFromSnapshot
     CreateDiskFromSnapshot
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Maybe Text
restoreDate :: Maybe Text
$sel:restoreDate:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe Text
restoreDate} -> Maybe Text
restoreDate) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Maybe Text
a -> CreateDiskFromSnapshot
s {$sel:restoreDate:CreateDiskFromSnapshot' :: Maybe Text
restoreDate = Maybe Text
a} :: CreateDiskFromSnapshot)

-- | The tag keys and optional values to add to the resource during create.
--
-- Use the @TagResource@ action to tag a resource after it\'s created.
createDiskFromSnapshot_tags :: Lens.Lens' CreateDiskFromSnapshot (Prelude.Maybe [Tag])
createDiskFromSnapshot_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_tags = (CreateDiskFromSnapshot -> Maybe [Tag])
-> (CreateDiskFromSnapshot
    -> Maybe [Tag] -> CreateDiskFromSnapshot)
-> Lens
     CreateDiskFromSnapshot
     CreateDiskFromSnapshot
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Maybe [Tag]
a -> CreateDiskFromSnapshot
s {$sel:tags:CreateDiskFromSnapshot' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateDiskFromSnapshot) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDiskFromSnapshot
-> f CreateDiskFromSnapshot
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

-- | The unique Lightsail disk name (e.g., @my-disk@).
createDiskFromSnapshot_diskName :: Lens.Lens' CreateDiskFromSnapshot Prelude.Text
createDiskFromSnapshot_diskName :: (Text -> f Text)
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_diskName = (CreateDiskFromSnapshot -> Text)
-> (CreateDiskFromSnapshot -> Text -> CreateDiskFromSnapshot)
-> Lens CreateDiskFromSnapshot CreateDiskFromSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Text
diskName :: Text
$sel:diskName:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Text
diskName} -> Text
diskName) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Text
a -> CreateDiskFromSnapshot
s {$sel:diskName:CreateDiskFromSnapshot' :: Text
diskName = Text
a} :: CreateDiskFromSnapshot)

-- | The Availability Zone where you want to create the disk (e.g.,
-- @us-east-2a@). Choose the same Availability Zone as the Lightsail
-- instance where you want to create the disk.
--
-- Use the GetRegions operation to list the Availability Zones where
-- Lightsail is currently available.
createDiskFromSnapshot_availabilityZone :: Lens.Lens' CreateDiskFromSnapshot Prelude.Text
createDiskFromSnapshot_availabilityZone :: (Text -> f Text)
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_availabilityZone = (CreateDiskFromSnapshot -> Text)
-> (CreateDiskFromSnapshot -> Text -> CreateDiskFromSnapshot)
-> Lens CreateDiskFromSnapshot CreateDiskFromSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Text
availabilityZone :: Text
$sel:availabilityZone:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Text
availabilityZone} -> Text
availabilityZone) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Text
a -> CreateDiskFromSnapshot
s {$sel:availabilityZone:CreateDiskFromSnapshot' :: Text
availabilityZone = Text
a} :: CreateDiskFromSnapshot)

-- | The size of the disk in GB (e.g., @32@).
createDiskFromSnapshot_sizeInGb :: Lens.Lens' CreateDiskFromSnapshot Prelude.Int
createDiskFromSnapshot_sizeInGb :: (Int -> f Int)
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_sizeInGb = (CreateDiskFromSnapshot -> Int)
-> (CreateDiskFromSnapshot -> Int -> CreateDiskFromSnapshot)
-> Lens CreateDiskFromSnapshot CreateDiskFromSnapshot Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Int
sizeInGb :: Int
$sel:sizeInGb:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Int
sizeInGb} -> Int
sizeInGb) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Int
a -> CreateDiskFromSnapshot
s {$sel:sizeInGb:CreateDiskFromSnapshot' :: Int
sizeInGb = Int
a} :: CreateDiskFromSnapshot)

instance Core.AWSRequest CreateDiskFromSnapshot where
  type
    AWSResponse CreateDiskFromSnapshot =
      CreateDiskFromSnapshotResponse
  request :: CreateDiskFromSnapshot -> Request CreateDiskFromSnapshot
request = Service -> CreateDiskFromSnapshot -> Request CreateDiskFromSnapshot
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateDiskFromSnapshot
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateDiskFromSnapshot)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateDiskFromSnapshot))
-> Logger
-> Service
-> Proxy CreateDiskFromSnapshot
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateDiskFromSnapshot)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [Operation] -> Int -> CreateDiskFromSnapshotResponse
CreateDiskFromSnapshotResponse'
            (Maybe [Operation] -> Int -> CreateDiskFromSnapshotResponse)
-> Either String (Maybe [Operation])
-> Either String (Int -> CreateDiskFromSnapshotResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Operation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"operations" Either String (Maybe (Maybe [Operation]))
-> Maybe [Operation] -> Either String (Maybe [Operation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Operation]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> CreateDiskFromSnapshotResponse)
-> Either String Int
-> Either String CreateDiskFromSnapshotResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateDiskFromSnapshot

instance Prelude.NFData CreateDiskFromSnapshot

instance Core.ToHeaders CreateDiskFromSnapshot where
  toHeaders :: CreateDiskFromSnapshot -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateDiskFromSnapshot -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Lightsail_20161128.CreateDiskFromSnapshot" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateDiskFromSnapshot where
  toJSON :: CreateDiskFromSnapshot -> Value
toJSON CreateDiskFromSnapshot' {Int
Maybe Bool
Maybe [AddOnRequest]
Maybe [Tag]
Maybe Text
Text
sizeInGb :: Int
availabilityZone :: Text
diskName :: Text
tags :: Maybe [Tag]
restoreDate :: Maybe Text
diskSnapshotName :: Maybe Text
addOns :: Maybe [AddOnRequest]
sourceDiskName :: Maybe Text
useLatestRestorableAutoSnapshot :: Maybe Bool
$sel:sizeInGb:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Int
$sel:availabilityZone:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Text
$sel:diskName:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Text
$sel:tags:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe [Tag]
$sel:restoreDate:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe Text
$sel:diskSnapshotName:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe Text
$sel:addOns:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe [AddOnRequest]
$sel:sourceDiskName:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe Text
$sel:useLatestRestorableAutoSnapshot:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"useLatestRestorableAutoSnapshot" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
useLatestRestorableAutoSnapshot,
            (Text
"sourceDiskName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sourceDiskName,
            (Text
"addOns" Text -> [AddOnRequest] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([AddOnRequest] -> Pair) -> Maybe [AddOnRequest] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AddOnRequest]
addOns,
            (Text
"diskSnapshotName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
diskSnapshotName,
            (Text
"restoreDate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
restoreDate,
            (Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"diskName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
diskName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"availabilityZone" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
availabilityZone),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"sizeInGb" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
sizeInGb)
          ]
      )

instance Core.ToPath CreateDiskFromSnapshot where
  toPath :: CreateDiskFromSnapshot -> ByteString
toPath = ByteString -> CreateDiskFromSnapshot -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery CreateDiskFromSnapshot where
  toQuery :: CreateDiskFromSnapshot -> QueryString
toQuery = QueryString -> CreateDiskFromSnapshot -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateDiskFromSnapshotResponse' smart constructor.
data CreateDiskFromSnapshotResponse = CreateDiskFromSnapshotResponse'
  { -- | An array of objects that describe the result of the action, such as the
    -- status of the request, the timestamp of the request, and the resources
    -- affected by the request.
    CreateDiskFromSnapshotResponse -> Maybe [Operation]
operations :: Prelude.Maybe [Operation],
    -- | The response's http status code.
    CreateDiskFromSnapshotResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateDiskFromSnapshotResponse
-> CreateDiskFromSnapshotResponse -> Bool
(CreateDiskFromSnapshotResponse
 -> CreateDiskFromSnapshotResponse -> Bool)
-> (CreateDiskFromSnapshotResponse
    -> CreateDiskFromSnapshotResponse -> Bool)
-> Eq CreateDiskFromSnapshotResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDiskFromSnapshotResponse
-> CreateDiskFromSnapshotResponse -> Bool
$c/= :: CreateDiskFromSnapshotResponse
-> CreateDiskFromSnapshotResponse -> Bool
== :: CreateDiskFromSnapshotResponse
-> CreateDiskFromSnapshotResponse -> Bool
$c== :: CreateDiskFromSnapshotResponse
-> CreateDiskFromSnapshotResponse -> Bool
Prelude.Eq, ReadPrec [CreateDiskFromSnapshotResponse]
ReadPrec CreateDiskFromSnapshotResponse
Int -> ReadS CreateDiskFromSnapshotResponse
ReadS [CreateDiskFromSnapshotResponse]
(Int -> ReadS CreateDiskFromSnapshotResponse)
-> ReadS [CreateDiskFromSnapshotResponse]
-> ReadPrec CreateDiskFromSnapshotResponse
-> ReadPrec [CreateDiskFromSnapshotResponse]
-> Read CreateDiskFromSnapshotResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDiskFromSnapshotResponse]
$creadListPrec :: ReadPrec [CreateDiskFromSnapshotResponse]
readPrec :: ReadPrec CreateDiskFromSnapshotResponse
$creadPrec :: ReadPrec CreateDiskFromSnapshotResponse
readList :: ReadS [CreateDiskFromSnapshotResponse]
$creadList :: ReadS [CreateDiskFromSnapshotResponse]
readsPrec :: Int -> ReadS CreateDiskFromSnapshotResponse
$creadsPrec :: Int -> ReadS CreateDiskFromSnapshotResponse
Prelude.Read, Int -> CreateDiskFromSnapshotResponse -> ShowS
[CreateDiskFromSnapshotResponse] -> ShowS
CreateDiskFromSnapshotResponse -> String
(Int -> CreateDiskFromSnapshotResponse -> ShowS)
-> (CreateDiskFromSnapshotResponse -> String)
-> ([CreateDiskFromSnapshotResponse] -> ShowS)
-> Show CreateDiskFromSnapshotResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDiskFromSnapshotResponse] -> ShowS
$cshowList :: [CreateDiskFromSnapshotResponse] -> ShowS
show :: CreateDiskFromSnapshotResponse -> String
$cshow :: CreateDiskFromSnapshotResponse -> String
showsPrec :: Int -> CreateDiskFromSnapshotResponse -> ShowS
$cshowsPrec :: Int -> CreateDiskFromSnapshotResponse -> ShowS
Prelude.Show, (forall x.
 CreateDiskFromSnapshotResponse
 -> Rep CreateDiskFromSnapshotResponse x)
-> (forall x.
    Rep CreateDiskFromSnapshotResponse x
    -> CreateDiskFromSnapshotResponse)
-> Generic CreateDiskFromSnapshotResponse
forall x.
Rep CreateDiskFromSnapshotResponse x
-> CreateDiskFromSnapshotResponse
forall x.
CreateDiskFromSnapshotResponse
-> Rep CreateDiskFromSnapshotResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDiskFromSnapshotResponse x
-> CreateDiskFromSnapshotResponse
$cfrom :: forall x.
CreateDiskFromSnapshotResponse
-> Rep CreateDiskFromSnapshotResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateDiskFromSnapshotResponse' 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:
--
-- 'operations', 'createDiskFromSnapshotResponse_operations' - An array of objects that describe the result of the action, such as the
-- status of the request, the timestamp of the request, and the resources
-- affected by the request.
--
-- 'httpStatus', 'createDiskFromSnapshotResponse_httpStatus' - The response's http status code.
newCreateDiskFromSnapshotResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateDiskFromSnapshotResponse
newCreateDiskFromSnapshotResponse :: Int -> CreateDiskFromSnapshotResponse
newCreateDiskFromSnapshotResponse Int
pHttpStatus_ =
  CreateDiskFromSnapshotResponse' :: Maybe [Operation] -> Int -> CreateDiskFromSnapshotResponse
CreateDiskFromSnapshotResponse'
    { $sel:operations:CreateDiskFromSnapshotResponse' :: Maybe [Operation]
operations =
        Maybe [Operation]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateDiskFromSnapshotResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of objects that describe the result of the action, such as the
-- status of the request, the timestamp of the request, and the resources
-- affected by the request.
createDiskFromSnapshotResponse_operations :: Lens.Lens' CreateDiskFromSnapshotResponse (Prelude.Maybe [Operation])
createDiskFromSnapshotResponse_operations :: (Maybe [Operation] -> f (Maybe [Operation]))
-> CreateDiskFromSnapshotResponse
-> f CreateDiskFromSnapshotResponse
createDiskFromSnapshotResponse_operations = (CreateDiskFromSnapshotResponse -> Maybe [Operation])
-> (CreateDiskFromSnapshotResponse
    -> Maybe [Operation] -> CreateDiskFromSnapshotResponse)
-> Lens
     CreateDiskFromSnapshotResponse
     CreateDiskFromSnapshotResponse
     (Maybe [Operation])
     (Maybe [Operation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshotResponse' {Maybe [Operation]
operations :: Maybe [Operation]
$sel:operations:CreateDiskFromSnapshotResponse' :: CreateDiskFromSnapshotResponse -> Maybe [Operation]
operations} -> Maybe [Operation]
operations) (\s :: CreateDiskFromSnapshotResponse
s@CreateDiskFromSnapshotResponse' {} Maybe [Operation]
a -> CreateDiskFromSnapshotResponse
s {$sel:operations:CreateDiskFromSnapshotResponse' :: Maybe [Operation]
operations = Maybe [Operation]
a} :: CreateDiskFromSnapshotResponse) ((Maybe [Operation] -> f (Maybe [Operation]))
 -> CreateDiskFromSnapshotResponse
 -> f CreateDiskFromSnapshotResponse)
-> ((Maybe [Operation] -> f (Maybe [Operation]))
    -> Maybe [Operation] -> f (Maybe [Operation]))
-> (Maybe [Operation] -> f (Maybe [Operation]))
-> CreateDiskFromSnapshotResponse
-> f CreateDiskFromSnapshotResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Operation] [Operation] [Operation] [Operation]
-> Iso
     (Maybe [Operation])
     (Maybe [Operation])
     (Maybe [Operation])
     (Maybe [Operation])
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 [Operation] [Operation] [Operation] [Operation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
createDiskFromSnapshotResponse_httpStatus :: Lens.Lens' CreateDiskFromSnapshotResponse Prelude.Int
createDiskFromSnapshotResponse_httpStatus :: (Int -> f Int)
-> CreateDiskFromSnapshotResponse
-> f CreateDiskFromSnapshotResponse
createDiskFromSnapshotResponse_httpStatus = (CreateDiskFromSnapshotResponse -> Int)
-> (CreateDiskFromSnapshotResponse
    -> Int -> CreateDiskFromSnapshotResponse)
-> Lens
     CreateDiskFromSnapshotResponse
     CreateDiskFromSnapshotResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshotResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateDiskFromSnapshotResponse' :: CreateDiskFromSnapshotResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateDiskFromSnapshotResponse
s@CreateDiskFromSnapshotResponse' {} Int
a -> CreateDiskFromSnapshotResponse
s {$sel:httpStatus:CreateDiskFromSnapshotResponse' :: Int
httpStatus = Int
a} :: CreateDiskFromSnapshotResponse)

instance
  Prelude.NFData
    CreateDiskFromSnapshotResponse