{-# 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.DescribeCertificateAuthorityAuditReport
-- 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)
--
-- Lists information about a specific audit report created by calling the
-- <https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html CreateCertificateAuthorityAuditReport>
-- action. Audit information is created every time the certificate
-- authority (CA) private key is used. The private key is used when you
-- call the
-- <https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_IssueCertificate.html IssueCertificate>
-- action or the
-- <https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_RevokeCertificate.html RevokeCertificate>
-- action.
module Amazonka.CertificateManagerPCA.DescribeCertificateAuthorityAuditReport
  ( -- * Creating a Request
    DescribeCertificateAuthorityAuditReport (..),
    newDescribeCertificateAuthorityAuditReport,

    -- * Request Lenses
    describeCertificateAuthorityAuditReport_certificateAuthorityArn,
    describeCertificateAuthorityAuditReport_auditReportId,

    -- * Destructuring the Response
    DescribeCertificateAuthorityAuditReportResponse (..),
    newDescribeCertificateAuthorityAuditReportResponse,

    -- * Response Lenses
    describeCertificateAuthorityAuditReportResponse_s3Key,
    describeCertificateAuthorityAuditReportResponse_createdAt,
    describeCertificateAuthorityAuditReportResponse_auditReportStatus,
    describeCertificateAuthorityAuditReportResponse_s3BucketName,
    describeCertificateAuthorityAuditReportResponse_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:/ 'newDescribeCertificateAuthorityAuditReport' smart constructor.
data DescribeCertificateAuthorityAuditReport = DescribeCertificateAuthorityAuditReport'
  { -- | The Amazon Resource Name (ARN) of the private CA. This must be of the
    -- form:
    --
    -- @arn:aws:acm-pca:region:account:certificate-authority\/12345678-1234-1234-1234-123456789012 @.
    DescribeCertificateAuthorityAuditReport -> Text
certificateAuthorityArn :: Prelude.Text,
    -- | The report ID returned by calling the
    -- <https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html CreateCertificateAuthorityAuditReport>
    -- action.
    DescribeCertificateAuthorityAuditReport -> Text
auditReportId :: Prelude.Text
  }
  deriving (DescribeCertificateAuthorityAuditReport
-> DescribeCertificateAuthorityAuditReport -> Bool
(DescribeCertificateAuthorityAuditReport
 -> DescribeCertificateAuthorityAuditReport -> Bool)
-> (DescribeCertificateAuthorityAuditReport
    -> DescribeCertificateAuthorityAuditReport -> Bool)
-> Eq DescribeCertificateAuthorityAuditReport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCertificateAuthorityAuditReport
-> DescribeCertificateAuthorityAuditReport -> Bool
$c/= :: DescribeCertificateAuthorityAuditReport
-> DescribeCertificateAuthorityAuditReport -> Bool
== :: DescribeCertificateAuthorityAuditReport
-> DescribeCertificateAuthorityAuditReport -> Bool
$c== :: DescribeCertificateAuthorityAuditReport
-> DescribeCertificateAuthorityAuditReport -> Bool
Prelude.Eq, ReadPrec [DescribeCertificateAuthorityAuditReport]
ReadPrec DescribeCertificateAuthorityAuditReport
Int -> ReadS DescribeCertificateAuthorityAuditReport
ReadS [DescribeCertificateAuthorityAuditReport]
(Int -> ReadS DescribeCertificateAuthorityAuditReport)
-> ReadS [DescribeCertificateAuthorityAuditReport]
-> ReadPrec DescribeCertificateAuthorityAuditReport
-> ReadPrec [DescribeCertificateAuthorityAuditReport]
-> Read DescribeCertificateAuthorityAuditReport
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCertificateAuthorityAuditReport]
$creadListPrec :: ReadPrec [DescribeCertificateAuthorityAuditReport]
readPrec :: ReadPrec DescribeCertificateAuthorityAuditReport
$creadPrec :: ReadPrec DescribeCertificateAuthorityAuditReport
readList :: ReadS [DescribeCertificateAuthorityAuditReport]
$creadList :: ReadS [DescribeCertificateAuthorityAuditReport]
readsPrec :: Int -> ReadS DescribeCertificateAuthorityAuditReport
$creadsPrec :: Int -> ReadS DescribeCertificateAuthorityAuditReport
Prelude.Read, Int -> DescribeCertificateAuthorityAuditReport -> ShowS
[DescribeCertificateAuthorityAuditReport] -> ShowS
DescribeCertificateAuthorityAuditReport -> String
(Int -> DescribeCertificateAuthorityAuditReport -> ShowS)
-> (DescribeCertificateAuthorityAuditReport -> String)
-> ([DescribeCertificateAuthorityAuditReport] -> ShowS)
-> Show DescribeCertificateAuthorityAuditReport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCertificateAuthorityAuditReport] -> ShowS
$cshowList :: [DescribeCertificateAuthorityAuditReport] -> ShowS
show :: DescribeCertificateAuthorityAuditReport -> String
$cshow :: DescribeCertificateAuthorityAuditReport -> String
showsPrec :: Int -> DescribeCertificateAuthorityAuditReport -> ShowS
$cshowsPrec :: Int -> DescribeCertificateAuthorityAuditReport -> ShowS
Prelude.Show, (forall x.
 DescribeCertificateAuthorityAuditReport
 -> Rep DescribeCertificateAuthorityAuditReport x)
