1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
// This file is @generated by prost-build.
/// A SourceContext is a reference to a tree of files. A SourceContext together
/// with a path point to a unique revision of a single file or directory.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SourceContext {
/// A SourceContext can refer any one of the following types of repositories.
#[prost(oneof = "source_context::Context", tags = "1, 2, 3, 6")]
pub context: ::core::option::Option<source_context::Context>,
}
/// Nested message and enum types in `SourceContext`.
pub mod source_context {
/// A SourceContext can refer any one of the following types of repositories.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Context {
/// A SourceContext referring to a revision in a cloud repo.
#[prost(message, tag = "1")]
CloudRepo(super::CloudRepoSourceContext),
/// A SourceContext referring to a snapshot in a cloud workspace.
#[prost(message, tag = "2")]
CloudWorkspace(super::CloudWorkspaceSourceContext),
/// A SourceContext referring to a Gerrit project.
#[prost(message, tag = "3")]
Gerrit(super::GerritSourceContext),
/// A SourceContext referring to any third party Git repo (e.g. GitHub).
#[prost(message, tag = "6")]
Git(super::GitSourceContext),
}
}
/// An ExtendedSourceContext is a SourceContext combined with additional
/// details describing the context.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExtendedSourceContext {
/// Any source context.
#[prost(message, optional, tag = "1")]
pub context: ::core::option::Option<SourceContext>,
/// Labels with user defined metadata.
#[prost(btree_map = "string, string", tag = "2")]
pub labels: ::prost::alloc::collections::BTreeMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
/// An alias to a repo revision.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AliasContext {
/// The alias kind.
#[prost(enumeration = "alias_context::Kind", tag = "1")]
pub kind: i32,
/// The alias name.
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}
/// Nested message and enum types in `AliasContext`.
pub mod alias_context {
/// The type of an Alias.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Kind {
/// Do not use.
Any = 0,
/// Git tag
Fixed = 1,
/// Git branch
Movable = 2,
/// OTHER is used to specify non-standard aliases, those not of the kinds
/// above. For example, if a Git repo has a ref named "refs/foo/bar", it
/// is considered to be of kind OTHER.
Other = 4,
}
impl Kind {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Kind::Any => "ANY",
Kind::Fixed => "FIXED",
Kind::Movable => "MOVABLE",
Kind::Other => "OTHER",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ANY" => Some(Self::Any),
"FIXED" => Some(Self::Fixed),
"MOVABLE" => Some(Self::Movable),
"OTHER" => Some(Self::Other),
_ => None,
}
}
}
}
/// A CloudRepoSourceContext denotes a particular revision in a cloud
/// repo (a repo hosted by the Google Cloud Platform).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CloudRepoSourceContext {
/// The ID of the repo.
#[prost(message, optional, tag = "1")]
pub repo_id: ::core::option::Option<RepoId>,
/// A revision in a cloud repository can be identified by either its revision
/// ID or its Alias.
#[prost(oneof = "cloud_repo_source_context::Revision", tags = "2, 3, 4")]
pub revision: ::core::option::Option<cloud_repo_source_context::Revision>,
}
/// Nested message and enum types in `CloudRepoSourceContext`.
pub mod cloud_repo_source_context {
/// A revision in a cloud repository can be identified by either its revision
/// ID or its Alias.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Revision {
/// A revision ID.
#[prost(string, tag = "2")]
RevisionId(::prost::alloc::string::String),
/// The name of an alias (branch, tag, etc.).
#[prost(string, tag = "3")]
AliasName(::prost::alloc::string::String),
/// An alias, which may be a branch or tag.
#[prost(message, tag = "4")]
AliasContext(super::AliasContext),
}
}
/// A CloudWorkspaceSourceContext denotes a workspace at a particular snapshot.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CloudWorkspaceSourceContext {
/// The ID of the workspace.
#[prost(message, optional, tag = "1")]
pub workspace_id: ::core::option::Option<CloudWorkspaceId>,
/// The ID of the snapshot.
/// An empty snapshot_id refers to the most recent snapshot.
#[prost(string, tag = "2")]
pub snapshot_id: ::prost::alloc::string::String,
}
/// A SourceContext referring to a Gerrit project.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GerritSourceContext {
/// The URI of a running Gerrit instance.
#[prost(string, tag = "1")]
pub host_uri: ::prost::alloc::string::String,
/// The full project name within the host. Projects may be nested, so
/// "project/subproject" is a valid project name.
/// The "repo name" is hostURI/project.
#[prost(string, tag = "2")]
pub gerrit_project: ::prost::alloc::string::String,
/// A revision in a Gerrit project can be identified by either its revision ID
/// or its alias.
#[prost(oneof = "gerrit_source_context::Revision", tags = "3, 4, 5")]
pub revision: ::core::option::Option<gerrit_source_context::Revision>,
}
/// Nested message and enum types in `GerritSourceContext`.
pub mod gerrit_source_context {
/// A revision in a Gerrit project can be identified by either its revision ID
/// or its alias.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Revision {
/// A revision (commit) ID.
#[prost(string, tag = "3")]
RevisionId(::prost::alloc::string::String),
/// The name of an alias (branch, tag, etc.).
#[prost(string, tag = "4")]
AliasName(::prost::alloc::string::String),
/// An alias, which may be a branch or tag.
#[prost(message, tag = "5")]
AliasContext(super::AliasContext),
}
}
/// A GitSourceContext denotes a particular revision in a third party Git
/// repository (e.g. GitHub).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GitSourceContext {
/// Git repository URL.
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
/// Git commit hash.
/// required.
#[prost(string, tag = "2")]
pub revision_id: ::prost::alloc::string::String,
}
/// A unique identifier for a cloud repo.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RepoId {
/// A cloud repository can be identified by either its project ID and
/// repository name combination, or its globally unique identifier.
#[prost(oneof = "repo_id::Id", tags = "1, 2")]
pub id: ::core::option::Option<repo_id::Id>,
}
/// Nested message and enum types in `RepoId`.
pub mod repo_id {
/// A cloud repository can be identified by either its project ID and
/// repository name combination, or its globally unique identifier.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Id {
/// A combination of a project ID and a repo name.
#[prost(message, tag = "1")]
ProjectRepoId(super::ProjectRepoId),
/// A server-assigned, globally unique identifier.
#[prost(string, tag = "2")]
Uid(::prost::alloc::string::String),
}
}
/// Selects a repo using a Google Cloud Platform project ID
/// (e.g. winged-cargo-31) and a repo name within that project.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProjectRepoId {
/// The ID of the project.
#[prost(string, tag = "1")]
pub project_id: ::prost::alloc::string::String,
/// The name of the repo. Leave empty for the default repo.
#[prost(string, tag = "2")]
pub repo_name: ::prost::alloc::string::String,
}
/// A CloudWorkspaceId is a unique identifier for a cloud workspace.
/// A cloud workspace is a place associated with a repo where modified files
/// can be stored before they are committed.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CloudWorkspaceId {
/// The ID of the repo containing the workspace.
#[prost(message, optional, tag = "1")]
pub repo_id: ::core::option::Option<RepoId>,
/// The unique name of the workspace within the repo. This is the name
/// chosen by the client in the Source API's CreateWorkspace method.
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}