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

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

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

-- |
-- Create a value of 'PublicDnsNamespacePropertiesChange' 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', 'publicDnsNamespacePropertiesChange_dnsProperties' - Updated DNS properties for the hosted zone for the public DNS namespace.
newPublicDnsNamespacePropertiesChange ::
  -- | 'dnsProperties'
  PublicDnsPropertiesMutableChange ->
  PublicDnsNamespacePropertiesChange
newPublicDnsNamespacePropertiesChange :: PublicDnsPropertiesMutableChange
-> PublicDnsNamespacePropertiesChange
newPublicDnsNamespacePropertiesChange PublicDnsPropertiesMutableChange
pDnsProperties_ =
  PublicDnsNamespacePropertiesChange' :: PublicDnsPropertiesMutableChange
-> PublicDnsNamespacePropertiesChange
PublicDnsNamespacePropertiesChange'
    { $sel:dnsProperties:PublicDnsNamespacePropertiesChange' :: PublicDnsPropertiesMutableChange
dnsProperties =
        PublicDnsPropertiesMutableChange
pDnsProperties_
    }

-- | Updated DNS properties for the hosted zone for the public DNS namespace.
publicDnsNamespacePropertiesChange_dnsProperties :: Lens.Lens' PublicDnsNamespacePropertiesChange PublicDnsPropertiesMutableChange
publicDnsNamespacePropertiesChange_dnsProperties :: (PublicDnsPropertiesMutableChange
 -> f PublicDnsPropertiesMutableChange)
-> PublicDnsNamespacePropertiesChange
-> f PublicDnsNamespacePropertiesChange
publicDnsNamespacePropertiesChange_dnsProperties = (PublicDnsNamespacePropertiesChange
 -> PublicDnsPropertiesMutableChange)
-> (PublicDnsNamespacePropertiesChange
    -> PublicDnsPropertiesMutableChange
    -> PublicDnsNamespacePropertiesChange)
-> Lens
     PublicDnsNamespacePropertiesChange
     PublicDnsNamespacePropertiesChange
     PublicDnsPropertiesMutableChange
     PublicDnsPropertiesMutableChange
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublicDnsNamespacePropertiesChange' {PublicDnsPropertiesMutableChange
dnsProperties :: PublicDnsPropertiesMutableChange
$sel:dnsProperties:PublicDnsNamespacePropertiesChange' :: PublicDnsNamespacePropertiesChange
-> PublicDnsPropertiesMutableChange
dnsProperties} -> PublicDnsPropertiesMutableChange
dnsProperties) (\s :: PublicDnsNamespacePropertiesChange
s@PublicDnsNamespacePropertiesChange' {} PublicDnsPropertiesMutableChange
a -> PublicDnsNamespacePropertiesChange
s {$sel:dnsProperties:PublicDnsNamespacePropertiesChange' :: PublicDnsPropertiesMutableChange
dnsProperties = PublicDnsPropertiesMutableChange
a} :: PublicDnsNamespacePropertiesChange)

instance
  Prelude.Hashable
    PublicDnsNamespacePropertiesChange

instance
  Prelude.NFData
    PublicDnsNamespacePropertiesChange

instance
  Core.ToJSON
    PublicDnsNamespacePropertiesChange
  where
  toJSON :: PublicDnsNamespacePropertiesChange -> Value
toJSON PublicDnsNamespacePropertiesChange' {PublicDnsPropertiesMutableChange
dnsProperties :: PublicDnsPropertiesMutableChange
$sel:dnsProperties:PublicDnsNamespacePropertiesChange' :: PublicDnsNamespacePropertiesChange
-> PublicDnsPropertiesMutableChange
..} =
    [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 -> PublicDnsPropertiesMutableChange -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= PublicDnsPropertiesMutableChange
dnsProperties)
          ]
      )