2019-06-26 20:39:01 +02:00
|
|
|
package fichier
|
|
|
|
|
2021-02-22 00:37:38 +01:00
|
|
|
// FileInfoRequest is the request structure of the corresponding request
|
|
|
|
type FileInfoRequest struct {
|
|
|
|
URL string `json:"url"`
|
|
|
|
}
|
|
|
|
|
2019-06-26 20:39:01 +02:00
|
|
|
// ListFolderRequest is the request structure of the corresponding request
|
|
|
|
type ListFolderRequest struct {
|
2019-07-20 01:50:57 +02:00
|
|
|
FolderID int `json:"folder_id"`
|
2019-06-26 20:39:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ListFilesRequest is the request structure of the corresponding request
|
|
|
|
type ListFilesRequest struct {
|
2019-07-20 01:50:57 +02:00
|
|
|
FolderID int `json:"folder_id"`
|
2019-06-26 20:39:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// DownloadRequest is the request structure of the corresponding request
|
|
|
|
type DownloadRequest struct {
|
|
|
|
URL string `json:"url"`
|
|
|
|
Single int `json:"single"`
|
2021-05-16 23:28:18 +02:00
|
|
|
Pass string `json:"pass,omitempty"`
|
2019-06-26 20:39:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// RemoveFolderRequest is the request structure of the corresponding request
|
|
|
|
type RemoveFolderRequest struct {
|
2019-07-20 01:50:57 +02:00
|
|
|
FolderID int `json:"folder_id"`
|
2019-06-26 20:39:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// RemoveFileRequest is the request structure of the corresponding request
|
|
|
|
type RemoveFileRequest struct {
|
|
|
|
Files []RmFile `json:"files"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// RmFile is the request structure of the corresponding request
|
|
|
|
type RmFile struct {
|
|
|
|
URL string `json:"url"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// GenericOKResponse is the response structure of the corresponding request
|
|
|
|
type GenericOKResponse struct {
|
|
|
|
Status string `json:"status"`
|
|
|
|
Message string `json:"message"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// MakeFolderRequest is the request structure of the corresponding request
|
|
|
|
type MakeFolderRequest struct {
|
|
|
|
Name string `json:"name"`
|
2019-07-20 01:50:57 +02:00
|
|
|
FolderID int `json:"folder_id"`
|
2019-06-26 20:39:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// MakeFolderResponse is the response structure of the corresponding request
|
|
|
|
type MakeFolderResponse struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
FolderID int `json:"folder_id"`
|
|
|
|
}
|
|
|
|
|
2021-02-22 00:37:38 +01:00
|
|
|
// MoveFileRequest is the request structure of the corresponding request
|
|
|
|
type MoveFileRequest struct {
|
|
|
|
URLs []string `json:"urls"`
|
|
|
|
FolderID int `json:"destination_folder_id"`
|
|
|
|
Rename string `json:"rename,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// MoveFileResponse is the response structure of the corresponding request
|
|
|
|
type MoveFileResponse struct {
|
2021-06-10 13:22:45 +02:00
|
|
|
Status string `json:"status"`
|
|
|
|
Message string `json:"message"`
|
|
|
|
URLs []string `json:"urls"`
|
2021-02-22 00:37:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// CopyFileRequest is the request structure of the corresponding request
|
|
|
|
type CopyFileRequest struct {
|
|
|
|
URLs []string `json:"urls"`
|
|
|
|
FolderID int `json:"folder_id"`
|
|
|
|
Rename string `json:"rename,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// CopyFileResponse is the response structure of the corresponding request
|
|
|
|
type CopyFileResponse struct {
|
2021-06-10 13:22:45 +02:00
|
|
|
Status string `json:"status"`
|
|
|
|
Message string `json:"message"`
|
|
|
|
Copied int `json:"copied"`
|
|
|
|
URLs []FileCopy `json:"urls"`
|
2021-02-22 00:37:38 +01:00
|
|
|
}
|
|
|
|
|
2022-08-14 04:56:32 +02:00
|
|
|
// FileCopy is used in the CopyFileResponse
|
2021-02-22 00:37:38 +01:00
|
|
|
type FileCopy struct {
|
|
|
|
FromURL string `json:"from_url"`
|
|
|
|
ToURL string `json:"to_url"`
|
|
|
|
}
|
|
|
|
|
2021-06-10 14:11:00 +02:00
|
|
|
// RenameFileURL is the data structure to rename a single file
|
|
|
|
type RenameFileURL struct {
|
|
|
|
URL string `json:"url"`
|
|
|
|
Filename string `json:"filename"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// RenameFileRequest is the request structure of the corresponding request
|
|
|
|
type RenameFileRequest struct {
|
|
|
|
URLs []RenameFileURL `json:"urls"`
|
|
|
|
Pretty int `json:"pretty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// RenameFileResponse is the response structure of the corresponding request
|
|
|
|
type RenameFileResponse struct {
|
|
|
|
Status string `json:"status"`
|
|
|
|
Message string `json:"message"`
|
|
|
|
Renamed int `json:"renamed"`
|
|
|
|
URLs []struct {
|
|
|
|
URL string `json:"url"`
|
|
|
|
OldFilename string `json:"old_filename"`
|
|
|
|
NewFilename string `json:"new_filename"`
|
|
|
|
} `json:"urls"`
|
|
|
|
}
|
|
|
|
|
2019-06-26 20:39:01 +02:00
|
|
|
// GetUploadNodeResponse is the response structure of the corresponding request
|
|
|
|
type GetUploadNodeResponse struct {
|
|
|
|
ID string `json:"id"`
|
|
|
|
URL string `json:"url"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetTokenResponse is the response structure of the corresponding request
|
|
|
|
type GetTokenResponse struct {
|
|
|
|
URL string `json:"url"`
|
|
|
|
Status string `json:"Status"`
|
|
|
|
Message string `json:"Message"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// SharedFolderResponse is the response structure of the corresponding request
|
|
|
|
type SharedFolderResponse []SharedFile
|
|
|
|
|
|
|
|
// SharedFile is the structure how 1Fichier returns a shared File
|
|
|
|
type SharedFile struct {
|
|
|
|
Filename string `json:"filename"`
|
|
|
|
Link string `json:"link"`
|
2019-10-01 13:34:38 +02:00
|
|
|
Size int64 `json:"size"`
|
2019-06-26 20:39:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// EndFileUploadResponse is the response structure of the corresponding request
|
|
|
|
type EndFileUploadResponse struct {
|
|
|
|
Incoming int `json:"incoming"`
|
|
|
|
Links []struct {
|
|
|
|
Download string `json:"download"`
|
|
|
|
Filename string `json:"filename"`
|
|
|
|
Remove string `json:"remove"`
|
|
|
|
Size string `json:"size"`
|
|
|
|
Whirlpool string `json:"whirlpool"`
|
|
|
|
} `json:"links"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// File is the structure how 1Fichier returns a File
|
|
|
|
type File struct {
|
|
|
|
CDN int `json:"cdn"`
|
|
|
|
Checksum string `json:"checksum"`
|
|
|
|
ContentType string `json:"content-type"`
|
|
|
|
Date string `json:"date"`
|
|
|
|
Filename string `json:"filename"`
|
|
|
|
Pass int `json:"pass"`
|
2019-10-01 13:34:38 +02:00
|
|
|
Size int64 `json:"size"`
|
2019-06-26 20:39:01 +02:00
|
|
|
URL string `json:"url"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// FilesList is the structure how 1Fichier returns a list of files
|
|
|
|
type FilesList struct {
|
|
|
|
Items []File `json:"items"`
|
|
|
|
Status string `json:"Status"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Folder is the structure how 1Fichier returns a Folder
|
|
|
|
type Folder struct {
|
|
|
|
CreateDate string `json:"create_date"`
|
|
|
|
ID int `json:"id"`
|
|
|
|
Name string `json:"name"`
|
2019-07-20 01:50:57 +02:00
|
|
|
Pass int `json:"pass"`
|
2019-06-26 20:39:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// FoldersList is the structure how 1Fichier returns a list of Folders
|
|
|
|
type FoldersList struct {
|
2019-07-20 01:50:57 +02:00
|
|
|
FolderID int `json:"folder_id"`
|
2019-06-26 20:39:01 +02:00
|
|
|
Name string `json:"name"`
|
|
|
|
Status string `json:"Status"`
|
|
|
|
SubFolders []Folder `json:"sub_folders"`
|
|
|
|
}
|
2022-01-24 03:42:36 +01:00
|
|
|
|
2022-01-26 00:02:17 +01:00
|
|
|
// AccountInfo is the structure how 1Fichier returns user info
|
2022-01-24 03:42:36 +01:00
|
|
|
type AccountInfo struct {
|
|
|
|
StatsDate string `json:"stats_date"`
|
|
|
|
MailRM string `json:"mail_rm"`
|
|
|
|
DefaultQuota int64 `json:"default_quota"`
|
|
|
|
UploadForbidden string `json:"upload_forbidden"`
|
|
|
|
PageLimit int `json:"page_limit"`
|
|
|
|
ColdStorage int64 `json:"cold_storage"`
|
|
|
|
Status string `json:"status"`
|
|
|
|
UseCDN string `json:"use_cdn"`
|
|
|
|
AvailableColdStorage int64 `json:"available_cold_storage"`
|
|
|
|
DefaultPort string `json:"default_port"`
|
|
|
|
DefaultDomain int `json:"default_domain"`
|
|
|
|
Email string `json:"email"`
|
|
|
|
DownloadMenu string `json:"download_menu"`
|
|
|
|
FTPDID int `json:"ftp_did"`
|
|
|
|
DefaultPortFiles string `json:"default_port_files"`
|
|
|
|
FTPReport string `json:"ftp_report"`
|
|
|
|
OverQuota int64 `json:"overquota"`
|
|
|
|
AvailableStorage int64 `json:"available_storage"`
|
|
|
|
CDN string `json:"cdn"`
|
|
|
|
Offer string `json:"offer"`
|
|
|
|
SubscriptionEnd string `json:"subscription_end"`
|
|
|
|
TFA string `json:"2fa"`
|
|
|
|
AllowedColdStorage int64 `json:"allowed_cold_storage"`
|
|
|
|
HotStorage int64 `json:"hot_storage"`
|
|
|
|
DefaultColdStorageQuota int64 `json:"default_cold_storage_quota"`
|
|
|
|
FTPMode string `json:"ftp_mode"`
|
|
|
|
RUReport string `json:"ru_report"`
|
|
|
|
}
|