{-# 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.CompleteSnapshot
-- 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)
--
-- Seals and completes the snapshot after all of the required blocks of
-- data have been written to it. Completing the snapshot changes the status
-- to @completed@. You cannot write new blocks to a snapshot after it has
-- been completed.
module Amazonka.EBS.CompleteSnapshot
  ( -- * Creating a Request
    CompleteSnapshot (..),
    newCompleteSnapshot,

    -- * Request Lenses
    completeSnapshot_checksumAlgorithm,
    completeSnapshot_checksum,
    completeSnapshot_checksumAggregationMethod,
    completeSnapshot_snapshotId,
    completeSnapshot_changedBlocksCount,

    -- * Destructuring the Response
    CompleteSnapshotResponse (..),
    newCompleteSnapshotResponse,

    -- * Response Lenses
    completeSnapshotResponse_status,
    completeSnapshotResponse_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:/ 'newCompleteSnapshot' smart constructor.
data CompleteSnapshot = CompleteSnapshot'
  { -- | The algorithm used to generate the checksum. Currently, the only
    -- supported algorithm is @SHA256@.
    CompleteSnapshot -> Maybe ChecksumAlgorithm
checksumAlgorithm :: Prelude.Maybe ChecksumAlgorithm,
    -- | An aggregated Base-64 SHA256 checksum based on the checksums of each
    -- written block.
    --
    -- To generate the aggregated checksum using the linear aggregation method,
    -- arrange the checksums for each written block in ascending order of their
    -- block index, concatenate them to form a single string, and then generate
    -- the checksum on the entire string using the SHA256 algorithm.
    CompleteSnapshot -> Maybe Text
checksum :: Prelude.Maybe Prelude.Text,
    -- | The aggregation method used to generate the checksum. Currently, the
    -- only supported aggregation method is @LINEAR@.
    CompleteSnapshot -> Maybe ChecksumAggregationMethod
checksumAggregationMethod :: Prelude.Maybe ChecksumAggregationMethod,
    -- | The ID of the snapshot.
    CompleteSnapshot -> Text
snapshotId :: Prelude.Text,
    -- | The number of blocks that were written to the snapshot.
    CompleteSnapshot -> Natural
changedBlocksCount :: Prelude.Natural
  }
  deriving (CompleteSnapshot -> CompleteSnapshot -> Bool
(CompleteSnapshot -> CompleteSnapshot -> Bool)
-> (CompleteSnapshot -> CompleteSnapshot -> Bool)
-> Eq CompleteSnapshot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompleteSnapshot -> CompleteSnapshot -> Bool
$c/= :: CompleteSnapshot -> CompleteSnapshot -> Bool
== :: CompleteSnapshot -> CompleteSnapshot -> Bool
$c== :: CompleteSnapshot -> CompleteSnapshot -> Bool
Prelude.Eq, ReadPrec [CompleteSnapshot]
ReadPrec CompleteSnapshot
Int -> ReadS CompleteSnapshot
ReadS [CompleteSnapshot]
(Int -> ReadS CompleteSnapshot)
-> ReadS [CompleteSnapshot]
-> ReadPrec CompleteSnapshot
-> ReadPrec [CompleteSnapshot]
-> Read CompleteSnapshot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CompleteSnapshot]
$creadListPrec :: ReadPrec [CompleteSnapshot]
readPrec :: ReadPrec CompleteSnapshot
$creadPrec :: ReadPrec CompleteSnapshot
readList :: ReadS [CompleteSnapshot]
$creadList :: ReadS [CompleteSnapshot]
readsPrec :: Int -> ReadS CompleteSnapshot
$creadsPrec :: Int -> ReadS CompleteSnapshot
Prelude.Read, Int -> CompleteSnapshot -> ShowS
[CompleteSnapshot] -> ShowS
CompleteSnapshot -> String
(Int -> CompleteSnapshot -> ShowS)
-> (CompleteSnapshot -> String)
-> ([CompleteSnapshot] -> ShowS)
-> Show CompleteSnapshot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompleteSnapshot] -> ShowS
$cshowList :: [CompleteSnapshot] -> ShowS
show :: CompleteSnapshot -> String
$cshow :: CompleteSnapshot -> String
showsPrec :: Int -> CompleteSnapshot -> ShowS
$cshowsPrec :: Int -> CompleteSnapshot -> ShowS
Prelude.Show, (forall x. CompleteSnapshot -> Rep CompleteSnapshot x)
-> (forall x. Rep CompleteSnapshot x -> CompleteSnapshot)
-> Generic CompleteSnapshot
forall x. Rep CompleteSnapshot x -> CompleteSnapshot
forall x. CompleteSnapshot -> Rep CompleteSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CompleteSnapshot x -> CompleteSnapshot
$cfrom :: forall x. CompleteSnapshot -> Rep CompleteSnapshot x
Prelude.Generic)

