| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* Copyright 2022-2023 Jan-Michael Brummer <jan-michael.brummer1@volkswagen.de> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU Lesser General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 3 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU Lesser General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU Lesser General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #if !defined(_MSG_INSIDE) && !defined(MSG_COMPILATION) | ||
| 20 | #error "Only <msg.h> can be included directly." | ||
| 21 | #endif | ||
| 22 | |||
| 23 | #include <glib-object.h> | ||
| 24 | #include <gio/gio.h> | ||
| 25 | #include <json-glib/json-glib.h> | ||
| 26 | |||
| 27 | G_BEGIN_DECLS | ||
| 28 | |||
| 29 | /** | ||
| 30 | * MsgDriveType: | ||
| 31 | * @MSG_DRIVE_TYPE_PERSONAL: Personal OneDrive drive | ||
| 32 | * @MSG_DRIVE_TYPE_BUSINESS: OneDrive for Business drive | ||
| 33 | * @MSG_DRIVE_TYPE_DOCUMENT_LIBRARY: SharePoint document library | ||
| 34 | * | ||
| 35 | * The type of Drive | ||
| 36 | * <ulink url="https://docs.microsoft.com/en-us/graph/api/resources/drive?view=graph-rest-1.0"> | ||
| 37 | * objects</ulink>. | ||
| 38 | */ | ||
| 39 | typedef enum | ||
| 40 | { | ||
| 41 | MSG_DRIVE_TYPE_PERSONAL, | ||
| 42 | MSG_DRIVE_TYPE_BUSINESS, | ||
| 43 | MSG_DRIVE_TYPE_DOCUMENT_LIBRARY, | ||
| 44 | } MsgDriveType; | ||
| 45 | |||
| 46 | #define MSG_TYPE_DRIVE (msg_drive_get_type ()) | ||
| 47 | |||
| 48 | 42 | G_DECLARE_FINAL_TYPE (MsgDrive, msg_drive, MSG, DRIVE, GObject); | |
| 49 | |||
| 50 | MsgDrive * | ||
| 51 | msg_drive_new (void); | ||
| 52 | |||
| 53 | MsgDrive * | ||
| 54 | msg_drive_new_from_json (JsonObject *object, | ||
| 55 | GError **error); | ||
| 56 | |||
| 57 | const char * | ||
| 58 | msg_drive_get_id (MsgDrive *self); | ||
| 59 | |||
| 60 | MsgDriveType | ||
| 61 | msg_drive_get_drive_type (MsgDrive *self); | ||
| 62 | |||
| 63 | const char * | ||
| 64 | msg_drive_get_name (MsgDrive *self); | ||
| 65 | |||
| 66 | gulong | ||
| 67 | msg_drive_get_total (MsgDrive *self); | ||
| 68 | |||
| 69 | gulong | ||
| 70 | msg_drive_get_used (MsgDrive *self); | ||
| 71 | |||
| 72 | gulong | ||
| 73 | msg_drive_get_remaining (MsgDrive *self); | ||
| 74 | |||
| 75 | const GDateTime * | ||
| 76 | msg_drive_get_created (MsgDrive *self); | ||
| 77 | |||
| 78 | const GDateTime * | ||
| 79 | msg_drive_get_modified (MsgDrive *self); | ||
| 80 | |||
| 81 | G_END_DECLS | ||
| 82 |