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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53AutoNaming.Types.PublicDnsNamespacePropertiesChange

-- | Updated properties for the public DNS namespace.
--
-- /See:/ 'newPublicDnsNamespaceChange' smart constructor.
data PublicDnsNamespaceChange = PublicDnsNamespaceChange'
  { -- | An updated description for the public DNS namespace.
    PublicDnsNamespaceChange -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Properties to be updated in the public DNS namespace.
    PublicDnsNamespaceChange
-> Maybe PublicDnsNamespacePropertiesChange
properties :: Prelude.Maybe PublicDnsNamespacePropertiesChange
  }
  deriving (PublicDnsNamespaceChange -> PublicDnsNamespaceChange -> Bool
(PublicDnsNamespaceChange -> PublicDnsNamespaceChange -> Bool)
-> (PublicDnsNamespaceChange -> PublicDnsNamespaceChange -> Bool)
-> Eq PublicDnsNamespaceChange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PublicDnsNamespaceChange -> PublicDnsNamespaceChange -> Bool
$c/= :: PublicDnsNamespaceChange -> PublicDnsNamespaceChange -> Bool
== :: PublicDnsNamespaceChange -> PublicDnsNamespaceChange -> Bool
$c== :: PublicDnsNamespaceChange -> PublicDnsNamespaceChange -> Bool
Prelude.Eq, ReadPrec [PublicDnsNamespaceChange]
ReadPrec PublicDnsNamespaceChange
Int -> ReadS PublicDnsNamespaceChange
ReadS [PublicDnsNamespaceChange]
(Int -> ReadS PublicDnsNamespaceChange)
-> ReadS [PublicDnsNamespaceChange]
-> ReadPrec PublicDnsNamespaceChange
-> ReadPrec [PublicDnsNamespaceChange]
-> Read PublicDnsNamespaceChange
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PublicDnsNamespaceChange]
$creadListPrec :: ReadPrec [PublicDnsNamespaceChange]
readPrec :: ReadPrec PublicDnsNamespaceChange
$creadPrec :: ReadPrec PublicDnsNamespaceChange
readList :: ReadS [PublicDnsNamespaceChange]
$creadList :: ReadS [PublicDnsNamespaceChange]
readsPrec :: Int -> ReadS PublicDnsNamespaceChange
$creadsPrec :: Int -> ReadS PublicDnsNamespaceChange
Prelude.Read, Int -> PublicDnsNamespaceChange -> ShowS
[PublicDnsNamespaceChange] -> ShowS
PublicDnsNamespaceChange -> String
(Int -> PublicDnsNamespaceChange -> ShowS)
-> (PublicDnsNamespaceChange -> String)
-> ([PublicDnsNamespaceChange] -> ShowS)
-> Show PublicDnsNamespaceChange
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PublicDnsNamespaceChange] -> ShowS
$cshowList :: [PublicDnsNamespaceChange] -> ShowS
show :: PublicDnsNamespaceChange -> String
$cshow :: PublicDnsNamespaceChange -> String
showsPrec :: Int -> PublicDnsNamespaceChange -> ShowS
$cshowsPrec :: Int -> PublicDnsNamespaceChange -> ShowS
Prelude.Show, (forall x.
 PublicDnsNamespaceChange -> Rep PublicDnsNamespaceChange x)
-> (forall x.
    Rep PublicDnsNamespaceChange x -> PublicDnsNamespaceChange)
-> Generic PublicDnsNamespaceChange
forall x.
Rep PublicDnsNamespaceChange x -> PublicDnsNamespaceChange
forall x.
PublicDnsNamespaceChange -> Rep PublicDnsNamespaceChange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PublicDnsNamespaceChange x -> PublicDnsNamespaceChange
$cfrom :: forall x.
PublicDnsNamespaceChange -> Rep PublicDnsNamespaceChange x
Prelude.Generic)

-- |
-- Create a value of 'PublicDnsNamespaceChange' 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:
--
-- 'description', 'publicDnsNamespaceChange_description' - An updated description for the public DNS namespace.
--
-- 'properties', 'publicDnsNamespaceChange_properties' - Properties to be updated in the public DNS namespace.
newPublicDnsNamespaceChange ::
  PublicDnsNamespaceChange
newPublicDnsNamespaceChange :: PublicDnsNamespaceChange
newPublicDnsNamespaceChange =
  PublicDnsNamespaceChange' :: Maybe Text
