{-# 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.CertificateManagerPCA.CreateCertificateAuthorityAuditReport
-- 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 audit report that lists every time that your CA private key
-- is used. The report is saved in the Amazon S3 bucket that you specify on
-- input. The
-- <https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_IssueCertificate.html IssueCertificate>
-- and
-- <https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_RevokeCertificate.html RevokeCertificate>
-- actions use the private key.
--
-- Both PCA and the IAM principal must have permission to write to the S3
-- bucket that you specify. If the IAM principal making the call does not
-- have permission to write to the bucket, then an exception is thrown. For
-- more information, see
-- <https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaAuthAccess.html Configure Access to ACM Private CA>.
--
-- ACM Private CA assets that are stored in Amazon S3 can be protected with
-- encryption. For more information, see
-- <https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaAuditReport.html#audit-report-encryption Encrypting Your Audit Reports>.
module Amazonka.CertificateManagerPCA.CreateCertificateAuthorityAuditReport
  ( -- * Creating a Request
    CreateCertificateAuthorityAuditReport (..),
    newCreateCertificateAuthorityAuditReport,

    -- * Request Lenses
    createCertificateAuthorityAuditReport_certificateAuthorityArn,
    createCertificateAuthorityAuditReport_s3BucketName,
    createCertificateAuthorityAuditReport_auditReportResponseFormat,

    -- * Destructuring the Response
    CreateCertificateAuthorityAuditReportResponse (..),
    newCreateCertificateAuthorityAuditReportResponse,

    -- * Response Lenses
    createCertificateAuthorityAuditReportResponse_s3Key,
    createCertificateAuthorityAuditReportResponse_auditReportId,
    createCertificateAuthorityAuditReportResponse_httpStatus,
  )
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

-- | /See:/ 'newCreateCertificateAuthorityAuditReport' smart constructor.
data CreateCertificateAuthorityAuditReport = CreateCertificateAuthorityAuditReport'
  { -- | The Amazon Resource Name (ARN) of the CA to be audited. This is of the
    -- form:
    --
    -- @arn:aws:acm-pca:region:account:certificate-authority\/12345678-1234-1234-1234-123456789012 @.
    CreateCertificateAuthorityAuditReport -> Text
certificateAuthorityArn :: Prelude.Text,
    -- | The name of the S3 bucket that will contain the audit report.
    CreateCertificateAuthorityAuditReport -> Text
s3BucketName :: Prelude.Text,
    -- | The format in which to create the report. This can be either __JSON__ or
    -- __CSV__.
    CreateCertificateAuthorityAuditReport -> AuditReportResponseFormat
auditReportResponseFormat :: AuditReportResponseFormat
  }
  deriving (CreateCertificateAuthorityAuditReport
-> CreateCertificateAuthorityAuditReport -> Bool
(CreateCertificateAuthorityAuditReport
 -> CreateCertificateAuthorityAuditReport -> Bool)
-> (CreateCertificateAuthorityAuditReport
    -> CreateCertificateAuthorityAuditReport -> Bool)
-> Eq CreateCertificateAuthorityAuditReport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCertificateAuthorityAuditReport
-> CreateCertificateAuthorityAuditReport -> Bool
$c/= :: CreateCertificateAuthorityAuditReport
-> CreateCertificateAuthorityAuditReport -> Bool
== :: CreateCertificateAuthorityAuditReport
-> CreateCertificateAuthorityAuditReport -> Bool
$c== :: CreateCertificateAuthorityAuditReport
-> CreateCertificateAuthorityAuditReport -> Bool
Prelude.Eq, ReadPrec [CreateCertificateAuthorityAuditReport]
ReadPrec CreateCertificateAuthorityAuditReport
Int -> ReadS CreateCertificateAuthorityAuditReport
ReadS [CreateCertificateAuthorityAuditReport]
(Int -> ReadS CreateCertificateAuthorityAuditReport)
-> ReadS [CreateCertificateAuthorityAuditReport]
-> ReadPrec CreateCertificateAuthorityAuditReport
-> ReadPrec [CreateCertificateAuthorityAuditReport]
-> Read CreateCertificateAuthorityAuditReport
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCertificateAuthorityAuditReport]
$creadListPrec :: ReadPrec [CreateCertificateAuthorityAuditReport]
readPrec :: ReadPrec CreateCertificateAuthorityAuditReport
$creadPrec :: ReadPrec CreateCertificateAuthorityAuditReport
readList :: ReadS [CreateCertificateAuthorityAuditReport]
$creadList :: ReadS [CreateCertificateAuthorityAuditReport]
readsPrec :: Int -> ReadS CreateCertificateAuthorityAuditReport
$creadsPrec :: Int -> ReadS CreateCertificateAuthorityAuditReport
Prelude.Read, Int -> CreateCertificateAuthorityAuditReport -> ShowS
[CreateCertificateAuthorityAuditReport] -> ShowS
CreateCertificateAuthorityAuditReport -> String
(Int -> CreateCertificateAuthorityAuditReport -> ShowS)
-> (CreateCertificateAuthorityAuditReport -> String)
-> ([CreateCertificateAuthorityAuditReport] -> ShowS)
-> Show CreateCertificateAuthorityAuditReport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCertificateAuthorityAuditReport] -> ShowS
$cshowList :: [CreateCertificateAuthorityAuditReport] -> ShowS
show :: CreateCertificateAuthorityAuditReport -> String
$cshow :: CreateCertificateAuthorityAuditReport -> String
showsPrec :: Int -> CreateCertificateAuthorityAuditReport -> ShowS
$cshowsPrec :: Int -> CreateCertificateAuthorityAuditReport -> ShowS
Prelude.Show, (forall x.
 CreateCertificateAuthorityAuditReport
 -> Rep CreateCertificateAuthorityAuditReport x)
