{-# 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.CreateClusterSecurityGroup
(
CreateClusterSecurityGroup (..),
newCreateClusterSecurityGroup,
createClusterSecurityGroup_tags,
createClusterSecurityGroup_clusterSecurityGroupName,
createClusterSecurityGroup_description,
CreateClusterSecurityGroupResponse (..),
newCreateClusterSecurityGroupResponse,
createClusterSecurityGroupResponse_clusterSecurityGroup,
createClusterSecurityGroupResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateClusterSecurityGroup = CreateClusterSecurityGroup'
{
CreateClusterSecurityGroup -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateClusterSecurityGroup -> Text
clusterSecurityGroupName :: Prelude.Text,
CreateClusterSecurityGroup -> Text
description :: Prelude.Text
}
deriving (CreateClusterSecurityGroup -> CreateClusterSecurityGroup -> Bool
(CreateClusterSecurityGroup -> CreateClusterSecurityGroup -> Bool)
-> (CreateClusterSecurityGroup
-> CreateClusterSecurityGroup -> Bool)
-> Eq CreateClusterSecurityGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateClusterSecurityGroup -> CreateClusterSecurityGroup -> Bool
$c/= :: CreateClusterSecurityGroup -> CreateClusterSecurityGroup -> Bool
== :: CreateClusterSecurityGroup -> CreateClusterSecurityGroup -> Bool
$c== :: CreateClusterSecurityGroup -> CreateClusterSecurityGroup -> Bool
Prelude.Eq, ReadPrec [CreateClusterSecurityGroup]
ReadPrec CreateClusterSecurityGroup
Int -> ReadS CreateClusterSecurityGroup
ReadS [CreateClusterSecurityGroup]
(Int -> ReadS CreateClusterSecurityGroup)
-> ReadS [CreateClusterSecurityGroup]
-> ReadPrec CreateClusterSecurityGroup
-> ReadPrec [CreateClusterSecurityGroup]
-> Read CreateClusterSecurityGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateClusterSecurityGroup]
$creadListPrec :: ReadPrec [CreateClusterSecurityGroup]
readPrec :: ReadPrec CreateClusterSecurityGroup
$creadPrec :: ReadPrec CreateClusterSecurityGroup
readList :: ReadS [CreateClusterSecurityGroup]
$creadList :: ReadS [CreateClusterSecurityGroup]
readsPrec :: Int -> ReadS CreateClusterSecurityGroup
$creadsPrec :: Int -> ReadS CreateClusterSecurityGroup
Prelude.Read, Int -> CreateClusterSecurityGroup -> ShowS
[CreateClusterSecurityGroup] -> ShowS
CreateClusterSecurityGroup -> String
(Int -> CreateClusterSecurityGroup -> ShowS)
-> (CreateClusterSecurityGroup -> String)
-> ([CreateClusterSecurityGroup] -> ShowS)
-> Show CreateClusterSecurityGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateClusterSecurityGroup] -> ShowS
$cshowList :: [CreateClusterSecurityGroup] -> ShowS
show :: CreateClusterSecurityGroup -> String
$cshow :: CreateClusterSecurityGroup -> String
showsPrec :: Int -> CreateClusterSecurityGroup -> ShowS
$cshowsPrec :: Int -> CreateClusterSecurityGroup -> ShowS
Prelude.Show, (forall x.
CreateClusterSecurityGroup -> Rep CreateClusterSecurityGroup x)
-> (forall x.
Rep CreateClusterSecurityGroup x -> CreateClusterSecurityGroup)
-> Generic CreateClusterSecurityGroup
forall x.
Rep CreateClusterSecurityGroup x -> CreateClusterSecurityGroup
forall x.
CreateClusterSecurityGroup -> Rep CreateClusterSecurityGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateClusterSecurityGroup x -> CreateClusterSecurityGroup
$cfrom :: forall x.
CreateClusterSecurityGroup -> Rep CreateClusterSecurityGroup x
Prelude.Generic)
newCreateClusterSecurityGroup ::
Prelude.Text ->
Prelude.Text ->
CreateClusterSecurityGroup
newCreateClusterSecurityGroup :: Text -> Text -> CreateClusterSecurityGroup
newCreateClusterSecurityGroup
Text
pClusterSecurityGroupName_
Text
pDescription_ =
CreateClusterSecurityGroup' :: Maybe [Tag] -> Text -> Text -> CreateClusterSecurityGroup
CreateClusterSecurityGroup'
{ $sel:tags:CreateClusterSecurityGroup' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:clusterSecurityGroupName:CreateClusterSecurityGroup' :: Text
clusterSecurityGroupName =
Text
pClusterSecurityGroupName_,
$sel:description:CreateClusterSecurityGroup' :: Text
description = Text
pDescription_
}
createClusterSecurityGroup_tags :: Lens.Lens' CreateClusterSecurityGroup (Prelude.Maybe [Tag])
createClusterSecurityGroup_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateClusterSecurityGroup -> f CreateClusterSecurityGroup
createClusterSecurityGroup_tags = (CreateClusterSecurityGroup -> Maybe [Tag])
-> (CreateClusterSecurityGroup
-> Maybe [Tag] -> CreateClusterSecurityGroup)
-> Lens
CreateClusterSecurityGroup
CreateClusterSecurityGroup
(Maybe [Tag])
(Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterSecurityGroup' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateClusterSecurityGroup' :: CreateClusterSecurityGroup -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateClusterSecurityGroup
s@CreateClusterSecurityGroup' {} Maybe [Tag]
a -> CreateClusterSecurityGroup
s {$sel:tags:CreateClusterSecurityGroup' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateClusterSecurityGroup) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateClusterSecurityGroup -> f CreateClusterSecurityGroup)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateClusterSecurityGroup
-> f CreateClusterSecurityGroup
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
createClusterSecurityGroup_clusterSecurityGroupName :: Lens.Lens' CreateClusterSecurityGroup Prelude.Text
createClusterSecurityGroup_clusterSecurityGroupName :: (Text -> f Text)
-> CreateClusterSecurityGroup -> f CreateClusterSecurityGroup
createClusterSecurityGroup_clusterSecurityGroupName = (CreateClusterSecurityGroup -> Text)
-> (CreateClusterSecurityGroup
-> Text -> CreateClusterSecurityGroup)
-> Lens
CreateClusterSecurityGroup CreateClusterSecurityGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterSecurityGroup' {Text
clusterSecurityGroupName :: Text
$sel:clusterSecurityGroupName:CreateClusterSecurityGroup' :: CreateClusterSecurityGroup -> Text
clusterSecurityGroupName} -> Text
clusterSecurityGroupName) (\s :: CreateClusterSecurityGroup
s@CreateClusterSecurityGroup' {} Text
a -> CreateClusterSecurityGroup
s {$sel:clusterSecurityGroupName:CreateClusterSecurityGroup' :: Text
clusterSecurityGroupName = Text
a} :: CreateClusterSecurityGroup)
createClusterSecurityGroup_description :: Lens.Lens' CreateClusterSecurityGroup Prelude.Text
createClusterSecurityGroup_description :: (Text -> f Text)
-> CreateClusterSecurityGroup -> f CreateClusterSecurityGroup
createClusterSecurityGroup_description = (CreateClusterSecurityGroup -> Text)
-> (CreateClusterSecurityGroup
-> Text -> CreateClusterSecurityGroup)
-> Lens
CreateClusterSecurityGroup CreateClusterSecurityGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterSecurityGroup' {Text
description :: Text
$sel:description:CreateClusterSecurityGroup' :: CreateClusterSecurityGroup -> Text
description} -> Text
description) (\s :: CreateClusterSecurityGroup
s@CreateClusterSecurityGroup' {} Text
a -> CreateClusterSecurityGroup
s {$sel:description:CreateClusterSecurityGroup' :: Text
description = Text
a} :: CreateClusterSecurityGroup)
instance Core.AWSRequest CreateClusterSecurityGroup where
type
AWSResponse CreateClusterSecurityGroup =
CreateClusterSecurityGroupResponse
request :: CreateClusterSecurityGroup -> Request CreateClusterSecurityGroup
request = Service
-> CreateClusterSecurityGroup -> Request CreateClusterSecurityGroup
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy CreateClusterSecurityGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateClusterSecurityGroup)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse CreateClusterSecurityGroup))
-> Logger
-> Service
-> Proxy CreateClusterSecurityGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateClusterSecurityGroup)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"CreateClusterSecurityGroupResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe ClusterSecurityGroup
-> Int -> CreateClusterSecurityGroupResponse
CreateClusterSecurityGroupResponse'
(Maybe ClusterSecurityGroup
-> Int -> CreateClusterSecurityGroupResponse)
-> Either String (Maybe ClusterSecurityGroup)
-> Either String (Int -> CreateClusterSecurityGroupResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ClusterSecurityGroup)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ClusterSecurityGroup")
Either String (Int -> CreateClusterSecurityGroupResponse)
-> Either String Int
-> Either String CreateClusterSecurityGroupResponse
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 CreateClusterSecurityGroup
instance Prelude.NFData CreateClusterSecurityGroup
instance Core.ToHeaders CreateClusterSecurityGroup where
toHeaders :: CreateClusterSecurityGroup -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateClusterSecurityGroup -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath CreateClusterSecurityGroup where
toPath :: CreateClusterSecurityGroup -> ByteString
toPath = ByteString -> CreateClusterSecurityGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateClusterSecurityGroup where
toQuery :: CreateClusterSecurityGroup -> QueryString
toQuery CreateClusterSecurityGroup' {Maybe [Tag]
Text
description :: Text
clusterSecurityGroupName :: Text
tags :: Maybe [Tag]
$sel:description:CreateClusterSecurityGroup' :: CreateClusterSecurityGroup -> Text
$sel:clusterSecurityGroupName:CreateClusterSecurityGroup' :: CreateClusterSecurityGroup -> Text
$sel:tags:CreateClusterSecurityGroup' :: CreateClusterSecurityGroup -> Maybe [Tag]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"CreateClusterSecurityGroup" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"Tags"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Tag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"Tag" ([Tag] -> QueryString) -> Maybe [Tag] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags),
ByteString
"ClusterSecurityGroupName"
ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
clusterSecurityGroupName,
ByteString
"Description" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
description
]
data CreateClusterSecurityGroupResponse = CreateClusterSecurityGroupResponse'
{ CreateClusterSecurityGroupResponse -> Maybe ClusterSecurityGroup
clusterSecurityGroup :: Prelude.Maybe ClusterSecurityGroup,
CreateClusterSecurityGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateClusterSecurityGroupResponse
-> CreateClusterSecurityGroupResponse -> Bool
(CreateClusterSecurityGroupResponse
-> CreateClusterSecurityGroupResponse -> Bool)
-> (CreateClusterSecurityGroupResponse
-> CreateClusterSecurityGroupResponse -> Bool)
-> Eq CreateClusterSecurityGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateClusterSecurityGroupResponse
-> CreateClusterSecurityGroupResponse -> Bool
$c/= :: CreateClusterSecurityGroupResponse
-> CreateClusterSecurityGroupResponse -> Bool
== :: CreateClusterSecurityGroupResponse
-> CreateClusterSecurityGroupResponse -> Bool
$c== :: CreateClusterSecurityGroupResponse
-> CreateClusterSecurityGroupResponse -> Bool
Prelude.Eq, ReadPrec [CreateClusterSecurityGroupResponse]
ReadPrec CreateClusterSecurityGroupResponse
Int -> ReadS CreateClusterSecurityGroupResponse
ReadS [CreateClusterSecurityGroupResponse]
(Int -> ReadS CreateClusterSecurityGroupResponse)
-> ReadS [CreateClusterSecurityGroupResponse]
-> ReadPrec CreateClusterSecurityGroupResponse
-> ReadPrec [CreateClusterSecurityGroupResponse]
-> Read CreateClusterSecurityGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateClusterSecurityGroupResponse]
$creadListPrec :: ReadPrec [CreateClusterSecurityGroupResponse]
readPrec :: ReadPrec CreateClusterSecurityGroupResponse
$creadPrec :: ReadPrec CreateClusterSecurityGroupResponse
readList :: ReadS [CreateClusterSecurityGroupResponse]
$creadList :: ReadS [CreateClusterSecurityGroupResponse]
readsPrec :: Int -> ReadS CreateClusterSecurityGroupResponse
$creadsPrec :: Int -> ReadS CreateClusterSecurityGroupResponse
Prelude.Read, Int -> CreateClusterSecurityGroupResponse -> ShowS
[CreateClusterSecurityGroupResponse] -> ShowS
CreateClusterSecurityGroupResponse -> String
(Int -> CreateClusterSecurityGroupResponse -> ShowS)
-> (CreateClusterSecurityGroupResponse -> String)
-> ([CreateClusterSecurityGroupResponse] -> ShowS)
-> Show CreateClusterSecurityGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateClusterSecurityGroupResponse] -> ShowS
$cshowList :: [CreateClusterSecurityGroupResponse] -> ShowS
show :: CreateClusterSecurityGroupResponse -> String
$cshow :: CreateClusterSecurityGroupResponse -> String
showsPrec :: Int -> CreateClusterSecurityGroupResponse -> ShowS
$cshowsPrec :: Int -> CreateClusterSecurityGroupResponse -> ShowS
Prelude.Show, (forall x.
CreateClusterSecurityGroupResponse
-> Rep CreateClusterSecurityGroupResponse x)
-> (forall x.
Rep CreateClusterSecurityGroupResponse x
-> CreateClusterSecurityGroupResponse)
-> Generic CreateClusterSecurityGroupResponse
forall x.
Rep CreateClusterSecurityGroupResponse x
-> CreateClusterSecurityGroupResponse
forall x.
CreateClusterSecurityGroupResponse
-> Rep CreateClusterSecurityGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateClusterSecurityGroupResponse x
-> CreateClusterSecurityGroupResponse
$cfrom :: forall x.
CreateClusterSecurityGroupResponse
-> Rep CreateClusterSecurityGroupResponse x
Prelude.Generic)
newCreateClusterSecurityGroupResponse ::
Prelude.Int ->
CreateClusterSecurityGroupResponse
newCreateClusterSecurityGroupResponse :: Int -> CreateClusterSecurityGroupResponse
newCreateClusterSecurityGroupResponse Int
pHttpStatus_ =
CreateClusterSecurityGroupResponse' :: Maybe ClusterSecurityGroup
-> Int -> CreateClusterSecurityGroupResponse
CreateClusterSecurityGroupResponse'
{ $sel:clusterSecurityGroup:CreateClusterSecurityGroupResponse' :: Maybe ClusterSecurityGroup
clusterSecurityGroup =
Maybe ClusterSecurityGroup
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateClusterSecurityGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createClusterSecurityGroupResponse_clusterSecurityGroup :: Lens.Lens' CreateClusterSecurityGroupResponse (Prelude.Maybe ClusterSecurityGroup)
createClusterSecurityGroupResponse_clusterSecurityGroup :: (Maybe ClusterSecurityGroup -> f (Maybe ClusterSecurityGroup))
-> CreateClusterSecurityGroupResponse
-> f CreateClusterSecurityGroupResponse
createClusterSecurityGroupResponse_clusterSecurityGroup = (CreateClusterSecurityGroupResponse -> Maybe ClusterSecurityGroup)
-> (CreateClusterSecurityGroupResponse
-> Maybe ClusterSecurityGroup
-> CreateClusterSecurityGroupResponse)
-> Lens
CreateClusterSecurityGroupResponse
CreateClusterSecurityGroupResponse
(Maybe ClusterSecurityGroup)
(Maybe ClusterSecurityGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterSecurityGroupResponse' {Maybe ClusterSecurityGroup
clusterSecurityGroup :: Maybe ClusterSecurityGroup
$sel:clusterSecurityGroup:CreateClusterSecurityGroupResponse' :: CreateClusterSecurityGroupResponse -> Maybe ClusterSecurityGroup
clusterSecurityGroup} -> Maybe ClusterSecurityGroup
clusterSecurityGroup) (\s :: CreateClusterSecurityGroupResponse
s@CreateClusterSecurityGroupResponse' {} Maybe ClusterSecurityGroup
a -> CreateClusterSecurityGroupResponse
s {$sel:clusterSecurityGroup:CreateClusterSecurityGroupResponse' :: Maybe ClusterSecurityGroup
clusterSecurityGroup = Maybe ClusterSecurityGroup
a} :: CreateClusterSecurityGroupResponse)
createClusterSecurityGroupResponse_httpStatus :: Lens.Lens' CreateClusterSecurityGroupResponse Prelude.Int
createClusterSecurityGroupResponse_httpStatus :: (Int -> f Int)
-> CreateClusterSecurityGroupResponse
-> f CreateClusterSecurityGroupResponse
createClusterSecurityGroupResponse_httpStatus = (CreateClusterSecurityGroupResponse -> Int)
-> (CreateClusterSecurityGroupResponse
-> Int -> CreateClusterSecurityGroupResponse)
-> Lens
CreateClusterSecurityGroupResponse
CreateClusterSecurityGroupResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterSecurityGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateClusterSecurityGroupResponse' :: CreateClusterSecurityGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateClusterSecurityGroupResponse
s@CreateClusterSecurityGroupResponse' {} Int
a -> CreateClusterSecurityGroupResponse
s {$sel:httpStatus:CreateClusterSecurityGroupResponse' :: Int
httpStatus = Int
a} :: CreateClusterSecurityGroupResponse)
instance
Prelude.NFData
CreateClusterSecurityGroupResponse