{-# 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.Lightsail.Types.LoadBalancerTlsCertificateDomainValidationRecord
-- 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.Lightsail.Types.LoadBalancerTlsCertificateDomainValidationRecord where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.LoadBalancerTlsCertificateDomainStatus
import qualified Amazonka.Prelude as Prelude

-- | Describes the validation record of each domain name in the SSL\/TLS
-- certificate.
--
-- /See:/ 'newLoadBalancerTlsCertificateDomainValidationRecord' smart constructor.
data LoadBalancerTlsCertificateDomainValidationRecord = LoadBalancerTlsCertificateDomainValidationRecord'
  { -- | The value for that type.
    LoadBalancerTlsCertificateDomainValidationRecord -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
    -- | The domain name against which your SSL\/TLS certificate was validated.
    LoadBalancerTlsCertificateDomainValidationRecord -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
    -- | A fully qualified domain name in the certificate. For example,
    -- @example.com@.
    LoadBalancerTlsCertificateDomainValidationRecord -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The validation status. Valid values are listed below.
    LoadBalancerTlsCertificateDomainValidationRecord
-> Maybe LoadBalancerTlsCertificateDomainStatus
validationStatus :: Prelude.Maybe LoadBalancerTlsCertificateDomainStatus,
    -- | The type of validation record. For example, @CNAME@ for domain
    -- validation.
    LoadBalancerTlsCertificateDomainValidationRecord -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
  }
  deriving (LoadBalancerTlsCertificateDomainValidationRecord
-> LoadBalancerTlsCertificateDomainValidationRecord -> Bool
(LoadBalancerTlsCertificateDomainValidationRecord
 -> LoadBalancerTlsCertificateDomainValidationRecord -> Bool)
-> (LoadBalancerTlsCertificateDomainValidationRecord
    -> LoadBalancerTlsCertificateDomainValidationRecord -> Bool)
-> Eq LoadBalancerTlsCertificateDomainValidationRecord
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoadBalancerTlsCertificateDomainValidationRecord
-> LoadBalancerTlsCertificateDomainValidationRecord -> Bool
$c/= :: LoadBalancerTlsCertificateDomainValidationRecord
-> LoadBalancerTlsCertificateDomainValidationRecord -> Bool
== :: LoadBalancerTlsCertificateDomainValidationRecord
-> LoadBalancerTlsCertificateDomainValidationRecord -> Bool
$c== :: LoadBalancerTlsCertificateDomainValidationRecord
-> LoadBalancerTlsCertificateDomainValidationRecord -> Bool
Prelude.Eq, ReadPrec [LoadBalancerTlsCertificateDomainValidationRecord]
ReadPrec LoadBalancerTlsCertificateDomainValidationRecord
Int -> ReadS LoadBalancerTlsCertificateDomainValidationRecord
ReadS [LoadBalancerTlsCertificateDomainValidationRecord]
(Int -> ReadS LoadBalancerTlsCertificateDomainValidationRecord)
-> ReadS [LoadBalancerTlsCertificateDomainValidationRecord]
-> ReadPrec LoadBalancerTlsCertificateDomainValidationRecord
-> ReadPrec [LoadBalancerTlsCertificateDomainValidationRecord]
-> Read LoadBalancerTlsCertificateDomainValidationRecord
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoadBalancerTlsCertificateDomainValidationRecord]
$creadListPrec :: ReadPrec [LoadBalancerTlsCertificateDomainValidationRecord]
readPrec :: ReadPrec LoadBalancerTlsCertificateDomainValidationRecord
$creadPrec :: ReadPrec LoadBalancerTlsCertificateDomainValidationRecord
readList :: ReadS [LoadBalancerTlsCertificateDomainValidationRecord]
$creadList :: ReadS [LoadBalancerTlsCertificateDomainValidationRecord]
readsPrec :: Int -> ReadS LoadBalancerTlsCertificateDomainValidationRecord
$creadsPrec :: Int -> ReadS LoadBalancerTlsCertificateDomainValidationRecord
Prelude.Read, Int -> LoadBalancerTlsCertificateDomainValidationRecord -> ShowS
[LoadBalancerTlsCertificateDomainValidationRecord] -> ShowS
LoadBalancerTlsCertificateDomainValidationRecord -> String
(Int -> LoadBalancerTlsCertificateDomainValidationRecord -> ShowS)
-> (LoadBalancerTlsCertificateDomainValidationRecord -> String)
-> ([LoadBalancerTlsCertificateDomainValidationRecord] -> ShowS)
-> Show LoadBalancerTlsCertificateDomainValidationRecord
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoadBalancerTlsCertificateDomainValidationRecord] -> ShowS
$cshowList :: [LoadBalancerTlsCertificateDomainValidationRecord] -> ShowS
show :: LoadBalancerTlsCertificateDomainValidationRecord -> String
$cshow :: LoadBalancerTlsCertificateDomainValidationRecord -> String
showsPrec :: Int -> LoadBalancerTlsCertificateDomainValidationRecord -> ShowS
$cshowsPrec :: Int -> LoadBalancerTlsCertificateDomainValidationRecord -> ShowS
Prelude.Show, (forall x.
 LoadBalancerTlsCertificateDomainValidationRecord
 -> Rep LoadBalancerTlsCertificateDomainValidationRecord x)
