original_docstring: Create a Cloud Build Trigger.
  
          Args:
              project_id: GCP project id.
              repo_name: The Github repo name shown on cloud source. It should
                  have the format "github_<account_name>_<repo_name>". For
                  example, "github_googlecloudplatform_django-cloud-deploy"
              branch_regexp: A regular expression to control which branches can
                  trigger the build. For example, a branch_regexp equals to ".*"
                  will trigger builds when developer pushes to all branches.
              env_vars: A dictionary of environment variables to be used in
                  the cloud build environment.
          
docstring: Create a Cloud Build Trigger.
docstring_tokens: Create a Cloud Build Trigger .
code: def create_trigger(self,
                         project_id: str,
                         repo_name: str,
                         branch_regexp: str,
                         env_vars: Dict[str, str] = None):
          """Create a Cloud Build Trigger.
  
          Args:
              project_id: GCP project id.
              repo_name: The Github repo name shown on cloud source. It should
                  have the format "github_<account_name>_<repo_name>". For
                  example, "github_googlecloudplatform_django-cloud-deploy"
              branch_regexp: A regular expression to control which branches can
                  trigger the build. For example, a branch_regexp equals to ".*"
                  will trigger builds when developer pushes to all branches.
              env_vars: A dictionary of environment variables to be used in
                  the cloud build environment.
          """
          request_body = {
              'triggerTemplate': {
                  'projectId': project_id,
                  'repoName': repo_name,
                  'branchName': branch_regexp,
              },
              'description': self._DESCRIPTION,
              'filename': 'cloudbuild.yaml',
              'substitutions': env_vars if env_vars else {}
          }
          request = self._cloudbuild_service.projects().triggers().create(
              projectId=project_id, body=request_body)
          try:
              request.execute(num_retries=5)
          except errors.HttpError as e:
              raise CloudBuildError(
                  'Failed to create the cloud build trigger') from e
code_tokens: def create_trigger ( self , project_id : str , repo_name : str , branch_regexp : str , env_vars : Dict [ str , str ] = None ) : request_body = { 'triggerTemplate' : { 'projectId' : project_id , 'repoName' : repo_name , 'branchName' : branch_regexp , } , 'description' : self . _DESCRIPTION , 'filename' : 'cloudbuild.yaml' , 'substitutions' : env_vars if env_vars else { } } request = self . _cloudbuild_service . projects ( ) . triggers ( ) . create ( projectId = project_id , body = request_body ) try : request . execute ( num_retries = 5 ) except errors . HttpError as e : raise CloudBuildError ( 'Failed to create the cloud build trigger' ) from e
short_docstring: Create a Cloud Build Trigger.
short_docstring_tokens: Create a Cloud Build Trigger .
comment: """Create a Cloud Build Trigger.
  
          Args:
              project_id: GCP project id.
              repo_name: The Github repo name shown on cloud source. It should
                  have the format "github_<account_name>_<repo_name>". For
                  example, "github_googlecloudplatform_django-cloud-deploy"
              branch_regexp: A regular expression to control which branches can
                  trigger the build. For example, a branch_regexp equals to ".*"
                  will trigger builds when developer pushes to all branches.
              env_vars: A dictionary of environment variables to be used in
                  the cloud build environment.
          """