{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.WorkSpaces.AssociateIPGroups
(
associateIPGroups
, AssociateIPGroups
, aigDirectoryId
, aigGroupIds
, associateIPGroupsResponse
, AssociateIPGroupsResponse
, aigrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.WorkSpaces.Types
import Network.AWS.WorkSpaces.Types.Product
data AssociateIPGroups = AssociateIPGroups'
{ _aigDirectoryId :: !Text
, _aigGroupIds :: ![Text]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateIPGroups
:: Text
-> AssociateIPGroups
associateIPGroups pDirectoryId_ =
AssociateIPGroups' {_aigDirectoryId = pDirectoryId_, _aigGroupIds = mempty}
aigDirectoryId :: Lens' AssociateIPGroups Text
aigDirectoryId = lens _aigDirectoryId (\ s a -> s{_aigDirectoryId = a})
aigGroupIds :: Lens' AssociateIPGroups [Text]
aigGroupIds = lens _aigGroupIds (\ s a -> s{_aigGroupIds = a}) . _Coerce
instance AWSRequest AssociateIPGroups where
type Rs AssociateIPGroups = AssociateIPGroupsResponse
request = postJSON workSpaces
response
= receiveEmpty
(\ s h x ->
AssociateIPGroupsResponse' <$> (pure (fromEnum s)))
instance Hashable AssociateIPGroups where
instance NFData AssociateIPGroups where
instance ToHeaders AssociateIPGroups where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("WorkspacesService.AssociateIpGroups" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AssociateIPGroups where
toJSON AssociateIPGroups'{..}
= object
(catMaybes
[Just ("DirectoryId" .= _aigDirectoryId),
Just ("GroupIds" .= _aigGroupIds)])
instance ToPath AssociateIPGroups where
toPath = const "/"
instance ToQuery AssociateIPGroups where
toQuery = const mempty
newtype AssociateIPGroupsResponse = AssociateIPGroupsResponse'
{ _aigrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateIPGroupsResponse
:: Int
-> AssociateIPGroupsResponse
associateIPGroupsResponse pResponseStatus_ =
AssociateIPGroupsResponse' {_aigrsResponseStatus = pResponseStatus_}
aigrsResponseStatus :: Lens' AssociateIPGroupsResponse Int
aigrsResponseStatus = lens _aigrsResponseStatus (\ s a -> s{_aigrsResponseStatus = a})
instance NFData AssociateIPGroupsResponse where