{-# 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.EBS.StartSnapshot
-- 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 new Amazon EBS snapshot. The new snapshot enters the @pending@
-- state after the request completes.
--
-- After creating the snapshot, use
-- <https://docs.aws.amazon.com/ebs/latest/APIReference/API_PutSnapshotBlock.html PutSnapshotBlock>
-- to write blocks of data to the snapshot.
module Amazonka.EBS.StartSnapshot
  ( -- * Creating a Request
    StartSnapshot (..),
    newStartSnapshot,

    -- * Request Lenses
    startSnapshot_kmsKeyArn,
    startSnapshot_clientToken,
    startSnapshot_encrypted,
    startSnapshot_parentSnapshotId,
    startSnapshot_timeout,
    startSnapshot_description,
    startSnapshot_tags,
    startSnapshot_volumeSize,

    -- * Destructuring the Response
    StartSnapshotResponse (..),
    newStartSnapshotResponse,

    -- * Response Lenses
    startSnapshotResponse_blockSize,
    startSnapshotResponse_status,
    startSnapshotResponse_kmsKeyArn,
    startSnapshotResponse_startTime,
    startSnapshotResponse_volumeSize,
    startSnapshotResponse_ownerId,
    startSnapshotResponse_parentSnapshotId,
    startSnapshotResponse_description,
    startSnapshotResponse_tags,
    startSnapshotResponse_snapshotId,
    startSnapshotResponse_httpStatus,
  )
where

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

-- | /See:/ 'newStartSnapshot' smart constructor.
data StartSnapshot = StartSnapshot'
  { -- | The Amazon Resource Name (ARN) of the Key Management Service (KMS) key
    -- to be used to encrypt the snapshot. If you do not specify a KMS key, the
    -- default Amazon Web Services managed KMS key is used.
    --
    -- If you specify a __ParentSnapshotId__, omit this parameter; the snapshot
    -- will be encrypted using the same KMS key that was used to encrypt the
    -- parent snapshot.
    --
    -- If __Encrypted__ is set to @true@, you must specify a KMS key ARN.
    StartSnapshot -> Maybe (Sensitive Text)
kmsKeyArn :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | A unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request. Idempotency ensures that an API request
    -- completes only once. With an idempotent request, if the original request
    -- completes successfully. The subsequent retries with the same client
    -- token return the result from the original successful request and they
    -- have no additional effect.
    --
    -- If you do not specify a client token, one is automatically generated by
    -- the Amazon Web Services SDK.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html Idempotency for StartSnapshot API>
    -- in the /Amazon Elastic Compute Cloud User Guide/.
    StartSnapshot -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether to encrypt the snapshot. To create an encrypted
    -- snapshot, specify @true@. To create an unencrypted snapshot, omit this
    -- parameter.
    --
    -- If you specify a value for __ParentSnapshotId__, omit this parameter.
    --
    -- If you specify @true@, the snapshot is encrypted using the KMS key
    -- specified using the __KmsKeyArn__ parameter. If no value is specified
    -- for __KmsKeyArn__, the default KMS key for your account is used. If no
    -- default KMS key has been specified for your account, the Amazon Web
    -- Services managed KMS key is used. To set a default KMS key for your
    -- account, use
    -- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html ModifyEbsDefaultKmsKeyId>.
    --
    -- If your account is enabled for encryption by default, you cannot set
    -- this parameter to @false@. In this case, you can omit this parameter.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption Using encryption>
    -- in the /Amazon Elastic Compute Cloud User Guide/.
    StartSnapshot -> Maybe Bool
encrypted :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the parent snapshot. If there is no parent snapshot, or if you
    -- are creating the first snapshot for an on-premises volume, omit this
    -- parameter.
    --
    -- If your account is enabled for encryption by default, you cannot use an
    -- unencrypted snapshot as a parent snapshot. You must first create an
    -- encrypted copy of the parent snapshot using
    -- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html CopySnapshot>.
    StartSnapshot -> Maybe Text
parentSnapshotId :: Prelude.Maybe Prelude.Text,
    -- | The amount of time (in minutes) after which the snapshot is
    -- automatically cancelled if:
    --
    -- -   No blocks are written to the snapshot.
    --
    -- -   The snapshot is not completed after writing the last block of data.
    --
    -- If no value is specified, the timeout defaults to @60@ minutes.
    StartSnapshot -> Maybe Natural
timeout :: Prelude.Maybe Prelude.Natural,
    -- | A description for the snapshot.
    StartSnapshot -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags to apply to the snapshot.
    StartSnapshot -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The size of the volume, in GiB. The maximum size is @65536@ GiB (64
    -- TiB).
    StartSnapshot -> Natural
volumeSize :: Prelude.Natural
  }
  deriving (StartSnapshot -> StartSnapshot -> Bool
(StartSnapshot -> StartSnapshot -> Bool)
-> (StartSnapshot -> StartSnapshot -> Bool) -> Eq StartSnapshot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartSnapshot -> StartSnapshot -> Bool
$c/= :: StartSnapshot -> StartSnapshot -> Bool
== :: StartSnapshot -> StartSnapshot -> Bool
$c== :: StartSnapshot -> StartSnapshot -> Bool
Prelude.Eq, Int -> StartSnapshot -> ShowS
[StartSnapshot] -> ShowS
StartSnapshot -> String
(Int -> StartSnapshot -> ShowS)
-> (StartSnapshot -> String)
-> ([StartSnapshot] -> ShowS)
-> Show StartSnapshot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartSnapshot] -> ShowS
$cshowList :: [StartSnapshot] -> ShowS
show :: StartSnapshot -> String
$cshow :: StartSnapshot -> String
showsPrec :: Int -> StartSnapshot -> ShowS
$cshowsPrec :: Int -> StartSnapshot -> ShowS
Prelude.Show, (forall x. StartSnapshot -> Rep StartSnapshot x)
-> (forall x. Rep StartSnapshot x -> StartSnapshot)
-> Generic StartSnapshot
forall x. Rep StartSnapshot x -> StartSnapshot
forall x. StartSnapshot -> Rep StartSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartSnapshot x -> StartSnapshot
$cfrom :: forall x. StartSnapshot -> Rep StartSnapshot x
Prelude.Generic)

-- |
-- Create a value of 'StartSnapshot' 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:
--
-- 'kmsKeyArn', 'startSnapshot_kmsKeyArn' - The Amazon Resource Name (ARN) of the Key Management Service (KMS) key
-- to be used to encrypt the snapshot. If you do not specify a KMS key, the
-- default Amazon Web Services managed KMS key is used.
--
-- If you specify a __ParentSnapshotId__, omit this parameter; the snapshot
-- will be encrypted using the same KMS key that was used to encrypt the
-- parent snapshot.
--
-- If __Encrypted__ is set to @true@, you must specify a KMS key ARN.
--
-- 'clientToken', 'startSnapshot_clientToken' - A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. Idempotency ensures that an API request
-- completes only once. With an idempotent request, if the original request
-- completes successfully. The subsequent retries with the same client
-- token return the result from the original successful request and they
-- have no additional effect.
--
-- If you do not specify a client token, one is automatically generated by
-- the Amazon Web Services SDK.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html Idempotency for StartSnapshot API>
-- in the /Amazon Elastic Compute Cloud User Guide/.
--
-- 'encrypted', 'startSnapshot_encrypted' - Indicates whether to encrypt the snapshot. To create an encrypted
-- snapshot, specify @true@. To create an unencrypted snapshot, omit this
-- parameter.
--
-- If you specify a value for __ParentSnapshotId__, omit this parameter.
--
-- If you specify @true@, the snapshot is encrypted using the KMS key
-- specified using the __KmsKeyArn__ parameter. If no value is specified
-- for __KmsKeyArn__, the default KMS key for your account is used. If no
-- default KMS key has been specified for your account, the Amazon Web
-- Services managed KMS key is used. To set a default KMS key for your
-- account, use
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html ModifyEbsDefaultKmsKeyId>.
--
-- If your account is enabled for encryption by default, you cannot set
-- this parameter to @false@. In this case, you can omit this parameter.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption Using encryption>
-- in the /Amazon Elastic Compute Cloud User Guide/.
--
-- 'parentSnapshotId', 'startSnapshot_parentSnapshotId' - The ID of the parent snapshot. If there is no parent snapshot, or if you
-- are creating the first snapshot for an on-premises volume, omit this
-- parameter.
--
-- If your account is enabled for encryption by default, you cannot use an
-- unencrypted snapshot as a parent snapshot. You must first create an
-- encrypted copy of the parent snapshot using
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html CopySnapshot>.
--
-- 'timeout', 'startSnapshot_timeout' - The amount of time (in minutes) after which the snapshot is
-- automatically cancelled if:
--
-- -   No blocks are written to the snapshot.
--
-- -   The snapshot is not completed after writing the last block of data.
--
-- If no value is specified, the timeout defaults to @60@ minutes.
--
-- 'description', 'startSnapshot_description' - A description for the snapshot.
--
-- 'tags', 'startSnapshot_tags' - The tags to apply to the snapshot.
--
-- 'volumeSize', 'startSnapshot_volumeSize' - The size of the volume, in GiB. The maximum size is @65536@ GiB (64
-- TiB).
newStartSnapshot ::
  -- | 'volumeSize'
  Prelude.Natural ->
  StartSnapshot
newStartSnapshot :: Natural -> StartSnapshot
newStartSnapshot Natural
pVolumeSize_ =
  StartSnapshot' :: Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe [Tag]
-> Natural
-> StartSnapshot
StartSnapshot'
    { $sel:kmsKeyArn:StartSnapshot' :: Maybe (Sensitive Text)
kmsKeyArn = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:clientToken:StartSnapshot' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:encrypted:StartSnapshot' :: Maybe Bool
encrypted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:parentSnapshotId:StartSnapshot' :: Maybe Text
parentSnapshotId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:timeout:StartSnapshot' :: Maybe Natural
timeout = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:description:StartSnapshot' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:StartSnapshot' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeSize:StartSnapshot' :: Natural
volumeSize = Natural
pVolumeSize_
    }

-- | The Amazon Resource Name (ARN) of the Key Management Service (KMS) key
-- to be used to encrypt the snapshot. If you do not specify a KMS key, the
-- default Amazon Web Services managed KMS key is used.
--
-- If you specify a __ParentSnapshotId__, omit this parameter; the snapshot
-- will be encrypted using the same KMS key that was used to encrypt the
-- parent snapshot.
--
-- If __Encrypted__ is set to @true@, you must specify a KMS key ARN.
startSnapshot_kmsKeyArn :: Lens.Lens' StartSnapshot (Prelude.Maybe Prelude.Text)
startSnapshot_kmsKeyArn :: (Maybe Text -> f (Maybe Text)) -> StartSnapshot -> f StartSnapshot
startSnapshot_kmsKeyArn = (StartSnapshot -> Maybe (Sensitive Text))
-> (StartSnapshot -> Maybe (Sensitive Text) -> StartSnapshot)
-> Lens
     StartSnapshot
     StartSnapshot
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshot' {Maybe (Sensitive Text)
kmsKeyArn :: Maybe (Sensitive Text)
$sel:kmsKeyArn:StartSnapshot' :: StartSnapshot -> Maybe (Sensitive Text)
kmsKeyArn} -> Maybe (Sensitive Text)
kmsKeyArn) (\s :: StartSnapshot
s@StartSnapshot' {} Maybe (Sensitive Text)
a -> StartSnapshot
s {$sel:kmsKeyArn:StartSnapshot' :: Maybe (Sensitive Text)
kmsKeyArn = Maybe (Sensitive Text)
a} :: StartSnapshot) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> StartSnapshot -> f StartSnapshot)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> StartSnapshot
-> f StartSnapshot
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. Idempotency ensures that an API request
-- completes only once. With an idempotent request, if the original request
-- completes successfully. The subsequent retries with the same client
-- token return the result from the original successful request and they
-- have no additional effect.
--
-- If you do not specify a client token, one is automatically generated by
-- the Amazon Web Services SDK.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html Idempotency for StartSnapshot API>
-- in the /Amazon Elastic Compute Cloud User Guide/.
startSnapshot_clientToken :: Lens.Lens' StartSnapshot (Prelude.Maybe Prelude.Text)
startSnapshot_clientToken :: (Maybe Text -> f (Maybe Text)) -> StartSnapshot -> f StartSnapshot
startSnapshot_clientToken = (StartSnapshot -> Maybe Text)
-> (StartSnapshot -> Maybe Text -> StartSnapshot)
-> Lens StartSnapshot StartSnapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshot' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:StartSnapshot' :: StartSnapshot -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: StartSnapshot
s@StartSnapshot' {} Maybe Text
a -> StartSnapshot
s {$sel:clientToken:StartSnapshot' :: Maybe Text
clientToken = Maybe Text
a} :: StartSnapshot)

-- | Indicates whether to encrypt the snapshot. To create an encrypted
-- snapshot, specify @true@. To create an unencrypted snapshot, omit this
-- parameter.
--
-- If you specify a value for __ParentSnapshotId__, omit this parameter.
--
-- If you specify @true@, the snapshot is encrypted using the KMS key
-- specified using the __KmsKeyArn__ parameter. If no value is specified
-- for __KmsKeyArn__, the default KMS key for your account is used. If no
-- default KMS key has been specified for your account, the Amazon Web
-- Services managed KMS key is used. To set a default KMS key for your
-- account, use
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html ModifyEbsDefaultKmsKeyId>.
--
-- If your account is enabled for encryption by default, you cannot set
-- this parameter to @false@. In this case, you can omit this parameter.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption Using encryption>
-- in the /Amazon Elastic Compute Cloud User Guide/.
startSnapshot_encrypted :: Lens.Lens' StartSnapshot (Prelude.Maybe Prelude.Bool)
startSnapshot_encrypted :: (Maybe Bool -> f (Maybe Bool)) -> StartSnapshot -> f StartSnapshot
startSnapshot_encrypted = (StartSnapshot -> Maybe Bool)
-> (StartSnapshot -> Maybe Bool -> StartSnapshot)
-> Lens StartSnapshot StartSnapshot (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshot' {Maybe Bool
encrypted :: Maybe Bool
$sel:encrypted:StartSnapshot' :: StartSnapshot -> Maybe Bool
encrypted} -> Maybe Bool
encrypted) (\s :: StartSnapshot
s@StartSnapshot' {} Maybe Bool
a -> StartSnapshot
s {$sel:encrypted:StartSnapshot' :: Maybe Bool
encrypted = Maybe Bool
a} :: StartSnapshot)

