{-# 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.AwsCertificateManagerCertificateResourceRecord
-- 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.AwsCertificateManagerCertificateResourceRecord where

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

-- | Provides details about the CNAME record that is added to the DNS
-- database for domain validation.
--
-- /See:/ 'newAwsCertificateManagerCertificateResourceRecord' smart constructor.
data AwsCertificateManagerCertificateResourceRecord = AwsCertificateManagerCertificateResourceRecord'
  { -- | The value of the resource.
    AwsCertificateManagerCertificateResourceRecord -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
    -- | The name of the resource.
    AwsCertificateManagerCertificateResourceRecord -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The type of resource.
    AwsCertificateManagerCertificateResourceRecord -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsCertificateManagerCertificateResourceRecord
-> AwsCertificateManagerCertificateResourceRecord -> Bool
(AwsCertificateManagerCertificateResourceRecord
 -> AwsCertificateManagerCertificateResourceRecord -> Bool)
-> (AwsCertificateManagerCertificateResourceRecord
    -> AwsCertificateManagerCertificateResourceRecord -> Bool)
-> Eq AwsCertificateManagerCertificateResourceRecord
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsCertificateManagerCertificateResourceRecord
-> AwsCertificateManagerCertificateResourceRecord -> Bool
$c/= :: AwsCertificateManagerCertificateResourceRecord
-> AwsCertificateManagerCertificateResourceRecord -> Bool
== :: AwsCertificateManagerCertificateResourceRecord
-> AwsCertificateManagerCertificateResourceRecord -> Bool
$c== :: AwsCertificateManagerCertificateResourceRecord
-> AwsCertificateManagerCertificateResourceRecord -> Bool
Prelude.Eq, ReadPrec [AwsCertificateManagerCertificateResourceRecord]
ReadPrec AwsCertificateManagerCertificateResourceRecord
Int -> ReadS AwsCertificateManagerCertificateResourceRecord
ReadS [AwsCertificateManagerCertificateResourceRecord]
(Int -> ReadS AwsCertificateManagerCertificateResourceRecord)
-> ReadS [AwsCertificateManagerCertificateResourceRecord]
-> ReadPrec AwsCertificateManagerCertificateResourceRecord
-> ReadPrec [AwsCertificateManagerCertificateResourceRecord]
-> Read AwsCertificateManagerCertificateResourceRecord
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsCertificateManagerCertificateResourceRecord]
$creadListPrec :: ReadPrec [AwsCertificateManagerCertificateResourceRecord]
readPrec :: ReadPrec AwsCertificateManagerCertificateResourceRecord
$creadPrec :: ReadPrec AwsCertificateManagerCertificateResourceRecord
readList :: ReadS [AwsCertificateManagerCertificateResourceRecord]
$creadList :: ReadS [AwsCertificateManagerCertificateResourceRecord]
readsPrec :: Int -> ReadS AwsCertificateManagerCertificateResourceRecord
$creadsPrec :: Int -> ReadS AwsCertificateManagerCertificateResourceRecord
Prelude.Read, Int -> AwsCertificateManagerCertificateResourceRecord -> ShowS
[AwsCertificateManagerCertificateResourceRecord] -> ShowS
AwsCertificateManagerCertificateResourceRecord -> String
(Int -> AwsCertificateManagerCertificateResourceRecord -> ShowS)
-> (AwsCertificateManagerCertificateResourceRecord -> String)
-> ([AwsCertificateManagerCertificateResourceRecord] -> ShowS)
-> Show AwsCertificateManagerCertificateResourceRecord
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsCertificateManagerCertificateResourceRecord] -> ShowS
$cshowList :: [AwsCertificateManagerCertificateResourceRecord] -> ShowS
show :: AwsCertificateManagerCertificateResourceRecord -> String
$cshow :: AwsCertificateManagerCertificateResourceRecord -> String
showsPrec :: Int -> AwsCertificateManagerCertificateResourceRecord -> ShowS
$cshowsPrec :: Int -> AwsCertificateManagerCertificateResourceRecord -> ShowS
Prelude.Show, (forall x.
 AwsCertificateManagerCertificateResourceRecord
 -> Rep AwsCertificateManagerCertificateResourceRecord x)
-> (forall x.
    Rep AwsCertificateManagerCertificateResourceRecord x
    -> AwsCertificateManagerCertificateResourceRecord)
-> Generic AwsCertificateManagerCertificateResourceRecord
forall x.
Rep AwsCertificateManagerCertificateResourceRecord x
-> AwsCertificateManagerCertificateResourceRecord
forall x.
AwsCertificateManagerCertificateResourceRecord
-> Rep AwsCertificateManagerCertificateResourceRecord x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsCertificateManagerCertificateResourceRecord x
-> AwsCertificateManagerCertificateResourceRecord
$cfrom :: forall x.
AwsCertificateManagerCertificateResourceRecord
-> Rep AwsCertificateManagerCertificateResourceRecord x
Prelude.Generic)

-- |
-- Create a value of 'AwsCertificateManagerCertificateResourceRecord' 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:
--
-- 'value', 'awsCertificateManagerCertificateResourceRecord_value' - The value of the resource.
--
-- 'name', 'awsCertificateManagerCertificateResourceRecord_name' - The name of the resource.
--
-- 'type'', 'awsCertificateManagerCertificateResourceRecord_type' - The type of resource.
newAwsCertificateManagerCertificateResourceRecord ::
  AwsCertificateManagerCertificateResourceRecord
newAwsCertificateManagerCertificateResourceRecord :: AwsCertificateManagerCertificateResourceRecord
newAwsCertificateManagerCertificateResourceRecord =
  AwsCertificateManagerCertificateResourceRecord' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsCertificateManagerCertificateResourceRecord
AwsCertificateManagerCertificateResourceRecord'
    { $sel:value:AwsCertificateManagerCertificateResourceRecord' :: Maybe Text
value =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:AwsCertificateManagerCertificateResourceRecord' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':AwsCertificateManagerCertificateResourceRecord' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The value of the resource.
awsCertificateManagerCertificateResourceRecord_value :: Lens.Lens' AwsCertificateManagerCertificateResourceRecord (Prelude.Maybe Prelude.Text)
awsCertificateManagerCertificateResourceRecord_value :: (Maybe Text -> f (Maybe Text))
-> AwsCertificateManagerCertificateResourceRecord
-> f AwsCertificateManagerCertificateResourceRecord
awsCertificateManagerCertificateResourceRecord_value = (AwsCertificateManagerCertificateResourceRecord -> Maybe Text)
-> (AwsCertificateManagerCertificateResourceRecord
    -> Maybe Text -> AwsCertificateManagerCertificateResourceRecord)
-> Lens
     AwsCertificateManagerCertificateResourceRecord
     AwsCertificateManagerCertificateResourceRecord
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCertificateManagerCertificateResourceRecord' {Maybe Text
value :: Maybe Text
$sel:value:AwsCertificateManagerCertificateResourceRecord' :: AwsCertificateManagerCertificateResourceRecord -> Maybe Text
value} -> Maybe Text
value) (\s :: AwsCertificateManagerCertificateResourceRecord
s@AwsCertificateManagerCertificateResourceRecord' {} Maybe Text
a -> AwsCertificateManagerCertificateResourceRecord
s {$sel:value:AwsCertificateManagerCertificateResourceRecord' :: Maybe Text
value = Maybe Text
a} :: AwsCertificateManagerCertificateResourceRecord)

-- | The name of the resource.
awsCertificateManagerCertificateResourceRecord_name :: Lens.Lens' AwsCertificateManagerCertificateResourceRecord (Prelude.Maybe Prelude.Text)
awsCertificateManagerCertificateResourceRecord_name :: (Maybe Text -> f (Maybe Text))
-> AwsCertificateManagerCertificateResourceRecord
-> f AwsCertificateManagerCertificateResourceRecord
awsCertificateManagerCertificateResourceRecord_name = (AwsCertificateManagerCertificateResourceRecord -> Maybe Text)
-> (AwsCertificateManagerCertificateResourceRecord
    -> Maybe Text -> AwsCertificateManagerCertificateResourceRecord)
-> Lens
     AwsCertificateManagerCertificateResourceRecord
     AwsCertificateManagerCertificateResourceRecord
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCertificateManagerCertificateResourceRecord' {Maybe Text
name :: Maybe Text
$sel:name:AwsCertificateManagerCertificateResourceRecord' :: AwsCertificateManagerCertificateResourceRecord -> Maybe Text
name} -> Maybe Text
name) (\s :: AwsCertificateManagerCertificateResourceRecord
s@AwsCertificateManagerCertificateResourceRecord' {} Maybe Text
a -> AwsCertificateManagerCertificateResourceRecord
s {$sel:name:AwsCertificateManagerCertificateResourceRecord' :: Maybe Text
name = Maybe Text
a} :: AwsCertificateManagerCertificateResourceRecord)

-- | The type of resource.
awsCertificateManagerCertificateResourceRecord_type :: Lens.Lens' AwsCertificateManagerCertificateResourceRecord (Prelude.Maybe Prelude.Text)
awsCertificateManagerCertificateResourceRecord_type :: (Maybe Text -> f (Maybe Text))
-> AwsCertificateManagerCertificateResourceRecord
-> f AwsCertificateManagerCertificateResourceRecord
awsCertificateManagerCertificateResourceRecord_type = (AwsCertificateManagerCertificateResourceRecord -> Maybe Text)
-> (AwsCertificateManagerCertificateResourceRecord
    -> Maybe Text -> AwsCertificateManagerCertificateResourceRecord)
-> Lens
     AwsCertificateManagerCertificateResourceRecord
     AwsCertificateManagerCertificateResourceRecord
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCertificateManagerCertificateResourceRecord' {Maybe Text
type' :: Maybe Text
$sel:type':AwsCertificateManagerCertificateResourceRecord' :: AwsCertificateManagerCertificateResourceRecord -> Maybe Text
type'} -> Maybe Text
type') (\s :: AwsCertificateManagerCertificateResourceRecord
s@AwsCertificateManagerCertificateResourceRecord' {} Maybe Text
a -> AwsCertificateManagerCertificateResourceRecord
s {$sel:type':AwsCertificateManagerCertificateResourceRecord' :: Maybe Text
type' = Maybe Text
a} :: AwsCertificateManagerCertificateResourceRecord)

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

instance
  Prelude.Hashable
    AwsCertificateManagerCertificateResourceRecord

instance
  Prelude.NFData
    AwsCertificateManagerCertificateResourceRecord

instance
  Core.ToJSON
    AwsCertificateManagerCertificateResourceRecord
  where
  toJSON :: AwsCertificateManagerCertificateResourceRecord -> Value
toJSON
    AwsCertificateManagerCertificateResourceRecord' {Maybe Text
type' :: Maybe Text
name :: Maybe Text
value :: Maybe Text
$sel:type':AwsCertificateManagerCertificateResourceRecord' :: AwsCertificateManagerCertificateResourceRecord -> Maybe Text
$sel:name:AwsCertificateManagerCertificateResourceRecord' :: AwsCertificateManagerCertificateResourceRecord -> Maybe Text
$sel:value:AwsCertificateManagerCertificateResourceRecord' :: AwsCertificateManagerCertificateResourceRecord -> Maybe Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"Value" 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
value,
              (Text
"Name" 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
name,
              (Text
"Type" 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
type'
            ]
        )