Skip to main content

opentalk_nextcloud_client/
types.rs

1// SPDX-FileCopyrightText: OpenTalk GmbH <mail@opentalk.eu>
2//
3// SPDX-License-Identifier: EUPL-1.2
4
5use std::{collections::HashSet, fmt::Debug};
6
7use serde::Deserialize;
8
9use crate::{ShareId, SharePermission};
10
11#[derive(Debug, Deserialize)]
12pub struct ShareAnswer<D: Debug> {
13    pub ocs: OcsShareAnswer<D>,
14}
15
16#[derive(Debug, Deserialize)]
17pub struct OcsShareAnswer<D: Debug> {
18    pub meta: Meta,
19    pub data: D,
20}
21
22#[derive(Debug, Deserialize)]
23pub struct Meta {
24    pub message: String,
25    pub status: String,
26    pub statuscode: u32,
27}
28
29#[derive(Debug, Deserialize)]
30pub struct OcsShareData {
31    pub id: ShareId,
32    pub url: String,
33    pub file_target: String,
34    #[serde(with = "crate::utils::share_permissions")]
35    pub permissions: HashSet<SharePermission>,
36}
37
38#[derive(Debug, Deserialize)]
39pub struct OcsPassword {
40    pub password: String,
41}