-- | The ID of the parent snapshot. If there is no parent snapshot, or if you
-- are creating the first snapshot for an on-premises volume, omit this
-- parameter.
--
-- If your account is enabled for encryption by default, you cannot use an
-- unencrypted snapshot as a parent snapshot. You must first create an
-- encrypted copy of the parent snapshot using
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html CopySnapshot>.
startSnapshot_parentSnapshotId :: Lens.Lens' StartSnapshot (Prelude.Maybe Prelude.Text)
startSnapshot_parentSnapshotId :: (Maybe Text -> f (Maybe Text)) -> StartSnapshot -> f StartSnapshot
startSnapshot_parentSnapshotId = (StartSnapshot -> Maybe Text)
-> (StartSnapshot -> Maybe Text -> StartSnapshot)
-> Lens StartSnapshot StartSnapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshot' {Maybe Text
parentSnapshotId :: Maybe Text
$sel:parentSnapshotId:StartSnapshot' :: StartSnapshot -> Maybe Text
parentSnapshotId} -> Maybe Text
parentSnapshotId) (\s :: StartSnapshot
s@StartSnapshot' {} Maybe Text
a -> StartSnapshot
s {$sel:parentSnapshotId:StartSnapshot' :: Maybe Text
parentSnapshotId = Maybe Text
a} :: StartSnapshot)

-- | The amount of time (in minutes) after which the snapshot is
-- automatically cancelled if:
--
-- -   No blocks are written to the snapshot.
--
-- -   The snapshot is not completed after writing the last block of data.
--
-- If no value is specified, the timeout defaults to @60@ minutes.
startSnapshot_timeout :: Lens.Lens' StartSnapshot (Prelude.Maybe Prelude.Natural)
startSnapshot_timeout :: (Maybe Natural -> f (Maybe Natural))
-> StartSnapshot -> f StartSnapshot
startSnapshot_timeout = (StartSnapshot -> Maybe Natural)
-> (StartSnapshot -> Maybe Natural -> StartSnapshot)
-> Lens StartSnapshot StartSnapshot (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshot' {Maybe Natural
timeout :: Maybe Natural
$sel:timeout:StartSnapshot' :: StartSnapshot -> Maybe Natural
timeout} -> Maybe Natural
timeout) (\s :: StartSnapshot
s@StartSnapshot' {} Maybe Natural
a -> StartSnapshot
s {$sel:timeout:StartSnapshot' :: Maybe Natural
timeout = Maybe Natural
a} :: StartSnapshot)

-- | A description for the snapshot.
startSnapshot_description :: Lens.Lens' StartSnapshot (Prelude.Maybe Prelude.Text)
startSnapshot_description :: (Maybe Text -> f (Maybe Text)) -> StartSnapshot -> f StartSnapshot
startSnapshot_description = (StartSnapshot -> Maybe Text)
-> (StartSnapshot -> Maybe Text -> StartSnapshot)
-> Lens StartSnapshot StartSnapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshot' {Maybe Text
description :: Maybe Text
$sel:description:StartSnapshot' :: StartSnapshot -> Maybe Text
description} -> Maybe Text
description) (\s :: StartSnapshot
s@StartSnapshot' {} Maybe Text
a -> StartSnapshot
s {$sel:description:StartSnapshot' :: Maybe Text
description = Maybe Text
a} :: StartSnapshot)

-- | The tags to apply to the snapshot.
startSnapshot_tags :: Lens.Lens' StartSnapshot (Prelude.Maybe [Tag])
startSnapshot_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> StartSnapshot -> f StartSnapshot
startSnapshot_tags = (StartSnapshot -> Maybe [Tag])
-> (StartSnapshot -> Maybe [Tag] -> StartSnapshot)
-> Lens StartSnapshot StartSnapshot (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshot' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:StartSnapshot' :: StartSnapshot -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: StartSnapshot
s@StartSnapshot' {} Maybe [Tag]
a -> StartSnapshot
s {$sel:tags:StartSnapshot' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: StartSnapshot) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> StartSnapshot -> f StartSnapshot)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> StartSnapshot
-> f StartSnapshot
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 size of the volume, in GiB. The maximum size is @65536@ GiB (64
-- TiB).
startSnapshot_volumeSize :: Lens.Lens' StartSnapshot Prelude.Natural
startSnapshot_volumeSize :: (Natural -> f Natural) -> StartSnapshot -> f StartSnapshot
startSnapshot_volumeSize = (StartSnapshot -> Natural)
-> (StartSnapshot -> Natural -> StartSnapshot)
-> Lens StartSnapshot StartSnapshot Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshot' {Natural
volumeSize :: Natural
$sel:volumeSize:StartSnapshot' :: StartSnapshot -> Natural
volumeSize} -> Natural
volumeSize) (\s :: StartSnapshot
s@StartSnapshot' {} Natural
a -> StartSnapshot
s {$sel:volumeSize:StartSnapshot' :: Natural
volumeSize = Natural
a} :: StartSnapshot)

instance Core.AWSRequest StartSnapshot where
  type
    AWSResponse StartSnapshot =
      StartSnapshotResponse
  request :: StartSnapshot -> Request StartSnapshot
request = Service -> StartSnapshot -> Request StartSnapshot
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartSnapshot
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartSnapshot)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse StartSnapshot))
-> Logger
-> Service
-> Proxy StartSnapshot
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartSnapshot)))
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 Int
-> Maybe Status
-> Maybe (Sensitive Text)
-> Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Maybe Text
-> Int
-> StartSnapshotResponse
StartSnapshotResponse'
            (Maybe Int
 -> Maybe Status
 -> Maybe (Sensitive Text)
 -> Maybe POSIX
 -> Maybe Natural
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Tag]
 -> Maybe Text
 -> Int
 -> StartSnapshotResponse)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe Status
      -> Maybe (Sensitive Text)
      -> Maybe POSIX
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> Int
      -> StartSnapshotResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Int)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"BlockSize")
            Either
  String
  (Maybe Status
   -> Maybe (Sensitive Text)
   -> Maybe POSIX
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> Int
   -> StartSnapshotResponse)
-> Either String (Maybe Status)
-> Either
     String
     (Maybe (Sensitive Text)
      -> Maybe POSIX
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> Int
      -> StartSnapshotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Status)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
            Either
  String
  (Maybe (Sensitive Text)
   -> Maybe POSIX
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> Int
   -> StartSnapshotResponse)
-> Either String (Maybe (Sensitive Text))
-> Either
     String
     (Maybe POSIX
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> Int
      -> StartSnapshotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"KmsKeyArn")
            Either
  String
  (Maybe POSIX
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> Int
   -> StartSnapshotResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> Int
      -> StartSnapshotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"StartTime")
            Either
  String
  (Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> Int
   -> StartSnapshotResponse)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> Int
      -> StartSnapshotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"VolumeSize")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> Int
   -> StartSnapshotResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> Int
      -> StartSnapshotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"OwnerId")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> Int
   -> StartSnapshotResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [Tag] -> Maybe Text -> Int -> StartSnapshotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ParentSnapshotId")
            Either
  String
  (Maybe Text
   -> Maybe [Tag] -> Maybe Text -> Int -> StartSnapshotResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [Tag] -> Maybe Text -> Int -> StartSnapshotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Description")
            Either
  String (Maybe [Tag] -> Maybe Text -> Int -> StartSnapshotResponse)
-> Either String (Maybe [Tag])
-> Either String (Maybe Text -> Int -> StartSnapshotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Tags" Either String (Maybe (Maybe [Tag]))
-> Maybe [Tag] -> Either String (Maybe [Tag])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> StartSnapshotResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StartSnapshotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SnapshotId")
            Either String (Int -> StartSnapshotResponse)
-> Either String Int -> Either String StartSnapshotResponse
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 StartSnapshot

instance Prelude.NFData StartSnapshot

instance Core.ToHeaders StartSnapshot where
  toHeaders :: StartSnapshot -> ResponseHeaders
toHeaders =
    ResponseHeaders -> StartSnapshot -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 StartSnapshot where
  toJSON :: StartSnapshot -> Value
toJSON StartSnapshot' {Natural
Maybe Bool
Maybe Natural
Maybe [Tag]
Maybe Text
Maybe (Sensitive Text)
volumeSize :: Natural
tags :: Maybe [Tag]
description :: Maybe Text
timeout :: Maybe Natural
parentSnapshotId :: Maybe Text
encrypted :: Maybe Bool
clientToken :: Maybe Text
kmsKeyArn :: Maybe (Sensitive Text)
$sel:volumeSize:StartSnapshot' :: StartSnapshot -> Natural
$sel:tags:StartSnapshot' :: StartSnapshot -> Maybe [Tag]
$sel:description:StartSnapshot' :: StartSnapshot -> Maybe Text
$sel:timeout:StartSnapshot' :: StartSnapshot -> Maybe Natural
$sel:parentSnapshotId:StartSnapshot' :: StartSnapshot -> Maybe Text
$sel:encrypted:StartSnapshot' :: StartSnapshot -> Maybe Bool
$sel:clientToken:StartSnapshot' :: StartSnapshot -> Maybe Text
$sel:kmsKeyArn:StartSnapshot' :: StartSnapshot -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"KmsKeyArn" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
kmsKeyArn,
            (Text
"ClientToken" 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
clientToken,
            (Text
"Encrypted" 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
encrypted,
            (Text
"ParentSnapshotId" 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
parentSnapshotId,
            (Text
"Timeout" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
timeout,
            (Text
"Description" 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
description,
            (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
"VolumeSize" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
volumeSize)
          ]
      )

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

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

-- | /See:/ 'newStartSnapshotResponse' smart constructor.
data StartSnapshotResponse = StartSnapshotResponse'
  { -- | The size of the blocks in the snapshot, in bytes.
    StartSnapshotResponse -> Maybe Int
blockSize :: Prelude.Maybe Prelude.Int,
    -- | The status of the snapshot.
    StartSnapshotResponse -> Maybe Status
status :: Prelude.Maybe Status,
    -- | The Amazon Resource Name (ARN) of the Key Management Service (KMS) key
    -- used to encrypt the snapshot.
    StartSnapshotResponse -> Maybe (Sensitive Text)
kmsKeyArn :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The timestamp when the snapshot was created.
    StartSnapshotResponse -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
    -- | The size of the volume, in GiB.
    StartSnapshotResponse -> Maybe Natural
volumeSize :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Web Services account ID of the snapshot owner.
    StartSnapshotResponse -> Maybe Text
ownerId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the parent snapshot.
    StartSnapshotResponse -> Maybe Text
parentSnapshotId :: Prelude.Maybe Prelude.Text,
    -- | The description of the snapshot.
    StartSnapshotResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags applied to the snapshot. You can specify up to 50 tags per
    -- snapshot. For more information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html Tagging your Amazon EC2 resources>
    -- in the /Amazon Elastic Compute Cloud User Guide/.
    StartSnapshotResponse -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The ID of the snapshot.
    StartSnapshotResponse -> Maybe Text
snapshotId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    StartSnapshotResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartSnapshotResponse -> StartSnapshotResponse -> Bool
(StartSnapshotResponse -> StartSnapshotResponse -> Bool)
-> (StartSnapshotResponse -> StartSnapshotResponse -> Bool)
-> Eq StartSnapshotResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartSnapshotResponse -> StartSnapshotResponse -> Bool
$c/= :: StartSnapshotResponse -> StartSnapshotResponse -> Bool
== :: StartSnapshotResponse -> StartSnapshotResponse -> Bool
$c== :: StartSnapshotResponse -> StartSnapshotResponse -> Bool
Prelude.Eq, Int -> StartSnapshotResponse -> ShowS
[StartSnapshotResponse] -> ShowS
StartSnapshotResponse -> String
(Int -> StartSnapshotResponse -> ShowS)
-> (StartSnapshotResponse -> String)
-> ([StartSnapshotResponse] -> ShowS)
-> Show StartSnapshotResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartSnapshotResponse] -> ShowS
$cshowList :: [StartSnapshotResponse] -> ShowS
show :: StartSnapshotResponse -> String
$cshow :: StartSnapshotResponse -> String
showsPrec :: Int -> StartSnapshotResponse -> ShowS
$cshowsPrec :: Int -> StartSnapshotResponse -> ShowS
Prelude.Show, (forall x. StartSnapshotResponse -> Rep StartSnapshotResponse x)
-> (forall x. Rep StartSnapshotResponse x -> StartSnapshotResponse)
-> Generic StartSnapshotResponse
forall x. Rep StartSnapshotResponse x -> StartSnapshotResponse
forall x. StartSnapshotResponse -> Rep StartSnapshotResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartSnapshotResponse x -> StartSnapshotResponse
$cfrom :: forall x. StartSnapshotResponse -> Rep StartSnapshotResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartSnapshotResponse' 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:
--
-- 'blockSize', 'startSnapshotResponse_blockSize' - The size of the blocks in the snapshot, in bytes.
--
-- 'status', 'startSnapshotResponse_status' - The status of the snapshot.
--
-- 'kmsKeyArn', 'startSnapshotResponse_kmsKeyArn' - The Amazon Resource Name (ARN) of the Key Management Service (KMS) key
-- used to encrypt the snapshot.
--
-- 'startTime', 'startSnapshotResponse_startTime' - The timestamp when the snapshot was created.
--
-- 'volumeSize', 'startSnapshotResponse_volumeSize' - The size of the volume, in GiB.
--
-- 'ownerId', 'startSnapshotResponse_ownerId' - The Amazon Web Services account ID of the snapshot owner.
--
-- 'parentSnapshotId', 'startSnapshotResponse_parentSnapshotId' - The ID of the parent snapshot.
--
-- 'description', 'startSnapshotResponse_description' - The description of the snapshot.
--
-- 'tags', 'startSnapshotResponse_tags' - The tags applied to the snapshot. You can specify up to 50 tags per
-- snapshot. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html Tagging your Amazon EC2 resources>
-- in the /Amazon Elastic Compute Cloud User Guide/.
--
-- 'snapshotId', 'startSnapshotResponse_snapshotId' - The ID of the snapshot.
--
-- 'httpStatus', 'startSnapshotResponse_httpStatus' - The response's http status code.
newStartSnapshotResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartSnapshotResponse
newStartSnapshotResponse :: Int -> StartSnapshotResponse
newStartSnapshotResponse Int
pHttpStatus_ =
  StartSnapshotResponse' :: Maybe Int
-> Maybe Status
-> Maybe (Sensitive Text)
-> Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Maybe Text
-> Int
-> StartSnapshotResponse
StartSnapshotResponse'
    { $sel:blockSize:StartSnapshotResponse' :: Maybe Int
blockSize = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:status:StartSnapshotResponse' :: Maybe Status
status = Maybe Status
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyArn:StartSnapshotResponse' :: Maybe (Sensitive Text)
kmsKeyArn = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:StartSnapshotResponse' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeSize:StartSnapshotResponse' :: Maybe Natural
volumeSize = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:ownerId:StartSnapshotResponse' :: Maybe Text
ownerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parentSnapshotId:StartSnapshotResponse' :: Maybe Text
parentSnapshotId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:StartSnapshotResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:StartSnapshotResponse' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotId:StartSnapshotResponse' :: Maybe Text
snapshotId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartSnapshotResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The size of the blocks in the snapshot, in bytes.
startSnapshotResponse_blockSize :: Lens.Lens' StartSnapshotResponse (Prelude.Maybe Prelude.Int)
startSnapshotResponse_blockSize :: (Maybe Int -> f (Maybe Int))
-> StartSnapshotResponse -> f StartSnapshotResponse
startSnapshotResponse_blockSize = (StartSnapshotResponse -> Maybe Int)
-> (StartSnapshotResponse -> Maybe Int -> StartSnapshotResponse)
-> Lens
     StartSnapshotResponse StartSnapshotResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshotResponse' {Maybe Int
blockSize :: Maybe Int
$sel:blockSize:StartSnapshotResponse' :: StartSnapshotResponse -> Maybe Int
blockSize} -> Maybe Int
blockSize) (\s :: StartSnapshotResponse
s@StartSnapshotResponse' {} Maybe Int
a -> StartSnapshotResponse
s {$sel:blockSize:StartSnapshotResponse' :: Maybe Int
blockSize = Maybe Int
a} :: StartSnapshotResponse)

-- | The status of the snapshot.
startSnapshotResponse_status :: Lens.Lens' StartSnapshotResponse (Prelude.Maybe Status)
startSnapshotResponse_status :: (Maybe Status -> f (Maybe Status))
-> StartSnapshotResponse -> f StartSnapshotResponse
startSnapshotResponse_status = (StartSnapshotResponse -> Maybe Status)
-> (StartSnapshotResponse -> Maybe Status -> StartSnapshotResponse)
-> Lens
     StartSnapshotResponse
     StartSnapshotResponse
     (Maybe Status)
     (Maybe Status)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshotResponse' {Maybe Status
status :: Maybe Status
$sel:status:StartSnapshotResponse' :: StartSnapshotResponse -> Maybe Status
status} -> Maybe Status
status) (\s :: StartSnapshotResponse
s@StartSnapshotResponse' {} Maybe Status
a -> StartSnapshotResponse
s {$sel:status:StartSnapshotResponse' :: Maybe Status
status = Maybe Status
a} :: StartSnapshotResponse)

-- | The Amazon Resource Name (ARN) of the Key Management Service (KMS) key
-- used to encrypt the snapshot.
startSnapshotResponse_kmsKeyArn :: Lens.Lens' StartSnapshotResponse (Prelude.Maybe Prelude.Text)
startSnapshotResponse_kmsKeyArn :: (Maybe Text -> f (Maybe Text))
-> StartSnapshotResponse -> f StartSnapshotResponse
startSnapshotResponse_kmsKeyArn = (StartSnapshotResponse -> Maybe (Sensitive Text))
-> (StartSnapshotResponse
    -> Maybe (Sensitive Text) -> StartSnapshotResponse)
-> Lens
     StartSnapshotResponse
     StartSnapshotResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshotResponse' {Maybe (Sensitive Text)
kmsKeyArn :: Maybe (Sensitive Text)
$sel:kmsKeyArn:StartSnapshotResponse' :: StartSnapshotResponse -> Maybe (Sensitive Text)
kmsKeyArn} -> Maybe (Sensitive Text)
kmsKeyArn) (\s :: StartSnapshotResponse
s@StartSnapshotResponse' {} Maybe (Sensitive Text)
a -> StartSnapshotResponse
s {$sel:kmsKeyArn:StartSnapshotResponse' :: Maybe (Sensitive Text)
kmsKeyArn = Maybe (Sensitive Text)
a} :: StartSnapshotResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> StartSnapshotResponse -> f StartSnapshotResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> StartSnapshotResponse
-> f StartSnapshotResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The timestamp when the snapshot was created.
startSnapshotResponse_startTime :: Lens.Lens' StartSnapshotResponse (Prelude.Maybe Prelude.UTCTime)
startSnapshotResponse_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StartSnapshotResponse -> f StartSnapshotResponse
startSnapshotResponse_startTime = (StartSnapshotResponse -> Maybe POSIX)
-> (StartSnapshotResponse -> Maybe POSIX -> StartSnapshotResponse)
-> Lens
     StartSnapshotResponse
     StartSnapshotResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshotResponse' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:StartSnapshotResponse' :: StartSnapshotResponse -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: StartSnapshotResponse
s@StartSnapshotResponse' {} Maybe POSIX
a -> StartSnapshotResponse
s {$sel:startTime:StartSnapshotResponse' :: Maybe POSIX
startTime = Maybe POSIX
a} :: StartSnapshotResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> StartSnapshotResponse -> f StartSnapshotResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StartSnapshotResponse
-> f StartSnapshotResponse
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 size of the volume, in GiB.
startSnapshotResponse_volumeSize :: Lens.Lens' StartSnapshotResponse (Prelude.Maybe Prelude.Natural)
startSnapshotResponse_volumeSize :: (Maybe Natural -> f (Maybe Natural))
-> StartSnapshotResponse -> f StartSnapshotResponse
startSnapshotResponse_volumeSize = (StartSnapshotResponse -> Maybe Natural)
-> (StartSnapshotResponse
    -> Maybe Natural -> StartSnapshotResponse)
-> Lens
     StartSnapshotResponse
     StartSnapshotResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshotResponse' {Maybe Natural
volumeSize :: Maybe Natural
$sel:volumeSize:StartSnapshotResponse' :: StartSnapshotResponse -> Maybe Natural
volumeSize} -> Maybe Natural
volumeSize) (\s :: StartSnapshotResponse
s@StartSnapshotResponse' {} Maybe Natural
a -> StartSnapshotResponse
s {$sel:volumeSize:StartSnapshotResponse' :: Maybe Natural
volumeSize = Maybe Natural
a} :: StartSnapshotResponse)

-- | The Amazon Web Services account ID of the snapshot owner.
startSnapshotResponse_ownerId :: Lens.Lens' StartSnapshotResponse (Prelude.Maybe Prelude.Text)
startSnapshotResponse_ownerId :: (Maybe Text -> f (Maybe Text))
-> StartSnapshotResponse -> f StartSnapshotResponse
startSnapshotResponse_ownerId = (StartSnapshotResponse -> Maybe Text)
-> (StartSnapshotResponse -> Maybe Text -> StartSnapshotResponse)
-> Lens
     StartSnapshotResponse
     StartSnapshotResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshotResponse' {Maybe Text
ownerId :: Maybe Text
$sel:ownerId:StartSnapshotResponse' :: StartSnapshotResponse -> Maybe Text
ownerId} -> Maybe Text
ownerId) (\s :: StartSnapshotResponse
s@StartSnapshotResponse' {} Maybe Text
a -> StartSnapshotResponse
s {$sel:ownerId:StartSnapshotResponse' :: Maybe Text
ownerId = Maybe Text
a} :: StartSnapshotResponse)

-- | The ID of the parent snapshot.
startSnapshotResponse_parentSnapshotId :: Lens.Lens' StartSnapshotResponse (Prelude.Maybe Prelude.Text)
startSnapshotResponse_parentSnapshotId :: (Maybe Text -> f (Maybe Text))
-> StartSnapshotResponse -> f StartSnapshotResponse
startSnapshotResponse_parentSnapshotId = (StartSnapshotResponse -> Maybe Text)
-> (StartSnapshotResponse -> Maybe Text -> StartSnapshotResponse)
-> Lens
     StartSnapshotResponse
     StartSnapshotResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshotResponse' {Maybe Text
parentSnapshotId :: Maybe Text
$sel:parentSnapshotId:StartSnapshotResponse' :: StartSnapshotResponse -> Maybe Text
parentSnapshotId} -> Maybe Text
parentSnapshotId) (\s :: StartSnapshotResponse
s@StartSnapshotResponse' {} Maybe Text
a -> StartSnapshotResponse
s {$sel:parentSnapshotId:StartSnapshotResponse' :: Maybe Text
parentSnapshotId = Maybe Text
a} :: StartSnapshotResponse)

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

-- | The tags applied to the snapshot. You can specify up to 50 tags per
-- snapshot. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html Tagging your Amazon EC2 resources>
-- in the /Amazon Elastic Compute Cloud User Guide/.
startSnapshotResponse_tags :: Lens.Lens' StartSnapshotResponse (Prelude.Maybe [Tag])
startSnapshotResponse_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> StartSnapshotResponse -> f StartSnapshotResponse
startSnapshotResponse_tags = (StartSnapshotResponse -> Maybe [Tag])
-> (StartSnapshotResponse -> Maybe [Tag] -> StartSnapshotResponse)
-> Lens
     StartSnapshotResponse
     StartSnapshotResponse
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshotResponse' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:StartSnapshotResponse' :: StartSnapshotResponse -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: StartSnapshotResponse
s@StartSnapshotResponse' {} Maybe [Tag]
a -> StartSnapshotResponse
s {$sel:tags:StartSnapshotResponse' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: StartSnapshotResponse) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> StartSnapshotResponse -> f StartSnapshotResponse)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> StartSnapshotResponse
-> f StartSnapshotResponse
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 ID of the snapshot.
startSnapshotResponse_snapshotId :: Lens.Lens' StartSnapshotResponse (Prelude.Maybe Prelude.Text)
startSnapshotResponse_snapshotId :: (Maybe Text -> f (Maybe Text))
-> StartSnapshotResponse -> f StartSnapshotResponse
startSnapshotResponse_snapshotId = (StartSnapshotResponse -> Maybe Text)
-> (StartSnapshotResponse -> Maybe Text -> StartSnapshotResponse)
-> Lens
     StartSnapshotResponse
     StartSnapshotResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSnapshotResponse' {Maybe Text
snapshotId :: Maybe Text
$sel:snapshotId:StartSnapshotResponse' :: StartSnapshotResponse -> Maybe Text
snapshotId} -> Maybe Text
snapshotId) (\s :: StartSnapshotResponse
s@StartSnapshotResponse' {} Maybe Text
a -> StartSnapshotResponse
s {$sel:snapshotId:StartSnapshotResponse' :: Maybe Text
snapshotId = Maybe Text
a} :: StartSnapshotResponse)

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

instance Prelude.NFData StartSnapshotResponse