153 lines
3.8 KiB
C
153 lines
3.8 KiB
C
/*
|
||
* libyadisk - A C library for interacting with Yandex.Disk API
|
||
*
|
||
* This file is part of libyadisk.
|
||
*
|
||
* Copyright (C) 2023 Maxim Slipenko
|
||
*
|
||
* This program is free software: you can redistribute it and/or modify
|
||
* it under the terms of the GNU Lesser General Public License as published by
|
||
* the Free Software Foundation, either version 3 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* This library is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU Lesser General Public License for more details.
|
||
*
|
||
* You should have received a copy of the GNU Lesser General Public License
|
||
* along with this program. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
|
||
*/
|
||
/**
|
||
* @file
|
||
*/
|
||
#ifndef YADISK_YADISK_GET_DISK_H
|
||
#define YADISK_YADISK_GET_DISK_H
|
||
|
||
#include "yadisk_shared.h"
|
||
|
||
/**
|
||
* @brief
|
||
* @en User info
|
||
* @ru Информация о пользователе
|
||
*/
|
||
typedef struct {
|
||
const char* reg_time;
|
||
const char* display_name;
|
||
const char* uid;
|
||
const char* country;
|
||
int is_child;
|
||
const char* login;
|
||
} yadisk_user_info;
|
||
|
||
/**
|
||
* @brief
|
||
* @en System folders paths
|
||
* @ru Пути системных папок
|
||
*/
|
||
typedef struct {
|
||
const char* odnoklassniki;
|
||
const char* google;
|
||
const char* instagram;
|
||
const char* vkontakte;
|
||
const char* attach;
|
||
const char* mailru;
|
||
const char* downloads;
|
||
const char* applications;
|
||
const char* facebook;
|
||
const char* social;
|
||
const char* messenger;
|
||
const char* calendar;
|
||
const char* photostream;
|
||
const char* screenshots;
|
||
const char* scans;
|
||
} yadisk_system_folders;
|
||
|
||
/**
|
||
* @brief
|
||
* @en Information about the disk
|
||
* @ru Информация о диске
|
||
*/
|
||
typedef struct yadisk_disk_info {
|
||
/**
|
||
* @brief
|
||
* @en Total space
|
||
* @ru Общий объем
|
||
*/
|
||
unsigned long total_space;
|
||
/**
|
||
* @brief
|
||
* @en Trash size
|
||
* @ru Объем корзины
|
||
*/
|
||
unsigned long trash_size;
|
||
/**
|
||
* @brief
|
||
* @en Used space
|
||
* @ru Использованный объем
|
||
*/
|
||
unsigned long used_space;
|
||
/**
|
||
* @brief
|
||
* @en Is paid tariff
|
||
* @ru Платный ли тариф
|
||
*/
|
||
int is_paid;
|
||
/**
|
||
* @brief
|
||
* @en Registration date
|
||
* @ru Дата регистрации
|
||
*/
|
||
const char* reg_time;
|
||
/**
|
||
* @brief
|
||
* @en System folders paths
|
||
* @ru Пути системных папок
|
||
*/
|
||
yadisk_system_folders system_folders;
|
||
/**
|
||
* @brief
|
||
* @en Info about user
|
||
* @ru Информация о пользователе
|
||
*/
|
||
yadisk_user_info user;
|
||
/**
|
||
* @brief
|
||
* @en Unlimited autoupload
|
||
* @ru Безлимитная автозагрузка
|
||
*/
|
||
int unlimited_autoupload_enabled;
|
||
/**
|
||
* @brief
|
||
* @en Revision
|
||
* @ru Ревизия
|
||
*/
|
||
unsigned long revision;
|
||
} yadisk_disk_info;
|
||
|
||
typedef struct {
|
||
/**
|
||
* @brief
|
||
* @ru Список возвращаемых атрибутов.
|
||
*/
|
||
const char* fields;
|
||
} yadisk_get_disk_params;
|
||
|
||
/**
|
||
* @brief
|
||
* @ru Функция для получения метаинформации о диске пользователя.
|
||
*
|
||
* Реализует метод `GET /v1/disk`
|
||
* @param client
|
||
* @ru Клиент Яндекс.Диска
|
||
* @param params
|
||
* @ru Параметры запроса
|
||
* @param info
|
||
* @ru Информация о диске. Результат выполнения операции
|
||
* @return
|
||
* @ru Код возврата (YADISK_OK в случае успеха).
|
||
*/
|
||
yadisk_code yadisk_get_disk(yadisk_api_client* client, yadisk_get_disk_params* params, yadisk_disk_info* info);
|
||
|
||
#endif //YADISK_YADISK_GET_DISK_H
|