{-# 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.CertificateManagerPCA.TagCertificateAuthority
(
TagCertificateAuthority (..),
newTagCertificateAuthority,
tagCertificateAuthority_certificateAuthorityArn,
tagCertificateAuthority_tags,
TagCertificateAuthorityResponse (..),
newTagCertificateAuthorityResponse,
)
where
import Amazonka.CertificateManagerPCA.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 TagCertificateAuthority = TagCertificateAuthority'
{
TagCertificateAuthority -> Text
certificateAuthorityArn :: Prelude.Text,
TagCertificateAuthority -> NonEmpty Tag
tags :: Prelude.NonEmpty Tag
}
deriving (TagCertificateAuthority -> TagCertificateAuthority -> Bool
(TagCertificateAuthority -> TagCertificateAuthority -> Bool)
-> (TagCertificateAuthority -> TagCertificateAuthority -> Bool)
-> Eq TagCertificateAuthority
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TagCertificateAuthority -> TagCertificateAuthority -> Bool
$c/= :: TagCertificateAuthority -> TagCertificateAuthority -> Bool
== :: TagCertificateAuthority -> TagCertificateAuthority -> Bool
$c== :: TagCertificateAuthority -> TagCertificateAuthority -> Bool
Prelude.Eq, ReadPrec [TagCertificateAuthority]
ReadPrec TagCertificateAuthority
Int -> ReadS TagCertificateAuthority
ReadS [TagCertificateAuthority]
(Int -> ReadS TagCertificateAuthority)
-> ReadS [TagCertificateAuthority]
-> ReadPrec TagCertificateAuthority
-> ReadPrec [TagCertificateAuthority]
-> Read TagCertificateAuthority
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TagCertificateAuthority]
$creadListPrec :: ReadPrec [TagCertificateAuthority]
readPrec :: ReadPrec TagCertificateAuthority
$creadPrec :: ReadPrec TagCertificateAuthority
readList :: ReadS [TagCertificateAuthority]
$creadList :: ReadS [TagCertificateAuthority]
readsPrec :: Int -> ReadS TagCertificateAuthority
$creadsPrec :: Int -> ReadS TagCertificateAuthority
Prelude.Read, Int -> TagCertificateAuthority -> ShowS
[TagCertificateAuthority] -> ShowS
TagCertificateAuthority -> String
(Int -> TagCertificateAuthority -> ShowS)
-> (TagCertificateAuthority -> String)
-> ([TagCertificateAuthority] -> ShowS)
-> Show TagCertificateAuthority
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TagCertificateAuthority] -> ShowS
$cshowList :: [TagCertificateAuthority] -> ShowS
show :: TagCertificateAuthority -> String
$cshow :: TagCertificateAuthority -> String
showsPrec :: Int -> TagCertificateAuthority -> ShowS
$cshowsPrec :: Int -> TagCertificateAuthority -> ShowS
Prelude.Show, (forall x.
TagCertificateAuthority -> Rep TagCertificateAuthority x)
-> (forall x.
Rep TagCertificateAuthority x -> TagCertificateAuthority)
-> Generic TagCertificateAuthority
forall x. Rep TagCertificateAuthority x -> TagCertificateAuthority
forall x. TagCertificateAuthority -> Rep TagCertificateAuthority x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TagCertificateAuthority x -> TagCertificateAuthority
$cfrom :: forall x. TagCertificateAuthority -> Rep TagCertificateAuthority x
Prelude.Generic)
newTagCertificateAuthority ::
Prelude.Text ->
Prelude.NonEmpty Tag ->
TagCertificateAuthority
newTagCertificateAuthority :: Text -> NonEmpty Tag -> TagCertificateAuthority
newTagCertificateAuthority
Text
pCertificateAuthorityArn_
NonEmpty Tag
pTags_ =
TagCertificateAuthority' :: Text -> NonEmpty Tag -> TagCertificateAuthority
TagCertificateAuthority'
{ $sel:certificateAuthorityArn:TagCertificateAuthority' :: Text
certificateAuthorityArn =
Text
pCertificateAuthorityArn_,
$sel:tags:TagCertificateAuthority' :: 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_
}
tagCertificateAuthority_certificateAuthorityArn :: Lens.Lens' TagCertificateAuthority Prelude.Text
tagCertificateAuthority_certificateAuthorityArn :: (Text -> f Text)
-> TagCertificateAuthority -> f TagCertificateAuthority
tagCertificateAuthority_certificateAuthorityArn = (TagCertificateAuthority -> Text)
-> (TagCertificateAuthority -> Text -> TagCertificateAuthority)
-> Lens TagCertificateAuthority TagCertificateAuthority Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagCertificateAuthority' {Text
certificateAuthorityArn :: Text
$sel:certificateAuthorityArn:TagCertificateAuthority' :: TagCertificateAuthority -> Text
certificateAuthorityArn} -> Text
certificateAuthorityArn) (\s :: TagCertificateAuthority
s@TagCertificateAuthority' {} Text
a -> TagCertificateAuthority
s {$sel:certificateAuthorityArn:TagCertificateAuthority' :: Text
certificateAuthorityArn = Text
a} :: TagCertificateAuthority)
tagCertificateAuthority_tags :: Lens.Lens' TagCertificateAuthority (Prelude.NonEmpty Tag)
tagCertificateAuthority_tags :: (NonEmpty Tag -> f (NonEmpty Tag))
-> TagCertificateAuthority -> f TagCertificateAuthority
tagCertificateAuthority_tags = (TagCertificateAuthority -> NonEmpty Tag)
-> (TagCertificateAuthority
-> NonEmpty Tag -> TagCertificateAuthority)
-> Lens
TagCertificateAuthority
TagCertificateAuthority
(NonEmpty Tag)
(NonEmpty Tag)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagCertificateAuthority' {NonEmpty Tag
tags :: NonEmpty Tag
$sel:tags:TagCertificateAuthority' :: TagCertificateAuthority -> NonEmpty Tag
tags} -> NonEmpty Tag
tags) (\s :: TagCertificateAuthority
s@TagCertificateAuthority' {} NonEmpty Tag
a -> TagCertificateAuthority
s {$sel:tags:TagCertificateAuthority' :: NonEmpty Tag
tags = NonEmpty Tag
a} :: TagCertificateAuthority) ((NonEmpty Tag -> f (NonEmpty Tag))
-> TagCertificateAuthority -> f TagCertificateAuthority)
-> ((NonEmpty Tag -> f (NonEmpty Tag))
-> NonEmpty Tag -> f (NonEmpty Tag))
-> (NonEmpty Tag -> f (NonEmpty Tag))
-> TagCertificateAuthority
-> f TagCertificateAuthority
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 TagCertificateAuthority where
type
AWSResponse TagCertificateAuthority =
TagCertificateAuthorityResponse
request :: TagCertificateAuthority -> Request TagCertificateAuthority
request = Service
-> TagCertificateAuthority -> Request TagCertificateAuthority
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy TagCertificateAuthority
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse TagCertificateAuthority)))
response =
AWSResponse TagCertificateAuthority
-> Logger
-> Service
-> Proxy TagCertificateAuthority
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse TagCertificateAuthority)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse TagCertificateAuthority
TagCertificateAuthorityResponse
TagCertificateAuthorityResponse'
instance Prelude.Hashable TagCertificateAuthority
instance Prelude.NFData TagCertificateAuthority
instance Core.ToHeaders TagCertificateAuthority where
toHeaders :: TagCertificateAuthority -> [Header]
toHeaders =
[Header] -> TagCertificateAuthority -> [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
"ACMPrivateCA.TagCertificateAuthority" ::
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 TagCertificateAuthority where
toJSON :: TagCertificateAuthority -> Value
toJSON TagCertificateAuthority' {NonEmpty Tag
Text
tags :: NonEmpty Tag
certificateAuthorityArn :: Text
$sel:tags:TagCertificateAuthority' :: TagCertificateAuthority -> NonEmpty Tag
$sel:certificateAuthorityArn:TagCertificateAuthority' :: TagCertificateAuthority -> 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
"CertificateAuthorityArn"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
certificateAuthorityArn
),
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 TagCertificateAuthority where
toPath :: TagCertificateAuthority -> ByteString
toPath = ByteString -> TagCertificateAuthority -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery TagCertificateAuthority where
toQuery :: TagCertificateAuthority -> QueryString
toQuery = QueryString -> TagCertificateAuthority -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data TagCertificateAuthorityResponse = TagCertificateAuthorityResponse'
{
}
deriving (TagCertificateAuthorityResponse
-> TagCertificateAuthorityResponse -> Bool
(TagCertificateAuthorityResponse
-> TagCertificateAuthorityResponse -> Bool)
-> (TagCertificateAuthorityResponse
-> TagCertificateAuthorityResponse -> Bool)
-> Eq TagCertificateAuthorityResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TagCertificateAuthorityResponse
-> TagCertificateAuthorityResponse -> Bool
$c/= :: TagCertificateAuthorityResponse
-> TagCertificateAuthorityResponse -> Bool
== :: TagCertificateAuthorityResponse
-> TagCertificateAuthorityResponse -> Bool
$c== :: TagCertificateAuthorityResponse
-> TagCertificateAuthorityResponse -> Bool
Prelude.Eq, ReadPrec [TagCertificateAuthorityResponse]
ReadPrec TagCertificateAuthorityResponse
Int -> ReadS TagCertificateAuthorityResponse
ReadS [TagCertificateAuthorityResponse]
(Int -> ReadS TagCertificateAuthorityResponse)
-> ReadS [TagCertificateAuthorityResponse]
-> ReadPrec TagCertificateAuthorityResponse
-> ReadPrec [TagCertificateAuthorityResponse]
-> Read TagCertificateAuthorityResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TagCertificateAuthorityResponse]
$creadListPrec :: ReadPrec [TagCertificateAuthorityResponse]
readPrec :: ReadPrec TagCertificateAuthorityResponse
$creadPrec :: ReadPrec TagCertificateAuthorityResponse
readList :: ReadS [TagCertificateAuthorityResponse]
$creadList :: ReadS [TagCertificateAuthorityResponse]
readsPrec :: Int -> ReadS TagCertificateAuthorityResponse
$creadsPrec :: Int -> ReadS TagCertificateAuthorityResponse
Prelude.Read, Int -> TagCertificateAuthorityResponse -> ShowS
[TagCertificateAuthorityResponse] -> ShowS
TagCertificateAuthorityResponse -> String
(Int -> TagCertificateAuthorityResponse -> ShowS)
-> (TagCertificateAuthorityResponse -> String)
-> ([TagCertificateAuthorityResponse] -> ShowS)
-> Show TagCertificateAuthorityResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TagCertificateAuthorityResponse] -> ShowS
$cshowList :: [TagCertificateAuthorityResponse] -> ShowS
show :: TagCertificateAuthorityResponse -> String
$cshow :: TagCertificateAuthorityResponse -> String
showsPrec :: Int -> TagCertificateAuthorityResponse -> ShowS
$cshowsPrec :: Int -> TagCertificateAuthorityResponse -> ShowS
Prelude.Show, (forall x.
TagCertificateAuthorityResponse
-> Rep TagCertificateAuthorityResponse x)
-> (forall x.
Rep TagCertificateAuthorityResponse x
-> TagCertificateAuthorityResponse)
-> Generic TagCertificateAuthorityResponse
forall x.
Rep TagCertificateAuthorityResponse x
-> TagCertificateAuthorityResponse
forall x.
TagCertificateAuthorityResponse
-> Rep TagCertificateAuthorityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TagCertificateAuthorityResponse x
-> TagCertificateAuthorityResponse
$cfrom :: forall x.
TagCertificateAuthorityResponse
-> Rep TagCertificateAuthorityResponse x
Prelude.Generic)
newTagCertificateAuthorityResponse ::
TagCertificateAuthorityResponse
newTagCertificateAuthorityResponse :: TagCertificateAuthorityResponse
newTagCertificateAuthorityResponse =
TagCertificateAuthorityResponse
TagCertificateAuthorityResponse'
instance
Prelude.NFData
TagCertificateAuthorityResponse