{-# 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.ListTagsForVault
(
ListTagsForVault (..),
newListTagsForVault,
listTagsForVault_accountId,
listTagsForVault_vaultName,
ListTagsForVaultResponse (..),
newListTagsForVaultResponse,
listTagsForVaultResponse_tags,
listTagsForVaultResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glacier.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListTagsForVault = ListTagsForVault'
{
ListTagsForVault -> Text
accountId :: Prelude.Text,
ListTagsForVault -> Text
vaultName :: Prelude.Text
}
deriving (ListTagsForVault -> ListTagsForVault -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTagsForVault -> ListTagsForVault -> Bool
$c/= :: ListTagsForVault -> ListTagsForVault -> Bool
== :: ListTagsForVault -> ListTagsForVault -> Bool
$c== :: ListTagsForVault -> ListTagsForVault -> Bool
Prelude.Eq, ReadPrec [ListTagsForVault]
ReadPrec ListTagsForVault
Int -> ReadS ListTagsForVault
ReadS [ListTagsForVault]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTagsForVault]
$creadListPrec :: ReadPrec [ListTagsForVault]
readPrec :: ReadPrec ListTagsForVault
$creadPrec :: ReadPrec ListTagsForVault
readList :: ReadS [ListTagsForVault]
$creadList :: ReadS [ListTagsForVault]
readsPrec :: Int -> ReadS ListTagsForVault
$creadsPrec :: Int -> ReadS ListTagsForVault
Prelude.Read, Int -> ListTagsForVault -> ShowS
[ListTagsForVault] -> ShowS
ListTagsForVault -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTagsForVault] -> ShowS
$cshowList :: [ListTagsForVault] -> ShowS
show :: ListTagsForVault -> String
$cshow :: ListTagsForVault -> String
showsPrec :: Int -> ListTagsForVault -> ShowS
$cshowsPrec :: Int -> ListTagsForVault -> ShowS
Prelude.Show, forall x. Rep ListTagsForVault x -> ListTagsForVault
forall x. ListTagsForVault -> Rep ListTagsForVault x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTagsForVault x -> ListTagsForVault
$cfrom :: forall x. ListTagsForVault -> Rep ListTagsForVault x
Prelude.Generic)
newListTagsForVault ::
Prelude.Text ->
Prelude.Text ->
ListTagsForVault
newListTagsForVault :: Text -> Text -> ListTagsForVault
newListTagsForVault Text
pAccountId_ Text
pVaultName_ =
ListTagsForVault'
{ $sel:accountId:ListTagsForVault' :: Text
accountId = Text
pAccountId_,
$sel:vaultName:ListTagsForVault' :: Text
vaultName = Text
pVaultName_
}
listTagsForVault_accountId :: Lens.Lens' ListTagsForVault Prelude.Text
listTagsForVault_accountId :: Lens' ListTagsForVault Text
listTagsForVault_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForVault' {Text
accountId :: Text
$sel:accountId:ListTagsForVault' :: ListTagsForVault -> Text
accountId} -> Text
accountId) (\s :: ListTagsForVault
s@ListTagsForVault' {} Text
a -> ListTagsForVault
s {$sel:accountId:ListTagsForVault' :: Text
accountId = Text
a} :: ListTagsForVault)
listTagsForVault_vaultName :: Lens.Lens' ListTagsForVault Prelude.Text
listTagsForVault_vaultName :: Lens' ListTagsForVault Text
listTagsForVault_vaultName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForVault' {Text
vaultName :: Text
$sel:vaultName:ListTagsForVault' :: ListTagsForVault -> Text
vaultName} -> Text
vaultName) (\s :: ListTagsForVault
s@ListTagsForVault' {} Text
a -> ListTagsForVault
s {$sel:vaultName:ListTagsForVault' :: Text
vaultName = Text
a} :: ListTagsForVault)
instance Core.AWSRequest ListTagsForVault where
type
AWSResponse ListTagsForVault =
ListTagsForVaultResponse
request :: (Service -> Service)
-> ListTagsForVault -> Request ListTagsForVault
request Service -> Service
overrides =
forall a. ByteString -> Request a -> Request a
Request.glacierVersionHeader (Service -> ByteString
Core.version Service
defaultService)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListTagsForVault
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListTagsForVault)))
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 (HashMap Text Text) -> Int -> ListTagsForVaultResponse
ListTagsForVaultResponse'
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
"Tags" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
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 ListTagsForVault where
hashWithSalt :: Int -> ListTagsForVault -> Int
hashWithSalt Int
_salt ListTagsForVault' {Text
vaultName :: Text
accountId :: Text
$sel:vaultName:ListTagsForVault' :: ListTagsForVault -> Text
$sel:accountId:ListTagsForVault' :: ListTagsForVault -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
accountId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vaultName
instance Prelude.NFData ListTagsForVault where
rnf :: ListTagsForVault -> ()
rnf ListTagsForVault' {Text
vaultName :: Text
accountId :: Text
$sel:vaultName:ListTagsForVault' :: ListTagsForVault -> Text
$sel:accountId:ListTagsForVault' :: ListTagsForVault -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
accountId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vaultName
instance Data.ToHeaders ListTagsForVault where
toHeaders :: ListTagsForVault -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListTagsForVault where
toPath :: ListTagsForVault -> ByteString
toPath ListTagsForVault' {Text
vaultName :: Text
accountId :: Text
$sel:vaultName:ListTagsForVault' :: ListTagsForVault -> Text
$sel:accountId:ListTagsForVault' :: ListTagsForVault -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
accountId,
ByteString
"/vaults/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
vaultName,
ByteString
"/tags"
]
instance Data.ToQuery ListTagsForVault where
toQuery :: ListTagsForVault -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListTagsForVaultResponse = ListTagsForVaultResponse'
{
ListTagsForVaultResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
ListTagsForVaultResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListTagsForVaultResponse -> ListTagsForVaultResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTagsForVaultResponse -> ListTagsForVaultResponse -> Bool
$c/= :: ListTagsForVaultResponse -> ListTagsForVaultResponse -> Bool
== :: ListTagsForVaultResponse -> ListTagsForVaultResponse -> Bool
$c== :: ListTagsForVaultResponse -> ListTagsForVaultResponse -> Bool
Prelude.Eq, ReadPrec [ListTagsForVaultResponse]
ReadPrec ListTagsForVaultResponse
Int -> ReadS ListTagsForVaultResponse
ReadS [ListTagsForVaultResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTagsForVaultResponse]
$creadListPrec :: ReadPrec [ListTagsForVaultResponse]
readPrec :: ReadPrec ListTagsForVaultResponse
$creadPrec :: ReadPrec ListTagsForVaultResponse
readList :: ReadS [ListTagsForVaultResponse]
$creadList :: ReadS [ListTagsForVaultResponse]
readsPrec :: Int -> ReadS ListTagsForVaultResponse
$creadsPrec :: Int -> ReadS ListTagsForVaultResponse
Prelude.Read, Int -> ListTagsForVaultResponse -> ShowS
[ListTagsForVaultResponse] -> ShowS
ListTagsForVaultResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTagsForVaultResponse] -> ShowS
$cshowList :: [ListTagsForVaultResponse] -> ShowS
show :: ListTagsForVaultResponse -> String
$cshow :: ListTagsForVaultResponse -> String
showsPrec :: Int -> ListTagsForVaultResponse -> ShowS
$cshowsPrec :: Int -> ListTagsForVaultResponse -> ShowS
Prelude.Show, forall x.
Rep ListTagsForVaultResponse x -> ListTagsForVaultResponse
forall x.
ListTagsForVaultResponse -> Rep ListTagsForVaultResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTagsForVaultResponse x -> ListTagsForVaultResponse
$cfrom :: forall x.
ListTagsForVaultResponse -> Rep ListTagsForVaultResponse x
Prelude.Generic)
newListTagsForVaultResponse ::
Prelude.Int ->
ListTagsForVaultResponse
newListTagsForVaultResponse :: Int -> ListTagsForVaultResponse
newListTagsForVaultResponse Int
pHttpStatus_ =
ListTagsForVaultResponse'
{ $sel:tags:ListTagsForVaultResponse' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListTagsForVaultResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listTagsForVaultResponse_tags :: Lens.Lens' ListTagsForVaultResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
listTagsForVaultResponse_tags :: Lens' ListTagsForVaultResponse (Maybe (HashMap Text Text))
listTagsForVaultResponse_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForVaultResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ListTagsForVaultResponse' :: ListTagsForVaultResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ListTagsForVaultResponse
s@ListTagsForVaultResponse' {} Maybe (HashMap Text Text)
a -> ListTagsForVaultResponse
s {$sel:tags:ListTagsForVaultResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ListTagsForVaultResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listTagsForVaultResponse_httpStatus :: Lens.Lens' ListTagsForVaultResponse Prelude.Int
listTagsForVaultResponse_httpStatus :: Lens' ListTagsForVaultResponse Int
listTagsForVaultResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForVaultResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListTagsForVaultResponse' :: ListTagsForVaultResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListTagsForVaultResponse
s@ListTagsForVaultResponse' {} Int
a -> ListTagsForVaultResponse
s {$sel:httpStatus:ListTagsForVaultResponse' :: Int
httpStatus = Int
a} :: ListTagsForVaultResponse)
instance Prelude.NFData ListTagsForVaultResponse where
rnf :: ListTagsForVaultResponse -> ()
rnf ListTagsForVaultResponse' {Int
Maybe (HashMap Text Text)
httpStatus :: Int
tags :: Maybe (HashMap Text Text)
$sel:httpStatus:ListTagsForVaultResponse' :: ListTagsForVaultResponse -> Int
$sel:tags:ListTagsForVaultResponse' :: ListTagsForVaultResponse -> Maybe (HashMap Text Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus