{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- 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 or
-- NIST P-384 curves.
--
-- __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_certificatePem,
    createCertificateFromCsrResponse_certificateArn,
    createCertificateFromCsrResponse_certificateId,
    createCertificateFromCsrResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types
import qualified Amazonka.Lens as Lens
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
(CreateCertificateFromCsr -> CreateCertificateFromCsr -> Bool)
-> (CreateCertificateFromCsr -> CreateCertificateFromCsr -> Bool)
-> Eq CreateCertificateFromCsr
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]
(Int -> ReadS CreateCertificateFromCsr)
-> ReadS [CreateCertificateFromCsr]
-> ReadPrec CreateCertificateFromCsr
-> ReadPrec [CreateCertificateFromCsr]
-> Read 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
(Int -> CreateCertificateFromCsr -> ShowS)
-> (CreateCertificateFromCsr -> String)
-> ([CreateCertificateFromCsr] -> ShowS)
-> Show CreateCertificateFromCsr
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.
 CreateCertificateFromCsr -> Rep CreateCertificateFromCsr x)
-> (forall x.
    Rep CreateCertificateFromCsr x -> CreateCertificateFromCsr)
-> Generic CreateCertificateFromCsr
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' :: Maybe Bool -> Text -> CreateCertificateFromCsr
CreateCertificateFromCsr'
      { $sel:setAsActive:CreateCertificateFromCsr' :: Maybe Bool
setAsActive =
          Maybe Bool
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 :: (Maybe Bool -> f (Maybe Bool))
-> CreateCertificateFromCsr -> f CreateCertificateFromCsr
createCertificateFromCsr_setAsActive = (CreateCertificateFromCsr -> Maybe Bool)
-> (CreateCertificateFromCsr
    -> Maybe Bool -> CreateCertificateFromCsr)
-> Lens
     CreateCertificateFromCsr
     CreateCertificateFromCsr
     (Maybe Bool)
     (Maybe Bool)
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 :: (Text -> f Text)
-> CreateCertificateFromCsr -> f CreateCertificateFromCsr
createCertificateFromCsr_certificateSigningRequest = (CreateCertificateFromCsr -> Text)
-> (CreateCertificateFromCsr -> Text -> CreateCertificateFromCsr)
-> Lens CreateCertificateFromCsr CreateCertificateFromCsr Text Text
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 :: CreateCertificateFromCsr -> Request CreateCertificateFromCsr
request = Service
-> CreateCertificateFromCsr -> Request CreateCertificateFromCsr
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateCertificateFromCsr
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateCertificateFromCsr)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateCertificateFromCsr))
-> Logger
-> Service
-> Proxy CreateCertificateFromCsr
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateCertificateFromCsr)))
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
-> Maybe Text
-> Maybe Text
-> Int
-> CreateCertificateFromCsrResponse
CreateCertificateFromCsrResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> CreateCertificateFromCsrResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> CreateCertificateFromCsrResponse)
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
"certificatePem")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Int -> CreateCertificateFromCsrResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> CreateCertificateFromCsrResponse)
forall (f :: * -> *) a b. Applicative f => 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 (Maybe Text -> Int -> CreateCertificateFromCsrResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateCertificateFromCsrResponse)
forall (f :: * -> *) a b. Applicative f => 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
"certificateId")
            Either String (Int -> CreateCertificateFromCsrResponse)
-> Either String Int
-> Either String CreateCertificateFromCsrResponse
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 CreateCertificateFromCsr

instance Prelude.NFData CreateCertificateFromCsr

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

instance Core.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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"certificateSigningRequest"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
certificateSigningRequest
              )
          ]
      )

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

instance Core.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
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"setAsActive" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
setAsActive]