-> (forall x.
    Rep DescribeCertificateAuthorityAuditReport x
    -> DescribeCertificateAuthorityAuditReport)
-> Generic DescribeCertificateAuthorityAuditReport
forall x.
Rep DescribeCertificateAuthorityAuditReport x
-> DescribeCertificateAuthorityAuditReport
forall x.
DescribeCertificateAuthorityAuditReport
-> Rep DescribeCertificateAuthorityAuditReport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCertificateAuthorityAuditReport x
-> DescribeCertificateAuthorityAuditReport
$cfrom :: forall x.
DescribeCertificateAuthorityAuditReport
-> Rep DescribeCertificateAuthorityAuditReport x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCertificateAuthorityAuditReport' 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', 'describeCertificateAuthorityAuditReport_certificateAuthorityArn' - The Amazon Resource Name (ARN) of the private CA. This must be of the
-- form:
--
-- @arn:aws:acm-pca:region:account:certificate-authority\/12345678-1234-1234-1234-123456789012 @.
--
-- 'auditReportId', 'describeCertificateAuthorityAuditReport_auditReportId' - The report ID returned by calling the
-- <https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html CreateCertificateAuthorityAuditReport>
-- action.
newDescribeCertificateAuthorityAuditReport ::
  -- | 'certificateAuthorityArn'
  Prelude.Text ->
  -- | 'auditReportId'
  Prelude.Text ->
  DescribeCertificateAuthorityAuditReport
newDescribeCertificateAuthorityAuditReport :: Text -> Text -> DescribeCertificateAuthorityAuditReport
newDescribeCertificateAuthorityAuditReport
  Text
pCertificateAuthorityArn_
  Text
pAuditReportId_ =
    DescribeCertificateAuthorityAuditReport' :: Text -> Text -> DescribeCertificateAuthorityAuditReport
DescribeCertificateAuthorityAuditReport'
      { $sel:certificateAuthorityArn:DescribeCertificateAuthorityAuditReport' :: Text
certificateAuthorityArn =
          Text
pCertificateAuthorityArn_,
        $sel:auditReportId:DescribeCertificateAuthorityAuditReport' :: Text
auditReportId = Text
pAuditReportId_
      }

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

-- | The report ID returned by calling the
-- <https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html CreateCertificateAuthorityAuditReport>
-- action.
describeCertificateAuthorityAuditReport_auditReportId :: Lens.Lens' DescribeCertificateAuthorityAuditReport Prelude.Text
describeCertificateAuthorityAuditReport_auditReportId :: (Text -> f Text)
-> DescribeCertificateAuthorityAuditReport
-> f DescribeCertificateAuthorityAuditReport
describeCertificateAuthorityAuditReport_auditReportId = (DescribeCertificateAuthorityAuditReport -> Text)
-> (DescribeCertificateAuthorityAuditReport
    -> Text -> DescribeCertificateAuthorityAuditReport)
-> Lens
     DescribeCertificateAuthorityAuditReport
     DescribeCertificateAuthorityAuditReport
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCertificateAuthorityAuditReport' {Text
auditReportId :: Text
$sel:auditReportId:DescribeCertificateAuthorityAuditReport' :: DescribeCertificateAuthorityAuditReport -> Text
auditReportId} -> Text
auditReportId) (\s :: DescribeCertificateAuthorityAuditReport
s@DescribeCertificateAuthorityAuditReport' {} Text
a -> DescribeCertificateAuthorityAuditReport
s {$sel:auditReportId:DescribeCertificateAuthorityAuditReport' :: Text
auditReportId = Text
a} :: DescribeCertificateAuthorityAuditReport)

instance
  Core.AWSRequest
    DescribeCertificateAuthorityAuditReport
  where
  type
    AWSResponse
      DescribeCertificateAuthorityAuditReport =
      DescribeCertificateAuthorityAuditReportResponse
  request :: DescribeCertificateAuthorityAuditReport
-> Request DescribeCertificateAuthorityAuditReport
request = Service
-> DescribeCertificateAuthorityAuditReport
-> Request DescribeCertificateAuthorityAuditReport
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeCertificateAuthorityAuditReport
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DescribeCertificateAuthorityAuditReport)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse DescribeCertificateAuthorityAuditReport))
-> Logger
-> Service
-> Proxy DescribeCertificateAuthorityAuditReport
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DescribeCertificateAuthorityAuditReport)))
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 POSIX
-> Maybe AuditReportStatus
-> Maybe Text
-> Int
-> DescribeCertificateAuthorityAuditReportResponse
DescribeCertificateAuthorityAuditReportResponse'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe AuditReportStatus
 -> Maybe Text
 -> Int
 -> DescribeCertificateAuthorityAuditReportResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe AuditReportStatus
      -> Maybe Text
      -> Int
      -> DescribeCertificateAuthorityAuditReportResponse)
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 POSIX
   -> Maybe AuditReportStatus
   -> Maybe Text
   -> Int
   -> DescribeCertificateAuthorityAuditReportResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe AuditReportStatus
      -> Maybe Text
      -> Int
      -> DescribeCertificateAuthorityAuditReportResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreatedAt")
              Either
  String
  (Maybe AuditReportStatus
   -> Maybe Text
   -> Int
   -> DescribeCertificateAuthorityAuditReportResponse)
-> Either String (Maybe AuditReportStatus)
-> Either
     String
     (Maybe Text
      -> Int -> DescribeCertificateAuthorityAuditReportResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AuditReportStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AuditReportStatus")
              Either
  String
  (Maybe Text
   -> Int -> DescribeCertificateAuthorityAuditReportResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> DescribeCertificateAuthorityAuditReportResponse)
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
"S3BucketName")
              Either
  String (Int -> DescribeCertificateAuthorityAuditReportResponse)
-> Either String Int
-> Either String DescribeCertificateAuthorityAuditReportResponse
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
    DescribeCertificateAuthorityAuditReport

instance
  Prelude.NFData
    DescribeCertificateAuthorityAuditReport

instance
  Core.ToHeaders
    DescribeCertificateAuthorityAuditReport
  where
  toHeaders :: DescribeCertificateAuthorityAuditReport -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> DescribeCertificateAuthorityAuditReport -> 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.DescribeCertificateAuthorityAuditReport" ::
                          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
    DescribeCertificateAuthorityAuditReport
  where
  toJSON :: DescribeCertificateAuthorityAuditReport -> Value
toJSON DescribeCertificateAuthorityAuditReport' {Text
auditReportId :: Text
certificateAuthorityArn :: Text
$sel:auditReportId:DescribeCertificateAuthorityAuditReport' :: DescribeCertificateAuthorityAuditReport -> Text
$sel:certificateAuthorityArn:DescribeCertificateAuthorityAuditReport' :: DescribeCertificateAuthorityAuditReport -> 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
"AuditReportId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
auditReportId)
          ]
      )

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

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

-- | /See:/ 'newDescribeCertificateAuthorityAuditReportResponse' smart constructor.
data DescribeCertificateAuthorityAuditReportResponse = DescribeCertificateAuthorityAuditReportResponse'
  { -- | S3 __key__ that uniquely identifies the report file in your S3 bucket.
    DescribeCertificateAuthorityAuditReportResponse -> Maybe Text
s3Key :: Prelude.Maybe Prelude.Text,
    -- | The date and time at which the report was created.
    DescribeCertificateAuthorityAuditReportResponse -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | Specifies whether report creation is in progress, has succeeded, or has
    -- failed.
    DescribeCertificateAuthorityAuditReportResponse
-> Maybe AuditReportStatus
auditReportStatus :: Prelude.Maybe AuditReportStatus,
    -- | Name of the S3 bucket that contains the report.
    DescribeCertificateAuthorityAuditReportResponse -> Maybe Text
s3BucketName :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeCertificateAuthorityAuditReportResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeCertificateAuthorityAuditReportResponse
-> DescribeCertificateAuthorityAuditReportResponse -> Bool
(DescribeCertificateAuthorityAuditReportResponse
 -> DescribeCertificateAuthorityAuditReportResponse -> Bool)
-> (DescribeCertificateAuthorityAuditReportResponse
    -> DescribeCertificateAuthorityAuditReportResponse -> Bool)
-> Eq DescribeCertificateAuthorityAuditReportResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCertificateAuthorityAuditReportResponse
-> DescribeCertificateAuthorityAuditReportResponse -> Bool
$c/= :: DescribeCertificateAuthorityAuditReportResponse
-> DescribeCertificateAuthorityAuditReportResponse -> Bool
== :: DescribeCertificateAuthorityAuditReportResponse
-> DescribeCertificateAuthorityAuditReportResponse -> Bool
$c== :: DescribeCertificateAuthorityAuditReportResponse
-> DescribeCertificateAuthorityAuditReportResponse -> Bool
Prelude.Eq, ReadPrec [DescribeCertificateAuthorityAuditReportResponse]
ReadPrec DescribeCertificateAuthorityAuditReportResponse
Int -> ReadS DescribeCertificateAuthorityAuditReportResponse
ReadS [DescribeCertificateAuthorityAuditReportResponse]
(Int -> ReadS DescribeCertificateAuthorityAuditReportResponse)
-> ReadS [DescribeCertificateAuthorityAuditReportResponse]
-> ReadPrec DescribeCertificateAuthorityAuditReportResponse
-> ReadPrec [DescribeCertificateAuthorityAuditReportResponse]
-> Read DescribeCertificateAuthorityAuditReportResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCertificateAuthorityAuditReportResponse]
$creadListPrec :: ReadPrec [DescribeCertificateAuthorityAuditReportResponse]
readPrec :: ReadPrec DescribeCertificateAuthorityAuditReportResponse
$creadPrec :: ReadPrec DescribeCertificateAuthorityAuditReportResponse
readList :: ReadS [DescribeCertificateAuthorityAuditReportResponse]
$creadList :: ReadS [DescribeCertificateAuthorityAuditReportResponse]
readsPrec :: Int -> ReadS DescribeCertificateAuthorityAuditReportResponse
$creadsPrec :: Int -> ReadS DescribeCertificateAuthorityAuditReportResponse
Prelude.Read, Int -> DescribeCertificateAuthorityAuditReportResponse -> ShowS
[DescribeCertificateAuthorityAuditReportResponse] -> ShowS
DescribeCertificateAuthorityAuditReportResponse -> String
(Int -> DescribeCertificateAuthorityAuditReportResponse -> ShowS)
-> (DescribeCertificateAuthorityAuditReportResponse -> String)
-> ([DescribeCertificateAuthorityAuditReportResponse] -> ShowS)
-> Show DescribeCertificateAuthorityAuditReportResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCertificateAuthorityAuditReportResponse] -> ShowS
$cshowList :: [DescribeCertificateAuthorityAuditReportResponse] -> ShowS
show :: DescribeCertificateAuthorityAuditReportResponse -> String
$cshow :: DescribeCertificateAuthorityAuditReportResponse -> String
showsPrec :: Int -> DescribeCertificateAuthorityAuditReportResponse -> ShowS
$cshowsPrec :: Int -> DescribeCertificateAuthorityAuditReportResponse -> ShowS
Prelude.Show, (forall x.
 DescribeCertificateAuthorityAuditReportResponse
 -> Rep DescribeCertificateAuthorityAuditReportResponse x)
