{-# 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 #-}
module Amazonka.DAX.CreateCluster
(
CreateCluster (..),
newCreateCluster,
createCluster_securityGroupIds,
createCluster_sSESpecification,
createCluster_subnetGroupName,
createCluster_clusterEndpointEncryptionType,
createCluster_preferredMaintenanceWindow,
createCluster_availabilityZones,
createCluster_description,
createCluster_notificationTopicArn,
createCluster_tags,
createCluster_parameterGroupName,
createCluster_clusterName,
createCluster_nodeType,
createCluster_replicationFactor,
createCluster_iamRoleArn,
CreateClusterResponse (..),
newCreateClusterResponse,
createClusterResponse_cluster,
createClusterResponse_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
data CreateCluster = CreateCluster'
{
CreateCluster -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
CreateCluster -> Maybe SSESpecification
sSESpecification :: Prelude.Maybe SSESpecification,
CreateCluster -> Maybe Text
subnetGroupName :: Prelude.Maybe Prelude.Text,
CreateCluster -> Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType :: Prelude.Maybe ClusterEndpointEncryptionType,
CreateCluster -> Maybe Text
preferredMaintenanceWindow :: Prelude.Maybe Prelude.Text,
CreateCluster -> Maybe [Text]
availabilityZones :: Prelude.Maybe [Prelude.Text],
CreateCluster -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
CreateCluster -> Maybe Text
notificationTopicArn :: Prelude.Maybe Prelude.Text,
CreateCluster -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateCluster -> Maybe Text
parameterGroupName :: Prelude.Maybe Prelude.Text,
CreateCluster -> Text
clusterName :: Prelude.Text,
CreateCluster -> Text
nodeType :: Prelude.Text,
CreateCluster -> Int
replicationFactor :: Prelude.Int,
CreateCluster -> Text
iamRoleArn :: Prelude.Text
}
deriving (CreateCluster -> CreateCluster -> Bool
(CreateCluster -> CreateCluster -> Bool)
-> (CreateCluster -> CreateCluster -> Bool) -> Eq CreateCluster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCluster -> CreateCluster -> Bool
$c/= :: CreateCluster -> CreateCluster -> Bool
== :: CreateCluster -> CreateCluster -> Bool
$c== :: CreateCluster -> CreateCluster -> Bool
Prelude.Eq, ReadPrec [CreateCluster]
ReadPrec CreateCluster
Int -> ReadS CreateCluster
ReadS [CreateCluster]
(Int -> ReadS CreateCluster)
-> ReadS [CreateCluster]
-> ReadPrec CreateCluster
-> ReadPrec [CreateCluster]
-> Read CreateCluster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCluster]
$creadListPrec :: ReadPrec [CreateCluster]
readPrec :: ReadPrec CreateCluster
$creadPrec :: ReadPrec CreateCluster
readList :: ReadS [CreateCluster]
$creadList :: ReadS [CreateCluster]
readsPrec :: Int -> ReadS CreateCluster
$creadsPrec :: Int -> ReadS CreateCluster
Prelude.Read, Int -> CreateCluster -> ShowS
[CreateCluster] -> ShowS
CreateCluster -> String
(Int -> CreateCluster -> ShowS)
-> (CreateCluster -> String)
-> ([CreateCluster] -> ShowS)
-> Show CreateCluster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCluster] -> ShowS
$cshowList :: [CreateCluster] -> ShowS
show :: CreateCluster -> String
$cshow :: CreateCluster -> String
showsPrec :: Int -> CreateCluster -> ShowS
$cshowsPrec :: Int -> CreateCluster -> ShowS
Prelude.Show, (forall x. CreateCluster -> Rep CreateCluster x)
-> (forall x. Rep CreateCluster x -> CreateCluster)
-> Generic CreateCluster
forall x. Rep CreateCluster x -> CreateCluster
forall x. CreateCluster -> Rep CreateCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateCluster x -> CreateCluster
$cfrom :: forall x. CreateCluster -> Rep CreateCluster x
Prelude.Generic)
newCreateCluster ::
Prelude.Text ->
Prelude.Text ->
Prelude.Int ->
Prelude.Text ->
CreateCluster
newCreateCluster :: Text -> Text -> Int -> Text -> CreateCluster
newCreateCluster
Text
pClusterName_
Text
pNodeType_
Int
pReplicationFactor_
Text
pIamRoleArn_ =
CreateCluster' :: Maybe [Text]
-> Maybe SSESpecification
-> Maybe Text
-> Maybe ClusterEndpointEncryptionType
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Maybe Text
-> Text
-> Text
-> Int
-> Text
-> CreateCluster
CreateCluster'
{ $sel:securityGroupIds:CreateCluster' :: Maybe [Text]
securityGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:sSESpecification:CreateCluster' :: Maybe SSESpecification
sSESpecification = Maybe SSESpecification
forall a. Maybe a
Prelude.Nothing,
$sel:subnetGroupName:CreateCluster' :: Maybe Text
subnetGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:clusterEndpointEncryptionType:CreateCluster' :: Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType = Maybe ClusterEndpointEncryptionType
forall a. Maybe a
Prelude.Nothing,
$sel:preferredMaintenanceWindow:CreateCluster' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:availabilityZones:CreateCluster' :: Maybe [Text]
availabilityZones = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:description:CreateCluster' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:notificationTopicArn:CreateCluster' :: Maybe Text
notificationTopicArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateCluster' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:parameterGroupName:CreateCluster' :: Maybe Text
parameterGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:clusterName:CreateCluster' :: Text
clusterName = Text
pClusterName_,
$sel:nodeType:CreateCluster' :: Text
nodeType = Text
pNodeType_,
$sel:replicationFactor:CreateCluster' :: Int
replicationFactor = Int
pReplicationFactor_,
$sel:iamRoleArn:CreateCluster' :: Text
iamRoleArn = Text
pIamRoleArn_
}
createCluster_securityGroupIds :: Lens.Lens' CreateCluster (Prelude.Maybe [Prelude.Text])
createCluster_securityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateCluster -> f CreateCluster
createCluster_securityGroupIds = (CreateCluster -> Maybe [Text])
-> (CreateCluster -> Maybe [Text] -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:securityGroupIds:CreateCluster' :: CreateCluster -> Maybe [Text]
securityGroupIds} -> Maybe [Text]
securityGroupIds) (\s :: CreateCluster
s@CreateCluster' {} Maybe [Text]
a -> CreateCluster
s {$sel:securityGroupIds:CreateCluster' :: Maybe [Text]
securityGroupIds = Maybe [Text]
a} :: CreateCluster) ((Maybe [Text] -> f (Maybe [Text]))
-> CreateCluster -> f CreateCluster)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateCluster
-> f CreateCluster
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
createCluster_sSESpecification :: Lens.Lens' CreateCluster (Prelude.Maybe SSESpecification)
createCluster_sSESpecification :: (Maybe SSESpecification -> f (Maybe SSESpecification))
-> CreateCluster -> f CreateCluster
createCluster_sSESpecification = (CreateCluster -> Maybe SSESpecification)
-> (CreateCluster -> Maybe SSESpecification -> CreateCluster)
-> Lens
CreateCluster
CreateCluster
(Maybe SSESpecification)
(Maybe SSESpecification)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe SSESpecification
sSESpecification :: Maybe SSESpecification
$sel:sSESpecification:CreateCluster' :: CreateCluster -> Maybe SSESpecification
sSESpecification} -> Maybe SSESpecification
sSESpecification) (\s :: CreateCluster
s@CreateCluster' {} Maybe SSESpecification
a -> CreateCluster
s {$sel:sSESpecification:CreateCluster' :: Maybe SSESpecification
sSESpecification = Maybe SSESpecification
a} :: CreateCluster)
createCluster_subnetGroupName :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_subnetGroupName :: (Maybe Text -> f (Maybe Text)) -> CreateCluster -> f CreateCluster
createCluster_subnetGroupName = (CreateCluster -> Maybe Text)
-> (CreateCluster -> Maybe Text -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
subnetGroupName :: Maybe Text
$sel:subnetGroupName:CreateCluster' :: CreateCluster -> Maybe Text
subnetGroupName} -> Maybe Text
subnetGroupName) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:subnetGroupName:CreateCluster' :: Maybe Text
subnetGroupName = Maybe Text
a} :: CreateCluster)
createCluster_clusterEndpointEncryptionType :: Lens.Lens' CreateCluster (Prelude.Maybe ClusterEndpointEncryptionType)
createCluster_clusterEndpointEncryptionType :: (Maybe ClusterEndpointEncryptionType
-> f (Maybe ClusterEndpointEncryptionType))
-> CreateCluster -> f CreateCluster
createCluster_clusterEndpointEncryptionType = (CreateCluster -> Maybe ClusterEndpointEncryptionType)
-> (CreateCluster
-> Maybe ClusterEndpointEncryptionType -> CreateCluster)
-> Lens
CreateCluster
CreateCluster
(Maybe ClusterEndpointEncryptionType)
(Maybe ClusterEndpointEncryptionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType :: Maybe ClusterEndpointEncryptionType
$sel:clusterEndpointEncryptionType:CreateCluster' :: CreateCluster -> Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType} -> Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType) (\s :: CreateCluster
s@CreateCluster' {} Maybe ClusterEndpointEncryptionType
a -> CreateCluster
s {$sel:clusterEndpointEncryptionType:CreateCluster' :: Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType = Maybe ClusterEndpointEncryptionType
a} :: CreateCluster)
createCluster_preferredMaintenanceWindow :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_preferredMaintenanceWindow :: (Maybe Text -> f (Maybe Text)) -> CreateCluster -> f CreateCluster
createCluster_preferredMaintenanceWindow = (CreateCluster -> Maybe Text)
-> (CreateCluster -> Maybe Text -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
preferredMaintenanceWindow :: Maybe Text
$sel:preferredMaintenanceWindow:CreateCluster' :: CreateCluster -> Maybe Text
preferredMaintenanceWindow} -> Maybe Text
preferredMaintenanceWindow) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:preferredMaintenanceWindow:CreateCluster' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
a} :: CreateCluster)
createCluster_availabilityZones :: Lens.Lens' CreateCluster (Prelude.Maybe [Prelude.Text])
createCluster_availabilityZones :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateCluster -> f CreateCluster
createCluster_availabilityZones = (CreateCluster -> Maybe [Text])
-> (CreateCluster -> Maybe [Text] -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe [Text]
availabilityZones :: Maybe [Text]
$sel:availabilityZones:CreateCluster' :: CreateCluster -> Maybe [Text]
availabilityZones} -> Maybe [Text]
availabilityZones) (\s :: CreateCluster
s@CreateCluster' {} Maybe [Text]
a -> CreateCluster
s {$sel:availabilityZones:CreateCluster' :: Maybe [Text]
availabilityZones = Maybe [Text]
a} :: CreateCluster) ((Maybe [Text] -> f (Maybe [Text]))
-> CreateCluster -> f CreateCluster)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateCluster
-> f CreateCluster
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
createCluster_description :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_description :: (Maybe Text -> f (Maybe Text)) -> CreateCluster -> f CreateCluster
createCluster_description = (CreateCluster -> Maybe Text)
-> (CreateCluster -> Maybe Text -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
description :: Maybe Text
$sel:description:CreateCluster' :: CreateCluster -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:description:CreateCluster' :: Maybe Text
description = Maybe Text
a} :: CreateCluster)
createCluster_notificationTopicArn :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_notificationTopicArn :: (Maybe Text -> f (Maybe Text)) -> CreateCluster -> f CreateCluster
createCluster_notificationTopicArn = (CreateCluster -> Maybe Text)
-> (CreateCluster -> Maybe Text -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
notificationTopicArn :: Maybe Text
$sel:notificationTopicArn:CreateCluster' :: CreateCluster -> Maybe Text
notificationTopicArn} -> Maybe Text
notificationTopicArn) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:notificationTopicArn:CreateCluster' :: Maybe Text
notificationTopicArn = Maybe Text
a} :: CreateCluster)
createCluster_tags :: Lens.Lens' CreateCluster (Prelude.Maybe [Tag])
createCluster_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateCluster -> f CreateCluster
createCluster_tags = (CreateCluster -> Maybe [Tag])
-> (CreateCluster -> Maybe [Tag] -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateCluster' :: CreateCluster -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateCluster
s@CreateCluster' {} Maybe [Tag]
a -> CreateCluster
s {$sel:tags:CreateCluster' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateCluster) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateCluster -> f CreateCluster)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateCluster
-> f CreateCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createCluster_parameterGroupName :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_parameterGroupName :: (Maybe Text -> f (Maybe Text)) -> CreateCluster -> f CreateCluster
createCluster_parameterGroupName = (CreateCluster -> Maybe Text)
-> (CreateCluster -> Maybe Text -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
parameterGroupName :: Maybe Text
$sel:parameterGroupName:CreateCluster' :: CreateCluster -> Maybe Text
parameterGroupName} -> Maybe Text
parameterGroupName) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:parameterGroupName:CreateCluster' :: Maybe Text
parameterGroupName = Maybe Text
a} :: CreateCluster)
createCluster_clusterName :: Lens.Lens' CreateCluster Prelude.Text
createCluster_clusterName :: (Text -> f Text) -> CreateCluster -> f CreateCluster
createCluster_clusterName = (CreateCluster -> Text)
-> (CreateCluster -> Text -> CreateCluster)
-> Lens CreateCluster CreateCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Text
clusterName :: Text
$sel:clusterName:CreateCluster' :: CreateCluster -> Text
clusterName} -> Text
clusterName) (\s :: CreateCluster
s@CreateCluster' {} Text
a -> CreateCluster
s {$sel:clusterName:CreateCluster' :: Text
clusterName = Text
a} :: CreateCluster)
createCluster_nodeType :: Lens.Lens' CreateCluster Prelude.Text
createCluster_nodeType :: (Text -> f Text) -> CreateCluster -> f CreateCluster
createCluster_nodeType = (CreateCluster -> Text)
-> (CreateCluster -> Text -> CreateCluster)
-> Lens CreateCluster CreateCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Text
nodeType :: Text
$sel:nodeType:CreateCluster' :: CreateCluster -> Text
nodeType} -> Text
nodeType) (\s :: CreateCluster
s@CreateCluster' {} Text
a -> CreateCluster
s {$sel:nodeType:CreateCluster' :: Text
nodeType = Text
a} :: CreateCluster)
createCluster_replicationFactor :: Lens.Lens' CreateCluster Prelude.Int
createCluster_replicationFactor :: (Int -> f Int) -> CreateCluster -> f CreateCluster
createCluster_replicationFactor = (CreateCluster -> Int)
-> (CreateCluster -> Int -> CreateCluster)
-> Lens CreateCluster CreateCluster Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Int
replicationFactor :: Int
$sel:replicationFactor:CreateCluster' :: CreateCluster -> Int
replicationFactor} -> Int
replicationFactor) (\s :: CreateCluster
s@CreateCluster' {} Int
a -> CreateCluster
s {$sel:replicationFactor:CreateCluster' :: Int
replicationFactor = Int
a} :: CreateCluster)
createCluster_iamRoleArn :: Lens.Lens' CreateCluster Prelude.Text
createCluster_iamRoleArn :: (Text -> f Text) -> CreateCluster -> f CreateCluster
createCluster_iamRoleArn = (CreateCluster -> Text)
-> (CreateCluster -> Text -> CreateCluster)
-> Lens CreateCluster CreateCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Text
iamRoleArn :: Text
$sel:iamRoleArn:CreateCluster' :: CreateCluster -> Text
iamRoleArn} -> Text
iamRoleArn) (\s :: CreateCluster
s@CreateCluster' {} Text
a -> CreateCluster
s {$sel:iamRoleArn:CreateCluster' :: Text
iamRoleArn = Text
a} :: CreateCluster)
instance Core.AWSRequest CreateCluster where
type
AWSResponse CreateCluster =
CreateClusterResponse
request :: CreateCluster -> Request CreateCluster
request = Service -> CreateCluster -> Request CreateCluster
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateCluster)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateCluster))
-> Logger
-> Service
-> Proxy CreateCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateCluster)))
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 -> CreateClusterResponse
CreateClusterResponse'
(Maybe Cluster -> Int -> CreateClusterResponse)
-> Either String (Maybe Cluster)
-> Either String (Int -> CreateClusterResponse)
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 -> CreateClusterResponse)
-> Either String Int -> Either String CreateClusterResponse
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 CreateCluster
instance Prelude.NFData CreateCluster
instance Core.ToHeaders CreateCluster where
toHeaders :: CreateCluster -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateCluster -> 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.CreateCluster" :: 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 CreateCluster where
toJSON :: CreateCluster -> Value
toJSON CreateCluster' {Int
Maybe [Text]
Maybe [Tag]
Maybe Text
Maybe ClusterEndpointEncryptionType
Maybe SSESpecification
Text
iamRoleArn :: Text
replicationFactor :: Int
nodeType :: Text
clusterName :: Text
parameterGroupName :: Maybe Text
tags :: Maybe [Tag]
notificationTopicArn :: Maybe Text
description :: Maybe Text
availabilityZones :: Maybe [Text]
preferredMaintenanceWindow :: Maybe Text
clusterEndpointEncryptionType :: Maybe ClusterEndpointEncryptionType
subnetGroupName :: Maybe Text
sSESpecification :: Maybe SSESpecification
securityGroupIds :: Maybe [Text]
$sel:iamRoleArn:CreateCluster' :: CreateCluster -> Text
$sel:replicationFactor:CreateCluster' :: CreateCluster -> Int
$sel:nodeType:CreateCluster' :: CreateCluster -> Text
$sel:clusterName:CreateCluster' :: CreateCluster -> Text
$sel:parameterGroupName:CreateCluster' :: CreateCluster -> Maybe Text
$sel:tags:CreateCluster' :: CreateCluster -> Maybe [Tag]
$sel:notificationTopicArn:CreateCluster' :: CreateCluster -> Maybe Text
$sel:description:CreateCluster' :: CreateCluster -> Maybe Text
$sel:availabilityZones:CreateCluster' :: CreateCluster -> Maybe [Text]
$sel:preferredMaintenanceWindow:CreateCluster' :: CreateCluster -> Maybe Text
$sel:clusterEndpointEncryptionType:CreateCluster' :: CreateCluster -> Maybe ClusterEndpointEncryptionType
$sel:subnetGroupName:CreateCluster' :: CreateCluster -> Maybe Text
$sel:sSESpecification:CreateCluster' :: CreateCluster -> Maybe SSESpecification
$sel:securityGroupIds:CreateCluster' :: CreateCluster -> 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
"SSESpecification" Text -> SSESpecification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(SSESpecification -> Pair) -> Maybe SSESpecification -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SSESpecification
sSESpecification,
(Text
"SubnetGroupName" 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
subnetGroupName,
(Text
"ClusterEndpointEncryptionType" Text -> ClusterEndpointEncryptionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ClusterEndpointEncryptionType -> Pair)
-> Maybe ClusterEndpointEncryptionType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType,
(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
"AvailabilityZones" 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]
availabilityZones,
(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
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
(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),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"NodeType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
nodeType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ReplicationFactor" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
replicationFactor),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"IamRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
iamRoleArn)
]
)
instance Core.ToPath CreateCluster where
toPath :: CreateCluster -> ByteString
toPath = ByteString -> CreateCluster -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateCluster where
toQuery :: CreateCluster -> QueryString
toQuery = QueryString -> CreateCluster -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateClusterResponse = CreateClusterResponse'
{
CreateClusterResponse -> Maybe Cluster
cluster :: Prelude.Maybe Cluster,
CreateClusterResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateClusterResponse -> CreateClusterResponse -> Bool
(CreateClusterResponse -> CreateClusterResponse -> Bool)
-> (CreateClusterResponse -> CreateClusterResponse -> Bool)
-> Eq CreateClusterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateClusterResponse -> CreateClusterResponse -> Bool
$c/= :: CreateClusterResponse -> CreateClusterResponse -> Bool
== :: CreateClusterResponse -> CreateClusterResponse -> Bool
$c== :: CreateClusterResponse -> CreateClusterResponse -> Bool
Prelude.Eq, ReadPrec [CreateClusterResponse]
ReadPrec CreateClusterResponse
Int -> ReadS CreateClusterResponse
ReadS [CreateClusterResponse]
(Int -> ReadS CreateClusterResponse)
-> ReadS [CreateClusterResponse]
-> ReadPrec CreateClusterResponse
-> ReadPrec [CreateClusterResponse]
-> Read CreateClusterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateClusterResponse]
$creadListPrec :: ReadPrec [CreateClusterResponse]
readPrec :: ReadPrec CreateClusterResponse
$creadPrec :: ReadPrec CreateClusterResponse
readList :: ReadS [CreateClusterResponse]
$creadList :: ReadS [CreateClusterResponse]
readsPrec :: Int -> ReadS CreateClusterResponse
$creadsPrec :: Int -> ReadS CreateClusterResponse
Prelude.Read, Int -> CreateClusterResponse -> ShowS
[CreateClusterResponse] -> ShowS
CreateClusterResponse -> String
(Int -> CreateClusterResponse -> ShowS)
-> (CreateClusterResponse -> String)
-> ([CreateClusterResponse] -> ShowS)
-> Show CreateClusterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateClusterResponse] -> ShowS
$cshowList :: [CreateClusterResponse] -> ShowS
show :: CreateClusterResponse -> String
$cshow :: CreateClusterResponse -> String
showsPrec :: Int -> CreateClusterResponse -> ShowS
$cshowsPrec :: Int -> CreateClusterResponse -> ShowS
Prelude.Show, (forall x. CreateClusterResponse -> Rep CreateClusterResponse x)
-> (forall x. Rep CreateClusterResponse x -> CreateClusterResponse)
-> Generic CreateClusterResponse
forall x. Rep CreateClusterResponse x -> CreateClusterResponse
forall x. CreateClusterResponse -> Rep CreateClusterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateClusterResponse x -> CreateClusterResponse
$cfrom :: forall x. CreateClusterResponse -> Rep CreateClusterResponse x
Prelude.Generic)
newCreateClusterResponse ::
Prelude.Int ->
CreateClusterResponse
newCreateClusterResponse :: Int -> CreateClusterResponse
newCreateClusterResponse Int
pHttpStatus_ =
CreateClusterResponse' :: Maybe Cluster -> Int -> CreateClusterResponse
CreateClusterResponse'
{ $sel:cluster:CreateClusterResponse' :: Maybe Cluster
cluster = Maybe Cluster
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateClusterResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createClusterResponse_cluster :: Lens.Lens' CreateClusterResponse (Prelude.Maybe Cluster)
createClusterResponse_cluster :: (Maybe Cluster -> f (Maybe Cluster))
-> CreateClusterResponse -> f CreateClusterResponse
createClusterResponse_cluster = (CreateClusterResponse -> Maybe Cluster)
-> (CreateClusterResponse
-> Maybe Cluster -> CreateClusterResponse)
-> Lens
CreateClusterResponse
CreateClusterResponse
(Maybe Cluster)
(Maybe Cluster)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterResponse' {Maybe Cluster
cluster :: Maybe Cluster
$sel:cluster:CreateClusterResponse' :: CreateClusterResponse -> Maybe Cluster
cluster} -> Maybe Cluster
cluster) (\s :: CreateClusterResponse
s@CreateClusterResponse' {} Maybe Cluster
a -> CreateClusterResponse
s {$sel:cluster:CreateClusterResponse' :: Maybe Cluster
cluster = Maybe Cluster
a} :: CreateClusterResponse)
createClusterResponse_httpStatus :: Lens.Lens' CreateClusterResponse Prelude.Int
createClusterResponse_httpStatus :: (Int -> f Int) -> CreateClusterResponse -> f CreateClusterResponse
createClusterResponse_httpStatus = (CreateClusterResponse -> Int)
-> (CreateClusterResponse -> Int -> CreateClusterResponse)
-> Lens CreateClusterResponse CreateClusterResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateClusterResponse' :: CreateClusterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateClusterResponse
s@CreateClusterResponse' {} Int
a -> CreateClusterResponse
s {$sel:httpStatus:CreateClusterResponse' :: Int
httpStatus = Int
a} :: CreateClusterResponse)
instance Prelude.NFData CreateClusterResponse