-- |
-- Create a value of 'CompleteSnapshot' 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:
--
-- 'checksumAlgorithm', 'completeSnapshot_checksumAlgorithm' - The algorithm used to generate the checksum. Currently, the only
-- supported algorithm is @SHA256@.
--
-- 'checksum', 'completeSnapshot_checksum' - An aggregated Base-64 SHA256 checksum based on the checksums of each
-- written block.
--
-- To generate the aggregated checksum using the linear aggregation method,
-- arrange the checksums for each written block in ascending order of their
-- block index, concatenate them to form a single string, and then generate
-- the checksum on the entire string using the SHA256 algorithm.
--
-- 'checksumAggregationMethod', 'completeSnapshot_checksumAggregationMethod' - The aggregation method used to generate the checksum. Currently, the
-- only supported aggregation method is @LINEAR@.
--
-- 'snapshotId', 'completeSnapshot_snapshotId' - The ID of the snapshot.
--
-- 'changedBlocksCount', 'completeSnapshot_changedBlocksCount' - The number of blocks that were written to the snapshot.
newCompleteSnapshot ::
  -- | 'snapshotId'
  Prelude.Text ->
  -- | 'changedBlocksCount'
  Prelude.Natural ->
  CompleteSnapshot
newCompleteSnapshot :: Text -> Natural -> CompleteSnapshot
newCompleteSnapshot Text
pSnapshotId_ Natural
pChangedBlocksCount_ =
  CompleteSnapshot' :: Maybe ChecksumAlgorithm
-> Maybe Text
-> Maybe ChecksumAggregationMethod
-> Text
-> Natural
-> CompleteSnapshot
CompleteSnapshot'
    { $sel:checksumAlgorithm:CompleteSnapshot' :: Maybe ChecksumAlgorithm
checksumAlgorithm =
        Maybe ChecksumAlgorithm
forall a. Maybe a
Prelude.Nothing,
      $sel:checksum:CompleteSnapshot' :: Maybe Text
checksum = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:checksumAggregationMethod:CompleteSnapshot' :: Maybe ChecksumAggregationMethod
checksumAggregationMethod = Maybe ChecksumAggregationMethod
forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotId:CompleteSnapshot' :: Text
snapshotId = Text
pSnapshotId_,
      $sel:changedBlocksCount:CompleteSnapshot' :: Natural
changedBlocksCount = Natural
pChangedBlocksCount_
    }

-- | The algorithm used to generate the checksum. Currently, the only
-- supported algorithm is @SHA256@.
completeSnapshot_checksumAlgorithm :: Lens.Lens' CompleteSnapshot (Prelude.Maybe ChecksumAlgorithm)
completeSnapshot_checksumAlgorithm :: (Maybe ChecksumAlgorithm -> f (Maybe ChecksumAlgorithm))
-> CompleteSnapshot -> f CompleteSnapshot
completeSnapshot_checksumAlgorithm = (CompleteSnapshot -> Maybe ChecksumAlgorithm)
-> (CompleteSnapshot
    -> Maybe ChecksumAlgorithm -> CompleteSnapshot)
-> Lens
     CompleteSnapshot
     CompleteSnapshot
     (Maybe ChecksumAlgorithm)
     (Maybe ChecksumAlgorithm)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteSnapshot' {Maybe ChecksumAlgorithm
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:checksumAlgorithm:CompleteSnapshot' :: CompleteSnapshot -> Maybe ChecksumAlgorithm
checksumAlgorithm} -> Maybe ChecksumAlgorithm
checksumAlgorithm) (\s :: CompleteSnapshot
s@CompleteSnapshot' {} Maybe ChecksumAlgorithm
a -> CompleteSnapshot
s {$sel:checksumAlgorithm:CompleteSnapshot' :: Maybe ChecksumAlgorithm
checksumAlgorithm = Maybe ChecksumAlgorithm
a} :: CompleteSnapshot)