-> (forall x.
    Rep DescribeCertificateAuthorityAuditReportResponse x
    -> DescribeCertificateAuthorityAuditReportResponse)
-> Generic DescribeCertificateAuthorityAuditReportResponse
forall x.
Rep DescribeCertificateAuthorityAuditReportResponse x
-> DescribeCertificateAuthorityAuditReportResponse
forall x.
DescribeCertificateAuthorityAuditReportResponse
-> Rep DescribeCertificateAuthorityAuditReportResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCertificateAuthorityAuditReportResponse x
-> DescribeCertificateAuthorityAuditReportResponse
$cfrom :: forall x.
DescribeCertificateAuthorityAuditReportResponse
-> Rep DescribeCertificateAuthorityAuditReportResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCertificateAuthorityAuditReportResponse' 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', 'describeCertificateAuthorityAuditReportResponse_s3Key' - S3 __key__ that uniquely identifies the report file in your S3 bucket.
--
-- 'createdAt', 'describeCertificateAuthorityAuditReportResponse_createdAt' - The date and time at which the report was created.
--
-- 'auditReportStatus', 'describeCertificateAuthorityAuditReportResponse_auditReportStatus' - Specifies whether report creation is in progress, has succeeded, or has
-- failed.
--
-- 's3BucketName', 'describeCertificateAuthorityAuditReportResponse_s3BucketName' - Name of the S3 bucket that contains the report.
--
-- 'httpStatus', 'describeCertificateAuthorityAuditReportResponse_httpStatus' - The response's http status code.
newDescribeCertificateAuthorityAuditReportResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeCertificateAuthorityAuditReportResponse
newDescribeCertificateAuthorityAuditReportResponse :: Int -> DescribeCertificateAuthorityAuditReportResponse
newDescribeCertificateAuthorityAuditReportResponse
  Int
pHttpStatus_ =
    DescribeCertificateAuthorityAuditReportResponse' :: Maybe Text
