Skip to content

Commit

Permalink
core: Common models
Browse files Browse the repository at this point in the history
  • Loading branch information
sirambd committed Jul 2, 2024
1 parent 21a3bcf commit 6c1afc1
Show file tree
Hide file tree
Showing 6 changed files with 196 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Infomaniak SwissTransfer - Multiplatform
* Copyright (C) 2024 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.infomaniak.multiplatform_swisstransfer.common.interfaces

interface Container<F : List<File>> {
var uuid: String
var duration: Long
var createdDateTimestamp: Long
var expiredDateTimestamp: Long
var numberOfFile: Long
var message: String?
var needPassword: Long
var lang: String
var sizeUploaded: Long
var deletedDateTimestamp: Long?
var swiftVersion: Long
var downloadLimit: Long
var source: String

// @SerialName("WSUser") TODO: What's it ?
//val wsUser: JsonElement?

var files: F
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Infomaniak SwissTransfer - Multiplatform
* Copyright (C) 2024 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.infomaniak.multiplatform_swisstransfer.common.interfaces

interface File {
var containerUUID: String
var uuid: String
var fileName: String
var fileSizeInBytes: Long
var downloadCounter: Long
var createdDateTimestamp: Long
var expiredDateTimestamp: Long
var eVirus: String
var deletedDate: String?
var mimeType: String
var receivedSizeInBytes: Long
var path: String?
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Infomaniak SwissTransfer - Multiplatform
* Copyright (C) 2024 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.infomaniak.multiplatform_swisstransfer.common.interfaces

interface Transfer<ContainerType> {
var linkUUID: String
var containerUUID: String
var downloadCounterCredit: Long
var createdDateTimestamp: Long
var expiredDateTimestamp: Long
var isDownloadOnetime: Long
var isMailSent: Boolean
var downloadHost: String
var container: ContainerType
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Infomaniak SwissTransfer - Multiplatform
* Copyright (C) 2024 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.infomaniak.multiplatform_swisstransfer.common.interfaces.upload

interface UploadCompleteResponse {
var linkUUID: String
var containerUUID: String
var userEmail: String?
var downloadCounterCredit: Long
var createdDateTimestamp: Long
var expiredDateTimestamp: Long
var isDownloadOnetime: Boolean
var isMailSent: Boolean
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Infomaniak SwissTransfer - Multiplatform
* Copyright (C) 2024 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.infomaniak.multiplatform_swisstransfer.common.interfaces.upload

interface UploadContainer {
val uuid: String
val duration: String
val downloadLimit: Long
val lang: String
val source: String
val wsUser: String?
val authorIP: String
val swiftVersion: String

// val createdDate: Object TODO: (Date) Waiting or deserialize this complex date object to timestamp
val expiredDateTimestamp: Long
val needPassword: Boolean
val message: String
val numberOfFile: Long
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Infomaniak SwissTransfer - Multiplatform
* Copyright (C) 2024 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.infomaniak.multiplatform_swisstransfer.common.interfaces.upload

interface UploadContainerResponse<C : UploadContainer> {
var container: C
var uploadHost: String
var filesUUID: List<String>
}

0 comments on commit 6c1afc1

Please sign in to comment.