1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct Skill {
4 #[prost(string, tag = "1")]
5 pub skill_rid: ::prost::alloc::string::String,
6 #[prost(string, tag = "2")]
7 pub workspace_rid: ::prost::alloc::string::String,
8 #[prost(message, optional, tag = "3")]
9 pub backing: ::core::option::Option<SkillBacking>,
10 #[prost(enumeration = "SkillState", tag = "4")]
11 pub state: i32,
12 #[prost(message, optional, tag = "5")]
13 pub created: ::core::option::Option<super::super::file_store::v1::Attribution>,
14 #[prost(message, optional, tag = "6")]
15 pub updated: ::core::option::Option<super::super::file_store::v1::Attribution>,
16 #[prost(uint64, tag = "7")]
17 pub version: u64,
18 #[prost(message, optional, tag = "8")]
19 pub last_known: ::core::option::Option<SkillSnapshot>,
20}
21#[derive(Clone, PartialEq, ::prost::Message)]
22pub struct SkillBacking {
23 #[prost(oneof = "skill_backing::Source", tags = "1")]
24 pub source: ::core::option::Option<skill_backing::Source>,
25}
26pub mod skill_backing {
28 #[derive(Clone, PartialEq, ::prost::Oneof)]
29 pub enum Source {
30 #[prost(message, tag = "1")]
31 FileStore(super::FileStoreSkillBacking),
32 }
33}
34#[derive(Clone, PartialEq, ::prost::Message)]
35pub struct FileStoreSkillBacking {
36 #[prost(message, optional, tag = "1")]
37 pub entry_file_identity: ::core::option::Option<
38 super::super::file_store::v1::LogicalFileIdentity,
39 >,
40 #[prost(string, tag = "2")]
41 pub drive_rid: ::prost::alloc::string::String,
42 #[prost(message, optional, tag = "3")]
43 pub entry_path: ::core::option::Option<super::super::file_store::v1::LogicalPath>,
44}
45#[derive(Clone, PartialEq, ::prost::Message)]
46pub struct SkillSnapshot {
47 #[prost(string, optional, tag = "1")]
48 pub name: ::core::option::Option<::prost::alloc::string::String>,
49 #[prost(string, optional, tag = "2")]
50 pub description: ::core::option::Option<::prost::alloc::string::String>,
51 #[prost(string, tag = "3")]
52 pub file_revision_rid: ::prost::alloc::string::String,
53}
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct CreateSkillRequest {
56 #[prost(message, optional, tag = "1")]
57 pub skill: ::core::option::Option<Skill>,
58}
59#[derive(Clone, PartialEq, ::prost::Message)]
60pub struct CreateSkillResponse {
61 #[prost(message, optional, tag = "1")]
62 pub skill: ::core::option::Option<Skill>,
63}
64#[derive(Clone, PartialEq, ::prost::Message)]
65pub struct GetSkillRequest {
66 #[prost(string, tag = "1")]
67 pub skill_rid: ::prost::alloc::string::String,
68}
69#[derive(Clone, PartialEq, ::prost::Message)]
70pub struct GetSkillResponse {
71 #[prost(message, optional, tag = "1")]
72 pub skill: ::core::option::Option<Skill>,
73}
74#[derive(Clone, PartialEq, ::prost::Message)]
75pub struct SearchSkillsRequest {
76 #[prost(string, tag = "1")]
77 pub workspace_rid: ::prost::alloc::string::String,
78 #[prost(message, optional, tag = "2")]
79 pub filter: ::core::option::Option<SkillSearchFilter>,
80 #[prost(enumeration = "SkillLibrarySort", tag = "3")]
81 pub sort: i32,
82 #[prost(int32, optional, tag = "4")]
83 pub page_size: ::core::option::Option<i32>,
84 #[prost(string, optional, tag = "5")]
85 pub page_token: ::core::option::Option<::prost::alloc::string::String>,
86}
87#[derive(Clone, PartialEq, ::prost::Message)]
88pub struct SkillSearchFilter {
89 #[prost(string, optional, tag = "1")]
90 pub text: ::core::option::Option<::prost::alloc::string::String>,
91 #[prost(enumeration = "SkillState", repeated, packed = "false", tag = "2")]
92 pub states: ::prost::alloc::vec::Vec<i32>,
93}
94#[derive(Clone, PartialEq, ::prost::Message)]
95pub struct SearchSkillsResponse {
96 #[prost(message, repeated, tag = "1")]
97 pub skills: ::prost::alloc::vec::Vec<Skill>,
98 #[prost(string, optional, tag = "2")]
99 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
100 #[prost(bool, tag = "3")]
101 pub partial: bool,
102}
103#[derive(Clone, PartialEq, ::prost::Message)]
104pub struct UpdateSkillRequest {
105 #[prost(message, optional, tag = "1")]
106 pub skill: ::core::option::Option<Skill>,
107 #[prost(message, optional, tag = "2")]
108 pub update_mask: ::core::option::Option<
109 super::super::super::google::protobuf::FieldMask,
110 >,
111 #[prost(uint64, tag = "3")]
112 pub expected_version: u64,
113}
114#[derive(Clone, PartialEq, ::prost::Message)]
115pub struct UpdateSkillResponse {
116 #[prost(message, optional, tag = "1")]
117 pub skill: ::core::option::Option<Skill>,
118}
119#[derive(Clone, PartialEq, ::prost::Message)]
120pub struct GetSkillBackingStatusRequest {
121 #[prost(string, tag = "1")]
122 pub skill_rid: ::prost::alloc::string::String,
123}
124#[derive(Clone, PartialEq, ::prost::Message)]
125pub struct GetSkillBackingStatusResponse {
126 #[prost(enumeration = "SkillBackingStatus", tag = "1")]
127 pub status: i32,
128 #[prost(message, optional, tag = "2")]
129 pub observed_snapshot: ::core::option::Option<SkillSnapshot>,
130}
131#[derive(Clone, PartialEq, ::prost::Message)]
132pub struct WorkspaceSkillsDrive {
133 #[prost(string, tag = "1")]
134 pub workspace_rid: ::prost::alloc::string::String,
135 #[prost(message, optional, tag = "2")]
136 pub drive: ::core::option::Option<super::super::file_store::v1::Drive>,
137}
138#[derive(Clone, PartialEq, ::prost::Message)]
139pub struct UpdateWorkspaceSkillsDriveRequest {
140 #[prost(message, optional, tag = "1")]
141 pub skills_drive: ::core::option::Option<WorkspaceSkillsDrive>,
142}
143#[derive(Clone, PartialEq, ::prost::Message)]
144pub struct UpdateWorkspaceSkillsDriveResponse {
145 #[prost(message, optional, tag = "1")]
146 pub skills_drive: ::core::option::Option<WorkspaceSkillsDrive>,
147}
148#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
149#[repr(i32)]
150pub enum SkillState {
151 Unspecified = 0,
152 Draft = 1,
153 Enabled = 2,
154 Disabled = 3,
155 Archived = 4,
156}
157impl SkillState {
158 pub fn as_str_name(&self) -> &'static str {
163 match self {
164 Self::Unspecified => "SKILL_STATE_UNSPECIFIED",
165 Self::Draft => "SKILL_STATE_DRAFT",
166 Self::Enabled => "SKILL_STATE_ENABLED",
167 Self::Disabled => "SKILL_STATE_DISABLED",
168 Self::Archived => "SKILL_STATE_ARCHIVED",
169 }
170 }
171 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
173 match value {
174 "SKILL_STATE_UNSPECIFIED" => Some(Self::Unspecified),
175 "SKILL_STATE_DRAFT" => Some(Self::Draft),
176 "SKILL_STATE_ENABLED" => Some(Self::Enabled),
177 "SKILL_STATE_DISABLED" => Some(Self::Disabled),
178 "SKILL_STATE_ARCHIVED" => Some(Self::Archived),
179 _ => None,
180 }
181 }
182}
183#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
184#[repr(i32)]
185pub enum SkillLibrarySort {
186 Unspecified = 0,
187 UpdatedDesc = 1,
188 NameAsc = 2,
189 NameDesc = 3,
190}
191impl SkillLibrarySort {
192 pub fn as_str_name(&self) -> &'static str {
197 match self {
198 Self::Unspecified => "SKILL_LIBRARY_SORT_UNSPECIFIED",
199 Self::UpdatedDesc => "SKILL_LIBRARY_SORT_UPDATED_DESC",
200 Self::NameAsc => "SKILL_LIBRARY_SORT_NAME_ASC",
201 Self::NameDesc => "SKILL_LIBRARY_SORT_NAME_DESC",
202 }
203 }
204 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
206 match value {
207 "SKILL_LIBRARY_SORT_UNSPECIFIED" => Some(Self::Unspecified),
208 "SKILL_LIBRARY_SORT_UPDATED_DESC" => Some(Self::UpdatedDesc),
209 "SKILL_LIBRARY_SORT_NAME_ASC" => Some(Self::NameAsc),
210 "SKILL_LIBRARY_SORT_NAME_DESC" => Some(Self::NameDesc),
211 _ => None,
212 }
213 }
214}
215#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
216#[repr(i32)]
217pub enum SkillBackingStatus {
218 Unspecified = 0,
219 Available = 1,
220 Invalid = 2,
221 Missing = 3,
222 Unavailable = 4,
223}
224impl SkillBackingStatus {
225 pub fn as_str_name(&self) -> &'static str {
230 match self {
231 Self::Unspecified => "SKILL_BACKING_STATUS_UNSPECIFIED",
232 Self::Available => "SKILL_BACKING_STATUS_AVAILABLE",
233 Self::Invalid => "SKILL_BACKING_STATUS_INVALID",
234 Self::Missing => "SKILL_BACKING_STATUS_MISSING",
235 Self::Unavailable => "SKILL_BACKING_STATUS_UNAVAILABLE",
236 }
237 }
238 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
240 match value {
241 "SKILL_BACKING_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
242 "SKILL_BACKING_STATUS_AVAILABLE" => Some(Self::Available),
243 "SKILL_BACKING_STATUS_INVALID" => Some(Self::Invalid),
244 "SKILL_BACKING_STATUS_MISSING" => Some(Self::Missing),
245 "SKILL_BACKING_STATUS_UNAVAILABLE" => Some(Self::Unavailable),
246 _ => None,
247 }
248 }
249}
250#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
251#[repr(i32)]
252pub enum SkillError {
253 Unspecified = 0,
254 SkillNotFound = 1,
255 SkillAlreadyExists = 2,
256 VersionConflict = 3,
257 SkillsDriveUnavailable = 4,
258}
259impl SkillError {
260 pub fn as_str_name(&self) -> &'static str {
265 match self {
266 Self::Unspecified => "SKILL_ERROR_UNSPECIFIED",
267 Self::SkillNotFound => "SKILL_ERROR_SKILL_NOT_FOUND",
268 Self::SkillAlreadyExists => "SKILL_ERROR_SKILL_ALREADY_EXISTS",
269 Self::VersionConflict => "SKILL_ERROR_VERSION_CONFLICT",
270 Self::SkillsDriveUnavailable => "SKILL_ERROR_SKILLS_DRIVE_UNAVAILABLE",
271 }
272 }
273 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
275 match value {
276 "SKILL_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
277 "SKILL_ERROR_SKILL_NOT_FOUND" => Some(Self::SkillNotFound),
278 "SKILL_ERROR_SKILL_ALREADY_EXISTS" => Some(Self::SkillAlreadyExists),
279 "SKILL_ERROR_VERSION_CONFLICT" => Some(Self::VersionConflict),
280 "SKILL_ERROR_SKILLS_DRIVE_UNAVAILABLE" => Some(Self::SkillsDriveUnavailable),
281 _ => None,
282 }
283 }
284}
285pub mod skills_service_client {
287 #![allow(
288 unused_variables,
289 dead_code,
290 missing_docs,
291 clippy::wildcard_imports,
292 clippy::let_unit_value,
293 )]
294 use tonic::codegen::*;
295 use tonic::codegen::http::Uri;
296 #[derive(Debug, Clone)]
297 pub struct SkillsServiceClient<T> {
298 inner: tonic::client::Grpc<T>,
299 }
300 impl SkillsServiceClient<tonic::transport::Channel> {
301 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
303 where
304 D: TryInto<tonic::transport::Endpoint>,
305 D::Error: Into<StdError>,
306 {
307 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
308 Ok(Self::new(conn))
309 }
310 }
311 impl<T> SkillsServiceClient<T>
312 where
313 T: tonic::client::GrpcService<tonic::body::Body>,
314 T::Error: Into<StdError>,
315 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
316 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
317 {
318 pub fn new(inner: T) -> Self {
319 let inner = tonic::client::Grpc::new(inner);
320 Self { inner }
321 }
322 pub fn with_origin(inner: T, origin: Uri) -> Self {
323 let inner = tonic::client::Grpc::with_origin(inner, origin);
324 Self { inner }
325 }
326 pub fn with_interceptor<F>(
327 inner: T,
328 interceptor: F,
329 ) -> SkillsServiceClient<InterceptedService<T, F>>
330 where
331 F: tonic::service::Interceptor,
332 T::ResponseBody: Default,
333 T: tonic::codegen::Service<
334 http::Request<tonic::body::Body>,
335 Response = http::Response<
336 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
337 >,
338 >,
339 <T as tonic::codegen::Service<
340 http::Request<tonic::body::Body>,
341 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
342 {
343 SkillsServiceClient::new(InterceptedService::new(inner, interceptor))
344 }
345 #[must_use]
350 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
351 self.inner = self.inner.send_compressed(encoding);
352 self
353 }
354 #[must_use]
356 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
357 self.inner = self.inner.accept_compressed(encoding);
358 self
359 }
360 #[must_use]
364 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
365 self.inner = self.inner.max_decoding_message_size(limit);
366 self
367 }
368 #[must_use]
372 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
373 self.inner = self.inner.max_encoding_message_size(limit);
374 self
375 }
376 pub async fn create_skill(
377 &mut self,
378 request: impl tonic::IntoRequest<super::CreateSkillRequest>,
379 ) -> std::result::Result<
380 tonic::Response<super::CreateSkillResponse>,
381 tonic::Status,
382 > {
383 self.inner
384 .ready()
385 .await
386 .map_err(|e| {
387 tonic::Status::unknown(
388 format!("Service was not ready: {}", e.into()),
389 )
390 })?;
391 let codec = tonic::codec::ProstCodec::default();
392 let path = http::uri::PathAndQuery::from_static(
393 "/nominal.skills.v1.SkillsService/CreateSkill",
394 );
395 let mut req = request.into_request();
396 req.extensions_mut()
397 .insert(
398 GrpcMethod::new("nominal.skills.v1.SkillsService", "CreateSkill"),
399 );
400 self.inner.unary(req, path, codec).await
401 }
402 pub async fn get_skill(
403 &mut self,
404 request: impl tonic::IntoRequest<super::GetSkillRequest>,
405 ) -> std::result::Result<
406 tonic::Response<super::GetSkillResponse>,
407 tonic::Status,
408 > {
409 self.inner
410 .ready()
411 .await
412 .map_err(|e| {
413 tonic::Status::unknown(
414 format!("Service was not ready: {}", e.into()),
415 )
416 })?;
417 let codec = tonic::codec::ProstCodec::default();
418 let path = http::uri::PathAndQuery::from_static(
419 "/nominal.skills.v1.SkillsService/GetSkill",
420 );
421 let mut req = request.into_request();
422 req.extensions_mut()
423 .insert(GrpcMethod::new("nominal.skills.v1.SkillsService", "GetSkill"));
424 self.inner.unary(req, path, codec).await
425 }
426 pub async fn search_skills(
427 &mut self,
428 request: impl tonic::IntoRequest<super::SearchSkillsRequest>,
429 ) -> std::result::Result<
430 tonic::Response<super::SearchSkillsResponse>,
431 tonic::Status,
432 > {
433 self.inner
434 .ready()
435 .await
436 .map_err(|e| {
437 tonic::Status::unknown(
438 format!("Service was not ready: {}", e.into()),
439 )
440 })?;
441 let codec = tonic::codec::ProstCodec::default();
442 let path = http::uri::PathAndQuery::from_static(
443 "/nominal.skills.v1.SkillsService/SearchSkills",
444 );
445 let mut req = request.into_request();
446 req.extensions_mut()
447 .insert(
448 GrpcMethod::new("nominal.skills.v1.SkillsService", "SearchSkills"),
449 );
450 self.inner.unary(req, path, codec).await
451 }
452 pub async fn update_skill(
453 &mut self,
454 request: impl tonic::IntoRequest<super::UpdateSkillRequest>,
455 ) -> std::result::Result<
456 tonic::Response<super::UpdateSkillResponse>,
457 tonic::Status,
458 > {
459 self.inner
460 .ready()
461 .await
462 .map_err(|e| {
463 tonic::Status::unknown(
464 format!("Service was not ready: {}", e.into()),
465 )
466 })?;
467 let codec = tonic::codec::ProstCodec::default();
468 let path = http::uri::PathAndQuery::from_static(
469 "/nominal.skills.v1.SkillsService/UpdateSkill",
470 );
471 let mut req = request.into_request();
472 req.extensions_mut()
473 .insert(
474 GrpcMethod::new("nominal.skills.v1.SkillsService", "UpdateSkill"),
475 );
476 self.inner.unary(req, path, codec).await
477 }
478 pub async fn get_skill_backing_status(
479 &mut self,
480 request: impl tonic::IntoRequest<super::GetSkillBackingStatusRequest>,
481 ) -> std::result::Result<
482 tonic::Response<super::GetSkillBackingStatusResponse>,
483 tonic::Status,
484 > {
485 self.inner
486 .ready()
487 .await
488 .map_err(|e| {
489 tonic::Status::unknown(
490 format!("Service was not ready: {}", e.into()),
491 )
492 })?;
493 let codec = tonic::codec::ProstCodec::default();
494 let path = http::uri::PathAndQuery::from_static(
495 "/nominal.skills.v1.SkillsService/GetSkillBackingStatus",
496 );
497 let mut req = request.into_request();
498 req.extensions_mut()
499 .insert(
500 GrpcMethod::new(
501 "nominal.skills.v1.SkillsService",
502 "GetSkillBackingStatus",
503 ),
504 );
505 self.inner.unary(req, path, codec).await
506 }
507 pub async fn update_workspace_skills_drive(
508 &mut self,
509 request: impl tonic::IntoRequest<super::UpdateWorkspaceSkillsDriveRequest>,
510 ) -> std::result::Result<
511 tonic::Response<super::UpdateWorkspaceSkillsDriveResponse>,
512 tonic::Status,
513 > {
514 self.inner
515 .ready()
516 .await
517 .map_err(|e| {
518 tonic::Status::unknown(
519 format!("Service was not ready: {}", e.into()),
520 )
521 })?;
522 let codec = tonic::codec::ProstCodec::default();
523 let path = http::uri::PathAndQuery::from_static(
524 "/nominal.skills.v1.SkillsService/UpdateWorkspaceSkillsDrive",
525 );
526 let mut req = request.into_request();
527 req.extensions_mut()
528 .insert(
529 GrpcMethod::new(
530 "nominal.skills.v1.SkillsService",
531 "UpdateWorkspaceSkillsDrive",
532 ),
533 );
534 self.inner.unary(req, path, codec).await
535 }
536 }
537}