<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_rest_api_id(self, name):
 # type: (str) -> Optional[str] """Get rest api id associated with an API name. :type name: str :param name: The name of the rest api. :rtype: str :return: If the rest api exists, then the restApiId is returned, otherwise None. """

        rest_apis = self._client('apigateway').get_rest_apis()['items']
        for api in rest_apis:
            if api['name'] == name:
                return api['id']
        return None