#[non_exhaustive]pub struct GitRepoSource {
pub uri: String,
pub ref: String,
pub repo_type: RepoType,
pub source: Option<Source>,
pub enterprise_config: Option<EnterpriseConfig>,
/* private fields */
}Expand description
GitRepoSource describes a repo and ref of a 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.uri: StringThe URI of the repo (e.g. https://github.com/user/repo.git).
Either uri or repository can be specified and is required.
ref: StringThe branch or tag to use. Must start with “refs/” (required).
repo_type: RepoTypeSee RepoType below.
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 GitRepoSource
impl GitRepoSource
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 = GitRepoSource::new().set_repo_type(RepoType::CloudSourceRepositories);
let x1 = GitRepoSource::new().set_repo_type(RepoType::Github);
let x2 = GitRepoSource::new().set_repo_type(RepoType::BitbucketServer);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_repo_source::EnterpriseConfig;
let x = GitRepoSource::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 = GitRepoSource::new().set_github_enterprise_config("example");
assert!(x.github_enterprise_config().is_some());Trait Implementations§
Source§impl Clone for GitRepoSource
impl Clone for GitRepoSource
Source§fn clone(&self) -> GitRepoSource
fn clone(&self) -> GitRepoSource
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more