{-# 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.Route53AutoNaming.Types.PublicDnsNamespaceProperties
-- 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.Route53AutoNaming.Types.PublicDnsNamespaceProperties where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53AutoNaming.Types.PublicDnsPropertiesMutable

-- | DNS properties for the public DNS namespace.
--
-- /See:/ 'newPublicDnsNamespaceProperties' smart constructor.
data PublicDnsNamespaceProperties = PublicDnsNamespaceProperties'
  { -- | DNS properties for the public DNS namespace.
    PublicDnsNamespaceProperties -> PublicDnsPropertiesMutable
dnsProperties :: PublicDnsPropertiesMutable
  }
  deriving (PublicDnsNamespaceProperties
-> PublicDnsNamespaceProperties -> Bool
(PublicDnsNamespaceProperties
 -> PublicDnsNamespaceProperties -> Bool)
-> (PublicDnsNamespaceProperties
    -> PublicDnsNamespaceProperties -> Bool)
-> Eq PublicDnsNamespaceProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PublicDnsNamespaceProperties
-> PublicDnsNamespaceProperties -> Bool
$c/= :: PublicDnsNamespaceProperties
-> PublicDnsNamespaceProperties -> Bool
== :: PublicDnsNamespaceProperties
-> PublicDnsNamespaceProperties -> Bool
$c== :: PublicDnsNamespaceProperties
-> PublicDnsNamespaceProperties -> Bool
Prelude.Eq, ReadPrec [PublicDnsNamespaceProperties]
ReadPrec PublicDnsNamespaceProperties
Int -> ReadS PublicDnsNamespaceProperties
ReadS [PublicDnsNamespaceProperties]
(Int -> ReadS PublicDnsNamespaceProperties)
-> ReadS [PublicDnsNamespaceProperties]
-> ReadPrec PublicDnsNamespaceProperties
-> ReadPrec [PublicDnsNamespaceProperties]
-> Read PublicDnsNamespaceProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PublicDnsNamespaceProperties]
$creadListPrec :: ReadPrec [PublicDnsNamespaceProperties]
readPrec :: ReadPrec PublicDnsNamespaceProperties
$creadPrec :: ReadPrec PublicDnsNamespaceProperties
readList :: ReadS [PublicDnsNamespaceProperties]
$creadList :: ReadS [PublicDnsNamespaceProperties]
readsPrec :: Int -> ReadS PublicDnsNamespaceProperties
$creadsPrec :: Int -> ReadS PublicDnsNamespaceProperties
Prelude.Read, Int -> PublicDnsNamespaceProperties -> ShowS
[PublicDnsNamespaceProperties] -> ShowS
PublicDnsNamespaceProperties -> String
(Int -> PublicDnsNamespaceProperties -> ShowS)
-> (PublicDnsNamespaceProperties -> String)
-> ([PublicDnsNamespaceProperties] -> ShowS)
-> Show PublicDnsNamespaceProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PublicDnsNamespaceProperties] -> ShowS
$cshowList :: [PublicDnsNamespaceProperties] -> ShowS
show :: PublicDnsNamespaceProperties -> String
$cshow :: PublicDnsNamespaceProperties -> String
showsPrec :: Int -> PublicDnsNamespaceProperties -> ShowS
$cshowsPrec :: Int -> PublicDnsNamespaceProperties -> ShowS
Prelude.Show, (forall x.
 PublicDnsNamespaceProperties -> Rep PublicDnsNamespaceProperties x)
-> (forall x.
    Rep PublicDnsNamespaceProperties x -> PublicDnsNamespaceProperties)
-> Generic PublicDnsNamespaceProperties
forall x.
Rep PublicDnsNamespaceProperties x -> PublicDnsNamespaceProperties
forall x.
PublicDnsNamespaceProperties -> Rep PublicDnsNamespaceProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PublicDnsNamespaceProperties x -> PublicDnsNamespaceProperties
$cfrom :: forall x.
PublicDnsNamespaceProperties -> Rep PublicDnsNamespaceProperties x
Prelude.Generic)

-- |
-- Create a value of 'PublicDnsNamespaceProperties' 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:
--
-- 'dnsProperties', 'publicDnsNamespaceProperties_dnsProperties' - DNS properties for the public DNS namespace.
newPublicDnsNamespaceProperties ::
  -- | 'dnsProperties'
  PublicDnsPropertiesMutable ->
  PublicDnsNamespaceProperties
newPublicDnsNamespaceProperties :: PublicDnsPropertiesMutable -> PublicDnsNamespaceProperties
newPublicDnsNamespaceProperties PublicDnsPropertiesMutable
pDnsProperties_ =
  PublicDnsNamespaceProperties' :: PublicDnsPropertiesMutable -> PublicDnsNamespaceProperties
PublicDnsNamespaceProperties'
    { $sel:dnsProperties:PublicDnsNamespaceProperties' :: PublicDnsPropertiesMutable
dnsProperties =
        PublicDnsPropertiesMutable
pDnsProperties_
    }

-- | DNS properties for the public DNS namespace.
publicDnsNamespaceProperties_dnsProperties :: Lens.Lens' PublicDnsNamespaceProperties PublicDnsPropertiesMutable
publicDnsNamespaceProperties_dnsProperties :: (PublicDnsPropertiesMutable -> f PublicDnsPropertiesMutable)
-> PublicDnsNamespaceProperties -> f PublicDnsNamespaceProperties
publicDnsNamespaceProperties_dnsProperties = (PublicDnsNamespaceProperties -> PublicDnsPropertiesMutable)
-> (PublicDnsNamespaceProperties
    -> PublicDnsPropertiesMutable -> PublicDnsNamespaceProperties)
-> Lens
     PublicDnsNamespaceProperties
     PublicDnsNamespaceProperties
     PublicDnsPropertiesMutable
     PublicDnsPropertiesMutable
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublicDnsNamespaceProperties' {PublicDnsPropertiesMutable
dnsProperties :: PublicDnsPropertiesMutable
$sel:dnsProperties:PublicDnsNamespaceProperties' :: PublicDnsNamespaceProperties -> PublicDnsPropertiesMutable
dnsProperties} -> PublicDnsPropertiesMutable
dnsProperties) (\s :: PublicDnsNamespaceProperties
s@PublicDnsNamespaceProperties' {} PublicDnsPropertiesMutable
a -> PublicDnsNamespaceProperties
s {$sel:dnsProperties:PublicDnsNamespaceProperties' :: PublicDnsPropertiesMutable
dnsProperties = PublicDnsPropertiesMutable
a} :: PublicDnsNamespaceProperties)

instance
  Prelude.Hashable
    PublicDnsNamespaceProperties

instance Prelude.NFData PublicDnsNamespaceProperties

instance Core.ToJSON PublicDnsNamespaceProperties where
  toJSON :: PublicDnsNamespaceProperties -> Value
toJSON PublicDnsNamespaceProperties' {PublicDnsPropertiesMutable
dnsProperties :: PublicDnsPropertiesMutable
$sel:dnsProperties:PublicDnsNamespaceProperties' :: PublicDnsNamespaceProperties -> PublicDnsPropertiesMutable
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"DnsProperties" Text -> PublicDnsPropertiesMutable -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= PublicDnsPropertiesMutable
dnsProperties)
          ]
      )