{-# 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.CertificateManager.AddTagsToCertificate
(
AddTagsToCertificate (..),
newAddTagsToCertificate,
addTagsToCertificate_certificateArn,
addTagsToCertificate_tags,
AddTagsToCertificateResponse (..),
newAddTagsToCertificateResponse,
)
where
import Amazonka.CertificateManager.Types
import qualified Amazonka.Core as Core
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 AddTagsToCertificate = AddTagsToCertificate'
{
AddTagsToCertificate -> Text
certificateArn :: Prelude.Text,
AddTagsToCertificate -> NonEmpty Tag
tags :: Prelude.NonEmpty Tag
}
deriving (AddTagsToCertificate -> AddTagsToCertificate -> Bool
(AddTagsToCertificate -> AddTagsToCertificate -> Bool)
-> (AddTagsToCertificate -> AddTagsToCertificate -> Bool)
-> Eq AddTagsToCertificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddTagsToCertificate -> AddTagsToCertificate -> Bool
$c/= :: AddTagsToCertificate -> AddTagsToCertificate -> Bool
== :: AddTagsToCertificate -> AddTagsToCertificate -> Bool
$c== :: AddTagsToCertificate -> AddTagsToCertificate -> Bool
Prelude.Eq, ReadPrec [AddTagsToCertificate]
ReadPrec AddTagsToCertificate
Int -> ReadS AddTagsToCertificate
ReadS [AddTagsToCertificate]
(Int -> ReadS AddTagsToCertificate)
-> ReadS [AddTagsToCertificate]
-> ReadPrec AddTagsToCertificate
-> ReadPrec [AddTagsToCertificate]
-> Read AddTagsToCertificate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddTagsToCertificate]
$creadListPrec :: ReadPrec [AddTagsToCertificate]
readPrec :: ReadPrec AddTagsToCertificate
$creadPrec :: ReadPrec AddTagsToCertificate
readList :: ReadS [AddTagsToCertificate]
$creadList :: ReadS [AddTagsToCertificate]
readsPrec :: Int -> ReadS AddTagsToCertificate
$creadsPrec :: Int -> ReadS AddTagsToCertificate
Prelude.Read, Int -> AddTagsToCertificate -> ShowS
[AddTagsToCertificate] -> ShowS
AddTagsToCertificate -> String
(Int -> AddTagsToCertificate -> ShowS)
-> (AddTagsToCertificate -> String)
-> ([AddTagsToCertificate] -> ShowS)
-> Show AddTagsToCertificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddTagsToCertificate] -> ShowS
$cshowList :: [AddTagsToCertificate] -> ShowS
show :: AddTagsToCertificate -> String
$cshow :: AddTagsToCertificate -> String
showsPrec :: Int -> AddTagsToCertificate -> ShowS
$cshowsPrec :: Int -> AddTagsToCertificate -> ShowS
Prelude.Show, (forall x. AddTagsToCertificate -> Rep AddTagsToCertificate x)
-> (forall x. Rep AddTagsToCertificate x -> AddTagsToCertificate)
-> Generic AddTagsToCertificate
forall x. Rep AddTagsToCertificate x -> AddTagsToCertificate
forall x. AddTagsToCertificate -> Rep AddTagsToCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddTagsToCertificate x -> AddTagsToCertificate
$cfrom :: forall x. AddTagsToCertificate -> Rep AddTagsToCertificate x
Prelude.Generic)
newAddTagsToCertificate ::
Prelude.Text ->
Prelude.NonEmpty Tag ->
AddTagsToCertificate
newAddTagsToCertificate :: Text -> NonEmpty Tag -> AddTagsToCertificate
newAddTagsToCertificate Text
pCertificateArn_ NonEmpty Tag
pTags_ =
AddTagsToCertificate' :: Text -> NonEmpty Tag -> AddTagsToCertificate
AddTagsToCertificate'
{ $sel:certificateArn:AddTagsToCertificate' :: Text
certificateArn =
Text
pCertificateArn_,
$sel:tags:AddTagsToCertificate' :: NonEmpty Tag
tags = Tagged (NonEmpty Tag) (Identity (NonEmpty Tag))
-> Tagged (NonEmpty Tag) (Identity (NonEmpty Tag))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Tag) (Identity (NonEmpty Tag))
-> Tagged (NonEmpty Tag) (Identity (NonEmpty Tag)))
-> NonEmpty Tag -> NonEmpty Tag
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Tag
pTags_
}
addTagsToCertificate_certificateArn :: Lens.Lens' AddTagsToCertificate Prelude.Text
addTagsToCertificate_certificateArn :: (Text -> f Text) -> AddTagsToCertificate -> f AddTagsToCertificate
addTagsToCertificate_certificateArn = (AddTagsToCertificate -> Text)
-> (AddTagsToCertificate -> Text -> AddTagsToCertificate)
-> Lens AddTagsToCertificate AddTagsToCertificate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddTagsToCertificate' {Text
certificateArn :: Text
$sel:certificateArn:AddTagsToCertificate' :: AddTagsToCertificate -> Text
certificateArn} -> Text
certificateArn) (\s :: AddTagsToCertificate
s@AddTagsToCertificate' {} Text
a -> AddTagsToCertificate
s {$sel:certificateArn:AddTagsToCertificate' :: Text
certificateArn = Text
a} :: AddTagsToCertificate)
addTagsToCertificate_tags :: Lens.Lens' AddTagsToCertificate (Prelude.NonEmpty Tag)
addTagsToCertificate_tags :: (NonEmpty Tag -> f (NonEmpty Tag))
-> AddTagsToCertificate -> f AddTagsToCertificate
addTagsToCertificate_tags = (AddTagsToCertificate -> NonEmpty Tag)
-> (AddTagsToCertificate -> NonEmpty Tag -> AddTagsToCertificate)
-> Lens
AddTagsToCertificate
AddTagsToCertificate
(NonEmpty Tag)
(NonEmpty Tag)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddTagsToCertificate' {NonEmpty Tag
tags :: NonEmpty Tag
$sel:tags:AddTagsToCertificate' :: AddTagsToCertificate -> NonEmpty Tag
tags} -> NonEmpty Tag
tags) (\s :: AddTagsToCertificate
s@AddTagsToCertificate' {} NonEmpty Tag
a -> AddTagsToCertificate
s {$sel:tags:AddTagsToCertificate' :: NonEmpty Tag
tags = NonEmpty Tag
a} :: AddTagsToCertificate) ((NonEmpty Tag -> f (NonEmpty Tag))
-> AddTagsToCertificate -> f AddTagsToCertificate)
-> ((NonEmpty Tag -> f (NonEmpty Tag))
-> NonEmpty Tag -> f (NonEmpty Tag))
-> (NonEmpty Tag -> f (NonEmpty Tag))
-> AddTagsToCertificate
-> f AddTagsToCertificate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Tag -> f (NonEmpty Tag))
-> NonEmpty Tag -> f (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest AddTagsToCertificate where
type
AWSResponse AddTagsToCertificate =
AddTagsToCertificateResponse
request :: AddTagsToCertificate -> Request AddTagsToCertificate
request = Service -> AddTagsToCertificate -> Request AddTagsToCertificate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AddTagsToCertificate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AddTagsToCertificate)))
response =
AWSResponse AddTagsToCertificate
-> Logger
-> Service
-> Proxy AddTagsToCertificate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AddTagsToCertificate)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse AddTagsToCertificate
AddTagsToCertificateResponse
AddTagsToCertificateResponse'
instance Prelude.Hashable AddTagsToCertificate
instance Prelude.NFData AddTagsToCertificate
instance Core.ToHeaders AddTagsToCertificate where
toHeaders :: AddTagsToCertificate -> [Header]
toHeaders =
[Header] -> AddTagsToCertificate -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"CertificateManager.AddTagsToCertificate" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON AddTagsToCertificate where
toJSON :: AddTagsToCertificate -> Value
toJSON AddTagsToCertificate' {NonEmpty Tag
Text
tags :: NonEmpty Tag
certificateArn :: Text
$sel:tags:AddTagsToCertificate' :: AddTagsToCertificate -> NonEmpty Tag
$sel:certificateArn:AddTagsToCertificate' :: AddTagsToCertificate -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"CertificateArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
certificateArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Tag
tags)
]
)
instance Core.ToPath AddTagsToCertificate where
toPath :: AddTagsToCertificate -> ByteString
toPath = ByteString -> AddTagsToCertificate -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AddTagsToCertificate where
toQuery :: AddTagsToCertificate -> QueryString
toQuery = QueryString -> AddTagsToCertificate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AddTagsToCertificateResponse = AddTagsToCertificateResponse'
{
}
deriving (AddTagsToCertificateResponse
-> AddTagsToCertificateResponse -> Bool
(AddTagsToCertificateResponse
-> AddTagsToCertificateResponse -> Bool)
-> (AddTagsToCertificateResponse
-> AddTagsToCertificateResponse -> Bool)
-> Eq AddTagsToCertificateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddTagsToCertificateResponse
-> AddTagsToCertificateResponse -> Bool
$c/= :: AddTagsToCertificateResponse
-> AddTagsToCertificateResponse -> Bool
== :: AddTagsToCertificateResponse
-> AddTagsToCertificateResponse -> Bool
$c== :: AddTagsToCertificateResponse
-> AddTagsToCertificateResponse -> Bool
Prelude.Eq, ReadPrec [AddTagsToCertificateResponse]
ReadPrec AddTagsToCertificateResponse
Int -> ReadS AddTagsToCertificateResponse
ReadS [AddTagsToCertificateResponse]
(Int -> ReadS AddTagsToCertificateResponse)
-> ReadS [AddTagsToCertificateResponse]
-> ReadPrec AddTagsToCertificateResponse
-> ReadPrec [AddTagsToCertificateResponse]
-> Read AddTagsToCertificateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddTagsToCertificateResponse]
$creadListPrec :: ReadPrec [AddTagsToCertificateResponse]
readPrec :: ReadPrec AddTagsToCertificateResponse
$creadPrec :: ReadPrec AddTagsToCertificateResponse
readList :: ReadS [AddTagsToCertificateResponse]
$creadList :: ReadS [AddTagsToCertificateResponse]
readsPrec :: Int -> ReadS AddTagsToCertificateResponse
$creadsPrec :: Int -> ReadS AddTagsToCertificateResponse
Prelude.Read, Int -> AddTagsToCertificateResponse -> ShowS
[AddTagsToCertificateResponse] -> ShowS
AddTagsToCertificateResponse -> String
(Int -> AddTagsToCertificateResponse -> ShowS)
-> (AddTagsToCertificateResponse -> String)
-> ([AddTagsToCertificateResponse] -> ShowS)
-> Show AddTagsToCertificateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddTagsToCertificateResponse] -> ShowS
$cshowList :: [AddTagsToCertificateResponse] -> ShowS
show :: AddTagsToCertificateResponse -> String
$cshow :: AddTagsToCertificateResponse -> String
showsPrec :: Int -> AddTagsToCertificateResponse -> ShowS
$cshowsPrec :: Int -> AddTagsToCertificateResponse -> ShowS
Prelude.Show, (forall x.
AddTagsToCertificateResponse -> Rep AddTagsToCertificateResponse x)
-> (forall x.
Rep AddTagsToCertificateResponse x -> AddTagsToCertificateResponse)
-> Generic AddTagsToCertificateResponse
forall x.
Rep AddTagsToCertificateResponse x -> AddTagsToCertificateResponse
forall x.
AddTagsToCertificateResponse -> Rep AddTagsToCertificateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AddTagsToCertificateResponse x -> AddTagsToCertificateResponse
$cfrom :: forall x.
AddTagsToCertificateResponse -> Rep AddTagsToCertificateResponse x
Prelude.Generic)
newAddTagsToCertificateResponse ::
AddTagsToCertificateResponse
newAddTagsToCertificateResponse :: AddTagsToCertificateResponse
newAddTagsToCertificateResponse =
AddTagsToCertificateResponse
AddTagsToCertificateResponse'
instance Prelude.NFData AddTagsToCertificateResponse