-> (forall x.
    Rep CreateCertificateAuthorityAuditReport x
    -> CreateCertificateAuthorityAuditReport)
-> Generic CreateCertificateAuthorityAuditReport
forall x.
Rep CreateCertificateAuthorityAuditReport x
-> CreateCertificateAuthorityAuditReport
forall x.
CreateCertificateAuthorityAuditReport
-> Rep CreateCertificateAuthorityAuditReport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCertificateAuthorityAuditReport x
-> CreateCertificateAuthorityAuditReport
$cfrom :: forall x.
CreateCertificateAuthorityAuditReport
-> Rep CreateCertificateAuthorityAuditReport x
Prelude.Generic)

-- |
-- Create a value of 'CreateCertificateAuthorityAuditReport' 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:
--
-- 'certificateAuthorityArn', 'createCertificateAuthorityAuditReport_certificateAuthorityArn' - The Amazon Resource Name (ARN) of the CA to be audited. This is of the
-- form:
--
-- @arn:aws:acm-pca:region:account:certificate-authority\/12345678-1234-1234-1234-123456789012 @.
--
-- 's3BucketName', 'createCertificateAuthorityAuditReport_s3BucketName' - The name of the S3 bucket that will contain the audit report.
--
-- 'auditReportResponseFormat', 'createCertificateAuthorityAuditReport_auditReportResponseFormat' - The format in which to create the report. This can be either __JSON__ or
-- __CSV__.
newCreateCertificateAuthorityAuditReport ::
  -- | 'certificateAuthorityArn'
  Prelude.Text ->
  -- | 's3BucketName'
  Prelude.Text ->
  -- | 'auditReportResponseFormat'
  AuditReportResponseFormat ->
  CreateCertificateAuthorityAuditReport
newCreateCertificateAuthorityAuditReport :: Text
-> Text
-> AuditReportResponseFormat
-> CreateCertificateAuthorityAuditReport
newCreateCertificateAuthorityAuditReport
  Text
pCertificateAuthorityArn_
  Text
pS3BucketName_
  AuditReportResponseFormat
pAuditReportResponseFormat_ =
    CreateCertificateAuthorityAuditReport' :: Text
-> Text
-> AuditReportResponseFormat
-> CreateCertificateAuthorityAuditReport
CreateCertificateAuthorityAuditReport'
      { $sel:certificateAuthorityArn:CreateCertificateAuthorityAuditReport' :: Text
certificateAuthorityArn =
          Text
pCertificateAuthorityArn_,
        $sel:s3BucketName:CreateCertificateAuthorityAuditReport' :: Text
s3BucketName = Text
pS3BucketName_,
        $sel:auditReportResponseFormat:CreateCertificateAuthorityAuditReport' :: AuditReportResponseFormat
auditReportResponseFormat =
          AuditReportResponseFormat
pAuditReportResponseFormat_
      }

-- | The Amazon Resource Name (ARN) of the CA to be audited. This is of the
-- form:
--
-- @arn:aws:acm-pca:region:account:certificate-authority\/12345678-1234-1234-1234-123456789012 @.
createCertificateAuthorityAuditReport_certificateAuthorityArn :: Lens.Lens' CreateCertificateAuthorityAuditReport Prelude.Text
createCertificateAuthorityAuditReport_certificateAuthorityArn :: (Text -> f Text)
-> CreateCertificateAuthorityAuditReport
-> f CreateCertificateAuthorityAuditReport
createCertificateAuthorityAuditReport_certificateAuthorityArn = (CreateCertificateAuthorityAuditReport -> Text)
-> (CreateCertificateAuthorityAuditReport
    -> Text -> CreateCertificateAuthorityAuditReport)
-> Lens
     CreateCertificateAuthorityAuditReport
     CreateCertificateAuthorityAuditReport
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificateAuthorityAuditReport' {Text
certificateAuthorityArn :: Text
$sel:certificateAuthorityArn:CreateCertificateAuthorityAuditReport' :: CreateCertificateAuthorityAuditReport -> Text
certificateAuthorityArn} -> Text
certificateAuthorityArn) (\s :: CreateCertificateAuthorityAuditReport
s@CreateCertificateAuthorityAuditReport' {} Text
a -> CreateCertificateAuthorityAuditReport
s {$sel:certificateAuthorityArn:CreateCertificateAuthorityAuditReport' :: Text
certificateAuthorityArn = Text
a} :: CreateCertificateAuthorityAuditReport)

-- | The name of the S3 bucket that will contain the audit report.
createCertificateAuthorityAuditReport_s3BucketName :: Lens.Lens' CreateCertificateAuthorityAuditReport Prelude.Text
createCertificateAuthorityAuditReport_s3BucketName :: (Text -> f Text)
-> CreateCertificateAuthorityAuditReport
-> f CreateCertificateAuthorityAuditReport
createCertificateAuthorityAuditReport_s3BucketName = (CreateCertificateAuthorityAuditReport -> Text)
-> (CreateCertificateAuthorityAuditReport
    -> Text -> CreateCertificateAuthorityAuditReport)
-> Lens
     CreateCertificateAuthorityAuditReport
     CreateCertificateAuthorityAuditReport
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificateAuthorityAuditReport' {Text
s3BucketName :: Text
$sel:s3BucketName:CreateCertificateAuthorityAuditReport' :: CreateCertificateAuthorityAuditReport -> Text
s3BucketName} -> Text
s3BucketName) (\s :: CreateCertificateAuthorityAuditReport
s@CreateCertificateAuthorityAuditReport' {} Text
a -> CreateCertificateAuthorityAuditReport
s {$sel:s3BucketName:CreateCertificateAuthorityAuditReport' :: Text
s3BucketName = Text
a} :: CreateCertificateAuthorityAuditReport)

-- | The format in which to create the report. This can be either __JSON__ or
-- __CSV__.
createCertificateAuthorityAuditReport_auditReportResponseFormat :: Lens.Lens' CreateCertificateAuthorityAuditReport AuditReportResponseFormat
createCertificateAuthorityAuditReport_auditReportResponseFormat :: (AuditReportResponseFormat -> f AuditReportResponseFormat)
-> CreateCertificateAuthorityAuditReport
-> f CreateCertificateAuthorityAuditReport
createCertificateAuthorityAuditReport_auditReportResponseFormat = (CreateCertificateAuthorityAuditReport
 -> AuditReportResponseFormat)
-> (CreateCertificateAuthorityAuditReport
    -> AuditReportResponseFormat
    -> CreateCertificateAuthorityAuditReport)
-> Lens
     CreateCertificateAuthorityAuditReport
     CreateCertificateAuthorityAuditReport
     AuditReportResponseFormat
     AuditReportResponseFormat
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificateAuthorityAuditReport' {AuditReportResponseFormat
auditReportResponseFormat :: AuditReportResponseFormat
$sel:auditReportResponseFormat:CreateCertificateAuthorityAuditReport' :: CreateCertificateAuthorityAuditReport -> AuditReportResponseFormat
auditReportResponseFormat} -> AuditReportResponseFormat
auditReportResponseFormat) (\s :: CreateCertificateAuthorityAuditReport
s@CreateCertificateAuthorityAuditReport' {} AuditReportResponseFormat
a -> CreateCertificateAuthorityAuditReport
s {$sel:auditReportResponseFormat:CreateCertificateAuthorityAuditReport' :: AuditReportResponseFormat
auditReportResponseFormat = AuditReportResponseFormat
a} :: CreateCertificateAuthorityAuditReport)

instance
  Core.AWSRequest
    CreateCertificateAuthorityAuditReport
  where
  type
    AWSResponse
      CreateCertificateAuthorityAuditReport =
      CreateCertificateAuthorityAuditReportResponse
  request :: CreateCertificateAuthorityAuditReport
-> Request CreateCertificateAuthorityAuditReport
request = Service
-> CreateCertificateAuthorityAuditReport
-> Request CreateCertificateAuthorityAuditReport
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateCertificateAuthorityAuditReport
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse CreateCertificateAuthorityAuditReport)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse CreateCertificateAuthorityAuditReport))
-> Logger
-> Service
-> Proxy CreateCertificateAuthorityAuditReport
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse CreateCertificateAuthorityAuditReport)))
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
-> Int
-> CreateCertificateAuthorityAuditReportResponse
CreateCertificateAuthorityAuditReportResponse'
            (Maybe Text
 -> Maybe Text
 -> Int
 -> CreateCertificateAuthorityAuditReportResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Int -> CreateCertificateAuthorityAuditReportResponse)
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
"S3Key")
              Either
  String
  (Maybe Text
   -> Int -> CreateCertificateAuthorityAuditReportResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> CreateCertificateAuthorityAuditReportResponse)
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
"AuditReportId")
              Either
  String (Int -> CreateCertificateAuthorityAuditReportResponse)
-> Either String Int
-> Either String CreateCertificateAuthorityAuditReportResponse
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
    CreateCertificateAuthorityAuditReport

instance
  Prelude.NFData
    CreateCertificateAuthorityAuditReport

instance
  Core.ToHeaders
    CreateCertificateAuthorityAuditReport
  where
  toHeaders :: CreateCertificateAuthorityAuditReport -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> CreateCertificateAuthorityAuditReport -> 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
"ACMPrivateCA.CreateCertificateAuthorityAuditReport" ::
                          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
    CreateCertificateAuthorityAuditReport
  where
  toJSON :: CreateCertificateAuthorityAuditReport -> Value
toJSON CreateCertificateAuthorityAuditReport' {Text
AuditReportResponseFormat
auditReportResponseFormat :: AuditReportResponseFormat
s3BucketName :: Text
certificateAuthorityArn :: Text
$sel:auditReportResponseFormat:CreateCertificateAuthorityAuditReport' :: CreateCertificateAuthorityAuditReport -> AuditReportResponseFormat
$sel:s3BucketName:CreateCertificateAuthorityAuditReport' :: CreateCertificateAuthorityAuditReport -> Text
$sel:certificateAuthorityArn:CreateCertificateAuthorityAuditReport' :: CreateCertificateAuthorityAuditReport -> 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
"S3BucketName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
s3BucketName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"AuditReportResponseFormat"
                  Text -> AuditReportResponseFormat -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AuditReportResponseFormat
auditReportResponseFormat
              )
          ]
      )

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

instance
  Core.ToQuery
    CreateCertificateAuthorityAuditReport
  where
  toQuery :: CreateCertificateAuthorityAuditReport -> QueryString
