cts_common/protocol/
workspace.rs1use crate::{Crn, WorkspaceId};
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Serialize, Deserialize)]
5pub struct CreateWorkspaceResponse {
6 pub id: WorkspaceId,
7}
8
9#[derive(Debug, Serialize, Deserialize)]
10pub struct UpdateWorkspaceResponse {
11 pub id: WorkspaceId,
12 pub name: Option<String>,
13 pub org_id: String,
14 pub region: String,
15 pub crn: Crn,
16}
17
18#[cfg(feature = "server")]
19pub(super) mod server {
20 use super::*;
21 use axum::{response::IntoResponse, Json};
22
23 impl IntoResponse for CreateWorkspaceResponse {
24 fn into_response(self) -> axum::response::Response {
25 (http::StatusCode::CREATED, Json(self)).into_response()
26 }
27 }
28
29 impl IntoResponse for UpdateWorkspaceResponse {
30 fn into_response(self) -> axum::response::Response {
31 (http::StatusCode::OK, Json(self)).into_response()
32 }
33 }
34}