{-# 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.DocDbElastic.UpdateCluster
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Modifies a Elastic DocumentDB cluster. This includes updating
-- admin-username\/password, upgrading API version setting up a backup
-- window and maintenance window
module Amazonka.DocDbElastic.UpdateCluster
  ( -- * Creating a Request
    UpdateCluster (..),
    newUpdateCluster,

    -- * Request Lenses
    updateCluster_adminUserPassword,
    updateCluster_authType,
    updateCluster_clientToken,
    updateCluster_preferredMaintenanceWindow,
    updateCluster_shardCapacity,
    updateCluster_shardCount,
    updateCluster_subnetIds,
    updateCluster_vpcSecurityGroupIds,
    updateCluster_clusterArn,

    -- * Destructuring the Response
    UpdateClusterResponse (..),
    newUpdateClusterResponse,

    -- * Response Lenses
    updateClusterResponse_httpStatus,
    updateClusterResponse_cluster,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DocDbElastic.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateCluster' smart constructor.
data UpdateCluster = UpdateCluster'
  { -- | The password for the Elastic DocumentDB cluster administrator. This
    -- password can contain any printable ASCII character except forward slash
    -- (\/), double quote (\"), or the \"at\" symbol (\@).
    --
    -- /Constraints/: Must contain from 8 to 100 characters.
    UpdateCluster -> Maybe (Sensitive Text)
adminUserPassword :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The authentication type for the Elastic DocumentDB cluster.
    UpdateCluster -> Maybe Auth
authType :: Prelude.Maybe Auth,
    -- | The client token for the Elastic DocumentDB cluster.
    UpdateCluster -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The weekly time range during which system maintenance can occur, in
    -- Universal Coordinated Time (UTC).
    --
    -- /Format/: @ddd:hh24:mi-ddd:hh24:mi@
    --
    -- /Default/: a 30-minute window selected at random from an 8-hour block of
    -- time for each Amazon Web Services Region, occurring on a random day of
    -- the week.
    --
    -- /Valid days/: Mon, Tue, Wed, Thu, Fri, Sat, Sun
    --
    -- /Constraints/: Minimum 30-minute window.
    UpdateCluster -> Maybe Text
preferredMaintenanceWindow :: Prelude.Maybe Prelude.Text,
    -- | The capacity of each shard in the Elastic DocumentDB cluster.
    UpdateCluster -> Maybe Int
shardCapacity :: Prelude.Maybe Prelude.Int,
    -- | The number of shards to create in the Elastic DocumentDB cluster.
    UpdateCluster -> Maybe Int
shardCount :: Prelude.Maybe Prelude.Int,
    -- | The number of shards to create in the Elastic DocumentDB cluster.
    UpdateCluster -> Maybe [Text]
subnetIds :: Prelude.Maybe [Prelude.Text],
    -- | A list of EC2 VPC security groups to associate with the new Elastic
    -- DocumentDB cluster.
    UpdateCluster -> Maybe [Text]
vpcSecurityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | The arn of the Elastic DocumentDB cluster.
    UpdateCluster -> Text
clusterArn :: Prelude.Text
  }
  deriving (UpdateCluster -> UpdateCluster -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCluster -> UpdateCluster -> Bool
$c/= :: UpdateCluster -> UpdateCluster -> Bool
== :: UpdateCluster -> UpdateCluster -> Bool
$c== :: UpdateCluster -> UpdateCluster -> Bool
Prelude.Eq, Int -> UpdateCluster -> ShowS
[UpdateCluster] -> ShowS
UpdateCluster -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCluster] -> ShowS
$cshowList :: [UpdateCluster] -> ShowS
show :: UpdateCluster -> String
$cshow :: UpdateCluster -> String
showsPrec :: Int -> UpdateCluster -> ShowS
$cshowsPrec :: Int -> UpdateCluster -> ShowS
Prelude.Show, forall x. Rep UpdateCluster x -> UpdateCluster
forall x. UpdateCluster -> Rep UpdateCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateCluster x -> UpdateCluster
$cfrom :: forall x. UpdateCluster -> Rep UpdateCluster x
Prelude.Generic)

-- |
-- Create a value of 'UpdateCluster' 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', 'updateCluster_adminUserPassword' - The password for the Elastic DocumentDB cluster administrator. This
-- password can contain any printable ASCII character except forward slash
-- (\/), double quote (\"), or the \"at\" symbol (\@).
--
-- /Constraints/: Must contain from 8 to 100 characters.
--
-- 'authType', 'updateCluster_authType' - The authentication type for the Elastic DocumentDB cluster.
--
-- 'clientToken', 'updateCluster_clientToken' - The client token for the Elastic DocumentDB cluster.
--
-- 'preferredMaintenanceWindow', 'updateCluster_preferredMaintenanceWindow' - The weekly time range during which system maintenance can occur, in
-- Universal Coordinated Time (UTC).
--
-- /Format/: @ddd:hh24:mi-ddd:hh24:mi@
--
-- /Default/: a 30-minute window selected at random from an 8-hour block of
-- time for each Amazon Web Services Region, occurring on a random day of
-- the week.
--
-- /Valid days/: Mon, Tue, Wed, Thu, Fri, Sat, Sun
--
-- /Constraints/: Minimum 30-minute window.
--
-- 'shardCapacity', 'updateCluster_shardCapacity' - The capacity of each shard in the Elastic DocumentDB cluster.
--
-- 'shardCount', 'updateCluster_shardCount' - The number of shards to create in the Elastic DocumentDB cluster.
--
-- 'subnetIds', 'updateCluster_subnetIds' - The number of shards to create in the Elastic DocumentDB cluster.
--
-- 'vpcSecurityGroupIds', 'updateCluster_vpcSecurityGroupIds' - A list of EC2 VPC security groups to associate with the new Elastic
-- DocumentDB cluster.
--
-- 'clusterArn', 'updateCluster_clusterArn' - The arn of the Elastic DocumentDB cluster.
newUpdateCluster ::
  -- | 'clusterArn'
  Prelude.Text ->
  UpdateCluster
newUpdateCluster :: Text -> UpdateCluster
newUpdateCluster Text
pClusterArn_ =
  UpdateCluster'
    { $sel:adminUserPassword:UpdateCluster' :: Maybe (Sensitive Text)
adminUserPassword = forall a. Maybe a
Prelude.Nothing,
      $sel:authType:UpdateCluster' :: Maybe Auth
authType = forall a. Maybe a
Prelude.Nothing,
      $sel:clientToken:UpdateCluster' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
      $sel:preferredMaintenanceWindow:UpdateCluster' :: Maybe Text
preferredMaintenanceWindow = forall a. Maybe a
Prelude.Nothing,
      $sel:shardCapacity:UpdateCluster' :: Maybe Int
shardCapacity = forall a. Maybe a
Prelude.Nothing,
      $sel:shardCount:UpdateCluster' :: Maybe Int
shardCount = forall a. Maybe a
Prelude.Nothing,
      $sel:subnetIds:UpdateCluster' :: Maybe [Text]
subnetIds = forall a. Maybe a
Prelude.Nothing,
      $sel:vpcSecurityGroupIds:UpdateCluster' :: Maybe [Text]
vpcSecurityGroupIds = forall a. Maybe a
Prelude.Nothing,
      $sel:clusterArn:UpdateCluster' :: Text
clusterArn = Text
pClusterArn_
    }

-- | The password for the Elastic DocumentDB cluster administrator. This
-- password can contain any printable ASCII character except forward slash
-- (\/), double quote (\"), or the \"at\" symbol (\@).
--
-- /Constraints/: Must contain from 8 to 100 characters.
updateCluster_adminUserPassword :: Lens.Lens' UpdateCluster (Prelude.Maybe Prelude.Text)
updateCluster_adminUserPassword :: Lens' UpdateCluster (Maybe Text)
updateCluster_adminUserPassword = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe (Sensitive Text)
adminUserPassword :: Maybe (Sensitive Text)
$sel:adminUserPassword:UpdateCluster' :: UpdateCluster -> Maybe (Sensitive Text)
adminUserPassword} -> Maybe (Sensitive Text)
adminUserPassword) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe (Sensitive Text)
a -> UpdateCluster
s {$sel:adminUserPassword:UpdateCluster' :: Maybe (Sensitive Text)
adminUserPassword = Maybe (Sensitive Text)
a} :: UpdateCluster) 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 authentication type for the Elastic DocumentDB cluster.
updateCluster_authType :: Lens.Lens' UpdateCluster (Prelude.Maybe Auth)
updateCluster_authType :: Lens' UpdateCluster (Maybe Auth)
updateCluster_authType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe Auth
authType :: Maybe Auth
$sel:authType:UpdateCluster' :: UpdateCluster -> Maybe Auth
authType} -> Maybe Auth
authType) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe Auth
a -> UpdateCluster
s {$sel:authType:UpdateCluster' :: Maybe Auth
authType = Maybe Auth
a} :: UpdateCluster)