-- | An aggregated Base-64 SHA256 checksum based on the checksums of each
-- written block.
--
-- To generate the aggregated checksum using the linear aggregation method,
-- arrange the checksums for each written block in ascending order of their
-- block index, concatenate them to form a single string, and then generate
-- the checksum on the entire string using the SHA256 algorithm.
completeSnapshot_checksum :: Lens.Lens' CompleteSnapshot (Prelude.Maybe Prelude.Text)
completeSnapshot_checksum :: (Maybe Text -> f (Maybe Text))
-> CompleteSnapshot -> f CompleteSnapshot
completeSnapshot_checksum = (CompleteSnapshot -> Maybe Text)
-> (CompleteSnapshot -> Maybe Text -> CompleteSnapshot)
-> Lens CompleteSnapshot CompleteSnapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteSnapshot' {Maybe Text
checksum :: Maybe Text
$sel:checksum:CompleteSnapshot' :: CompleteSnapshot -> Maybe Text
checksum} -> Maybe Text
checksum) (\s :: CompleteSnapshot
s@CompleteSnapshot' {} Maybe Text
a -> CompleteSnapshot
s {$sel:checksum:CompleteSnapshot' :: Maybe Text
checksum = Maybe Text
a} :: CompleteSnapshot)

-- | The aggregation method used to generate the checksum. Currently, the
-- only supported aggregation method is @LINEAR@.
completeSnapshot_checksumAggregationMethod :: Lens.Lens' CompleteSnapshot (Prelude.Maybe ChecksumAggregationMethod)
completeSnapshot_checksumAggregationMethod :: (Maybe ChecksumAggregationMethod
 -> f (Maybe ChecksumAggregationMethod))
-> CompleteSnapshot -> f CompleteSnapshot
completeSnapshot_checksumAggregationMethod = (CompleteSnapshot -> Maybe ChecksumAggregationMethod)
-> (CompleteSnapshot
    -> Maybe ChecksumAggregationMethod -> CompleteSnapshot)
-> Lens
     CompleteSnapshot
     CompleteSnapshot
     (Maybe ChecksumAggregationMethod)
     (Maybe ChecksumAggregationMethod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteSnapshot' {Maybe ChecksumAggregationMethod
checksumAggregationMethod :: Maybe ChecksumAggregationMethod
$sel:checksumAggregationMethod:CompleteSnapshot' :: CompleteSnapshot -> Maybe ChecksumAggregationMethod
checksumAggregationMethod} -> Maybe ChecksumAggregationMethod
checksumAggregationMethod) (\s :: CompleteSnapshot
s@CompleteSnapshot' {} Maybe ChecksumAggregationMethod
a -> CompleteSnapshot
s {$sel:checksumAggregationMethod:CompleteSnapshot' :: Maybe ChecksumAggregationMethod
checksumAggregationMethod = Maybe ChecksumAggregationMethod
a} :: CompleteSnapshot)

-- | The ID of the snapshot.
completeSnapshot_snapshotId :: Lens.Lens' CompleteSnapshot Prelude.Text
completeSnapshot_snapshotId :: (Text -> f Text) -> CompleteSnapshot -> f CompleteSnapshot
completeSnapshot_snapshotId = (CompleteSnapshot -> Text)
-> (CompleteSnapshot -> Text -> CompleteSnapshot)
-> Lens CompleteSnapshot CompleteSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteSnapshot' {Text
snapshotId :: Text
$sel:snapshotId:CompleteSnapshot' :: CompleteSnapshot -> Text
snapshotId} -> Text
snapshotId) (\s :: CompleteSnapshot
s@CompleteSnapshot' {} Text
a -> CompleteSnapshot
s {$sel:snapshotId:CompleteSnapshot' :: Text
snapshotId = Text
a} :: CompleteSnapshot)

-- | The number of blocks that were written to the snapshot.
completeSnapshot_changedBlocksCount :: Lens.Lens' CompleteSnapshot Prelude.Natural
completeSnapshot_changedBlocksCount :: (Natural -> f Natural) -> CompleteSnapshot -> f CompleteSnapshot
completeSnapshot_changedBlocksCount = (CompleteSnapshot -> Natural)
-> (CompleteSnapshot -> Natural -> CompleteSnapshot)
-> Lens CompleteSnapshot CompleteSnapshot Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteSnapshot' {Natural
changedBlocksCount :: Natural
$sel:changedBlocksCount:CompleteSnapshot' :: CompleteSnapshot -> Natural
changedBlocksCount} -> Natural
changedBlocksCount) (\s :: CompleteSnapshot
s@CompleteSnapshot' {} Natural
a -> CompleteSnapshot
s {$sel:changedBlocksCount:CompleteSnapshot' :: Natural
changedBlocksCount = Natural
a} :: CompleteSnapshot)

instance Core.AWSRequest CompleteSnapshot where
  type
    AWSResponse CompleteSnapshot =
      CompleteSnapshotResponse
  request :: CompleteSnapshot -> Request CompleteSnapshot
request = Service -> CompleteSnapshot -> Request CompleteSnapshot
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CompleteSnapshot
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CompleteSnapshot)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CompleteSnapshot))
-> Logger
-> Service
-> Proxy CompleteSnapshot
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CompleteSnapshot)))
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 Status -> Int -> CompleteSnapshotResponse
CompleteSnapshotResponse'
            (Maybe Status -> Int -> CompleteSnapshotResponse)
-> Either String (Maybe Status)
-> Either String (Int -> CompleteSnapshotResponse)
forall (f :: * -> *) a b. Functor 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 (Int -> CompleteSnapshotResponse)
-> Either String Int -> Either String CompleteSnapshotResponse
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 CompleteSnapshot

instance Prelude.NFData CompleteSnapshot

instance Core.ToHeaders CompleteSnapshot where
  toHeaders :: CompleteSnapshot -> ResponseHeaders
toHeaders CompleteSnapshot' {Natural
Maybe Text
Maybe ChecksumAggregationMethod
Maybe ChecksumAlgorithm
Text
changedBlocksCount :: Natural
snapshotId :: Text
checksumAggregationMethod :: Maybe ChecksumAggregationMethod
checksum :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:changedBlocksCount:CompleteSnapshot' :: CompleteSnapshot -> Natural
$sel:snapshotId:CompleteSnapshot' :: CompleteSnapshot -> Text
$sel:checksumAggregationMethod:CompleteSnapshot' :: CompleteSnapshot -> Maybe ChecksumAggregationMethod
$sel:checksum:CompleteSnapshot' :: CompleteSnapshot -> Maybe Text
$sel:checksumAlgorithm:CompleteSnapshot' :: CompleteSnapshot -> Maybe ChecksumAlgorithm
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"x-amz-Checksum-Algorithm"
          HeaderName -> Maybe ChecksumAlgorithm -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ChecksumAlgorithm
checksumAlgorithm,
        HeaderName
"x-amz-Checksum" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
checksum,
        HeaderName
"x-amz-Checksum-Aggregation-Method"
          HeaderName -> Maybe ChecksumAggregationMethod -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ChecksumAggregationMethod
checksumAggregationMethod,
        HeaderName
"x-amz-ChangedBlocksCount"
          HeaderName -> Natural -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Natural
changedBlocksCount,
        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 CompleteSnapshot where
  toJSON :: CompleteSnapshot -> Value
toJSON = Value -> CompleteSnapshot -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)

instance Core.ToPath CompleteSnapshot where
  toPath :: CompleteSnapshot -> ByteString
toPath CompleteSnapshot' {Natural
Maybe Text
Maybe ChecksumAggregationMethod
Maybe ChecksumAlgorithm
Text
changedBlocksCount :: Natural
snapshotId :: Text
checksumAggregationMethod :: Maybe ChecksumAggregationMethod
checksum :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:changedBlocksCount:CompleteSnapshot' :: CompleteSnapshot -> Natural
$sel:snapshotId:CompleteSnapshot' :: CompleteSnapshot -> Text
$sel:checksumAggregationMethod:CompleteSnapshot' :: CompleteSnapshot -> Maybe ChecksumAggregationMethod
$sel:checksum:CompleteSnapshot' :: CompleteSnapshot -> Maybe Text
$sel:checksumAlgorithm:CompleteSnapshot' :: CompleteSnapshot -> Maybe ChecksumAlgorithm
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/snapshots/completion/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
snapshotId]

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

-- | /See:/ 'newCompleteSnapshotResponse' smart constructor.
data CompleteSnapshotResponse = CompleteSnapshotResponse'
  { -- | The status of the snapshot.
    CompleteSnapshotResponse -> Maybe Status
status :: Prelude.Maybe Status,
    -- | The response's http status code.
    CompleteSnapshotResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CompleteSnapshotResponse -> CompleteSnapshotResponse -> Bool
(CompleteSnapshotResponse -> CompleteSnapshotResponse -> Bool)
-> (CompleteSnapshotResponse -> CompleteSnapshotResponse -> Bool)
-> Eq CompleteSnapshotResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompleteSnapshotResponse -> CompleteSnapshotResponse -> Bool
$c/= :: CompleteSnapshotResponse -> CompleteSnapshotResponse -> Bool
== :: CompleteSnapshotResponse -> CompleteSnapshotResponse -> Bool
$c== :: CompleteSnapshotResponse -> CompleteSnapshotResponse -> Bool
Prelude.Eq, ReadPrec [CompleteSnapshotResponse]
ReadPrec CompleteSnapshotResponse
Int -> ReadS CompleteSnapshotResponse
ReadS [CompleteSnapshotResponse]
(Int -> ReadS CompleteSnapshotResponse)
-> ReadS [CompleteSnapshotResponse]
-> ReadPrec CompleteSnapshotResponse
-> ReadPrec [CompleteSnapshotResponse]
-> Read CompleteSnapshotResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CompleteSnapshotResponse]
$creadListPrec :: ReadPrec [CompleteSnapshotResponse]
readPrec :: ReadPrec CompleteSnapshotResponse
$creadPrec :: ReadPrec CompleteSnapshotResponse
readList :: ReadS [CompleteSnapshotResponse]
$creadList :: ReadS [CompleteSnapshotResponse]
readsPrec :: Int -> ReadS CompleteSnapshotResponse
$creadsPrec :: Int -> ReadS CompleteSnapshotResponse
Prelude.Read, Int -> CompleteSnapshotResponse -> ShowS
[CompleteSnapshotResponse] -> ShowS
CompleteSnapshotResponse -> String
(Int -> CompleteSnapshotResponse -> ShowS)
-> (CompleteSnapshotResponse -> String)
-> ([CompleteSnapshotResponse] -> ShowS)
-> Show CompleteSnapshotResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompleteSnapshotResponse] -> ShowS
$cshowList :: [CompleteSnapshotResponse] -> ShowS
show :: CompleteSnapshotResponse -> String
$cshow :: CompleteSnapshotResponse -> String
showsPrec :: Int -> CompleteSnapshotResponse -> ShowS
$cshowsPrec :: Int -> CompleteSnapshotResponse -> ShowS
Prelude.Show, (forall x.
 CompleteSnapshotResponse -> Rep CompleteSnapshotResponse x)
-> (forall x.
    Rep CompleteSnapshotResponse x -> CompleteSnapshotResponse)
-> Generic CompleteSnapshotResponse
forall x.
Rep CompleteSnapshotResponse x -> CompleteSnapshotResponse
forall x.
CompleteSnapshotResponse -> Rep CompleteSnapshotResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CompleteSnapshotResponse x -> CompleteSnapshotResponse
$cfrom :: forall x.
CompleteSnapshotResponse -> Rep CompleteSnapshotResponse x
Prelude.Generic)

-- |
-- Create a value of 'CompleteSnapshotResponse' 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:
--
-- 'status', 'completeSnapshotResponse_status' - The status of the snapshot.
--
-- 'httpStatus', 'completeSnapshotResponse_httpStatus' - The response's http status code.
newCompleteSnapshotResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CompleteSnapshotResponse
newCompleteSnapshotResponse :: Int -> CompleteSnapshotResponse
newCompleteSnapshotResponse Int
pHttpStatus_ =
  CompleteSnapshotResponse' :: Maybe Status -> Int -> CompleteSnapshotResponse
CompleteSnapshotResponse'
    { $sel:status:CompleteSnapshotResponse' :: Maybe Status
status = Maybe Status
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CompleteSnapshotResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

instance Prelude.NFData CompleteSnapshotResponse