All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ecwid.apiclient.v3.impl.ProductVariationsApiClientImpl.kt Maven / Gradle / Ivy

There is a newer version: 0.347.0
Show newest version
package com.ecwid.apiclient.v3.impl

import com.ecwid.apiclient.v3.ApiClientHelper
import com.ecwid.apiclient.v3.ProductVariationsApiClient
import com.ecwid.apiclient.v3.dto.common.PartialResult
import com.ecwid.apiclient.v3.dto.variation.request.*
import com.ecwid.apiclient.v3.dto.variation.result.*
import kotlin.reflect.KClass

internal class ProductVariationsApiClientImpl(
	private val apiClientHelper: ApiClientHelper
) : ProductVariationsApiClient {
	override fun createProductVariation(request: CreateProductVariationRequest) =
		apiClientHelper.makeObjectResultRequest(request)

	override fun uploadVariationImage(request: ProductVariationImageUploadRequest) =
		apiClientHelper.makeObjectResultRequest(request)

	override fun uploadProductVariationImageAsync(request: ProductVariationImageAsyncUploadRequest) =
		apiClientHelper.makeObjectResultRequest(request)

	override fun deleteVariationImage(request: ProductVariationImageDeleteRequest) =
		apiClientHelper.makeObjectResultRequest(request)

	override fun getAllProductVariations(request: ProductVariationsRequest) =
		apiClientHelper.makeObjectResultRequest(request)

	override fun > getAllProductVariations(request: ProductVariationsRequest, resultClass: KClass): List {
		return apiClientHelper.makeObjectPartialResultRequestList(request, resultClass)
	}

	override fun getProductVariation(request: ProductVariationDetailsRequest) =
		apiClientHelper.makeObjectResultRequest(request)

	override fun > getProductVariation(request: ProductVariationDetailsRequest, resultClass: KClass): Result {
		return apiClientHelper.makeObjectPartialResultRequest(request, resultClass)
	}

	override fun updateProductVariation(request: UpdateProductVariationRequest) =
		apiClientHelper.makeObjectResultRequest(request)

	override fun deleteProductVariation(request: DeleteProductVariationRequest) =
		apiClientHelper.makeObjectResultRequest(request)

	override fun deleteAllProductVariations(request: DeleteAllProductVariationsRequest) =
		apiClientHelper.makeObjectResultRequest(request)

	override fun adjustVariationInventory(request: AdjustVariationInventoryRequest) =
		apiClientHelper.makeObjectResultRequest(request)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy