ocm-types 0.2.1

Types required to implement the OpenCloudMesh filesharing protocol
Documentation
// SPDX-FileCopyrightText: 2026 Matthias Kraus <info@opengeomesh.org>
//
// SPDX-License-Identifier: LGPL-3.0-or-later

use serde::{Deserialize, Serialize};


#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Error {
    /// An error message which is understandable for both humans and
    /// machines (e.g. no use of special characters) providing more
    /// information on the cause of the error.
    /// example: RESOURCE_NOT_FOUND
    pub message: String,
    pub validation_errors: Vec<ValidationError>,
}

#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ValidationError {
    /// example: shareWith
    pub name: Option<String>,
    /// A validation error message which is understandable for
    /// both humans and machines (e.g. no use of special
    /// characters) providing more information on the cause of the
    /// validation error.
    /// example: NOT_FOUND
    pub message: Option<String>,
}