{-# 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.CertificateManager.DescribeCertificate -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Returns detailed metadata about the specified ACM certificate. -- -- If you have just created a certificate using the @RequestCertificate@ -- action, there is a delay of several seconds before you can retrieve -- information about it. module Amazonka.CertificateManager.DescribeCertificate ( -- * Creating a Request DescribeCertificate (..), newDescribeCertificate, -- * Request Lenses describeCertificate_certificateArn, -- * Destructuring the Response DescribeCertificateResponse (..), newDescribeCertificateResponse, -- * Response Lenses describeCertificateResponse_certificate, describeCertificateResponse_httpStatus, ) where import Amazonka.CertificateManager.Types import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import qualified Amazonka.Prelude as Prelude import qualified Amazonka.Request as Request import qualified Amazonka.Response as Response -- | /See:/ 'newDescribeCertificate' smart constructor. data DescribeCertificate = DescribeCertificate' { -- | The Amazon Resource Name (ARN) of the ACM certificate. The ARN must have -- the following form: -- -- @arn:aws:acm:region:123456789012:certificate\/12345678-1234-1234-1234-123456789012@ -- -- For more information about ARNs, see -- . certificateArn :: Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'DescribeCertificate' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'certificateArn', 'describeCertificate_certificateArn' - The Amazon Resource Name (ARN) of the ACM certificate. The ARN must have -- the following form: -- -- @arn:aws:acm:region:123456789012:certificate\/12345678-1234-1234-1234-123456789012@ -- -- For more information about ARNs, see -- . newDescribeCertificate :: -- | 'certificateArn' Prelude.Text -> DescribeCertificate newDescribeCertificate pCertificateArn_ = DescribeCertificate' { certificateArn = pCertificateArn_ } -- | The Amazon Resource Name (ARN) of the ACM certificate. The ARN must have -- the following form: -- -- @arn:aws:acm:region:123456789012:certificate\/12345678-1234-1234-1234-123456789012@ -- -- For more information about ARNs, see -- . describeCertificate_certificateArn :: Lens.Lens' DescribeCertificate Prelude.Text describeCertificate_certificateArn = Lens.lens (\DescribeCertificate' {certificateArn} -> certificateArn) (\s@DescribeCertificate' {} a -> s {certificateArn = a} :: DescribeCertificate) instance Core.AWSRequest DescribeCertificate where type AWSResponse DescribeCertificate = DescribeCertificateResponse request overrides = Request.postJSON (overrides defaultService) response = Response.receiveJSON ( \s h x -> DescribeCertificateResponse' Prelude.<$> (x Data..?> "Certificate") Prelude.<*> (Prelude.pure (Prelude.fromEnum s)) ) instance Prelude.Hashable DescribeCertificate where hashWithSalt _salt DescribeCertificate' {..} = _salt `Prelude.hashWithSalt` certificateArn instance Prelude.NFData DescribeCertificate where rnf DescribeCertificate' {..} = Prelude.rnf certificateArn instance Data.ToHeaders DescribeCertificate where toHeaders = Prelude.const ( Prelude.mconcat [ "X-Amz-Target" Data.=# ( "CertificateManager.DescribeCertificate" :: Prelude.ByteString ), "Content-Type" Data.=# ( "application/x-amz-json-1.1" :: Prelude.ByteString ) ] ) instance Data.ToJSON DescribeCertificate where toJSON DescribeCertificate' {..} = Data.object ( Prelude.catMaybes [ Prelude.Just ("CertificateArn" Data..= certificateArn) ] ) instance Data.ToPath DescribeCertificate where toPath = Prelude.const "/" instance Data.ToQuery DescribeCertificate where toQuery = Prelude.const Prelude.mempty -- | /See:/ 'newDescribeCertificateResponse' smart constructor. data DescribeCertificateResponse = DescribeCertificateResponse' { -- | Metadata about an ACM certificate. certificate :: Prelude.Maybe CertificateDetail, -- | The response's http status code. httpStatus :: Prelude.Int } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'DescribeCertificateResponse' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'certificate', 'describeCertificateResponse_certificate' - Metadata about an ACM certificate. -- -- 'httpStatus', 'describeCertificateResponse_httpStatus' - The response's http status code. newDescribeCertificateResponse :: -- | 'httpStatus' Prelude.Int -> DescribeCertificateResponse newDescribeCertificateResponse pHttpStatus_ = DescribeCertificateResponse' { certificate = Prelude.Nothing, httpStatus = pHttpStatus_ } -- | Metadata about an ACM certificate. describeCertificateResponse_certificate :: Lens.Lens' DescribeCertificateResponse (Prelude.Maybe CertificateDetail) describeCertificateResponse_certificate = Lens.lens (\DescribeCertificateResponse' {certificate} -> certificate) (\s@DescribeCertificateResponse' {} a -> s {certificate = a} :: DescribeCertificateResponse) -- | The response's http status code. describeCertificateResponse_httpStatus :: Lens.Lens' DescribeCertificateResponse Prelude.Int describeCertificateResponse_httpStatus = Lens.lens (\DescribeCertificateResponse' {httpStatus} -> httpStatus) (\s@DescribeCertificateResponse' {} a -> s {httpStatus = a} :: DescribeCertificateResponse) instance Prelude.NFData DescribeCertificateResponse where rnf DescribeCertificateResponse' {..} = Prelude.rnf certificate `Prelude.seq` Prelude.rnf httpStatus