{-# 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.Glacier.DeleteArchive
(
DeleteArchive (..),
newDeleteArchive,
deleteArchive_accountId,
deleteArchive_vaultName,
deleteArchive_archiveId,
DeleteArchiveResponse (..),
newDeleteArchiveResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Glacier.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
data DeleteArchive = DeleteArchive'
{
DeleteArchive -> Text
accountId :: Prelude.Text,
DeleteArchive -> Text
vaultName :: Prelude.Text,
DeleteArchive -> Text
archiveId :: Prelude.Text
}
deriving (DeleteArchive -> DeleteArchive -> Bool
(DeleteArchive -> DeleteArchive -> Bool)
-> (DeleteArchive -> DeleteArchive -> Bool) -> Eq DeleteArchive
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteArchive -> DeleteArchive -> Bool
$c/= :: DeleteArchive -> DeleteArchive -> Bool
== :: DeleteArchive -> DeleteArchive -> Bool
$c== :: DeleteArchive -> DeleteArchive -> Bool
Prelude.Eq, ReadPrec [DeleteArchive]
ReadPrec DeleteArchive
Int -> ReadS DeleteArchive
ReadS [DeleteArchive]
(Int -> ReadS DeleteArchive)
-> ReadS [DeleteArchive]
-> ReadPrec DeleteArchive
-> ReadPrec [DeleteArchive]
-> Read DeleteArchive
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteArchive]
$creadListPrec :: ReadPrec [DeleteArchive]
readPrec :: ReadPrec DeleteArchive
$creadPrec :: ReadPrec DeleteArchive
readList :: ReadS [DeleteArchive]
$creadList :: ReadS [DeleteArchive]
readsPrec :: Int -> ReadS DeleteArchive
$creadsPrec :: Int -> ReadS DeleteArchive
Prelude.Read, Int -> DeleteArchive -> ShowS
[DeleteArchive] -> ShowS
DeleteArchive -> String
(Int -> DeleteArchive -> ShowS)
-> (DeleteArchive -> String)
-> ([DeleteArchive] -> ShowS)
-> Show DeleteArchive
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteArchive] -> ShowS
$cshowList :: [DeleteArchive] -> ShowS
show :: DeleteArchive -> String
$cshow :: DeleteArchive -> String
showsPrec :: Int -> DeleteArchive -> ShowS
$cshowsPrec :: Int -> DeleteArchive -> ShowS
Prelude.Show, (forall x. DeleteArchive -> Rep DeleteArchive x)
-> (forall x. Rep DeleteArchive x -> DeleteArchive)
-> Generic DeleteArchive
forall x. Rep DeleteArchive x -> DeleteArchive
forall x. DeleteArchive -> Rep DeleteArchive x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteArchive x -> DeleteArchive
$cfrom :: forall x. DeleteArchive -> Rep DeleteArchive x
Prelude.Generic)
newDeleteArchive ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DeleteArchive
newDeleteArchive :: Text -> Text -> Text -> DeleteArchive
newDeleteArchive Text
pAccountId_ Text
pVaultName_ Text
pArchiveId_ =
DeleteArchive' :: Text -> Text -> Text -> DeleteArchive
DeleteArchive'
{ $sel:accountId:DeleteArchive' :: Text
accountId = Text
pAccountId_,
$sel:vaultName:DeleteArchive' :: Text
vaultName = Text
pVaultName_,
$sel:archiveId:DeleteArchive' :: Text
archiveId = Text
pArchiveId_
}
deleteArchive_accountId :: Lens.Lens' DeleteArchive Prelude.Text
deleteArchive_accountId :: (Text -> f Text) -> DeleteArchive -> f DeleteArchive
deleteArchive_accountId = (DeleteArchive -> Text)
-> (DeleteArchive -> Text -> DeleteArchive)
-> Lens DeleteArchive DeleteArchive Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteArchive' {Text
accountId :: Text
$sel:accountId:DeleteArchive' :: DeleteArchive -> Text
accountId} -> Text
accountId) (\s :: DeleteArchive
s@DeleteArchive' {} Text
a -> DeleteArchive
s {$sel:accountId:DeleteArchive' :: Text
accountId = Text
a} :: DeleteArchive)
deleteArchive_vaultName :: Lens.Lens' DeleteArchive Prelude.Text
deleteArchive_vaultName :: (Text -> f Text) -> DeleteArchive -> f DeleteArchive
deleteArchive_vaultName = (DeleteArchive -> Text)
-> (DeleteArchive -> Text -> DeleteArchive)
-> Lens DeleteArchive DeleteArchive Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteArchive' {Text
vaultName :: Text
$sel:vaultName:DeleteArchive' :: DeleteArchive -> Text
vaultName} -> Text
vaultName) (\s :: DeleteArchive
s@DeleteArchive' {} Text
a -> DeleteArchive
s {$sel:vaultName:DeleteArchive' :: Text
vaultName = Text
a} :: DeleteArchive)
deleteArchive_archiveId :: Lens.Lens' DeleteArchive Prelude.Text
deleteArchive_archiveId :: (Text -> f Text) -> DeleteArchive -> f DeleteArchive
deleteArchive_archiveId = (DeleteArchive -> Text)
-> (DeleteArchive -> Text -> DeleteArchive)
-> Lens DeleteArchive DeleteArchive Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteArchive' {Text
archiveId :: Text
$sel:archiveId:DeleteArchive' :: DeleteArchive -> Text
archiveId} -> Text
archiveId) (\s :: DeleteArchive
s@DeleteArchive' {} Text
a -> DeleteArchive
s {$sel:archiveId:DeleteArchive' :: Text
archiveId = Text
a} :: DeleteArchive)
instance Core.AWSRequest DeleteArchive where
type
AWSResponse DeleteArchive =
DeleteArchiveResponse
request :: DeleteArchive -> Request DeleteArchive
request =
ByteString -> Request DeleteArchive -> Request DeleteArchive
forall a. ByteString -> Request a -> Request a
Request.glacierVersionHeader (Service -> ByteString
Core._serviceVersion Service
defaultService)
(Request DeleteArchive -> Request DeleteArchive)
-> (DeleteArchive -> Request DeleteArchive)
-> DeleteArchive
-> Request DeleteArchive
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> DeleteArchive -> Request DeleteArchive
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteArchive
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteArchive)))
response =
AWSResponse DeleteArchive
-> Logger
-> Service
-> Proxy DeleteArchive
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteArchive)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteArchive
DeleteArchiveResponse
DeleteArchiveResponse'
instance Prelude.Hashable DeleteArchive
instance Prelude.NFData DeleteArchive
instance Core.ToHeaders DeleteArchive where
toHeaders :: DeleteArchive -> [Header]
toHeaders = [Header] -> DeleteArchive -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteArchive where
toPath :: DeleteArchive -> ByteString
toPath DeleteArchive' {Text
archiveId :: Text
vaultName :: Text
accountId :: Text
$sel:archiveId:DeleteArchive' :: DeleteArchive -> Text
$sel:vaultName:DeleteArchive' :: DeleteArchive -> Text
$sel:accountId:DeleteArchive' :: DeleteArchive -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
accountId,
ByteString
"/vaults/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
vaultName,
ByteString
"/archives/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
archiveId
]
instance Core.ToQuery DeleteArchive where
toQuery :: DeleteArchive -> QueryString
toQuery = QueryString -> DeleteArchive -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteArchiveResponse = DeleteArchiveResponse'
{
}
deriving (DeleteArchiveResponse -> DeleteArchiveResponse -> Bool
(DeleteArchiveResponse -> DeleteArchiveResponse -> Bool)
-> (DeleteArchiveResponse -> DeleteArchiveResponse -> Bool)
-> Eq DeleteArchiveResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteArchiveResponse -> DeleteArchiveResponse -> Bool
$c/= :: DeleteArchiveResponse -> DeleteArchiveResponse -> Bool
== :: DeleteArchiveResponse -> DeleteArchiveResponse -> Bool
$c== :: DeleteArchiveResponse -> DeleteArchiveResponse -> Bool
Prelude.Eq, ReadPrec [DeleteArchiveResponse]
ReadPrec DeleteArchiveResponse
Int -> ReadS DeleteArchiveResponse
ReadS [DeleteArchiveResponse]
(Int -> ReadS DeleteArchiveResponse)
-> ReadS [DeleteArchiveResponse]
-> ReadPrec DeleteArchiveResponse
-> ReadPrec [DeleteArchiveResponse]
-> Read DeleteArchiveResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteArchiveResponse]
$creadListPrec :: ReadPrec [DeleteArchiveResponse]
readPrec :: ReadPrec DeleteArchiveResponse
$creadPrec :: ReadPrec DeleteArchiveResponse
readList :: ReadS [DeleteArchiveResponse]
$creadList :: ReadS [DeleteArchiveResponse]
readsPrec :: Int -> ReadS DeleteArchiveResponse
$creadsPrec :: Int -> ReadS DeleteArchiveResponse
Prelude.Read, Int -> DeleteArchiveResponse -> ShowS
[DeleteArchiveResponse] -> ShowS
DeleteArchiveResponse -> String
(Int -> DeleteArchiveResponse -> ShowS)
-> (DeleteArchiveResponse -> String)
-> ([DeleteArchiveResponse] -> ShowS)
-> Show DeleteArchiveResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteArchiveResponse] -> ShowS
$cshowList :: [DeleteArchiveResponse] -> ShowS
show :: DeleteArchiveResponse -> String
$cshow :: DeleteArchiveResponse -> String
showsPrec :: Int -> DeleteArchiveResponse -> ShowS
$cshowsPrec :: Int -> DeleteArchiveResponse -> ShowS
Prelude.Show, (forall x. DeleteArchiveResponse -> Rep DeleteArchiveResponse x)
-> (forall x. Rep DeleteArchiveResponse x -> DeleteArchiveResponse)
-> Generic DeleteArchiveResponse
forall x. Rep DeleteArchiveResponse x -> DeleteArchiveResponse
forall x. DeleteArchiveResponse -> Rep DeleteArchiveResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteArchiveResponse x -> DeleteArchiveResponse
$cfrom :: forall x. DeleteArchiveResponse -> Rep DeleteArchiveResponse x
Prelude.Generic)
newDeleteArchiveResponse ::
DeleteArchiveResponse
newDeleteArchiveResponse :: DeleteArchiveResponse
newDeleteArchiveResponse = DeleteArchiveResponse
DeleteArchiveResponse'
instance Prelude.NFData DeleteArchiveResponse