{-# 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.Redshift.CreateClusterParameterGroup
(
CreateClusterParameterGroup (..),
newCreateClusterParameterGroup,
createClusterParameterGroup_tags,
createClusterParameterGroup_parameterGroupName,
createClusterParameterGroup_parameterGroupFamily,
createClusterParameterGroup_description,
CreateClusterParameterGroupResponse (..),
newCreateClusterParameterGroupResponse,
createClusterParameterGroupResponse_clusterParameterGroup,
createClusterParameterGroupResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateClusterParameterGroup = CreateClusterParameterGroup'
{
CreateClusterParameterGroup -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateClusterParameterGroup -> Text
parameterGroupName :: Prelude.Text,
CreateClusterParameterGroup -> Text
parameterGroupFamily :: Prelude.Text,
CreateClusterParameterGroup -> Text
description :: Prelude.Text
}
deriving (CreateClusterParameterGroup -> CreateClusterParameterGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateClusterParameterGroup -> CreateClusterParameterGroup -> Bool
$c/= :: CreateClusterParameterGroup -> CreateClusterParameterGroup -> Bool
== :: CreateClusterParameterGroup -> CreateClusterParameterGroup -> Bool
$c== :: CreateClusterParameterGroup -> CreateClusterParameterGroup -> Bool
Prelude.Eq, ReadPrec [CreateClusterParameterGroup]
ReadPrec CreateClusterParameterGroup
Int -> ReadS CreateClusterParameterGroup
ReadS [CreateClusterParameterGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateClusterParameterGroup]
$creadListPrec :: ReadPrec [CreateClusterParameterGroup]
readPrec :: ReadPrec CreateClusterParameterGroup
$creadPrec :: ReadPrec CreateClusterParameterGroup
readList :: ReadS [CreateClusterParameterGroup]
$creadList :: ReadS [CreateClusterParameterGroup]
readsPrec :: Int -> ReadS CreateClusterParameterGroup
$creadsPrec :: Int -> ReadS CreateClusterParameterGroup
Prelude.Read, Int -> CreateClusterParameterGroup -> ShowS
[CreateClusterParameterGroup] -> ShowS
CreateClusterParameterGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateClusterParameterGroup] -> ShowS
$cshowList :: [CreateClusterParameterGroup] -> ShowS
show :: CreateClusterParameterGroup -> String
$cshow :: CreateClusterParameterGroup -> String
showsPrec :: Int -> CreateClusterParameterGroup -> ShowS
$cshowsPrec :: Int -> CreateClusterParameterGroup -> ShowS
Prelude.Show, forall x.
Rep CreateClusterParameterGroup x -> CreateClusterParameterGroup
forall x.
CreateClusterParameterGroup -> Rep CreateClusterParameterGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateClusterParameterGroup x -> CreateClusterParameterGroup
$cfrom :: forall x.
CreateClusterParameterGroup -> Rep CreateClusterParameterGroup x
Prelude.Generic)
newCreateClusterParameterGroup ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CreateClusterParameterGroup
newCreateClusterParameterGroup :: Text -> Text -> Text -> CreateClusterParameterGroup
newCreateClusterParameterGroup
Text
pParameterGroupName_
Text
pParameterGroupFamily_
Text
pDescription_ =
CreateClusterParameterGroup'
{ $sel:tags:CreateClusterParameterGroup' :: Maybe [Tag]
tags =
forall a. Maybe a
Prelude.Nothing,
$sel:parameterGroupName:CreateClusterParameterGroup' :: Text
parameterGroupName = Text
pParameterGroupName_,
$sel:parameterGroupFamily:CreateClusterParameterGroup' :: Text
parameterGroupFamily = Text
pParameterGroupFamily_,
$sel:description:CreateClusterParameterGroup' :: Text
description = Text
pDescription_
}
createClusterParameterGroup_tags :: Lens.Lens' CreateClusterParameterGroup (Prelude.Maybe [Tag])
createClusterParameterGroup_tags :: Lens' CreateClusterParameterGroup (Maybe [Tag])
createClusterParameterGroup_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterParameterGroup' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateClusterParameterGroup' :: CreateClusterParameterGroup -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateClusterParameterGroup
s@CreateClusterParameterGroup' {} Maybe [Tag]
a -> CreateClusterParameterGroup
s {$sel:tags:CreateClusterParameterGroup' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateClusterParameterGroup) 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
createClusterParameterGroup_parameterGroupName :: Lens.Lens' CreateClusterParameterGroup Prelude.Text
createClusterParameterGroup_parameterGroupName :: Lens' CreateClusterParameterGroup Text
createClusterParameterGroup_parameterGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterParameterGroup' {Text
parameterGroupName :: Text
$sel:parameterGroupName:CreateClusterParameterGroup' :: CreateClusterParameterGroup -> Text
parameterGroupName} -> Text
parameterGroupName) (\s :: CreateClusterParameterGroup
s@CreateClusterParameterGroup' {} Text
a -> CreateClusterParameterGroup
s {$sel:parameterGroupName:CreateClusterParameterGroup' :: Text
parameterGroupName = Text
a} :: CreateClusterParameterGroup)
createClusterParameterGroup_parameterGroupFamily :: Lens.Lens' CreateClusterParameterGroup Prelude.Text
createClusterParameterGroup_parameterGroupFamily :: Lens' CreateClusterParameterGroup Text
createClusterParameterGroup_parameterGroupFamily = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterParameterGroup' {Text
parameterGroupFamily :: Text
$sel:parameterGroupFamily:CreateClusterParameterGroup' :: CreateClusterParameterGroup -> Text
parameterGroupFamily} -> Text
parameterGroupFamily) (\s :: CreateClusterParameterGroup
s@CreateClusterParameterGroup' {} Text
a -> CreateClusterParameterGroup
s {$sel:parameterGroupFamily:CreateClusterParameterGroup' :: Text
parameterGroupFamily = Text
a} :: CreateClusterParameterGroup)
createClusterParameterGroup_description :: Lens.Lens' CreateClusterParameterGroup Prelude.Text
createClusterParameterGroup_description :: Lens' CreateClusterParameterGroup Text
createClusterParameterGroup_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterParameterGroup' {Text
description :: Text
$sel:description:CreateClusterParameterGroup' :: CreateClusterParameterGroup -> Text
description} -> Text
description) (\s :: CreateClusterParameterGroup
s@CreateClusterParameterGroup' {} Text
a -> CreateClusterParameterGroup
s {$sel:description:CreateClusterParameterGroup' :: Text
description = Text
a} :: CreateClusterParameterGroup)
instance Core.AWSRequest CreateClusterParameterGroup where
type
AWSResponse CreateClusterParameterGroup =
CreateClusterParameterGroupResponse
request :: (Service -> Service)
-> CreateClusterParameterGroup
-> Request CreateClusterParameterGroup
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateClusterParameterGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateClusterParameterGroup)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"CreateClusterParameterGroupResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe ClusterParameterGroup
-> Int -> CreateClusterParameterGroupResponse
CreateClusterParameterGroupResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ClusterParameterGroup")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateClusterParameterGroup where
hashWithSalt :: Int -> CreateClusterParameterGroup -> Int
hashWithSalt Int
_salt CreateClusterParameterGroup' {Maybe [Tag]
Text
description :: Text
parameterGroupFamily :: Text
parameterGroupName :: Text
tags :: Maybe [Tag]
$sel:description:CreateClusterParameterGroup' :: CreateClusterParameterGroup -> Text
$sel:parameterGroupFamily:CreateClusterParameterGroup' :: CreateClusterParameterGroup -> Text
$sel:parameterGroupName:CreateClusterParameterGroup' :: CreateClusterParameterGroup -> Text
$sel:tags:CreateClusterParameterGroup' :: CreateClusterParameterGroup -> Maybe [Tag]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
parameterGroupName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
parameterGroupFamily
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
description
instance Prelude.NFData CreateClusterParameterGroup where
rnf :: CreateClusterParameterGroup -> ()
rnf CreateClusterParameterGroup' {Maybe [Tag]
Text
description :: Text
parameterGroupFamily :: Text
parameterGroupName :: Text
tags :: Maybe [Tag]
$sel:description:CreateClusterParameterGroup' :: CreateClusterParameterGroup -> Text
$sel:parameterGroupFamily:CreateClusterParameterGroup' :: CreateClusterParameterGroup -> Text
$sel:parameterGroupName:CreateClusterParameterGroup' :: CreateClusterParameterGroup -> Text
$sel:tags:CreateClusterParameterGroup' :: CreateClusterParameterGroup -> Maybe [Tag]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
parameterGroupName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
parameterGroupFamily
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
description
instance Data.ToHeaders CreateClusterParameterGroup where
toHeaders :: CreateClusterParameterGroup -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath CreateClusterParameterGroup where
toPath :: CreateClusterParameterGroup -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateClusterParameterGroup where
toQuery :: CreateClusterParameterGroup -> QueryString
toQuery CreateClusterParameterGroup' {Maybe [Tag]
Text
description :: Text
parameterGroupFamily :: Text
parameterGroupName :: Text
tags :: Maybe [Tag]
$sel:description:CreateClusterParameterGroup' :: CreateClusterParameterGroup -> Text
$sel:parameterGroupFamily:CreateClusterParameterGroup' :: CreateClusterParameterGroup -> Text
$sel:parameterGroupName:CreateClusterParameterGroup' :: CreateClusterParameterGroup -> Text
$sel:tags:CreateClusterParameterGroup' :: CreateClusterParameterGroup -> Maybe [Tag]
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"CreateClusterParameterGroup" ::
Prelude.ByteString
),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"Tags"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
(forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Tag" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags),
ByteString
"ParameterGroupName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
parameterGroupName,
ByteString
"ParameterGroupFamily" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
parameterGroupFamily,
ByteString
"Description" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
description
]
data CreateClusterParameterGroupResponse = CreateClusterParameterGroupResponse'
{ CreateClusterParameterGroupResponse -> Maybe ClusterParameterGroup
clusterParameterGroup :: Prelude.Maybe ClusterParameterGroup,
CreateClusterParameterGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateClusterParameterGroupResponse
-> CreateClusterParameterGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateClusterParameterGroupResponse
-> CreateClusterParameterGroupResponse -> Bool
$c/= :: CreateClusterParameterGroupResponse
-> CreateClusterParameterGroupResponse -> Bool
== :: CreateClusterParameterGroupResponse
-> CreateClusterParameterGroupResponse -> Bool
$c== :: CreateClusterParameterGroupResponse
-> CreateClusterParameterGroupResponse -> Bool
Prelude.Eq, ReadPrec [CreateClusterParameterGroupResponse]
ReadPrec CreateClusterParameterGroupResponse
Int -> ReadS CreateClusterParameterGroupResponse
ReadS [CreateClusterParameterGroupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateClusterParameterGroupResponse]
$creadListPrec :: ReadPrec [CreateClusterParameterGroupResponse]
readPrec :: ReadPrec CreateClusterParameterGroupResponse
$creadPrec :: ReadPrec CreateClusterParameterGroupResponse
readList :: ReadS [CreateClusterParameterGroupResponse]
$creadList :: ReadS [CreateClusterParameterGroupResponse]
readsPrec :: Int -> ReadS CreateClusterParameterGroupResponse
$creadsPrec :: Int -> ReadS CreateClusterParameterGroupResponse
Prelude.Read, Int -> CreateClusterParameterGroupResponse -> ShowS
[CreateClusterParameterGroupResponse] -> ShowS
CreateClusterParameterGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateClusterParameterGroupResponse] -> ShowS
$cshowList :: [CreateClusterParameterGroupResponse] -> ShowS
show :: CreateClusterParameterGroupResponse -> String
$cshow :: CreateClusterParameterGroupResponse -> String
showsPrec :: Int -> CreateClusterParameterGroupResponse -> ShowS
$cshowsPrec :: Int -> CreateClusterParameterGroupResponse -> ShowS
Prelude.Show, forall x.
Rep CreateClusterParameterGroupResponse x
-> CreateClusterParameterGroupResponse
forall x.
CreateClusterParameterGroupResponse
-> Rep CreateClusterParameterGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateClusterParameterGroupResponse x
-> CreateClusterParameterGroupResponse
$cfrom :: forall x.
CreateClusterParameterGroupResponse
-> Rep CreateClusterParameterGroupResponse x
Prelude.Generic)
newCreateClusterParameterGroupResponse ::
Prelude.Int ->
CreateClusterParameterGroupResponse
newCreateClusterParameterGroupResponse :: Int -> CreateClusterParameterGroupResponse
newCreateClusterParameterGroupResponse Int
pHttpStatus_ =
CreateClusterParameterGroupResponse'
{ $sel:clusterParameterGroup:CreateClusterParameterGroupResponse' :: Maybe ClusterParameterGroup
clusterParameterGroup =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateClusterParameterGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createClusterParameterGroupResponse_clusterParameterGroup :: Lens.Lens' CreateClusterParameterGroupResponse (Prelude.Maybe ClusterParameterGroup)
createClusterParameterGroupResponse_clusterParameterGroup :: Lens'
CreateClusterParameterGroupResponse (Maybe ClusterParameterGroup)
createClusterParameterGroupResponse_clusterParameterGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterParameterGroupResponse' {Maybe ClusterParameterGroup
clusterParameterGroup :: Maybe ClusterParameterGroup
$sel:clusterParameterGroup:CreateClusterParameterGroupResponse' :: CreateClusterParameterGroupResponse -> Maybe ClusterParameterGroup
clusterParameterGroup} -> Maybe ClusterParameterGroup
clusterParameterGroup) (\s :: CreateClusterParameterGroupResponse
s@CreateClusterParameterGroupResponse' {} Maybe ClusterParameterGroup
a -> CreateClusterParameterGroupResponse
s {$sel:clusterParameterGroup:CreateClusterParameterGroupResponse' :: Maybe ClusterParameterGroup
clusterParameterGroup = Maybe ClusterParameterGroup
a} :: CreateClusterParameterGroupResponse)
createClusterParameterGroupResponse_httpStatus :: Lens.Lens' CreateClusterParameterGroupResponse Prelude.Int
createClusterParameterGroupResponse_httpStatus :: Lens' CreateClusterParameterGroupResponse Int
createClusterParameterGroupResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterParameterGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateClusterParameterGroupResponse' :: CreateClusterParameterGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateClusterParameterGroupResponse
s@CreateClusterParameterGroupResponse' {} Int
a -> CreateClusterParameterGroupResponse
s {$sel:httpStatus:CreateClusterParameterGroupResponse' :: Int
httpStatus = Int
a} :: CreateClusterParameterGroupResponse)
instance
Prelude.NFData
CreateClusterParameterGroupResponse
where
rnf :: CreateClusterParameterGroupResponse -> ()
rnf CreateClusterParameterGroupResponse' {Int
Maybe ClusterParameterGroup
httpStatus :: Int
clusterParameterGroup :: Maybe ClusterParameterGroup
$sel:httpStatus:CreateClusterParameterGroupResponse' :: CreateClusterParameterGroupResponse -> Int
$sel:clusterParameterGroup:CreateClusterParameterGroupResponse' :: CreateClusterParameterGroupResponse -> Maybe ClusterParameterGroup
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ClusterParameterGroup
clusterParameterGroup
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus