Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.ecwid.apiclient.v3.dto.common

import com.ecwid.apiclient.v3.dto.product.enums.AttributeValueLocation
import com.ecwid.apiclient.v3.dto.producttype.enums.AttributeType

interface FetchedAttributeValue {
val id: Int?
val name: String?
val type: AttributeType?
val value: String?
val show: AttributeValueLocation?
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.ecwid.apiclient.v3.dto.common

import com.ecwid.apiclient.v3.dto.product.enums.AttributeValueAlias

interface UpdatedAttributeValue {
val id: Int?
val alias: AttributeValueAlias?
val name: String?
val value: String?
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package com.ecwid.apiclient.v3.dto.custom

import com.ecwid.apiclient.v3.dto.cart.result.FetchedCart
import com.ecwid.apiclient.v3.dto.common.ApiRequestDTO
import com.ecwid.apiclient.v3.dto.common.OrderedStringToListStringMap
import com.ecwid.apiclient.v3.dto.common.OrderedStringToStringMap
import com.ecwid.apiclient.v3.dto.common.PictureInfo
import com.ecwid.apiclient.v3.dto.common.*
import com.ecwid.apiclient.v3.dto.order.enums.*
import com.ecwid.apiclient.v3.dto.product.enums.AttributeValueLocation
import com.ecwid.apiclient.v3.dto.producttype.enums.AttributeType
Expand Down Expand Up @@ -226,7 +223,10 @@ data class CustomAppRequest(
val applicationLimit: DiscountCouponApplicationLimit? = null,
val creationDate: Date? = null,
val orderCount: Int? = null,
@Deprecated("This field is added for backward compatibility only. Don't use it.", replaceWith = ReplaceWith("catalogLimit"))
@Deprecated(
"This field is added for backward compatibility only. Don't use it.",
replaceWith = ReplaceWith("catalogLimit")
)
val legacyCatalogLimit: DiscountCouponCatalogLimit? = null,
val catalogLimit: DiscountCouponCatalogLimit? = null,
val repeatCustomerOnly: Boolean? = null,
Expand Down Expand Up @@ -277,12 +277,16 @@ data class CustomAppRequest(
)

data class AttributeValue(
val id: Int? = null,
val name: String? = null,
val type: AttributeType? = null,
val value: String? = null,
val show: AttributeValueLocation? = null
)
override val id: Int? = null,
override val name: String? = null,
override val type: AttributeType? = null,
override val value: String? = null,
override val show: AttributeValueLocation? = null
) : FetchedAttributeValue {

fun Collection<FetchedAttributeValue>.toOrderAttributeList() = this.map { it as AttributeValue }

}

data class ProductDimensions(
val length: Double? = null,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package com.ecwid.apiclient.v3.dto.product.request

import com.ecwid.apiclient.v3.dto.common.NullableUpdatedValue
import com.ecwid.apiclient.v3.dto.common.ApiUpdatedDTO
import com.ecwid.apiclient.v3.dto.common.*
import com.ecwid.apiclient.v3.dto.common.ApiUpdatedDTO.ModifyKind
import com.ecwid.apiclient.v3.dto.common.LocalizedValueMap
import com.ecwid.apiclient.v3.dto.common.ProductCondition
import com.ecwid.apiclient.v3.dto.product.enums.*
import com.ecwid.apiclient.v3.dto.product.result.FetchedProduct

Expand Down Expand Up @@ -276,11 +273,13 @@ data class UpdatedProduct(
)

data class AttributeValue internal constructor(
val id: Int? = null,
val alias: AttributeValueAlias? = null,
val name: String? = null,
val value: String? = null
) {
override val id: Int? = null,
override val alias: AttributeValueAlias? = null,
override val name: String? = null,
override val value: String? = null
) : UpdatedAttributeValue {

fun Collection<UpdatedAttributeValue>.toProductAttributeList() = this.map { it as AttributeValue }

companion object {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package com.ecwid.apiclient.v3.dto.product.result

import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO
import com.ecwid.apiclient.v3.dto.common.*
import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO.ModifyKind
import com.ecwid.apiclient.v3.dto.common.LocalizedValueMap
import com.ecwid.apiclient.v3.dto.common.PictureInfo
import com.ecwid.apiclient.v3.dto.common.ProductCondition
import com.ecwid.apiclient.v3.dto.product.enums.*
import com.ecwid.apiclient.v3.dto.product.request.UpdatedProduct
import com.ecwid.apiclient.v3.dto.producttype.enums.AttributeType
Expand Down Expand Up @@ -238,12 +235,16 @@ data class FetchedProduct(
)

data class AttributeValue(
val id: Int? = null,
val name: String? = null,
val type: AttributeType? = null,
val value: String? = null,
val show: AttributeValueLocation? = null
)
override val id: Int? = null,
override val name: String? = null,
override val type: AttributeType? = null,
override val value: String? = null,
override val show: AttributeValueLocation? = null
) : FetchedAttributeValue {

fun Collection<FetchedAttributeValue>.toProductAttributeList() = this.map { it as AttributeValue }

}

data class RelatedProducts(
val productIds: List<Int>? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.ecwid.apiclient.v3.dto.variation.request

import com.ecwid.apiclient.v3.dto.common.ApiUpdatedDTO
import com.ecwid.apiclient.v3.dto.common.ApiUpdatedDTO.ModifyKind
import com.ecwid.apiclient.v3.dto.common.UpdatedAttributeValue
import com.ecwid.apiclient.v3.dto.product.enums.AttributeValueAlias
import com.ecwid.apiclient.v3.dto.product.enums.OutOfStockVisibilityBehaviour
import com.ecwid.apiclient.v3.dto.variation.result.FetchedVariation
Expand Down Expand Up @@ -34,11 +35,15 @@ data class UpdatedVariation(
) : ApiUpdatedDTO {

data class AttributeValue(
val id: Int? = null,
val alias: AttributeValueAlias? = null,
val name: String? = null,
val value: String? = null
)
override val id: Int? = null,
override val alias: AttributeValueAlias? = null,
override val name: String? = null,
override val value: String? = null
) : UpdatedAttributeValue {

fun Collection<UpdatedAttributeValue>.toVariationAttributeList() = this.map { it as AttributeValue }

}

data class WholesalePrice(
val quantity: Int = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.ecwid.apiclient.v3.dto.variation.result

import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO
import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO.ModifyKind
import com.ecwid.apiclient.v3.dto.common.FetchedAttributeValue
import com.ecwid.apiclient.v3.dto.common.LocalizedValueMap
import com.ecwid.apiclient.v3.dto.product.enums.AttributeValueLocation
import com.ecwid.apiclient.v3.dto.product.enums.OutOfStockVisibilityBehaviour
Expand Down Expand Up @@ -49,12 +50,16 @@ data class FetchedVariation(
) : ApiFetchedDTO {

data class AttributeValue(
val id: Int? = null,
val name: String? = null,
val type: AttributeType? = null,
val value: String? = null,
val show: AttributeValueLocation? = null
)
override val id: Int? = null,
override val name: String? = null,
override val type: AttributeType? = null,
override val value: String? = null,
override val show: AttributeValueLocation? = null
) : FetchedAttributeValue {

fun Collection<FetchedAttributeValue>.toVariationAttributeList() = this.map { it as AttributeValue }

}

data class WholesalePrice(
val quantity: Int = 0,
Expand Down