{-# 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.PrivateDnsPropertiesMutable
-- 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.PrivateDnsPropertiesMutable 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.SOA

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

-- |
-- Create a value of 'PrivateDnsPropertiesMutable' 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', 'privateDnsPropertiesMutable_soa' - Fields for the Start of Authority (SOA) record for the hosted zone for
-- the private DNS namespace.
newPrivateDnsPropertiesMutable ::
  -- | 'soa'
  SOA ->
  PrivateDnsPropertiesMutable
newPrivateDnsPropertiesMutable :: SOA -> PrivateDnsPropertiesMutable
newPrivateDnsPropertiesMutable SOA
pSOA_ =
  PrivateDnsPropertiesMutable' {$sel:soa:PrivateDnsPropertiesMutable' :: SOA
soa = SOA
pSOA_}

-- | Fields for the Start of Authority (SOA) record for the hosted zone for
-- the private DNS namespace.
privateDnsPropertiesMutable_soa :: Lens.Lens' PrivateDnsPropertiesMutable SOA
privateDnsPropertiesMutable_soa :: Lens' PrivateDnsPropertiesMutable SOA
privateDnsPropertiesMutable_soa = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PrivateDnsPropertiesMutable' {SOA
soa :: SOA
$sel:soa:PrivateDnsPropertiesMutable' :: PrivateDnsPropertiesMutable -> SOA
soa} -> SOA
soa) (\s :: PrivateDnsPropertiesMutable
s@PrivateDnsPropertiesMutable' {} SOA
a -> PrivateDnsPropertiesMutable
s {$sel:soa:PrivateDnsPropertiesMutable' :: SOA
soa = SOA
a} :: PrivateDnsPropertiesMutable)

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

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

instance Data.ToJSON PrivateDnsPropertiesMutable where
  toJSON :: PrivateDnsPropertiesMutable -> Value
toJSON PrivateDnsPropertiesMutable' {SOA
soa :: SOA
$sel:soa:PrivateDnsPropertiesMutable' :: PrivateDnsPropertiesMutable -> SOA
..} =
    [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..= SOA
soa)]
      )