add more fields for yadisk_get_disk_resources

This commit is contained in:
2023-12-31 22:18:50 +03:00
parent db89e0e129
commit 7efbd654b7
4 changed files with 46 additions and 6 deletions

View File

@@ -41,6 +41,9 @@ yadisk_get_disk_resources(
GET_JSON_STRING(root, "type", &(info->type));
GET_JSON_STRING(root, "created", &(info->created));
GET_JSON_STRING(root, "modified", &(info->modified));
GET_JSON_STRING(root, "media_type", &(info->media_type));
GET_JSON_STRING(root, "mime_type", &(info->mime_type));
GET_JSON_UINT64(root, "size", &(info->size));
json_object_put(root);
return YADISK_OK;

View File

@@ -30,16 +30,48 @@
const char* resource_id; \
const char* type; \
const char* created; \
const char* modified;
const char* modified; \
const char* mime_type; \
const char* media_type; \
unsigned long size; \
const char* md5; \
const char* sha256; \
const char* antivirus_status; \
unsigned long long revision; \
yadisk_comment_ids* comment_ids; \
yadisk_sizes* sizes; \
unsigned long sizes_count;
// Структура для комментариев
typedef struct {
const char* private_resource;
const char* public_resource;
} yadisk_comment_ids;
// Структура для размеров
typedef struct {
const char* url;
const char* name;
} yadisk_size;
// Массив размеров
typedef struct {
yadisk_size* sizes;
unsigned long count;
} yadisk_sizes;
struct yadisk_resource_item {
YADISK_RESOURCE_ITEM_PROPERTIES
};
typedef struct {
struct yadisk_resource_item* items; // Массив элементов
unsigned long items_count; // Количество элементов
unsigned long limit;
unsigned long offset;
unsigned long total;
const char* sort;
const char* path;
} yadisk_resource_embedded;
typedef struct {