{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IoT.CreateCertificateFromCsr
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an X.509 certificate using the specified certificate signing
-- request.
--
-- __Note:__ The CSR must include a public key that is either an RSA key
-- with a length of at least 2048 bits or an ECC key from NIST P-256, NIST
-- P-384, or NIST P-512 curves. For supported certificates, consult
-- <https://docs.aws.amazon.com/iot/latest/developerguide/x509-client-certs.html#x509-cert-algorithms Certificate signing algorithms supported by IoT>.
--
-- __Note:__ Reusing the same certificate signing request (CSR) results in
-- a distinct certificate.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions CreateCertificateFromCsr>
-- action.
--
-- You can create multiple certificates in a batch by creating a directory,
-- copying multiple .csr files into that directory, and then specifying
-- that directory on the command line. The following commands show how to
-- create a batch of certificates given a batch of CSRs.
--
-- Assuming a set of CSRs are located inside of the directory
-- my-csr-directory:
--
-- On Linux and OS X, the command is:
--
-- \$ ls my-csr-directory\/ | xargs -I {} aws iot
-- create-certificate-from-csr --certificate-signing-request
-- file:\/\/my-csr-directory\/{}
--
-- This command lists all of the CSRs in my-csr-directory and pipes each
-- CSR file name to the aws iot create-certificate-from-csr Amazon Web
-- Services CLI command to create a certificate for the corresponding CSR.
--
-- The aws iot create-certificate-from-csr part of the command can also be
-- run in parallel to speed up the certificate creation process:
--
-- \$ ls my-csr-directory\/ | xargs -P 10 -I {} aws iot
-- create-certificate-from-csr --certificate-signing-request
-- file:\/\/my-csr-directory\/{}
--
-- On Windows PowerShell, the command to create certificates for all CSRs
-- in my-csr-directory is:
--
-- > ls -Name my-csr-directory | %{aws iot create-certificate-from-csr
-- --certificate-signing-request file:\/\/my-csr-directory\/$_}
--
-- On a Windows command prompt, the command to create certificates for all
-- CSRs in my-csr-directory is:
--
-- > forfiles \/p my-csr-directory \/c \"cmd \/c aws iot
-- create-certificate-from-csr --certificate-signing-request
-- file:\/\/\@path\"
module Amazonka.IoT.CreateCertificateFromCsr
  ( -- * Creating a Request
    CreateCertificateFromCsr (..),
    newCreateCertificateFromCsr,

    -- * Request Lenses
    createCertificateFromCsr_setAsActive,
    createCertificateFromCsr_certificateSigningRequest,

    -- * Destructuring the Response
    CreateCertificateFromCsrResponse (..),
    newCreateCertificateFromCsrResponse,

    -- * Response Lenses
    createCertificateFromCsrResponse_certificateArn,
    createCertificateFromCsrResponse_certificateId,
    createCertificateFromCsrResponse_certificatePem,
    createCertificateFromCsrResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | The input for the CreateCertificateFromCsr operation.
--
-- /See:/ 'newCreateCertificateFromCsr' smart constructor.
data CreateCertificateFromCsr = CreateCertificateFromCsr'
  { -- | Specifies whether the certificate is active.
    CreateCertificateFromCsr -> Maybe Bool
setAsActive :: Prelude.Maybe Prelude.Bool,
    -- | The certificate signing request (CSR).
    CreateCertificateFromCsr -> Text
certificateSigningRequest :: Prelude.Text
  }
  deriving (CreateCertificateFromCsr -> CreateCertificateFromCsr -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCertificateFromCsr -> CreateCertificateFromCsr -> Bool
$c/= :: CreateCertificateFromCsr -> CreateCertificateFromCsr -> Bool
== :: CreateCertificateFromCsr -> CreateCertificateFromCsr -> Bool
$c== :: CreateCertificateFromCsr -> CreateCertificateFromCsr -> Bool
Prelude.Eq, ReadPrec [CreateCertificateFromCsr]
ReadPrec CreateCertificateFromCsr
Int -> ReadS CreateCertificateFromCsr
ReadS [CreateCertificateFromCsr]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCertificateFromCsr]
$creadListPrec :: ReadPrec [CreateCertificateFromCsr]
readPrec :: ReadPrec CreateCertificateFromCsr
$creadPrec :: ReadPrec CreateCertificateFromCsr
readList :: ReadS [CreateCertificateFromCsr]
$creadList :: ReadS [CreateCertificateFromCsr]
readsPrec :: Int -> ReadS CreateCertificateFromCsr
$creadsPrec :: Int -> ReadS CreateCertificateFromCsr
Prelude.Read, Int -> CreateCertificateFromCsr -> ShowS
[CreateCertificateFromCsr] -> ShowS
CreateCertificateFromCsr -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCertificateFromCsr] -> ShowS
$cshowList :: [CreateCertificateFromCsr] -> ShowS
show :: CreateCertificateFromCsr -> String
$cshow :: CreateCertificateFromCsr -> String
showsPrec :: Int -> CreateCertificateFromCsr -> ShowS
$cshowsPrec :: Int -> CreateCertificateFromCsr -> ShowS
Prelude.Show, forall x.
Rep CreateCertificateFromCsr x -> CreateCertificateFromCsr
forall x.
CreateCertificateFromCsr -> Rep CreateCertificateFromCsr x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCertificateFromCsr x -> CreateCertificateFromCsr
$cfrom :: forall x.
CreateCertificateFromCsr -> Rep CreateCertificateFromCsr x
Prelude.Generic)

-- |
-- Create a value of 'CreateCertificateFromCsr' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'setAsActive', 'createCertificateFromCsr_setAsActive' - Specifies whether the certificate is active.
--
-- 'certificateSigningRequest', 'createCertificateFromCsr_certificateSigningRequest' - The certificate signing request (CSR).
newCreateCertificateFromCsr ::
  -- | 'certificateSigningRequest'
  Prelude.Text ->
  CreateCertificateFromCsr
newCreateCertificateFromCsr :: Text -> CreateCertificateFromCsr
newCreateCertificateFromCsr
  Text
pCertificateSigningRequest_ =
    CreateCertificateFromCsr'
      { $sel:setAsActive:CreateCertificateFromCsr' :: Maybe Bool
setAsActive =
          forall a. Maybe a
Prelude.Nothing,
        $sel:certificateSigningRequest:CreateCertificateFromCsr' :: Text
certificateSigningRequest =
          Text
pCertificateSigningRequest_
      }

-- | Specifies whether the certificate is active.
createCertificateFromCsr_setAsActive :: Lens.Lens' CreateCertificateFromCsr (Prelude.Maybe Prelude.Bool)
createCertificateFromCsr_setAsActive :: Lens' CreateCertificateFromCsr (Maybe Bool)
createCertificateFromCsr_setAsActive = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificateFromCsr' {Maybe Bool
setAsActive :: Maybe Bool
$sel:setAsActive:CreateCertificateFromCsr' :: CreateCertificateFromCsr -> Maybe Bool
setAsActive} -> Maybe Bool
setAsActive) (\s :: CreateCertificateFromCsr
s@CreateCertificateFromCsr' {} Maybe Bool
a -> CreateCertificateFromCsr
s {$sel:setAsActive:CreateCertificateFromCsr' :: Maybe Bool
setAsActive = Maybe Bool
a} :: CreateCertificateFromCsr)

-- | The certificate signing request (CSR).
createCertificateFromCsr_certificateSigningRequest :: Lens.Lens' CreateCertificateFromCsr Prelude.Text
createCertificateFromCsr_certificateSigningRequest :: Lens' CreateCertificateFromCsr Text
createCertificateFromCsr_certificateSigningRequest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificateFromCsr' {Text
certificateSigningRequest :: Text
$sel:certificateSigningRequest:CreateCertificateFromCsr' :: CreateCertificateFromCsr -> Text
certificateSigningRequest} -> Text
certificateSigningRequest) (\s :: CreateCertificateFromCsr
s@CreateCertificateFromCsr' {} Text
a -> CreateCertificateFromCsr
s {$sel:certificateSigningRequest:CreateCertificateFromCsr' :: Text
certificateSigningRequest = Text
a} :: CreateCertificateFromCsr)

