{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:certificateAuthorityArn:TagCertificateAuthority' :: Text
certificateAuthorityArn =
Text
pCertificateAuthorityArn_,
$sel:tags:TagCertificateAuthority' :: NonEmpty Tag
tags = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Tag
pTags_
}
tagCertificateAuthority_certificateAuthorityArn :: Lens.Lens' TagCertificateAuthority Prelude.Text
tagCertificateAuthority_certificateAuthorityArn :: Lens' TagCertificateAuthority Text
tagCertificateAuthority_certificateAuthorityArn = 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 :: Lens' TagCertificateAuthority (NonEmpty Tag)
tagCertificateAuthority_tags = 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) 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 TagCertificateAuthority where
type
AWSResponse TagCertificateAuthority =
TagCertificateAuthorityResponse
request :: (Service -> Service)
-> TagCertificateAuthority -> Request TagCertificateAuthority
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy TagCertificateAuthority
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse TagCertificateAuthority)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
TagCertificateAuthorityResponse
TagCertificateAuthorityResponse'
instance Prelude.Hashable TagCertificateAuthority where
hashWithSalt :: Int -> TagCertificateAuthority -> Int
hashWithSalt Int
_salt TagCertificateAuthority' {NonEmpty Tag
Text
tags :: NonEmpty Tag
certificateAuthorityArn :: Text
$sel:tags:TagCertificateAuthority' :: TagCertificateAuthority -> NonEmpty Tag
$sel:certificateAuthorityArn:TagCertificateAuthority' :: TagCertificateAuthority -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
certificateAuthorityArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Tag
tags
instance Prelude.NFData TagCertificateAuthority where
rnf :: TagCertificateAuthority -> ()
rnf TagCertificateAuthority' {NonEmpty Tag
Text
tags :: NonEmpty Tag
certificateAuthorityArn :: Text
$sel:tags:TagCertificateAuthority' :: TagCertificateAuthority -> NonEmpty Tag
$sel:certificateAuthorityArn:TagCertificateAuthority' :: TagCertificateAuthority -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
certificateAuthorityArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Tag
tags
instance Data.ToHeaders TagCertificateAuthority where
toHeaders :: TagCertificateAuthority -> [Header]
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"ACMPrivateCA.TagCertificateAuthority" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"CertificateAuthorityArn"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
certificateAuthorityArn
),
forall a. a -> Maybe a
Prelude.Just (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Tag
tags)
]
)
instance Data.ToPath TagCertificateAuthority where
toPath :: TagCertificateAuthority -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery TagCertificateAuthority where
toQuery :: TagCertificateAuthority -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data TagCertificateAuthorityResponse = TagCertificateAuthorityResponse'
{
}
deriving (TagCertificateAuthorityResponse
-> TagCertificateAuthorityResponse -> Bool
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]
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
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.
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
where
rnf :: TagCertificateAuthorityResponse -> ()
rnf TagCertificateAuthorityResponse
_ = ()