github.com/rclone/rclone@v1.66.1-0.20240517100346-7b89735ae726/backend/fichier/structs.go (about)

     1  package fichier
     2  
     3  // FileInfoRequest is the request structure of the corresponding request
     4  type FileInfoRequest struct {
     5  	URL string `json:"url"`
     6  }
     7  
     8  // ListFolderRequest is the request structure of the corresponding request
     9  type ListFolderRequest struct {
    10  	FolderID int `json:"folder_id"`
    11  }
    12  
    13  // ListFilesRequest is the request structure of the corresponding request
    14  type ListFilesRequest struct {
    15  	FolderID int `json:"folder_id"`
    16  }
    17  
    18  // DownloadRequest is the request structure of the corresponding request
    19  type DownloadRequest struct {
    20  	URL    string `json:"url"`
    21  	Single int    `json:"single"`
    22  	Pass   string `json:"pass,omitempty"`
    23  	CDN    int    `json:"cdn,omitempty"`
    24  }
    25  
    26  // RemoveFolderRequest is the request structure of the corresponding request
    27  type RemoveFolderRequest struct {
    28  	FolderID int `json:"folder_id"`
    29  }
    30  
    31  // RemoveFileRequest is the request structure of the corresponding request
    32  type RemoveFileRequest struct {
    33  	Files []RmFile `json:"files"`
    34  }
    35  
    36  // RmFile is the request structure of the corresponding request
    37  type RmFile struct {
    38  	URL string `json:"url"`
    39  }
    40  
    41  // GenericOKResponse is the response structure of the corresponding request
    42  type GenericOKResponse struct {
    43  	Status  string `json:"status"`
    44  	Message string `json:"message"`
    45  }
    46  
    47  // MakeFolderRequest is the request structure of the corresponding request
    48  type MakeFolderRequest struct {
    49  	Name     string `json:"name"`
    50  	FolderID int    `json:"folder_id"`
    51  }
    52  
    53  // MakeFolderResponse is the response structure of the corresponding request
    54  type MakeFolderResponse struct {
    55  	Name     string `json:"name"`
    56  	FolderID int    `json:"folder_id"`
    57  }
    58  
    59  // MoveFileRequest is the request structure of the corresponding request
    60  type MoveFileRequest struct {
    61  	URLs     []string `json:"urls"`
    62  	FolderID int      `json:"destination_folder_id"`
    63  	Rename   string   `json:"rename,omitempty"`
    64  }
    65  
    66  // MoveFileResponse is the response structure of the corresponding request
    67  type MoveFileResponse struct {
    68  	Status  string   `json:"status"`
    69  	Message string   `json:"message"`
    70  	URLs    []string `json:"urls"`
    71  }
    72  
    73  // MoveDirRequest is the request structure of the corresponding request
    74  type MoveDirRequest struct {
    75  	FolderID            int    `json:"folder_id"`
    76  	DestinationFolderID int    `json:"destination_folder_id,omitempty"`
    77  	DestinationUser     string `json:"destination_user"`
    78  	Rename              string `json:"rename,omitempty"`
    79  }
    80  
    81  // MoveDirResponse is the response structure of the corresponding request
    82  type MoveDirResponse struct {
    83  	Status  string `json:"status"`
    84  	Message string `json:"message"`
    85  	OldName string `json:"old_name"`
    86  	NewName string `json:"new_name"`
    87  }
    88  
    89  // CopyFileRequest is the request structure of the corresponding request
    90  type CopyFileRequest struct {
    91  	URLs     []string `json:"urls"`
    92  	FolderID int      `json:"folder_id"`
    93  	Rename   string   `json:"rename,omitempty"`
    94  }
    95  
    96  // CopyFileResponse is the response structure of the corresponding request
    97  type CopyFileResponse struct {
    98  	Status  string     `json:"status"`
    99  	Message string     `json:"message"`
   100  	Copied  int        `json:"copied"`
   101  	URLs    []FileCopy `json:"urls"`
   102  }
   103  
   104  // FileCopy is used in the CopyFileResponse
   105  type FileCopy struct {
   106  	FromURL string `json:"from_url"`
   107  	ToURL   string `json:"to_url"`
   108  }
   109  
   110  // RenameFileURL is the data structure to rename a single file
   111  type RenameFileURL struct {
   112  	URL      string `json:"url"`
   113  	Filename string `json:"filename"`
   114  }
   115  
   116  // RenameFileRequest is the request structure of the corresponding request
   117  type RenameFileRequest struct {
   118  	URLs   []RenameFileURL `json:"urls"`
   119  	Pretty int             `json:"pretty"`
   120  }
   121  
   122  // RenameFileResponse is the response structure of the corresponding request
   123  type RenameFileResponse struct {
   124  	Status  string `json:"status"`
   125  	Message string `json:"message"`
   126  	Renamed int    `json:"renamed"`
   127  	URLs    []struct {
   128  		URL         string `json:"url"`
   129  		OldFilename string `json:"old_filename"`
   130  		NewFilename string `json:"new_filename"`
   131  	} `json:"urls"`
   132  }
   133  
   134  // GetUploadNodeResponse is the response structure of the corresponding request
   135  type GetUploadNodeResponse struct {
   136  	ID  string `json:"id"`
   137  	URL string `json:"url"`
   138  }
   139  
   140  // GetTokenResponse is the response structure of the corresponding request
   141  type GetTokenResponse struct {
   142  	URL     string `json:"url"`
   143  	Status  string `json:"Status"`
   144  	Message string `json:"Message"`
   145  }
   146  
   147  // SharedFolderResponse is the response structure of the corresponding request
   148  type SharedFolderResponse []SharedFile
   149  
   150  // SharedFile is the structure how 1Fichier returns a shared File
   151  type SharedFile struct {
   152  	Filename string `json:"filename"`
   153  	Link     string `json:"link"`
   154  	Size     int64  `json:"size"`
   155  }
   156  
   157  // EndFileUploadResponse is the response structure of the corresponding request
   158  type EndFileUploadResponse struct {
   159  	Incoming int `json:"incoming"`
   160  	Links    []struct {
   161  		Download  string `json:"download"`
   162  		Filename  string `json:"filename"`
   163  		Remove    string `json:"remove"`
   164  		Size      string `json:"size"`
   165  		Whirlpool string `json:"whirlpool"`
   166  	} `json:"links"`
   167  }
   168  
   169  // File is the structure how 1Fichier returns a File
   170  type File struct {
   171  	CDN         int    `json:"cdn"`
   172  	Checksum    string `json:"checksum"`
   173  	ContentType string `json:"content-type"`
   174  	Date        string `json:"date"`
   175  	Filename    string `json:"filename"`
   176  	Pass        int    `json:"pass"`
   177  	Size        int64  `json:"size"`
   178  	URL         string `json:"url"`
   179  }
   180  
   181  // FilesList is the structure how 1Fichier returns a list of files
   182  type FilesList struct {
   183  	Items  []File `json:"items"`
   184  	Status string `json:"Status"`
   185  }
   186  
   187  // Folder is the structure how 1Fichier returns a Folder
   188  type Folder struct {
   189  	CreateDate string `json:"create_date"`
   190  	ID         int    `json:"id"`
   191  	Name       string `json:"name"`
   192  	Pass       int    `json:"pass"`
   193  }
   194  
   195  // FoldersList is the structure how 1Fichier returns a list of Folders
   196  type FoldersList struct {
   197  	FolderID   int      `json:"folder_id"`
   198  	Name       string   `json:"name"`
   199  	Status     string   `json:"Status"`
   200  	SubFolders []Folder `json:"sub_folders"`
   201  }
   202  
   203  // AccountInfo is the structure how 1Fichier returns user info
   204  type AccountInfo struct {
   205  	StatsDate               string `json:"stats_date"`
   206  	MailRM                  string `json:"mail_rm"`
   207  	DefaultQuota            int64  `json:"default_quota"`
   208  	UploadForbidden         string `json:"upload_forbidden"`
   209  	PageLimit               int    `json:"page_limit"`
   210  	ColdStorage             int64  `json:"cold_storage"`
   211  	Status                  string `json:"status"`
   212  	UseCDN                  string `json:"use_cdn"`
   213  	AvailableColdStorage    int64  `json:"available_cold_storage"`
   214  	DefaultPort             string `json:"default_port"`
   215  	DefaultDomain           int    `json:"default_domain"`
   216  	Email                   string `json:"email"`
   217  	DownloadMenu            string `json:"download_menu"`
   218  	FTPDID                  int    `json:"ftp_did"`
   219  	DefaultPortFiles        string `json:"default_port_files"`
   220  	FTPReport               string `json:"ftp_report"`
   221  	OverQuota               int64  `json:"overquota"`
   222  	AvailableStorage        int64  `json:"available_storage"`
   223  	CDN                     string `json:"cdn"`
   224  	Offer                   string `json:"offer"`
   225  	SubscriptionEnd         string `json:"subscription_end"`
   226  	TFA                     string `json:"2fa"`
   227  	AllowedColdStorage      int64  `json:"allowed_cold_storage"`
   228  	HotStorage              int64  `json:"hot_storage"`
   229  	DefaultColdStorageQuota int64  `json:"default_cold_storage_quota"`
   230  	FTPMode                 string `json:"ftp_mode"`
   231  	RUReport                string `json:"ru_report"`
   232  }