instance Core.AWSRequest CreateCertificateFromCsr where
  type
    AWSResponse CreateCertificateFromCsr =
      CreateCertificateFromCsrResponse
  request :: (Service -> Service)
-> CreateCertificateFromCsr -> Request CreateCertificateFromCsr
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 CreateCertificateFromCsr
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateCertificateFromCsr)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateCertificateFromCsrResponse
CreateCertificateFromCsrResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"certificateArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"certificateId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"certificatePem")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateCertificateFromCsr where
  hashWithSalt :: Int -> CreateCertificateFromCsr -> Int
hashWithSalt Int
_salt CreateCertificateFromCsr' {Maybe Bool
Text
certificateSigningRequest :: Text
setAsActive :: Maybe Bool
$sel:certificateSigningRequest:CreateCertificateFromCsr' :: CreateCertificateFromCsr -> Text
$sel:setAsActive:CreateCertificateFromCsr' :: CreateCertificateFromCsr -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
setAsActive
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
certificateSigningRequest

instance Prelude.NFData CreateCertificateFromCsr where
  rnf :: CreateCertificateFromCsr -> ()
rnf CreateCertificateFromCsr' {Maybe Bool
Text
certificateSigningRequest :: Text
setAsActive :: Maybe Bool
$sel:certificateSigningRequest:CreateCertificateFromCsr' :: CreateCertificateFromCsr -> Text
$sel:setAsActive:CreateCertificateFromCsr' :: CreateCertificateFromCsr -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
setAsActive
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
certificateSigningRequest

instance Data.ToHeaders CreateCertificateFromCsr where
  toHeaders :: CreateCertificateFromCsr -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToJSON CreateCertificateFromCsr where
  toJSON :: CreateCertificateFromCsr -> Value
toJSON CreateCertificateFromCsr' {Maybe Bool
Text
certificateSigningRequest :: Text
setAsActive :: Maybe Bool
$sel:certificateSigningRequest:CreateCertificateFromCsr' :: CreateCertificateFromCsr -> Text
$sel:setAsActive:CreateCertificateFromCsr' :: CreateCertificateFromCsr -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              ( Key
"certificateSigningRequest"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
certificateSigningRequest
              )
          ]
      )

instance Data.ToPath CreateCertificateFromCsr where
  toPath :: CreateCertificateFromCsr -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/certificates"

instance Data.ToQuery CreateCertificateFromCsr where
  toQuery :: CreateCertificateFromCsr -> QueryString
toQuery CreateCertificateFromCsr' {Maybe Bool
Text
certificateSigningRequest :: Text
setAsActive :: Maybe Bool
$sel:certificateSigningRequest:CreateCertificateFromCsr' :: CreateCertificateFromCsr -> Text
$sel:setAsActive:CreateCertificateFromCsr' :: CreateCertificateFromCsr -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"setAsActive" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
setAsActive]

