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

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

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

-- |
-- Create a value of 'PrivateDnsPropertiesMutableChange' 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:
--
-- 'soa', 'privateDnsPropertiesMutableChange_soa' - Updated fields for the Start of Authority (SOA) record for the hosted
-- zone for the private DNS namespace.
newPrivateDnsPropertiesMutableChange ::
  -- | 'soa'
  SOAChange ->
  PrivateDnsPropertiesMutableChange
newPrivateDnsPropertiesMutableChange :: SOAChange -> PrivateDnsPropertiesMutableChange
newPrivateDnsPropertiesMutableChange SOAChange
pSOA_ =
  PrivateDnsPropertiesMutableChange' :: SOAChange -> PrivateDnsPropertiesMutableChange
PrivateDnsPropertiesMutableChange' {$sel:soa:PrivateDnsPropertiesMutableChange' :: SOAChange
soa = SOAChange
pSOA_}

-- | Updated fields for the Start of Authority (SOA) record for the hosted
-- zone for the private DNS namespace.
privateDnsPropertiesMutableChange_soa :: Lens.Lens' PrivateDnsPropertiesMutableChange SOAChange
privateDnsPropertiesMutableChange_soa :: (SOAChange -> f SOAChange)
-> PrivateDnsPropertiesMutableChange
-> f PrivateDnsPropertiesMutableChange
privateDnsPropertiesMutableChange_soa = (PrivateDnsPropertiesMutableChange -> SOAChange)
-> (PrivateDnsPropertiesMutableChange
    -> SOAChange -> PrivateDnsPropertiesMutableChange)
-> Lens
     PrivateDnsPropertiesMutableChange
     PrivateDnsPropertiesMutableChange
     SOAChange
     SOAChange
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PrivateDnsPropertiesMutableChange' {SOAChange
soa :: SOAChange
$sel:soa:PrivateDnsPropertiesMutableChange' :: PrivateDnsPropertiesMutableChange -> SOAChange
soa} -> SOAChange
soa) (\s :: PrivateDnsPropertiesMutableChange
s@PrivateDnsPropertiesMutableChange' {} SOAChange
a -> PrivateDnsPropertiesMutableChange
s {$sel:soa:PrivateDnsPropertiesMutableChange' :: SOAChange
soa = SOAChange
a} :: PrivateDnsPropertiesMutableChange)

instance
  Prelude.Hashable
    PrivateDnsPropertiesMutableChange

instance
  Prelude.NFData
    PrivateDnsPropertiesMutableChange

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