-> Maybe PublicDnsNamespacePropertiesChange
-> PublicDnsNamespaceChange
PublicDnsNamespaceChange'
    { $sel:description:PublicDnsNamespaceChange' :: Maybe Text
description =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:properties:PublicDnsNamespaceChange' :: Maybe PublicDnsNamespacePropertiesChange
properties = Maybe PublicDnsNamespacePropertiesChange
forall a. Maybe a
Prelude.Nothing
    }

-- | An updated description for the public DNS namespace.
publicDnsNamespaceChange_description :: Lens.Lens' PublicDnsNamespaceChange (Prelude.Maybe Prelude.Text)
publicDnsNamespaceChange_description :: (Maybe Text -> f (Maybe Text))
-> PublicDnsNamespaceChange -> f PublicDnsNamespaceChange
publicDnsNamespaceChange_description = (PublicDnsNamespaceChange -> Maybe Text)
-> (PublicDnsNamespaceChange
    -> Maybe Text -> PublicDnsNamespaceChange)
-> Lens
     PublicDnsNamespaceChange
     PublicDnsNamespaceChange
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublicDnsNamespaceChange' {Maybe Text
description :: Maybe Text
$sel:description:PublicDnsNamespaceChange' :: PublicDnsNamespaceChange -> Maybe Text
description} -> Maybe Text
description) (\s :: PublicDnsNamespaceChange
s@PublicDnsNamespaceChange' {} Maybe Text
a -> PublicDnsNamespaceChange
s {$sel:description:PublicDnsNamespaceChange' :: Maybe Text
description = Maybe Text
a} :: PublicDnsNamespaceChange)

-- | Properties to be updated in the public DNS namespace.
publicDnsNamespaceChange_properties :: Lens.Lens' PublicDnsNamespaceChange (Prelude.Maybe PublicDnsNamespacePropertiesChange)
publicDnsNamespaceChange_properties :: (Maybe PublicDnsNamespacePropertiesChange
 -> f (Maybe PublicDnsNamespacePropertiesChange))
-> PublicDnsNamespaceChange -> f PublicDnsNamespaceChange
publicDnsNamespaceChange_properties = (PublicDnsNamespaceChange
 -> Maybe PublicDnsNamespacePropertiesChange)
-> (PublicDnsNamespaceChange
    -> Maybe PublicDnsNamespacePropertiesChange
    -> PublicDnsNamespaceChange)
-> Lens
     PublicDnsNamespaceChange
     PublicDnsNamespaceChange
     (Maybe PublicDnsNamespacePropertiesChange)
     (Maybe PublicDnsNamespacePropertiesChange)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublicDnsNamespaceChange' {Maybe PublicDnsNamespacePropertiesChange
properties :: Maybe PublicDnsNamespacePropertiesChange
$sel:properties:PublicDnsNamespaceChange' :: PublicDnsNamespaceChange
-> Maybe PublicDnsNamespacePropertiesChange
properties} -> Maybe PublicDnsNamespacePropertiesChange
properties) (\s :: PublicDnsNamespaceChange
s@PublicDnsNamespaceChange' {} Maybe PublicDnsNamespacePropertiesChange
a -> PublicDnsNamespaceChange
s {$sel:properties:PublicDnsNamespaceChange' :: Maybe PublicDnsNamespacePropertiesChange
properties = Maybe PublicDnsNamespacePropertiesChange
a} :: PublicDnsNamespaceChange)

instance Prelude.Hashable PublicDnsNamespaceChange

instance Prelude.NFData PublicDnsNamespaceChange

instance Core.ToJSON PublicDnsNamespaceChange where
  toJSON :: PublicDnsNamespaceChange -> Value
toJSON PublicDnsNamespaceChange' {Maybe Text
Maybe PublicDnsNamespacePropertiesChange
properties :: Maybe PublicDnsNamespacePropertiesChange
description :: Maybe Text
$sel:properties:PublicDnsNamespaceChange' :: PublicDnsNamespaceChange
-> Maybe PublicDnsNamespacePropertiesChange
$sel:description:PublicDnsNamespaceChange' :: PublicDnsNamespaceChange -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"Properties" Text -> PublicDnsNamespacePropertiesChange -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PublicDnsNamespacePropertiesChange -> Pair)
-> Maybe PublicDnsNamespacePropertiesChange -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PublicDnsNamespacePropertiesChange
properties
          ]
      )