#[non_exhaustive]pub struct GitFileSource {
pub path: String,
pub uri: String,
pub repo_type: RepoType,
pub revision: String,
pub source: Option<Source>,
pub enterprise_config: Option<EnterpriseConfig>,
/* private fields */
}Expand description
GitFileSource describes a file within a (possibly remote) code repository.
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.path: StringThe path of the file, with the repo root as the root of the path.
uri: StringThe URI of the repo. Either uri or repository can be specified. If unspecified, the repo from which the trigger invocation originated is assumed to be the repo from which to read the specified path.
repo_type: RepoTypeSee RepoType above.
revision: StringThe branch, tag, arbitrary ref, or SHA version of the repo to use when resolving the filename (optional). This field respects the same syntax/resolution as described here: https://git-scm.com/docs/gitrevisions If unspecified, the revision from which the trigger invocation originated is assumed to be the revision from which to read the specified path.
source: Option<Source>The source of the SCM repo.
enterprise_config: Option<EnterpriseConfig>The resource name of the enterprise config that should be applied to this source.
Implementations§
Source§impl GitFileSource
impl GitFileSource
pub fn new() -> Self
Sourcepub fn set_repo_type<T: Into<RepoType>>(self, v: T) -> Self
pub fn set_repo_type<T: Into<RepoType>>(self, v: T) -> Self
Sets the value of repo_type.
§Example
use google_cloud_build_v1::model::git_file_source::RepoType;
let x0 = GitFileSource::new().set_repo_type(RepoType::CloudSourceRepositories);
let x1 = GitFileSource::new().set_repo_type(RepoType::Github);
let x2 = GitFileSource::new().set_repo_type(RepoType::BitbucketServer);Sourcepub fn set_revision<T: Into<String>>(self, v: T) -> Self
pub fn set_revision<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_source<T: Into<Option<Source>>>(self, v: T) -> Self
pub fn set_source<T: Into<Option<Source>>>(self, v: T) -> Self
Sourcepub fn repository(&self) -> Option<&String>
pub fn repository(&self) -> Option<&String>
The value of source
if it holds a Repository, None if the field is not set or
holds a different branch.
Sourcepub fn set_repository<T: Into<String>>(self, v: T) -> Self
pub fn set_repository<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_enterprise_config<T: Into<Option<EnterpriseConfig>>>(
self,
v: T,
) -> Self
pub fn set_enterprise_config<T: Into<Option<EnterpriseConfig>>>( self, v: T, ) -> Self
Sets the value of enterprise_config.
Note that all the setters affecting enterprise_config are mutually
exclusive.
§Example
use google_cloud_build_v1::model::git_file_source::EnterpriseConfig;
let x = GitFileSource::new().set_enterprise_config(Some(EnterpriseConfig::GithubEnterpriseConfig("example".to_string())));Sourcepub fn github_enterprise_config(&self) -> Option<&String>
pub fn github_enterprise_config(&self) -> Option<&String>
The value of enterprise_config
if it holds a GithubEnterpriseConfig, None if the field is not set or
holds a different branch.
Sourcepub fn set_github_enterprise_config<T: Into<String>>(self, v: T) -> Self
pub fn set_github_enterprise_config<T: Into<String>>(self, v: T) -> Self
Sets the value of enterprise_config
to hold a GithubEnterpriseConfig.
Note that all the setters affecting enterprise_config are
mutually exclusive.
§Example
let x = GitFileSource::new().set_github_enterprise_config("example");
assert!(x.github_enterprise_config().is_some());Trait Implementations§
Source§impl Clone for GitFileSource
impl Clone for GitFileSource
Source§fn clone(&self) -> GitFileSource
fn clone(&self) -> GitFileSource
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more