diff --git a/Network/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/repositories/TransferRepository.kt b/Network/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/repositories/TransferRepository.kt new file mode 100644 index 00000000..3aa562ee --- /dev/null +++ b/Network/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/repositories/TransferRepository.kt @@ -0,0 +1,32 @@ +/* + * 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 . + */ + +package com.infomaniak.multiplatform_swisstransfer.network.repositories + +import com.infomaniak.multiplatform_swisstransfer.network.models.ApiResponse +import com.infomaniak.multiplatform_swisstransfer.network.models.transfer.TransferApi +import com.infomaniak.multiplatform_swisstransfer.network.requests.TransferRequest +import io.ktor.client.HttpClient +import kotlinx.serialization.json.Json + +class TransferRepository internal constructor(private val transferRequest: TransferRequest) { + + constructor(json: Json, httpClient: HttpClient) : this(TransferRequest(json, httpClient)) + + suspend fun getTransfer(linkUUID: String): ApiResponse = transferRequest.getTransfer(linkUUID) +} diff --git a/Network/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/repositories/UploadRepository.kt b/Network/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/repositories/UploadRepository.kt new file mode 100644 index 00000000..4b8c7fb9 --- /dev/null +++ b/Network/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/repositories/UploadRepository.kt @@ -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 . + */ + +package com.infomaniak.multiplatform_swisstransfer.network.repositories + +import com.infomaniak.multiplatform_swisstransfer.network.requests.UploadRequest +import io.ktor.client.HttpClient +import kotlinx.serialization.json.Json + +class UploadRepository internal constructor(private val uploadRequest: UploadRequest) { + + constructor(json: Json, httpClient: HttpClient) : this(UploadRequest(json, httpClient)) + + // TODO: implement method here +}