{-# 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.DeleteTape
(
DeleteTape (..),
newDeleteTape,
deleteTape_bypassGovernanceRetention,
deleteTape_gatewayARN,
deleteTape_tapeARN,
DeleteTapeResponse (..),
newDeleteTapeResponse,
deleteTapeResponse_tapeARN,
deleteTapeResponse_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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.StorageGateway.Types
data DeleteTape = DeleteTape'
{
DeleteTape -> Maybe Bool
bypassGovernanceRetention :: Prelude.Maybe Prelude.Bool,
DeleteTape -> Text
gatewayARN :: Prelude.Text,
DeleteTape -> Text
tapeARN :: Prelude.Text
}
deriving (DeleteTape -> DeleteTape -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTape -> DeleteTape -> Bool
$c/= :: DeleteTape -> DeleteTape -> Bool
== :: DeleteTape -> DeleteTape -> Bool
$c== :: DeleteTape -> DeleteTape -> Bool
Prelude.Eq, ReadPrec [DeleteTape]
ReadPrec DeleteTape
Int -> ReadS DeleteTape
ReadS [DeleteTape]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTape]
$creadListPrec :: ReadPrec [DeleteTape]
readPrec :: ReadPrec DeleteTape
$creadPrec :: ReadPrec DeleteTape
readList :: ReadS [DeleteTape]
$creadList :: ReadS [DeleteTape]
readsPrec :: Int -> ReadS DeleteTape
$creadsPrec :: Int -> ReadS DeleteTape
Prelude.Read, Int -> DeleteTape -> ShowS
[DeleteTape] -> ShowS
DeleteTape -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTape] -> ShowS
$cshowList :: [DeleteTape] -> ShowS
show :: DeleteTape -> String
$cshow :: DeleteTape -> String
showsPrec :: Int -> DeleteTape -> ShowS
$cshowsPrec :: Int -> DeleteTape -> ShowS
Prelude.Show, forall x. Rep DeleteTape x -> DeleteTape
forall x. DeleteTape -> Rep DeleteTape x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTape x -> DeleteTape
$cfrom :: forall x. DeleteTape -> Rep DeleteTape x
Prelude.Generic)
newDeleteTape ::
Prelude.Text ->
Prelude.Text ->
DeleteTape
newDeleteTape :: Text -> Text -> DeleteTape
newDeleteTape Text
pGatewayARN_ Text
pTapeARN_ =
DeleteTape'
{ $sel:bypassGovernanceRetention:DeleteTape' :: Maybe Bool
bypassGovernanceRetention =
forall a. Maybe a
Prelude.Nothing,
$sel:gatewayARN:DeleteTape' :: Text
gatewayARN = Text
pGatewayARN_,
$sel:tapeARN:DeleteTape' :: Text
tapeARN = Text
pTapeARN_
}
deleteTape_bypassGovernanceRetention :: Lens.Lens' DeleteTape (Prelude.Maybe Prelude.Bool)
deleteTape_bypassGovernanceRetention :: Lens' DeleteTape (Maybe Bool)
deleteTape_bypassGovernanceRetention = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTape' {Maybe Bool
bypassGovernanceRetention :: Maybe Bool
$sel:bypassGovernanceRetention:DeleteTape' :: DeleteTape -> Maybe Bool
bypassGovernanceRetention} -> Maybe Bool
bypassGovernanceRetention) (\s :: DeleteTape
s@DeleteTape' {} Maybe Bool
a -> DeleteTape
s {$sel:bypassGovernanceRetention:DeleteTape' :: Maybe Bool
bypassGovernanceRetention = Maybe Bool
a} :: DeleteTape)
deleteTape_gatewayARN :: Lens.Lens' DeleteTape Prelude.Text
deleteTape_gatewayARN :: Lens' DeleteTape Text
deleteTape_gatewayARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTape' {Text
gatewayARN :: Text
$sel:gatewayARN:DeleteTape' :: DeleteTape -> Text
gatewayARN} -> Text
gatewayARN) (\s :: DeleteTape
s@DeleteTape' {} Text
a -> DeleteTape
s {$sel:gatewayARN:DeleteTape' :: Text
gatewayARN = Text
a} :: DeleteTape)
deleteTape_tapeARN :: Lens.Lens' DeleteTape Prelude.Text
deleteTape_tapeARN :: Lens' DeleteTape Text
deleteTape_tapeARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTape' {Text
tapeARN :: Text
$sel:tapeARN:DeleteTape' :: DeleteTape -> Text
tapeARN} -> Text
tapeARN) (\s :: DeleteTape
s@DeleteTape' {} Text
a -> DeleteTape
s {$sel:tapeARN:DeleteTape' :: Text
tapeARN = Text
a} :: DeleteTape)
instance Core.AWSRequest DeleteTape where
type AWSResponse DeleteTape = DeleteTapeResponse
request :: (Service -> Service) -> DeleteTape -> Request DeleteTape
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 DeleteTape
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteTape)))
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 Text -> Int -> DeleteTapeResponse
DeleteTapeResponse'
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
"TapeARN")
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 DeleteTape where
hashWithSalt :: Int -> DeleteTape -> Int
hashWithSalt Int
_salt DeleteTape' {Maybe Bool
Text
tapeARN :: Text
gatewayARN :: Text
bypassGovernanceRetention :: Maybe Bool
$sel:tapeARN:DeleteTape' :: DeleteTape -> Text
$sel:gatewayARN:DeleteTape' :: DeleteTape -> Text
$sel:bypassGovernanceRetention:DeleteTape' :: DeleteTape -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
bypassGovernanceRetention
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
gatewayARN
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
tapeARN
instance Prelude.NFData DeleteTape where
rnf :: DeleteTape -> ()
rnf DeleteTape' {Maybe Bool
Text
tapeARN :: Text
gatewayARN :: Text
bypassGovernanceRetention :: Maybe Bool
$sel:tapeARN:DeleteTape' :: DeleteTape -> Text
$sel:gatewayARN:DeleteTape' :: DeleteTape -> Text
$sel:bypassGovernanceRetention:DeleteTape' :: DeleteTape -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
bypassGovernanceRetention
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
gatewayARN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
tapeARN
instance Data.ToHeaders DeleteTape where
toHeaders :: DeleteTape -> 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
"StorageGateway_20130630.DeleteTape" ::
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 DeleteTape where
toJSON :: DeleteTape -> Value
toJSON DeleteTape' {Maybe Bool
Text
tapeARN :: Text
gatewayARN :: Text
bypassGovernanceRetention :: Maybe Bool
$sel:tapeARN:DeleteTape' :: DeleteTape -> Text
$sel:gatewayARN:DeleteTape' :: DeleteTape -> Text
$sel:bypassGovernanceRetention:DeleteTape' :: DeleteTape -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"BypassGovernanceRetention" 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 Bool
bypassGovernanceRetention,
forall a. a -> Maybe a
Prelude.Just (Key
"GatewayARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
gatewayARN),
forall a. a -> Maybe a
Prelude.Just (Key
"TapeARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
tapeARN)
]
)
instance Data.ToPath DeleteTape where
toPath :: DeleteTape -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteTape where
toQuery :: DeleteTape -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteTapeResponse = DeleteTapeResponse'
{
DeleteTapeResponse -> Maybe Text
tapeARN :: Prelude.Maybe Prelude.Text,
DeleteTapeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteTapeResponse -> DeleteTapeResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTapeResponse -> DeleteTapeResponse -> Bool
$c/= :: DeleteTapeResponse -> DeleteTapeResponse -> Bool
== :: DeleteTapeResponse -> DeleteTapeResponse -> Bool
$c== :: DeleteTapeResponse -> DeleteTapeResponse -> Bool
Prelude.Eq, ReadPrec [DeleteTapeResponse]
ReadPrec DeleteTapeResponse
Int -> ReadS DeleteTapeResponse
ReadS [DeleteTapeResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTapeResponse]
$creadListPrec :: ReadPrec [DeleteTapeResponse]
readPrec :: ReadPrec DeleteTapeResponse
$creadPrec :: ReadPrec DeleteTapeResponse
readList :: ReadS [DeleteTapeResponse]
$creadList :: ReadS [DeleteTapeResponse]
readsPrec :: Int -> ReadS DeleteTapeResponse
$creadsPrec :: Int -> ReadS DeleteTapeResponse
Prelude.Read, Int -> DeleteTapeResponse -> ShowS
[DeleteTapeResponse] -> ShowS
DeleteTapeResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTapeResponse] -> ShowS
$cshowList :: [DeleteTapeResponse] -> ShowS
show :: DeleteTapeResponse -> String
$cshow :: DeleteTapeResponse -> String
showsPrec :: Int -> DeleteTapeResponse -> ShowS
$cshowsPrec :: Int -> DeleteTapeResponse -> ShowS
Prelude.Show, forall x. Rep DeleteTapeResponse x -> DeleteTapeResponse
forall x. DeleteTapeResponse -> Rep DeleteTapeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTapeResponse x -> DeleteTapeResponse
$cfrom :: forall x. DeleteTapeResponse -> Rep DeleteTapeResponse x
Prelude.Generic)
newDeleteTapeResponse ::
Prelude.Int ->
DeleteTapeResponse
newDeleteTapeResponse :: Int -> DeleteTapeResponse
newDeleteTapeResponse Int
pHttpStatus_ =
DeleteTapeResponse'
{ $sel:tapeARN:DeleteTapeResponse' :: Maybe Text
tapeARN = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteTapeResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteTapeResponse_tapeARN :: Lens.Lens' DeleteTapeResponse (Prelude.Maybe Prelude.Text)
deleteTapeResponse_tapeARN :: Lens' DeleteTapeResponse (Maybe Text)
deleteTapeResponse_tapeARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTapeResponse' {Maybe Text
tapeARN :: Maybe Text
$sel:tapeARN:DeleteTapeResponse' :: DeleteTapeResponse -> Maybe Text
tapeARN} -> Maybe Text
tapeARN) (\s :: DeleteTapeResponse
s@DeleteTapeResponse' {} Maybe Text
a -> DeleteTapeResponse
s {$sel:tapeARN:DeleteTapeResponse' :: Maybe Text
tapeARN = Maybe Text
a} :: DeleteTapeResponse)
deleteTapeResponse_httpStatus :: Lens.Lens' DeleteTapeResponse Prelude.Int
deleteTapeResponse_httpStatus :: Lens' DeleteTapeResponse Int
deleteTapeResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTapeResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteTapeResponse' :: DeleteTapeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteTapeResponse
s@DeleteTapeResponse' {} Int
a -> DeleteTapeResponse
s {$sel:httpStatus:DeleteTapeResponse' :: Int
httpStatus = Int
a} :: DeleteTapeResponse)
instance Prelude.NFData DeleteTapeResponse where
rnf :: DeleteTapeResponse -> ()
rnf DeleteTapeResponse' {Int
Maybe Text
httpStatus :: Int
tapeARN :: Maybe Text
$sel:httpStatus:DeleteTapeResponse' :: DeleteTapeResponse -> Int
$sel:tapeARN:DeleteTapeResponse' :: DeleteTapeResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tapeARN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus