{-# 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.SecurityHub.Types.AwsCertificateManagerCertificateOptions
-- 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.SecurityHub.Types.AwsCertificateManagerCertificateOptions where

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

-- | Contains other options for the certificate.
--
-- /See:/ 'newAwsCertificateManagerCertificateOptions' smart constructor.
data AwsCertificateManagerCertificateOptions = AwsCertificateManagerCertificateOptions'
  { -- | Whether to add the certificate to a transparency log.
    --
    -- Valid values: @DISABLED@ | @ENABLED@
    AwsCertificateManagerCertificateOptions -> Maybe Text
certificateTransparencyLoggingPreference :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsCertificateManagerCertificateOptions
-> AwsCertificateManagerCertificateOptions -> Bool
(AwsCertificateManagerCertificateOptions
 -> AwsCertificateManagerCertificateOptions -> Bool)
-> (AwsCertificateManagerCertificateOptions
    -> AwsCertificateManagerCertificateOptions -> Bool)
-> Eq AwsCertificateManagerCertificateOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsCertificateManagerCertificateOptions
-> AwsCertificateManagerCertificateOptions -> Bool
$c/= :: AwsCertificateManagerCertificateOptions
-> AwsCertificateManagerCertificateOptions -> Bool
== :: AwsCertificateManagerCertificateOptions
-> AwsCertificateManagerCertificateOptions -> Bool
$c== :: AwsCertificateManagerCertificateOptions
-> AwsCertificateManagerCertificateOptions -> Bool
Prelude.Eq, ReadPrec [AwsCertificateManagerCertificateOptions]
ReadPrec AwsCertificateManagerCertificateOptions
Int -> ReadS AwsCertificateManagerCertificateOptions
ReadS [AwsCertificateManagerCertificateOptions]
(Int -> ReadS AwsCertificateManagerCertificateOptions)
-> ReadS [AwsCertificateManagerCertificateOptions]
-> ReadPrec AwsCertificateManagerCertificateOptions
-> ReadPrec [AwsCertificateManagerCertificateOptions]
-> Read AwsCertificateManagerCertificateOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsCertificateManagerCertificateOptions]
$creadListPrec :: ReadPrec [AwsCertificateManagerCertificateOptions]
readPrec :: ReadPrec AwsCertificateManagerCertificateOptions
$creadPrec :: ReadPrec AwsCertificateManagerCertificateOptions
readList :: ReadS [AwsCertificateManagerCertificateOptions]
$creadList :: ReadS [AwsCertificateManagerCertificateOptions]
readsPrec :: Int -> ReadS AwsCertificateManagerCertificateOptions
$creadsPrec :: Int -> ReadS AwsCertificateManagerCertificateOptions
Prelude.Read, Int -> AwsCertificateManagerCertificateOptions -> ShowS
[AwsCertificateManagerCertificateOptions] -> ShowS
AwsCertificateManagerCertificateOptions -> String
(Int -> AwsCertificateManagerCertificateOptions -> ShowS)
-> (AwsCertificateManagerCertificateOptions -> String)
-> ([AwsCertificateManagerCertificateOptions] -> ShowS)
-> Show AwsCertificateManagerCertificateOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsCertificateManagerCertificateOptions] -> ShowS
$cshowList :: [AwsCertificateManagerCertificateOptions] -> ShowS
show :: AwsCertificateManagerCertificateOptions -> String
$cshow :: AwsCertificateManagerCertificateOptions -> String
showsPrec :: Int -> AwsCertificateManagerCertificateOptions -> ShowS
$cshowsPrec :: Int -> AwsCertificateManagerCertificateOptions -> ShowS
Prelude.Show, (forall x.
 AwsCertificateManagerCertificateOptions
 -> Rep AwsCertificateManagerCertificateOptions x)
-> (forall x.
    Rep AwsCertificateManagerCertificateOptions x
    -> AwsCertificateManagerCertificateOptions)
-> Generic AwsCertificateManagerCertificateOptions
forall x.
Rep AwsCertificateManagerCertificateOptions x
-> AwsCertificateManagerCertificateOptions
forall x.
AwsCertificateManagerCertificateOptions
-> Rep AwsCertificateManagerCertificateOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsCertificateManagerCertificateOptions x
-> AwsCertificateManagerCertificateOptions
$cfrom :: forall x.
AwsCertificateManagerCertificateOptions
-> Rep AwsCertificateManagerCertificateOptions x
Prelude.Generic)

