{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Route53AutoNaming.Types.PublicDnsNamespaceProperties where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
    { $sel:dnsProperties:PublicDnsNamespaceProperties' :: PublicDnsPropertiesMutable
dnsProperties =
        PublicDnsPropertiesMutable
pDnsProperties_
    }

-- | DNS properties for the public DNS namespace.
publicDnsNamespaceProperties_dnsProperties :: Lens.Lens' PublicDnsNamespaceProperties PublicDnsPropertiesMutable
publicDnsNamespaceProperties_dnsProperties :: Lens' PublicDnsNamespaceProperties PublicDnsPropertiesMutable
publicDnsNamespaceProperties_dnsProperties = 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
  where
  hashWithSalt :: Int -> PublicDnsNamespaceProperties -> Int
hashWithSalt Int
_salt PublicDnsNamespaceProperties' {PublicDnsPropertiesMutable
dnsProperties :: PublicDnsPropertiesMutable
$sel:dnsProperties:PublicDnsNamespaceProperties' :: PublicDnsNamespaceProperties -> PublicDnsPropertiesMutable
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` PublicDnsPropertiesMutable
dnsProperties

instance Prelude.NFData PublicDnsNamespaceProperties where
  rnf :: PublicDnsNamespaceProperties -> ()
rnf PublicDnsNamespaceProperties' {PublicDnsPropertiesMutable
dnsProperties :: PublicDnsPropertiesMutable
$sel:dnsProperties:PublicDnsNamespaceProperties' :: PublicDnsNamespaceProperties -> PublicDnsPropertiesMutable
..} =
    forall a. NFData a => a -> ()
Prelude.rnf PublicDnsPropertiesMutable
dnsProperties

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