#[non_exhaustive]pub struct BuildTrigger {Show 19 fields
pub resource_name: String,
pub id: String,
pub description: String,
pub name: String,
pub tags: Vec<String>,
pub trigger_template: Option<RepoSource>,
pub github: Option<GitHubEventsConfig>,
pub pubsub_config: Option<PubsubConfig>,
pub webhook_config: Option<WebhookConfig>,
pub create_time: Option<Timestamp>,
pub disabled: bool,
pub substitutions: HashMap<String, String>,
pub ignored_files: Vec<String>,
pub included_files: Vec<String>,
pub filter: String,
pub source_to_build: Option<GitRepoSource>,
pub service_account: String,
pub repository_event_config: Option<RepositoryEventConfig>,
pub build_template: Option<BuildTemplate>,
/* private fields */
}
Expand description
Configuration for an automated build in response to source repository changes.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.resource_name: String
The Trigger
name with format:
projects/{project}/locations/{location}/triggers/{trigger}
, where
{trigger} is a unique identifier generated by the service.
id: String
Output only. Unique identifier of the trigger.
description: String
Human-readable description of this trigger.
name: String
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 for annotation of a BuildTrigger
trigger_template: Option<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: Option<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: Option<PubsubConfig>
PubsubConfig describes the configuration of a trigger that creates a build whenever a Pub/Sub message is published.
webhook_config: Option<WebhookConfig>
WebhookConfig describes the configuration of a trigger that creates a build whenever a webhook is sent to a trigger’s webhook URL.
create_time: Option<Timestamp>
Output only. Time when the trigger was created.
disabled: bool
If true, the trigger will never automatically execute a build.
substitutions: HashMap<String, String>
Substitutions for Build resource. The keys must match the following
regular expression: ^_[A-Z0-9_]+$
.
ignored_files: Vec<String>
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: Vec<String>
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: String
Optional. A Common Expression Language string.
source_to_build: Option<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: String
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: Option<RepositoryEventConfig>
The configuration of a trigger that creates a build whenever an event from Repo API is received.
build_template: Option<BuildTemplate>
Template describing the Build request to make when the trigger is matched. At least one of the template fields must be provided.
Implementations§
Source§impl BuildTrigger
impl BuildTrigger
pub fn new() -> Self
Sourcepub fn set_resource_name<T: Into<String>>(self, v: T) -> Self
pub fn set_resource_name<T: Into<String>>(self, v: T) -> Self
Sets the value of resource_name.
Sourcepub fn set_description<T: Into<String>>(self, v: T) -> Self
pub fn set_description<T: Into<String>>(self, v: T) -> Self
Sets the value of description.
Sets the value of tags.
Sourcepub fn set_trigger_template<T>(self, v: T) -> Selfwhere
T: Into<RepoSource>,
pub fn set_trigger_template<T>(self, v: T) -> Selfwhere
T: Into<RepoSource>,
Sets the value of trigger_template.
Sourcepub fn set_or_clear_trigger_template<T>(self, v: Option<T>) -> Selfwhere
T: Into<RepoSource>,
pub fn set_or_clear_trigger_template<T>(self, v: Option<T>) -> Selfwhere
T: Into<RepoSource>,
Sets or clears the value of trigger_template.
Sourcepub fn set_github<T>(self, v: T) -> Selfwhere
T: Into<GitHubEventsConfig>,
pub fn set_github<T>(self, v: T) -> Selfwhere
T: Into<GitHubEventsConfig>,
Sets the value of github.
Sourcepub fn set_or_clear_github<T>(self, v: Option<T>) -> Selfwhere
T: Into<GitHubEventsConfig>,
pub fn set_or_clear_github<T>(self, v: Option<T>) -> Selfwhere
T: Into<GitHubEventsConfig>,
Sets or clears the value of github.
Sourcepub fn set_pubsub_config<T>(self, v: T) -> Selfwhere
T: Into<PubsubConfig>,
pub fn set_pubsub_config<T>(self, v: T) -> Selfwhere
T: Into<PubsubConfig>,
Sets the value of pubsub_config.
Sourcepub fn set_or_clear_pubsub_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<PubsubConfig>,
pub fn set_or_clear_pubsub_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<PubsubConfig>,
Sets or clears the value of pubsub_config.
Sourcepub fn set_webhook_config<T>(self, v: T) -> Selfwhere
T: Into<WebhookConfig>,
pub fn set_webhook_config<T>(self, v: T) -> Selfwhere
T: Into<WebhookConfig>,
Sets the value of webhook_config.
Sourcepub fn set_or_clear_webhook_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<WebhookConfig>,
pub fn set_or_clear_webhook_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<WebhookConfig>,
Sets or clears the value of webhook_config.
Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
Sourcepub fn set_disabled<T: Into<bool>>(self, v: T) -> Self
pub fn set_disabled<T: Into<bool>>(self, v: T) -> Self
Sets the value of disabled.
Sourcepub fn set_substitutions<T, K, V>(self, v: T) -> Self
pub fn set_substitutions<T, K, V>(self, v: T) -> Self
Sets the value of substitutions.
Sourcepub fn set_ignored_files<T, V>(self, v: T) -> Self
pub fn set_ignored_files<T, V>(self, v: T) -> Self
Sets the value of ignored_files.
Sourcepub fn set_included_files<T, V>(self, v: T) -> Self
pub fn set_included_files<T, V>(self, v: T) -> Self
Sets the value of included_files.
Sourcepub fn set_filter<T: Into<String>>(self, v: T) -> Self
pub fn set_filter<T: Into<String>>(self, v: T) -> Self
Sets the value of filter.
Sourcepub fn set_source_to_build<T>(self, v: T) -> Selfwhere
T: Into<GitRepoSource>,
pub fn set_source_to_build<T>(self, v: T) -> Selfwhere
T: Into<GitRepoSource>,
Sets the value of source_to_build.
Sourcepub fn set_or_clear_source_to_build<T>(self, v: Option<T>) -> Selfwhere
T: Into<GitRepoSource>,
pub fn set_or_clear_source_to_build<T>(self, v: Option<T>) -> Selfwhere
T: Into<GitRepoSource>,
Sets or clears the value of source_to_build.
Sourcepub fn set_service_account<T: Into<String>>(self, v: T) -> Self
pub fn set_service_account<T: Into<String>>(self, v: T) -> Self
Sets the value of service_account.
Sourcepub fn set_repository_event_config<T>(self, v: T) -> Selfwhere
T: Into<RepositoryEventConfig>,
pub fn set_repository_event_config<T>(self, v: T) -> Selfwhere
T: Into<RepositoryEventConfig>,
Sets the value of repository_event_config.
Sourcepub fn set_or_clear_repository_event_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<RepositoryEventConfig>,
pub fn set_or_clear_repository_event_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<RepositoryEventConfig>,
Sets or clears the value of repository_event_config.
Sourcepub fn set_build_template<T: Into<Option<BuildTemplate>>>(self, v: T) -> Self
pub fn set_build_template<T: Into<Option<BuildTemplate>>>(self, v: T) -> Self
Sets the value of build_template.
Note that all the setters affecting build_template
are mutually
exclusive.
Sourcepub fn autodetect(&self) -> Option<&bool>
pub fn autodetect(&self) -> Option<&bool>
The value of build_template
if it holds a Autodetect
, None
if the field is not set or
holds a different branch.
Sourcepub fn set_autodetect<T: Into<bool>>(self, v: T) -> Self
pub fn set_autodetect<T: Into<bool>>(self, v: T) -> Self
Sets the value of build_template
to hold a Autodetect
.
Note that all the setters affecting build_template
are
mutually exclusive.
Sourcepub fn build(&self) -> Option<&Box<Build>>
pub fn build(&self) -> Option<&Box<Build>>
The value of build_template
if it holds a Build
, None
if the field is not set or
holds a different branch.
Sourcepub fn set_build<T: Into<Box<Build>>>(self, v: T) -> Self
pub fn set_build<T: Into<Box<Build>>>(self, v: T) -> Self
Sets the value of build_template
to hold a Build
.
Note that all the setters affecting build_template
are
mutually exclusive.
Sourcepub fn filename(&self) -> Option<&String>
pub fn filename(&self) -> Option<&String>
The value of build_template
if it holds a Filename
, None
if the field is not set or
holds a different branch.
Sourcepub fn set_filename<T: Into<String>>(self, v: T) -> Self
pub fn set_filename<T: Into<String>>(self, v: T) -> Self
Sets the value of build_template
to hold a Filename
.
Note that all the setters affecting build_template
are
mutually exclusive.
Sourcepub fn git_file_source(&self) -> Option<&Box<GitFileSource>>
pub fn git_file_source(&self) -> Option<&Box<GitFileSource>>
The value of build_template
if it holds a GitFileSource
, None
if the field is not set or
holds a different branch.
Sourcepub fn set_git_file_source<T: Into<Box<GitFileSource>>>(self, v: T) -> Self
pub fn set_git_file_source<T: Into<Box<GitFileSource>>>(self, v: T) -> Self
Sets the value of build_template
to hold a GitFileSource
.
Note that all the setters affecting build_template
are
mutually exclusive.
Trait Implementations§
Source§impl Clone for BuildTrigger
impl Clone for BuildTrigger
Source§fn clone(&self) -> BuildTrigger
fn clone(&self) -> BuildTrigger
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more