#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Skill {
#[prost(string, tag = "1")]
pub skill_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub backing: ::core::option::Option<SkillBacking>,
#[prost(enumeration = "SkillState", tag = "4")]
pub state: i32,
#[prost(message, optional, tag = "5")]
pub created: ::core::option::Option<super::super::file_store::v1::Attribution>,
#[prost(message, optional, tag = "6")]
pub updated: ::core::option::Option<super::super::file_store::v1::Attribution>,
#[prost(uint64, tag = "7")]
pub version: u64,
#[prost(message, optional, tag = "8")]
pub last_known: ::core::option::Option<SkillSnapshot>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SkillBacking {
#[prost(oneof = "skill_backing::Source", tags = "1")]
pub source: ::core::option::Option<skill_backing::Source>,
}
pub mod skill_backing {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Source {
#[prost(message, tag = "1")]
FileStore(super::FileStoreSkillBacking),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileStoreSkillBacking {
#[prost(message, optional, tag = "1")]
pub entry_file_identity: ::core::option::Option<
super::super::file_store::v1::LogicalFileIdentity,
>,
#[prost(string, tag = "2")]
pub drive_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub entry_path: ::core::option::Option<super::super::file_store::v1::LogicalPath>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SkillSnapshot {
#[prost(string, optional, tag = "1")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag = "3")]
pub file_revision_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSkillRequest {
#[prost(message, optional, tag = "1")]
pub skill: ::core::option::Option<Skill>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSkillResponse {
#[prost(message, optional, tag = "1")]
pub skill: ::core::option::Option<Skill>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSkillRequest {
#[prost(string, tag = "1")]
pub skill_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSkillResponse {
#[prost(message, optional, tag = "1")]
pub skill: ::core::option::Option<Skill>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchSkillsRequest {
#[prost(string, tag = "1")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub filter: ::core::option::Option<SkillSearchFilter>,
#[prost(enumeration = "SkillLibrarySort", tag = "3")]
pub sort: i32,
#[prost(int32, optional, tag = "4")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, optional, tag = "5")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SkillSearchFilter {
#[prost(string, optional, tag = "1")]
pub text: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "SkillState", repeated, packed = "false", tag = "2")]
pub states: ::prost::alloc::vec::Vec<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchSkillsResponse {
#[prost(message, repeated, tag = "1")]
pub skills: ::prost::alloc::vec::Vec<Skill>,
#[prost(string, optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bool, tag = "3")]
pub partial: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateSkillRequest {
#[prost(message, optional, tag = "1")]
pub skill: ::core::option::Option<Skill>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<
super::super::super::google::protobuf::FieldMask,
>,
#[prost(uint64, tag = "3")]
pub expected_version: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateSkillResponse {
#[prost(message, optional, tag = "1")]
pub skill: ::core::option::Option<Skill>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSkillBackingStatusRequest {
#[prost(string, tag = "1")]
pub skill_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSkillBackingStatusResponse {
#[prost(enumeration = "SkillBackingStatus", tag = "1")]
pub status: i32,
#[prost(message, optional, tag = "2")]
pub observed_snapshot: ::core::option::Option<SkillSnapshot>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkspaceSkillsDrive {
#[prost(string, tag = "1")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub drive: ::core::option::Option<super::super::file_store::v1::Drive>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateWorkspaceSkillsDriveRequest {
#[prost(message, optional, tag = "1")]
pub skills_drive: ::core::option::Option<WorkspaceSkillsDrive>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateWorkspaceSkillsDriveResponse {
#[prost(message, optional, tag = "1")]
pub skills_drive: ::core::option::Option<WorkspaceSkillsDrive>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SkillState {
Unspecified = 0,
Draft = 1,
Enabled = 2,
Disabled = 3,
Archived = 4,
}
impl SkillState {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SKILL_STATE_UNSPECIFIED",
Self::Draft => "SKILL_STATE_DRAFT",
Self::Enabled => "SKILL_STATE_ENABLED",
Self::Disabled => "SKILL_STATE_DISABLED",
Self::Archived => "SKILL_STATE_ARCHIVED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SKILL_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"SKILL_STATE_DRAFT" => Some(Self::Draft),
"SKILL_STATE_ENABLED" => Some(Self::Enabled),
"SKILL_STATE_DISABLED" => Some(Self::Disabled),
"SKILL_STATE_ARCHIVED" => Some(Self::Archived),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SkillLibrarySort {
Unspecified = 0,
UpdatedDesc = 1,
NameAsc = 2,
NameDesc = 3,
}
impl SkillLibrarySort {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SKILL_LIBRARY_SORT_UNSPECIFIED",
Self::UpdatedDesc => "SKILL_LIBRARY_SORT_UPDATED_DESC",
Self::NameAsc => "SKILL_LIBRARY_SORT_NAME_ASC",
Self::NameDesc => "SKILL_LIBRARY_SORT_NAME_DESC",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SKILL_LIBRARY_SORT_UNSPECIFIED" => Some(Self::Unspecified),
"SKILL_LIBRARY_SORT_UPDATED_DESC" => Some(Self::UpdatedDesc),
"SKILL_LIBRARY_SORT_NAME_ASC" => Some(Self::NameAsc),
"SKILL_LIBRARY_SORT_NAME_DESC" => Some(Self::NameDesc),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SkillBackingStatus {
Unspecified = 0,
Available = 1,
Invalid = 2,
Missing = 3,
Unavailable = 4,
}
impl SkillBackingStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SKILL_BACKING_STATUS_UNSPECIFIED",
Self::Available => "SKILL_BACKING_STATUS_AVAILABLE",
Self::Invalid => "SKILL_BACKING_STATUS_INVALID",
Self::Missing => "SKILL_BACKING_STATUS_MISSING",
Self::Unavailable => "SKILL_BACKING_STATUS_UNAVAILABLE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SKILL_BACKING_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"SKILL_BACKING_STATUS_AVAILABLE" => Some(Self::Available),
"SKILL_BACKING_STATUS_INVALID" => Some(Self::Invalid),
"SKILL_BACKING_STATUS_MISSING" => Some(Self::Missing),
"SKILL_BACKING_STATUS_UNAVAILABLE" => Some(Self::Unavailable),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SkillError {
Unspecified = 0,
SkillNotFound = 1,
SkillAlreadyExists = 2,
VersionConflict = 3,
SkillsDriveUnavailable = 4,
}
impl SkillError {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SKILL_ERROR_UNSPECIFIED",
Self::SkillNotFound => "SKILL_ERROR_SKILL_NOT_FOUND",
Self::SkillAlreadyExists => "SKILL_ERROR_SKILL_ALREADY_EXISTS",
Self::VersionConflict => "SKILL_ERROR_VERSION_CONFLICT",
Self::SkillsDriveUnavailable => "SKILL_ERROR_SKILLS_DRIVE_UNAVAILABLE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SKILL_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
"SKILL_ERROR_SKILL_NOT_FOUND" => Some(Self::SkillNotFound),
"SKILL_ERROR_SKILL_ALREADY_EXISTS" => Some(Self::SkillAlreadyExists),
"SKILL_ERROR_VERSION_CONFLICT" => Some(Self::VersionConflict),
"SKILL_ERROR_SKILLS_DRIVE_UNAVAILABLE" => Some(Self::SkillsDriveUnavailable),
_ => None,
}
}
}
pub mod skills_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct SkillsServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SkillsServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> SkillsServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> SkillsServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
SkillsServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn create_skill(
&mut self,
request: impl tonic::IntoRequest<super::CreateSkillRequest>,
) -> std::result::Result<
tonic::Response<super::CreateSkillResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.skills.v1.SkillsService/CreateSkill",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.skills.v1.SkillsService", "CreateSkill"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_skill(
&mut self,
request: impl tonic::IntoRequest<super::GetSkillRequest>,
) -> std::result::Result<
tonic::Response<super::GetSkillResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.skills.v1.SkillsService/GetSkill",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("nominal.skills.v1.SkillsService", "GetSkill"));
self.inner.unary(req, path, codec).await
}
pub async fn search_skills(
&mut self,
request: impl tonic::IntoRequest<super::SearchSkillsRequest>,
) -> std::result::Result<
tonic::Response<super::SearchSkillsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.skills.v1.SkillsService/SearchSkills",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.skills.v1.SkillsService", "SearchSkills"),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_skill(
&mut self,
request: impl tonic::IntoRequest<super::UpdateSkillRequest>,
) -> std::result::Result<
tonic::Response<super::UpdateSkillResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.skills.v1.SkillsService/UpdateSkill",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.skills.v1.SkillsService", "UpdateSkill"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_skill_backing_status(
&mut self,
request: impl tonic::IntoRequest<super::GetSkillBackingStatusRequest>,
) -> std::result::Result<
tonic::Response<super::GetSkillBackingStatusResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.skills.v1.SkillsService/GetSkillBackingStatus",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.skills.v1.SkillsService",
"GetSkillBackingStatus",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_workspace_skills_drive(
&mut self,
request: impl tonic::IntoRequest<super::UpdateWorkspaceSkillsDriveRequest>,
) -> std::result::Result<
tonic::Response<super::UpdateWorkspaceSkillsDriveResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.skills.v1.SkillsService/UpdateWorkspaceSkillsDrive",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.skills.v1.SkillsService",
"UpdateWorkspaceSkillsDrive",
),
);
self.inner.unary(req, path, codec).await
}
}
}