-- | The output from the CreateCertificateFromCsr operation.
--
-- /See:/ 'newCreateCertificateFromCsrResponse' smart constructor.
data CreateCertificateFromCsrResponse = CreateCertificateFromCsrResponse'
  { -- | The Amazon Resource Name (ARN) of the certificate. You can use the ARN
    -- as a principal for policy operations.
    CreateCertificateFromCsrResponse -> Maybe Text
certificateArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the certificate. Certificate management operations only take a
    -- certificateId.
    CreateCertificateFromCsrResponse -> Maybe Text
certificateId :: Prelude.Maybe Prelude.Text,
    -- | The certificate data, in PEM format.
    CreateCertificateFromCsrResponse -> Maybe Text
certificatePem :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateCertificateFromCsrResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateCertificateFromCsrResponse
-> CreateCertificateFromCsrResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCertificateFromCsrResponse
-> CreateCertificateFromCsrResponse -> Bool
$c/= :: CreateCertificateFromCsrResponse
-> CreateCertificateFromCsrResponse -> Bool
== :: CreateCertificateFromCsrResponse
-> CreateCertificateFromCsrResponse -> Bool
$c== :: CreateCertificateFromCsrResponse
-> CreateCertificateFromCsrResponse -> Bool
Prelude.Eq, ReadPrec [CreateCertificateFromCsrResponse]
ReadPrec CreateCertificateFromCsrResponse
Int -> ReadS CreateCertificateFromCsrResponse
ReadS [CreateCertificateFromCsrResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCertificateFromCsrResponse]
$creadListPrec :: ReadPrec [CreateCertificateFromCsrResponse]
readPrec :: ReadPrec CreateCertificateFromCsrResponse
$creadPrec :: ReadPrec CreateCertificateFromCsrResponse
readList :: ReadS [CreateCertificateFromCsrResponse]
$creadList :: ReadS [CreateCertificateFromCsrResponse]
readsPrec :: Int -> ReadS CreateCertificateFromCsrResponse
$creadsPrec :: Int -> ReadS CreateCertificateFromCsrResponse
Prelude.Read, Int -> CreateCertificateFromCsrResponse -> ShowS
[CreateCertificateFromCsrResponse] -> ShowS
CreateCertificateFromCsrResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCertificateFromCsrResponse] -> ShowS
$cshowList :: [CreateCertificateFromCsrResponse] -> ShowS
show :: CreateCertificateFromCsrResponse -> String
$cshow :: CreateCertificateFromCsrResponse -> String
showsPrec :: Int -> CreateCertificateFromCsrResponse -> ShowS
$cshowsPrec :: Int -> CreateCertificateFromCsrResponse -> ShowS
Prelude.Show, forall x.
Rep CreateCertificateFromCsrResponse x
-> CreateCertificateFromCsrResponse
forall x.
CreateCertificateFromCsrResponse
-> Rep CreateCertificateFromCsrResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCertificateFromCsrResponse x
-> CreateCertificateFromCsrResponse
$cfrom :: forall x.
CreateCertificateFromCsrResponse
-> Rep CreateCertificateFromCsrResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateCertificateFromCsrResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'certificateArn', 'createCertificateFromCsrResponse_certificateArn' - The Amazon Resource Name (ARN) of the certificate. You can use the ARN
-- as a principal for policy operations.
--
-- 'certificateId', 'createCertificateFromCsrResponse_certificateId' - The ID of the certificate. Certificate management operations only take a
-- certificateId.
--
-- 'certificatePem', 'createCertificateFromCsrResponse_certificatePem' - The certificate data, in PEM format.
--
-- 'httpStatus', 'createCertificateFromCsrResponse_httpStatus' - The response's http status code.
newCreateCertificateFromCsrResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateCertificateFromCsrResponse
newCreateCertificateFromCsrResponse :: Int -> CreateCertificateFromCsrResponse
newCreateCertificateFromCsrResponse Int
pHttpStatus_ =
  CreateCertificateFromCsrResponse'
    { $sel:certificateArn:CreateCertificateFromCsrResponse' :: Maybe Text
certificateArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:certificateId:CreateCertificateFromCsrResponse' :: Maybe Text
certificateId = forall a. Maybe a
Prelude.Nothing,
      $sel:certificatePem:CreateCertificateFromCsrResponse' :: Maybe Text
certificatePem = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateCertificateFromCsrResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the certificate. You can use the ARN
-- as a principal for policy operations.
createCertificateFromCsrResponse_certificateArn :: Lens.Lens' CreateCertificateFromCsrResponse (Prelude.Maybe Prelude.Text)
createCertificateFromCsrResponse_certificateArn :: Lens' CreateCertificateFromCsrResponse (Maybe Text)
createCertificateFromCsrResponse_certificateArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificateFromCsrResponse' {Maybe Text
certificateArn :: Maybe Text
$sel:certificateArn:CreateCertificateFromCsrResponse' :: CreateCertificateFromCsrResponse -> Maybe Text
certificateArn} -> Maybe Text
certificateArn) (\s :: CreateCertificateFromCsrResponse
s@CreateCertificateFromCsrResponse' {} Maybe Text
a -> CreateCertificateFromCsrResponse
s {$sel:certificateArn:CreateCertificateFromCsrResponse' :: Maybe Text
certificateArn = Maybe Text
a} :: CreateCertificateFromCsrResponse)

-- | The ID of the certificate. Certificate management operations only take a
-- certificateId.
createCertificateFromCsrResponse_certificateId :: Lens.Lens' CreateCertificateFromCsrResponse (Prelude.Maybe Prelude.Text)
createCertificateFromCsrResponse_certificateId :: Lens' CreateCertificateFromCsrResponse (Maybe Text)
createCertificateFromCsrResponse_certificateId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificateFromCsrResponse' {Maybe Text
certificateId :: Maybe Text
$sel:certificateId:CreateCertificateFromCsrResponse' :: CreateCertificateFromCsrResponse -> Maybe Text
certificateId} -> Maybe Text
certificateId) (\s :: CreateCertificateFromCsrResponse
s@CreateCertificateFromCsrResponse' {} Maybe Text
a -> CreateCertificateFromCsrResponse
s {$sel:certificateId:CreateCertificateFromCsrResponse' :: Maybe Text
certificateId = Maybe Text
a} :: CreateCertificateFromCsrResponse)

-- | The certificate data, in PEM format.
createCertificateFromCsrResponse_certificatePem :: Lens.Lens' CreateCertificateFromCsrResponse (Prelude.Maybe Prelude.Text)
createCertificateFromCsrResponse_certificatePem :: Lens' CreateCertificateFromCsrResponse (Maybe Text)
createCertificateFromCsrResponse_certificatePem = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificateFromCsrResponse' {Maybe Text
certificatePem :: Maybe Text
$sel:certificatePem:CreateCertificateFromCsrResponse' :: CreateCertificateFromCsrResponse -> Maybe Text
certificatePem} -> Maybe Text
certificatePem) (\s :: CreateCertificateFromCsrResponse
s@CreateCertificateFromCsrResponse' {} Maybe Text
a -> CreateCertificateFromCsrResponse
s {$sel:certificatePem:CreateCertificateFromCsrResponse' :: Maybe Text
certificatePem = Maybe Text
a} :: CreateCertificateFromCsrResponse)

-- | The response's http status code.
createCertificateFromCsrResponse_httpStatus :: Lens.Lens' CreateCertificateFromCsrResponse Prelude.Int
createCertificateFromCsrResponse_httpStatus :: Lens' CreateCertificateFromCsrResponse Int
createCertificateFromCsrResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificateFromCsrResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateCertificateFromCsrResponse' :: CreateCertificateFromCsrResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateCertificateFromCsrResponse
s@CreateCertificateFromCsrResponse' {} Int
a -> CreateCertificateFromCsrResponse
s {$sel:httpStatus:CreateCertificateFromCsrResponse' :: Int
httpStatus = Int
a} :: CreateCertificateFromCsrResponse)

instance
  Prelude.NFData
    CreateCertificateFromCsrResponse
  where
  rnf :: CreateCertificateFromCsrResponse -> ()
rnf CreateCertificateFromCsrResponse' {Int
Maybe Text
httpStatus :: Int
certificatePem :: Maybe Text
certificateId :: Maybe Text
certificateArn :: Maybe Text
$sel:httpStatus:CreateCertificateFromCsrResponse' :: CreateCertificateFromCsrResponse -> Int
$sel:certificatePem:CreateCertificateFromCsrResponse' :: CreateCertificateFromCsrResponse -> Maybe Text
$sel:certificateId:CreateCertificateFromCsrResponse' :: CreateCertificateFromCsrResponse -> Maybe Text
$sel:certificateArn:CreateCertificateFromCsrResponse' :: CreateCertificateFromCsrResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
certificateArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
certificateId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
certificatePem
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus