{-# 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.DescribeVault
(
DescribeVault (..),
newDescribeVault,
describeVault_accountId,
describeVault_vaultName,
DescribeVaultOutput (..),
newDescribeVaultOutput,
describeVaultOutput_vaultName,
describeVaultOutput_sizeInBytes,
describeVaultOutput_lastInventoryDate,
describeVaultOutput_vaultARN,
describeVaultOutput_creationDate,
describeVaultOutput_numberOfArchives,
)
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 DescribeVault = DescribeVault'
{
DescribeVault -> Text
accountId :: Prelude.Text,
DescribeVault -> Text
vaultName :: Prelude.Text
}
deriving (DescribeVault -> DescribeVault -> Bool
(DescribeVault -> DescribeVault -> Bool)
-> (DescribeVault -> DescribeVault -> Bool) -> Eq DescribeVault
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVault -> DescribeVault -> Bool
$c/= :: DescribeVault -> DescribeVault -> Bool
== :: DescribeVault -> DescribeVault -> Bool
$c== :: DescribeVault -> DescribeVault -> Bool
Prelude.Eq, ReadPrec [DescribeVault]
ReadPrec DescribeVault
Int -> ReadS DescribeVault
ReadS [DescribeVault]
(Int -> ReadS DescribeVault)
-> ReadS [DescribeVault]
-> ReadPrec DescribeVault
-> ReadPrec [DescribeVault]
-> Read DescribeVault
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVault]
$creadListPrec :: ReadPrec [DescribeVault]
readPrec :: ReadPrec DescribeVault
$creadPrec :: ReadPrec DescribeVault
readList :: ReadS [DescribeVault]
$creadList :: ReadS [DescribeVault]
readsPrec :: Int -> ReadS DescribeVault
$creadsPrec :: Int -> ReadS DescribeVault
Prelude.Read, Int -> DescribeVault -> ShowS
[DescribeVault] -> ShowS
DescribeVault -> String
(Int -> DescribeVault -> ShowS)
-> (DescribeVault -> String)
-> ([DescribeVault] -> ShowS)
-> Show DescribeVault
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVault] -> ShowS
$cshowList :: [DescribeVault] -> ShowS
show :: DescribeVault -> String
$cshow :: DescribeVault -> String
showsPrec :: Int -> DescribeVault -> ShowS
$cshowsPrec :: Int -> DescribeVault -> ShowS
Prelude.Show, (forall x. DescribeVault -> Rep DescribeVault x)
-> (forall x. Rep DescribeVault x -> DescribeVault)
-> Generic DescribeVault
forall x. Rep DescribeVault x -> DescribeVault
forall x. DescribeVault -> Rep DescribeVault x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeVault x -> DescribeVault
$cfrom :: forall x. DescribeVault -> Rep DescribeVault x
Prelude.Generic)
newDescribeVault ::
Prelude.Text ->
Prelude.Text ->
DescribeVault
newDescribeVault :: Text -> Text -> DescribeVault
newDescribeVault Text
pAccountId_ Text
pVaultName_ =
DescribeVault' :: Text -> Text -> DescribeVault
DescribeVault'
{ $sel:accountId:DescribeVault' :: Text
accountId = Text
pAccountId_,
$sel:vaultName:DescribeVault' :: Text
vaultName = Text
pVaultName_
}
describeVault_accountId :: Lens.Lens' DescribeVault Prelude.Text
describeVault_accountId :: (Text -> f Text) -> DescribeVault -> f DescribeVault
describeVault_accountId = (DescribeVault -> Text)
-> (DescribeVault -> Text -> DescribeVault)
-> Lens DescribeVault DescribeVault Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVault' {Text
accountId :: Text
$sel:accountId:DescribeVault' :: DescribeVault -> Text
accountId} -> Text
accountId) (\s :: DescribeVault
s@DescribeVault' {} Text
a -> DescribeVault
s {$sel:accountId:DescribeVault' :: Text
accountId = Text
a} :: DescribeVault)
describeVault_vaultName :: Lens.Lens' DescribeVault Prelude.Text
describeVault_vaultName :: (Text -> f Text) -> DescribeVault -> f DescribeVault
describeVault_vaultName = (DescribeVault -> Text)
-> (DescribeVault -> Text -> DescribeVault)
-> Lens DescribeVault DescribeVault Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVault' {Text
vaultName :: Text
$sel:vaultName:DescribeVault' :: DescribeVault -> Text
vaultName} -> Text
vaultName) (\s :: DescribeVault
s@DescribeVault' {} Text
a -> DescribeVault
s {$sel:vaultName:DescribeVault' :: Text
vaultName = Text
a} :: DescribeVault)
instance Core.AWSRequest DescribeVault where
type AWSResponse DescribeVault = DescribeVaultOutput
request :: DescribeVault -> Request DescribeVault
request =
ByteString -> Request DescribeVault -> Request DescribeVault
forall a. ByteString -> Request a -> Request a
Request.glacierVersionHeader (Service -> ByteString
Core._serviceVersion Service
defaultService)
(Request DescribeVault -> Request DescribeVault)
-> (DescribeVault -> Request DescribeVault)
-> DescribeVault
-> Request DescribeVault
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> DescribeVault -> Request DescribeVault
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeVault
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeVault)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeVault))
-> Logger
-> Service
-> Proxy DescribeVault
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeVault)))
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 -> Object -> Either String DescribeVaultOutput
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable DescribeVault
instance Prelude.NFData DescribeVault
instance Core.ToHeaders DescribeVault where
toHeaders :: DescribeVault -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeVault -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeVault where
toPath :: DescribeVault -> ByteString
toPath DescribeVault' {Text
vaultName :: Text
accountId :: Text
$sel:vaultName:DescribeVault' :: DescribeVault -> Text
$sel:accountId:DescribeVault' :: DescribeVault -> 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
]
instance Core.ToQuery DescribeVault where
toQuery :: DescribeVault -> QueryString
toQuery = QueryString -> DescribeVault -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty