{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.CreatePublicDnsNamespace
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a public namespace based on DNS, which is visible on the
-- internet. The namespace defines your service naming scheme. For example,
-- if you name your namespace @example.com@ and name your service
-- @backend@, the resulting DNS name for the service is
-- @backend.example.com@. You can discover instances that were registered
-- with a public DNS namespace by using either a @DiscoverInstances@
-- request or using DNS. For the current quota on the number of namespaces
-- that you can create using the same Amazon Web Services account, see
-- <https://docs.aws.amazon.com/cloud-map/latest/dg/cloud-map-limits.html Cloud Map quotas>
-- in the /Cloud Map Developer Guide/.
--
-- The @CreatePublicDnsNamespace@ API operation is not supported in the
-- Amazon Web Services GovCloud (US) Regions.
module Amazonka.Route53AutoNaming.CreatePublicDnsNamespace
  ( -- * Creating a Request
    CreatePublicDnsNamespace (..),
    newCreatePublicDnsNamespace,

    -- * Request Lenses
    createPublicDnsNamespace_creatorRequestId,
    createPublicDnsNamespace_description,
    createPublicDnsNamespace_properties,
    createPublicDnsNamespace_tags,
    createPublicDnsNamespace_name,

    -- * Destructuring the Response
    CreatePublicDnsNamespaceResponse (..),
    newCreatePublicDnsNamespaceResponse,

    -- * Response Lenses
    createPublicDnsNamespaceResponse_operationId,
    createPublicDnsNamespaceResponse_httpStatus,
  )
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53AutoNaming.Types

-- | /See:/ 'newCreatePublicDnsNamespace' smart constructor.
data CreatePublicDnsNamespace = CreatePublicDnsNamespace'
  { -- | A unique string that identifies the request and that allows failed
    -- @CreatePublicDnsNamespace@ requests to be retried without the risk of
    -- running the operation twice. @CreatorRequestId@ can be any unique string
    -- (for example, a date\/timestamp).
    CreatePublicDnsNamespace -> Maybe Text
creatorRequestId :: Prelude.Maybe Prelude.Text,
    -- | A description for the namespace.
    CreatePublicDnsNamespace -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Properties for the public DNS namespace.
    CreatePublicDnsNamespace -> Maybe PublicDnsNamespaceProperties
properties :: Prelude.Maybe PublicDnsNamespaceProperties,
    -- | The tags to add to the namespace. Each tag consists of a key and an
    -- optional value that you define. Tags keys can be up to 128 characters in
    -- length, and tag values can be up to 256 characters in length.
    CreatePublicDnsNamespace -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name that you want to assign to this namespace.
    --
    -- Do not include sensitive information in the name. The name is publicly
    -- available using DNS queries.
    CreatePublicDnsNamespace -> Text
name :: Prelude.Text
  }
  deriving (CreatePublicDnsNamespace -> CreatePublicDnsNamespace -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePublicDnsNamespace -> CreatePublicDnsNamespace -> Bool
$c/= :: CreatePublicDnsNamespace -> CreatePublicDnsNamespace -> Bool
== :: CreatePublicDnsNamespace -> CreatePublicDnsNamespace -> Bool
$c== :: CreatePublicDnsNamespace -> CreatePublicDnsNamespace -> Bool
Prelude.Eq, ReadPrec [CreatePublicDnsNamespace]
ReadPrec CreatePublicDnsNamespace
Int -> ReadS CreatePublicDnsNamespace
ReadS [CreatePublicDnsNamespace]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreatePublicDnsNamespace]
$creadListPrec :: ReadPrec [CreatePublicDnsNamespace]
readPrec :: ReadPrec CreatePublicDnsNamespace
$creadPrec :: ReadPrec CreatePublicDnsNamespace
readList :: ReadS [CreatePublicDnsNamespace]
$creadList :: ReadS [CreatePublicDnsNamespace]
readsPrec :: Int -> ReadS CreatePublicDnsNamespace
$creadsPrec :: Int -> ReadS CreatePublicDnsNamespace
Prelude.Read, Int -> CreatePublicDnsNamespace -> ShowS
[CreatePublicDnsNamespace] -> ShowS
CreatePublicDnsNamespace -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePublicDnsNamespace] -> ShowS
$cshowList :: [CreatePublicDnsNamespace] -> ShowS
show :: CreatePublicDnsNamespace -> String
$cshow :: CreatePublicDnsNamespace -> String
showsPrec :: Int -> CreatePublicDnsNamespace -> ShowS
$cshowsPrec :: Int -> CreatePublicDnsNamespace -> ShowS
Prelude.Show, forall x.
Rep CreatePublicDnsNamespace x -> CreatePublicDnsNamespace
forall x.
CreatePublicDnsNamespace -> Rep CreatePublicDnsNamespace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreatePublicDnsNamespace x -> CreatePublicDnsNamespace
$cfrom :: forall x.
CreatePublicDnsNamespace -> Rep CreatePublicDnsNamespace x
Prelude.Generic)

-- |
-- Create a value of 'CreatePublicDnsNamespace' 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:
--
-- 'creatorRequestId', 'createPublicDnsNamespace_creatorRequestId' - A unique string that identifies the request and that allows failed
-- @CreatePublicDnsNamespace@ requests to be retried without the risk of
-- running the operation twice. @CreatorRequestId@ can be any unique string
-- (for example, a date\/timestamp).
--
-- 'description', 'createPublicDnsNamespace_description' - A description for the namespace.
--
-- 'properties', 'createPublicDnsNamespace_properties' - Properties for the public DNS namespace.
--
-- 'tags', 'createPublicDnsNamespace_tags' - The tags to add to the namespace. Each tag consists of a key and an
-- optional value that you define. Tags keys can be up to 128 characters in
-- length, and tag values can be up to 256 characters in length.
--
-- 'name', 'createPublicDnsNamespace_name' - The name that you want to assign to this namespace.
--
-- Do not include sensitive information in the name. The name is publicly
-- available using DNS queries.
newCreatePublicDnsNamespace ::
  -- | 'name'
  Prelude.Text ->
  CreatePublicDnsNamespace
newCreatePublicDnsNamespace :: Text -> CreatePublicDnsNamespace
newCreatePublicDnsNamespace Text
pName_ =
  CreatePublicDnsNamespace'
    { $sel:creatorRequestId:CreatePublicDnsNamespace' :: Maybe Text
creatorRequestId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreatePublicDnsNamespace' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:properties:CreatePublicDnsNamespace' :: Maybe PublicDnsNamespaceProperties
properties = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreatePublicDnsNamespace' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreatePublicDnsNamespace' :: Text
name = Text
pName_
    }

-- | A unique string that identifies the request and that allows failed
-- @CreatePublicDnsNamespace@ requests to be retried without the risk of
-- running the operation twice. @CreatorRequestId@ can be any unique string
-- (for example, a date\/timestamp).
createPublicDnsNamespace_creatorRequestId :: Lens.Lens' CreatePublicDnsNamespace (Prelude.Maybe Prelude.Text)
createPublicDnsNamespace_creatorRequestId :: Lens' CreatePublicDnsNamespace (Maybe Text)
createPublicDnsNamespace_creatorRequestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePublicDnsNamespace' {Maybe Text
creatorRequestId :: Maybe Text
$sel:creatorRequestId:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Maybe Text
creatorRequestId} -> Maybe Text
creatorRequestId) (\s :: CreatePublicDnsNamespace
s@CreatePublicDnsNamespace' {} Maybe Text
a -> CreatePublicDnsNamespace
s {$sel:creatorRequestId:CreatePublicDnsNamespace' :: Maybe Text
creatorRequestId = Maybe Text
a} :: CreatePublicDnsNamespace)

-- | A description for the namespace.
createPublicDnsNamespace_description :: Lens.Lens' CreatePublicDnsNamespace (Prelude.Maybe Prelude.Text)
createPublicDnsNamespace_description :: Lens' CreatePublicDnsNamespace (Maybe Text)
createPublicDnsNamespace_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePublicDnsNamespace' {Maybe Text
description :: Maybe Text
$sel:description:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Maybe Text
description} -> Maybe Text
description) (\s :: CreatePublicDnsNamespace
s@CreatePublicDnsNamespace' {} Maybe Text
a -> CreatePublicDnsNamespace
s {$sel:description:CreatePublicDnsNamespace' :: Maybe Text
description = Maybe Text
a} :: CreatePublicDnsNamespace)

-- | Properties for the public DNS namespace.
createPublicDnsNamespace_properties :: Lens.Lens' CreatePublicDnsNamespace (Prelude.Maybe PublicDnsNamespaceProperties)
createPublicDnsNamespace_properties :: Lens' CreatePublicDnsNamespace (Maybe PublicDnsNamespaceProperties)
createPublicDnsNamespace_properties = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePublicDnsNamespace' {Maybe PublicDnsNamespaceProperties
properties :: Maybe PublicDnsNamespaceProperties
$sel:properties:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Maybe PublicDnsNamespaceProperties
properties} -> Maybe PublicDnsNamespaceProperties
properties) (\s :: CreatePublicDnsNamespace
s@CreatePublicDnsNamespace' {} Maybe PublicDnsNamespaceProperties
a -> CreatePublicDnsNamespace
s {$sel:properties:CreatePublicDnsNamespace' :: Maybe PublicDnsNamespaceProperties
properties = Maybe PublicDnsNamespaceProperties
a} :: CreatePublicDnsNamespace)

-- | The tags to add to the namespace. Each tag consists of a key and an
-- optional value that you define. Tags keys can be up to 128 characters in
-- length, and tag values can be up to 256 characters in length.
createPublicDnsNamespace_tags :: Lens.Lens' CreatePublicDnsNamespace (Prelude.Maybe [Tag])
createPublicDnsNamespace_tags :: Lens' CreatePublicDnsNamespace (Maybe [Tag])
createPublicDnsNamespace_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePublicDnsNamespace' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreatePublicDnsNamespace
s@CreatePublicDnsNamespace' {} Maybe [Tag]
a -> CreatePublicDnsNamespace
s {$sel:tags:CreatePublicDnsNamespace' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreatePublicDnsNamespace) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name that you want to assign to this namespace.
--
-- Do not include sensitive information in the name. The name is publicly
-- available using DNS queries.
createPublicDnsNamespace_name :: Lens.Lens' CreatePublicDnsNamespace Prelude.Text
createPublicDnsNamespace_name :: Lens' CreatePublicDnsNamespace Text
createPublicDnsNamespace_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePublicDnsNamespace' {Text
name :: Text
$sel:name:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Text
name} -> Text
name) (\s :: CreatePublicDnsNamespace
s@CreatePublicDnsNamespace' {} Text
a -> CreatePublicDnsNamespace
s {$sel:name:CreatePublicDnsNamespace' :: Text
name = Text
a} :: CreatePublicDnsNamespace)

instance Core.AWSRequest CreatePublicDnsNamespace where
  type
    AWSResponse CreatePublicDnsNamespace =
      CreatePublicDnsNamespaceResponse
  request :: (Service -> Service)
-> CreatePublicDnsNamespace -> Request CreatePublicDnsNamespace
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreatePublicDnsNamespace
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreatePublicDnsNamespace)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreatePublicDnsNamespaceResponse
CreatePublicDnsNamespaceResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"OperationId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreatePublicDnsNamespace where
  hashWithSalt :: Int -> CreatePublicDnsNamespace -> Int
hashWithSalt Int
_salt CreatePublicDnsNamespace' {Maybe [Tag]
Maybe Text
Maybe PublicDnsNamespaceProperties
Text
name :: Text
tags :: Maybe [Tag]
properties :: Maybe PublicDnsNamespaceProperties
description :: Maybe Text
creatorRequestId :: Maybe Text
$sel:name:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Text
$sel:tags:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Maybe [Tag]
$sel:properties:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Maybe PublicDnsNamespaceProperties
$sel:description:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Maybe Text
$sel:creatorRequestId:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
creatorRequestId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PublicDnsNamespaceProperties
properties
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData CreatePublicDnsNamespace where
  rnf :: CreatePublicDnsNamespace -> ()
rnf CreatePublicDnsNamespace' {Maybe [Tag]
Maybe Text
Maybe PublicDnsNamespaceProperties
Text
name :: Text
tags :: Maybe [Tag]
properties :: Maybe PublicDnsNamespaceProperties
description :: Maybe Text
creatorRequestId :: Maybe Text
$sel:name:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Text
$sel:tags:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Maybe [Tag]
$sel:properties:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Maybe PublicDnsNamespaceProperties
$sel:description:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Maybe Text
$sel:creatorRequestId:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
creatorRequestId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PublicDnsNamespaceProperties
properties
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

instance Data.ToHeaders CreatePublicDnsNamespace where
  toHeaders :: CreatePublicDnsNamespace -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Route53AutoNaming_v20170314.CreatePublicDnsNamespace" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreatePublicDnsNamespace where
  toJSON :: CreatePublicDnsNamespace -> Value
toJSON CreatePublicDnsNamespace' {Maybe [Tag]
Maybe Text
Maybe PublicDnsNamespaceProperties
Text
name :: Text
tags :: Maybe [Tag]
properties :: Maybe PublicDnsNamespaceProperties
description :: Maybe Text
creatorRequestId :: Maybe Text
$sel:name:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Text
$sel:tags:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Maybe [Tag]
$sel:properties:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Maybe PublicDnsNamespaceProperties
$sel:description:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Maybe Text
$sel:creatorRequestId:CreatePublicDnsNamespace' :: CreatePublicDnsNamespace -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"CreatorRequestId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
creatorRequestId,
            (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"Properties" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PublicDnsNamespaceProperties
properties,
            (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
          ]
      )

instance Data.ToPath CreatePublicDnsNamespace where
  toPath :: CreatePublicDnsNamespace -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery CreatePublicDnsNamespace where
  toQuery :: CreatePublicDnsNamespace -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreatePublicDnsNamespaceResponse' smart constructor.
data CreatePublicDnsNamespaceResponse = CreatePublicDnsNamespaceResponse'
  { -- | A value that you can use to determine whether the request completed
    -- successfully. To get the status of the operation, see
    -- <https://docs.aws.amazon.com/cloud-map/latest/api/API_GetOperation.html GetOperation>.
    CreatePublicDnsNamespaceResponse -> Maybe Text
operationId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreatePublicDnsNamespaceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreatePublicDnsNamespaceResponse
-> CreatePublicDnsNamespaceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePublicDnsNamespaceResponse
-> CreatePublicDnsNamespaceResponse -> Bool
$c/= :: CreatePublicDnsNamespaceResponse
-> CreatePublicDnsNamespaceResponse -> Bool
== :: CreatePublicDnsNamespaceResponse
-> CreatePublicDnsNamespaceResponse -> Bool
$c== :: CreatePublicDnsNamespaceResponse
-> CreatePublicDnsNamespaceResponse -> Bool
Prelude.Eq, ReadPrec [CreatePublicDnsNamespaceResponse]
ReadPrec CreatePublicDnsNamespaceResponse
Int -> ReadS CreatePublicDnsNamespaceResponse
ReadS [CreatePublicDnsNamespaceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreatePublicDnsNamespaceResponse]
$creadListPrec :: ReadPrec [CreatePublicDnsNamespaceResponse]
readPrec :: ReadPrec CreatePublicDnsNamespaceResponse
$creadPrec :: ReadPrec CreatePublicDnsNamespaceResponse
readList :: ReadS [CreatePublicDnsNamespaceResponse]
$creadList :: ReadS [CreatePublicDnsNamespaceResponse]
readsPrec :: Int -> ReadS CreatePublicDnsNamespaceResponse
$creadsPrec :: Int -> ReadS CreatePublicDnsNamespaceResponse
Prelude.Read, Int -> CreatePublicDnsNamespaceResponse -> ShowS
[CreatePublicDnsNamespaceResponse] -> ShowS
CreatePublicDnsNamespaceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePublicDnsNamespaceResponse] -> ShowS
$cshowList :: [CreatePublicDnsNamespaceResponse] -> ShowS
show :: CreatePublicDnsNamespaceResponse -> String
$cshow :: CreatePublicDnsNamespaceResponse -> String
showsPrec :: Int -> CreatePublicDnsNamespaceResponse -> ShowS
$cshowsPrec :: Int -> CreatePublicDnsNamespaceResponse -> ShowS
Prelude.Show, forall x.
Rep CreatePublicDnsNamespaceResponse x
-> CreatePublicDnsNamespaceResponse
forall x.
CreatePublicDnsNamespaceResponse
-> Rep CreatePublicDnsNamespaceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreatePublicDnsNamespaceResponse x
-> CreatePublicDnsNamespaceResponse
$cfrom :: forall x.
CreatePublicDnsNamespaceResponse
-> Rep CreatePublicDnsNamespaceResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreatePublicDnsNamespaceResponse' 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:
--
-- 'operationId', 'createPublicDnsNamespaceResponse_operationId' - A value that you can use to determine whether the request completed
-- successfully. To get the status of the operation, see
-- <https://docs.aws.amazon.com/cloud-map/latest/api/API_GetOperation.html GetOperation>.
--
-- 'httpStatus', 'createPublicDnsNamespaceResponse_httpStatus' - The response's http status code.
newCreatePublicDnsNamespaceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreatePublicDnsNamespaceResponse
newCreatePublicDnsNamespaceResponse :: Int -> CreatePublicDnsNamespaceResponse
newCreatePublicDnsNamespaceResponse Int
pHttpStatus_ =
  CreatePublicDnsNamespaceResponse'
    { $sel:operationId:CreatePublicDnsNamespaceResponse' :: Maybe Text
operationId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreatePublicDnsNamespaceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A value that you can use to determine whether the request completed
-- successfully. To get the status of the operation, see
-- <https://docs.aws.amazon.com/cloud-map/latest/api/API_GetOperation.html GetOperation>.
createPublicDnsNamespaceResponse_operationId :: Lens.Lens' CreatePublicDnsNamespaceResponse (Prelude.Maybe Prelude.Text)
createPublicDnsNamespaceResponse_operationId :: Lens' CreatePublicDnsNamespaceResponse (Maybe Text)
createPublicDnsNamespaceResponse_operationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePublicDnsNamespaceResponse' {Maybe Text
operationId :: Maybe Text
$sel:operationId:CreatePublicDnsNamespaceResponse' :: CreatePublicDnsNamespaceResponse -> Maybe Text
operationId} -> Maybe Text
operationId) (\s :: CreatePublicDnsNamespaceResponse
s@CreatePublicDnsNamespaceResponse' {} Maybe Text
a -> CreatePublicDnsNamespaceResponse
s {$sel:operationId:CreatePublicDnsNamespaceResponse' :: Maybe Text
operationId = Maybe Text
a} :: CreatePublicDnsNamespaceResponse)

-- | The response's http status code.
createPublicDnsNamespaceResponse_httpStatus :: Lens.Lens' CreatePublicDnsNamespaceResponse Prelude.Int
createPublicDnsNamespaceResponse_httpStatus :: Lens' CreatePublicDnsNamespaceResponse Int
createPublicDnsNamespaceResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePublicDnsNamespaceResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreatePublicDnsNamespaceResponse' :: CreatePublicDnsNamespaceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreatePublicDnsNamespaceResponse
s@CreatePublicDnsNamespaceResponse' {} Int
a -> CreatePublicDnsNamespaceResponse
s {$sel:httpStatus:CreatePublicDnsNamespaceResponse' :: Int
httpStatus = Int
a} :: CreatePublicDnsNamespaceResponse)

instance
  Prelude.NFData
    CreatePublicDnsNamespaceResponse
  where
  rnf :: CreatePublicDnsNamespaceResponse -> ()
rnf CreatePublicDnsNamespaceResponse' {Int
Maybe Text
httpStatus :: Int
operationId :: Maybe Text
$sel:httpStatus:CreatePublicDnsNamespaceResponse' :: CreatePublicDnsNamespaceResponse -> Int
$sel:operationId:CreatePublicDnsNamespaceResponse' :: CreatePublicDnsNamespaceResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
operationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus