#[non_exhaustive]pub struct RepositoryEventConfig {
pub repository: String,
pub repository_type: RepositoryType,
pub filter: Option<Filter>,
/* private fields */
}Expand description
The configuration of a trigger that creates a build whenever an event from Repo API is received.
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.repository: StringThe resource name of the Repo API resource.
repository_type: RepositoryTypeOutput only. The type of the SCM vendor the repository points to.
filter: Option<Filter>The types of filter to trigger a build.
Implementations§
Source§impl RepositoryEventConfig
impl RepositoryEventConfig
pub fn new() -> Self
Sourcepub fn set_repository<T: Into<String>>(self, v: T) -> Self
pub fn set_repository<T: Into<String>>(self, v: T) -> Self
Sets the value of repository.
§Example
let x = RepositoryEventConfig::new().set_repository("example");Sourcepub fn set_repository_type<T: Into<RepositoryType>>(self, v: T) -> Self
pub fn set_repository_type<T: Into<RepositoryType>>(self, v: T) -> Self
Sets the value of repository_type.
§Example
use google_cloud_build_v1::model::repository_event_config::RepositoryType;
let x0 = RepositoryEventConfig::new().set_repository_type(RepositoryType::Github);
let x1 = RepositoryEventConfig::new().set_repository_type(RepositoryType::GithubEnterprise);
let x2 = RepositoryEventConfig::new().set_repository_type(RepositoryType::GitlabEnterprise);Sourcepub fn set_filter<T: Into<Option<Filter>>>(self, v: T) -> Self
pub fn set_filter<T: Into<Option<Filter>>>(self, v: T) -> Self
Sets the value of filter.
Note that all the setters affecting filter are mutually
exclusive.
§Example
use google_cloud_build_v1::model::PullRequestFilter;
let x = RepositoryEventConfig::new().set_filter(Some(
google_cloud_build_v1::model::repository_event_config::Filter::PullRequest(PullRequestFilter::default().into())));Sourcepub fn pull_request(&self) -> Option<&Box<PullRequestFilter>>
pub fn pull_request(&self) -> Option<&Box<PullRequestFilter>>
The value of filter
if it holds a PullRequest, None if the field is not set or
holds a different branch.
Sourcepub fn set_pull_request<T: Into<Box<PullRequestFilter>>>(self, v: T) -> Self
pub fn set_pull_request<T: Into<Box<PullRequestFilter>>>(self, v: T) -> Self
Sets the value of filter
to hold a PullRequest.
Note that all the setters affecting filter are
mutually exclusive.
§Example
use google_cloud_build_v1::model::PullRequestFilter;
let x = RepositoryEventConfig::new().set_pull_request(PullRequestFilter::default()/* use setters */);
assert!(x.pull_request().is_some());
assert!(x.push().is_none());Sourcepub fn push(&self) -> Option<&Box<PushFilter>>
pub fn push(&self) -> Option<&Box<PushFilter>>
The value of filter
if it holds a Push, None if the field is not set or
holds a different branch.
Sourcepub fn set_push<T: Into<Box<PushFilter>>>(self, v: T) -> Self
pub fn set_push<T: Into<Box<PushFilter>>>(self, v: T) -> Self
Sets the value of filter
to hold a Push.
Note that all the setters affecting filter are
mutually exclusive.
§Example
use google_cloud_build_v1::model::PushFilter;
let x = RepositoryEventConfig::new().set_push(PushFilter::default()/* use setters */);
assert!(x.push().is_some());
assert!(x.pull_request().is_none());Trait Implementations§
Source§impl Clone for RepositoryEventConfig
impl Clone for RepositoryEventConfig
Source§fn clone(&self) -> RepositoryEventConfig
fn clone(&self) -> RepositoryEventConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more