Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/leip 164 upload images #55

Merged
merged 4 commits into from
Nov 2, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions libs/model/src/main/kotlin/de/cyface/model/RequestMetaData.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2022 Cyface GmbH
* Copyright 2021-2023 Cyface GmbH
*
* This file is part of the Serialization.
*
Expand All @@ -26,7 +26,7 @@ import java.nio.charset.Charset
* The metadata as transmitted in the request header or pre-request body.
*
* @author Armin Schnabel
* @version 1.0.1
* @version 2.0.0
* @since 6.0.0
* @property deviceType The worldwide unique identifier of the device uploading the data.
* @property measurementIdentifier The device wide unique identifier of the uploaded measurement.
Expand All @@ -39,6 +39,9 @@ import java.nio.charset.Charset
* @property endLocation The `GeoLocation` at the end of the track represented by the transmitted measurement.
* @property modality The modality type used to capture the measurement.
* @property formatVersion The format version of the upload file.
* @property logCount The number of logs captured for this measurement.
hb0 marked this conversation as resolved.
Show resolved Hide resolved
* @property imageCount The number of images captured for this measurement.
* @property videoCount The number of videos captured for this measurement.
*/
@Suppress("unused") // Part of the API
data class RequestMetaData(
Expand All @@ -52,7 +55,10 @@ data class RequestMetaData(
val startLocation: GeoLocation?,
val endLocation: GeoLocation?,
val modality: String,
val formatVersion: Int
val formatVersion: Int,
val logCount: Int,
val imageCount: Int,
val videoCount: Int
) : Serializable {

init {
Expand Down Expand Up @@ -89,6 +95,9 @@ data class RequestMetaData(
require(formatVersion == CURRENT_TRANSFER_FILE_FORMAT_VERSION) {
"Unsupported formatVersion: ${formatVersion.toLong()}"
}
require(logCount >= 0) { "Invalid logCount: $logCount" }
require(imageCount >= 0) { "Invalid imageCount: $imageCount" }
require(videoCount >= 0) { "Invalid videoCount: $videoCount" }
}

/**
Expand Down