-- | The client token for the Elastic DocumentDB cluster.
updateCluster_clientToken :: Lens.Lens' UpdateCluster (Prelude.Maybe Prelude.Text)
updateCluster_clientToken :: Lens' UpdateCluster (Maybe Text)
updateCluster_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:UpdateCluster' :: UpdateCluster -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe Text
a -> UpdateCluster
s {$sel:clientToken:UpdateCluster' :: Maybe Text
clientToken = Maybe Text
a} :: UpdateCluster)

-- | The weekly time range during which system maintenance can occur, in
-- Universal Coordinated Time (UTC).
--
-- /Format/: @ddd:hh24:mi-ddd:hh24:mi@
--
-- /Default/: a 30-minute window selected at random from an 8-hour block of
-- time for each Amazon Web Services Region, occurring on a random day of
-- the week.
--
-- /Valid days/: Mon, Tue, Wed, Thu, Fri, Sat, Sun
--
-- /Constraints/: Minimum 30-minute window.
updateCluster_preferredMaintenanceWindow :: Lens.Lens' UpdateCluster (Prelude.Maybe Prelude.Text)
updateCluster_preferredMaintenanceWindow :: Lens' UpdateCluster (Maybe Text)
updateCluster_preferredMaintenanceWindow = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe Text
preferredMaintenanceWindow :: Maybe Text
$sel:preferredMaintenanceWindow:UpdateCluster' :: UpdateCluster -> Maybe Text
preferredMaintenanceWindow} -> Maybe Text
preferredMaintenanceWindow) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe Text
a -> UpdateCluster
s {$sel:preferredMaintenanceWindow:UpdateCluster' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
a} :: UpdateCluster)

