{-# 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.DocumentDB.AddTagsToResource
(
AddTagsToResource (..),
newAddTagsToResource,
addTagsToResource_resourceName,
addTagsToResource_tags,
AddTagsToResourceResponse (..),
newAddTagsToResourceResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DocumentDB.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AddTagsToResource = AddTagsToResource'
{
AddTagsToResource -> Text
resourceName :: Prelude.Text,
AddTagsToResource -> [Tag]
tags :: [Tag]
}
deriving (AddTagsToResource -> AddTagsToResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddTagsToResource -> AddTagsToResource -> Bool
$c/= :: AddTagsToResource -> AddTagsToResource -> Bool
== :: AddTagsToResource -> AddTagsToResource -> Bool
$c== :: AddTagsToResource -> AddTagsToResource -> Bool
Prelude.Eq, ReadPrec [AddTagsToResource]
ReadPrec AddTagsToResource
Int -> ReadS AddTagsToResource
ReadS [AddTagsToResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddTagsToResource]
$creadListPrec :: ReadPrec [AddTagsToResource]
readPrec :: ReadPrec AddTagsToResource
$creadPrec :: ReadPrec AddTagsToResource
readList :: ReadS [AddTagsToResource]
$creadList :: ReadS [AddTagsToResource]
readsPrec :: Int -> ReadS AddTagsToResource
$creadsPrec :: Int -> ReadS AddTagsToResource
Prelude.Read, Int -> AddTagsToResource -> ShowS
[AddTagsToResource] -> ShowS
AddTagsToResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddTagsToResource] -> ShowS
$cshowList :: [AddTagsToResource] -> ShowS
show :: AddTagsToResource -> String
$cshow :: AddTagsToResource -> String
showsPrec :: Int -> AddTagsToResource -> ShowS
$cshowsPrec :: Int -> AddTagsToResource -> ShowS
Prelude.Show, forall x. Rep AddTagsToResource x -> AddTagsToResource
forall x. AddTagsToResource -> Rep AddTagsToResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddTagsToResource x -> AddTagsToResource
$cfrom :: forall x. AddTagsToResource -> Rep AddTagsToResource x
Prelude.Generic)
newAddTagsToResource ::
Prelude.Text ->
AddTagsToResource
newAddTagsToResource :: Text -> AddTagsToResource
newAddTagsToResource Text
pResourceName_ =
AddTagsToResource'
{ $sel:resourceName:AddTagsToResource' :: Text
resourceName = Text
pResourceName_,
$sel:tags:AddTagsToResource' :: [Tag]
tags = forall a. Monoid a => a
Prelude.mempty
}
addTagsToResource_resourceName :: Lens.Lens' AddTagsToResource Prelude.Text
addTagsToResource_resourceName :: Lens' AddTagsToResource Text
addTagsToResource_resourceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddTagsToResource' {Text
resourceName :: Text
$sel:resourceName:AddTagsToResource' :: AddTagsToResource -> Text
resourceName} -> Text
resourceName) (\s :: AddTagsToResource
s@AddTagsToResource' {} Text
a -> AddTagsToResource
s {$sel:resourceName:AddTagsToResource' :: Text
resourceName = Text
a} :: AddTagsToResource)
addTagsToResource_tags :: Lens.Lens' AddTagsToResource [Tag]
addTagsToResource_tags :: Lens' AddTagsToResource [Tag]
addTagsToResource_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddTagsToResource' {[Tag]
tags :: [Tag]
$sel:tags:AddTagsToResource' :: AddTagsToResource -> [Tag]
tags} -> [Tag]
tags) (\s :: AddTagsToResource
s@AddTagsToResource' {} [Tag]
a -> AddTagsToResource
s {$sel:tags:AddTagsToResource' :: [Tag]
tags = [Tag]
a} :: AddTagsToResource) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest AddTagsToResource where
type
AWSResponse AddTagsToResource =
AddTagsToResourceResponse
request :: (Service -> Service)
-> AddTagsToResource -> Request AddTagsToResource
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy AddTagsToResource
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AddTagsToResource)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AddTagsToResourceResponse
AddTagsToResourceResponse'
instance Prelude.Hashable AddTagsToResource where
hashWithSalt :: Int -> AddTagsToResource -> Int
hashWithSalt Int
_salt AddTagsToResource' {[Tag]
Text
tags :: [Tag]
resourceName :: Text
$sel:tags:AddTagsToResource' :: AddTagsToResource -> [Tag]
$sel:resourceName:AddTagsToResource' :: AddTagsToResource -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Tag]
tags
instance Prelude.NFData AddTagsToResource where
rnf :: AddTagsToResource -> ()
rnf AddTagsToResource' {[Tag]
Text
tags :: [Tag]
resourceName :: Text
$sel:tags:AddTagsToResource' :: AddTagsToResource -> [Tag]
$sel:resourceName:AddTagsToResource' :: AddTagsToResource -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
resourceName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Tag]
tags
instance Data.ToHeaders AddTagsToResource where
toHeaders :: AddTagsToResource -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath AddTagsToResource where
toPath :: AddTagsToResource -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery AddTagsToResource where
toQuery :: AddTagsToResource -> QueryString
toQuery AddTagsToResource' {[Tag]
Text
tags :: [Tag]
resourceName :: Text
$sel:tags:AddTagsToResource' :: AddTagsToResource -> [Tag]
$sel:resourceName:AddTagsToResource' :: AddTagsToResource -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"AddTagsToResource" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
ByteString
"ResourceName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
resourceName,
ByteString
"Tags" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Tag" [Tag]
tags
]
data AddTagsToResourceResponse = AddTagsToResourceResponse'
{
}
deriving (AddTagsToResourceResponse -> AddTagsToResourceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddTagsToResourceResponse -> AddTagsToResourceResponse -> Bool
$c/= :: AddTagsToResourceResponse -> AddTagsToResourceResponse -> Bool
== :: AddTagsToResourceResponse -> AddTagsToResourceResponse -> Bool
$c== :: AddTagsToResourceResponse -> AddTagsToResourceResponse -> Bool
Prelude.Eq, ReadPrec [AddTagsToResourceResponse]
ReadPrec AddTagsToResourceResponse
Int -> ReadS AddTagsToResourceResponse
ReadS [AddTagsToResourceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddTagsToResourceResponse]
$creadListPrec :: ReadPrec [AddTagsToResourceResponse]
readPrec :: ReadPrec AddTagsToResourceResponse
$creadPrec :: ReadPrec AddTagsToResourceResponse
readList :: ReadS [AddTagsToResourceResponse]
$creadList :: ReadS [AddTagsToResourceResponse]
readsPrec :: Int -> ReadS AddTagsToResourceResponse
$creadsPrec :: Int -> ReadS AddTagsToResourceResponse
Prelude.Read, Int -> AddTagsToResourceResponse -> ShowS
[AddTagsToResourceResponse] -> ShowS
AddTagsToResourceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddTagsToResourceResponse] -> ShowS
$cshowList :: [AddTagsToResourceResponse] -> ShowS
show :: AddTagsToResourceResponse -> String
$cshow :: AddTagsToResourceResponse -> String
showsPrec :: Int -> AddTagsToResourceResponse -> ShowS
$cshowsPrec :: Int -> AddTagsToResourceResponse -> ShowS
Prelude.Show, forall x.
Rep AddTagsToResourceResponse x -> AddTagsToResourceResponse
forall x.
AddTagsToResourceResponse -> Rep AddTagsToResourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AddTagsToResourceResponse x -> AddTagsToResourceResponse
$cfrom :: forall x.
AddTagsToResourceResponse -> Rep AddTagsToResourceResponse x
Prelude.Generic)
newAddTagsToResourceResponse ::
AddTagsToResourceResponse
newAddTagsToResourceResponse :: AddTagsToResourceResponse
newAddTagsToResourceResponse =
AddTagsToResourceResponse
AddTagsToResourceResponse'
instance Prelude.NFData AddTagsToResourceResponse where
rnf :: AddTagsToResourceResponse -> ()
rnf AddTagsToResourceResponse
_ = ()