{-# 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.ModifyClusterIamRoles
(
ModifyClusterIamRoles (..),
newModifyClusterIamRoles,
modifyClusterIamRoles_addIamRoles,
modifyClusterIamRoles_defaultIamRoleArn,
modifyClusterIamRoles_removeIamRoles,
modifyClusterIamRoles_clusterIdentifier,
ModifyClusterIamRolesResponse (..),
newModifyClusterIamRolesResponse,
modifyClusterIamRolesResponse_cluster,
modifyClusterIamRolesResponse_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 ModifyClusterIamRoles = ModifyClusterIamRoles'
{
ModifyClusterIamRoles -> Maybe [Text]
addIamRoles :: Prelude.Maybe [Prelude.Text],
ModifyClusterIamRoles -> Maybe Text
defaultIamRoleArn :: Prelude.Maybe Prelude.Text,
ModifyClusterIamRoles -> Maybe [Text]
removeIamRoles :: Prelude.Maybe [Prelude.Text],
ModifyClusterIamRoles -> Text
clusterIdentifier :: Prelude.Text
}
deriving (ModifyClusterIamRoles -> ModifyClusterIamRoles -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyClusterIamRoles -> ModifyClusterIamRoles -> Bool
$c/= :: ModifyClusterIamRoles -> ModifyClusterIamRoles -> Bool
== :: ModifyClusterIamRoles -> ModifyClusterIamRoles -> Bool
$c== :: ModifyClusterIamRoles -> ModifyClusterIamRoles -> Bool
Prelude.Eq, ReadPrec [ModifyClusterIamRoles]
ReadPrec ModifyClusterIamRoles
Int -> ReadS ModifyClusterIamRoles
ReadS [ModifyClusterIamRoles]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyClusterIamRoles]
$creadListPrec :: ReadPrec [ModifyClusterIamRoles]
readPrec :: ReadPrec ModifyClusterIamRoles
$creadPrec :: ReadPrec ModifyClusterIamRoles
readList :: ReadS [ModifyClusterIamRoles]
$creadList :: ReadS [ModifyClusterIamRoles]
readsPrec :: Int -> ReadS ModifyClusterIamRoles
$creadsPrec :: Int -> ReadS ModifyClusterIamRoles
Prelude.Read, Int -> ModifyClusterIamRoles -> ShowS
[ModifyClusterIamRoles] -> ShowS
ModifyClusterIamRoles -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyClusterIamRoles] -> ShowS
$cshowList :: [ModifyClusterIamRoles] -> ShowS
show :: ModifyClusterIamRoles -> String
$cshow :: ModifyClusterIamRoles -> String
showsPrec :: Int -> ModifyClusterIamRoles -> ShowS
$cshowsPrec :: Int -> ModifyClusterIamRoles -> ShowS
Prelude.Show, forall x. Rep ModifyClusterIamRoles x -> ModifyClusterIamRoles
forall x. ModifyClusterIamRoles -> Rep ModifyClusterIamRoles x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyClusterIamRoles x -> ModifyClusterIamRoles
$cfrom :: forall x. ModifyClusterIamRoles -> Rep ModifyClusterIamRoles x
Prelude.Generic)
newModifyClusterIamRoles ::
Prelude.Text ->
ModifyClusterIamRoles
newModifyClusterIamRoles :: Text -> ModifyClusterIamRoles
newModifyClusterIamRoles Text
pClusterIdentifier_ =
ModifyClusterIamRoles'
{ $sel:addIamRoles:ModifyClusterIamRoles' :: Maybe [Text]
addIamRoles =
forall a. Maybe a
Prelude.Nothing,
$sel:defaultIamRoleArn:ModifyClusterIamRoles' :: Maybe Text
defaultIamRoleArn = forall a. Maybe a
Prelude.Nothing,
$sel:removeIamRoles:ModifyClusterIamRoles' :: Maybe [Text]
removeIamRoles = forall a. Maybe a
Prelude.Nothing,
$sel:clusterIdentifier:ModifyClusterIamRoles' :: Text
clusterIdentifier = Text
pClusterIdentifier_
}
modifyClusterIamRoles_addIamRoles :: Lens.Lens' ModifyClusterIamRoles (Prelude.Maybe [Prelude.Text])
modifyClusterIamRoles_addIamRoles :: Lens' ModifyClusterIamRoles (Maybe [Text])
modifyClusterIamRoles_addIamRoles = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyClusterIamRoles' {Maybe [Text]
addIamRoles :: Maybe [Text]
$sel:addIamRoles:ModifyClusterIamRoles' :: ModifyClusterIamRoles -> Maybe [Text]
addIamRoles} -> Maybe [Text]
addIamRoles) (\s :: ModifyClusterIamRoles
s@ModifyClusterIamRoles' {} Maybe [Text]
a -> ModifyClusterIamRoles
s {$sel:addIamRoles:ModifyClusterIamRoles' :: Maybe [Text]
addIamRoles = Maybe [Text]
a} :: ModifyClusterIamRoles) 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
modifyClusterIamRoles_defaultIamRoleArn :: Lens.Lens' ModifyClusterIamRoles (Prelude.Maybe Prelude.Text)
modifyClusterIamRoles_defaultIamRoleArn :: Lens' ModifyClusterIamRoles (Maybe Text)
modifyClusterIamRoles_defaultIamRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyClusterIamRoles' {Maybe Text
defaultIamRoleArn :: Maybe Text
$sel:defaultIamRoleArn:ModifyClusterIamRoles' :: ModifyClusterIamRoles -> Maybe Text
defaultIamRoleArn} -> Maybe Text
defaultIamRoleArn) (\s :: ModifyClusterIamRoles
s@ModifyClusterIamRoles' {} Maybe Text
a -> ModifyClusterIamRoles
s {$sel:defaultIamRoleArn:ModifyClusterIamRoles' :: Maybe Text
defaultIamRoleArn = Maybe Text
a} :: ModifyClusterIamRoles)
modifyClusterIamRoles_removeIamRoles :: Lens.Lens' ModifyClusterIamRoles (Prelude.Maybe [Prelude.Text])
modifyClusterIamRoles_removeIamRoles :: Lens' ModifyClusterIamRoles (Maybe [Text])
modifyClusterIamRoles_removeIamRoles = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyClusterIamRoles' {Maybe [Text]
removeIamRoles :: Maybe [Text]
$sel:removeIamRoles:ModifyClusterIamRoles' :: ModifyClusterIamRoles -> Maybe [Text]
removeIamRoles} -> Maybe [Text]
removeIamRoles) (\s :: ModifyClusterIamRoles
s@ModifyClusterIamRoles' {} Maybe [Text]
a -> ModifyClusterIamRoles
s {$sel:removeIamRoles:ModifyClusterIamRoles' :: Maybe [Text]
removeIamRoles = Maybe [Text]
a} :: ModifyClusterIamRoles) 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
modifyClusterIamRoles_clusterIdentifier :: Lens.Lens' ModifyClusterIamRoles Prelude.Text
modifyClusterIamRoles_clusterIdentifier :: Lens' ModifyClusterIamRoles Text
modifyClusterIamRoles_clusterIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyClusterIamRoles' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:ModifyClusterIamRoles' :: ModifyClusterIamRoles -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: ModifyClusterIamRoles
s@ModifyClusterIamRoles' {} Text
a -> ModifyClusterIamRoles
s {$sel:clusterIdentifier:ModifyClusterIamRoles' :: Text
clusterIdentifier = Text
a} :: ModifyClusterIamRoles)
instance Core.AWSRequest ModifyClusterIamRoles where
type
AWSResponse ModifyClusterIamRoles =
ModifyClusterIamRolesResponse
request :: (Service -> Service)
-> ModifyClusterIamRoles -> Request ModifyClusterIamRoles
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 ModifyClusterIamRoles
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifyClusterIamRoles)))
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
"ModifyClusterIamRolesResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Cluster -> Int -> ModifyClusterIamRolesResponse
ModifyClusterIamRolesResponse'
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
"Cluster")
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 ModifyClusterIamRoles where
hashWithSalt :: Int -> ModifyClusterIamRoles -> Int
hashWithSalt Int
_salt ModifyClusterIamRoles' {Maybe [Text]
Maybe Text
Text
clusterIdentifier :: Text
removeIamRoles :: Maybe [Text]
defaultIamRoleArn :: Maybe Text
addIamRoles :: Maybe [Text]
$sel:clusterIdentifier:ModifyClusterIamRoles' :: ModifyClusterIamRoles -> Text
$sel:removeIamRoles:ModifyClusterIamRoles' :: ModifyClusterIamRoles -> Maybe [Text]
$sel:defaultIamRoleArn:ModifyClusterIamRoles' :: ModifyClusterIamRoles -> Maybe Text
$sel:addIamRoles:ModifyClusterIamRoles' :: ModifyClusterIamRoles -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
addIamRoles
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultIamRoleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
removeIamRoles
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clusterIdentifier
instance Prelude.NFData ModifyClusterIamRoles where
rnf :: ModifyClusterIamRoles -> ()
rnf ModifyClusterIamRoles' {Maybe [Text]
Maybe Text
Text
clusterIdentifier :: Text
removeIamRoles :: Maybe [Text]
defaultIamRoleArn :: Maybe Text
addIamRoles :: Maybe [Text]
$sel:clusterIdentifier:ModifyClusterIamRoles' :: ModifyClusterIamRoles -> Text
$sel:removeIamRoles:ModifyClusterIamRoles' :: ModifyClusterIamRoles -> Maybe [Text]
$sel:defaultIamRoleArn:ModifyClusterIamRoles' :: ModifyClusterIamRoles -> Maybe Text
$sel:addIamRoles:ModifyClusterIamRoles' :: ModifyClusterIamRoles -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
addIamRoles
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultIamRoleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
removeIamRoles
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clusterIdentifier
instance Data.ToHeaders ModifyClusterIamRoles where
toHeaders :: ModifyClusterIamRoles -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ModifyClusterIamRoles where
toPath :: ModifyClusterIamRoles -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ModifyClusterIamRoles where
toQuery :: ModifyClusterIamRoles -> QueryString
toQuery ModifyClusterIamRoles' {Maybe [Text]
Maybe Text
Text
clusterIdentifier :: Text
removeIamRoles :: Maybe [Text]
defaultIamRoleArn :: Maybe Text
addIamRoles :: Maybe [Text]
$sel:clusterIdentifier:ModifyClusterIamRoles' :: ModifyClusterIamRoles -> Text
$sel:removeIamRoles:ModifyClusterIamRoles' :: ModifyClusterIamRoles -> Maybe [Text]
$sel:defaultIamRoleArn:ModifyClusterIamRoles' :: ModifyClusterIamRoles -> Maybe Text
$sel:addIamRoles:ModifyClusterIamRoles' :: ModifyClusterIamRoles -> Maybe [Text]
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ModifyClusterIamRoles" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"AddIamRoles"
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
"IamRoleArn"
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
addIamRoles
),
ByteString
"DefaultIamRoleArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
defaultIamRoleArn,
ByteString
"RemoveIamRoles"
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
"IamRoleArn"
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
removeIamRoles
),
ByteString
"ClusterIdentifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
clusterIdentifier
]
data ModifyClusterIamRolesResponse = ModifyClusterIamRolesResponse'
{ ModifyClusterIamRolesResponse -> Maybe Cluster
cluster :: Prelude.Maybe Cluster,
ModifyClusterIamRolesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ModifyClusterIamRolesResponse
-> ModifyClusterIamRolesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyClusterIamRolesResponse
-> ModifyClusterIamRolesResponse -> Bool
$c/= :: ModifyClusterIamRolesResponse
-> ModifyClusterIamRolesResponse -> Bool
== :: ModifyClusterIamRolesResponse
-> ModifyClusterIamRolesResponse -> Bool
$c== :: ModifyClusterIamRolesResponse
-> ModifyClusterIamRolesResponse -> Bool
Prelude.Eq, ReadPrec [ModifyClusterIamRolesResponse]
ReadPrec ModifyClusterIamRolesResponse
Int -> ReadS ModifyClusterIamRolesResponse
ReadS [ModifyClusterIamRolesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyClusterIamRolesResponse]
$creadListPrec :: ReadPrec [ModifyClusterIamRolesResponse]
readPrec :: ReadPrec ModifyClusterIamRolesResponse
$creadPrec :: ReadPrec ModifyClusterIamRolesResponse
readList :: ReadS [ModifyClusterIamRolesResponse]
$creadList :: ReadS [ModifyClusterIamRolesResponse]
readsPrec :: Int -> ReadS ModifyClusterIamRolesResponse
$creadsPrec :: Int -> ReadS ModifyClusterIamRolesResponse
Prelude.Read, Int -> ModifyClusterIamRolesResponse -> ShowS
[ModifyClusterIamRolesResponse] -> ShowS
ModifyClusterIamRolesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyClusterIamRolesResponse] -> ShowS
$cshowList :: [ModifyClusterIamRolesResponse] -> ShowS
show :: ModifyClusterIamRolesResponse -> String
$cshow :: ModifyClusterIamRolesResponse -> String
showsPrec :: Int -> ModifyClusterIamRolesResponse -> ShowS
$cshowsPrec :: Int -> ModifyClusterIamRolesResponse -> ShowS
Prelude.Show, forall x.
Rep ModifyClusterIamRolesResponse x
-> ModifyClusterIamRolesResponse
forall x.
ModifyClusterIamRolesResponse
-> Rep ModifyClusterIamRolesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyClusterIamRolesResponse x
-> ModifyClusterIamRolesResponse
$cfrom :: forall x.
ModifyClusterIamRolesResponse
-> Rep ModifyClusterIamRolesResponse x
Prelude.Generic)
newModifyClusterIamRolesResponse ::
Prelude.Int ->
ModifyClusterIamRolesResponse
newModifyClusterIamRolesResponse :: Int -> ModifyClusterIamRolesResponse
newModifyClusterIamRolesResponse Int
pHttpStatus_ =
ModifyClusterIamRolesResponse'
{ $sel:cluster:ModifyClusterIamRolesResponse' :: Maybe Cluster
cluster =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ModifyClusterIamRolesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
modifyClusterIamRolesResponse_cluster :: Lens.Lens' ModifyClusterIamRolesResponse (Prelude.Maybe Cluster)
modifyClusterIamRolesResponse_cluster :: Lens' ModifyClusterIamRolesResponse (Maybe Cluster)
modifyClusterIamRolesResponse_cluster = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyClusterIamRolesResponse' {Maybe Cluster
cluster :: Maybe Cluster
$sel:cluster:ModifyClusterIamRolesResponse' :: ModifyClusterIamRolesResponse -> Maybe Cluster
cluster} -> Maybe Cluster
cluster) (\s :: ModifyClusterIamRolesResponse
s@ModifyClusterIamRolesResponse' {} Maybe Cluster
a -> ModifyClusterIamRolesResponse
s {$sel:cluster:ModifyClusterIamRolesResponse' :: Maybe Cluster
cluster = Maybe Cluster
a} :: ModifyClusterIamRolesResponse)
modifyClusterIamRolesResponse_httpStatus :: Lens.Lens' ModifyClusterIamRolesResponse Prelude.Int
modifyClusterIamRolesResponse_httpStatus :: Lens' ModifyClusterIamRolesResponse Int
modifyClusterIamRolesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyClusterIamRolesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ModifyClusterIamRolesResponse' :: ModifyClusterIamRolesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ModifyClusterIamRolesResponse
s@ModifyClusterIamRolesResponse' {} Int
a -> ModifyClusterIamRolesResponse
s {$sel:httpStatus:ModifyClusterIamRolesResponse' :: Int
httpStatus = Int
a} :: ModifyClusterIamRolesResponse)
instance Prelude.NFData ModifyClusterIamRolesResponse where
rnf :: ModifyClusterIamRolesResponse -> ()
rnf ModifyClusterIamRolesResponse' {Int
Maybe Cluster
httpStatus :: Int
cluster :: Maybe Cluster
$sel:httpStatus:ModifyClusterIamRolesResponse' :: ModifyClusterIamRolesResponse -> Int
$sel:cluster:ModifyClusterIamRolesResponse' :: ModifyClusterIamRolesResponse -> Maybe Cluster
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Cluster
cluster
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus