/*
* 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};
/// Sheet : A spreadsheet. Sheets belong to exactly one connected account (`accountId` + `provider`). The native provider stores sheets in the Spatio database; external providers (Google Sheets, Excel Online, etc.) round-trip through Spatio. `data` is a free-form bag for provider-specific blobs (cell matrices, formulas, formatting). Clients that walk rows / cells should use the dedicated row + cell endpoints; `data` is only meaningful when round-tripping with an external provider that embeds its native format here.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Sheet {
#[serde(rename = "id")]
pub id: String,
/// Registered provider id (e.g. `native-sheets`).
#[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
pub provider: Option<String>,
/// Connected-account row this sheet belongs to.
#[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
/// User id of the sheet owner; non-native providers leave empty.
#[serde(rename = "ownerUserId", skip_serializing_if = "Option::is_none")]
pub owner_user_id: Option<String>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub description: Option<Option<String>>,
/// Free-form provider blob. Treat as opaque.
#[serde(rename = "data", skip_serializing_if = "Option::is_none")]
pub data: Option<std::collections::HashMap<String, serde_json::Value>>,
#[serde(rename = "rowCount")]
pub row_count: i32,
#[serde(rename = "columnCount")]
pub column_count: i32,
/// Tab count when the file contains multiple sheets.
#[serde(rename = "sheetCount")]
pub sheet_count: i32,
#[serde(rename = "isPublic")]
pub is_public: bool,
#[serde(rename = "isReadOnly")]
pub is_read_only: bool,
#[serde(rename = "fileSize", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub file_size: Option<Option<i32>>,
#[serde(rename = "lastAccessedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub last_accessed_at: Option<Option<chrono::DateTime<chrono::FixedOffset>>>,
#[serde(rename = "createdAt")]
pub created_at: chrono::DateTime<chrono::FixedOffset>,
#[serde(rename = "updatedAt")]
pub updated_at: chrono::DateTime<chrono::FixedOffset>,
}
impl Sheet {
/// A spreadsheet. Sheets belong to exactly one connected account (`accountId` + `provider`). The native provider stores sheets in the Spatio database; external providers (Google Sheets, Excel Online, etc.) round-trip through Spatio. `data` is a free-form bag for provider-specific blobs (cell matrices, formulas, formatting). Clients that walk rows / cells should use the dedicated row + cell endpoints; `data` is only meaningful when round-tripping with an external provider that embeds its native format here.
pub fn new(id: String, name: String, row_count: i32, column_count: i32, sheet_count: i32, is_public: bool, is_read_only: bool, created_at: chrono::DateTime<chrono::FixedOffset>, updated_at: chrono::DateTime<chrono::FixedOffset>) -> Sheet {
Sheet {
id,
provider: None,
account_id: None,
owner_user_id: None,
name,
description: None,
data: None,
row_count,
column_count,
sheet_count,
is_public,
is_read_only,
file_size: None,
last_accessed_at: None,
created_at,
updated_at,
}
}
}