{-# 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.RestoreFromSnapshot
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Restores a namespace from a snapshot.
module Amazonka.RedshiftServerLess.RestoreFromSnapshot
  ( -- * Creating a Request
    RestoreFromSnapshot (..),
    newRestoreFromSnapshot,

    -- * Request Lenses
    restoreFromSnapshot_ownerAccount,
    restoreFromSnapshot_snapshotArn,
    restoreFromSnapshot_snapshotName,
    restoreFromSnapshot_namespaceName,
    restoreFromSnapshot_workgroupName,

    -- * Destructuring the Response
    RestoreFromSnapshotResponse (..),
    newRestoreFromSnapshotResponse,

    -- * Response Lenses
    restoreFromSnapshotResponse_namespace,
    restoreFromSnapshotResponse_ownerAccount,
    restoreFromSnapshotResponse_snapshotName,
    restoreFromSnapshotResponse_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:/ 'newRestoreFromSnapshot' smart constructor.
data RestoreFromSnapshot = RestoreFromSnapshot'
  { -- | The Amazon Web Services account that owns the snapshot.
    RestoreFromSnapshot -> Maybe Text
ownerAccount :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the snapshot to restore from. Required
    -- if restoring from Amazon Redshift Serverless to a provisioned cluster.
    -- Must not be specified at the same time as @snapshotName@.
    --
    -- The format of the ARN is
    -- arn:aws:redshift:\<region>:\<account_id>:snapshot:\<cluster_identifier>\/\<snapshot_identifier>.
    RestoreFromSnapshot -> Maybe Text
snapshotArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the snapshot to restore from. Must not be specified at the
    -- same time as @snapshotArn@.
    RestoreFromSnapshot -> Maybe Text
snapshotName :: Prelude.Maybe Prelude.Text,
    -- | The name of the namespace to restore the snapshot to.
    RestoreFromSnapshot -> Text
namespaceName :: Prelude.Text,
    -- | The name of the workgroup used to restore the snapshot.
    RestoreFromSnapshot -> Text
workgroupName :: Prelude.Text
  }
  deriving (RestoreFromSnapshot -> RestoreFromSnapshot -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RestoreFromSnapshot -> RestoreFromSnapshot -> Bool
$c/= :: RestoreFromSnapshot -> RestoreFromSnapshot -> Bool
== :: RestoreFromSnapshot -> RestoreFromSnapshot -> Bool
$c== :: RestoreFromSnapshot -> RestoreFromSnapshot -> Bool
Prelude.Eq, ReadPrec [RestoreFromSnapshot]
ReadPrec RestoreFromSnapshot
Int -> ReadS RestoreFromSnapshot
ReadS [RestoreFromSnapshot]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RestoreFromSnapshot]
$creadListPrec :: ReadPrec [RestoreFromSnapshot]
readPrec :: ReadPrec RestoreFromSnapshot
$creadPrec :: ReadPrec RestoreFromSnapshot
readList :: ReadS [RestoreFromSnapshot]
$creadList :: ReadS [RestoreFromSnapshot]
readsPrec :: Int -> ReadS RestoreFromSnapshot
$creadsPrec :: Int -> ReadS RestoreFromSnapshot
Prelude.Read, Int -> RestoreFromSnapshot -> ShowS
[RestoreFromSnapshot] -> ShowS
RestoreFromSnapshot -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RestoreFromSnapshot] -> ShowS
$cshowList :: [RestoreFromSnapshot] -> ShowS
show :: RestoreFromSnapshot -> String
$cshow :: RestoreFromSnapshot -> String
showsPrec :: Int -> RestoreFromSnapshot -> ShowS
$cshowsPrec :: Int -> RestoreFromSnapshot -> ShowS
Prelude.Show, forall x. Rep RestoreFromSnapshot x -> RestoreFromSnapshot
forall x. RestoreFromSnapshot -> Rep RestoreFromSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RestoreFromSnapshot x -> RestoreFromSnapshot
$cfrom :: forall x. RestoreFromSnapshot -> Rep RestoreFromSnapshot x
Prelude.Generic)

