# Class BuildTrigger (3.37.0)

3.37.0 (latest) 3.36.0 3.35.0 3.34.0 3.33.0 3.32.0 3.31.3 3.30.0 3.29.0 3.28.0 3.27.1 3.26.0 3.25.0 3.24.2 3.23.3 3.22.0 3.21.0 3.20.1 3.19.0 3.18.0 3.17.1 3.16.0 3.15.0 3.14.0 3.13.0 3.12.0 3.11.1 3.10.0 3.9.3 3.8.3 3.7.1 3.6.0 3.5.2 3.4.0 3.3.2 3.2.1 3.1.1 3.0.2 2.0.2 1.1.2 1.0.0 0.1.0

    BuildTrigger(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Configuration for an automated build in response to source
repository changes.

This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.

.. _oneof: <https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields>

| ## Attributes ||
|---|---|
| **Name** | **Description** |
| `resource_name` | `str` The `Trigger` name with format: `projects/{project}/locations/{location}/triggers/{trigger}`, where {trigger} is a unique identifier generated by the service. |
| `id` | `str` Output only. Unique identifier of the trigger. |
| `description` | `str` Human-readable description of this trigger. |
| `name` | `str` User-assigned name of the trigger. Must be unique within the project. Trigger names must meet the following requirements: + They must contain only alphanumeric characters and dashes. + They can be 1-64 characters long. + They must begin and end with an alphanumeric character. |
| `tags` | `MutableSequence[str]` Tags for annotation of a `BuildTrigger` |
| `trigger_template` | `https://docs.cloud.google.com/python/docs/reference/cloudbuild/latest/google.cloud.devtools.cloudbuild_v1.types.RepoSource` Template describing the types of source changes to trigger a build. Branch and tag names in trigger templates are interpreted as regular expressions. Any branch or tag change that matches that regular expression will trigger a build. Mutually exclusive with `github`. |
| `github` | `https://docs.cloud.google.com/python/docs/reference/cloudbuild/latest/google.cloud.devtools.cloudbuild_v1.types.GitHubEventsConfig` GitHubEventsConfig describes the configuration of a trigger that creates a build whenever a GitHub event is received. Mutually exclusive with `trigger_template`. |
| `pubsub_config` | `https://docs.cloud.google.com/python/docs/reference/cloudbuild/latest/google.cloud.devtools.cloudbuild_v1.types.PubsubConfig` PubsubConfig describes the configuration of a trigger that creates a build whenever a Pub/Sub message is published. |
| `webhook_config` | `https://docs.cloud.google.com/python/docs/reference/cloudbuild/latest/google.cloud.devtools.cloudbuild_v1.types.WebhookConfig` WebhookConfig describes the configuration of a trigger that creates a build whenever a webhook is sent to a trigger's webhook URL. |
| `autodetect` | `bool` Autodetect build configuration. The following precedence is used (case insensitive): 1. cloudbuild.yaml 2. cloudbuild.yml 3. cloudbuild.json 4. Dockerfile Currently only available for GitHub App Triggers. This field is a member of `oneof`_ `build_template`. |
| `build` | `google.cloud.devtools.cloudbuild_v1.types.Build` Contents of the build template. This field is a member of `oneof`_ `build_template`. |
| `filename` | `str` Path, from the source root, to the build configuration file (i.e. cloudbuild.yaml). This field is a member of `oneof`_ `build_template`. |
| `git_file_source` | `https://docs.cloud.google.com/python/docs/reference/cloudbuild/latest/google.cloud.devtools.cloudbuild_v1.types.GitFileSource` The file source describing the local or remote Build template. This field is a member of `oneof`_ `build_template`. |
| `create_time` | `google.protobuf.timestamp_pb2.Timestamp` Output only. Time when the trigger was created. |
| `disabled` | `bool` If true, the trigger will never automatically execute a build. |
| `substitutions` | `MutableMapping[str, str]` Substitutions for Build resource. The keys must match the following regular expression: `^_[A-Z0-9_]+$`. |
| `ignored_files` | `MutableSequence[str]` ignored_files and included_files are file glob matches using https://golang.org/pkg/path/filepath/#Match extended with support for "\\\*\\\*". If ignored_files and changed files are both empty, then they are not used to determine whether or not to trigger a build. If ignored_files is not empty, then we ignore any files that match any of the ignored_file globs. If the change has no files that are outside of the ignored_files globs, then we do not trigger a build. |
| `included_files` | `MutableSequence[str]` If any of the files altered in the commit pass the ignored_files filter and included_files is empty, then as far as this filter is concerned, we should trigger the build. If any of the files altered in the commit pass the ignored_files filter and included_files is not empty, then we make sure that at least one of those files matches a included_files glob. If not, then we do not trigger a build. |
| `filter` | `str` Optional. A Common Expression Language string. |
| `source_to_build` | `https://docs.cloud.google.com/python/docs/reference/cloudbuild/latest/google.cloud.devtools.cloudbuild_v1.types.GitRepoSource` The repo and ref of the repository from which to build. This field is used only for those triggers that do not respond to SCM events. Triggers that respond to such events build source at whatever commit caused the event. This field is currently only used by Webhook, Pub/Sub, Manual, and Cron triggers. |
| `service_account` | `str` The service account used for all user-controlled operations including UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild. If no service account is set and the legacy Cloud Build service account (`[PROJECT_NUM]@cloudbuild.gserviceaccount.com`) is the default for the project then it will be used instead. Format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}` |
| `repository_event_config` | `https://docs.cloud.google.com/python/docs/reference/cloudbuild/latest/google.cloud.devtools.cloudbuild_v1.types.RepositoryEventConfig` The configuration of a trigger that creates a build whenever an event from Repo API is received. |

## Classes

### SubstitutionsEntry

    SubstitutionsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

The abstract base class for a message.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `kwargs` | `dict` Keys and values corresponding to the fields of the message. |
| `mapping` | ``Union[dict, `.Message`]`` A dictionary or message to be used to determine the values for this message. |
| `ignore_unknown_fields` | `Optional(bool)` If True, do not raise errors for unknown fields. Only applied if `mapping` is a mapping type or there are keyword parameters. |