{-# 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.RedshiftServerLess.ConvertRecoveryPointToSnapshot
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Converts a recovery point to a snapshot. For more information about
-- recovery points and snapshots, see
-- <https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-snapshots-recovery.html Working with snapshots and recovery points>.
module Amazonka.RedshiftServerLess.ConvertRecoveryPointToSnapshot
  ( -- * Creating a Request
    ConvertRecoveryPointToSnapshot (..),
    newConvertRecoveryPointToSnapshot,

    -- * Request Lenses
    convertRecoveryPointToSnapshot_retentionPeriod,
    convertRecoveryPointToSnapshot_tags,
    convertRecoveryPointToSnapshot_recoveryPointId,
    convertRecoveryPointToSnapshot_snapshotName,

    -- * Destructuring the Response
    ConvertRecoveryPointToSnapshotResponse (..),
    newConvertRecoveryPointToSnapshotResponse,

    -- * Response Lenses
    convertRecoveryPointToSnapshotResponse_snapshot,
    convertRecoveryPointToSnapshotResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.RedshiftServerLess.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newConvertRecoveryPointToSnapshot' smart constructor.
data ConvertRecoveryPointToSnapshot = ConvertRecoveryPointToSnapshot'
  { -- | How long to retain the snapshot.
    ConvertRecoveryPointToSnapshot -> Maybe Int
retentionPeriod :: Prelude.Maybe Prelude.Int,
    -- | An array of
    -- <https://docs.aws.amazon.com/redshift-serverless/latest/APIReference/API_Tag.html Tag objects>
    -- to associate with the created snapshot.
    ConvertRecoveryPointToSnapshot -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The unique identifier of the recovery point.
    ConvertRecoveryPointToSnapshot -> Text
recoveryPointId :: Prelude.Text,
    -- | The name of the snapshot.
    ConvertRecoveryPointToSnapshot -> Text
snapshotName :: Prelude.Text
  }
  deriving (ConvertRecoveryPointToSnapshot
-> ConvertRecoveryPointToSnapshot -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConvertRecoveryPointToSnapshot
-> ConvertRecoveryPointToSnapshot -> Bool
$c/= :: ConvertRecoveryPointToSnapshot
-> ConvertRecoveryPointToSnapshot -> Bool
== :: ConvertRecoveryPointToSnapshot
-> ConvertRecoveryPointToSnapshot -> Bool
$c== :: ConvertRecoveryPointToSnapshot
-> ConvertRecoveryPointToSnapshot -> Bool
Prelude.Eq, ReadPrec [ConvertRecoveryPointToSnapshot]
ReadPrec ConvertRecoveryPointToSnapshot
Int -> ReadS ConvertRecoveryPointToSnapshot
ReadS [ConvertRecoveryPointToSnapshot]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConvertRecoveryPointToSnapshot]
$creadListPrec :: ReadPrec [ConvertRecoveryPointToSnapshot]
readPrec :: ReadPrec ConvertRecoveryPointToSnapshot
$creadPrec :: ReadPrec ConvertRecoveryPointToSnapshot
readList :: ReadS [ConvertRecoveryPointToSnapshot]
$creadList :: ReadS [ConvertRecoveryPointToSnapshot]
readsPrec :: Int -> ReadS ConvertRecoveryPointToSnapshot
$creadsPrec :: Int -> ReadS ConvertRecoveryPointToSnapshot
Prelude.Read, Int -> ConvertRecoveryPointToSnapshot -> ShowS
[ConvertRecoveryPointToSnapshot] -> ShowS
ConvertRecoveryPointToSnapshot -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConvertRecoveryPointToSnapshot] -> ShowS
$cshowList :: [ConvertRecoveryPointToSnapshot] -> ShowS
show :: ConvertRecoveryPointToSnapshot -> String
$cshow :: ConvertRecoveryPointToSnapshot -> String
showsPrec :: Int -> ConvertRecoveryPointToSnapshot -> ShowS
$cshowsPrec :: Int -> ConvertRecoveryPointToSnapshot -> ShowS
Prelude.Show, forall x.
Rep ConvertRecoveryPointToSnapshot x
-> ConvertRecoveryPointToSnapshot
forall x.
ConvertRecoveryPointToSnapshot
-> Rep ConvertRecoveryPointToSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ConvertRecoveryPointToSnapshot x
-> ConvertRecoveryPointToSnapshot
$cfrom :: forall x.
ConvertRecoveryPointToSnapshot
-> Rep ConvertRecoveryPointToSnapshot x
Prelude.Generic)

-- |
-- Create a value of 'ConvertRecoveryPointToSnapshot' 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:
--
-- 'retentionPeriod', 'convertRecoveryPointToSnapshot_retentionPeriod' - How long to retain the snapshot.
--
-- 'tags', 'convertRecoveryPointToSnapshot_tags' - An array of
-- <https://docs.aws.amazon.com/redshift-serverless/latest/APIReference/API_Tag.html Tag objects>
-- to associate with the created snapshot.
--
-- 'recoveryPointId', 'convertRecoveryPointToSnapshot_recoveryPointId' - The unique identifier of the recovery point.
--
-- 'snapshotName', 'convertRecoveryPointToSnapshot_snapshotName' - The name of the snapshot.
newConvertRecoveryPointToSnapshot ::
  -- | 'recoveryPointId'
  Prelude.Text ->
  -- | 'snapshotName'
  Prelude.Text ->
  ConvertRecoveryPointToSnapshot
newConvertRecoveryPointToSnapshot :: Text -> Text -> ConvertRecoveryPointToSnapshot
newConvertRecoveryPointToSnapshot
  Text
pRecoveryPointId_
  Text
pSnapshotName_ =
    ConvertRecoveryPointToSnapshot'
      { $sel:retentionPeriod:ConvertRecoveryPointToSnapshot' :: Maybe Int
retentionPeriod =
          forall a. Maybe a
Prelude.Nothing,
        $sel:tags:ConvertRecoveryPointToSnapshot' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:recoveryPointId:ConvertRecoveryPointToSnapshot' :: Text
recoveryPointId = Text
pRecoveryPointId_,
        $sel:snapshotName:ConvertRecoveryPointToSnapshot' :: Text
snapshotName = Text
pSnapshotName_
      }

-- | How long to retain the snapshot.
convertRecoveryPointToSnapshot_retentionPeriod :: Lens.Lens' ConvertRecoveryPointToSnapshot (Prelude.Maybe Prelude.Int)
convertRecoveryPointToSnapshot_retentionPeriod :: Lens' ConvertRecoveryPointToSnapshot (Maybe Int)
convertRecoveryPointToSnapshot_retentionPeriod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConvertRecoveryPointToSnapshot' {Maybe Int
retentionPeriod :: Maybe Int
$sel:retentionPeriod:ConvertRecoveryPointToSnapshot' :: ConvertRecoveryPointToSnapshot -> Maybe Int
retentionPeriod} -> Maybe Int
retentionPeriod) (\s :: ConvertRecoveryPointToSnapshot
s@ConvertRecoveryPointToSnapshot' {} Maybe Int
a -> ConvertRecoveryPointToSnapshot
s {$sel:retentionPeriod:ConvertRecoveryPointToSnapshot' :: Maybe Int
retentionPeriod = Maybe Int
a} :: ConvertRecoveryPointToSnapshot)

-- | An array of
-- <https://docs.aws.amazon.com/redshift-serverless/latest/APIReference/API_Tag.html Tag objects>
-- to associate with the created snapshot.
convertRecoveryPointToSnapshot_tags :: Lens.Lens' ConvertRecoveryPointToSnapshot (Prelude.Maybe [Tag])
convertRecoveryPointToSnapshot_tags :: Lens' ConvertRecoveryPointToSnapshot (Maybe [Tag])
convertRecoveryPointToSnapshot_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConvertRecoveryPointToSnapshot' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:ConvertRecoveryPointToSnapshot' :: ConvertRecoveryPointToSnapshot -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: ConvertRecoveryPointToSnapshot
s@ConvertRecoveryPointToSnapshot' {} Maybe [Tag]
a -> ConvertRecoveryPointToSnapshot
s {$sel:tags:ConvertRecoveryPointToSnapshot' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: ConvertRecoveryPointToSnapshot) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The unique identifier of the recovery point.
convertRecoveryPointToSnapshot_recoveryPointId :: Lens.Lens' ConvertRecoveryPointToSnapshot Prelude.Text
convertRecoveryPointToSnapshot_recoveryPointId :: Lens' ConvertRecoveryPointToSnapshot Text
convertRecoveryPointToSnapshot_recoveryPointId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConvertRecoveryPointToSnapshot' {Text
recoveryPointId :: Text
$sel:recoveryPointId:ConvertRecoveryPointToSnapshot' :: ConvertRecoveryPointToSnapshot -> Text
recoveryPointId} -> Text
recoveryPointId) (\s :: ConvertRecoveryPointToSnapshot
s@ConvertRecoveryPointToSnapshot' {} Text
a -> ConvertRecoveryPointToSnapshot
s {$sel:recoveryPointId:ConvertRecoveryPointToSnapshot' :: Text
recoveryPointId = Text
a} :: ConvertRecoveryPointToSnapshot)

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

instance
  Core.AWSRequest
    ConvertRecoveryPointToSnapshot
  where
  type
    AWSResponse ConvertRecoveryPointToSnapshot =
      ConvertRecoveryPointToSnapshotResponse
  request :: (Service -> Service)
-> ConvertRecoveryPointToSnapshot
-> Request ConvertRecoveryPointToSnapshot
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ConvertRecoveryPointToSnapshot
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ConvertRecoveryPointToSnapshot)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Snapshot -> Int -> ConvertRecoveryPointToSnapshotResponse
ConvertRecoveryPointToSnapshotResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"snapshot")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ConvertRecoveryPointToSnapshot
  where
  hashWithSalt :: Int -> ConvertRecoveryPointToSnapshot -> Int
hashWithSalt
    Int
_salt
    ConvertRecoveryPointToSnapshot' {Maybe Int
Maybe [Tag]
Text
snapshotName :: Text
recoveryPointId :: Text
tags :: Maybe [Tag]
retentionPeriod :: Maybe Int
$sel:snapshotName:ConvertRecoveryPointToSnapshot' :: ConvertRecoveryPointToSnapshot -> Text
$sel:recoveryPointId:ConvertRecoveryPointToSnapshot' :: ConvertRecoveryPointToSnapshot -> Text
$sel:tags:ConvertRecoveryPointToSnapshot' :: ConvertRecoveryPointToSnapshot -> Maybe [Tag]
$sel:retentionPeriod:ConvertRecoveryPointToSnapshot' :: ConvertRecoveryPointToSnapshot -> Maybe Int
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
retentionPeriod
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
recoveryPointId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
snapshotName

instance
  Prelude.NFData
    ConvertRecoveryPointToSnapshot
  where
  rnf :: ConvertRecoveryPointToSnapshot -> ()
rnf ConvertRecoveryPointToSnapshot' {Maybe Int
Maybe [Tag]
Text
snapshotName :: Text
recoveryPointId :: Text
tags :: Maybe [Tag]
retentionPeriod :: Maybe Int
$sel:snapshotName:ConvertRecoveryPointToSnapshot' :: ConvertRecoveryPointToSnapshot -> Text
$sel:recoveryPointId:ConvertRecoveryPointToSnapshot' :: ConvertRecoveryPointToSnapshot -> Text
$sel:tags:ConvertRecoveryPointToSnapshot' :: ConvertRecoveryPointToSnapshot -> Maybe [Tag]
$sel:retentionPeriod:ConvertRecoveryPointToSnapshot' :: ConvertRecoveryPointToSnapshot -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
retentionPeriod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
recoveryPointId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
snapshotName

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

instance Data.ToJSON ConvertRecoveryPointToSnapshot where
  toJSON :: ConvertRecoveryPointToSnapshot -> Value
toJSON ConvertRecoveryPointToSnapshot' {Maybe Int
Maybe [Tag]
Text
snapshotName :: Text
recoveryPointId :: Text
tags :: Maybe [Tag]
retentionPeriod :: Maybe Int
$sel:snapshotName:ConvertRecoveryPointToSnapshot' :: ConvertRecoveryPointToSnapshot -> Text
$sel:recoveryPointId:ConvertRecoveryPointToSnapshot' :: ConvertRecoveryPointToSnapshot -> Text
$sel:tags:ConvertRecoveryPointToSnapshot' :: ConvertRecoveryPointToSnapshot -> Maybe [Tag]
$sel:retentionPeriod:ConvertRecoveryPointToSnapshot' :: ConvertRecoveryPointToSnapshot -> Maybe Int
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"retentionPeriod" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
retentionPeriod,
            (Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"recoveryPointId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
recoveryPointId),
            forall a. a -> Maybe a
Prelude.Just (Key
"snapshotName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
snapshotName)
          ]
      )

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

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

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

-- |
-- Create a value of 'ConvertRecoveryPointToSnapshotResponse' 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:
--
-- 'snapshot', 'convertRecoveryPointToSnapshotResponse_snapshot' - The snapshot converted from the recovery point.
--
-- 'httpStatus', 'convertRecoveryPointToSnapshotResponse_httpStatus' - The response's http status code.
newConvertRecoveryPointToSnapshotResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ConvertRecoveryPointToSnapshotResponse
newConvertRecoveryPointToSnapshotResponse :: Int -> ConvertRecoveryPointToSnapshotResponse
newConvertRecoveryPointToSnapshotResponse
  Int
pHttpStatus_ =
    ConvertRecoveryPointToSnapshotResponse'
      { $sel:snapshot:ConvertRecoveryPointToSnapshotResponse' :: Maybe Snapshot
snapshot =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ConvertRecoveryPointToSnapshotResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The snapshot converted from the recovery point.
convertRecoveryPointToSnapshotResponse_snapshot :: Lens.Lens' ConvertRecoveryPointToSnapshotResponse (Prelude.Maybe Snapshot)
convertRecoveryPointToSnapshotResponse_snapshot :: Lens' ConvertRecoveryPointToSnapshotResponse (Maybe Snapshot)
convertRecoveryPointToSnapshotResponse_snapshot = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConvertRecoveryPointToSnapshotResponse' {Maybe Snapshot
snapshot :: Maybe Snapshot
$sel:snapshot:ConvertRecoveryPointToSnapshotResponse' :: ConvertRecoveryPointToSnapshotResponse -> Maybe Snapshot
snapshot} -> Maybe Snapshot
snapshot) (\s :: ConvertRecoveryPointToSnapshotResponse
s@ConvertRecoveryPointToSnapshotResponse' {} Maybe Snapshot
a -> ConvertRecoveryPointToSnapshotResponse
s {$sel:snapshot:ConvertRecoveryPointToSnapshotResponse' :: Maybe Snapshot
snapshot = Maybe Snapshot
a} :: ConvertRecoveryPointToSnapshotResponse)

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

instance
  Prelude.NFData
    ConvertRecoveryPointToSnapshotResponse
  where
  rnf :: ConvertRecoveryPointToSnapshotResponse -> ()
rnf ConvertRecoveryPointToSnapshotResponse' {Int
Maybe Snapshot
httpStatus :: Int
snapshot :: Maybe Snapshot
$sel:httpStatus:ConvertRecoveryPointToSnapshotResponse' :: ConvertRecoveryPointToSnapshotResponse -> Int
$sel:snapshot:ConvertRecoveryPointToSnapshotResponse' :: ConvertRecoveryPointToSnapshotResponse -> Maybe Snapshot
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Snapshot
snapshot
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus