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

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

-- | A complex type that contains the name of an HTTP namespace.
--
-- /See:/ 'newHttpProperties' smart constructor.
data HttpProperties = HttpProperties'
  { -- | The name of an HTTP namespace.
    HttpProperties -> Maybe Text
httpName :: Prelude.Maybe Prelude.Text
  }
  deriving (HttpProperties -> HttpProperties -> Bool
(HttpProperties -> HttpProperties -> Bool)
-> (HttpProperties -> HttpProperties -> Bool) -> Eq HttpProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HttpProperties -> HttpProperties -> Bool
$c/= :: HttpProperties -> HttpProperties -> Bool
== :: HttpProperties -> HttpProperties -> Bool
$c== :: HttpProperties -> HttpProperties -> Bool
Prelude.Eq, ReadPrec [HttpProperties]
ReadPrec HttpProperties
Int -> ReadS HttpProperties
ReadS [HttpProperties]
(Int -> ReadS HttpProperties)
-> ReadS [HttpProperties]
-> ReadPrec HttpProperties
-> ReadPrec [HttpProperties]
-> Read HttpProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HttpProperties]
$creadListPrec :: ReadPrec [HttpProperties]
readPrec :: ReadPrec HttpProperties
$creadPrec :: ReadPrec HttpProperties
readList :: ReadS [HttpProperties]
$creadList :: ReadS [HttpProperties]
readsPrec :: Int -> ReadS HttpProperties
$creadsPrec :: Int -> ReadS HttpProperties
Prelude.Read, Int -> HttpProperties -> ShowS
[HttpProperties] -> ShowS
HttpProperties -> String
(Int -> HttpProperties -> ShowS)
-> (HttpProperties -> String)
-> ([HttpProperties] -> ShowS)
-> Show HttpProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HttpProperties] -> ShowS
$cshowList :: [HttpProperties] -> ShowS
show :: HttpProperties -> String
$cshow :: HttpProperties -> String
showsPrec :: Int -> HttpProperties -> ShowS
$cshowsPrec :: Int -> HttpProperties -> ShowS
Prelude.Show, (forall x. HttpProperties -> Rep HttpProperties x)
-> (forall x. Rep HttpProperties x -> HttpProperties)
-> Generic HttpProperties
forall x. Rep HttpProperties x -> HttpProperties
forall x. HttpProperties -> Rep HttpProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HttpProperties x -> HttpProperties
$cfrom :: forall x. HttpProperties -> Rep HttpProperties x
Prelude.Generic)

-- |
-- Create a value of 'HttpProperties' 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:
--
-- 'httpName', 'httpProperties_httpName' - The name of an HTTP namespace.
newHttpProperties ::
  HttpProperties
newHttpProperties :: HttpProperties
newHttpProperties =
  HttpProperties' :: Maybe Text -> HttpProperties
HttpProperties' {$sel:httpName:HttpProperties' :: Maybe Text
httpName = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The name of an HTTP namespace.
httpProperties_httpName :: Lens.Lens' HttpProperties (Prelude.Maybe Prelude.Text)
httpProperties_httpName :: (Maybe Text -> f (Maybe Text))
-> HttpProperties -> f HttpProperties
httpProperties_httpName = (HttpProperties -> Maybe Text)
-> (HttpProperties -> Maybe Text -> HttpProperties)
-> Lens HttpProperties HttpProperties (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpProperties' {Maybe Text
httpName :: Maybe Text
$sel:httpName:HttpProperties' :: HttpProperties -> Maybe Text
httpName} -> Maybe Text
httpName) (\s :: HttpProperties
s@HttpProperties' {} Maybe Text
a -> HttpProperties
s {$sel:httpName:HttpProperties' :: Maybe Text
httpName = Maybe Text
a} :: HttpProperties)

instance Core.FromJSON HttpProperties where
  parseJSON :: Value -> Parser HttpProperties
parseJSON =
    String
-> (Object -> Parser HttpProperties)
-> Value
-> Parser HttpProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"HttpProperties"
      ( \Object
x ->
          Maybe Text -> HttpProperties
HttpProperties' (Maybe Text -> HttpProperties)
-> Parser (Maybe Text) -> Parser HttpProperties
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HttpName")
      )

instance Prelude.Hashable HttpProperties

instance Prelude.NFData HttpProperties