make field non nullable

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk
2025-07-02 11:06:10 +02:00
committed by backportbot[bot]
parent e624e2a110
commit 27e0a2a71f
3 changed files with 11 additions and 11 deletions

View File

@ -16,7 +16,7 @@ data class TaskTypes(
data class TaskType(
val id: String?,
val name: String?,
val name: String,
val description: String?
)
@ -26,7 +26,7 @@ fun TaskTypes.toV2(): List<TaskTypeData> =
id = taskType.id,
name = taskType.name,
description = taskType.description,
inputShape = null,
outputShape = null
inputShape = emptyMap(),
outputShape = emptyMap()
)
}

View File

@ -95,11 +95,11 @@ class GetTaskTypesRemoteOperationV2 : OCSRemoteOperation<List<TaskTypeData>>() {
val outputShape = taskType.outputShape
val hasOneTextInput =
inputShape?.size == 1 &&
inputShape.size == 1 &&
inputShape.values.first().type == supportedTaskType
val hasOneTextOutput =
outputShape?.size == 1 &&
outputShape.size == 1 &&
outputShape.values.first().type == supportedTaskType
return hasOneTextInput && hasOneTextOutput

View File

@ -14,14 +14,14 @@ data class TaskTypes(
data class TaskTypeData(
val id: String?,
val name: String?,
val name: String,
val description: String?,
val inputShape: Map<String, Shape>?,
val outputShape: Map<String, Shape>?
val inputShape: Map<String, Shape>,
val outputShape: Map<String, Shape>
)
data class Shape(
val name: String?,
val description: String?,
val type: String?
val name: String,
val description: String,
val type: String
)