-> Maybe POSIX
-> Maybe AuditReportStatus
-> Maybe Text
-> Int
-> DescribeCertificateAuthorityAuditReportResponse
DescribeCertificateAuthorityAuditReportResponse'
      { $sel:s3Key:DescribeCertificateAuthorityAuditReportResponse' :: Maybe Text
s3Key =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:createdAt:DescribeCertificateAuthorityAuditReportResponse' :: Maybe POSIX
createdAt =
          Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:auditReportStatus:DescribeCertificateAuthorityAuditReportResponse' :: Maybe AuditReportStatus
auditReportStatus =
          Maybe AuditReportStatus
forall a. Maybe a
Prelude.Nothing,
        $sel:s3BucketName:DescribeCertificateAuthorityAuditReportResponse' :: Maybe Text
s3BucketName =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeCertificateAuthorityAuditReportResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

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

-- | The date and time at which the report was created.
describeCertificateAuthorityAuditReportResponse_createdAt :: Lens.Lens' DescribeCertificateAuthorityAuditReportResponse (Prelude.Maybe Prelude.UTCTime)
describeCertificateAuthorityAuditReportResponse_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeCertificateAuthorityAuditReportResponse
-> f DescribeCertificateAuthorityAuditReportResponse
describeCertificateAuthorityAuditReportResponse_createdAt = (DescribeCertificateAuthorityAuditReportResponse -> Maybe POSIX)
-> (DescribeCertificateAuthorityAuditReportResponse
    -> Maybe POSIX -> DescribeCertificateAuthorityAuditReportResponse)
-> Lens
     DescribeCertificateAuthorityAuditReportResponse
     DescribeCertificateAuthorityAuditReportResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCertificateAuthorityAuditReportResponse' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:DescribeCertificateAuthorityAuditReportResponse' :: DescribeCertificateAuthorityAuditReportResponse -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: DescribeCertificateAuthorityAuditReportResponse
s@DescribeCertificateAuthorityAuditReportResponse' {} Maybe POSIX
a -> DescribeCertificateAuthorityAuditReportResponse
s {$sel:createdAt:DescribeCertificateAuthorityAuditReportResponse' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: DescribeCertificateAuthorityAuditReportResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeCertificateAuthorityAuditReportResponse
 -> f DescribeCertificateAuthorityAuditReportResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeCertificateAuthorityAuditReportResponse
-> f DescribeCertificateAuthorityAuditReportResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Specifies whether report creation is in progress, has succeeded, or has
-- failed.
describeCertificateAuthorityAuditReportResponse_auditReportStatus :: Lens.Lens' DescribeCertificateAuthorityAuditReportResponse (Prelude.Maybe AuditReportStatus)
describeCertificateAuthorityAuditReportResponse_auditReportStatus :: (Maybe AuditReportStatus -> f (Maybe AuditReportStatus))
-> DescribeCertificateAuthorityAuditReportResponse
-> f DescribeCertificateAuthorityAuditReportResponse
describeCertificateAuthorityAuditReportResponse_auditReportStatus = (DescribeCertificateAuthorityAuditReportResponse
 -> Maybe AuditReportStatus)
-> (DescribeCertificateAuthorityAuditReportResponse
    -> Maybe AuditReportStatus
    -> DescribeCertificateAuthorityAuditReportResponse)
-> Lens
     DescribeCertificateAuthorityAuditReportResponse
     DescribeCertificateAuthorityAuditReportResponse
     (Maybe AuditReportStatus)
     (Maybe AuditReportStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCertificateAuthorityAuditReportResponse' {Maybe AuditReportStatus
auditReportStatus :: Maybe AuditReportStatus
$sel:auditReportStatus:DescribeCertificateAuthorityAuditReportResponse' :: DescribeCertificateAuthorityAuditReportResponse
-> Maybe AuditReportStatus
auditReportStatus} -> Maybe AuditReportStatus
auditReportStatus) (\s :: DescribeCertificateAuthorityAuditReportResponse
s@DescribeCertificateAuthorityAuditReportResponse' {} Maybe AuditReportStatus
a -> DescribeCertificateAuthorityAuditReportResponse
s {$sel:auditReportStatus:DescribeCertificateAuthorityAuditReportResponse' :: Maybe AuditReportStatus
auditReportStatus = Maybe AuditReportStatus
a} :: DescribeCertificateAuthorityAuditReportResponse)

-- | Name of the S3 bucket that contains the report.
describeCertificateAuthorityAuditReportResponse_s3BucketName :: Lens.Lens' DescribeCertificateAuthorityAuditReportResponse (Prelude.Maybe Prelude.Text)
describeCertificateAuthorityAuditReportResponse_s3BucketName :: (Maybe Text -> f (Maybe Text))
-> DescribeCertificateAuthorityAuditReportResponse
-> f DescribeCertificateAuthorityAuditReportResponse
describeCertificateAuthorityAuditReportResponse_s3BucketName = (DescribeCertificateAuthorityAuditReportResponse -> Maybe Text)
-> (DescribeCertificateAuthorityAuditReportResponse
    -> Maybe Text -> DescribeCertificateAuthorityAuditReportResponse)
-> Lens
     DescribeCertificateAuthorityAuditReportResponse
     DescribeCertificateAuthorityAuditReportResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCertificateAuthorityAuditReportResponse' {Maybe Text
s3BucketName :: Maybe Text
$sel:s3BucketName:DescribeCertificateAuthorityAuditReportResponse' :: DescribeCertificateAuthorityAuditReportResponse -> Maybe Text
s3BucketName} -> Maybe Text
s3BucketName) (\s :: DescribeCertificateAuthorityAuditReportResponse
s@DescribeCertificateAuthorityAuditReportResponse' {} Maybe Text
a -> DescribeCertificateAuthorityAuditReportResponse
s {$sel:s3BucketName:DescribeCertificateAuthorityAuditReportResponse' :: Maybe Text
s3BucketName = Maybe Text
a} :: DescribeCertificateAuthorityAuditReportResponse)

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

instance
  Prelude.NFData
    DescribeCertificateAuthorityAuditReportResponse