{-# 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.RequestCertificate
(
RequestCertificate (..),
newRequestCertificate,
requestCertificate_idempotencyToken,
requestCertificate_validationMethod,
requestCertificate_subjectAlternativeNames,
requestCertificate_options,
requestCertificate_domainValidationOptions,
requestCertificate_certificateAuthorityArn,
requestCertificate_tags,
requestCertificate_domainName,
RequestCertificateResponse (..),
newRequestCertificateResponse,
requestCertificateResponse_certificateArn,
requestCertificateResponse_httpStatus,
)
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 RequestCertificate = RequestCertificate'
{
RequestCertificate -> Maybe Text
idempotencyToken :: Prelude.Maybe Prelude.Text,
RequestCertificate -> Maybe ValidationMethod
validationMethod :: Prelude.Maybe ValidationMethod,
RequestCertificate -> Maybe (NonEmpty Text)
subjectAlternativeNames :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
RequestCertificate -> Maybe CertificateOptions
options :: Prelude.Maybe CertificateOptions,
RequestCertificate -> Maybe (NonEmpty DomainValidationOption)
domainValidationOptions :: Prelude.Maybe (Prelude.NonEmpty DomainValidationOption),
RequestCertificate -> Maybe Text
certificateAuthorityArn :: Prelude.Maybe Prelude.Text,
RequestCertificate -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
RequestCertificate -> Text
domainName :: Prelude.Text
}
deriving (RequestCertificate -> RequestCertificate -> Bool
(RequestCertificate -> RequestCertificate -> Bool)
-> (RequestCertificate -> RequestCertificate -> Bool)
-> Eq RequestCertificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RequestCertificate -> RequestCertificate -> Bool
$c/= :: RequestCertificate -> RequestCertificate -> Bool
== :: RequestCertificate -> RequestCertificate -> Bool
$c== :: RequestCertificate -> RequestCertificate -> Bool
Prelude.Eq, ReadPrec [RequestCertificate]
ReadPrec RequestCertificate
Int -> ReadS RequestCertificate
ReadS [RequestCertificate]
(Int -> ReadS RequestCertificate)
-> ReadS [RequestCertificate]
-> ReadPrec RequestCertificate
-> ReadPrec [RequestCertificate]
-> Read RequestCertificate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RequestCertificate]
$creadListPrec :: ReadPrec [RequestCertificate]
readPrec :: ReadPrec RequestCertificate
$creadPrec :: ReadPrec RequestCertificate
readList :: ReadS [RequestCertificate]
$creadList :: ReadS [RequestCertificate]
readsPrec :: Int -> ReadS RequestCertificate
$creadsPrec :: Int -> ReadS RequestCertificate
Prelude.Read, Int -> RequestCertificate -> ShowS
[RequestCertificate] -> ShowS
RequestCertificate -> String
(Int -> RequestCertificate -> ShowS)
-> (RequestCertificate -> String)
-> ([RequestCertificate] -> ShowS)
-> Show RequestCertificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RequestCertificate] -> ShowS
$cshowList :: [RequestCertificate] -> ShowS
show :: RequestCertificate -> String
$cshow :: RequestCertificate -> String
showsPrec :: Int -> RequestCertificate -> ShowS
$cshowsPrec :: Int -> RequestCertificate -> ShowS
Prelude.Show, (forall x. RequestCertificate -> Rep RequestCertificate x)
-> (forall x. Rep RequestCertificate x -> RequestCertificate)
-> Generic RequestCertificate
forall x. Rep RequestCertificate x -> RequestCertificate
forall x. RequestCertificate -> Rep RequestCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RequestCertificate x -> RequestCertificate
$cfrom :: forall x. RequestCertificate -> Rep RequestCertificate x
Prelude.Generic)
newRequestCertificate ::
Prelude.Text ->
RequestCertificate
newRequestCertificate :: Text -> RequestCertificate
newRequestCertificate Text
pDomainName_ =
RequestCertificate' :: Maybe Text
-> Maybe ValidationMethod
-> Maybe (NonEmpty Text)
-> Maybe CertificateOptions
-> Maybe (NonEmpty DomainValidationOption)
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Text
-> RequestCertificate
RequestCertificate'
{ $sel:idempotencyToken:RequestCertificate' :: Maybe Text
idempotencyToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:validationMethod:RequestCertificate' :: Maybe ValidationMethod
validationMethod = Maybe ValidationMethod
forall a. Maybe a
Prelude.Nothing,
$sel:subjectAlternativeNames:RequestCertificate' :: Maybe (NonEmpty Text)
subjectAlternativeNames = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
$sel:options:RequestCertificate' :: Maybe CertificateOptions
options = Maybe CertificateOptions
forall a. Maybe a
Prelude.Nothing,
$sel:domainValidationOptions:RequestCertificate' :: Maybe (NonEmpty DomainValidationOption)
domainValidationOptions = Maybe (NonEmpty DomainValidationOption)
forall a. Maybe a
Prelude.Nothing,
$sel:certificateAuthorityArn:RequestCertificate' :: Maybe Text
certificateAuthorityArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:RequestCertificate' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
$sel:domainName:RequestCertificate' :: Text
domainName = Text
pDomainName_
}
requestCertificate_idempotencyToken :: Lens.Lens' RequestCertificate (Prelude.Maybe Prelude.Text)
requestCertificate_idempotencyToken :: (Maybe Text -> f (Maybe Text))
-> RequestCertificate -> f RequestCertificate
requestCertificate_idempotencyToken = (RequestCertificate -> Maybe Text)
-> (RequestCertificate -> Maybe Text -> RequestCertificate)
-> Lens
RequestCertificate RequestCertificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCertificate' {Maybe Text
idempotencyToken :: Maybe Text
$sel:idempotencyToken:RequestCertificate' :: RequestCertificate -> Maybe Text
idempotencyToken} -> Maybe Text
idempotencyToken) (\s :: RequestCertificate
s@RequestCertificate' {} Maybe Text
a -> RequestCertificate
s {$sel:idempotencyToken:RequestCertificate' :: Maybe Text
idempotencyToken = Maybe Text
a} :: RequestCertificate)
requestCertificate_validationMethod :: Lens.Lens' RequestCertificate (Prelude.Maybe ValidationMethod)
requestCertificate_validationMethod :: (Maybe ValidationMethod -> f (Maybe ValidationMethod))
-> RequestCertificate -> f RequestCertificate
requestCertificate_validationMethod = (RequestCertificate -> Maybe ValidationMethod)
-> (RequestCertificate
-> Maybe ValidationMethod -> RequestCertificate)
-> Lens
RequestCertificate
RequestCertificate
(Maybe ValidationMethod)
(Maybe ValidationMethod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCertificate' {Maybe ValidationMethod
validationMethod :: Maybe ValidationMethod
$sel:validationMethod:RequestCertificate' :: RequestCertificate -> Maybe ValidationMethod
validationMethod} -> Maybe ValidationMethod
validationMethod) (\s :: RequestCertificate
s@RequestCertificate' {} Maybe ValidationMethod
a -> RequestCertificate
s {$sel:validationMethod:RequestCertificate' :: Maybe ValidationMethod
validationMethod = Maybe ValidationMethod
a} :: RequestCertificate)
requestCertificate_subjectAlternativeNames :: Lens.Lens' RequestCertificate (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
requestCertificate_subjectAlternativeNames :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> RequestCertificate -> f RequestCertificate
requestCertificate_subjectAlternativeNames = (RequestCertificate -> Maybe (NonEmpty Text))
-> (RequestCertificate
-> Maybe (NonEmpty Text) -> RequestCertificate)
-> Lens
RequestCertificate
RequestCertificate
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCertificate' {Maybe (NonEmpty Text)
subjectAlternativeNames :: Maybe (NonEmpty Text)
$sel:subjectAlternativeNames:RequestCertificate' :: RequestCertificate -> Maybe (NonEmpty Text)
subjectAlternativeNames} -> Maybe (NonEmpty Text)
subjectAlternativeNames) (\s :: RequestCertificate
s@RequestCertificate' {} Maybe (NonEmpty Text)
a -> RequestCertificate
s {$sel:subjectAlternativeNames:RequestCertificate' :: Maybe (NonEmpty Text)
subjectAlternativeNames = Maybe (NonEmpty Text)
a} :: RequestCertificate) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> RequestCertificate -> f RequestCertificate)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> RequestCertificate
-> f RequestCertificate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty 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
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
requestCertificate_options :: Lens.Lens' RequestCertificate (Prelude.Maybe CertificateOptions)
requestCertificate_options :: (Maybe CertificateOptions -> f (Maybe CertificateOptions))
-> RequestCertificate -> f RequestCertificate
requestCertificate_options = (RequestCertificate -> Maybe CertificateOptions)
-> (RequestCertificate
-> Maybe CertificateOptions -> RequestCertificate)
-> Lens
RequestCertificate
RequestCertificate
(Maybe CertificateOptions)
(Maybe CertificateOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCertificate' {Maybe CertificateOptions
options :: Maybe CertificateOptions
$sel:options:RequestCertificate' :: RequestCertificate -> Maybe CertificateOptions
options} -> Maybe CertificateOptions
options) (\s :: RequestCertificate
s@RequestCertificate' {} Maybe CertificateOptions
a -> RequestCertificate
s {$sel:options:RequestCertificate' :: Maybe CertificateOptions
options = Maybe CertificateOptions
a} :: RequestCertificate)
requestCertificate_domainValidationOptions :: Lens.Lens' RequestCertificate (Prelude.Maybe (Prelude.NonEmpty DomainValidationOption))
requestCertificate_domainValidationOptions :: (Maybe (NonEmpty DomainValidationOption)
-> f (Maybe (NonEmpty DomainValidationOption)))
-> RequestCertificate -> f RequestCertificate
requestCertificate_domainValidationOptions = (RequestCertificate -> Maybe (NonEmpty DomainValidationOption))
-> (RequestCertificate
-> Maybe (NonEmpty DomainValidationOption) -> RequestCertificate)
-> Lens
RequestCertificate
RequestCertificate
(Maybe (NonEmpty DomainValidationOption))
(Maybe (NonEmpty DomainValidationOption))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCertificate' {Maybe (NonEmpty DomainValidationOption)
domainValidationOptions :: Maybe (NonEmpty DomainValidationOption)
$sel:domainValidationOptions:RequestCertificate' :: RequestCertificate -> Maybe (NonEmpty DomainValidationOption)
domainValidationOptions} -> Maybe (NonEmpty DomainValidationOption)
domainValidationOptions) (\s :: RequestCertificate
s@RequestCertificate' {} Maybe (NonEmpty DomainValidationOption)
a -> RequestCertificate
s {$sel:domainValidationOptions:RequestCertificate' :: Maybe (NonEmpty DomainValidationOption)
domainValidationOptions = Maybe (NonEmpty DomainValidationOption)
a} :: RequestCertificate) ((Maybe (NonEmpty DomainValidationOption)
-> f (Maybe (NonEmpty DomainValidationOption)))
-> RequestCertificate -> f RequestCertificate)
-> ((Maybe (NonEmpty DomainValidationOption)
-> f (Maybe (NonEmpty DomainValidationOption)))
-> Maybe (NonEmpty DomainValidationOption)
-> f (Maybe (NonEmpty DomainValidationOption)))
-> (Maybe (NonEmpty DomainValidationOption)
-> f (Maybe (NonEmpty DomainValidationOption)))
-> RequestCertificate
-> f RequestCertificate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty DomainValidationOption)
(NonEmpty DomainValidationOption)
(NonEmpty DomainValidationOption)
(NonEmpty DomainValidationOption)
-> Iso
(Maybe (NonEmpty DomainValidationOption))
(Maybe (NonEmpty DomainValidationOption))
(Maybe (NonEmpty DomainValidationOption))
(Maybe (NonEmpty DomainValidationOption))
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
(NonEmpty DomainValidationOption)
(NonEmpty DomainValidationOption)
(NonEmpty DomainValidationOption)
(NonEmpty DomainValidationOption)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
requestCertificate_certificateAuthorityArn :: Lens.Lens' RequestCertificate (Prelude.Maybe Prelude.Text)
requestCertificate_certificateAuthorityArn :: (Maybe Text -> f (Maybe Text))
-> RequestCertificate -> f RequestCertificate
requestCertificate_certificateAuthorityArn = (RequestCertificate -> Maybe Text)
-> (RequestCertificate -> Maybe Text -> RequestCertificate)
-> Lens
RequestCertificate RequestCertificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCertificate' {Maybe Text
certificateAuthorityArn :: Maybe Text
$sel:certificateAuthorityArn:RequestCertificate' :: RequestCertificate -> Maybe Text
certificateAuthorityArn} -> Maybe Text
certificateAuthorityArn) (\s :: RequestCertificate
s@RequestCertificate' {} Maybe Text
a -> RequestCertificate
s {$sel:certificateAuthorityArn:RequestCertificate' :: Maybe Text
certificateAuthorityArn = Maybe Text
a} :: RequestCertificate)
requestCertificate_tags :: Lens.Lens' RequestCertificate (Prelude.Maybe (Prelude.NonEmpty Tag))
requestCertificate_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> RequestCertificate -> f RequestCertificate
requestCertificate_tags = (RequestCertificate -> Maybe (NonEmpty Tag))
-> (RequestCertificate
-> Maybe (NonEmpty Tag) -> RequestCertificate)
-> Lens
RequestCertificate
RequestCertificate
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCertificate' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:RequestCertificate' :: RequestCertificate -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: RequestCertificate
s@RequestCertificate' {} Maybe (NonEmpty Tag)
a -> RequestCertificate
s {$sel:tags:RequestCertificate' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: RequestCertificate) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> RequestCertificate -> f RequestCertificate)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> RequestCertificate
-> f RequestCertificate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
requestCertificate_domainName :: Lens.Lens' RequestCertificate Prelude.Text
requestCertificate_domainName :: (Text -> f Text) -> RequestCertificate -> f RequestCertificate
requestCertificate_domainName = (RequestCertificate -> Text)
-> (RequestCertificate -> Text -> RequestCertificate)
-> Lens RequestCertificate RequestCertificate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCertificate' {Text
domainName :: Text
$sel:domainName:RequestCertificate' :: RequestCertificate -> Text
domainName} -> Text
domainName) (\s :: RequestCertificate
s@RequestCertificate' {} Text
a -> RequestCertificate
s {$sel:domainName:RequestCertificate' :: Text
domainName = Text
a} :: RequestCertificate)
instance Core.AWSRequest RequestCertificate where
type
AWSResponse RequestCertificate =
RequestCertificateResponse
request :: RequestCertificate -> Request RequestCertificate
request = Service -> RequestCertificate -> Request RequestCertificate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RequestCertificate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RequestCertificate)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RequestCertificate))
-> Logger
-> Service
-> Proxy RequestCertificate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RequestCertificate)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> RequestCertificateResponse
RequestCertificateResponse'
(Maybe Text -> Int -> RequestCertificateResponse)
-> Either String (Maybe Text)
-> Either String (Int -> RequestCertificateResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CertificateArn")
Either String (Int -> RequestCertificateResponse)
-> Either String Int -> Either String RequestCertificateResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable RequestCertificate
instance Prelude.NFData RequestCertificate
instance Core.ToHeaders RequestCertificate where
toHeaders :: RequestCertificate -> ResponseHeaders
toHeaders =
ResponseHeaders -> RequestCertificate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"CertificateManager.RequestCertificate" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON RequestCertificate where
toJSON :: RequestCertificate -> Value
toJSON RequestCertificate' {Maybe (NonEmpty Text)
Maybe (NonEmpty DomainValidationOption)
Maybe (NonEmpty Tag)
Maybe Text
Maybe CertificateOptions
Maybe ValidationMethod
Text
domainName :: Text
tags :: Maybe (NonEmpty Tag)
certificateAuthorityArn :: Maybe Text
domainValidationOptions :: Maybe (NonEmpty DomainValidationOption)
options :: Maybe CertificateOptions
subjectAlternativeNames :: Maybe (NonEmpty Text)
validationMethod :: Maybe ValidationMethod
idempotencyToken :: Maybe Text
$sel:domainName:RequestCertificate' :: RequestCertificate -> Text
$sel:tags:RequestCertificate' :: RequestCertificate -> Maybe (NonEmpty Tag)
$sel:certificateAuthorityArn:RequestCertificate' :: RequestCertificate -> Maybe Text
$sel:domainValidationOptions:RequestCertificate' :: RequestCertificate -> Maybe (NonEmpty DomainValidationOption)
$sel:options:RequestCertificate' :: RequestCertificate -> Maybe CertificateOptions
$sel:subjectAlternativeNames:RequestCertificate' :: RequestCertificate -> Maybe (NonEmpty Text)
$sel:validationMethod:RequestCertificate' :: RequestCertificate -> Maybe ValidationMethod
$sel:idempotencyToken:RequestCertificate' :: RequestCertificate -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"IdempotencyToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
idempotencyToken,
(Text
"ValidationMethod" Text -> ValidationMethod -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ValidationMethod -> Pair) -> Maybe ValidationMethod -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ValidationMethod
validationMethod,
(Text
"SubjectAlternativeNames" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
subjectAlternativeNames,
(Text
"Options" Text -> CertificateOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CertificateOptions -> Pair)
-> Maybe CertificateOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CertificateOptions
options,
(Text
"DomainValidationOptions" Text -> NonEmpty DomainValidationOption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NonEmpty DomainValidationOption -> Pair)
-> Maybe (NonEmpty DomainValidationOption) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty DomainValidationOption)
domainValidationOptions,
(Text
"CertificateAuthorityArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
certificateAuthorityArn,
(Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DomainName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domainName)
]
)
instance Core.ToPath RequestCertificate where
toPath :: RequestCertificate -> ByteString
toPath = ByteString -> RequestCertificate -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RequestCertificate where
toQuery :: RequestCertificate -> QueryString
toQuery = QueryString -> RequestCertificate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RequestCertificateResponse = RequestCertificateResponse'
{
RequestCertificateResponse -> Maybe Text
certificateArn :: Prelude.Maybe Prelude.Text,
RequestCertificateResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RequestCertificateResponse -> RequestCertificateResponse -> Bool
(RequestCertificateResponse -> RequestCertificateResponse -> Bool)
-> (RequestCertificateResponse
-> RequestCertificateResponse -> Bool)
-> Eq RequestCertificateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RequestCertificateResponse -> RequestCertificateResponse -> Bool
$c/= :: RequestCertificateResponse -> RequestCertificateResponse -> Bool
== :: RequestCertificateResponse -> RequestCertificateResponse -> Bool
$c== :: RequestCertificateResponse -> RequestCertificateResponse -> Bool
Prelude.Eq, ReadPrec [RequestCertificateResponse]
ReadPrec RequestCertificateResponse
Int -> ReadS RequestCertificateResponse
ReadS [RequestCertificateResponse]
(Int -> ReadS RequestCertificateResponse)
-> ReadS [RequestCertificateResponse]
-> ReadPrec RequestCertificateResponse
-> ReadPrec [RequestCertificateResponse]
-> Read RequestCertificateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RequestCertificateResponse]
$creadListPrec :: ReadPrec [RequestCertificateResponse]
readPrec :: ReadPrec RequestCertificateResponse
$creadPrec :: ReadPrec RequestCertificateResponse
readList :: ReadS [RequestCertificateResponse]
$creadList :: ReadS [RequestCertificateResponse]
readsPrec :: Int -> ReadS RequestCertificateResponse
$creadsPrec :: Int -> ReadS RequestCertificateResponse
Prelude.Read, Int -> RequestCertificateResponse -> ShowS
[RequestCertificateResponse] -> ShowS
RequestCertificateResponse -> String
(Int -> RequestCertificateResponse -> ShowS)
-> (RequestCertificateResponse -> String)
-> ([RequestCertificateResponse] -> ShowS)
-> Show RequestCertificateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RequestCertificateResponse] -> ShowS
$cshowList :: [RequestCertificateResponse] -> ShowS
show :: RequestCertificateResponse -> String
$cshow :: RequestCertificateResponse -> String
showsPrec :: Int -> RequestCertificateResponse -> ShowS
$cshowsPrec :: Int -> RequestCertificateResponse -> ShowS
Prelude.Show, (forall x.
RequestCertificateResponse -> Rep RequestCertificateResponse x)
-> (forall x.
Rep RequestCertificateResponse x -> RequestCertificateResponse)
-> Generic RequestCertificateResponse
forall x.
Rep RequestCertificateResponse x -> RequestCertificateResponse
forall x.
RequestCertificateResponse -> Rep RequestCertificateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RequestCertificateResponse x -> RequestCertificateResponse
$cfrom :: forall x.
RequestCertificateResponse -> Rep RequestCertificateResponse x
Prelude.Generic)
newRequestCertificateResponse ::
Prelude.Int ->
RequestCertificateResponse
newRequestCertificateResponse :: Int -> RequestCertificateResponse
newRequestCertificateResponse Int
pHttpStatus_ =
RequestCertificateResponse' :: Maybe Text -> Int -> RequestCertificateResponse
RequestCertificateResponse'
{ $sel:certificateArn:RequestCertificateResponse' :: Maybe Text
certificateArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RequestCertificateResponse' :: Int
httpStatus = Int
pHttpStatus_
}
requestCertificateResponse_certificateArn :: Lens.Lens' RequestCertificateResponse (Prelude.Maybe Prelude.Text)
requestCertificateResponse_certificateArn :: (Maybe Text -> f (Maybe Text))
-> RequestCertificateResponse -> f RequestCertificateResponse
requestCertificateResponse_certificateArn = (RequestCertificateResponse -> Maybe Text)
-> (RequestCertificateResponse
-> Maybe Text -> RequestCertificateResponse)
-> Lens
RequestCertificateResponse
RequestCertificateResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCertificateResponse' {Maybe Text
certificateArn :: Maybe Text
$sel:certificateArn:RequestCertificateResponse' :: RequestCertificateResponse -> Maybe Text
certificateArn} -> Maybe Text
certificateArn) (\s :: RequestCertificateResponse
s@RequestCertificateResponse' {} Maybe Text
a -> RequestCertificateResponse
s {$sel:certificateArn:RequestCertificateResponse' :: Maybe Text
certificateArn = Maybe Text
a} :: RequestCertificateResponse)
requestCertificateResponse_httpStatus :: Lens.Lens' RequestCertificateResponse Prelude.Int
requestCertificateResponse_httpStatus :: (Int -> f Int)
-> RequestCertificateResponse -> f RequestCertificateResponse
requestCertificateResponse_httpStatus = (RequestCertificateResponse -> Int)
-> (RequestCertificateResponse
-> Int -> RequestCertificateResponse)
-> Lens
RequestCertificateResponse RequestCertificateResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCertificateResponse' {Int
httpStatus :: Int
$sel:httpStatus:RequestCertificateResponse' :: RequestCertificateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RequestCertificateResponse
s@RequestCertificateResponse' {} Int
a -> RequestCertificateResponse
s {$sel:httpStatus:RequestCertificateResponse' :: Int
httpStatus = Int
a} :: RequestCertificateResponse)
instance Prelude.NFData RequestCertificateResponse