spatio-sdk 0.0.2

Rust SDK for the SpatioAPI. Generated from the official OpenAPI spec.
Documentation
/*
 * 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};

/// Organization : Organization summary used in list responses (`GET /v1/organizations`, `GET /v1/organizations/{id}/workspaces`). Returned with camelCase field names.  NB: The single-org GET `/v1/organizations/{id}` returns a *different shape* (`OrganizationDetailLegacy`, PascalCase keys) today — see that schema for the wire-level reality. This is a known inconsistency the platform-service is expected to converge on the camelCase shape in a future cleanup. 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Organization {
    #[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>>,
    /// The caller's role in this org (`owner`, `admin`, `billing_admin`, `member`).
    #[serde(rename = "role")]
    pub role: String,
    #[serde(rename = "memberCount", skip_serializing_if = "Option::is_none")]
    pub member_count: Option<i32>,
    #[serde(rename = "workspaceCount", skip_serializing_if = "Option::is_none")]
    pub workspace_count: Option<i32>,
    /// Compact workspace summaries embedded in the org-list response.
    #[serde(rename = "workspaces", skip_serializing_if = "Option::is_none")]
    pub workspaces: Option<Vec<models::OrganizationWorkspacesInner>>,
    #[serde(rename = "createdAt")]
    pub created_at: chrono::DateTime<chrono::FixedOffset>,
    #[serde(rename = "updatedAt")]
    pub updated_at: chrono::DateTime<chrono::FixedOffset>,
}

impl Organization {
    /// Organization summary used in list responses (`GET /v1/organizations`, `GET /v1/organizations/{id}/workspaces`). Returned with camelCase field names.  NB: The single-org GET `/v1/organizations/{id}` returns a *different shape* (`OrganizationDetailLegacy`, PascalCase keys) today — see that schema for the wire-level reality. This is a known inconsistency the platform-service is expected to converge on the camelCase shape in a future cleanup. 
    pub fn new(id: String, name: String, slug: String, role: String, created_at: chrono::DateTime<chrono::FixedOffset>, updated_at: chrono::DateTime<chrono::FixedOffset>) -> Organization {
        Organization {
            id,
            name,
            slug,
            description: None,
            logo_url: None,
            role,
            member_count: None,
            workspace_count: None,
            workspaces: None,
            created_at,
            updated_at,
        }
    }
}