class_docstr: Pre-processes zip path parameter.
  
  Responsible for checking if the zip path parameter is correctly specified in
  relation with source_code body fields. Non empty zip path parameter is special because
  it is mutually exclusive with sourceArchiveUrl and sourceRepository body fields.
  It is also mutually exclusive with non-empty sourceUploadUrl.
  The pre-process modifies sourceUploadUrl body field in special way when zip_path
  is not empty. An extra step is run when execute method is called and sourceUploadUrl
  field value is set in the body with the value returned by generateUploadUrl Cloud
  Function API method.
  
  :param body: Body passed to the create/update method calls.
  :param zip_path: (optional) Path to zip file containing source code of the function. If the path
      is set, the sourceUploadUrl should not be specified in the body or it should
      be empty. Then the zip file will be uploaded using the upload URL generated
      via generateUploadUrl from the Cloud Functions API.
class_docstr_tok: ["Pre-processes","zip","path","parameter",".","Responsible","for","checking","if","the","zip","path","parameter","is","correctly","specified","in","relation","with","source_code","body","fields",".","Non","empty","zip","path","parameter","is","special","because","it","is","mutually","exclusive","with","sourceArchiveUrl","and","sourceRepository","body","fields",".","It","is","also","mutually","exclusive","with","non-empty","sourceUploadUrl",".","The","pre-process","modifies","sourceUploadUrl","body","field","in","special","way","when","zip_path","is","not","empty",".","An","extra","step","is","run","when","execute","method","is","called","and","sourceUploadUrl","field","value","is","set","in","the","body","with","the","value","returned","by","generateUploadUrl","Cloud","Function","API","method",".",":","param","body",":","Body","passed","to","the","create\/update","method","calls",".",":","param","zip_path",":","(","optional",")","Path","to","zip","file","containing","source","code","of","the","function",".","If","the","path","is","set",",","the","sourceUploadUrl","should","not","be","specified","in","the","body","or","it","should","be","empty",".","Then","the","zip","file","will","be","uploaded","using","the","upload","URL","generated","via","generateUploadUrl","from","the","Cloud","Functions","API","."]
docstr: Checks if function source should be uploaded.
docstr_tok: ["Checks","if","function","source","should","be","uploaded","."]
code: def should_upload_function(self) -> bool:
      """Checks if function source should be uploaded."""
      if self.upload_function is None:
          raise AirflowException(
              "validate() method has to be invoked before should_upload_function"
          )
      return self.upload_function
  
imports: from __future__ import annotations
  import re
  from typing import TYPE_CHECKING, Any, Sequence
  from googleapiclient.errors import HttpError
  from airflow.exceptions import AirflowException
  from airflow.providers.google.cloud.hooks.functions import CloudFunctionsHook
  from airflow.providers.google.cloud.links.cloud_functions import CloudFunctionsDetailsLink, CloudFunctionsListLink
  from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
  from airflow.providers.google.cloud.utils.field_validator import GcpBodyFieldValidator, GcpFieldValidationException
  from airflow.version import version
label_desc: Use image node_id 6 for calling the ZipPathPreprocessor obj's underlying member method code with example usage: obj.should_upload_function() and returns: self