{-# 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.AddTagsToVault
(
AddTagsToVault (..),
newAddTagsToVault,
addTagsToVault_tags,
addTagsToVault_accountId,
addTagsToVault_vaultName,
AddTagsToVaultResponse (..),
newAddTagsToVaultResponse,
)
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 AddTagsToVault = AddTagsToVault'
{
AddTagsToVault -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
AddTagsToVault -> Text
accountId :: Prelude.Text,
AddTagsToVault -> Text
vaultName :: Prelude.Text
}
deriving (AddTagsToVault -> AddTagsToVault -> Bool
(AddTagsToVault -> AddTagsToVault -> Bool)
-> (AddTagsToVault -> AddTagsToVault -> Bool) -> Eq AddTagsToVault
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddTagsToVault -> AddTagsToVault -> Bool
$c/= :: AddTagsToVault -> AddTagsToVault -> Bool
== :: AddTagsToVault -> AddTagsToVault -> Bool
$c== :: AddTagsToVault -> AddTagsToVault -> Bool
Prelude.Eq, ReadPrec [AddTagsToVault]
ReadPrec AddTagsToVault
Int -> ReadS AddTagsToVault
ReadS [AddTagsToVault]
(Int -> ReadS AddTagsToVault)
-> ReadS [AddTagsToVault]
-> ReadPrec AddTagsToVault
-> ReadPrec [AddTagsToVault]
-> Read AddTagsToVault
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddTagsToVault]
$creadListPrec :: ReadPrec [AddTagsToVault]
readPrec :: ReadPrec AddTagsToVault
$creadPrec :: ReadPrec AddTagsToVault
readList :: ReadS [AddTagsToVault]
$creadList :: ReadS [AddTagsToVault]
readsPrec :: Int -> ReadS AddTagsToVault
$creadsPrec :: Int -> ReadS AddTagsToVault
Prelude.Read, Int -> AddTagsToVault -> ShowS
[AddTagsToVault] -> ShowS
AddTagsToVault -> String
(Int -> AddTagsToVault -> ShowS)
-> (AddTagsToVault -> String)
-> ([AddTagsToVault] -> ShowS)
-> Show AddTagsToVault
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddTagsToVault] -> ShowS
$cshowList :: [AddTagsToVault] -> ShowS
show :: AddTagsToVault -> String
$cshow :: AddTagsToVault -> String
showsPrec :: Int -> AddTagsToVault -> ShowS
$cshowsPrec :: Int -> AddTagsToVault -> ShowS
Prelude.Show, (forall x. AddTagsToVault -> Rep AddTagsToVault x)
-> (forall x. Rep AddTagsToVault x -> AddTagsToVault)
-> Generic AddTagsToVault
forall x. Rep AddTagsToVault x -> AddTagsToVault
forall x. AddTagsToVault -> Rep AddTagsToVault x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddTagsToVault x -> AddTagsToVault
$cfrom :: forall x. AddTagsToVault -> Rep AddTagsToVault x
Prelude.Generic)
newAddTagsToVault ::
Prelude.Text ->
Prelude.Text ->
AddTagsToVault
newAddTagsToVault :: Text -> Text -> AddTagsToVault
newAddTagsToVault Text
pAccountId_ Text
pVaultName_ =
AddTagsToVault' :: Maybe (HashMap Text Text) -> Text -> Text -> AddTagsToVault
AddTagsToVault'
{ $sel:tags:AddTagsToVault' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:AddTagsToVault' :: Text
accountId = Text
pAccountId_,
$sel:vaultName:AddTagsToVault' :: Text
vaultName = Text
pVaultName_
}
addTagsToVault_tags :: Lens.Lens' AddTagsToVault (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
addTagsToVault_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AddTagsToVault -> f AddTagsToVault
addTagsToVault_tags = (AddTagsToVault -> Maybe (HashMap Text Text))
-> (AddTagsToVault -> Maybe (HashMap Text Text) -> AddTagsToVault)
-> Lens
AddTagsToVault
AddTagsToVault
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddTagsToVault' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:AddTagsToVault' :: AddTagsToVault -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: AddTagsToVault
s@AddTagsToVault' {} Maybe (HashMap Text Text)
a -> AddTagsToVault
s {$sel:tags:AddTagsToVault' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: AddTagsToVault) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AddTagsToVault -> f AddTagsToVault)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AddTagsToVault
-> f AddTagsToVault
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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 AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
addTagsToVault_accountId :: Lens.Lens' AddTagsToVault Prelude.Text
addTagsToVault_accountId :: (Text -> f Text) -> AddTagsToVault -> f AddTagsToVault
addTagsToVault_accountId = (AddTagsToVault -> Text)
-> (AddTagsToVault -> Text -> AddTagsToVault)
-> Lens AddTagsToVault AddTagsToVault Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddTagsToVault' {Text
accountId :: Text
$sel:accountId:AddTagsToVault' :: AddTagsToVault -> Text
accountId} -> Text
accountId) (\s :: AddTagsToVault
s@AddTagsToVault' {} Text
a -> AddTagsToVault
s {$sel:accountId:AddTagsToVault' :: Text
accountId = Text
a} :: AddTagsToVault)
addTagsToVault_vaultName :: Lens.Lens' AddTagsToVault Prelude.Text
addTagsToVault_vaultName :: (Text -> f Text) -> AddTagsToVault -> f AddTagsToVault
addTagsToVault_vaultName = (AddTagsToVault -> Text)
-> (AddTagsToVault -> Text -> AddTagsToVault)
-> Lens AddTagsToVault AddTagsToVault Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddTagsToVault' {Text
vaultName :: Text
$sel:vaultName:AddTagsToVault' :: AddTagsToVault -> Text
vaultName} -> Text
vaultName) (\s :: AddTagsToVault
s@AddTagsToVault' {} Text
a -> AddTagsToVault
s {$sel:vaultName:AddTagsToVault' :: Text
vaultName = Text
a} :: AddTagsToVault)
instance Core.AWSRequest AddTagsToVault where
type
AWSResponse AddTagsToVault =
AddTagsToVaultResponse
request :: AddTagsToVault -> Request AddTagsToVault
request =
ByteString -> Request AddTagsToVault -> Request AddTagsToVault
forall a. ByteString -> Request a -> Request a
Request.glacierVersionHeader (Service -> ByteString
Core._serviceVersion Service
defaultService)
(Request AddTagsToVault -> Request AddTagsToVault)
-> (AddTagsToVault -> Request AddTagsToVault)
-> AddTagsToVault
-> Request AddTagsToVault
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> AddTagsToVault -> Request AddTagsToVault
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AddTagsToVault
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AddTagsToVault)))
response =
AWSResponse AddTagsToVault
-> Logger
-> Service
-> Proxy AddTagsToVault
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AddTagsToVault)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse AddTagsToVault
AddTagsToVaultResponse
AddTagsToVaultResponse'
instance Prelude.Hashable AddTagsToVault
instance Prelude.NFData AddTagsToVault
instance Core.ToHeaders AddTagsToVault where
toHeaders :: AddTagsToVault -> [Header]
toHeaders = [Header] -> AddTagsToVault -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON AddTagsToVault where
toJSON :: AddTagsToVault -> Value
toJSON AddTagsToVault' {Maybe (HashMap Text Text)
Text
vaultName :: Text
accountId :: Text
tags :: Maybe (HashMap Text Text)
$sel:vaultName:AddTagsToVault' :: AddTagsToVault -> Text
$sel:accountId:AddTagsToVault' :: AddTagsToVault -> Text
$sel:tags:AddTagsToVault' :: AddTagsToVault -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags]
)
instance Core.ToPath AddTagsToVault where
toPath :: AddTagsToVault -> ByteString
toPath AddTagsToVault' {Maybe (HashMap Text Text)
Text
vaultName :: Text
accountId :: Text
tags :: Maybe (HashMap Text Text)
$sel:vaultName:AddTagsToVault' :: AddTagsToVault -> Text
$sel:accountId:AddTagsToVault' :: AddTagsToVault -> Text
$sel:tags:AddTagsToVault' :: AddTagsToVault -> Maybe (HashMap Text 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
"/tags"
]
instance Core.ToQuery AddTagsToVault where
toQuery :: AddTagsToVault -> QueryString
toQuery =
QueryString -> AddTagsToVault -> QueryString
forall a b. a -> b -> a
Prelude.const ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"operation=add"])
data AddTagsToVaultResponse = AddTagsToVaultResponse'
{
}
deriving (AddTagsToVaultResponse -> AddTagsToVaultResponse -> Bool
(AddTagsToVaultResponse -> AddTagsToVaultResponse -> Bool)
-> (AddTagsToVaultResponse -> AddTagsToVaultResponse -> Bool)
-> Eq AddTagsToVaultResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddTagsToVaultResponse -> AddTagsToVaultResponse -> Bool
$c/= :: AddTagsToVaultResponse -> AddTagsToVaultResponse -> Bool
== :: AddTagsToVaultResponse -> AddTagsToVaultResponse -> Bool
$c== :: AddTagsToVaultResponse -> AddTagsToVaultResponse -> Bool
Prelude.Eq, ReadPrec [AddTagsToVaultResponse]
ReadPrec AddTagsToVaultResponse
Int -> ReadS AddTagsToVaultResponse
ReadS [AddTagsToVaultResponse]
(Int -> ReadS AddTagsToVaultResponse)
-> ReadS [AddTagsToVaultResponse]
-> ReadPrec AddTagsToVaultResponse
-> ReadPrec [AddTagsToVaultResponse]
-> Read AddTagsToVaultResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddTagsToVaultResponse]
$creadListPrec :: ReadPrec [AddTagsToVaultResponse]
readPrec :: ReadPrec AddTagsToVaultResponse
$creadPrec :: ReadPrec AddTagsToVaultResponse
readList :: ReadS [AddTagsToVaultResponse]
$creadList :: ReadS [AddTagsToVaultResponse]
readsPrec :: Int -> ReadS AddTagsToVaultResponse
$creadsPrec :: Int -> ReadS AddTagsToVaultResponse
Prelude.Read, Int -> AddTagsToVaultResponse -> ShowS
[AddTagsToVaultResponse] -> ShowS
AddTagsToVaultResponse -> String
(Int -> AddTagsToVaultResponse -> ShowS)
-> (AddTagsToVaultResponse -> String)
-> ([AddTagsToVaultResponse] -> ShowS)
-> Show AddTagsToVaultResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddTagsToVaultResponse] -> ShowS
$cshowList :: [AddTagsToVaultResponse] -> ShowS
show :: AddTagsToVaultResponse -> String
$cshow :: AddTagsToVaultResponse -> String
showsPrec :: Int -> AddTagsToVaultResponse -> ShowS
$cshowsPrec :: Int -> AddTagsToVaultResponse -> ShowS
Prelude.Show, (forall x. AddTagsToVaultResponse -> Rep AddTagsToVaultResponse x)
-> (forall x.
Rep AddTagsToVaultResponse x -> AddTagsToVaultResponse)
-> Generic AddTagsToVaultResponse
forall x. Rep AddTagsToVaultResponse x -> AddTagsToVaultResponse
forall x. AddTagsToVaultResponse -> Rep AddTagsToVaultResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddTagsToVaultResponse x -> AddTagsToVaultResponse
$cfrom :: forall x. AddTagsToVaultResponse -> Rep AddTagsToVaultResponse x
Prelude.Generic)
newAddTagsToVaultResponse ::
AddTagsToVaultResponse
newAddTagsToVaultResponse :: AddTagsToVaultResponse
newAddTagsToVaultResponse = AddTagsToVaultResponse
AddTagsToVaultResponse'
instance Prelude.NFData AddTagsToVaultResponse