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

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

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

instance Prelude.Hashable PublicDnsPropertiesMutable

instance Prelude.NFData PublicDnsPropertiesMutable

instance Core.ToJSON PublicDnsPropertiesMutable where
  toJSON :: PublicDnsPropertiesMutable -> Value
toJSON PublicDnsPropertiesMutable' {SOA
soa :: SOA
$sel:soa:PublicDnsPropertiesMutable' :: PublicDnsPropertiesMutable -> 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)]
      )