toQuery = QueryString -> CreateCertificateAuthorityAuditReport -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateCertificateAuthorityAuditReportResponse' smart constructor.
data CreateCertificateAuthorityAuditReportResponse = CreateCertificateAuthorityAuditReportResponse'
  { -- | The __key__ that uniquely identifies the report file in your S3 bucket.
    CreateCertificateAuthorityAuditReportResponse -> Maybe Text
s3Key :: Prelude.Maybe Prelude.Text,
    -- | An alphanumeric string that contains a report identifier.
    CreateCertificateAuthorityAuditReportResponse -> Maybe Text
auditReportId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateCertificateAuthorityAuditReportResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateCertificateAuthorityAuditReportResponse
-> CreateCertificateAuthorityAuditReportResponse -> Bool
(CreateCertificateAuthorityAuditReportResponse
 -> CreateCertificateAuthorityAuditReportResponse -> Bool)
-> (CreateCertificateAuthorityAuditReportResponse
    -> CreateCertificateAuthorityAuditReportResponse -> Bool)
-> Eq CreateCertificateAuthorityAuditReportResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCertificateAuthorityAuditReportResponse
-> CreateCertificateAuthorityAuditReportResponse -> Bool
$c/= :: CreateCertificateAuthorityAuditReportResponse
-> CreateCertificateAuthorityAuditReportResponse -> Bool
== :: CreateCertificateAuthorityAuditReportResponse
-> CreateCertificateAuthorityAuditReportResponse -> Bool
$c== :: CreateCertificateAuthorityAuditReportResponse
-> CreateCertificateAuthorityAuditReportResponse -> Bool
Prelude.Eq, ReadPrec [CreateCertificateAuthorityAuditReportResponse]
ReadPrec CreateCertificateAuthorityAuditReportResponse
Int -> ReadS CreateCertificateAuthorityAuditReportResponse
ReadS [CreateCertificateAuthorityAuditReportResponse]
(Int -> ReadS CreateCertificateAuthorityAuditReportResponse)
-> ReadS [CreateCertificateAuthorityAuditReportResponse]
-> ReadPrec CreateCertificateAuthorityAuditReportResponse
-> ReadPrec [CreateCertificateAuthorityAuditReportResponse]
-> Read CreateCertificateAuthorityAuditReportResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCertificateAuthorityAuditReportResponse]
$creadListPrec :: ReadPrec [CreateCertificateAuthorityAuditReportResponse]
readPrec :: ReadPrec CreateCertificateAuthorityAuditReportResponse
$creadPrec :: ReadPrec CreateCertificateAuthorityAuditReportResponse
readList :: ReadS [CreateCertificateAuthorityAuditReportResponse]
$creadList :: ReadS [CreateCertificateAuthorityAuditReportResponse]
readsPrec :: Int -> ReadS CreateCertificateAuthorityAuditReportResponse
$creadsPrec :: Int -> ReadS CreateCertificateAuthorityAuditReportResponse
Prelude.Read, Int -> CreateCertificateAuthorityAuditReportResponse -> ShowS
[CreateCertificateAuthorityAuditReportResponse] -> ShowS
CreateCertificateAuthorityAuditReportResponse -> String
(Int -> CreateCertificateAuthorityAuditReportResponse -> ShowS)
-> (CreateCertificateAuthorityAuditReportResponse -> String)
-> ([CreateCertificateAuthorityAuditReportResponse] -> ShowS)
-> Show CreateCertificateAuthorityAuditReportResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCertificateAuthorityAuditReportResponse] -> ShowS
$cshowList :: [CreateCertificateAuthorityAuditReportResponse] -> ShowS
show :: CreateCertificateAuthorityAuditReportResponse -> String
$cshow :: CreateCertificateAuthorityAuditReportResponse -> String
showsPrec :: Int -> CreateCertificateAuthorityAuditReportResponse -> ShowS
$cshowsPrec :: Int -> CreateCertificateAuthorityAuditReportResponse -> ShowS
Prelude.Show, (forall x.
 CreateCertificateAuthorityAuditReportResponse
 -> Rep CreateCertificateAuthorityAuditReportResponse x)
-> (forall x.
    Rep CreateCertificateAuthorityAuditReportResponse x
    -> CreateCertificateAuthorityAuditReportResponse)
-> Generic CreateCertificateAuthorityAuditReportResponse
forall x.
Rep CreateCertificateAuthorityAuditReportResponse x
-> CreateCertificateAuthorityAuditReportResponse
forall x.
CreateCertificateAuthorityAuditReportResponse
-> Rep CreateCertificateAuthorityAuditReportResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCertificateAuthorityAuditReportResponse x
-> CreateCertificateAuthorityAuditReportResponse
$cfrom :: forall x.
CreateCertificateAuthorityAuditReportResponse
-> Rep CreateCertificateAuthorityAuditReportResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateCertificateAuthorityAuditReportResponse' 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:
--
-- 's3Key', 'createCertificateAuthorityAuditReportResponse_s3Key' - The __key__ that uniquely identifies the report file in your S3 bucket.
--
-- 'auditReportId', 'createCertificateAuthorityAuditReportResponse_auditReportId' - An alphanumeric string that contains a report identifier.
--
-- 'httpStatus', 'createCertificateAuthorityAuditReportResponse_httpStatus' - The response's http status code.
newCreateCertificateAuthorityAuditReportResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateCertificateAuthorityAuditReportResponse
newCreateCertificateAuthorityAuditReportResponse :: Int -> CreateCertificateAuthorityAuditReportResponse
newCreateCertificateAuthorityAuditReportResponse
  Int
pHttpStatus_ =
    CreateCertificateAuthorityAuditReportResponse' :: Maybe Text
-> Maybe Text
-> Int
-> CreateCertificateAuthorityAuditReportResponse
CreateCertificateAuthorityAuditReportResponse'
      { $sel:s3Key:CreateCertificateAuthorityAuditReportResponse' :: Maybe Text
s3Key =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:auditReportId:CreateCertificateAuthorityAuditReportResponse' :: Maybe Text
auditReportId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateCertificateAuthorityAuditReportResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The __key__ that uniquely identifies the report file in your S3 bucket.
createCertificateAuthorityAuditReportResponse_s3Key :: Lens.Lens' CreateCertificateAuthorityAuditReportResponse (Prelude.Maybe Prelude.Text)
createCertificateAuthorityAuditReportResponse_s3Key :: (Maybe Text -> f (Maybe Text))
-> CreateCertificateAuthorityAuditReportResponse
-> f CreateCertificateAuthorityAuditReportResponse
createCertificateAuthorityAuditReportResponse_s3Key = (CreateCertificateAuthorityAuditReportResponse -> Maybe Text)
-> (CreateCertificateAuthorityAuditReportResponse
    -> Maybe Text -> CreateCertificateAuthorityAuditReportResponse)
-> Lens
     CreateCertificateAuthorityAuditReportResponse
     CreateCertificateAuthorityAuditReportResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificateAuthorityAuditReportResponse' {Maybe Text
s3Key :: Maybe Text
$sel:s3Key:CreateCertificateAuthorityAuditReportResponse' :: CreateCertificateAuthorityAuditReportResponse -> Maybe Text
s3Key} -> Maybe Text
s3Key) (\s :: CreateCertificateAuthorityAuditReportResponse
s@CreateCertificateAuthorityAuditReportResponse' {} Maybe Text
a -> CreateCertificateAuthorityAuditReportResponse
s {$sel:s3Key:CreateCertificateAuthorityAuditReportResponse' :: Maybe Text
s3Key = Maybe Text
a} :: CreateCertificateAuthorityAuditReportResponse)

-- | An alphanumeric string that contains a report identifier.
createCertificateAuthorityAuditReportResponse_auditReportId :: Lens.Lens' CreateCertificateAuthorityAuditReportResponse (Prelude.Maybe Prelude.Text)
createCertificateAuthorityAuditReportResponse_auditReportId :: (Maybe Text -> f (Maybe Text))
-> CreateCertificateAuthorityAuditReportResponse
-> f CreateCertificateAuthorityAuditReportResponse
createCertificateAuthorityAuditReportResponse_auditReportId = (CreateCertificateAuthorityAuditReportResponse -> Maybe Text)
-> (CreateCertificateAuthorityAuditReportResponse
    -> Maybe Text -> CreateCertificateAuthorityAuditReportResponse)
-> Lens
     CreateCertificateAuthorityAuditReportResponse
     CreateCertificateAuthorityAuditReportResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificateAuthorityAuditReportResponse' {Maybe Text
auditReportId :: Maybe Text
$sel:auditReportId:CreateCertificateAuthorityAuditReportResponse' :: CreateCertificateAuthorityAuditReportResponse -> Maybe Text
auditReportId} -> Maybe Text
auditReportId) (\s :: CreateCertificateAuthorityAuditReportResponse
s@CreateCertificateAuthorityAuditReportResponse' {} Maybe Text
a -> CreateCertificateAuthorityAuditReportResponse
s {$sel:auditReportId:CreateCertificateAuthorityAuditReportResponse' :: Maybe Text
auditReportId = Maybe Text
a} :: CreateCertificateAuthorityAuditReportResponse)

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

instance
  Prelude.NFData
    CreateCertificateAuthorityAuditReportResponse