mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
workspace crud
This commit is contained in:
@ -19,6 +19,7 @@ diesel = {version = "1.4.7", features = ["sqlite"]}
|
||||
diesel_derives = {version = "1.4.1", features = ["sqlite"]}
|
||||
futures-core = { version = "0.3", default-features = false }
|
||||
pin-project = "1.0.0"
|
||||
flowy-net = { path = "../flowy-net" }
|
||||
|
||||
lazy_static = "1.4.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
|
@ -3,7 +3,7 @@ pub use workspace_query::*;
|
||||
pub use workspace_update::*;
|
||||
pub use workspace_user_detail::*;
|
||||
|
||||
pub(crate) mod parser;
|
||||
pub mod parser;
|
||||
mod workspace_create;
|
||||
mod workspace_delete;
|
||||
mod workspace_query;
|
||||
|
@ -15,9 +15,16 @@ pub struct CreateWorkspaceRequest {
|
||||
pub desc: String,
|
||||
}
|
||||
|
||||
#[derive(ProtoBuf, Default)]
|
||||
pub struct CreateWorkspaceParams {
|
||||
#[pb(index = 1)]
|
||||
pub name: String,
|
||||
|
||||
#[pb(index = 2)]
|
||||
pub desc: String,
|
||||
|
||||
#[pb(index = 3, one_of)]
|
||||
pub user_id: Option<String>,
|
||||
}
|
||||
|
||||
impl TryInto<CreateWorkspaceParams> for CreateWorkspaceRequest {
|
||||
@ -33,6 +40,7 @@ impl TryInto<CreateWorkspaceParams> for CreateWorkspaceRequest {
|
||||
Ok(CreateWorkspaceParams {
|
||||
name: name.0,
|
||||
desc: self.desc,
|
||||
user_id: None,
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -52,6 +60,17 @@ pub struct Workspace {
|
||||
pub apps: RepeatedApp,
|
||||
}
|
||||
|
||||
impl Workspace {
|
||||
pub fn new(id: String, name: String, desc: String) -> Self {
|
||||
Self {
|
||||
id,
|
||||
name,
|
||||
desc,
|
||||
apps: RepeatedApp::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Debug, Default, ProtoBuf)]
|
||||
pub struct Workspaces {
|
||||
#[pb(index = 1)]
|
||||
|
@ -11,7 +11,9 @@ pub struct DeleteWorkspaceRequest {
|
||||
workspace_id: String,
|
||||
}
|
||||
|
||||
#[derive(ProtoBuf, Default)]
|
||||
pub struct DeleteWorkspaceParams {
|
||||
#[pb(index = 1)]
|
||||
workspace_id: String,
|
||||
}
|
||||
|
||||
|
@ -11,8 +11,12 @@ pub struct QueryWorkspaceRequest {
|
||||
pub read_apps: bool,
|
||||
}
|
||||
|
||||
#[derive(ProtoBuf, Default)]
|
||||
pub struct QueryWorkspaceParams {
|
||||
#[pb(index = 1)]
|
||||
pub workspace_id: String,
|
||||
|
||||
#[pb(index = 2)]
|
||||
pub read_apps: bool,
|
||||
}
|
||||
|
||||
|
@ -16,9 +16,15 @@ pub struct UpdateWorkspaceRequest {
|
||||
desc: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(ProtoBuf, Default)]
|
||||
pub struct UpdateWorkspaceParams {
|
||||
#[pb(index = 1)]
|
||||
pub id: String,
|
||||
|
||||
#[pb(index = 2, one_of)]
|
||||
pub name: Option<String>,
|
||||
|
||||
#[pb(index = 3, one_of)]
|
||||
pub desc: Option<String>,
|
||||
}
|
||||
|
||||
|
@ -65,12 +65,23 @@ pub enum WsErrCode {
|
||||
|
||||
#[display(fmt = "User not login yet")]
|
||||
UserNotLoginYet = 103,
|
||||
|
||||
#[display(fmt = "Server error")]
|
||||
ServerError = 1000,
|
||||
}
|
||||
|
||||
impl std::default::Default for WsErrCode {
|
||||
fn default() -> Self { WsErrCode::Unknown }
|
||||
}
|
||||
|
||||
impl std::convert::From<flowy_net::errors::ServerError> for WorkspaceError {
|
||||
fn from(error: flowy_net::errors::ServerError) -> Self {
|
||||
ErrorBuilder::new(WsErrCode::ServerError)
|
||||
.error(error.msg)
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::From<flowy_database::result::Error> for WorkspaceError {
|
||||
fn from(error: flowy_database::result::Error) -> Self {
|
||||
ErrorBuilder::new(WsErrCode::WorkspaceDatabaseError)
|
||||
|
@ -1,15 +1,16 @@
|
||||
mod handlers;
|
||||
mod observable;
|
||||
mod services;
|
||||
mod sql_tables;
|
||||
|
||||
pub mod entities;
|
||||
pub mod errors;
|
||||
pub mod event;
|
||||
mod handlers;
|
||||
pub mod module;
|
||||
mod sql_tables;
|
||||
pub mod protobuf;
|
||||
|
||||
#[macro_use]
|
||||
mod macros;
|
||||
mod observable;
|
||||
mod protobuf;
|
||||
mod services;
|
||||
|
||||
#[macro_use]
|
||||
extern crate flowy_database;
|
||||
@ -18,5 +19,10 @@ extern crate flowy_database;
|
||||
// extern crate flowy_dispatch;
|
||||
|
||||
pub mod prelude {
|
||||
pub use crate::{errors::*, module::*, services::*};
|
||||
pub use crate::{
|
||||
entities::{app::*, view::*, workspace::*},
|
||||
errors::*,
|
||||
module::*,
|
||||
services::*,
|
||||
};
|
||||
}
|
||||
|
@ -229,6 +229,7 @@ pub enum WsErrCode {
|
||||
WorkspaceDatabaseError = 101,
|
||||
UserInternalError = 102,
|
||||
UserNotLoginYet = 103,
|
||||
ServerError = 1000,
|
||||
}
|
||||
|
||||
impl ::protobuf::ProtobufEnum for WsErrCode {
|
||||
@ -252,6 +253,7 @@ impl ::protobuf::ProtobufEnum for WsErrCode {
|
||||
101 => ::std::option::Option::Some(WsErrCode::WorkspaceDatabaseError),
|
||||
102 => ::std::option::Option::Some(WsErrCode::UserInternalError),
|
||||
103 => ::std::option::Option::Some(WsErrCode::UserNotLoginYet),
|
||||
1000 => ::std::option::Option::Some(WsErrCode::ServerError),
|
||||
_ => ::std::option::Option::None
|
||||
}
|
||||
}
|
||||
@ -272,6 +274,7 @@ impl ::protobuf::ProtobufEnum for WsErrCode {
|
||||
WsErrCode::WorkspaceDatabaseError,
|
||||
WsErrCode::UserInternalError,
|
||||
WsErrCode::UserNotLoginYet,
|
||||
WsErrCode::ServerError,
|
||||
];
|
||||
values
|
||||
}
|
||||
@ -302,51 +305,53 @@ impl ::protobuf::reflect::ProtobufValue for WsErrCode {
|
||||
static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\n\x0cerrors.proto\"B\n\x0eWorkspaceError\x12\x1e\n\x04code\x18\x01\x20\
|
||||
\x01(\x0e2\n.WsErrCodeR\x04code\x12\x10\n\x03msg\x18\x02\x20\x01(\tR\x03\
|
||||
msg*\xc5\x02\n\tWsErrCode\x12\x0b\n\x07Unknown\x10\0\x12\x18\n\x14Worksp\
|
||||
msg*\xd7\x02\n\tWsErrCode\x12\x0b\n\x07Unknown\x10\0\x12\x18\n\x14Worksp\
|
||||
aceNameInvalid\x10\x01\x12\x16\n\x12WorkspaceIdInvalid\x10\x02\x12\x18\n\
|
||||
\x14AppColorStyleInvalid\x10\x03\x12\x10\n\x0cAppIdInvalid\x10\n\x12\x12\
|
||||
\n\x0eAppNameInvalid\x10\x0b\x12\x13\n\x0fViewNameInvalid\x10\x14\x12\
|
||||
\x18\n\x14ViewThumbnailInvalid\x10\x15\x12\x11\n\rViewIdInvalid\x10\x16\
|
||||
\x12\x13\n\x0fViewDescInvalid\x10\x17\x12\x1a\n\x16DatabaseConnectionFai\
|
||||
l\x10d\x12\x1a\n\x16WorkspaceDatabaseError\x10e\x12\x15\n\x11UserInterna\
|
||||
lError\x10f\x12\x13\n\x0fUserNotLoginYet\x10gJ\xee\x05\n\x06\x12\x04\0\0\
|
||||
\x15\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\
|
||||
\x05\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x16\n\x0b\n\x04\x04\0\x02\0\
|
||||
\x12\x03\x03\x04\x17\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\x03\x04\r\n\x0c\
|
||||
\n\x05\x04\0\x02\0\x01\x12\x03\x03\x0e\x12\n\x0c\n\x05\x04\0\x02\0\x03\
|
||||
\x12\x03\x03\x15\x16\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\x13\n\x0c\
|
||||
\n\x05\x04\0\x02\x01\x05\x12\x03\x04\x04\n\n\x0c\n\x05\x04\0\x02\x01\x01\
|
||||
\x12\x03\x04\x0b\x0e\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04\x11\x12\n\
|
||||
\n\n\x02\x05\0\x12\x04\x06\0\x15\x01\n\n\n\x03\x05\0\x01\x12\x03\x06\x05\
|
||||
\x0e\n\x0b\n\x04\x05\0\x02\0\x12\x03\x07\x04\x10\n\x0c\n\x05\x05\0\x02\0\
|
||||
\x01\x12\x03\x07\x04\x0b\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x07\x0e\x0f\
|
||||
\n\x0b\n\x04\x05\0\x02\x01\x12\x03\x08\x04\x1d\n\x0c\n\x05\x05\0\x02\x01\
|
||||
\x01\x12\x03\x08\x04\x18\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\x08\x1b\
|
||||
\x1c\n\x0b\n\x04\x05\0\x02\x02\x12\x03\t\x04\x1b\n\x0c\n\x05\x05\0\x02\
|
||||
\x02\x01\x12\x03\t\x04\x16\n\x0c\n\x05\x05\0\x02\x02\x02\x12\x03\t\x19\
|
||||
\x1a\n\x0b\n\x04\x05\0\x02\x03\x12\x03\n\x04\x1d\n\x0c\n\x05\x05\0\x02\
|
||||
\x03\x01\x12\x03\n\x04\x18\n\x0c\n\x05\x05\0\x02\x03\x02\x12\x03\n\x1b\
|
||||
\x1c\n\x0b\n\x04\x05\0\x02\x04\x12\x03\x0b\x04\x16\n\x0c\n\x05\x05\0\x02\
|
||||
\x04\x01\x12\x03\x0b\x04\x10\n\x0c\n\x05\x05\0\x02\x04\x02\x12\x03\x0b\
|
||||
\x13\x15\n\x0b\n\x04\x05\0\x02\x05\x12\x03\x0c\x04\x18\n\x0c\n\x05\x05\0\
|
||||
\x02\x05\x01\x12\x03\x0c\x04\x12\n\x0c\n\x05\x05\0\x02\x05\x02\x12\x03\
|
||||
\x0c\x15\x17\n\x0b\n\x04\x05\0\x02\x06\x12\x03\r\x04\x19\n\x0c\n\x05\x05\
|
||||
\0\x02\x06\x01\x12\x03\r\x04\x13\n\x0c\n\x05\x05\0\x02\x06\x02\x12\x03\r\
|
||||
\x16\x18\n\x0b\n\x04\x05\0\x02\x07\x12\x03\x0e\x04\x1e\n\x0c\n\x05\x05\0\
|
||||
\x02\x07\x01\x12\x03\x0e\x04\x18\n\x0c\n\x05\x05\0\x02\x07\x02\x12\x03\
|
||||
\x0e\x1b\x1d\n\x0b\n\x04\x05\0\x02\x08\x12\x03\x0f\x04\x17\n\x0c\n\x05\
|
||||
\x05\0\x02\x08\x01\x12\x03\x0f\x04\x11\n\x0c\n\x05\x05\0\x02\x08\x02\x12\
|
||||
\x03\x0f\x14\x16\n\x0b\n\x04\x05\0\x02\t\x12\x03\x10\x04\x19\n\x0c\n\x05\
|
||||
\x05\0\x02\t\x01\x12\x03\x10\x04\x13\n\x0c\n\x05\x05\0\x02\t\x02\x12\x03\
|
||||
\x10\x16\x18\n\x0b\n\x04\x05\0\x02\n\x12\x03\x11\x04!\n\x0c\n\x05\x05\0\
|
||||
\x02\n\x01\x12\x03\x11\x04\x1a\n\x0c\n\x05\x05\0\x02\n\x02\x12\x03\x11\
|
||||
\x1d\x20\n\x0b\n\x04\x05\0\x02\x0b\x12\x03\x12\x04!\n\x0c\n\x05\x05\0\
|
||||
\x02\x0b\x01\x12\x03\x12\x04\x1a\n\x0c\n\x05\x05\0\x02\x0b\x02\x12\x03\
|
||||
\x12\x1d\x20\n\x0b\n\x04\x05\0\x02\x0c\x12\x03\x13\x04\x1c\n\x0c\n\x05\
|
||||
\x05\0\x02\x0c\x01\x12\x03\x13\x04\x15\n\x0c\n\x05\x05\0\x02\x0c\x02\x12\
|
||||
\x03\x13\x18\x1b\n\x0b\n\x04\x05\0\x02\r\x12\x03\x14\x04\x1a\n\x0c\n\x05\
|
||||
\x05\0\x02\r\x01\x12\x03\x14\x04\x13\n\x0c\n\x05\x05\0\x02\r\x02\x12\x03\
|
||||
\x14\x16\x19b\x06proto3\
|
||||
lError\x10f\x12\x13\n\x0fUserNotLoginYet\x10g\x12\x10\n\x0bServerError\
|
||||
\x10\xe8\x07J\x97\x06\n\x06\x12\x04\0\0\x16\x01\n\x08\n\x01\x0c\x12\x03\
|
||||
\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x05\x01\n\n\n\x03\x04\0\x01\x12\
|
||||
\x03\x02\x08\x16\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\x17\n\x0c\n\x05\
|
||||
\x04\0\x02\0\x06\x12\x03\x03\x04\r\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\
|
||||
\x03\x0e\x12\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x15\x16\n\x0b\n\x04\
|
||||
\x04\0\x02\x01\x12\x03\x04\x04\x13\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\
|
||||
\x04\x04\n\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x04\x0b\x0e\n\x0c\n\x05\
|
||||
\x04\0\x02\x01\x03\x12\x03\x04\x11\x12\n\n\n\x02\x05\0\x12\x04\x06\0\x16\
|
||||
\x01\n\n\n\x03\x05\0\x01\x12\x03\x06\x05\x0e\n\x0b\n\x04\x05\0\x02\0\x12\
|
||||
\x03\x07\x04\x10\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x07\x04\x0b\n\x0c\n\
|
||||
\x05\x05\0\x02\0\x02\x12\x03\x07\x0e\x0f\n\x0b\n\x04\x05\0\x02\x01\x12\
|
||||
\x03\x08\x04\x1d\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x08\x04\x18\n\x0c\
|
||||
\n\x05\x05\0\x02\x01\x02\x12\x03\x08\x1b\x1c\n\x0b\n\x04\x05\0\x02\x02\
|
||||
\x12\x03\t\x04\x1b\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\t\x04\x16\n\x0c\
|
||||
\n\x05\x05\0\x02\x02\x02\x12\x03\t\x19\x1a\n\x0b\n\x04\x05\0\x02\x03\x12\
|
||||
\x03\n\x04\x1d\n\x0c\n\x05\x05\0\x02\x03\x01\x12\x03\n\x04\x18\n\x0c\n\
|
||||
\x05\x05\0\x02\x03\x02\x12\x03\n\x1b\x1c\n\x0b\n\x04\x05\0\x02\x04\x12\
|
||||
\x03\x0b\x04\x16\n\x0c\n\x05\x05\0\x02\x04\x01\x12\x03\x0b\x04\x10\n\x0c\
|
||||
\n\x05\x05\0\x02\x04\x02\x12\x03\x0b\x13\x15\n\x0b\n\x04\x05\0\x02\x05\
|
||||
\x12\x03\x0c\x04\x18\n\x0c\n\x05\x05\0\x02\x05\x01\x12\x03\x0c\x04\x12\n\
|
||||
\x0c\n\x05\x05\0\x02\x05\x02\x12\x03\x0c\x15\x17\n\x0b\n\x04\x05\0\x02\
|
||||
\x06\x12\x03\r\x04\x19\n\x0c\n\x05\x05\0\x02\x06\x01\x12\x03\r\x04\x13\n\
|
||||
\x0c\n\x05\x05\0\x02\x06\x02\x12\x03\r\x16\x18\n\x0b\n\x04\x05\0\x02\x07\
|
||||
\x12\x03\x0e\x04\x1e\n\x0c\n\x05\x05\0\x02\x07\x01\x12\x03\x0e\x04\x18\n\
|
||||
\x0c\n\x05\x05\0\x02\x07\x02\x12\x03\x0e\x1b\x1d\n\x0b\n\x04\x05\0\x02\
|
||||
\x08\x12\x03\x0f\x04\x17\n\x0c\n\x05\x05\0\x02\x08\x01\x12\x03\x0f\x04\
|
||||
\x11\n\x0c\n\x05\x05\0\x02\x08\x02\x12\x03\x0f\x14\x16\n\x0b\n\x04\x05\0\
|
||||
\x02\t\x12\x03\x10\x04\x19\n\x0c\n\x05\x05\0\x02\t\x01\x12\x03\x10\x04\
|
||||
\x13\n\x0c\n\x05\x05\0\x02\t\x02\x12\x03\x10\x16\x18\n\x0b\n\x04\x05\0\
|
||||
\x02\n\x12\x03\x11\x04!\n\x0c\n\x05\x05\0\x02\n\x01\x12\x03\x11\x04\x1a\
|
||||
\n\x0c\n\x05\x05\0\x02\n\x02\x12\x03\x11\x1d\x20\n\x0b\n\x04\x05\0\x02\
|
||||
\x0b\x12\x03\x12\x04!\n\x0c\n\x05\x05\0\x02\x0b\x01\x12\x03\x12\x04\x1a\
|
||||
\n\x0c\n\x05\x05\0\x02\x0b\x02\x12\x03\x12\x1d\x20\n\x0b\n\x04\x05\0\x02\
|
||||
\x0c\x12\x03\x13\x04\x1c\n\x0c\n\x05\x05\0\x02\x0c\x01\x12\x03\x13\x04\
|
||||
\x15\n\x0c\n\x05\x05\0\x02\x0c\x02\x12\x03\x13\x18\x1b\n\x0b\n\x04\x05\0\
|
||||
\x02\r\x12\x03\x14\x04\x1a\n\x0c\n\x05\x05\0\x02\r\x01\x12\x03\x14\x04\
|
||||
\x13\n\x0c\n\x05\x05\0\x02\r\x02\x12\x03\x14\x16\x19\n\x0b\n\x04\x05\0\
|
||||
\x02\x0e\x12\x03\x15\x04\x17\n\x0c\n\x05\x05\0\x02\x0e\x01\x12\x03\x15\
|
||||
\x04\x0f\n\x0c\n\x05\x05\0\x02\x0e\x02\x12\x03\x15\x12\x16b\x06proto3\
|
||||
";
|
||||
|
||||
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
||||
|
@ -224,6 +224,289 @@ impl ::protobuf::reflect::ProtobufValue for CreateWorkspaceRequest {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct CreateWorkspaceParams {
|
||||
// message fields
|
||||
pub name: ::std::string::String,
|
||||
pub desc: ::std::string::String,
|
||||
// message oneof groups
|
||||
pub one_of_user_id: ::std::option::Option<CreateWorkspaceParams_oneof_one_of_user_id>,
|
||||
// special fields
|
||||
pub unknown_fields: ::protobuf::UnknownFields,
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a CreateWorkspaceParams {
|
||||
fn default() -> &'a CreateWorkspaceParams {
|
||||
<CreateWorkspaceParams as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone,PartialEq,Debug)]
|
||||
pub enum CreateWorkspaceParams_oneof_one_of_user_id {
|
||||
user_id(::std::string::String),
|
||||
}
|
||||
|
||||
impl CreateWorkspaceParams {
|
||||
pub fn new() -> CreateWorkspaceParams {
|
||||
::std::default::Default::default()
|
||||
}
|
||||
|
||||
// string name = 1;
|
||||
|
||||
|
||||
pub fn get_name(&self) -> &str {
|
||||
&self.name
|
||||
}
|
||||
pub fn clear_name(&mut self) {
|
||||
self.name.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_name(&mut self, v: ::std::string::String) {
|
||||
self.name = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_name(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.name
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_name(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.name, ::std::string::String::new())
|
||||
}
|
||||
|
||||
// string desc = 2;
|
||||
|
||||
|
||||
pub fn get_desc(&self) -> &str {
|
||||
&self.desc
|
||||
}
|
||||
pub fn clear_desc(&mut self) {
|
||||
self.desc.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_desc(&mut self, v: ::std::string::String) {
|
||||
self.desc = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_desc(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.desc
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_desc(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.desc, ::std::string::String::new())
|
||||
}
|
||||
|
||||
// string user_id = 3;
|
||||
|
||||
|
||||
pub fn get_user_id(&self) -> &str {
|
||||
match self.one_of_user_id {
|
||||
::std::option::Option::Some(CreateWorkspaceParams_oneof_one_of_user_id::user_id(ref v)) => v,
|
||||
_ => "",
|
||||
}
|
||||
}
|
||||
pub fn clear_user_id(&mut self) {
|
||||
self.one_of_user_id = ::std::option::Option::None;
|
||||
}
|
||||
|
||||
pub fn has_user_id(&self) -> bool {
|
||||
match self.one_of_user_id {
|
||||
::std::option::Option::Some(CreateWorkspaceParams_oneof_one_of_user_id::user_id(..)) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_user_id(&mut self, v: ::std::string::String) {
|
||||
self.one_of_user_id = ::std::option::Option::Some(CreateWorkspaceParams_oneof_one_of_user_id::user_id(v))
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
pub fn mut_user_id(&mut self) -> &mut ::std::string::String {
|
||||
if let ::std::option::Option::Some(CreateWorkspaceParams_oneof_one_of_user_id::user_id(_)) = self.one_of_user_id {
|
||||
} else {
|
||||
self.one_of_user_id = ::std::option::Option::Some(CreateWorkspaceParams_oneof_one_of_user_id::user_id(::std::string::String::new()));
|
||||
}
|
||||
match self.one_of_user_id {
|
||||
::std::option::Option::Some(CreateWorkspaceParams_oneof_one_of_user_id::user_id(ref mut v)) => v,
|
||||
_ => panic!(),
|
||||
}
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_user_id(&mut self) -> ::std::string::String {
|
||||
if self.has_user_id() {
|
||||
match self.one_of_user_id.take() {
|
||||
::std::option::Option::Some(CreateWorkspaceParams_oneof_one_of_user_id::user_id(v)) => v,
|
||||
_ => panic!(),
|
||||
}
|
||||
} else {
|
||||
::std::string::String::new()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for CreateWorkspaceParams {
|
||||
fn is_initialized(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
while !is.eof()? {
|
||||
let (field_number, wire_type) = is.read_tag_unpack()?;
|
||||
match field_number {
|
||||
1 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
|
||||
},
|
||||
2 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.desc)?;
|
||||
},
|
||||
3 => {
|
||||
if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
|
||||
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
|
||||
}
|
||||
self.one_of_user_id = ::std::option::Option::Some(CreateWorkspaceParams_oneof_one_of_user_id::user_id(is.read_string()?));
|
||||
},
|
||||
_ => {
|
||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||
},
|
||||
};
|
||||
}
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
// Compute sizes of nested messages
|
||||
#[allow(unused_variables)]
|
||||
fn compute_size(&self) -> u32 {
|
||||
let mut my_size = 0;
|
||||
if !self.name.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(1, &self.name);
|
||||
}
|
||||
if !self.desc.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(2, &self.desc);
|
||||
}
|
||||
if let ::std::option::Option::Some(ref v) = self.one_of_user_id {
|
||||
match v {
|
||||
&CreateWorkspaceParams_oneof_one_of_user_id::user_id(ref v) => {
|
||||
my_size += ::protobuf::rt::string_size(3, &v);
|
||||
},
|
||||
};
|
||||
}
|
||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||
self.cached_size.set(my_size);
|
||||
my_size
|
||||
}
|
||||
|
||||
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
if !self.name.is_empty() {
|
||||
os.write_string(1, &self.name)?;
|
||||
}
|
||||
if !self.desc.is_empty() {
|
||||
os.write_string(2, &self.desc)?;
|
||||
}
|
||||
if let ::std::option::Option::Some(ref v) = self.one_of_user_id {
|
||||
match v {
|
||||
&CreateWorkspaceParams_oneof_one_of_user_id::user_id(ref v) => {
|
||||
os.write_string(3, v)?;
|
||||
},
|
||||
};
|
||||
}
|
||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
fn get_cached_size(&self) -> u32 {
|
||||
self.cached_size.get()
|
||||
}
|
||||
|
||||
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
|
||||
&self.unknown_fields
|
||||
}
|
||||
|
||||
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
|
||||
&mut self.unknown_fields
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn (::std::any::Any) {
|
||||
self as &dyn (::std::any::Any)
|
||||
}
|
||||
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
|
||||
self as &mut dyn (::std::any::Any)
|
||||
}
|
||||
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
|
||||
self
|
||||
}
|
||||
|
||||
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
Self::descriptor_static()
|
||||
}
|
||||
|
||||
fn new() -> CreateWorkspaceParams {
|
||||
CreateWorkspaceParams::new()
|
||||
}
|
||||
|
||||
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
|
||||
descriptor.get(|| {
|
||||
let mut fields = ::std::vec::Vec::new();
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"name",
|
||||
|m: &CreateWorkspaceParams| { &m.name },
|
||||
|m: &mut CreateWorkspaceParams| { &mut m.name },
|
||||
));
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"desc",
|
||||
|m: &CreateWorkspaceParams| { &m.desc },
|
||||
|m: &mut CreateWorkspaceParams| { &mut m.desc },
|
||||
));
|
||||
fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
|
||||
"user_id",
|
||||
CreateWorkspaceParams::has_user_id,
|
||||
CreateWorkspaceParams::get_user_id,
|
||||
));
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateWorkspaceParams>(
|
||||
"CreateWorkspaceParams",
|
||||
fields,
|
||||
file_descriptor_proto()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn default_instance() -> &'static CreateWorkspaceParams {
|
||||
static instance: ::protobuf::rt::LazyV2<CreateWorkspaceParams> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(CreateWorkspaceParams::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Clear for CreateWorkspaceParams {
|
||||
fn clear(&mut self) {
|
||||
self.name.clear();
|
||||
self.desc.clear();
|
||||
self.one_of_user_id = ::std::option::Option::None;
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for CreateWorkspaceParams {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||
::protobuf::text_format::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for CreateWorkspaceParams {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
|
||||
::protobuf::reflect::ReflectValueRef::Message(self)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct Workspace {
|
||||
// message fields
|
||||
@ -693,36 +976,49 @@ impl ::protobuf::reflect::ProtobufValue for Workspaces {
|
||||
static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\n\x16workspace_create.proto\x1a\x10app_create.proto\"@\n\x16CreateWorks\
|
||||
paceRequest\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x12\x12\n\x04d\
|
||||
esc\x18\x02\x20\x01(\tR\x04desc\"e\n\tWorkspace\x12\x0e\n\x02id\x18\x01\
|
||||
\x20\x01(\tR\x02id\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\x12\
|
||||
\n\x04desc\x18\x03\x20\x01(\tR\x04desc\x12\x20\n\x04apps\x18\x04\x20\x01\
|
||||
(\x0b2\x0c.RepeatedAppR\x04apps\".\n\nWorkspaces\x12\x20\n\x05items\x18\
|
||||
\x01\x20\x03(\x0b2\n.WorkspaceR\x05itemsJ\xf4\x03\n\x06\x12\x04\0\0\x0f\
|
||||
\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\t\n\x02\x03\0\x12\x03\x01\0\x1a\n\
|
||||
\n\n\x02\x04\0\x12\x04\x03\0\x06\x01\n\n\n\x03\x04\0\x01\x12\x03\x03\x08\
|
||||
\x1e\n\x0b\n\x04\x04\0\x02\0\x12\x03\x04\x04\x14\n\x0c\n\x05\x04\0\x02\0\
|
||||
\x05\x12\x03\x04\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x04\x0b\x0f\n\
|
||||
\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x04\x12\x13\n\x0b\n\x04\x04\0\x02\x01\
|
||||
\x12\x03\x05\x04\x14\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x05\x04\n\n\
|
||||
\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x05\x0b\x0f\n\x0c\n\x05\x04\0\x02\
|
||||
\x01\x03\x12\x03\x05\x12\x13\n\n\n\x02\x04\x01\x12\x04\x07\0\x0c\x01\n\n\
|
||||
\n\x03\x04\x01\x01\x12\x03\x07\x08\x11\n\x0b\n\x04\x04\x01\x02\0\x12\x03\
|
||||
\x08\x04\x12\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x08\x04\n\n\x0c\n\x05\
|
||||
\x04\x01\x02\0\x01\x12\x03\x08\x0b\r\n\x0c\n\x05\x04\x01\x02\0\x03\x12\
|
||||
\x03\x08\x10\x11\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\t\x04\x14\n\x0c\n\
|
||||
\x05\x04\x01\x02\x01\x05\x12\x03\t\x04\n\n\x0c\n\x05\x04\x01\x02\x01\x01\
|
||||
\x12\x03\t\x0b\x0f\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\t\x12\x13\n\
|
||||
\x0b\n\x04\x04\x01\x02\x02\x12\x03\n\x04\x14\n\x0c\n\x05\x04\x01\x02\x02\
|
||||
\x05\x12\x03\n\x04\n\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\n\x0b\x0f\n\
|
||||
\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03\n\x12\x13\n\x0b\n\x04\x04\x01\x02\
|
||||
\x03\x12\x03\x0b\x04\x19\n\x0c\n\x05\x04\x01\x02\x03\x06\x12\x03\x0b\x04\
|
||||
\x0f\n\x0c\n\x05\x04\x01\x02\x03\x01\x12\x03\x0b\x10\x14\n\x0c\n\x05\x04\
|
||||
\x01\x02\x03\x03\x12\x03\x0b\x17\x18\n\n\n\x02\x04\x02\x12\x04\r\0\x0f\
|
||||
\x01\n\n\n\x03\x04\x02\x01\x12\x03\r\x08\x12\n\x0b\n\x04\x04\x02\x02\0\
|
||||
\x12\x03\x0e\x04!\n\x0c\n\x05\x04\x02\x02\0\x04\x12\x03\x0e\x04\x0c\n\
|
||||
\x0c\n\x05\x04\x02\x02\0\x06\x12\x03\x0e\r\x16\n\x0c\n\x05\x04\x02\x02\0\
|
||||
\x01\x12\x03\x0e\x17\x1c\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\x0e\x1f\
|
||||
\x20b\x06proto3\
|
||||
esc\x18\x02\x20\x01(\tR\x04desc\"l\n\x15CreateWorkspaceParams\x12\x12\n\
|
||||
\x04name\x18\x01\x20\x01(\tR\x04name\x12\x12\n\x04desc\x18\x02\x20\x01(\
|
||||
\tR\x04desc\x12\x19\n\x07user_id\x18\x03\x20\x01(\tH\0R\x06userIdB\x10\n\
|
||||
\x0eone_of_user_id\"e\n\tWorkspace\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\
|
||||
\x02id\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\x12\n\x04desc\
|
||||
\x18\x03\x20\x01(\tR\x04desc\x12\x20\n\x04apps\x18\x04\x20\x01(\x0b2\x0c\
|
||||
.RepeatedAppR\x04apps\".\n\nWorkspaces\x12\x20\n\x05items\x18\x01\x20\
|
||||
\x03(\x0b2\n.WorkspaceR\x05itemsJ\xcc\x05\n\x06\x12\x04\0\0\x14\x01\n\
|
||||
\x08\n\x01\x0c\x12\x03\0\0\x12\n\t\n\x02\x03\0\x12\x03\x01\0\x1a\n\n\n\
|
||||
\x02\x04\0\x12\x04\x03\0\x06\x01\n\n\n\x03\x04\0\x01\x12\x03\x03\x08\x1e\
|
||||
\n\x0b\n\x04\x04\0\x02\0\x12\x03\x04\x04\x14\n\x0c\n\x05\x04\0\x02\0\x05\
|
||||
\x12\x03\x04\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x04\x0b\x0f\n\x0c\
|
||||
\n\x05\x04\0\x02\0\x03\x12\x03\x04\x12\x13\n\x0b\n\x04\x04\0\x02\x01\x12\
|
||||
\x03\x05\x04\x14\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x05\x04\n\n\x0c\n\
|
||||
\x05\x04\0\x02\x01\x01\x12\x03\x05\x0b\x0f\n\x0c\n\x05\x04\0\x02\x01\x03\
|
||||
\x12\x03\x05\x12\x13\n\n\n\x02\x04\x01\x12\x04\x07\0\x0b\x01\n\n\n\x03\
|
||||
\x04\x01\x01\x12\x03\x07\x08\x1d\n\x0b\n\x04\x04\x01\x02\0\x12\x03\x08\
|
||||
\x04\x14\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x08\x04\n\n\x0c\n\x05\x04\
|
||||
\x01\x02\0\x01\x12\x03\x08\x0b\x0f\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\
|
||||
\x08\x12\x13\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\t\x04\x14\n\x0c\n\x05\
|
||||
\x04\x01\x02\x01\x05\x12\x03\t\x04\n\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\
|
||||
\x03\t\x0b\x0f\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\t\x12\x13\n\x0b\n\
|
||||
\x04\x04\x01\x08\0\x12\x03\n\x040\n\x0c\n\x05\x04\x01\x08\0\x01\x12\x03\
|
||||
\n\n\x18\n\x0b\n\x04\x04\x01\x02\x02\x12\x03\n\x1b.\n\x0c\n\x05\x04\x01\
|
||||
\x02\x02\x05\x12\x03\n\x1b!\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\n\")\
|
||||
\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03\n,-\n\n\n\x02\x04\x02\x12\x04\
|
||||
\x0c\0\x11\x01\n\n\n\x03\x04\x02\x01\x12\x03\x0c\x08\x11\n\x0b\n\x04\x04\
|
||||
\x02\x02\0\x12\x03\r\x04\x12\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x03\r\x04\
|
||||
\n\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03\r\x0b\r\n\x0c\n\x05\x04\x02\x02\
|
||||
\0\x03\x12\x03\r\x10\x11\n\x0b\n\x04\x04\x02\x02\x01\x12\x03\x0e\x04\x14\
|
||||
\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03\x0e\x04\n\n\x0c\n\x05\x04\x02\
|
||||
\x02\x01\x01\x12\x03\x0e\x0b\x0f\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03\
|
||||
\x0e\x12\x13\n\x0b\n\x04\x04\x02\x02\x02\x12\x03\x0f\x04\x14\n\x0c\n\x05\
|
||||
\x04\x02\x02\x02\x05\x12\x03\x0f\x04\n\n\x0c\n\x05\x04\x02\x02\x02\x01\
|
||||
\x12\x03\x0f\x0b\x0f\n\x0c\n\x05\x04\x02\x02\x02\x03\x12\x03\x0f\x12\x13\
|
||||
\n\x0b\n\x04\x04\x02\x02\x03\x12\x03\x10\x04\x19\n\x0c\n\x05\x04\x02\x02\
|
||||
\x03\x06\x12\x03\x10\x04\x0f\n\x0c\n\x05\x04\x02\x02\x03\x01\x12\x03\x10\
|
||||
\x10\x14\n\x0c\n\x05\x04\x02\x02\x03\x03\x12\x03\x10\x17\x18\n\n\n\x02\
|
||||
\x04\x03\x12\x04\x12\0\x14\x01\n\n\n\x03\x04\x03\x01\x12\x03\x12\x08\x12\
|
||||
\n\x0b\n\x04\x04\x03\x02\0\x12\x03\x13\x04!\n\x0c\n\x05\x04\x03\x02\0\
|
||||
\x04\x12\x03\x13\x04\x0c\n\x0c\n\x05\x04\x03\x02\0\x06\x12\x03\x13\r\x16\
|
||||
\n\x0c\n\x05\x04\x03\x02\0\x01\x12\x03\x13\x17\x1c\n\x0c\n\x05\x04\x03\
|
||||
\x02\0\x03\x12\x03\x13\x1f\x20b\x06proto3\
|
||||
";
|
||||
|
||||
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
||||
|
@ -182,14 +182,178 @@ impl ::protobuf::reflect::ProtobufValue for DeleteWorkspaceRequest {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct DeleteWorkspaceParams {
|
||||
// message fields
|
||||
pub workspace_id: ::std::string::String,
|
||||
// special fields
|
||||
pub unknown_fields: ::protobuf::UnknownFields,
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a DeleteWorkspaceParams {
|
||||
fn default() -> &'a DeleteWorkspaceParams {
|
||||
<DeleteWorkspaceParams as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
impl DeleteWorkspaceParams {
|
||||
pub fn new() -> DeleteWorkspaceParams {
|
||||
::std::default::Default::default()
|
||||
}
|
||||
|
||||
// string workspace_id = 1;
|
||||
|
||||
|
||||
pub fn get_workspace_id(&self) -> &str {
|
||||
&self.workspace_id
|
||||
}
|
||||
pub fn clear_workspace_id(&mut self) {
|
||||
self.workspace_id.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_workspace_id(&mut self, v: ::std::string::String) {
|
||||
self.workspace_id = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_workspace_id(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.workspace_id
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_workspace_id(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.workspace_id, ::std::string::String::new())
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for DeleteWorkspaceParams {
|
||||
fn is_initialized(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
while !is.eof()? {
|
||||
let (field_number, wire_type) = is.read_tag_unpack()?;
|
||||
match field_number {
|
||||
1 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.workspace_id)?;
|
||||
},
|
||||
_ => {
|
||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||
},
|
||||
};
|
||||
}
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
// Compute sizes of nested messages
|
||||
#[allow(unused_variables)]
|
||||
fn compute_size(&self) -> u32 {
|
||||
let mut my_size = 0;
|
||||
if !self.workspace_id.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(1, &self.workspace_id);
|
||||
}
|
||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||
self.cached_size.set(my_size);
|
||||
my_size
|
||||
}
|
||||
|
||||
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
if !self.workspace_id.is_empty() {
|
||||
os.write_string(1, &self.workspace_id)?;
|
||||
}
|
||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
fn get_cached_size(&self) -> u32 {
|
||||
self.cached_size.get()
|
||||
}
|
||||
|
||||
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
|
||||
&self.unknown_fields
|
||||
}
|
||||
|
||||
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
|
||||
&mut self.unknown_fields
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn (::std::any::Any) {
|
||||
self as &dyn (::std::any::Any)
|
||||
}
|
||||
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
|
||||
self as &mut dyn (::std::any::Any)
|
||||
}
|
||||
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
|
||||
self
|
||||
}
|
||||
|
||||
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
Self::descriptor_static()
|
||||
}
|
||||
|
||||
fn new() -> DeleteWorkspaceParams {
|
||||
DeleteWorkspaceParams::new()
|
||||
}
|
||||
|
||||
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
|
||||
descriptor.get(|| {
|
||||
let mut fields = ::std::vec::Vec::new();
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"workspace_id",
|
||||
|m: &DeleteWorkspaceParams| { &m.workspace_id },
|
||||
|m: &mut DeleteWorkspaceParams| { &mut m.workspace_id },
|
||||
));
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<DeleteWorkspaceParams>(
|
||||
"DeleteWorkspaceParams",
|
||||
fields,
|
||||
file_descriptor_proto()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn default_instance() -> &'static DeleteWorkspaceParams {
|
||||
static instance: ::protobuf::rt::LazyV2<DeleteWorkspaceParams> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(DeleteWorkspaceParams::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Clear for DeleteWorkspaceParams {
|
||||
fn clear(&mut self) {
|
||||
self.workspace_id.clear();
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for DeleteWorkspaceParams {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||
::protobuf::text_format::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for DeleteWorkspaceParams {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
|
||||
::protobuf::reflect::ReflectValueRef::Message(self)
|
||||
}
|
||||
}
|
||||
|
||||
static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\n\x16workspace_delete.proto\";\n\x16DeleteWorkspaceRequest\x12!\n\x0cwo\
|
||||
rkspace_id\x18\x01\x20\x01(\tR\x0bworkspaceIdJa\n\x06\x12\x04\0\0\x04\
|
||||
\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x04\
|
||||
\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x1e\n\x0b\n\x04\x04\0\x02\0\x12\
|
||||
\x03\x03\x04\x1c\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\x04\n\n\x0c\n\
|
||||
\x05\x04\0\x02\0\x01\x12\x03\x03\x0b\x17\n\x0c\n\x05\x04\0\x02\0\x03\x12\
|
||||
\x03\x03\x1a\x1bb\x06proto3\
|
||||
rkspace_id\x18\x01\x20\x01(\tR\x0bworkspaceId\":\n\x15DeleteWorkspacePar\
|
||||
ams\x12!\n\x0cworkspace_id\x18\x01\x20\x01(\tR\x0bworkspaceIdJ\xb0\x01\n\
|
||||
\x06\x12\x04\0\0\x07\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\
|
||||
\x12\x04\x02\0\x04\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x1e\n\x0b\n\
|
||||
\x04\x04\0\x02\0\x12\x03\x03\x04\x1c\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\
|
||||
\x03\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x0b\x17\n\x0c\n\x05\
|
||||
\x04\0\x02\0\x03\x12\x03\x03\x1a\x1b\n\n\n\x02\x04\x01\x12\x04\x05\0\x07\
|
||||
\x01\n\n\n\x03\x04\x01\x01\x12\x03\x05\x08\x1d\n\x0b\n\x04\x04\x01\x02\0\
|
||||
\x12\x03\x06\x04\x1c\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x06\x04\n\n\
|
||||
\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x06\x0b\x17\n\x0c\n\x05\x04\x01\x02\
|
||||
\0\x03\x12\x03\x06\x1a\x1bb\x06proto3\
|
||||
";
|
||||
|
||||
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
||||
|
@ -217,17 +217,220 @@ impl ::protobuf::reflect::ProtobufValue for QueryWorkspaceRequest {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct QueryWorkspaceParams {
|
||||
// message fields
|
||||
pub workspace_id: ::std::string::String,
|
||||
pub read_apps: bool,
|
||||
// special fields
|
||||
pub unknown_fields: ::protobuf::UnknownFields,
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a QueryWorkspaceParams {
|
||||
fn default() -> &'a QueryWorkspaceParams {
|
||||
<QueryWorkspaceParams as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
impl QueryWorkspaceParams {
|
||||
pub fn new() -> QueryWorkspaceParams {
|
||||
::std::default::Default::default()
|
||||
}
|
||||
|
||||
// string workspace_id = 1;
|
||||
|
||||
|
||||
pub fn get_workspace_id(&self) -> &str {
|
||||
&self.workspace_id
|
||||
}
|
||||
pub fn clear_workspace_id(&mut self) {
|
||||
self.workspace_id.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_workspace_id(&mut self, v: ::std::string::String) {
|
||||
self.workspace_id = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_workspace_id(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.workspace_id
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_workspace_id(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.workspace_id, ::std::string::String::new())
|
||||
}
|
||||
|
||||
// bool read_apps = 2;
|
||||
|
||||
|
||||
pub fn get_read_apps(&self) -> bool {
|
||||
self.read_apps
|
||||
}
|
||||
pub fn clear_read_apps(&mut self) {
|
||||
self.read_apps = false;
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_read_apps(&mut self, v: bool) {
|
||||
self.read_apps = v;
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for QueryWorkspaceParams {
|
||||
fn is_initialized(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
while !is.eof()? {
|
||||
let (field_number, wire_type) = is.read_tag_unpack()?;
|
||||
match field_number {
|
||||
1 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.workspace_id)?;
|
||||
},
|
||||
2 => {
|
||||
if wire_type != ::protobuf::wire_format::WireTypeVarint {
|
||||
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
|
||||
}
|
||||
let tmp = is.read_bool()?;
|
||||
self.read_apps = tmp;
|
||||
},
|
||||
_ => {
|
||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||
},
|
||||
};
|
||||
}
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
// Compute sizes of nested messages
|
||||
#[allow(unused_variables)]
|
||||
fn compute_size(&self) -> u32 {
|
||||
let mut my_size = 0;
|
||||
if !self.workspace_id.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(1, &self.workspace_id);
|
||||
}
|
||||
if self.read_apps != false {
|
||||
my_size += 2;
|
||||
}
|
||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||
self.cached_size.set(my_size);
|
||||
my_size
|
||||
}
|
||||
|
||||
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
if !self.workspace_id.is_empty() {
|
||||
os.write_string(1, &self.workspace_id)?;
|
||||
}
|
||||
if self.read_apps != false {
|
||||
os.write_bool(2, self.read_apps)?;
|
||||
}
|
||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
fn get_cached_size(&self) -> u32 {
|
||||
self.cached_size.get()
|
||||
}
|
||||
|
||||
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
|
||||
&self.unknown_fields
|
||||
}
|
||||
|
||||
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
|
||||
&mut self.unknown_fields
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn (::std::any::Any) {
|
||||
self as &dyn (::std::any::Any)
|
||||
}
|
||||
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
|
||||
self as &mut dyn (::std::any::Any)
|
||||
}
|
||||
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
|
||||
self
|
||||
}
|
||||
|
||||
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
Self::descriptor_static()
|
||||
}
|
||||
|
||||
fn new() -> QueryWorkspaceParams {
|
||||
QueryWorkspaceParams::new()
|
||||
}
|
||||
|
||||
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
|
||||
descriptor.get(|| {
|
||||
let mut fields = ::std::vec::Vec::new();
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"workspace_id",
|
||||
|m: &QueryWorkspaceParams| { &m.workspace_id },
|
||||
|m: &mut QueryWorkspaceParams| { &mut m.workspace_id },
|
||||
));
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
|
||||
"read_apps",
|
||||
|m: &QueryWorkspaceParams| { &m.read_apps },
|
||||
|m: &mut QueryWorkspaceParams| { &mut m.read_apps },
|
||||
));
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<QueryWorkspaceParams>(
|
||||
"QueryWorkspaceParams",
|
||||
fields,
|
||||
file_descriptor_proto()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn default_instance() -> &'static QueryWorkspaceParams {
|
||||
static instance: ::protobuf::rt::LazyV2<QueryWorkspaceParams> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(QueryWorkspaceParams::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Clear for QueryWorkspaceParams {
|
||||
fn clear(&mut self) {
|
||||
self.workspace_id.clear();
|
||||
self.read_apps = false;
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for QueryWorkspaceParams {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||
::protobuf::text_format::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for QueryWorkspaceParams {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
|
||||
::protobuf::reflect::ReflectValueRef::Message(self)
|
||||
}
|
||||
}
|
||||
|
||||
static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\n\x15workspace_query.proto\"W\n\x15QueryWorkspaceRequest\x12!\n\x0cwork\
|
||||
space_id\x18\x01\x20\x01(\tR\x0bworkspaceId\x12\x1b\n\tread_apps\x18\x02\
|
||||
\x20\x01(\x08R\x08readAppsJ\x98\x01\n\x06\x12\x04\0\0\x05\x01\n\x08\n\
|
||||
\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x05\x01\n\n\n\x03\
|
||||
\x04\0\x01\x12\x03\x02\x08\x1d\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\
|
||||
\x1c\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\x02\
|
||||
\0\x01\x12\x03\x03\x0b\x17\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x1a\
|
||||
\x1b\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\x17\n\x0c\n\x05\x04\0\x02\
|
||||
\x01\x05\x12\x03\x04\x04\x08\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x04\t\
|
||||
\x12\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04\x15\x16b\x06proto3\
|
||||
\x20\x01(\x08R\x08readApps\"V\n\x14QueryWorkspaceParams\x12!\n\x0cworksp\
|
||||
ace_id\x18\x01\x20\x01(\tR\x0bworkspaceId\x12\x1b\n\tread_apps\x18\x02\
|
||||
\x20\x01(\x08R\x08readAppsJ\x9e\x02\n\x06\x12\x04\0\0\t\x01\n\x08\n\x01\
|
||||
\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x05\x01\n\n\n\x03\x04\
|
||||
\0\x01\x12\x03\x02\x08\x1d\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\x1c\n\
|
||||
\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\
|
||||
\x12\x03\x03\x0b\x17\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x1a\x1b\n\
|
||||
\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\x17\n\x0c\n\x05\x04\0\x02\x01\
|
||||
\x05\x12\x03\x04\x04\x08\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x04\t\x12\
|
||||
\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04\x15\x16\n\n\n\x02\x04\x01\x12\
|
||||
\x04\x06\0\t\x01\n\n\n\x03\x04\x01\x01\x12\x03\x06\x08\x1c\n\x0b\n\x04\
|
||||
\x04\x01\x02\0\x12\x03\x07\x04\x1c\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\
|
||||
\x07\x04\n\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x07\x0b\x17\n\x0c\n\x05\
|
||||
\x04\x01\x02\0\x03\x12\x03\x07\x1a\x1b\n\x0b\n\x04\x04\x01\x02\x01\x12\
|
||||
\x03\x08\x04\x17\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\x08\x04\x08\n\
|
||||
\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\x08\t\x12\n\x0c\n\x05\x04\x01\x02\
|
||||
\x01\x03\x12\x03\x08\x15\x16b\x06proto3\
|
||||
";
|
||||
|
||||
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
||||
|
@ -345,11 +345,336 @@ impl ::protobuf::reflect::ProtobufValue for UpdateWorkspaceRequest {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct UpdateWorkspaceParams {
|
||||
// message fields
|
||||
pub id: ::std::string::String,
|
||||
// message oneof groups
|
||||
pub one_of_name: ::std::option::Option<UpdateWorkspaceParams_oneof_one_of_name>,
|
||||
pub one_of_desc: ::std::option::Option<UpdateWorkspaceParams_oneof_one_of_desc>,
|
||||
// special fields
|
||||
pub unknown_fields: ::protobuf::UnknownFields,
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a UpdateWorkspaceParams {
|
||||
fn default() -> &'a UpdateWorkspaceParams {
|
||||
<UpdateWorkspaceParams as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone,PartialEq,Debug)]
|
||||
pub enum UpdateWorkspaceParams_oneof_one_of_name {
|
||||
name(::std::string::String),
|
||||
}
|
||||
|
||||
#[derive(Clone,PartialEq,Debug)]
|
||||
pub enum UpdateWorkspaceParams_oneof_one_of_desc {
|
||||
desc(::std::string::String),
|
||||
}
|
||||
|
||||
impl UpdateWorkspaceParams {
|
||||
pub fn new() -> UpdateWorkspaceParams {
|
||||
::std::default::Default::default()
|
||||
}
|
||||
|
||||
// string id = 1;
|
||||
|
||||
|
||||
pub fn get_id(&self) -> &str {
|
||||
&self.id
|
||||
}
|
||||
pub fn clear_id(&mut self) {
|
||||
self.id.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_id(&mut self, v: ::std::string::String) {
|
||||
self.id = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_id(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.id
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_id(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.id, ::std::string::String::new())
|
||||
}
|
||||
|
||||
// string name = 2;
|
||||
|
||||
|
||||
pub fn get_name(&self) -> &str {
|
||||
match self.one_of_name {
|
||||
::std::option::Option::Some(UpdateWorkspaceParams_oneof_one_of_name::name(ref v)) => v,
|
||||
_ => "",
|
||||
}
|
||||
}
|
||||
pub fn clear_name(&mut self) {
|
||||
self.one_of_name = ::std::option::Option::None;
|
||||
}
|
||||
|
||||
pub fn has_name(&self) -> bool {
|
||||
match self.one_of_name {
|
||||
::std::option::Option::Some(UpdateWorkspaceParams_oneof_one_of_name::name(..)) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_name(&mut self, v: ::std::string::String) {
|
||||
self.one_of_name = ::std::option::Option::Some(UpdateWorkspaceParams_oneof_one_of_name::name(v))
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
pub fn mut_name(&mut self) -> &mut ::std::string::String {
|
||||
if let ::std::option::Option::Some(UpdateWorkspaceParams_oneof_one_of_name::name(_)) = self.one_of_name {
|
||||
} else {
|
||||
self.one_of_name = ::std::option::Option::Some(UpdateWorkspaceParams_oneof_one_of_name::name(::std::string::String::new()));
|
||||
}
|
||||
match self.one_of_name {
|
||||
::std::option::Option::Some(UpdateWorkspaceParams_oneof_one_of_name::name(ref mut v)) => v,
|
||||
_ => panic!(),
|
||||
}
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_name(&mut self) -> ::std::string::String {
|
||||
if self.has_name() {
|
||||
match self.one_of_name.take() {
|
||||
::std::option::Option::Some(UpdateWorkspaceParams_oneof_one_of_name::name(v)) => v,
|
||||
_ => panic!(),
|
||||
}
|
||||
} else {
|
||||
::std::string::String::new()
|
||||
}
|
||||
}
|
||||
|
||||
// string desc = 3;
|
||||
|
||||
|
||||
pub fn get_desc(&self) -> &str {
|
||||
match self.one_of_desc {
|
||||
::std::option::Option::Some(UpdateWorkspaceParams_oneof_one_of_desc::desc(ref v)) => v,
|
||||
_ => "",
|
||||
}
|
||||
}
|
||||
pub fn clear_desc(&mut self) {
|
||||
self.one_of_desc = ::std::option::Option::None;
|
||||
}
|
||||
|
||||
pub fn has_desc(&self) -> bool {
|
||||
match self.one_of_desc {
|
||||
::std::option::Option::Some(UpdateWorkspaceParams_oneof_one_of_desc::desc(..)) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_desc(&mut self, v: ::std::string::String) {
|
||||
self.one_of_desc = ::std::option::Option::Some(UpdateWorkspaceParams_oneof_one_of_desc::desc(v))
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
pub fn mut_desc(&mut self) -> &mut ::std::string::String {
|
||||
if let ::std::option::Option::Some(UpdateWorkspaceParams_oneof_one_of_desc::desc(_)) = self.one_of_desc {
|
||||
} else {
|
||||
self.one_of_desc = ::std::option::Option::Some(UpdateWorkspaceParams_oneof_one_of_desc::desc(::std::string::String::new()));
|
||||
}
|
||||
match self.one_of_desc {
|
||||
::std::option::Option::Some(UpdateWorkspaceParams_oneof_one_of_desc::desc(ref mut v)) => v,
|
||||
_ => panic!(),
|
||||
}
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_desc(&mut self) -> ::std::string::String {
|
||||
if self.has_desc() {
|
||||
match self.one_of_desc.take() {
|
||||
::std::option::Option::Some(UpdateWorkspaceParams_oneof_one_of_desc::desc(v)) => v,
|
||||
_ => panic!(),
|
||||
}
|
||||
} else {
|
||||
::std::string::String::new()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for UpdateWorkspaceParams {
|
||||
fn is_initialized(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
while !is.eof()? {
|
||||
let (field_number, wire_type) = is.read_tag_unpack()?;
|
||||
match field_number {
|
||||
1 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?;
|
||||
},
|
||||
2 => {
|
||||
if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
|
||||
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
|
||||
}
|
||||
self.one_of_name = ::std::option::Option::Some(UpdateWorkspaceParams_oneof_one_of_name::name(is.read_string()?));
|
||||
},
|
||||
3 => {
|
||||
if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
|
||||
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
|
||||
}
|
||||
self.one_of_desc = ::std::option::Option::Some(UpdateWorkspaceParams_oneof_one_of_desc::desc(is.read_string()?));
|
||||
},
|
||||
_ => {
|
||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||
},
|
||||
};
|
||||
}
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
// Compute sizes of nested messages
|
||||
#[allow(unused_variables)]
|
||||
fn compute_size(&self) -> u32 {
|
||||
let mut my_size = 0;
|
||||
if !self.id.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(1, &self.id);
|
||||
}
|
||||
if let ::std::option::Option::Some(ref v) = self.one_of_name {
|
||||
match v {
|
||||
&UpdateWorkspaceParams_oneof_one_of_name::name(ref v) => {
|
||||
my_size += ::protobuf::rt::string_size(2, &v);
|
||||
},
|
||||
};
|
||||
}
|
||||
if let ::std::option::Option::Some(ref v) = self.one_of_desc {
|
||||
match v {
|
||||
&UpdateWorkspaceParams_oneof_one_of_desc::desc(ref v) => {
|
||||
my_size += ::protobuf::rt::string_size(3, &v);
|
||||
},
|
||||
};
|
||||
}
|
||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||
self.cached_size.set(my_size);
|
||||
my_size
|
||||
}
|
||||
|
||||
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
if !self.id.is_empty() {
|
||||
os.write_string(1, &self.id)?;
|
||||
}
|
||||
if let ::std::option::Option::Some(ref v) = self.one_of_name {
|
||||
match v {
|
||||
&UpdateWorkspaceParams_oneof_one_of_name::name(ref v) => {
|
||||
os.write_string(2, v)?;
|
||||
},
|
||||
};
|
||||
}
|
||||
if let ::std::option::Option::Some(ref v) = self.one_of_desc {
|
||||
match v {
|
||||
&UpdateWorkspaceParams_oneof_one_of_desc::desc(ref v) => {
|
||||
os.write_string(3, v)?;
|
||||
},
|
||||
};
|
||||
}
|
||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
fn get_cached_size(&self) -> u32 {
|
||||
self.cached_size.get()
|
||||
}
|
||||
|
||||
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
|
||||
&self.unknown_fields
|
||||
}
|
||||
|
||||
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
|
||||
&mut self.unknown_fields
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn (::std::any::Any) {
|
||||
self as &dyn (::std::any::Any)
|
||||
}
|
||||
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
|
||||
self as &mut dyn (::std::any::Any)
|
||||
}
|
||||
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
|
||||
self
|
||||
}
|
||||
|
||||
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
Self::descriptor_static()
|
||||
}
|
||||
|
||||
fn new() -> UpdateWorkspaceParams {
|
||||
UpdateWorkspaceParams::new()
|
||||
}
|
||||
|
||||
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
|
||||
descriptor.get(|| {
|
||||
let mut fields = ::std::vec::Vec::new();
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"id",
|
||||
|m: &UpdateWorkspaceParams| { &m.id },
|
||||
|m: &mut UpdateWorkspaceParams| { &mut m.id },
|
||||
));
|
||||
fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
|
||||
"name",
|
||||
UpdateWorkspaceParams::has_name,
|
||||
UpdateWorkspaceParams::get_name,
|
||||
));
|
||||
fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
|
||||
"desc",
|
||||
UpdateWorkspaceParams::has_desc,
|
||||
UpdateWorkspaceParams::get_desc,
|
||||
));
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateWorkspaceParams>(
|
||||
"UpdateWorkspaceParams",
|
||||
fields,
|
||||
file_descriptor_proto()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn default_instance() -> &'static UpdateWorkspaceParams {
|
||||
static instance: ::protobuf::rt::LazyV2<UpdateWorkspaceParams> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(UpdateWorkspaceParams::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Clear for UpdateWorkspaceParams {
|
||||
fn clear(&mut self) {
|
||||
self.id.clear();
|
||||
self.one_of_name = ::std::option::Option::None;
|
||||
self.one_of_desc = ::std::option::Option::None;
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for UpdateWorkspaceParams {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||
::protobuf::text_format::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for UpdateWorkspaceParams {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
|
||||
::protobuf::reflect::ReflectValueRef::Message(self)
|
||||
}
|
||||
}
|
||||
|
||||
static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\n\x16workspace_update.proto\"r\n\x16UpdateWorkspaceRequest\x12\x0e\n\
|
||||
\x02id\x18\x01\x20\x01(\tR\x02id\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0\
|
||||
R\x04name\x12\x14\n\x04desc\x18\x03\x20\x01(\tH\x01R\x04descB\r\n\x0bone\
|
||||
_of_nameB\r\n\x0bone_of_descJ\x85\x02\n\x06\x12\x04\0\0\x06\x01\n\x08\n\
|
||||
_of_nameB\r\n\x0bone_of_desc\"q\n\x15UpdateWorkspaceParams\x12\x0e\n\x02\
|
||||
id\x18\x01\x20\x01(\tR\x02id\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0R\
|
||||
\x04name\x12\x14\n\x04desc\x18\x03\x20\x01(\tH\x01R\x04descB\r\n\x0bone_\
|
||||
of_nameB\r\n\x0bone_of_descJ\xf8\x03\n\x06\x12\x04\0\0\x0b\x01\n\x08\n\
|
||||
\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x06\x01\n\n\n\x03\
|
||||
\x04\0\x01\x12\x03\x02\x08\x1e\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\
|
||||
\x12\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\x02\
|
||||
@ -361,7 +686,19 @@ static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\x04\x04\0\x08\x01\x12\x03\x05\x04*\n\x0c\n\x05\x04\0\x08\x01\x01\x12\
|
||||
\x03\x05\n\x15\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x05\x18(\n\x0c\n\x05\
|
||||
\x04\0\x02\x02\x05\x12\x03\x05\x18\x1e\n\x0c\n\x05\x04\0\x02\x02\x01\x12\
|
||||
\x03\x05\x1f#\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x05&'b\x06proto3\
|
||||
\x03\x05\x1f#\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x05&'\n\n\n\x02\x04\
|
||||
\x01\x12\x04\x07\0\x0b\x01\n\n\n\x03\x04\x01\x01\x12\x03\x07\x08\x1d\n\
|
||||
\x0b\n\x04\x04\x01\x02\0\x12\x03\x08\x04\x12\n\x0c\n\x05\x04\x01\x02\0\
|
||||
\x05\x12\x03\x08\x04\n\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x08\x0b\r\n\
|
||||
\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x08\x10\x11\n\x0b\n\x04\x04\x01\x08\
|
||||
\0\x12\x03\t\x04*\n\x0c\n\x05\x04\x01\x08\0\x01\x12\x03\t\n\x15\n\x0b\n\
|
||||
\x04\x04\x01\x02\x01\x12\x03\t\x18(\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\
|
||||
\x03\t\x18\x1e\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\t\x1f#\n\x0c\n\
|
||||
\x05\x04\x01\x02\x01\x03\x12\x03\t&'\n\x0b\n\x04\x04\x01\x08\x01\x12\x03\
|
||||
\n\x04*\n\x0c\n\x05\x04\x01\x08\x01\x01\x12\x03\n\n\x15\n\x0b\n\x04\x04\
|
||||
\x01\x02\x02\x12\x03\n\x18(\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03\n\
|
||||
\x18\x1e\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\n\x1f#\n\x0c\n\x05\x04\
|
||||
\x01\x02\x02\x03\x12\x03\n&'b\x06proto3\
|
||||
";
|
||||
|
||||
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
||||
|
@ -19,4 +19,5 @@ enum WsErrCode {
|
||||
WorkspaceDatabaseError = 101;
|
||||
UserInternalError = 102;
|
||||
UserNotLoginYet = 103;
|
||||
ServerError = 1000;
|
||||
}
|
||||
|
@ -5,6 +5,11 @@ message CreateWorkspaceRequest {
|
||||
string name = 1;
|
||||
string desc = 2;
|
||||
}
|
||||
message CreateWorkspaceParams {
|
||||
string name = 1;
|
||||
string desc = 2;
|
||||
oneof one_of_user_id { string user_id = 3; };
|
||||
}
|
||||
message Workspace {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
|
@ -3,3 +3,6 @@ syntax = "proto3";
|
||||
message DeleteWorkspaceRequest {
|
||||
string workspace_id = 1;
|
||||
}
|
||||
message DeleteWorkspaceParams {
|
||||
string workspace_id = 1;
|
||||
}
|
||||
|
@ -4,3 +4,7 @@ message QueryWorkspaceRequest {
|
||||
string workspace_id = 1;
|
||||
bool read_apps = 2;
|
||||
}
|
||||
message QueryWorkspaceParams {
|
||||
string workspace_id = 1;
|
||||
bool read_apps = 2;
|
||||
}
|
||||
|
@ -5,3 +5,8 @@ message UpdateWorkspaceRequest {
|
||||
oneof one_of_name { string name = 2; };
|
||||
oneof one_of_desc { string desc = 3; };
|
||||
}
|
||||
message UpdateWorkspaceParams {
|
||||
string id = 1;
|
||||
oneof one_of_name { string name = 2; };
|
||||
oneof one_of_desc { string desc = 3; };
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ use crate::{
|
||||
sql_tables::workspace::{WorkspaceSql, WorkspaceTable, WorkspaceTableChangeset},
|
||||
};
|
||||
use flowy_dispatch::prelude::DispatchFuture;
|
||||
use flowy_net::request::HttpRequestBuilder;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct WorkspaceController {
|
||||
@ -31,9 +32,11 @@ impl WorkspaceController {
|
||||
|
||||
pub async fn create_workspace(
|
||||
&self,
|
||||
params: CreateWorkspaceParams,
|
||||
mut params: CreateWorkspaceParams,
|
||||
) -> Result<Workspace, WorkspaceError> {
|
||||
let user_id = self.user.user_id()?;
|
||||
params.user_id = Some(user_id.clone());
|
||||
|
||||
let workspace_table = WorkspaceTable::new(params, &user_id);
|
||||
let workspace: Workspace = workspace_table.clone().into();
|
||||
let _ = self.sql.create_workspace(workspace_table)?;
|
||||
@ -112,3 +115,27 @@ impl WorkspaceController {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn create_workspace_request(
|
||||
params: CreateWorkspaceParams,
|
||||
url: &str,
|
||||
) -> Result<Workspace, WorkspaceError> {
|
||||
let workspace = HttpRequestBuilder::post(&url.to_owned())
|
||||
.protobuf(params)?
|
||||
.send()
|
||||
.await?
|
||||
.response()?;
|
||||
Ok(workspace)
|
||||
}
|
||||
|
||||
pub async fn read_workspace_request(
|
||||
params: QueryWorkspaceParams,
|
||||
url: &str,
|
||||
) -> Result<Workspace, WorkspaceError> {
|
||||
let workspace = HttpRequestBuilder::get(&url.to_owned())
|
||||
.protobuf(params)?
|
||||
.send()
|
||||
.await?
|
||||
.response()?;
|
||||
Ok(workspace)
|
||||
}
|
||||
|
Reference in New Issue
Block a user