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