-> (forall x.
    Rep LoadBalancerTlsCertificateDomainValidationRecord x
    -> LoadBalancerTlsCertificateDomainValidationRecord)
-> Generic LoadBalancerTlsCertificateDomainValidationRecord
forall x.
Rep LoadBalancerTlsCertificateDomainValidationRecord x
-> LoadBalancerTlsCertificateDomainValidationRecord
forall x.
LoadBalancerTlsCertificateDomainValidationRecord
-> Rep LoadBalancerTlsCertificateDomainValidationRecord x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LoadBalancerTlsCertificateDomainValidationRecord x
-> LoadBalancerTlsCertificateDomainValidationRecord
$cfrom :: forall x.
LoadBalancerTlsCertificateDomainValidationRecord
-> Rep LoadBalancerTlsCertificateDomainValidationRecord x
Prelude.Generic)

-- |
-- Create a value of 'LoadBalancerTlsCertificateDomainValidationRecord' 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', 'loadBalancerTlsCertificateDomainValidationRecord_value' - The value for that type.
--
-- 'domainName', 'loadBalancerTlsCertificateDomainValidationRecord_domainName' - The domain name against which your SSL\/TLS certificate was validated.
--
-- 'name', 'loadBalancerTlsCertificateDomainValidationRecord_name' - A fully qualified domain name in the certificate. For example,
-- @example.com@.
--
-- 'validationStatus', 'loadBalancerTlsCertificateDomainValidationRecord_validationStatus' - The validation status. Valid values are listed below.
--
-- 'type'', 'loadBalancerTlsCertificateDomainValidationRecord_type' - The type of validation record. For example, @CNAME@ for domain
-- validation.
newLoadBalancerTlsCertificateDomainValidationRecord ::
  LoadBalancerTlsCertificateDomainValidationRecord
newLoadBalancerTlsCertificateDomainValidationRecord :: LoadBalancerTlsCertificateDomainValidationRecord
newLoadBalancerTlsCertificateDomainValidationRecord =
  LoadBalancerTlsCertificateDomainValidationRecord' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LoadBalancerTlsCertificateDomainStatus
-> Maybe Text
-> LoadBalancerTlsCertificateDomainValidationRecord
LoadBalancerTlsCertificateDomainValidationRecord'
    { $sel:value:LoadBalancerTlsCertificateDomainValidationRecord' :: Maybe Text
value =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:LoadBalancerTlsCertificateDomainValidationRecord' :: Maybe Text
domainName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:LoadBalancerTlsCertificateDomainValidationRecord' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:validationStatus:LoadBalancerTlsCertificateDomainValidationRecord' :: Maybe LoadBalancerTlsCertificateDomainStatus
validationStatus =
        Maybe LoadBalancerTlsCertificateDomainStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:type':LoadBalancerTlsCertificateDomainValidationRecord' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The value for that type.
loadBalancerTlsCertificateDomainValidationRecord_value :: Lens.Lens' LoadBalancerTlsCertificateDomainValidationRecord (Prelude.Maybe Prelude.Text)
loadBalancerTlsCertificateDomainValidationRecord_value :: (Maybe Text -> f (Maybe Text))
-> LoadBalancerTlsCertificateDomainValidationRecord
-> f LoadBalancerTlsCertificateDomainValidationRecord
loadBalancerTlsCertificateDomainValidationRecord_value = (LoadBalancerTlsCertificateDomainValidationRecord -> Maybe Text)
-> (LoadBalancerTlsCertificateDomainValidationRecord
    -> Maybe Text -> LoadBalancerTlsCertificateDomainValidationRecord)
-> Lens
     LoadBalancerTlsCertificateDomainValidationRecord
     LoadBalancerTlsCertificateDomainValidationRecord
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancerTlsCertificateDomainValidationRecord' {Maybe Text
value :: Maybe Text
$sel:value:LoadBalancerTlsCertificateDomainValidationRecord' :: LoadBalancerTlsCertificateDomainValidationRecord -> Maybe Text
value} -> Maybe Text
value) (\s :: LoadBalancerTlsCertificateDomainValidationRecord
s@LoadBalancerTlsCertificateDomainValidationRecord' {} Maybe Text
a -> LoadBalancerTlsCertificateDomainValidationRecord
s {$sel:value:LoadBalancerTlsCertificateDomainValidationRecord' :: Maybe Text
value = Maybe Text
a} :: LoadBalancerTlsCertificateDomainValidationRecord)

-- | The domain name against which your SSL\/TLS certificate was validated.
loadBalancerTlsCertificateDomainValidationRecord_domainName :: Lens.Lens' LoadBalancerTlsCertificateDomainValidationRecord (Prelude.Maybe Prelude.Text)
loadBalancerTlsCertificateDomainValidationRecord_domainName :: (Maybe Text -> f (Maybe Text))
-> LoadBalancerTlsCertificateDomainValidationRecord
-> f LoadBalancerTlsCertificateDomainValidationRecord
loadBalancerTlsCertificateDomainValidationRecord_domainName = (LoadBalancerTlsCertificateDomainValidationRecord -> Maybe Text)
-> (LoadBalancerTlsCertificateDomainValidationRecord
    -> Maybe Text -> LoadBalancerTlsCertificateDomainValidationRecord)
-> Lens
     LoadBalancerTlsCertificateDomainValidationRecord
     LoadBalancerTlsCertificateDomainValidationRecord
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancerTlsCertificateDomainValidationRecord' {Maybe Text
domainName :: Maybe Text
$sel:domainName:LoadBalancerTlsCertificateDomainValidationRecord' :: LoadBalancerTlsCertificateDomainValidationRecord -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: LoadBalancerTlsCertificateDomainValidationRecord
s@LoadBalancerTlsCertificateDomainValidationRecord' {} Maybe Text
a -> LoadBalancerTlsCertificateDomainValidationRecord
s {$sel:domainName:LoadBalancerTlsCertificateDomainValidationRecord' :: Maybe Text
domainName = Maybe Text
a} :: LoadBalancerTlsCertificateDomainValidationRecord)

