{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.CertificateSummary
-- 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)
module Amazonka.CertificateManager.Types.CertificateSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | This structure is returned in the response object of ListCertificates
-- action.
--
-- /See:/ 'newCertificateSummary' smart constructor.
data CertificateSummary = CertificateSummary'
  { -- | Amazon Resource Name (ARN) of the certificate. This is of the form:
    --
    -- @arn:aws:acm:region:123456789012:certificate\/12345678-1234-1234-1234-123456789012@
    --
    -- For more information about ARNs, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>.
    CertificateSummary -> Maybe Text
certificateArn :: Prelude.Maybe Prelude.Text,
    -- | Fully qualified domain name (FQDN), such as www.example.com or
    -- example.com, for the certificate.
    CertificateSummary -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text
  }
  deriving (CertificateSummary -> CertificateSummary -> Bool
(CertificateSummary -> CertificateSummary -> Bool)
-> (CertificateSummary -> CertificateSummary -> Bool)
-> Eq CertificateSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CertificateSummary -> CertificateSummary -> Bool
$c/= :: CertificateSummary -> CertificateSummary -> Bool
== :: CertificateSummary -> CertificateSummary -> Bool
$c== :: CertificateSummary -> CertificateSummary -> Bool
Prelude.Eq, ReadPrec [CertificateSummary]
ReadPrec CertificateSummary
Int -> ReadS CertificateSummary
ReadS [CertificateSummary]
(Int -> ReadS CertificateSummary)
-> ReadS [CertificateSummary]
-> ReadPrec CertificateSummary
-> ReadPrec [CertificateSummary]
-> Read CertificateSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CertificateSummary]
$creadListPrec :: ReadPrec [CertificateSummary]
readPrec :: ReadPrec CertificateSummary
$creadPrec :: ReadPrec CertificateSummary
readList :: ReadS [CertificateSummary]
$creadList :: ReadS [CertificateSummary]
readsPrec :: Int -> ReadS CertificateSummary
$creadsPrec :: Int -> ReadS CertificateSummary
Prelude.Read, Int -> CertificateSummary -> ShowS
[CertificateSummary] -> ShowS
CertificateSummary -> String
(Int -> CertificateSummary -> ShowS)
-> (CertificateSummary -> String)
-> ([CertificateSummary] -> ShowS)
-> Show CertificateSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CertificateSummary] -> ShowS
$cshowList :: [CertificateSummary] -> ShowS
show :: CertificateSummary -> String
$cshow :: CertificateSummary -> String
showsPrec :: Int -> CertificateSummary -> ShowS
$cshowsPrec :: Int -> CertificateSummary -> ShowS
Prelude.Show, (forall x. CertificateSummary -> Rep CertificateSummary x)
-> (forall x. Rep CertificateSummary x -> CertificateSummary)
-> Generic CertificateSummary
forall x. Rep CertificateSummary x -> CertificateSummary
forall x. CertificateSummary -> Rep CertificateSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CertificateSummary x -> CertificateSummary
$cfrom :: forall x. CertificateSummary -> Rep CertificateSummary x
Prelude.Generic)

-- |
-- Create a value of 'CertificateSummary' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'certificateArn', 'certificateSummary_certificateArn' - Amazon Resource Name (ARN) of the certificate. This is of the form:
--
-- @arn:aws:acm:region:123456789012:certificate\/12345678-1234-1234-1234-123456789012@
--
-- For more information about ARNs, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>.
--
-- 'domainName', 'certificateSummary_domainName' - Fully qualified domain name (FQDN), such as www.example.com or
-- example.com, for the certificate.
newCertificateSummary ::
  CertificateSummary
newCertificateSummary :: CertificateSummary
newCertificateSummary =
  CertificateSummary' :: Maybe Text -> Maybe Text -> CertificateSummary
CertificateSummary'
    { $sel:certificateArn:CertificateSummary' :: Maybe Text
certificateArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:CertificateSummary' :: Maybe Text
domainName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Amazon Resource Name (ARN) of the certificate. This is of the form:
--
-- @arn:aws:acm:region:123456789012:certificate\/12345678-1234-1234-1234-123456789012@
--
-- For more information about ARNs, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>.
certificateSummary_certificateArn :: Lens.Lens' CertificateSummary (Prelude.Maybe Prelude.Text)
certificateSummary_certificateArn :: (Maybe Text -> f (Maybe Text))
-> CertificateSummary -> f CertificateSummary
certificateSummary_certificateArn = (CertificateSummary -> Maybe Text)
-> (CertificateSummary -> Maybe Text -> CertificateSummary)
-> Lens
     CertificateSummary CertificateSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateSummary' {Maybe Text
certificateArn :: Maybe Text
$sel:certificateArn:CertificateSummary' :: CertificateSummary -> Maybe Text
certificateArn} -> Maybe Text
certificateArn) (\s :: CertificateSummary
s@CertificateSummary' {} Maybe Text
a -> CertificateSummary
s {$sel:certificateArn:CertificateSummary' :: Maybe Text
certificateArn = Maybe Text
a} :: CertificateSummary)

-- | Fully qualified domain name (FQDN), such as www.example.com or
-- example.com, for the certificate.
certificateSummary_domainName :: Lens.Lens' CertificateSummary (Prelude.Maybe Prelude.Text)
certificateSummary_domainName :: (Maybe Text -> f (Maybe Text))
-> CertificateSummary -> f CertificateSummary
certificateSummary_domainName = (CertificateSummary -> Maybe Text)
-> (CertificateSummary -> Maybe Text -> CertificateSummary)
-> Lens
     CertificateSummary CertificateSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateSummary' {Maybe Text
domainName :: Maybe Text
$sel:domainName:CertificateSummary' :: CertificateSummary -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: CertificateSummary
s@CertificateSummary' {} Maybe Text
a -> CertificateSummary
s {$sel:domainName:CertificateSummary' :: Maybe Text
domainName = Maybe Text
a} :: CertificateSummary)

instance Core.FromJSON CertificateSummary where
  parseJSON :: Value -> Parser CertificateSummary
parseJSON =
    String
-> (Object -> Parser CertificateSummary)
-> Value
-> Parser CertificateSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CertificateSummary"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> CertificateSummary
CertificateSummary'
            (Maybe Text -> Maybe Text -> CertificateSummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> CertificateSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CertificateArn")
            Parser (Maybe Text -> CertificateSummary)
-> Parser (Maybe Text) -> Parser CertificateSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DomainName")
      )

instance Prelude.Hashable CertificateSummary

instance Prelude.NFData CertificateSummary