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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(PrivateDnsPropertiesMutable
 -> PrivateDnsPropertiesMutable -> Bool)
-> (PrivateDnsPropertiesMutable
    -> PrivateDnsPropertiesMutable -> Bool)
-> Eq PrivateDnsPropertiesMutable
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]
(Int -> ReadS PrivateDnsPropertiesMutable)
-> ReadS [PrivateDnsPropertiesMutable]
-> ReadPrec PrivateDnsPropertiesMutable
-> ReadPrec [PrivateDnsPropertiesMutable]
-> Read 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
(Int -> PrivateDnsPropertiesMutable -> ShowS)
-> (PrivateDnsPropertiesMutable -> String)
-> ([PrivateDnsPropertiesMutable] -> ShowS)
-> Show PrivateDnsPropertiesMutable
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.
 PrivateDnsPropertiesMutable -> Rep PrivateDnsPropertiesMutable x)
-> (forall x.
    Rep PrivateDnsPropertiesMutable x -> PrivateDnsPropertiesMutable)
-> Generic PrivateDnsPropertiesMutable
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' :: SOA -> PrivateDnsPropertiesMutable
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 :: (SOA -> f SOA)
-> PrivateDnsPropertiesMutable -> f PrivateDnsPropertiesMutable
privateDnsPropertiesMutable_soa = (PrivateDnsPropertiesMutable -> SOA)
-> (PrivateDnsPropertiesMutable
    -> SOA -> PrivateDnsPropertiesMutable)
-> Lens
     PrivateDnsPropertiesMutable PrivateDnsPropertiesMutable SOA 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

instance Prelude.NFData PrivateDnsPropertiesMutable

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