{-# 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.RedshiftServerLess.UpdateNamespace
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates a namespace with the specified settings.
module Amazonka.RedshiftServerLess.UpdateNamespace
  ( -- * Creating a Request
    UpdateNamespace (..),
    newUpdateNamespace,

    -- * Request Lenses
    updateNamespace_adminUserPassword,
    updateNamespace_adminUsername,
    updateNamespace_defaultIamRoleArn,
    updateNamespace_iamRoles,
    updateNamespace_kmsKeyId,
    updateNamespace_logExports,
    updateNamespace_namespaceName,

    -- * Destructuring the Response
    UpdateNamespaceResponse (..),
    newUpdateNamespaceResponse,

    -- * Response Lenses
    updateNamespaceResponse_httpStatus,
    updateNamespaceResponse_namespace,
  )
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.RedshiftServerLess.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateNamespace' smart constructor.
data UpdateNamespace = UpdateNamespace'
  { -- | The password of the administrator for the first database created in the
    -- namespace.
    UpdateNamespace -> Maybe (Sensitive Text)
adminUserPassword :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The username of the administrator for the first database created in the
    -- namespace.
    UpdateNamespace -> Maybe (Sensitive Text)
adminUsername :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the IAM role to set as a default in
    -- the namespace.
    UpdateNamespace -> Maybe Text
defaultIamRoleArn :: Prelude.Maybe Prelude.Text,
    -- | A list of IAM roles to associate with the namespace.
    UpdateNamespace -> Maybe [Text]
iamRoles :: Prelude.Maybe [Prelude.Text],
    -- | The ID of the Amazon Web Services Key Management Service key used to
    -- encrypt your data.
    UpdateNamespace -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The types of logs the namespace can export. The export types are
    -- @userlog@, @connectionlog@, and @useractivitylog@.
    UpdateNamespace -> Maybe [LogExport]
logExports :: Prelude.Maybe [LogExport],
    -- | The name of the namespace.
    UpdateNamespace -> Text
namespaceName :: Prelude.Text
  }
  deriving (UpdateNamespace -> UpdateNamespace -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateNamespace -> UpdateNamespace -> Bool
$c/= :: UpdateNamespace -> UpdateNamespace -> Bool
== :: UpdateNamespace -> UpdateNamespace -> Bool
$c== :: UpdateNamespace -> UpdateNamespace -> Bool
Prelude.Eq, Int -> UpdateNamespace -> ShowS
[UpdateNamespace] -> ShowS
UpdateNamespace -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateNamespace] -> ShowS
$cshowList :: [UpdateNamespace] -> ShowS
show :: UpdateNamespace -> String
$cshow :: UpdateNamespace -> String
showsPrec :: Int -> UpdateNamespace -> ShowS
$cshowsPrec :: Int -> UpdateNamespace -> ShowS
Prelude.Show, forall x. Rep UpdateNamespace x -> UpdateNamespace
forall x. UpdateNamespace -> Rep UpdateNamespace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateNamespace x -> UpdateNamespace
$cfrom :: forall x. UpdateNamespace -> Rep UpdateNamespace x
Prelude.Generic)

-- |
-- Create a value of 'UpdateNamespace' 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:
--
-- 'adminUserPassword', 'updateNamespace_adminUserPassword' - The password of the administrator for the first database created in the
-- namespace.
--
-- 'adminUsername', 'updateNamespace_adminUsername' - The username of the administrator for the first database created in the
-- namespace.
--
-- 'defaultIamRoleArn', 'updateNamespace_defaultIamRoleArn' - The Amazon Resource Name (ARN) of the IAM role to set as a default in
-- the namespace.
--
-- 'iamRoles', 'updateNamespace_iamRoles' - A list of IAM roles to associate with the namespace.
--
-- 'kmsKeyId', 'updateNamespace_kmsKeyId' - The ID of the Amazon Web Services Key Management Service key used to
-- encrypt your data.
--
-- 'logExports', 'updateNamespace_logExports' - The types of logs the namespace can export. The export types are
-- @userlog@, @connectionlog@, and @useractivitylog@.
--
-- 'namespaceName', 'updateNamespace_namespaceName' - The name of the namespace.
newUpdateNamespace ::
  -- | 'namespaceName'
  Prelude.Text ->
  UpdateNamespace
newUpdateNamespace :: Text -> UpdateNamespace
newUpdateNamespace Text
pNamespaceName_ =
  UpdateNamespace'
    { $sel:adminUserPassword:UpdateNamespace' :: Maybe (Sensitive Text)
adminUserPassword =
        forall a. Maybe a
Prelude.Nothing,
      $sel:adminUsername:UpdateNamespace' :: Maybe (Sensitive Text)
adminUsername = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultIamRoleArn:UpdateNamespace' :: Maybe Text
defaultIamRoleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:iamRoles:UpdateNamespace' :: Maybe [Text]
iamRoles = forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:UpdateNamespace' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
      $sel:logExports:UpdateNamespace' :: Maybe [LogExport]
logExports = forall a. Maybe a
Prelude.Nothing,
      $sel:namespaceName:UpdateNamespace' :: Text
namespaceName = Text
pNamespaceName_
    }

-- | The password of the administrator for the first database created in the
-- namespace.
updateNamespace_adminUserPassword :: Lens.Lens' UpdateNamespace (Prelude.Maybe Prelude.Text)
updateNamespace_adminUserPassword :: Lens' UpdateNamespace (Maybe Text)
updateNamespace_adminUserPassword = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNamespace' {Maybe (Sensitive Text)
adminUserPassword :: Maybe (Sensitive Text)
$sel:adminUserPassword:UpdateNamespace' :: UpdateNamespace -> Maybe (Sensitive Text)
adminUserPassword} -> Maybe (Sensitive Text)
adminUserPassword) (\s :: UpdateNamespace
s@UpdateNamespace' {} Maybe (Sensitive Text)
a -> UpdateNamespace
s {$sel:adminUserPassword:UpdateNamespace' :: Maybe (Sensitive Text)
adminUserPassword = Maybe (Sensitive Text)
a} :: UpdateNamespace) 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 a. Iso' (Sensitive a) a
Data._Sensitive

-- | The username of the administrator for the first database created in the
-- namespace.
updateNamespace_adminUsername :: Lens.Lens' UpdateNamespace (Prelude.Maybe Prelude.Text)
updateNamespace_adminUsername :: Lens' UpdateNamespace (Maybe Text)
updateNamespace_adminUsername = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNamespace' {Maybe (Sensitive Text)
adminUsername :: Maybe (Sensitive Text)
$sel:adminUsername:UpdateNamespace' :: UpdateNamespace -> Maybe (Sensitive Text)
adminUsername} -> Maybe (Sensitive Text)
adminUsername) (\s :: UpdateNamespace
s@UpdateNamespace' {} Maybe (Sensitive Text)
a -> UpdateNamespace
s {$sel:adminUsername:UpdateNamespace' :: Maybe (Sensitive Text)
adminUsername = Maybe (Sensitive Text)
a} :: UpdateNamespace) 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 a. Iso' (Sensitive a) a
Data._Sensitive

-- | The Amazon Resource Name (ARN) of the IAM role to set as a default in
-- the namespace.
updateNamespace_defaultIamRoleArn :: Lens.Lens' UpdateNamespace (Prelude.Maybe Prelude.Text)
updateNamespace_defaultIamRoleArn :: Lens' UpdateNamespace (Maybe Text)
updateNamespace_defaultIamRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNamespace' {Maybe Text
defaultIamRoleArn :: Maybe Text
$sel:defaultIamRoleArn:UpdateNamespace' :: UpdateNamespace -> Maybe Text
defaultIamRoleArn} -> Maybe Text
defaultIamRoleArn) (\s :: UpdateNamespace
s@UpdateNamespace' {} Maybe Text
a -> UpdateNamespace
s {$sel:defaultIamRoleArn:UpdateNamespace' :: Maybe Text
defaultIamRoleArn = Maybe Text
a} :: UpdateNamespace)

-- | A list of IAM roles to associate with the namespace.
updateNamespace_iamRoles :: Lens.Lens' UpdateNamespace (Prelude.Maybe [Prelude.Text])
updateNamespace_iamRoles :: Lens' UpdateNamespace (Maybe [Text])
updateNamespace_iamRoles = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNamespace' {Maybe [Text]
iamRoles :: Maybe [Text]
$sel:iamRoles:UpdateNamespace' :: UpdateNamespace -> Maybe [Text]
iamRoles} -> Maybe [Text]
iamRoles) (\s :: UpdateNamespace
s@UpdateNamespace' {} Maybe [Text]
a -> UpdateNamespace
s {$sel:iamRoles:UpdateNamespace' :: Maybe [Text]
iamRoles = Maybe [Text]
a} :: UpdateNamespace) 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 ID of the Amazon Web Services Key Management Service key used to
-- encrypt your data.
updateNamespace_kmsKeyId :: Lens.Lens' UpdateNamespace (Prelude.Maybe Prelude.Text)
updateNamespace_kmsKeyId :: Lens' UpdateNamespace (Maybe Text)
updateNamespace_kmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNamespace' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:UpdateNamespace' :: UpdateNamespace -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: UpdateNamespace
s@UpdateNamespace' {} Maybe Text
a -> UpdateNamespace
s {$sel:kmsKeyId:UpdateNamespace' :: Maybe Text
kmsKeyId = Maybe Text
a} :: UpdateNamespace)

-- | The types of logs the namespace can export. The export types are
-- @userlog@, @connectionlog@, and @useractivitylog@.
updateNamespace_logExports :: Lens.Lens' UpdateNamespace (Prelude.Maybe [LogExport])
updateNamespace_logExports :: Lens' UpdateNamespace (Maybe [LogExport])
updateNamespace_logExports = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNamespace' {Maybe [LogExport]
logExports :: Maybe [LogExport]
$sel:logExports:UpdateNamespace' :: UpdateNamespace -> Maybe [LogExport]
logExports} -> Maybe [LogExport]
logExports) (\s :: UpdateNamespace
s@UpdateNamespace' {} Maybe [LogExport]
a -> UpdateNamespace
s {$sel:logExports:UpdateNamespace' :: Maybe [LogExport]
logExports = Maybe [LogExport]
a} :: UpdateNamespace) 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 of the namespace.
updateNamespace_namespaceName :: Lens.Lens' UpdateNamespace Prelude.Text
updateNamespace_namespaceName :: Lens' UpdateNamespace Text
updateNamespace_namespaceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNamespace' {Text
namespaceName :: Text
$sel:namespaceName:UpdateNamespace' :: UpdateNamespace -> Text
namespaceName} -> Text
namespaceName) (\s :: UpdateNamespace
s@UpdateNamespace' {} Text
a -> UpdateNamespace
s {$sel:namespaceName:UpdateNamespace' :: Text
namespaceName = Text
a} :: UpdateNamespace)

instance Core.AWSRequest UpdateNamespace where
  type
    AWSResponse UpdateNamespace =
      UpdateNamespaceResponse
  request :: (Service -> Service) -> UpdateNamespace -> Request UpdateNamespace
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 UpdateNamespace
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateNamespace)))
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 ->
          Int -> Namespace -> UpdateNamespaceResponse
UpdateNamespaceResponse'
            forall (f :: * -> *) a b. Functor 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))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"namespace")
      )

instance Prelude.Hashable UpdateNamespace where
  hashWithSalt :: Int -> UpdateNamespace -> Int
hashWithSalt Int
_salt UpdateNamespace' {Maybe [Text]
Maybe [LogExport]
Maybe Text
Maybe (Sensitive Text)
Text
namespaceName :: Text
logExports :: Maybe [LogExport]
kmsKeyId :: Maybe Text
iamRoles :: Maybe [Text]
defaultIamRoleArn :: Maybe Text
adminUsername :: Maybe (Sensitive Text)
adminUserPassword :: Maybe (Sensitive Text)
$sel:namespaceName:UpdateNamespace' :: UpdateNamespace -> Text
$sel:logExports:UpdateNamespace' :: UpdateNamespace -> Maybe [LogExport]
$sel:kmsKeyId:UpdateNamespace' :: UpdateNamespace -> Maybe Text
$sel:iamRoles:UpdateNamespace' :: UpdateNamespace -> Maybe [Text]
$sel:defaultIamRoleArn:UpdateNamespace' :: UpdateNamespace -> Maybe Text
$sel:adminUsername:UpdateNamespace' :: UpdateNamespace -> Maybe (Sensitive Text)
$sel:adminUserPassword:UpdateNamespace' :: UpdateNamespace -> Maybe (Sensitive Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
adminUserPassword
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
adminUsername
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultIamRoleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
iamRoles
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [LogExport]
logExports
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
namespaceName

instance Prelude.NFData UpdateNamespace where
  rnf :: UpdateNamespace -> ()
rnf UpdateNamespace' {Maybe [Text]
Maybe [LogExport]
Maybe Text
Maybe (Sensitive Text)
Text
namespaceName :: Text
logExports :: Maybe [LogExport]
kmsKeyId :: Maybe Text
iamRoles :: Maybe [Text]
defaultIamRoleArn :: Maybe Text
adminUsername :: Maybe (Sensitive Text)
adminUserPassword :: Maybe (Sensitive Text)
$sel:namespaceName:UpdateNamespace' :: UpdateNamespace -> Text
$sel:logExports:UpdateNamespace' :: UpdateNamespace -> Maybe [LogExport]
$sel:kmsKeyId:UpdateNamespace' :: UpdateNamespace -> Maybe Text
$sel:iamRoles:UpdateNamespace' :: UpdateNamespace -> Maybe [Text]
$sel:defaultIamRoleArn:UpdateNamespace' :: UpdateNamespace -> Maybe Text
$sel:adminUsername:UpdateNamespace' :: UpdateNamespace -> Maybe (Sensitive Text)
$sel:adminUserPassword:UpdateNamespace' :: UpdateNamespace -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
adminUserPassword
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
adminUsername
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultIamRoleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
iamRoles
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [LogExport]
logExports
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
namespaceName

instance Data.ToHeaders UpdateNamespace where
  toHeaders :: UpdateNamespace -> 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
"RedshiftServerless.UpdateNamespace" ::
                          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 UpdateNamespace where
  toJSON :: UpdateNamespace -> Value
toJSON UpdateNamespace' {Maybe [Text]
Maybe [LogExport]
Maybe Text
Maybe (Sensitive Text)
Text
namespaceName :: Text
logExports :: Maybe [LogExport]
kmsKeyId :: Maybe Text
iamRoles :: Maybe [Text]
defaultIamRoleArn :: Maybe Text
adminUsername :: Maybe (Sensitive Text)
adminUserPassword :: Maybe (Sensitive Text)
$sel:namespaceName:UpdateNamespace' :: UpdateNamespace -> Text
$sel:logExports:UpdateNamespace' :: UpdateNamespace -> Maybe [LogExport]
$sel:kmsKeyId:UpdateNamespace' :: UpdateNamespace -> Maybe Text
$sel:iamRoles:UpdateNamespace' :: UpdateNamespace -> Maybe [Text]
$sel:defaultIamRoleArn:UpdateNamespace' :: UpdateNamespace -> Maybe Text
$sel:adminUsername:UpdateNamespace' :: UpdateNamespace -> Maybe (Sensitive Text)
$sel:adminUserPassword:UpdateNamespace' :: UpdateNamespace -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"adminUserPassword" 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 (Sensitive Text)
adminUserPassword,
            (Key
"adminUsername" 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 (Sensitive Text)
adminUsername,
            (Key
"defaultIamRoleArn" 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
defaultIamRoleArn,
            (Key
"iamRoles" 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]
iamRoles,
            (Key
"kmsKeyId" 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
kmsKeyId,
            (Key
"logExports" 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 [LogExport]
logExports,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"namespaceName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
namespaceName)
          ]
      )

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

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

-- | /See:/ 'newUpdateNamespaceResponse' smart constructor.
data UpdateNamespaceResponse = UpdateNamespaceResponse'
  { -- | The response's http status code.
    UpdateNamespaceResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of tag instances.
    UpdateNamespaceResponse -> Namespace
namespace :: Namespace
  }
  deriving (UpdateNamespaceResponse -> UpdateNamespaceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateNamespaceResponse -> UpdateNamespaceResponse -> Bool
$c/= :: UpdateNamespaceResponse -> UpdateNamespaceResponse -> Bool
== :: UpdateNamespaceResponse -> UpdateNamespaceResponse -> Bool
$c== :: UpdateNamespaceResponse -> UpdateNamespaceResponse -> Bool
Prelude.Eq, Int -> UpdateNamespaceResponse -> ShowS
[UpdateNamespaceResponse] -> ShowS
UpdateNamespaceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateNamespaceResponse] -> ShowS
$cshowList :: [UpdateNamespaceResponse] -> ShowS
show :: UpdateNamespaceResponse -> String
$cshow :: UpdateNamespaceResponse -> String
showsPrec :: Int -> UpdateNamespaceResponse -> ShowS
$cshowsPrec :: Int -> UpdateNamespaceResponse -> ShowS
Prelude.Show, forall x. Rep UpdateNamespaceResponse x -> UpdateNamespaceResponse
forall x. UpdateNamespaceResponse -> Rep UpdateNamespaceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateNamespaceResponse x -> UpdateNamespaceResponse
$cfrom :: forall x. UpdateNamespaceResponse -> Rep UpdateNamespaceResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateNamespaceResponse' 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:
--
-- 'httpStatus', 'updateNamespaceResponse_httpStatus' - The response's http status code.
--
-- 'namespace', 'updateNamespaceResponse_namespace' - A list of tag instances.
newUpdateNamespaceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'namespace'
  Namespace ->
  UpdateNamespaceResponse
newUpdateNamespaceResponse :: Int -> Namespace -> UpdateNamespaceResponse
newUpdateNamespaceResponse Int
pHttpStatus_ Namespace
pNamespace_ =
  UpdateNamespaceResponse'
    { $sel:httpStatus:UpdateNamespaceResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:namespace:UpdateNamespaceResponse' :: Namespace
namespace = Namespace
pNamespace_
    }

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

-- | A list of tag instances.
updateNamespaceResponse_namespace :: Lens.Lens' UpdateNamespaceResponse Namespace
updateNamespaceResponse_namespace :: Lens' UpdateNamespaceResponse Namespace
updateNamespaceResponse_namespace = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNamespaceResponse' {Namespace
namespace :: Namespace
$sel:namespace:UpdateNamespaceResponse' :: UpdateNamespaceResponse -> Namespace
namespace} -> Namespace
namespace) (\s :: UpdateNamespaceResponse
s@UpdateNamespaceResponse' {} Namespace
a -> UpdateNamespaceResponse
s {$sel:namespace:UpdateNamespaceResponse' :: Namespace
namespace = Namespace
a} :: UpdateNamespaceResponse)

instance Prelude.NFData UpdateNamespaceResponse where
  rnf :: UpdateNamespaceResponse -> ()
rnf UpdateNamespaceResponse' {Int
Namespace
namespace :: Namespace
httpStatus :: Int
$sel:namespace:UpdateNamespaceResponse' :: UpdateNamespaceResponse -> Namespace
$sel:httpStatus:UpdateNamespaceResponse' :: UpdateNamespaceResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Namespace
namespace