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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'HttpNamespaceChange' 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', 'httpNamespaceChange_description' - An updated description for the HTTP namespace.
newHttpNamespaceChange ::
  -- | 'description'
  Prelude.Text ->
  HttpNamespaceChange
newHttpNamespaceChange :: Text -> HttpNamespaceChange
newHttpNamespaceChange Text
pDescription_ =
  HttpNamespaceChange' :: Text -> HttpNamespaceChange
HttpNamespaceChange' {$sel:description:HttpNamespaceChange' :: Text
description = Text
pDescription_}

-- | An updated description for the HTTP namespace.
httpNamespaceChange_description :: Lens.Lens' HttpNamespaceChange Prelude.Text
httpNamespaceChange_description :: (Text -> f Text) -> HttpNamespaceChange -> f HttpNamespaceChange
httpNamespaceChange_description = (HttpNamespaceChange -> Text)
-> (HttpNamespaceChange -> Text -> HttpNamespaceChange)
-> Lens HttpNamespaceChange HttpNamespaceChange Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpNamespaceChange' {Text
description :: Text
$sel:description:HttpNamespaceChange' :: HttpNamespaceChange -> Text
description} -> Text
description) (\s :: HttpNamespaceChange
s@HttpNamespaceChange' {} Text
a -> HttpNamespaceChange
s {$sel:description:HttpNamespaceChange' :: Text
description = Text
a} :: HttpNamespaceChange)

instance Prelude.Hashable HttpNamespaceChange

instance Prelude.NFData HttpNamespaceChange

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