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

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

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

-- |
-- Create a value of 'PrivateDnsNamespaceChange' 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', 'privateDnsNamespaceChange_description' - An updated description for the private DNS namespace.
--
-- 'properties', 'privateDnsNamespaceChange_properties' - Properties to be updated in the private DNS namespace.
newPrivateDnsNamespaceChange ::
  PrivateDnsNamespaceChange
newPrivateDnsNamespaceChange :: PrivateDnsNamespaceChange
newPrivateDnsNamespaceChange =
  PrivateDnsNamespaceChange' :: Maybe Text
-> Maybe PrivateDnsNamespacePropertiesChange
-> PrivateDnsNamespaceChange
PrivateDnsNamespaceChange'
    { $sel:description:PrivateDnsNamespaceChange' :: Maybe Text
description =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:properties:PrivateDnsNamespaceChange' :: Maybe PrivateDnsNamespacePropertiesChange
properties = Maybe PrivateDnsNamespacePropertiesChange
forall a. Maybe a
Prelude.Nothing
    }

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

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

instance Prelude.Hashable PrivateDnsNamespaceChange

instance Prelude.NFData PrivateDnsNamespaceChange

instance Core.ToJSON PrivateDnsNamespaceChange where
  toJSON :: PrivateDnsNamespaceChange -> Value
toJSON PrivateDnsNamespaceChange' {Maybe Text
Maybe PrivateDnsNamespacePropertiesChange
properties :: Maybe PrivateDnsNamespacePropertiesChange
description :: Maybe Text
$sel:properties:PrivateDnsNamespaceChange' :: PrivateDnsNamespaceChange
-> Maybe PrivateDnsNamespacePropertiesChange
$sel:description:PrivateDnsNamespaceChange' :: PrivateDnsNamespaceChange -> 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 -> PrivateDnsNamespacePropertiesChange -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PrivateDnsNamespacePropertiesChange -> Pair)
-> Maybe PrivateDnsNamespacePropertiesChange -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PrivateDnsNamespacePropertiesChange
properties
          ]
      )