code: def get_rest_api_id(self, name):
          # type: (str) -> Optional[str]
          
          rest_apis = self._client('apigateway').get_rest_apis()['items']
          for api in rest_apis:
              if api['name'] == name:
                  return api['id']
          return None
docs: 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.