{-# 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-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.PrivateDnsPropertiesMutableChange 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.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
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]
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
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.
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' {$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 :: Lens' PrivateDnsPropertiesMutableChange SOAChange
privateDnsPropertiesMutableChange_soa = 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
  where
  hashWithSalt :: Int -> PrivateDnsPropertiesMutableChange -> Int
hashWithSalt
    Int
_salt
    PrivateDnsPropertiesMutableChange' {SOAChange
soa :: SOAChange
$sel:soa:PrivateDnsPropertiesMutableChange' :: PrivateDnsPropertiesMutableChange -> SOAChange
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SOAChange
soa

instance
  Prelude.NFData
    PrivateDnsPropertiesMutableChange
  where
  rnf :: PrivateDnsPropertiesMutableChange -> ()
rnf PrivateDnsPropertiesMutableChange' {SOAChange
soa :: SOAChange
$sel:soa:PrivateDnsPropertiesMutableChange' :: PrivateDnsPropertiesMutableChange -> SOAChange
..} =
    forall a. NFData a => a -> ()
Prelude.rnf SOAChange
soa

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