File tree Expand file tree Collapse file tree
src/main/kotlin/com/ecwid/apiclient/v3/dto Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -284,7 +284,15 @@ data class CustomAppRequest(
284284 override val show : AttributeValueLocation ? = null
285285 ) : FetchedAttributeValue {
286286
287- fun Collection<FetchedAttributeValue>.toOrderAttributeList () = this .map { it as AttributeValue }
287+ fun FetchedAttributeValue.toOrderAttribute () = AttributeValue (
288+ id = id,
289+ name = name,
290+ type = type,
291+ value = value,
292+ show = show
293+ )
294+
295+ fun Collection<FetchedAttributeValue>.toOrderAttributeList () = this .map { it.toOrderAttribute() }
288296
289297 }
290298
Original file line number Diff line number Diff line change @@ -279,7 +279,14 @@ data class UpdatedProduct(
279279 override val value : String? = null
280280 ) : UpdatedAttributeValue {
281281
282- fun Collection<UpdatedAttributeValue>.toProductAttributeList () = this .map { it as AttributeValue }
282+ fun UpdatedAttributeValue.toProductAttribute () = AttributeValue (
283+ id = id,
284+ alias = alias,
285+ name = name,
286+ value = value,
287+ )
288+
289+ fun Collection<UpdatedAttributeValue>.toProductAttributeList () = this .map { it.toProductAttribute() }
283290
284291 companion object {
285292
Original file line number Diff line number Diff line change @@ -242,7 +242,15 @@ data class FetchedProduct(
242242 override val show : AttributeValueLocation ? = null
243243 ) : FetchedAttributeValue {
244244
245- fun Collection<FetchedAttributeValue>.toProductAttributeList () = this .map { it as AttributeValue }
245+ fun FetchedAttributeValue.toProductAttribute () = AttributeValue (
246+ id = id,
247+ name = name,
248+ type = type,
249+ value = value,
250+ show = show
251+ )
252+
253+ fun Collection<FetchedAttributeValue>.toProductAttributeList () = this .map { it.toProductAttribute() }
246254
247255 }
248256
Original file line number Diff line number Diff line change @@ -41,7 +41,14 @@ data class UpdatedVariation(
4141 override val value : String? = null
4242 ) : UpdatedAttributeValue {
4343
44- fun Collection<UpdatedAttributeValue>.toVariationAttributeList () = this .map { it as AttributeValue }
44+ fun UpdatedAttributeValue.toVariationAttribute () = AttributeValue (
45+ id = id,
46+ alias = alias,
47+ name = name,
48+ value = value,
49+ )
50+
51+ fun Collection<UpdatedAttributeValue>.toVariationAttributeList () = this .map { it.toVariationAttribute() }
4552
4653 }
4754
Original file line number Diff line number Diff line change @@ -57,7 +57,15 @@ data class FetchedVariation(
5757 override val show : AttributeValueLocation ? = null
5858 ) : FetchedAttributeValue {
5959
60- fun Collection<FetchedAttributeValue>.toVariationAttributeList () = this .map { it as AttributeValue }
60+ fun FetchedAttributeValue.toVariationAttribute () = AttributeValue (
61+ id = id,
62+ name = name,
63+ type = type,
64+ value = value,
65+ show = show
66+ )
67+
68+ fun Collection<FetchedAttributeValue>.toVariationAttributeList () = this .map { it.toVariationAttribute() }
6169
6270 }
6371
You can’t perform that action at this time.
0 commit comments