package com.github.nullptroma.wallenc.domain.vault.network.yandexdisk.dto

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonProperty
import java.time.Instant

@JsonIgnoreProperties(ignoreUnknown = true)
data class DiskInfoDto(
    @param:JsonProperty("trash_size") val trashSize: Long? = null,
    @param:JsonProperty("total_space") val totalSpace: Long? = null,
    @param:JsonProperty("used_space") val usedSpace: Long? = null,
)

@JsonIgnoreProperties(ignoreUnknown = true)
data class LinkDto(
    val href: String,
    val method: String,
    val templated: Boolean? = null,
)

@JsonIgnoreProperties(ignoreUnknown = true)
data class EmbeddedResourceListDto(
    val items: List<ResourceDto>? = null,
    val total: Int? = null,
    val path: String? = null,
    val sort: String? = null,
    val limit: Int? = null,
    val offset: Int? = null,
)

@JsonIgnoreProperties(ignoreUnknown = true)
data class ResourceDto(
    val path: String? = null,
    val type: String? = null,
    val name: String? = null,
    val size: Long? = null,
    val modified: Instant? = null,
    val created: Instant? = null,
    @param:JsonProperty("mime_type") val mimeType: String? = null,
    val md5: String? = null,
    @param:JsonProperty("custom_properties") val customProperties: Map<String, Any?>? = null,
    @param:JsonProperty("_embedded") val embedded: EmbeddedResourceListDto? = null,
)

@JsonIgnoreProperties(ignoreUnknown = true)
data class OperationStatusDto(
    val status: String? = null,
)

@JsonIgnoreProperties(ignoreUnknown = true)
data class CustomPropertiesPatchDto(
    @param:JsonProperty("custom_properties") val customProperties: Map<String, String>,
)
