{-# 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.NamespaceProperties
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Route53AutoNaming.Types.NamespaceProperties where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53AutoNaming.Types.DnsProperties
import Amazonka.Route53AutoNaming.Types.HttpProperties

-- | A complex type that contains information that\'s specific to the
-- namespace type.
--
-- /See:/ 'newNamespaceProperties' smart constructor.
data NamespaceProperties = NamespaceProperties'
  { -- | A complex type that contains the ID for the Route 53 hosted zone that
    -- Cloud Map creates when you create a namespace.
    NamespaceProperties -> Maybe DnsProperties
dnsProperties :: Prelude.Maybe DnsProperties,
    -- | A complex type that contains the name of an HTTP namespace.
    NamespaceProperties -> Maybe HttpProperties
httpProperties :: Prelude.Maybe HttpProperties
  }
  deriving (NamespaceProperties -> NamespaceProperties -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NamespaceProperties -> NamespaceProperties -> Bool
$c/= :: NamespaceProperties -> NamespaceProperties -> Bool
== :: NamespaceProperties -> NamespaceProperties -> Bool
$c== :: NamespaceProperties -> NamespaceProperties -> Bool
Prelude.Eq, ReadPrec [NamespaceProperties]
ReadPrec NamespaceProperties
Int -> ReadS NamespaceProperties
ReadS [NamespaceProperties]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NamespaceProperties]
$creadListPrec :: ReadPrec [NamespaceProperties]
readPrec :: ReadPrec NamespaceProperties
$creadPrec :: ReadPrec NamespaceProperties
readList :: ReadS [NamespaceProperties]
$creadList :: ReadS [NamespaceProperties]
readsPrec :: Int -> ReadS NamespaceProperties
$creadsPrec :: Int -> ReadS NamespaceProperties
Prelude.Read, Int -> NamespaceProperties -> ShowS
[NamespaceProperties] -> ShowS
NamespaceProperties -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NamespaceProperties] -> ShowS
$cshowList :: [NamespaceProperties] -> ShowS
show :: NamespaceProperties -> String
$cshow :: NamespaceProperties -> String
showsPrec :: Int -> NamespaceProperties -> ShowS
$cshowsPrec :: Int -> NamespaceProperties -> ShowS
Prelude.Show, forall x. Rep NamespaceProperties x -> NamespaceProperties
forall x. NamespaceProperties -> Rep NamespaceProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NamespaceProperties x -> NamespaceProperties
$cfrom :: forall x. NamespaceProperties -> Rep NamespaceProperties x
Prelude.Generic)

-- |
-- Create a value of 'NamespaceProperties' 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:
--
-- 'dnsProperties', 'namespaceProperties_dnsProperties' - A complex type that contains the ID for the Route 53 hosted zone that
-- Cloud Map creates when you create a namespace.
--
-- 'httpProperties', 'namespaceProperties_httpProperties' - A complex type that contains the name of an HTTP namespace.
newNamespaceProperties ::
  NamespaceProperties
newNamespaceProperties :: NamespaceProperties
newNamespaceProperties =
  NamespaceProperties'
    { $sel:dnsProperties:NamespaceProperties' :: Maybe DnsProperties
dnsProperties =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpProperties:NamespaceProperties' :: Maybe HttpProperties
httpProperties = forall a. Maybe a
Prelude.Nothing
    }

-- | A complex type that contains the ID for the Route 53 hosted zone that
-- Cloud Map creates when you create a namespace.
namespaceProperties_dnsProperties :: Lens.Lens' NamespaceProperties (Prelude.Maybe DnsProperties)
namespaceProperties_dnsProperties :: Lens' NamespaceProperties (Maybe DnsProperties)
namespaceProperties_dnsProperties = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NamespaceProperties' {Maybe DnsProperties
dnsProperties :: Maybe DnsProperties
$sel:dnsProperties:NamespaceProperties' :: NamespaceProperties -> Maybe DnsProperties
dnsProperties} -> Maybe DnsProperties
dnsProperties) (\s :: NamespaceProperties
s@NamespaceProperties' {} Maybe DnsProperties
a -> NamespaceProperties
s {$sel:dnsProperties:NamespaceProperties' :: Maybe DnsProperties
dnsProperties = Maybe DnsProperties
a} :: NamespaceProperties)

-- | A complex type that contains the name of an HTTP namespace.
namespaceProperties_httpProperties :: Lens.Lens' NamespaceProperties (Prelude.Maybe HttpProperties)
namespaceProperties_httpProperties :: Lens' NamespaceProperties (Maybe HttpProperties)
namespaceProperties_httpProperties = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NamespaceProperties' {Maybe HttpProperties
httpProperties :: Maybe HttpProperties
$sel:httpProperties:NamespaceProperties' :: NamespaceProperties -> Maybe HttpProperties
httpProperties} -> Maybe HttpProperties
httpProperties) (\s :: NamespaceProperties
s@NamespaceProperties' {} Maybe HttpProperties
a -> NamespaceProperties
s {$sel:httpProperties:NamespaceProperties' :: Maybe HttpProperties
httpProperties = Maybe HttpProperties
a} :: NamespaceProperties)

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

instance Prelude.Hashable NamespaceProperties where
  hashWithSalt :: Int -> NamespaceProperties -> Int
hashWithSalt Int
_salt NamespaceProperties' {Maybe HttpProperties
Maybe DnsProperties
httpProperties :: Maybe HttpProperties
dnsProperties :: Maybe DnsProperties
$sel:httpProperties:NamespaceProperties' :: NamespaceProperties -> Maybe HttpProperties
$sel:dnsProperties:NamespaceProperties' :: NamespaceProperties -> Maybe DnsProperties
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DnsProperties
dnsProperties
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HttpProperties
httpProperties

instance Prelude.NFData NamespaceProperties where
  rnf :: NamespaceProperties -> ()
rnf NamespaceProperties' {Maybe HttpProperties
Maybe DnsProperties
httpProperties :: Maybe HttpProperties
dnsProperties :: Maybe DnsProperties
$sel:httpProperties:NamespaceProperties' :: NamespaceProperties -> Maybe HttpProperties
$sel:dnsProperties:NamespaceProperties' :: NamespaceProperties -> Maybe DnsProperties
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe DnsProperties
dnsProperties
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HttpProperties
httpProperties