docs: def add_permission_for_apigateway(self, function_name,
                                        region_name, account_id,
                                        rest_api_id, random_id=None):
          # type: (str, str, str, str, Optional[str]) -> None
          """Authorize API gateway to invoke a lambda function is needed.
  
          This method will first check if API gateway has permission to call
          the lambda function, and only if necessary will it invoke
          ``self.add_permission_for_apigateway(...).
  
          """
          source_arn = self._build_source_arn_str(region_name, account_id,
                                                  rest_api_id)
          self._add_lambda_permission_if_needed(
              source_arn=source_arn,
              function_arn=function_name,
              service_name='apigateway',
          )