{-# 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 #-}
module Amazonka.StorageGateway.RetrieveTapeRecoveryPoint
(
RetrieveTapeRecoveryPoint (..),
newRetrieveTapeRecoveryPoint,
retrieveTapeRecoveryPoint_tapeARN,
retrieveTapeRecoveryPoint_gatewayARN,
RetrieveTapeRecoveryPointResponse (..),
newRetrieveTapeRecoveryPointResponse,
retrieveTapeRecoveryPointResponse_tapeARN,
retrieveTapeRecoveryPointResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.StorageGateway.Types
data RetrieveTapeRecoveryPoint = RetrieveTapeRecoveryPoint'
{
RetrieveTapeRecoveryPoint -> Text
tapeARN :: Prelude.Text,
RetrieveTapeRecoveryPoint -> Text
gatewayARN :: Prelude.Text
}
deriving (RetrieveTapeRecoveryPoint -> RetrieveTapeRecoveryPoint -> Bool
(RetrieveTapeRecoveryPoint -> RetrieveTapeRecoveryPoint -> Bool)
-> (RetrieveTapeRecoveryPoint -> RetrieveTapeRecoveryPoint -> Bool)
-> Eq RetrieveTapeRecoveryPoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RetrieveTapeRecoveryPoint -> RetrieveTapeRecoveryPoint -> Bool
$c/= :: RetrieveTapeRecoveryPoint -> RetrieveTapeRecoveryPoint -> Bool
== :: RetrieveTapeRecoveryPoint -> RetrieveTapeRecoveryPoint -> Bool
$c== :: RetrieveTapeRecoveryPoint -> RetrieveTapeRecoveryPoint -> Bool
Prelude.Eq, ReadPrec [RetrieveTapeRecoveryPoint]
ReadPrec RetrieveTapeRecoveryPoint
Int -> ReadS RetrieveTapeRecoveryPoint
ReadS [RetrieveTapeRecoveryPoint]
(Int -> ReadS RetrieveTapeRecoveryPoint)
-> ReadS [RetrieveTapeRecoveryPoint]
-> ReadPrec RetrieveTapeRecoveryPoint
-> ReadPrec [RetrieveTapeRecoveryPoint]
-> Read RetrieveTapeRecoveryPoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RetrieveTapeRecoveryPoint]
$creadListPrec :: ReadPrec [RetrieveTapeRecoveryPoint]
readPrec :: ReadPrec RetrieveTapeRecoveryPoint
$creadPrec :: ReadPrec RetrieveTapeRecoveryPoint
readList :: ReadS [RetrieveTapeRecoveryPoint]
$creadList :: ReadS [RetrieveTapeRecoveryPoint]
readsPrec :: Int -> ReadS RetrieveTapeRecoveryPoint
$creadsPrec :: Int -> ReadS RetrieveTapeRecoveryPoint
Prelude.Read, Int -> RetrieveTapeRecoveryPoint -> ShowS
[RetrieveTapeRecoveryPoint] -> ShowS
RetrieveTapeRecoveryPoint -> String
(Int -> RetrieveTapeRecoveryPoint -> ShowS)
-> (RetrieveTapeRecoveryPoint -> String)
-> ([RetrieveTapeRecoveryPoint] -> ShowS)
-> Show RetrieveTapeRecoveryPoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RetrieveTapeRecoveryPoint] -> ShowS
$cshowList :: [RetrieveTapeRecoveryPoint] -> ShowS
show :: RetrieveTapeRecoveryPoint -> String
$cshow :: RetrieveTapeRecoveryPoint -> String
showsPrec :: Int -> RetrieveTapeRecoveryPoint -> ShowS
$cshowsPrec :: Int -> RetrieveTapeRecoveryPoint -> ShowS
Prelude.Show, (forall x.
RetrieveTapeRecoveryPoint -> Rep RetrieveTapeRecoveryPoint x)
-> (forall x.
Rep RetrieveTapeRecoveryPoint x -> RetrieveTapeRecoveryPoint)
-> Generic RetrieveTapeRecoveryPoint
forall x.
Rep RetrieveTapeRecoveryPoint x -> RetrieveTapeRecoveryPoint
forall x.
RetrieveTapeRecoveryPoint -> Rep RetrieveTapeRecoveryPoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RetrieveTapeRecoveryPoint x -> RetrieveTapeRecoveryPoint
$cfrom :: forall x.
RetrieveTapeRecoveryPoint -> Rep RetrieveTapeRecoveryPoint x
Prelude.Generic)
newRetrieveTapeRecoveryPoint ::
Prelude.Text ->
Prelude.Text ->
RetrieveTapeRecoveryPoint
newRetrieveTapeRecoveryPoint :: Text -> Text -> RetrieveTapeRecoveryPoint
newRetrieveTapeRecoveryPoint Text
pTapeARN_ Text
pGatewayARN_ =
RetrieveTapeRecoveryPoint' :: Text -> Text -> RetrieveTapeRecoveryPoint
RetrieveTapeRecoveryPoint'
{ $sel:tapeARN:RetrieveTapeRecoveryPoint' :: Text
tapeARN = Text
pTapeARN_,
$sel:gatewayARN:RetrieveTapeRecoveryPoint' :: Text
gatewayARN = Text
pGatewayARN_
}
retrieveTapeRecoveryPoint_tapeARN :: Lens.Lens' RetrieveTapeRecoveryPoint Prelude.Text
retrieveTapeRecoveryPoint_tapeARN :: (Text -> f Text)
-> RetrieveTapeRecoveryPoint -> f RetrieveTapeRecoveryPoint
retrieveTapeRecoveryPoint_tapeARN = (RetrieveTapeRecoveryPoint -> Text)
-> (RetrieveTapeRecoveryPoint -> Text -> RetrieveTapeRecoveryPoint)
-> Lens
RetrieveTapeRecoveryPoint RetrieveTapeRecoveryPoint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RetrieveTapeRecoveryPoint' {Text
tapeARN :: Text
$sel:tapeARN:RetrieveTapeRecoveryPoint' :: RetrieveTapeRecoveryPoint -> Text
tapeARN} -> Text
tapeARN) (\s :: RetrieveTapeRecoveryPoint
s@RetrieveTapeRecoveryPoint' {} Text
a -> RetrieveTapeRecoveryPoint
s {$sel:tapeARN:RetrieveTapeRecoveryPoint' :: Text
tapeARN = Text
a} :: RetrieveTapeRecoveryPoint)
retrieveTapeRecoveryPoint_gatewayARN :: Lens.Lens' RetrieveTapeRecoveryPoint Prelude.Text
retrieveTapeRecoveryPoint_gatewayARN :: (Text -> f Text)
-> RetrieveTapeRecoveryPoint -> f RetrieveTapeRecoveryPoint
retrieveTapeRecoveryPoint_gatewayARN = (RetrieveTapeRecoveryPoint -> Text)
-> (RetrieveTapeRecoveryPoint -> Text -> RetrieveTapeRecoveryPoint)
-> Lens
RetrieveTapeRecoveryPoint RetrieveTapeRecoveryPoint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RetrieveTapeRecoveryPoint' {Text
gatewayARN :: Text
$sel:gatewayARN:RetrieveTapeRecoveryPoint' :: RetrieveTapeRecoveryPoint -> Text
gatewayARN} -> Text
gatewayARN) (\s :: RetrieveTapeRecoveryPoint
s@RetrieveTapeRecoveryPoint' {} Text
a -> RetrieveTapeRecoveryPoint
s {$sel:gatewayARN:RetrieveTapeRecoveryPoint' :: Text
gatewayARN = Text
a} :: RetrieveTapeRecoveryPoint)
instance Core.AWSRequest RetrieveTapeRecoveryPoint where
type
AWSResponse RetrieveTapeRecoveryPoint =
RetrieveTapeRecoveryPointResponse
request :: RetrieveTapeRecoveryPoint -> Request RetrieveTapeRecoveryPoint
request = Service
-> RetrieveTapeRecoveryPoint -> Request RetrieveTapeRecoveryPoint
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RetrieveTapeRecoveryPoint
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RetrieveTapeRecoveryPoint)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RetrieveTapeRecoveryPoint))
-> Logger
-> Service
-> Proxy RetrieveTapeRecoveryPoint
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RetrieveTapeRecoveryPoint)))
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 Text -> Int -> RetrieveTapeRecoveryPointResponse
RetrieveTapeRecoveryPointResponse'
(Maybe Text -> Int -> RetrieveTapeRecoveryPointResponse)
-> Either String (Maybe Text)
-> Either String (Int -> RetrieveTapeRecoveryPointResponse)
forall (f :: * -> *) a b. Functor 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
"TapeARN")
Either String (Int -> RetrieveTapeRecoveryPointResponse)
-> Either String Int
-> Either String RetrieveTapeRecoveryPointResponse
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 RetrieveTapeRecoveryPoint
instance Prelude.NFData RetrieveTapeRecoveryPoint
instance Core.ToHeaders RetrieveTapeRecoveryPoint where
toHeaders :: RetrieveTapeRecoveryPoint -> ResponseHeaders
toHeaders =
ResponseHeaders -> RetrieveTapeRecoveryPoint -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"StorageGateway_20130630.RetrieveTapeRecoveryPoint" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON RetrieveTapeRecoveryPoint where
toJSON :: RetrieveTapeRecoveryPoint -> Value
toJSON RetrieveTapeRecoveryPoint' {Text
gatewayARN :: Text
tapeARN :: Text
$sel:gatewayARN:RetrieveTapeRecoveryPoint' :: RetrieveTapeRecoveryPoint -> Text
$sel:tapeARN:RetrieveTapeRecoveryPoint' :: RetrieveTapeRecoveryPoint -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TapeARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
tapeARN),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"GatewayARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gatewayARN)
]
)
instance Core.ToPath RetrieveTapeRecoveryPoint where
toPath :: RetrieveTapeRecoveryPoint -> ByteString
toPath = ByteString -> RetrieveTapeRecoveryPoint -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RetrieveTapeRecoveryPoint where
toQuery :: RetrieveTapeRecoveryPoint -> QueryString
toQuery = QueryString -> RetrieveTapeRecoveryPoint -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RetrieveTapeRecoveryPointResponse = RetrieveTapeRecoveryPointResponse'
{
RetrieveTapeRecoveryPointResponse -> Maybe Text
tapeARN :: Prelude.Maybe Prelude.Text,
RetrieveTapeRecoveryPointResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RetrieveTapeRecoveryPointResponse
-> RetrieveTapeRecoveryPointResponse -> Bool
(RetrieveTapeRecoveryPointResponse
-> RetrieveTapeRecoveryPointResponse -> Bool)
-> (RetrieveTapeRecoveryPointResponse
-> RetrieveTapeRecoveryPointResponse -> Bool)
-> Eq RetrieveTapeRecoveryPointResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RetrieveTapeRecoveryPointResponse
-> RetrieveTapeRecoveryPointResponse -> Bool
$c/= :: RetrieveTapeRecoveryPointResponse
-> RetrieveTapeRecoveryPointResponse -> Bool
== :: RetrieveTapeRecoveryPointResponse
-> RetrieveTapeRecoveryPointResponse -> Bool
$c== :: RetrieveTapeRecoveryPointResponse
-> RetrieveTapeRecoveryPointResponse -> Bool
Prelude.Eq, ReadPrec [RetrieveTapeRecoveryPointResponse]
ReadPrec RetrieveTapeRecoveryPointResponse
Int -> ReadS RetrieveTapeRecoveryPointResponse
ReadS [RetrieveTapeRecoveryPointResponse]
(Int -> ReadS RetrieveTapeRecoveryPointResponse)
-> ReadS [RetrieveTapeRecoveryPointResponse]
-> ReadPrec RetrieveTapeRecoveryPointResponse
-> ReadPrec [RetrieveTapeRecoveryPointResponse]
-> Read RetrieveTapeRecoveryPointResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RetrieveTapeRecoveryPointResponse]
$creadListPrec :: ReadPrec [RetrieveTapeRecoveryPointResponse]
readPrec :: ReadPrec RetrieveTapeRecoveryPointResponse
$creadPrec :: ReadPrec RetrieveTapeRecoveryPointResponse
readList :: ReadS [RetrieveTapeRecoveryPointResponse]
$creadList :: ReadS [RetrieveTapeRecoveryPointResponse]
readsPrec :: Int -> ReadS RetrieveTapeRecoveryPointResponse
$creadsPrec :: Int -> ReadS RetrieveTapeRecoveryPointResponse
Prelude.Read, Int -> RetrieveTapeRecoveryPointResponse -> ShowS
[RetrieveTapeRecoveryPointResponse] -> ShowS
RetrieveTapeRecoveryPointResponse -> String
(Int -> RetrieveTapeRecoveryPointResponse -> ShowS)
-> (RetrieveTapeRecoveryPointResponse -> String)
-> ([RetrieveTapeRecoveryPointResponse] -> ShowS)
-> Show RetrieveTapeRecoveryPointResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RetrieveTapeRecoveryPointResponse] -> ShowS
$cshowList :: [RetrieveTapeRecoveryPointResponse] -> ShowS
show :: RetrieveTapeRecoveryPointResponse -> String
$cshow :: RetrieveTapeRecoveryPointResponse -> String
showsPrec :: Int -> RetrieveTapeRecoveryPointResponse -> ShowS
$cshowsPrec :: Int -> RetrieveTapeRecoveryPointResponse -> ShowS
Prelude.Show, (forall x.
RetrieveTapeRecoveryPointResponse
-> Rep RetrieveTapeRecoveryPointResponse x)
-> (forall x.
Rep RetrieveTapeRecoveryPointResponse x
-> RetrieveTapeRecoveryPointResponse)
-> Generic RetrieveTapeRecoveryPointResponse
forall x.
Rep RetrieveTapeRecoveryPointResponse x
-> RetrieveTapeRecoveryPointResponse
forall x.
RetrieveTapeRecoveryPointResponse
-> Rep RetrieveTapeRecoveryPointResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RetrieveTapeRecoveryPointResponse x
-> RetrieveTapeRecoveryPointResponse
$cfrom :: forall x.
RetrieveTapeRecoveryPointResponse
-> Rep RetrieveTapeRecoveryPointResponse x
Prelude.Generic)
newRetrieveTapeRecoveryPointResponse ::
Prelude.Int ->
RetrieveTapeRecoveryPointResponse
newRetrieveTapeRecoveryPointResponse :: Int -> RetrieveTapeRecoveryPointResponse
newRetrieveTapeRecoveryPointResponse Int
pHttpStatus_ =
RetrieveTapeRecoveryPointResponse' :: Maybe Text -> Int -> RetrieveTapeRecoveryPointResponse
RetrieveTapeRecoveryPointResponse'
{ $sel:tapeARN:RetrieveTapeRecoveryPointResponse' :: Maybe Text
tapeARN =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RetrieveTapeRecoveryPointResponse' :: Int
httpStatus = Int
pHttpStatus_
}
retrieveTapeRecoveryPointResponse_tapeARN :: Lens.Lens' RetrieveTapeRecoveryPointResponse (Prelude.Maybe Prelude.Text)
retrieveTapeRecoveryPointResponse_tapeARN :: (Maybe Text -> f (Maybe Text))
-> RetrieveTapeRecoveryPointResponse
-> f RetrieveTapeRecoveryPointResponse
retrieveTapeRecoveryPointResponse_tapeARN = (RetrieveTapeRecoveryPointResponse -> Maybe Text)
-> (RetrieveTapeRecoveryPointResponse
-> Maybe Text -> RetrieveTapeRecoveryPointResponse)
-> Lens
RetrieveTapeRecoveryPointResponse
RetrieveTapeRecoveryPointResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RetrieveTapeRecoveryPointResponse' {Maybe Text
tapeARN :: Maybe Text
$sel:tapeARN:RetrieveTapeRecoveryPointResponse' :: RetrieveTapeRecoveryPointResponse -> Maybe Text
tapeARN} -> Maybe Text
tapeARN) (\s :: RetrieveTapeRecoveryPointResponse
s@RetrieveTapeRecoveryPointResponse' {} Maybe Text
a -> RetrieveTapeRecoveryPointResponse
s {$sel:tapeARN:RetrieveTapeRecoveryPointResponse' :: Maybe Text
tapeARN = Maybe Text
a} :: RetrieveTapeRecoveryPointResponse)
retrieveTapeRecoveryPointResponse_httpStatus :: Lens.Lens' RetrieveTapeRecoveryPointResponse Prelude.Int
retrieveTapeRecoveryPointResponse_httpStatus :: (Int -> f Int)
-> RetrieveTapeRecoveryPointResponse
-> f RetrieveTapeRecoveryPointResponse
retrieveTapeRecoveryPointResponse_httpStatus = (RetrieveTapeRecoveryPointResponse -> Int)
-> (RetrieveTapeRecoveryPointResponse
-> Int -> RetrieveTapeRecoveryPointResponse)
-> Lens
RetrieveTapeRecoveryPointResponse
RetrieveTapeRecoveryPointResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RetrieveTapeRecoveryPointResponse' {Int
httpStatus :: Int
$sel:httpStatus:RetrieveTapeRecoveryPointResponse' :: RetrieveTapeRecoveryPointResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RetrieveTapeRecoveryPointResponse
s@RetrieveTapeRecoveryPointResponse' {} Int
a -> RetrieveTapeRecoveryPointResponse
s {$sel:httpStatus:RetrieveTapeRecoveryPointResponse' :: Int
httpStatus = Int
a} :: RetrieveTapeRecoveryPointResponse)
instance
Prelude.NFData
RetrieveTapeRecoveryPointResponse