-- |
-- Create a value of 'RestoreFromSnapshot' 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:
--
-- 'ownerAccount', 'restoreFromSnapshot_ownerAccount' - The Amazon Web Services account that owns the snapshot.
--
-- 'snapshotArn', 'restoreFromSnapshot_snapshotArn' - The Amazon Resource Name (ARN) of the snapshot to restore from. Required
-- if restoring from Amazon Redshift Serverless to a provisioned cluster.
-- Must not be specified at the same time as @snapshotName@.
--
-- The format of the ARN is
-- arn:aws:redshift:\<region>:\<account_id>:snapshot:\<cluster_identifier>\/\<snapshot_identifier>.
--
-- 'snapshotName', 'restoreFromSnapshot_snapshotName' - The name of the snapshot to restore from. Must not be specified at the
-- same time as @snapshotArn@.
--
-- 'namespaceName', 'restoreFromSnapshot_namespaceName' - The name of the namespace to restore the snapshot to.
--
-- 'workgroupName', 'restoreFromSnapshot_workgroupName' - The name of the workgroup used to restore the snapshot.
newRestoreFromSnapshot ::
  -- | 'namespaceName'
  Prelude.Text ->
  -- | 'workgroupName'
  Prelude.Text ->
  RestoreFromSnapshot
newRestoreFromSnapshot :: Text -> Text -> RestoreFromSnapshot
newRestoreFromSnapshot
  Text
pNamespaceName_
  Text
pWorkgroupName_ =
    RestoreFromSnapshot'
      { $sel:ownerAccount:RestoreFromSnapshot' :: Maybe Text
ownerAccount =
          forall a. Maybe a
Prelude.Nothing,
        $sel:snapshotArn:RestoreFromSnapshot' :: Maybe Text
snapshotArn = forall a. Maybe a
Prelude.Nothing,
        $sel:snapshotName:RestoreFromSnapshot' :: Maybe Text
snapshotName = forall a. Maybe a
Prelude.Nothing,
        $sel:namespaceName:RestoreFromSnapshot' :: Text
namespaceName = Text
pNamespaceName_,
        $sel:workgroupName:RestoreFromSnapshot' :: Text
workgroupName = Text
pWorkgroupName_
      }

-- | The Amazon Web Services account that owns the snapshot.
restoreFromSnapshot_ownerAccount :: Lens.Lens' RestoreFromSnapshot (Prelude.Maybe Prelude.Text)
restoreFromSnapshot_ownerAccount :: Lens' RestoreFromSnapshot (Maybe Text)
restoreFromSnapshot_ownerAccount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreFromSnapshot' {Maybe Text
ownerAccount :: Maybe Text
$sel:ownerAccount:RestoreFromSnapshot' :: RestoreFromSnapshot -> Maybe Text
ownerAccount} -> Maybe Text
ownerAccount) (\s :: RestoreFromSnapshot
s@RestoreFromSnapshot' {} Maybe Text
a -> RestoreFromSnapshot
s {$sel:ownerAccount:RestoreFromSnapshot' :: Maybe Text
ownerAccount = Maybe Text
a} :: RestoreFromSnapshot)

-- | The Amazon Resource Name (ARN) of the snapshot to restore from. Required
-- if restoring from Amazon Redshift Serverless to a provisioned cluster.
-- Must not be specified at the same time as @snapshotName@.
--
-- The format of the ARN is
-- arn:aws:redshift:\<region>:\<account_id>:snapshot:\<cluster_identifier>\/\<snapshot_identifier>.
restoreFromSnapshot_snapshotArn :: Lens.Lens' RestoreFromSnapshot (Prelude.Maybe Prelude.Text)
restoreFromSnapshot_snapshotArn :: Lens' RestoreFromSnapshot (Maybe Text)
restoreFromSnapshot_snapshotArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreFromSnapshot' {Maybe Text
snapshotArn :: Maybe Text
$sel:snapshotArn:RestoreFromSnapshot' :: RestoreFromSnapshot -> Maybe Text
snapshotArn} -> Maybe Text
snapshotArn) (\s :: RestoreFromSnapshot
s@RestoreFromSnapshot' {} Maybe Text
a -> RestoreFromSnapshot
s {$sel:snapshotArn:RestoreFromSnapshot' :: Maybe Text
snapshotArn = Maybe Text
a} :: RestoreFromSnapshot)

-- | The name of the snapshot to restore from. Must not be specified at the
-- same time as @snapshotArn@.
restoreFromSnapshot_snapshotName :: Lens.Lens' RestoreFromSnapshot (Prelude.Maybe Prelude.Text)
restoreFromSnapshot_snapshotName :: Lens' RestoreFromSnapshot (Maybe Text)
restoreFromSnapshot_snapshotName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreFromSnapshot' {Maybe Text
snapshotName :: Maybe Text
$sel:snapshotName:RestoreFromSnapshot' :: RestoreFromSnapshot -> Maybe Text
snapshotName} -> Maybe Text
snapshotName) (\s :: RestoreFromSnapshot
s@RestoreFromSnapshot' {} Maybe Text
a -> RestoreFromSnapshot
s {$sel:snapshotName:RestoreFromSnapshot' :: Maybe Text
snapshotName = Maybe Text
a} :: RestoreFromSnapshot)

-- | The name of the namespace to restore the snapshot to.
restoreFromSnapshot_namespaceName :: Lens.Lens' RestoreFromSnapshot Prelude.Text
restoreFromSnapshot_namespaceName :: Lens' RestoreFromSnapshot Text
restoreFromSnapshot_namespaceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreFromSnapshot' {Text
namespaceName :: Text
$sel:namespaceName:RestoreFromSnapshot' :: RestoreFromSnapshot -> Text
namespaceName} -> Text
namespaceName) (\s :: RestoreFromSnapshot
s@RestoreFromSnapshot' {} Text
a -> RestoreFromSnapshot
s {$sel:namespaceName:RestoreFromSnapshot' :: Text
namespaceName = Text
a} :: RestoreFromSnapshot)

-- | The name of the workgroup used to restore the snapshot.
restoreFromSnapshot_workgroupName :: Lens.Lens' RestoreFromSnapshot Prelude.Text
restoreFromSnapshot_workgroupName :: Lens' RestoreFromSnapshot Text
restoreFromSnapshot_workgroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreFromSnapshot' {Text
workgroupName :: Text
$sel:workgroupName:RestoreFromSnapshot' :: RestoreFromSnapshot -> Text
workgroupName} -> Text
workgroupName) (\s :: RestoreFromSnapshot
s@RestoreFromSnapshot' {} Text
a -> RestoreFromSnapshot
s {$sel:workgroupName:RestoreFromSnapshot' :: Text
workgroupName = Text
a} :: RestoreFromSnapshot)

instance Core.AWSRequest RestoreFromSnapshot where
  type
    AWSResponse RestoreFromSnapshot =
      RestoreFromSnapshotResponse
  request :: (Service -> Service)
-> RestoreFromSnapshot -> Request RestoreFromSnapshot
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 RestoreFromSnapshot
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse RestoreFromSnapshot)))
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 Namespace
-> Maybe Text -> Maybe Text -> Int -> RestoreFromSnapshotResponse
RestoreFromSnapshotResponse'
            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
"namespace")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ownerAccount")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"snapshotName")
            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 RestoreFromSnapshot where
  hashWithSalt :: Int -> RestoreFromSnapshot -> Int
hashWithSalt Int
_salt RestoreFromSnapshot' {Maybe Text
Text
workgroupName :: Text
namespaceName :: Text
snapshotName :: Maybe Text
snapshotArn :: Maybe Text
ownerAccount :: Maybe Text
$sel:workgroupName:RestoreFromSnapshot' :: RestoreFromSnapshot -> Text
$sel:namespaceName:RestoreFromSnapshot' :: RestoreFromSnapshot -> Text
$sel:snapshotName:RestoreFromSnapshot' :: RestoreFromSnapshot -> Maybe Text
$sel:snapshotArn:RestoreFromSnapshot' :: RestoreFromSnapshot -> Maybe Text
$sel:ownerAccount:RestoreFromSnapshot' :: RestoreFromSnapshot -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ownerAccount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snapshotArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snapshotName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
namespaceName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workgroupName

instance Prelude.NFData RestoreFromSnapshot where
  rnf :: RestoreFromSnapshot -> ()
rnf RestoreFromSnapshot' {Maybe Text
Text
workgroupName :: Text
namespaceName :: Text
snapshotName :: Maybe Text
snapshotArn :: Maybe Text
ownerAccount :: Maybe Text
$sel:workgroupName:RestoreFromSnapshot' :: RestoreFromSnapshot -> Text
$sel:namespaceName:RestoreFromSnapshot' :: RestoreFromSnapshot -> Text
$sel:snapshotName:RestoreFromSnapshot' :: RestoreFromSnapshot -> Maybe Text
$sel:snapshotArn:RestoreFromSnapshot' :: RestoreFromSnapshot -> Maybe Text
$sel:ownerAccount:RestoreFromSnapshot' :: RestoreFromSnapshot -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ownerAccount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
namespaceName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
workgroupName

instance Data.ToHeaders RestoreFromSnapshot where
  toHeaders :: RestoreFromSnapshot -> 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.RestoreFromSnapshot" ::
                          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 RestoreFromSnapshot where
  toJSON :: RestoreFromSnapshot -> Value
toJSON RestoreFromSnapshot' {Maybe Text
Text
workgroupName :: Text
namespaceName :: Text
snapshotName :: Maybe Text
snapshotArn :: Maybe Text
ownerAccount :: Maybe Text
$sel:workgroupName:RestoreFromSnapshot' :: RestoreFromSnapshot -> Text
$sel:namespaceName:RestoreFromSnapshot' :: RestoreFromSnapshot -> Text
$sel:snapshotName:RestoreFromSnapshot' :: RestoreFromSnapshot -> Maybe Text
$sel:snapshotArn:RestoreFromSnapshot' :: RestoreFromSnapshot -> Maybe Text
$sel:ownerAccount:RestoreFromSnapshot' :: RestoreFromSnapshot -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ownerAccount" 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 Text
ownerAccount,
            (Key
"snapshotArn" 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 Text
snapshotArn,
            (Key
"snapshotName" 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 Text
snapshotName,
            forall a. a -> Maybe a
Prelude.Just (Key
"namespaceName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
namespaceName),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"workgroupName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
workgroupName)
          ]
      )

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

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

-- | /See:/ 'newRestoreFromSnapshotResponse' smart constructor.
data RestoreFromSnapshotResponse = RestoreFromSnapshotResponse'
  { RestoreFromSnapshotResponse -> Maybe Namespace
namespace :: Prelude.Maybe Namespace,
    -- | The owner Amazon Web Services; account of the snapshot that was
    -- restored.
    RestoreFromSnapshotResponse -> Maybe Text
ownerAccount :: Prelude.Maybe Prelude.Text,
    -- | The name of the snapshot used to restore the namespace.
    RestoreFromSnapshotResponse -> Maybe Text
snapshotName :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    RestoreFromSnapshotResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (RestoreFromSnapshotResponse -> RestoreFromSnapshotResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RestoreFromSnapshotResponse -> RestoreFromSnapshotResponse -> Bool
$c/= :: RestoreFromSnapshotResponse -> RestoreFromSnapshotResponse -> Bool
== :: RestoreFromSnapshotResponse -> RestoreFromSnapshotResponse -> Bool
$c== :: RestoreFromSnapshotResponse -> RestoreFromSnapshotResponse -> Bool
Prelude.Eq, Int -> RestoreFromSnapshotResponse -> ShowS
[RestoreFromSnapshotResponse] -> ShowS
RestoreFromSnapshotResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RestoreFromSnapshotResponse] -> ShowS
$cshowList :: [RestoreFromSnapshotResponse] -> ShowS
show :: RestoreFromSnapshotResponse -> String
$cshow :: RestoreFromSnapshotResponse -> String
showsPrec :: Int -> RestoreFromSnapshotResponse -> ShowS
$cshowsPrec :: Int -> RestoreFromSnapshotResponse -> ShowS
Prelude.Show, forall x.
Rep RestoreFromSnapshotResponse x -> RestoreFromSnapshotResponse
forall x.
RestoreFromSnapshotResponse -> Rep RestoreFromSnapshotResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RestoreFromSnapshotResponse x -> RestoreFromSnapshotResponse
$cfrom :: forall x.
RestoreFromSnapshotResponse -> Rep RestoreFromSnapshotResponse x
Prelude.Generic)

-- |
-- Create a value of 'RestoreFromSnapshotResponse' 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:
--
-- 'namespace', 'restoreFromSnapshotResponse_namespace' - Undocumented member.
--
-- 'ownerAccount', 'restoreFromSnapshotResponse_ownerAccount' - The owner Amazon Web Services; account of the snapshot that was
-- restored.
--
-- 'snapshotName', 'restoreFromSnapshotResponse_snapshotName' - The name of the snapshot used to restore the namespace.
--
-- 'httpStatus', 'restoreFromSnapshotResponse_httpStatus' - The response's http status code.
newRestoreFromSnapshotResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  RestoreFromSnapshotResponse
newRestoreFromSnapshotResponse :: Int -> RestoreFromSnapshotResponse
newRestoreFromSnapshotResponse Int
pHttpStatus_ =
  RestoreFromSnapshotResponse'
    { $sel:namespace:RestoreFromSnapshotResponse' :: Maybe Namespace
namespace =
        forall a. Maybe a
Prelude.Nothing,
      $sel:ownerAccount:RestoreFromSnapshotResponse' :: Maybe Text
ownerAccount = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotName:RestoreFromSnapshotResponse' :: Maybe Text
snapshotName = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:RestoreFromSnapshotResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
restoreFromSnapshotResponse_namespace :: Lens.Lens' RestoreFromSnapshotResponse (Prelude.Maybe Namespace)
restoreFromSnapshotResponse_namespace :: Lens' RestoreFromSnapshotResponse (Maybe Namespace)
restoreFromSnapshotResponse_namespace = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreFromSnapshotResponse' {Maybe Namespace
namespace :: Maybe Namespace
$sel:namespace:RestoreFromSnapshotResponse' :: RestoreFromSnapshotResponse -> Maybe Namespace
namespace} -> Maybe Namespace
namespace) (\s :: RestoreFromSnapshotResponse
s@RestoreFromSnapshotResponse' {} Maybe Namespace
a -> RestoreFromSnapshotResponse
s {$sel:namespace:RestoreFromSnapshotResponse' :: Maybe Namespace
namespace = Maybe Namespace
a} :: RestoreFromSnapshotResponse)

-- | The owner Amazon Web Services; account of the snapshot that was
-- restored.
restoreFromSnapshotResponse_ownerAccount :: Lens.Lens' RestoreFromSnapshotResponse (Prelude.Maybe Prelude.Text)
restoreFromSnapshotResponse_ownerAccount :: Lens' RestoreFromSnapshotResponse (Maybe Text)
restoreFromSnapshotResponse_ownerAccount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreFromSnapshotResponse' {Maybe Text
ownerAccount :: Maybe Text
$sel:ownerAccount:RestoreFromSnapshotResponse' :: RestoreFromSnapshotResponse -> Maybe Text
ownerAccount} -> Maybe Text
ownerAccount) (\s :: RestoreFromSnapshotResponse
s@RestoreFromSnapshotResponse' {} Maybe Text
a -> RestoreFromSnapshotResponse
s {$sel:ownerAccount:RestoreFromSnapshotResponse' :: Maybe Text
ownerAccount = Maybe Text
a} :: RestoreFromSnapshotResponse)

-- | The name of the snapshot used to restore the namespace.
restoreFromSnapshotResponse_snapshotName :: Lens.Lens' RestoreFromSnapshotResponse (Prelude.Maybe Prelude.Text)
restoreFromSnapshotResponse_snapshotName :: Lens' RestoreFromSnapshotResponse (Maybe Text)
restoreFromSnapshotResponse_snapshotName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreFromSnapshotResponse' {Maybe Text
snapshotName :: Maybe Text
$sel:snapshotName:RestoreFromSnapshotResponse' :: RestoreFromSnapshotResponse -> Maybe Text
snapshotName} -> Maybe Text
snapshotName) (\s :: RestoreFromSnapshotResponse
s@RestoreFromSnapshotResponse' {} Maybe Text
a -> RestoreFromSnapshotResponse
s {$sel:snapshotName:RestoreFromSnapshotResponse' :: Maybe Text
snapshotName = Maybe Text
a} :: RestoreFromSnapshotResponse)

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

instance Prelude.NFData RestoreFromSnapshotResponse where
  rnf :: RestoreFromSnapshotResponse -> ()
rnf RestoreFromSnapshotResponse' {Int
Maybe Text
Maybe Namespace
httpStatus :: Int
snapshotName :: Maybe Text
ownerAccount :: Maybe Text
namespace :: Maybe Namespace
$sel:httpStatus:RestoreFromSnapshotResponse' :: RestoreFromSnapshotResponse -> Int
$sel:snapshotName:RestoreFromSnapshotResponse' :: RestoreFromSnapshotResponse -> Maybe Text
$sel:ownerAccount:RestoreFromSnapshotResponse' :: RestoreFromSnapshotResponse -> Maybe Text
$sel:namespace:RestoreFromSnapshotResponse' :: RestoreFromSnapshotResponse -> Maybe Namespace
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Namespace
namespace
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ownerAccount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus