{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RecordWildCards       #-}
{-# LANGUAGE TupleSections         #-}
{-# LANGUAGE TypeFamilies          #-}
module Aws.Iam.Commands.UpdateGroup
    ( UpdateGroup(..)
    , UpdateGroupResponse(..)
    ) where

import           Aws.Core
import           Aws.Iam.Core
import           Aws.Iam.Internal
import           Control.Applicative
import           Data.Text           (Text)
import           Data.Typeable
import           Prelude

-- | Updates the name and/or path of the specified group.
--
-- <http://docs.aws.amazon.com/IAM/latest/APIReference/API_UpdateGroup.html>
data UpdateGroup
    = UpdateGroup {
        UpdateGroup -> Text
ugGroupName    :: Text
      -- ^ Name of the group to be updated.
      , UpdateGroup -> Maybe Text
ugNewGroupName :: Maybe Text
      -- ^ New name for the group.
      , UpdateGroup -> Maybe Text
ugNewPath     :: Maybe Text
      -- ^ New path to which the group will be moved.
      }
    deriving (UpdateGroup -> UpdateGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateGroup -> UpdateGroup -> Bool
$c/= :: UpdateGroup -> UpdateGroup -> Bool
== :: UpdateGroup -> UpdateGroup -> Bool
$c== :: UpdateGroup -> UpdateGroup -> Bool
Eq, Eq UpdateGroup
UpdateGroup -> UpdateGroup -> Bool
UpdateGroup -> UpdateGroup -> Ordering
UpdateGroup -> UpdateGroup -> UpdateGroup
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: UpdateGroup -> UpdateGroup -> UpdateGroup
$cmin :: UpdateGroup -> UpdateGroup -> UpdateGroup
max :: UpdateGroup -> UpdateGroup -> UpdateGroup
$cmax :: UpdateGroup -> UpdateGroup -> UpdateGroup
>= :: UpdateGroup -> UpdateGroup -> Bool
$c>= :: UpdateGroup -> UpdateGroup -> Bool
> :: UpdateGroup -> UpdateGroup -> Bool
$c> :: UpdateGroup -> UpdateGroup -> Bool
<= :: UpdateGroup -> UpdateGroup -> Bool
$c<= :: UpdateGroup -> UpdateGroup -> Bool
< :: UpdateGroup -> UpdateGroup -> Bool
$c< :: UpdateGroup -> UpdateGroup -> Bool
compare :: UpdateGroup -> UpdateGroup -> Ordering
$ccompare :: UpdateGroup -> UpdateGroup -> Ordering
Ord, Int -> UpdateGroup -> ShowS
[UpdateGroup] -> ShowS
UpdateGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateGroup] -> ShowS
$cshowList :: [UpdateGroup] -> ShowS
show :: UpdateGroup -> String
$cshow :: UpdateGroup -> String
showsPrec :: Int -> UpdateGroup -> ShowS
$cshowsPrec :: Int -> UpdateGroup -> ShowS
Show, Typeable)

instance SignQuery UpdateGroup where
    type ServiceConfiguration UpdateGroup = IamConfiguration
    signQuery :: forall queryType.
UpdateGroup
-> ServiceConfiguration UpdateGroup queryType
-> SignatureData
-> SignedQuery
signQuery UpdateGroup{Maybe Text
Text
ugNewPath :: Maybe Text
ugNewGroupName :: Maybe Text
ugGroupName :: Text
ugNewPath :: UpdateGroup -> Maybe Text
ugNewGroupName :: UpdateGroup -> Maybe Text
ugGroupName :: UpdateGroup -> Text
..}
        = forall qt.
ByteString
-> [Maybe (ByteString, Text)]
-> IamConfiguration qt
-> SignatureData
-> SignedQuery
iamAction' ByteString
"UpdateGroup" [
              forall a. a -> Maybe a
Just (ByteString
"GroupName", Text
ugGroupName)
            , (ByteString
"NewGroupName",) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Text
ugNewGroupName
            , (ByteString
"NewPath",) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Text
ugNewPath
            ]

data UpdateGroupResponse = UpdateGroupResponse
    deriving (UpdateGroupResponse -> UpdateGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateGroupResponse -> UpdateGroupResponse -> Bool
$c/= :: UpdateGroupResponse -> UpdateGroupResponse -> Bool
== :: UpdateGroupResponse -> UpdateGroupResponse -> Bool
$c== :: UpdateGroupResponse -> UpdateGroupResponse -> Bool
Eq, Eq UpdateGroupResponse
UpdateGroupResponse -> UpdateGroupResponse -> Bool
UpdateGroupResponse -> UpdateGroupResponse -> Ordering
UpdateGroupResponse -> UpdateGroupResponse -> UpdateGroupResponse
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: UpdateGroupResponse -> UpdateGroupResponse -> UpdateGroupResponse
$cmin :: UpdateGroupResponse -> UpdateGroupResponse -> UpdateGroupResponse
max :: UpdateGroupResponse -> UpdateGroupResponse -> UpdateGroupResponse
$cmax :: UpdateGroupResponse -> UpdateGroupResponse -> UpdateGroupResponse
>= :: UpdateGroupResponse -> UpdateGroupResponse -> Bool
$c>= :: UpdateGroupResponse -> UpdateGroupResponse -> Bool
> :: UpdateGroupResponse -> UpdateGroupResponse -> Bool
$c> :: UpdateGroupResponse -> UpdateGroupResponse -> Bool
<= :: UpdateGroupResponse -> UpdateGroupResponse -> Bool
$c<= :: UpdateGroupResponse -> UpdateGroupResponse -> Bool
< :: UpdateGroupResponse -> UpdateGroupResponse -> Bool
$c< :: UpdateGroupResponse -> UpdateGroupResponse -> Bool
compare :: UpdateGroupResponse -> UpdateGroupResponse -> Ordering
$ccompare :: UpdateGroupResponse -> UpdateGroupResponse -> Ordering
Ord, Int -> UpdateGroupResponse -> ShowS
[UpdateGroupResponse] -> ShowS
UpdateGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateGroupResponse] -> ShowS
$cshowList :: [UpdateGroupResponse] -> ShowS
show :: UpdateGroupResponse -> String
$cshow :: UpdateGroupResponse -> String
showsPrec :: Int -> UpdateGroupResponse -> ShowS
$cshowsPrec :: Int -> UpdateGroupResponse -> ShowS
Show, Typeable)

instance ResponseConsumer UpdateGroup UpdateGroupResponse where
    type ResponseMetadata UpdateGroupResponse = IamMetadata
    responseConsumer :: Request
-> UpdateGroup
-> IORef (ResponseMetadata UpdateGroupResponse)
-> HTTPResponseConsumer UpdateGroupResponse
responseConsumer Request
_ UpdateGroup
_
        = forall a.
(Cursor -> Response IamMetadata a)
-> IORef IamMetadata -> HTTPResponseConsumer a
iamResponseConsumer (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. Monad m => a -> m a
return UpdateGroupResponse
UpdateGroupResponse)

instance Transaction UpdateGroup UpdateGroupResponse

instance AsMemoryResponse UpdateGroupResponse where
    type MemoryResponse UpdateGroupResponse = UpdateGroupResponse
    loadToMemory :: UpdateGroupResponse
-> ResourceT IO (MemoryResponse UpdateGroupResponse)
loadToMemory = forall (m :: * -> *) a. Monad m => a -> m a
return