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

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

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

instance
  Prelude.Hashable
    PublicDnsPropertiesMutableChange
  where
  hashWithSalt :: Int -> PublicDnsPropertiesMutableChange -> Int
hashWithSalt
    Int
_salt
    PublicDnsPropertiesMutableChange' {SOAChange
soa :: SOAChange
$sel:soa:PublicDnsPropertiesMutableChange' :: PublicDnsPropertiesMutableChange -> SOAChange
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SOAChange
soa

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

instance Data.ToJSON PublicDnsPropertiesMutableChange where
  toJSON :: PublicDnsPropertiesMutableChange -> Value
toJSON PublicDnsPropertiesMutableChange' {SOAChange
soa :: SOAChange
$sel:soa:PublicDnsPropertiesMutableChange' :: PublicDnsPropertiesMutableChange -> 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)]
      )