-- | The output from the CreateCertificateFromCsr operation.
--
-- /See:/ 'newCreateCertificateFromCsrResponse' smart constructor.
data CreateCertificateFromCsrResponse = CreateCertificateFromCsrResponse'
  { -- | The certificate data, in PEM format.
    CreateCertificateFromCsrResponse -> Maybe Text
certificatePem :: Prelude.Maybe Prelude.Text,
    -- | 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 response's http status code.
    CreateCertificateFromCsrResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateCertificateFromCsrResponse
-> CreateCertificateFromCsrResponse -> Bool
(CreateCertificateFromCsrResponse
 -> CreateCertificateFromCsrResponse -> Bool)
-> (CreateCertificateFromCsrResponse
    -> CreateCertificateFromCsrResponse -> Bool)
-> Eq CreateCertificateFromCsrResponse
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]
(Int -> ReadS CreateCertificateFromCsrResponse)
-> ReadS [CreateCertificateFromCsrResponse]
-> ReadPrec CreateCertificateFromCsrResponse
-> ReadPrec [CreateCertificateFromCsrResponse]
-> Read 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
(Int -> CreateCertificateFromCsrResponse -> ShowS)
-> (CreateCertificateFromCsrResponse -> String)
-> ([CreateCertificateFromCsrResponse] -> ShowS)
-> Show CreateCertificateFromCsrResponse
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.
 CreateCertificateFromCsrResponse
 -> Rep CreateCertificateFromCsrResponse x)
-> (forall x.
    Rep CreateCertificateFromCsrResponse x
    -> CreateCertificateFromCsrResponse)
-> Generic CreateCertificateFromCsrResponse
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:
--
-- 'certificatePem', 'createCertificateFromCsrResponse_certificatePem' - The certificate data, in PEM format.
--
-- '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.
--
-- 'httpStatus', 'createCertificateFromCsrResponse_httpStatus' - The response's http status code.
newCreateCertificateFromCsrResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateCertificateFromCsrResponse
newCreateCertificateFromCsrResponse :: Int -> CreateCertificateFromCsrResponse
newCreateCertificateFromCsrResponse Int
pHttpStatus_ =
  CreateCertificateFromCsrResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateCertificateFromCsrResponse
CreateCertificateFromCsrResponse'
    { $sel:certificatePem:CreateCertificateFromCsrResponse' :: Maybe Text
certificatePem =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateArn:CreateCertificateFromCsrResponse' :: Maybe Text
certificateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateId:CreateCertificateFromCsrResponse' :: Maybe Text
certificateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateCertificateFromCsrResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The certificate data, in PEM format.
createCertificateFromCsrResponse_certificatePem :: Lens.Lens' CreateCertificateFromCsrResponse (Prelude.Maybe Prelude.Text)
createCertificateFromCsrResponse_certificatePem :: (Maybe Text -> f (Maybe Text))
-> CreateCertificateFromCsrResponse
-> f CreateCertificateFromCsrResponse
createCertificateFromCsrResponse_certificatePem = (CreateCertificateFromCsrResponse -> Maybe Text)
-> (CreateCertificateFromCsrResponse
    -> Maybe Text -> CreateCertificateFromCsrResponse)
-> Lens
     CreateCertificateFromCsrResponse
     CreateCertificateFromCsrResponse
     (Maybe Text)
     (Maybe Text)
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 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 :: (Maybe Text -> f (Maybe Text))
-> CreateCertificateFromCsrResponse
-> f CreateCertificateFromCsrResponse
createCertificateFromCsrResponse_certificateArn = (CreateCertificateFromCsrResponse -> Maybe Text)
-> (CreateCertificateFromCsrResponse
    -> Maybe Text -> CreateCertificateFromCsrResponse)
-> Lens
     CreateCertificateFromCsrResponse
     CreateCertificateFromCsrResponse
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> CreateCertificateFromCsrResponse
-> f CreateCertificateFromCsrResponse
createCertificateFromCsrResponse_certificateId = (CreateCertificateFromCsrResponse -> Maybe Text)
-> (CreateCertificateFromCsrResponse
    -> Maybe Text -> CreateCertificateFromCsrResponse)
-> Lens
     CreateCertificateFromCsrResponse
     CreateCertificateFromCsrResponse
     (Maybe Text)
     (Maybe Text)
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 response's http status code.
createCertificateFromCsrResponse_httpStatus :: Lens.Lens' CreateCertificateFromCsrResponse Prelude.Int
createCertificateFromCsrResponse_httpStatus :: (Int -> f Int)
-> CreateCertificateFromCsrResponse
-> f CreateCertificateFromCsrResponse
createCertificateFromCsrResponse_httpStatus = (CreateCertificateFromCsrResponse -> Int)
-> (CreateCertificateFromCsrResponse
    -> Int -> CreateCertificateFromCsrResponse)
-> Lens
     CreateCertificateFromCsrResponse
     CreateCertificateFromCsrResponse
     Int
     Int
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