-- | The capacity of each shard in the Elastic DocumentDB cluster.
updateCluster_shardCapacity :: Lens.Lens' UpdateCluster (Prelude.Maybe Prelude.Int)
updateCluster_shardCapacity :: Lens' UpdateCluster (Maybe Int)
updateCluster_shardCapacity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe Int
shardCapacity :: Maybe Int
$sel:shardCapacity:UpdateCluster' :: UpdateCluster -> Maybe Int
shardCapacity} -> Maybe Int
shardCapacity) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe Int
a -> UpdateCluster
s {$sel:shardCapacity:UpdateCluster' :: Maybe Int
shardCapacity = Maybe Int
a} :: UpdateCluster)

-- | The number of shards to create in the Elastic DocumentDB cluster.
updateCluster_shardCount :: Lens.Lens' UpdateCluster (Prelude.Maybe Prelude.Int)
updateCluster_shardCount :: Lens' UpdateCluster (Maybe Int)
updateCluster_shardCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe Int
shardCount :: Maybe Int
$sel:shardCount:UpdateCluster' :: UpdateCluster -> Maybe Int
shardCount} -> Maybe Int
shardCount) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe Int
a -> UpdateCluster
s {$sel:shardCount:UpdateCluster' :: Maybe Int
shardCount = Maybe Int
a} :: UpdateCluster)

-- | The number of shards to create in the Elastic DocumentDB cluster.
updateCluster_subnetIds :: Lens.Lens' UpdateCluster (Prelude.Maybe [Prelude.Text])
updateCluster_subnetIds :: Lens' UpdateCluster (Maybe [Text])
updateCluster_subnetIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe [Text]
subnetIds :: Maybe [Text]
$sel:subnetIds:UpdateCluster' :: UpdateCluster -> Maybe [Text]
subnetIds} -> Maybe [Text]
subnetIds) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe [Text]
a -> UpdateCluster
s {$sel:subnetIds:UpdateCluster' :: Maybe [Text]
subnetIds = Maybe [Text]
a} :: UpdateCluster) 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

-- | A list of EC2 VPC security groups to associate with the new Elastic
-- DocumentDB cluster.
updateCluster_vpcSecurityGroupIds :: Lens.Lens' UpdateCluster (Prelude.Maybe [Prelude.Text])
updateCluster_vpcSecurityGroupIds :: Lens' UpdateCluster (Maybe [Text])
updateCluster_vpcSecurityGroupIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe [Text]
vpcSecurityGroupIds :: Maybe [Text]
$sel:vpcSecurityGroupIds:UpdateCluster' :: UpdateCluster -> Maybe [Text]
vpcSecurityGroupIds} -> Maybe [Text]
vpcSecurityGroupIds) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe [Text]
a -> UpdateCluster
s {$sel:vpcSecurityGroupIds:UpdateCluster' :: Maybe [Text]
vpcSecurityGroupIds = Maybe [Text]
a} :: UpdateCluster) 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 arn of the Elastic DocumentDB cluster.
updateCluster_clusterArn :: Lens.Lens' UpdateCluster Prelude.Text
updateCluster_clusterArn :: Lens' UpdateCluster Text
updateCluster_clusterArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Text
clusterArn :: Text
$sel:clusterArn:UpdateCluster' :: UpdateCluster -> Text
clusterArn} -> Text
clusterArn) (\s :: UpdateCluster
s@UpdateCluster' {} Text
a -> UpdateCluster
s {$sel:clusterArn:UpdateCluster' :: Text
clusterArn = Text
a} :: UpdateCluster)

instance Core.AWSRequest UpdateCluster where
  type
    AWSResponse UpdateCluster =
      UpdateClusterResponse
  request :: (Service -> Service) -> UpdateCluster -> Request UpdateCluster
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateCluster)))
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 -> Cluster -> UpdateClusterResponse
UpdateClusterResponse'
            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
"cluster")
      )

instance Prelude.Hashable UpdateCluster where
  hashWithSalt :: Int -> UpdateCluster -> Int
hashWithSalt Int
_salt UpdateCluster' {Maybe Int
Maybe [Text]
Maybe Text
Maybe (Sensitive Text)
Maybe Auth
Text
clusterArn :: Text
vpcSecurityGroupIds :: Maybe [Text]
subnetIds :: Maybe [Text]
shardCount :: Maybe Int
shardCapacity :: Maybe Int
preferredMaintenanceWindow :: Maybe Text
clientToken :: Maybe Text
authType :: Maybe Auth
adminUserPassword :: Maybe (Sensitive Text)
$sel:clusterArn:UpdateCluster' :: UpdateCluster -> Text
$sel:vpcSecurityGroupIds:UpdateCluster' :: UpdateCluster -> Maybe [Text]
$sel:subnetIds:UpdateCluster' :: UpdateCluster -> Maybe [Text]
$sel:shardCount:UpdateCluster' :: UpdateCluster -> Maybe Int
$sel:shardCapacity:UpdateCluster' :: UpdateCluster -> Maybe Int
$sel:preferredMaintenanceWindow:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:clientToken:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:authType:UpdateCluster' :: UpdateCluster -> Maybe Auth
$sel:adminUserPassword:UpdateCluster' :: UpdateCluster -> 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 Auth
authType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
preferredMaintenanceWindow
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
shardCapacity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
shardCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
subnetIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
vpcSecurityGroupIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clusterArn

instance Prelude.NFData UpdateCluster where
  rnf :: UpdateCluster -> ()
rnf UpdateCluster' {Maybe Int
Maybe [Text]
Maybe Text
Maybe (Sensitive Text)
Maybe Auth
Text
clusterArn :: Text
vpcSecurityGroupIds :: Maybe [Text]
subnetIds :: Maybe [Text]
shardCount :: Maybe Int
shardCapacity :: Maybe Int
preferredMaintenanceWindow :: Maybe Text
clientToken :: Maybe Text
authType :: Maybe Auth
adminUserPassword :: Maybe (Sensitive Text)
$sel:clusterArn:UpdateCluster' :: UpdateCluster -> Text
$sel:vpcSecurityGroupIds:UpdateCluster' :: UpdateCluster -> Maybe [Text]
$sel:subnetIds:UpdateCluster' :: UpdateCluster -> Maybe [Text]
$sel:shardCount:UpdateCluster' :: UpdateCluster -> Maybe Int
$sel:shardCapacity:UpdateCluster' :: UpdateCluster -> Maybe Int
$sel:preferredMaintenanceWindow:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:clientToken:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:authType:UpdateCluster' :: UpdateCluster -> Maybe Auth
$sel:adminUserPassword:UpdateCluster' :: UpdateCluster -> 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 Auth
authType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
preferredMaintenanceWindow
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
shardCapacity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
shardCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
subnetIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
vpcSecurityGroupIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clusterArn

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

instance Data.ToJSON UpdateCluster where
  toJSON :: UpdateCluster -> Value
toJSON UpdateCluster' {Maybe Int
Maybe [Text]
Maybe Text
Maybe (Sensitive Text)
Maybe Auth
Text
clusterArn :: Text
vpcSecurityGroupIds :: Maybe [Text]
subnetIds :: Maybe [Text]
shardCount :: Maybe Int
shardCapacity :: Maybe Int
preferredMaintenanceWindow :: Maybe Text
clientToken :: Maybe Text
authType :: Maybe Auth
adminUserPassword :: Maybe (Sensitive Text)
$sel:clusterArn:UpdateCluster' :: UpdateCluster -> Text
$sel:vpcSecurityGroupIds:UpdateCluster' :: UpdateCluster -> Maybe [Text]
$sel:subnetIds:UpdateCluster' :: UpdateCluster -> Maybe [Text]
$sel:shardCount:UpdateCluster' :: UpdateCluster -> Maybe Int
$sel:shardCapacity:UpdateCluster' :: UpdateCluster -> Maybe Int
$sel:preferredMaintenanceWindow:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:clientToken:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:authType:UpdateCluster' :: UpdateCluster -> Maybe Auth
$sel:adminUserPassword:UpdateCluster' :: UpdateCluster -> 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
"authType" 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 Auth
authType,
            (Key
"clientToken" 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
clientToken,
            (Key
"preferredMaintenanceWindow" 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
preferredMaintenanceWindow,
            (Key
"shardCapacity" 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 Int
shardCapacity,
            (Key
"shardCount" 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 Int
shardCount,
            (Key
"subnetIds" 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]
subnetIds,
            (Key
"vpcSecurityGroupIds" 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]
vpcSecurityGroupIds
          ]
      )

instance Data.ToPath UpdateCluster where
  toPath :: UpdateCluster -> ByteString
toPath UpdateCluster' {Maybe Int
Maybe [Text]
Maybe Text
Maybe (Sensitive Text)
Maybe Auth
Text
clusterArn :: Text
vpcSecurityGroupIds :: Maybe [Text]
subnetIds :: Maybe [Text]
shardCount :: Maybe Int
shardCapacity :: Maybe Int
preferredMaintenanceWindow :: Maybe Text
clientToken :: Maybe Text
authType :: Maybe Auth
adminUserPassword :: Maybe (Sensitive Text)
$sel:clusterArn:UpdateCluster' :: UpdateCluster -> Text
$sel:vpcSecurityGroupIds:UpdateCluster' :: UpdateCluster -> Maybe [Text]
$sel:subnetIds:UpdateCluster' :: UpdateCluster -> Maybe [Text]
$sel:shardCount:UpdateCluster' :: UpdateCluster -> Maybe Int
$sel:shardCapacity:UpdateCluster' :: UpdateCluster -> Maybe Int
$sel:preferredMaintenanceWindow:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:clientToken:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:authType:UpdateCluster' :: UpdateCluster -> Maybe Auth
$sel:adminUserPassword:UpdateCluster' :: UpdateCluster -> Maybe (Sensitive Text)
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/cluster/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
clusterArn]

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

-- | /See:/ 'newUpdateClusterResponse' smart constructor.
data UpdateClusterResponse = UpdateClusterResponse'
  { -- | The response's http status code.
    UpdateClusterResponse -> Int
httpStatus :: Prelude.Int,
    -- | Returns information about the updated Elastic DocumentDB cluster.
    UpdateClusterResponse -> Cluster
cluster :: Cluster
  }
  deriving (UpdateClusterResponse -> UpdateClusterResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateClusterResponse -> UpdateClusterResponse -> Bool
$c/= :: UpdateClusterResponse -> UpdateClusterResponse -> Bool
== :: UpdateClusterResponse -> UpdateClusterResponse -> Bool
$c== :: UpdateClusterResponse -> UpdateClusterResponse -> Bool
Prelude.Eq, ReadPrec [UpdateClusterResponse]
ReadPrec UpdateClusterResponse
Int -> ReadS UpdateClusterResponse
ReadS [UpdateClusterResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateClusterResponse]
$creadListPrec :: ReadPrec [UpdateClusterResponse]
readPrec :: ReadPrec UpdateClusterResponse
$creadPrec :: ReadPrec UpdateClusterResponse
readList :: ReadS [UpdateClusterResponse]
$creadList :: ReadS [UpdateClusterResponse]
readsPrec :: Int -> ReadS UpdateClusterResponse
$creadsPrec :: Int -> ReadS UpdateClusterResponse
Prelude.Read, Int -> UpdateClusterResponse -> ShowS
[UpdateClusterResponse] -> ShowS
UpdateClusterResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateClusterResponse] -> ShowS
$cshowList :: [UpdateClusterResponse] -> ShowS
show :: UpdateClusterResponse -> String
$cshow :: UpdateClusterResponse -> String
showsPrec :: Int -> UpdateClusterResponse -> ShowS
$cshowsPrec :: Int -> UpdateClusterResponse -> ShowS
Prelude.Show, forall x. Rep UpdateClusterResponse x -> UpdateClusterResponse
forall x. UpdateClusterResponse -> Rep UpdateClusterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateClusterResponse x -> UpdateClusterResponse
$cfrom :: forall x. UpdateClusterResponse -> Rep UpdateClusterResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateClusterResponse' 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', 'updateClusterResponse_httpStatus' - The response's http status code.
--
-- 'cluster', 'updateClusterResponse_cluster' - Returns information about the updated Elastic DocumentDB cluster.
newUpdateClusterResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'cluster'
  Cluster ->
  UpdateClusterResponse
newUpdateClusterResponse :: Int -> Cluster -> UpdateClusterResponse
newUpdateClusterResponse Int
pHttpStatus_ Cluster
pCluster_ =
  UpdateClusterResponse'
    { $sel:httpStatus:UpdateClusterResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:cluster:UpdateClusterResponse' :: Cluster
cluster = Cluster
pCluster_
    }

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

-- | Returns information about the updated Elastic DocumentDB cluster.
updateClusterResponse_cluster :: Lens.Lens' UpdateClusterResponse Cluster
updateClusterResponse_cluster :: Lens' UpdateClusterResponse Cluster
updateClusterResponse_cluster = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateClusterResponse' {Cluster
cluster :: Cluster
$sel:cluster:UpdateClusterResponse' :: UpdateClusterResponse -> Cluster
cluster} -> Cluster
cluster) (\s :: UpdateClusterResponse
s@UpdateClusterResponse' {} Cluster
a -> UpdateClusterResponse
s {$sel:cluster:UpdateClusterResponse' :: Cluster
cluster = Cluster
a} :: UpdateClusterResponse)

instance Prelude.NFData UpdateClusterResponse where
  rnf :: UpdateClusterResponse -> ()
rnf UpdateClusterResponse' {Int
Cluster
cluster :: Cluster
httpStatus :: Int
$sel:cluster:UpdateClusterResponse' :: UpdateClusterResponse -> Cluster
$sel:httpStatus:UpdateClusterResponse' :: UpdateClusterResponse -> 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 Cluster
cluster