{-# 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.DAX.UpdateCluster
-- 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)
--
-- Modifies the settings for a DAX cluster. You can use this action to
-- change one or more cluster configuration parameters by specifying the
-- parameters and the new values.
module Amazonka.DAX.UpdateCluster
  ( -- * Creating a Request
    UpdateCluster (..),
    newUpdateCluster,

    -- * Request Lenses
    updateCluster_securityGroupIds,
    updateCluster_preferredMaintenanceWindow,
    updateCluster_notificationTopicStatus,
    updateCluster_description,
    updateCluster_notificationTopicArn,
    updateCluster_parameterGroupName,
    updateCluster_clusterName,

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

    -- * Response Lenses
    updateClusterResponse_cluster,
    updateClusterResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DAX.Types
import qualified Amazonka.Lens as Lens
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'
  { -- | A list of user-specified security group IDs to be assigned to each node
    -- in the DAX cluster. If this parameter is not specified, DAX assigns the
    -- default VPC security group to each node.
    UpdateCluster -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | A range of time when maintenance of DAX cluster software will be
    -- performed. For example: @sun:01:00-sun:09:00@. Cluster maintenance
    -- normally takes less than 30 minutes, and is performed automatically
    -- within the maintenance window.
    UpdateCluster -> Maybe Text
preferredMaintenanceWindow :: Prelude.Maybe Prelude.Text,
    -- | The current state of the topic. A value of “active” means that
    -- notifications will be sent to the topic. A value of “inactive” means
    -- that notifications will not be sent to the topic.
    UpdateCluster -> Maybe Text
notificationTopicStatus :: Prelude.Maybe Prelude.Text,
    -- | A description of the changes being made to the cluster.
    UpdateCluster -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) that identifies the topic.
    UpdateCluster -> Maybe Text
notificationTopicArn :: Prelude.Maybe Prelude.Text,
    -- | The name of a parameter group for this cluster.
    UpdateCluster -> Maybe Text
parameterGroupName :: Prelude.Maybe Prelude.Text,
    -- | The name of the DAX cluster to be modified.
    UpdateCluster -> Text
clusterName :: Prelude.Text
  }
  deriving (UpdateCluster -> UpdateCluster -> Bool
(UpdateCluster -> UpdateCluster -> Bool)
-> (UpdateCluster -> UpdateCluster -> Bool) -> Eq UpdateCluster
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, ReadPrec [UpdateCluster]
ReadPrec UpdateCluster
Int -> ReadS UpdateCluster
ReadS [UpdateCluster]
(Int -> ReadS UpdateCluster)
-> ReadS [UpdateCluster]
-> ReadPrec UpdateCluster
-> ReadPrec [UpdateCluster]
-> Read UpdateCluster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCluster]
$creadListPrec :: ReadPrec [UpdateCluster]
readPrec :: ReadPrec UpdateCluster
$creadPrec :: ReadPrec UpdateCluster
readList :: ReadS [UpdateCluster]
$creadList :: ReadS [UpdateCluster]
readsPrec :: Int -> ReadS UpdateCluster
$creadsPrec :: Int -> ReadS UpdateCluster
Prelude.Read, Int -> UpdateCluster -> ShowS
[UpdateCluster] -> ShowS
UpdateCluster -> String
(Int -> UpdateCluster -> ShowS)
-> (UpdateCluster -> String)
-> ([UpdateCluster] -> ShowS)
-> Show UpdateCluster
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. UpdateCluster -> Rep UpdateCluster x)
-> (forall x. Rep UpdateCluster x -> UpdateCluster)
-> Generic UpdateCluster
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:
--
-- 'securityGroupIds', 'updateCluster_securityGroupIds' - A list of user-specified security group IDs to be assigned to each node
-- in the DAX cluster. If this parameter is not specified, DAX assigns the
-- default VPC security group to each node.
--
-- 'preferredMaintenanceWindow', 'updateCluster_preferredMaintenanceWindow' - A range of time when maintenance of DAX cluster software will be
-- performed. For example: @sun:01:00-sun:09:00@. Cluster maintenance
-- normally takes less than 30 minutes, and is performed automatically
-- within the maintenance window.
--
-- 'notificationTopicStatus', 'updateCluster_notificationTopicStatus' - The current state of the topic. A value of “active” means that
-- notifications will be sent to the topic. A value of “inactive” means
-- that notifications will not be sent to the topic.
--
-- 'description', 'updateCluster_description' - A description of the changes being made to the cluster.
--
-- 'notificationTopicArn', 'updateCluster_notificationTopicArn' - The Amazon Resource Name (ARN) that identifies the topic.
--
-- 'parameterGroupName', 'updateCluster_parameterGroupName' - The name of a parameter group for this cluster.
--
-- 'clusterName', 'updateCluster_clusterName' - The name of the DAX cluster to be modified.
newUpdateCluster ::
  -- | 'clusterName'
  Prelude.Text ->
  UpdateCluster
newUpdateCluster :: Text -> UpdateCluster
newUpdateCluster Text
pClusterName_ =
  UpdateCluster' :: Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> UpdateCluster
UpdateCluster'
    { $sel:securityGroupIds:UpdateCluster' :: Maybe [Text]
securityGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:preferredMaintenanceWindow:UpdateCluster' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:notificationTopicStatus:UpdateCluster' :: Maybe Text
notificationTopicStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateCluster' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:notificationTopicArn:UpdateCluster' :: Maybe Text
notificationTopicArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterGroupName:UpdateCluster' :: Maybe Text
parameterGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterName:UpdateCluster' :: Text
clusterName = Text
pClusterName_
    }

-- | A list of user-specified security group IDs to be assigned to each node
-- in the DAX cluster. If this parameter is not specified, DAX assigns the
-- default VPC security group to each node.
updateCluster_securityGroupIds :: Lens.Lens' UpdateCluster (Prelude.Maybe [Prelude.Text])
updateCluster_securityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateCluster -> f UpdateCluster
updateCluster_securityGroupIds = (UpdateCluster -> Maybe [Text])
-> (UpdateCluster -> Maybe [Text] -> UpdateCluster)
-> Lens UpdateCluster UpdateCluster (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:securityGroupIds:UpdateCluster' :: UpdateCluster -> Maybe [Text]
securityGroupIds} -> Maybe [Text]
securityGroupIds) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe [Text]
a -> UpdateCluster
s {$sel:securityGroupIds:UpdateCluster' :: Maybe [Text]
securityGroupIds = Maybe [Text]
a} :: UpdateCluster) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateCluster -> f UpdateCluster)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateCluster
-> f UpdateCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A range of time when maintenance of DAX cluster software will be
-- performed. For example: @sun:01:00-sun:09:00@. Cluster maintenance
-- normally takes less than 30 minutes, and is performed automatically
-- within the maintenance window.
updateCluster_preferredMaintenanceWindow :: Lens.Lens' UpdateCluster (Prelude.Maybe Prelude.Text)
updateCluster_preferredMaintenanceWindow :: (Maybe Text -> f (Maybe Text)) -> UpdateCluster -> f UpdateCluster
updateCluster_preferredMaintenanceWindow = (UpdateCluster -> Maybe Text)
-> (UpdateCluster -> Maybe Text -> UpdateCluster)
-> Lens UpdateCluster UpdateCluster (Maybe Text) (Maybe Text)
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 current state of the topic. A value of “active” means that
-- notifications will be sent to the topic. A value of “inactive” means
-- that notifications will not be sent to the topic.
updateCluster_notificationTopicStatus :: Lens.Lens' UpdateCluster (Prelude.Maybe Prelude.Text)
updateCluster_notificationTopicStatus :: (Maybe Text -> f (Maybe Text)) -> UpdateCluster -> f UpdateCluster
updateCluster_notificationTopicStatus = (UpdateCluster -> Maybe Text)
-> (UpdateCluster -> Maybe Text -> UpdateCluster)
-> Lens UpdateCluster UpdateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe Text
notificationTopicStatus :: Maybe Text
$sel:notificationTopicStatus:UpdateCluster' :: UpdateCluster -> Maybe Text
notificationTopicStatus} -> Maybe Text
notificationTopicStatus) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe Text
a -> UpdateCluster
s {$sel:notificationTopicStatus:UpdateCluster' :: Maybe Text
notificationTopicStatus = Maybe Text
a} :: UpdateCluster)

-- | A description of the changes being made to the cluster.
updateCluster_description :: Lens.Lens' UpdateCluster (Prelude.Maybe Prelude.Text)
updateCluster_description :: (Maybe Text -> f (Maybe Text)) -> UpdateCluster -> f UpdateCluster
updateCluster_description = (UpdateCluster -> Maybe Text)
-> (UpdateCluster -> Maybe Text -> UpdateCluster)
-> Lens UpdateCluster UpdateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe Text
description :: Maybe Text
$sel:description:UpdateCluster' :: UpdateCluster -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe Text
a -> UpdateCluster
s {$sel:description:UpdateCluster' :: Maybe Text
description = Maybe Text
a} :: UpdateCluster)

-- | The Amazon Resource Name (ARN) that identifies the topic.
updateCluster_notificationTopicArn :: Lens.Lens' UpdateCluster (Prelude.Maybe Prelude.Text)
updateCluster_notificationTopicArn :: (Maybe Text -> f (Maybe Text)) -> UpdateCluster -> f UpdateCluster
updateCluster_notificationTopicArn = (UpdateCluster -> Maybe Text)
-> (UpdateCluster -> Maybe Text -> UpdateCluster)
-> Lens UpdateCluster UpdateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe Text
notificationTopicArn :: Maybe Text
$sel:notificationTopicArn:UpdateCluster' :: UpdateCluster -> Maybe Text
notificationTopicArn} -> Maybe Text
notificationTopicArn) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe Text
a -> UpdateCluster
s {$sel:notificationTopicArn:UpdateCluster' :: Maybe Text
notificationTopicArn = Maybe Text
a} :: UpdateCluster)

-- | The name of a parameter group for this cluster.
updateCluster_parameterGroupName :: Lens.Lens' UpdateCluster (Prelude.Maybe Prelude.Text)
updateCluster_parameterGroupName :: (Maybe Text -> f (Maybe Text)) -> UpdateCluster -> f UpdateCluster
updateCluster_parameterGroupName = (UpdateCluster -> Maybe Text)
-> (UpdateCluster -> Maybe Text -> UpdateCluster)
-> Lens UpdateCluster UpdateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe Text
parameterGroupName :: Maybe Text
$sel:parameterGroupName:UpdateCluster' :: UpdateCluster -> Maybe Text
parameterGroupName} -> Maybe Text
parameterGroupName) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe Text
a -> UpdateCluster
s {$sel:parameterGroupName:UpdateCluster' :: Maybe Text
parameterGroupName = Maybe Text
a} :: UpdateCluster)

-- | The name of the DAX cluster to be modified.
updateCluster_clusterName :: Lens.Lens' UpdateCluster Prelude.Text
updateCluster_clusterName :: (Text -> f Text) -> UpdateCluster -> f UpdateCluster
updateCluster_clusterName = (UpdateCluster -> Text)
-> (UpdateCluster -> Text -> UpdateCluster)
-> Lens UpdateCluster UpdateCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Text
clusterName :: Text
$sel:clusterName:UpdateCluster' :: UpdateCluster -> Text
clusterName} -> Text
clusterName) (\s :: UpdateCluster
s@UpdateCluster' {} Text
a -> UpdateCluster
s {$sel:clusterName:UpdateCluster' :: Text
clusterName = Text
a} :: UpdateCluster)

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

instance Prelude.Hashable UpdateCluster

instance Prelude.NFData UpdateCluster

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

instance Core.ToJSON UpdateCluster where
  toJSON :: UpdateCluster -> Value
toJSON UpdateCluster' {Maybe [Text]
Maybe Text
Text
clusterName :: Text
parameterGroupName :: Maybe Text
notificationTopicArn :: Maybe Text
description :: Maybe Text
notificationTopicStatus :: Maybe Text
preferredMaintenanceWindow :: Maybe Text
securityGroupIds :: Maybe [Text]
$sel:clusterName:UpdateCluster' :: UpdateCluster -> Text
$sel:parameterGroupName:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:notificationTopicArn:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:description:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:notificationTopicStatus:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:preferredMaintenanceWindow:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:securityGroupIds:UpdateCluster' :: UpdateCluster -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SecurityGroupIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
securityGroupIds,
            (Text
"PreferredMaintenanceWindow" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
preferredMaintenanceWindow,
            (Text
"NotificationTopicStatus" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
notificationTopicStatus,
            (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"NotificationTopicArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
notificationTopicArn,
            (Text
"ParameterGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
parameterGroupName,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClusterName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clusterName)
          ]
      )

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

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

-- | /See:/ 'newUpdateClusterResponse' smart constructor.
data UpdateClusterResponse = UpdateClusterResponse'
  { -- | A description of the DAX cluster, after it has been modified.
    UpdateClusterResponse -> Maybe Cluster
cluster :: Prelude.Maybe Cluster,
    -- | The response's http status code.
    UpdateClusterResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateClusterResponse -> UpdateClusterResponse -> Bool
(UpdateClusterResponse -> UpdateClusterResponse -> Bool)
-> (UpdateClusterResponse -> UpdateClusterResponse -> Bool)
-> Eq UpdateClusterResponse
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]
(Int -> ReadS UpdateClusterResponse)
-> ReadS [UpdateClusterResponse]
-> ReadPrec UpdateClusterResponse
-> ReadPrec [UpdateClusterResponse]
-> Read 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
(Int -> UpdateClusterResponse -> ShowS)
-> (UpdateClusterResponse -> String)
-> ([UpdateClusterResponse] -> ShowS)
-> Show UpdateClusterResponse
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. UpdateClusterResponse -> Rep UpdateClusterResponse x)
-> (forall x. Rep UpdateClusterResponse x -> UpdateClusterResponse)
-> Generic UpdateClusterResponse
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:
--
-- 'cluster', 'updateClusterResponse_cluster' - A description of the DAX cluster, after it has been modified.
--
-- 'httpStatus', 'updateClusterResponse_httpStatus' - The response's http status code.
newUpdateClusterResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateClusterResponse
newUpdateClusterResponse :: Int -> UpdateClusterResponse
newUpdateClusterResponse Int
pHttpStatus_ =
  UpdateClusterResponse' :: Maybe Cluster -> Int -> UpdateClusterResponse
UpdateClusterResponse'
    { $sel:cluster:UpdateClusterResponse' :: Maybe Cluster
cluster = Maybe Cluster
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateClusterResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A description of the DAX cluster, after it has been modified.
updateClusterResponse_cluster :: Lens.Lens' UpdateClusterResponse (Prelude.Maybe Cluster)
updateClusterResponse_cluster :: (Maybe Cluster -> f (Maybe Cluster))
-> UpdateClusterResponse -> f UpdateClusterResponse
updateClusterResponse_cluster = (UpdateClusterResponse -> Maybe Cluster)
-> (UpdateClusterResponse
    -> Maybe Cluster -> UpdateClusterResponse)
-> Lens
     UpdateClusterResponse
     UpdateClusterResponse
     (Maybe Cluster)
     (Maybe Cluster)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateClusterResponse' {Maybe Cluster
cluster :: Maybe Cluster
$sel:cluster:UpdateClusterResponse' :: UpdateClusterResponse -> Maybe Cluster
cluster} -> Maybe Cluster
cluster) (\s :: UpdateClusterResponse
s@UpdateClusterResponse' {} Maybe Cluster
a -> UpdateClusterResponse
s {$sel:cluster:UpdateClusterResponse' :: Maybe Cluster
cluster = Maybe Cluster
a} :: UpdateClusterResponse)

-- | The response's http status code.
updateClusterResponse_httpStatus :: Lens.Lens' UpdateClusterResponse Prelude.Int
updateClusterResponse_httpStatus :: (Int -> f Int) -> UpdateClusterResponse -> f UpdateClusterResponse
updateClusterResponse_httpStatus = (UpdateClusterResponse -> Int)
-> (UpdateClusterResponse -> Int -> UpdateClusterResponse)
-> Lens UpdateClusterResponse UpdateClusterResponse Int Int
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)

instance Prelude.NFData UpdateClusterResponse