module Network.AWS.Greengrass.GetAssociatedRole
(
getAssociatedRole
, GetAssociatedRole
, garGroupId
, getAssociatedRoleResponse
, GetAssociatedRoleResponse
, garrsAssociatedAt
, garrsRoleARN
, garrsResponseStatus
) 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
newtype GetAssociatedRole = GetAssociatedRole'
{ _garGroupId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getAssociatedRole
:: Text
-> GetAssociatedRole
getAssociatedRole pGroupId_ = GetAssociatedRole' {_garGroupId = pGroupId_}
garGroupId :: Lens' GetAssociatedRole Text
garGroupId = lens _garGroupId (\ s a -> s{_garGroupId = a});
instance AWSRequest GetAssociatedRole where
type Rs GetAssociatedRole = GetAssociatedRoleResponse
request = get greengrass
response
= receiveJSON
(\ s h x ->
GetAssociatedRoleResponse' <$>
(x .?> "AssociatedAt") <*> (x .?> "RoleArn") <*>
(pure (fromEnum s)))
instance Hashable GetAssociatedRole where
instance NFData GetAssociatedRole where
instance ToHeaders GetAssociatedRole where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetAssociatedRole where
toPath GetAssociatedRole'{..}
= mconcat
["/greengrass/groups/", toBS _garGroupId, "/role"]
instance ToQuery GetAssociatedRole where
toQuery = const mempty
data GetAssociatedRoleResponse = GetAssociatedRoleResponse'
{ _garrsAssociatedAt :: !(Maybe Text)
, _garrsRoleARN :: !(Maybe Text)
, _garrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getAssociatedRoleResponse
:: Int
-> GetAssociatedRoleResponse
getAssociatedRoleResponse pResponseStatus_ =
GetAssociatedRoleResponse'
{ _garrsAssociatedAt = Nothing
, _garrsRoleARN = Nothing
, _garrsResponseStatus = pResponseStatus_
}
garrsAssociatedAt :: Lens' GetAssociatedRoleResponse (Maybe Text)
garrsAssociatedAt = lens _garrsAssociatedAt (\ s a -> s{_garrsAssociatedAt = a});
garrsRoleARN :: Lens' GetAssociatedRoleResponse (Maybe Text)
garrsRoleARN = lens _garrsRoleARN (\ s a -> s{_garrsRoleARN = a});
garrsResponseStatus :: Lens' GetAssociatedRoleResponse Int
garrsResponseStatus = lens _garrsResponseStatus (\ s a -> s{_garrsResponseStatus = a});
instance NFData GetAssociatedRoleResponse where