-- | A fully qualified domain name in the certificate. For example,
-- @example.com@.
loadBalancerTlsCertificateDomainValidationRecord_name :: Lens.Lens' LoadBalancerTlsCertificateDomainValidationRecord (Prelude.Maybe Prelude.Text)
loadBalancerTlsCertificateDomainValidationRecord_name :: (Maybe Text -> f (Maybe Text))
-> LoadBalancerTlsCertificateDomainValidationRecord
-> f LoadBalancerTlsCertificateDomainValidationRecord
loadBalancerTlsCertificateDomainValidationRecord_name = (LoadBalancerTlsCertificateDomainValidationRecord -> Maybe Text)
-> (LoadBalancerTlsCertificateDomainValidationRecord
    -> Maybe Text -> LoadBalancerTlsCertificateDomainValidationRecord)
-> Lens
     LoadBalancerTlsCertificateDomainValidationRecord
     LoadBalancerTlsCertificateDomainValidationRecord
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancerTlsCertificateDomainValidationRecord' {Maybe Text
name :: Maybe Text
$sel:name:LoadBalancerTlsCertificateDomainValidationRecord' :: LoadBalancerTlsCertificateDomainValidationRecord -> Maybe Text
name} -> Maybe Text
name) (\s :: LoadBalancerTlsCertificateDomainValidationRecord
s@LoadBalancerTlsCertificateDomainValidationRecord' {} Maybe Text
a -> LoadBalancerTlsCertificateDomainValidationRecord
s {$sel:name:LoadBalancerTlsCertificateDomainValidationRecord' :: Maybe Text
name = Maybe Text
a} :: LoadBalancerTlsCertificateDomainValidationRecord)

-- | The validation status. Valid values are listed below.
loadBalancerTlsCertificateDomainValidationRecord_validationStatus :: Lens.Lens' LoadBalancerTlsCertificateDomainValidationRecord (Prelude.Maybe LoadBalancerTlsCertificateDomainStatus)
loadBalancerTlsCertificateDomainValidationRecord_validationStatus :: (Maybe LoadBalancerTlsCertificateDomainStatus
 -> f (Maybe LoadBalancerTlsCertificateDomainStatus))
-> LoadBalancerTlsCertificateDomainValidationRecord
-> f LoadBalancerTlsCertificateDomainValidationRecord
loadBalancerTlsCertificateDomainValidationRecord_validationStatus = (LoadBalancerTlsCertificateDomainValidationRecord
 -> Maybe LoadBalancerTlsCertificateDomainStatus)
-> (LoadBalancerTlsCertificateDomainValidationRecord
    -> Maybe LoadBalancerTlsCertificateDomainStatus
    -> LoadBalancerTlsCertificateDomainValidationRecord)
-> Lens
     LoadBalancerTlsCertificateDomainValidationRecord
     LoadBalancerTlsCertificateDomainValidationRecord
     (Maybe LoadBalancerTlsCertificateDomainStatus)
     (Maybe LoadBalancerTlsCertificateDomainStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancerTlsCertificateDomainValidationRecord' {Maybe LoadBalancerTlsCertificateDomainStatus
validationStatus :: Maybe LoadBalancerTlsCertificateDomainStatus
$sel:validationStatus:LoadBalancerTlsCertificateDomainValidationRecord' :: LoadBalancerTlsCertificateDomainValidationRecord
-> Maybe LoadBalancerTlsCertificateDomainStatus
validationStatus} -> Maybe LoadBalancerTlsCertificateDomainStatus
validationStatus) (\s :: LoadBalancerTlsCertificateDomainValidationRecord
s@LoadBalancerTlsCertificateDomainValidationRecord' {} Maybe LoadBalancerTlsCertificateDomainStatus
a -> LoadBalancerTlsCertificateDomainValidationRecord
s {$sel:validationStatus:LoadBalancerTlsCertificateDomainValidationRecord' :: Maybe LoadBalancerTlsCertificateDomainStatus
validationStatus = Maybe LoadBalancerTlsCertificateDomainStatus
a} :: LoadBalancerTlsCertificateDomainValidationRecord)

-- | The type of validation record. For example, @CNAME@ for domain
-- validation.
loadBalancerTlsCertificateDomainValidationRecord_type :: Lens.Lens' LoadBalancerTlsCertificateDomainValidationRecord (Prelude.Maybe Prelude.Text)
loadBalancerTlsCertificateDomainValidationRecord_type :: (Maybe Text -> f (Maybe Text))
-> LoadBalancerTlsCertificateDomainValidationRecord
-> f LoadBalancerTlsCertificateDomainValidationRecord
loadBalancerTlsCertificateDomainValidationRecord_type = (LoadBalancerTlsCertificateDomainValidationRecord -> Maybe Text)
-> (LoadBalancerTlsCertificateDomainValidationRecord
    -> Maybe Text -> LoadBalancerTlsCertificateDomainValidationRecord)
-> Lens
     LoadBalancerTlsCertificateDomainValidationRecord
     LoadBalancerTlsCertificateDomainValidationRecord
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancerTlsCertificateDomainValidationRecord' {Maybe Text
type' :: Maybe Text
$sel:type':LoadBalancerTlsCertificateDomainValidationRecord' :: LoadBalancerTlsCertificateDomainValidationRecord -> Maybe Text
type'} -> Maybe Text
type') (\s :: LoadBalancerTlsCertificateDomainValidationRecord
s@LoadBalancerTlsCertificateDomainValidationRecord' {} Maybe Text
a -> LoadBalancerTlsCertificateDomainValidationRecord
s {$sel:type':LoadBalancerTlsCertificateDomainValidationRecord' :: Maybe Text
type' = Maybe Text
a} :: LoadBalancerTlsCertificateDomainValidationRecord)

instance
  Core.FromJSON
    LoadBalancerTlsCertificateDomainValidationRecord
  where
  parseJSON :: Value -> Parser LoadBalancerTlsCertificateDomainValidationRecord
parseJSON =
    String
-> (Object
    -> Parser LoadBalancerTlsCertificateDomainValidationRecord)
-> Value
-> Parser LoadBalancerTlsCertificateDomainValidationRecord
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LoadBalancerTlsCertificateDomainValidationRecord"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LoadBalancerTlsCertificateDomainStatus
-> Maybe Text
-> LoadBalancerTlsCertificateDomainValidationRecord
LoadBalancerTlsCertificateDomainValidationRecord'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe LoadBalancerTlsCertificateDomainStatus
 -> Maybe Text
 -> LoadBalancerTlsCertificateDomainValidationRecord)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe LoadBalancerTlsCertificateDomainStatus
      -> Maybe Text
      -> LoadBalancerTlsCertificateDomainValidationRecord)
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
   -> Maybe LoadBalancerTlsCertificateDomainStatus
   -> Maybe Text
   -> LoadBalancerTlsCertificateDomainValidationRecord)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe LoadBalancerTlsCertificateDomainStatus
      -> Maybe Text
      -> LoadBalancerTlsCertificateDomainValidationRecord)
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")
              Parser
  (Maybe Text
   -> Maybe LoadBalancerTlsCertificateDomainStatus
   -> Maybe Text
   -> LoadBalancerTlsCertificateDomainValidationRecord)
-> Parser (Maybe Text)
-> Parser
     (Maybe LoadBalancerTlsCertificateDomainStatus
      -> Maybe Text -> LoadBalancerTlsCertificateDomainValidationRecord)
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 LoadBalancerTlsCertificateDomainStatus
   -> Maybe Text -> LoadBalancerTlsCertificateDomainValidationRecord)
-> Parser (Maybe LoadBalancerTlsCertificateDomainStatus)
-> Parser
     (Maybe Text -> LoadBalancerTlsCertificateDomainValidationRecord)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe LoadBalancerTlsCertificateDomainStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"validationStatus")
              Parser
  (Maybe Text -> LoadBalancerTlsCertificateDomainValidationRecord)
-> Parser (Maybe Text)
-> Parser LoadBalancerTlsCertificateDomainValidationRecord
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
    LoadBalancerTlsCertificateDomainValidationRecord

instance
  Prelude.NFData
    LoadBalancerTlsCertificateDomainValidationRecord