module Network.AWS.Greengrass.AssociateRoleToGroup
(
associateRoleToGroup
, AssociateRoleToGroup
, artgRoleARN
, artgGroupId
, associateRoleToGroupResponse
, AssociateRoleToGroupResponse
, artgrsAssociatedAt
, artgrsResponseStatus
) where
import Network.AWS.Greengrass.Types
import Network.AWS.Greengrass.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data AssociateRoleToGroup = AssociateRoleToGroup'
{ _artgRoleARN :: !(Maybe Text)
, _artgGroupId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateRoleToGroup
:: Text
-> AssociateRoleToGroup
associateRoleToGroup pGroupId_ =
AssociateRoleToGroup' {_artgRoleARN = Nothing, _artgGroupId = pGroupId_}
artgRoleARN :: Lens' AssociateRoleToGroup (Maybe Text)
artgRoleARN = lens _artgRoleARN (\ s a -> s{_artgRoleARN = a});
artgGroupId :: Lens' AssociateRoleToGroup Text
artgGroupId = lens _artgGroupId (\ s a -> s{_artgGroupId = a});
instance AWSRequest AssociateRoleToGroup where
type Rs AssociateRoleToGroup =
AssociateRoleToGroupResponse
request = putJSON greengrass
response
= receiveJSON
(\ s h x ->
AssociateRoleToGroupResponse' <$>
(x .?> "AssociatedAt") <*> (pure (fromEnum s)))
instance Hashable AssociateRoleToGroup where
instance NFData AssociateRoleToGroup where
instance ToHeaders AssociateRoleToGroup where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AssociateRoleToGroup where
toJSON AssociateRoleToGroup'{..}
= object
(catMaybes [("RoleArn" .=) <$> _artgRoleARN])
instance ToPath AssociateRoleToGroup where
toPath AssociateRoleToGroup'{..}
= mconcat
["/greengrass/groups/", toBS _artgGroupId, "/role"]
instance ToQuery AssociateRoleToGroup where
toQuery = const mempty
data AssociateRoleToGroupResponse = AssociateRoleToGroupResponse'
{ _artgrsAssociatedAt :: !(Maybe Text)
, _artgrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateRoleToGroupResponse
:: Int
-> AssociateRoleToGroupResponse
associateRoleToGroupResponse pResponseStatus_ =
AssociateRoleToGroupResponse'
{_artgrsAssociatedAt = Nothing, _artgrsResponseStatus = pResponseStatus_}
artgrsAssociatedAt :: Lens' AssociateRoleToGroupResponse (Maybe Text)
artgrsAssociatedAt = lens _artgrsAssociatedAt (\ s a -> s{_artgrsAssociatedAt = a});
artgrsResponseStatus :: Lens' AssociateRoleToGroupResponse Int
artgrsResponseStatus = lens _artgrsResponseStatus (\ s a -> s{_artgrsResponseStatus = a});
instance NFData AssociateRoleToGroupResponse where