-- |
-- Create a value of 'AwsCertificateManagerCertificateOptions' 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:
--
-- 'certificateTransparencyLoggingPreference', 'awsCertificateManagerCertificateOptions_certificateTransparencyLoggingPreference' - Whether to add the certificate to a transparency log.
--
-- Valid values: @DISABLED@ | @ENABLED@
newAwsCertificateManagerCertificateOptions ::
  AwsCertificateManagerCertificateOptions
newAwsCertificateManagerCertificateOptions :: AwsCertificateManagerCertificateOptions
newAwsCertificateManagerCertificateOptions =
  AwsCertificateManagerCertificateOptions' :: Maybe Text -> AwsCertificateManagerCertificateOptions
AwsCertificateManagerCertificateOptions'
    { $sel:certificateTransparencyLoggingPreference:AwsCertificateManagerCertificateOptions' :: Maybe Text
certificateTransparencyLoggingPreference =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Whether to add the certificate to a transparency log.
--
-- Valid values: @DISABLED@ | @ENABLED@
awsCertificateManagerCertificateOptions_certificateTransparencyLoggingPreference :: Lens.Lens' AwsCertificateManagerCertificateOptions (Prelude.Maybe Prelude.Text)
awsCertificateManagerCertificateOptions_certificateTransparencyLoggingPreference :: (Maybe Text -> f (Maybe Text))
-> AwsCertificateManagerCertificateOptions
-> f AwsCertificateManagerCertificateOptions
awsCertificateManagerCertificateOptions_certificateTransparencyLoggingPreference = (AwsCertificateManagerCertificateOptions -> Maybe Text)
-> (AwsCertificateManagerCertificateOptions
    -> Maybe Text -> AwsCertificateManagerCertificateOptions)
-> Lens
     AwsCertificateManagerCertificateOptions
     AwsCertificateManagerCertificateOptions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCertificateManagerCertificateOptions' {Maybe Text
certificateTransparencyLoggingPreference :: Maybe Text
$sel:certificateTransparencyLoggingPreference:AwsCertificateManagerCertificateOptions' :: AwsCertificateManagerCertificateOptions -> Maybe Text
certificateTransparencyLoggingPreference} -> Maybe Text
certificateTransparencyLoggingPreference) (\s :: AwsCertificateManagerCertificateOptions
s@AwsCertificateManagerCertificateOptions' {} Maybe Text
a -> AwsCertificateManagerCertificateOptions
s {$sel:certificateTransparencyLoggingPreference:AwsCertificateManagerCertificateOptions' :: Maybe Text
certificateTransparencyLoggingPreference = Maybe Text
a} :: AwsCertificateManagerCertificateOptions)

instance
  Core.FromJSON
    AwsCertificateManagerCertificateOptions
  where
  parseJSON :: Value -> Parser AwsCertificateManagerCertificateOptions
parseJSON =
    String
-> (Object -> Parser AwsCertificateManagerCertificateOptions)
-> Value
-> Parser AwsCertificateManagerCertificateOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsCertificateManagerCertificateOptions"
      ( \Object
x ->
          Maybe Text -> AwsCertificateManagerCertificateOptions
AwsCertificateManagerCertificateOptions'
            (Maybe Text -> AwsCertificateManagerCertificateOptions)
-> Parser (Maybe Text)
-> Parser AwsCertificateManagerCertificateOptions
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
"CertificateTransparencyLoggingPreference"
                        )
      )

instance
  Prelude.Hashable
    AwsCertificateManagerCertificateOptions

instance
  Prelude.NFData
    AwsCertificateManagerCertificateOptions

instance
  Core.ToJSON
    AwsCertificateManagerCertificateOptions
  where
  toJSON :: AwsCertificateManagerCertificateOptions -> Value
toJSON AwsCertificateManagerCertificateOptions' {Maybe Text
certificateTransparencyLoggingPreference :: Maybe Text
$sel:certificateTransparencyLoggingPreference:AwsCertificateManagerCertificateOptions' :: AwsCertificateManagerCertificateOptions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CertificateTransparencyLoggingPreference" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
certificateTransparencyLoggingPreference
          ]
      )