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

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

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

-- |
-- Create a value of 'PrivateDnsNamespacePropertiesChange' 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', 'privateDnsNamespacePropertiesChange_dnsProperties' - Updated DNS properties for the private DNS namespace.
newPrivateDnsNamespacePropertiesChange ::
  -- | 'dnsProperties'
  PrivateDnsPropertiesMutableChange ->
  PrivateDnsNamespacePropertiesChange
newPrivateDnsNamespacePropertiesChange :: PrivateDnsPropertiesMutableChange
-> PrivateDnsNamespacePropertiesChange
newPrivateDnsNamespacePropertiesChange
  PrivateDnsPropertiesMutableChange
pDnsProperties_ =
    PrivateDnsNamespacePropertiesChange' :: PrivateDnsPropertiesMutableChange
-> PrivateDnsNamespacePropertiesChange
PrivateDnsNamespacePropertiesChange'
      { $sel:dnsProperties:PrivateDnsNamespacePropertiesChange' :: PrivateDnsPropertiesMutableChange
dnsProperties =
          PrivateDnsPropertiesMutableChange
pDnsProperties_
      }

-- | Updated DNS properties for the private DNS namespace.
privateDnsNamespacePropertiesChange_dnsProperties :: Lens.Lens' PrivateDnsNamespacePropertiesChange PrivateDnsPropertiesMutableChange
privateDnsNamespacePropertiesChange_dnsProperties :: (PrivateDnsPropertiesMutableChange
 -> f PrivateDnsPropertiesMutableChange)
-> PrivateDnsNamespacePropertiesChange
-> f PrivateDnsNamespacePropertiesChange
privateDnsNamespacePropertiesChange_dnsProperties = (PrivateDnsNamespacePropertiesChange
 -> PrivateDnsPropertiesMutableChange)
-> (PrivateDnsNamespacePropertiesChange
    -> PrivateDnsPropertiesMutableChange
    -> PrivateDnsNamespacePropertiesChange)
-> Lens
     PrivateDnsNamespacePropertiesChange
     PrivateDnsNamespacePropertiesChange
     PrivateDnsPropertiesMutableChange
     PrivateDnsPropertiesMutableChange
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PrivateDnsNamespacePropertiesChange' {PrivateDnsPropertiesMutableChange
dnsProperties :: PrivateDnsPropertiesMutableChange
$sel:dnsProperties:PrivateDnsNamespacePropertiesChange' :: PrivateDnsNamespacePropertiesChange
-> PrivateDnsPropertiesMutableChange
dnsProperties} -> PrivateDnsPropertiesMutableChange
dnsProperties) (\s :: PrivateDnsNamespacePropertiesChange
s@PrivateDnsNamespacePropertiesChange' {} PrivateDnsPropertiesMutableChange
a -> PrivateDnsNamespacePropertiesChange
s {$sel:dnsProperties:PrivateDnsNamespacePropertiesChange' :: PrivateDnsPropertiesMutableChange
dnsProperties = PrivateDnsPropertiesMutableChange
a} :: PrivateDnsNamespacePropertiesChange)

instance
  Prelude.Hashable
    PrivateDnsNamespacePropertiesChange

instance
  Prelude.NFData
    PrivateDnsNamespacePropertiesChange

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