/*
* SpatioAPI
*
* The REST API that owns every resource in your Spatio workspace: notes, sheets, slides, tasks, calendar events, mail, chat, files, and contacts. SpatioMCP wraps this API; Spatio Desktop reads from it. You can call it directly from your own code. All requests must be authenticated with a Personal Access Token (`Authorization: Bearer pat_...`) or an OAuth 2.1 access token, and use HTTPS. Official SDKs (MIT, generated from this spec on every release): - TypeScript: https://github.com/spatio-labs/spatio-ts (`npm install @spatio-labs/spatio-ts`) - Python: https://github.com/spatio-labs/spatio-py (`pip install spatio-sdk`) - Go: https://github.com/spatio-labs/spatio-go (`go get github.com/spatio-labs/spatio-go`) This specification is generated from the platform-service Go source on every push to `main`. The spec, not hand-written documentation, is the source of truth: server stubs and SDKs are generated from it, and any drift between the spec and the running service fails CI.
*
* The version of the OpenAPI document: v1
* Contact: hello@spatio.app
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Workspace : A workspace within an organization. Returned in list responses (`GET /v1/workspaces`, `GET /v1/organizations/{id}/workspaces`) and the single-get response (`GET /v1/workspaces/{id}`, wrapped in `{workspace: ...}`). `settings` shape varies by endpoint — sometimes a JSON object, sometimes a JSON-encoded string. Treat as opaque.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Workspace {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "slug")]
pub slug: String,
#[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub description: Option<Option<String>>,
#[serde(rename = "logoUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub logo_url: Option<Option<String>>,
#[serde(rename = "organizationId", skip_serializing_if = "Option::is_none")]
pub organization_id: Option<String>,
#[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
pub organization: Option<Box<models::WorkspaceOrganization>>,
/// The caller's role in this workspace (`owner`, `admin`, `member`, `guest`).
#[serde(rename = "role", skip_serializing_if = "Option::is_none")]
pub role: Option<String>,
/// Per-workspace settings. Currently emitted as either an object (`{language, timezone, ...}`) on `GET /v1/workspaces/{id}` or a JSON-encoded string on `GET /v1/organizations/{id}/workspaces`. Treat as opaque and parse defensively.
#[serde(rename = "settings", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub settings: Option<Option<serde_json::Value>>,
#[serde(rename = "isDefault", skip_serializing_if = "Option::is_none")]
pub is_default: Option<bool>,
#[serde(rename = "memberCount", skip_serializing_if = "Option::is_none")]
pub member_count: Option<i32>,
#[serde(rename = "billingTier", skip_serializing_if = "Option::is_none")]
pub billing_tier: Option<String>,
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<chrono::DateTime<chrono::FixedOffset>>,
#[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
pub updated_at: Option<chrono::DateTime<chrono::FixedOffset>>,
}
impl Workspace {
/// A workspace within an organization. Returned in list responses (`GET /v1/workspaces`, `GET /v1/organizations/{id}/workspaces`) and the single-get response (`GET /v1/workspaces/{id}`, wrapped in `{workspace: ...}`). `settings` shape varies by endpoint — sometimes a JSON object, sometimes a JSON-encoded string. Treat as opaque.
pub fn new(id: String, name: String, slug: String) -> Workspace {
Workspace {
id,
name,
slug,
description: None,
logo_url: None,
organization_id: None,
organization: None,
role: None,
settings: None,
is_default: None,
member_count: None,
billing_tier: None,
created_at: None,
updated_at: None,
}
}
}