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

com.ecwid.apiclient.v3.CategoriesApiClient.kt Maven / Gradle / Ivy

The newest version!
package com.ecwid.apiclient.v3

import com.ecwid.apiclient.v3.dto.category.request.*
import com.ecwid.apiclient.v3.dto.category.result.*
import com.ecwid.apiclient.v3.dto.common.PagingResult
import com.ecwid.apiclient.v3.dto.common.PartialResult
import kotlin.reflect.KClass

// Categories
// https://developers.ecwid.com/api-documentation/categories
interface CategoriesApiClient {
	fun searchCategories(request: CategoriesSearchRequest): CategoriesSearchResult
	fun  searchCategories(request: CategoriesSearchRequest, resultClass: KClass): Result
		where Result : PartialResult

	fun searchCategoriesAsSequence(request: CategoriesSearchRequest): Sequence
	fun  searchCategoriesAsSequence(request: CategoriesSearchRequest, resultClass: KClass): Sequence
		where Result : PartialResult, Result : PagingResult

	fun searchCategoriesByPath(request: CategoriesByPathRequest): CategoriesSearchResult
	fun  searchCategoriesByPath(request: CategoriesByPathRequest, resultClass: KClass): Result
		where Result : PartialResult

	fun searchCategoriesByPathAsSequence(request: CategoriesByPathRequest): Sequence
	fun  searchCategoriesByPathAsSequence(request: CategoriesByPathRequest, resultClass: KClass): Sequence
		where Result : PartialResult, Result : PagingResult

	fun getCategoryDetails(request: CategoryDetailsRequest): FetchedCategory
	fun  getCategoryDetails(request: CategoryDetailsRequest, resultClass: KClass): Result
		where Result : PartialResult

	fun createCategory(request: CategoryCreateRequest): CategoryCreateResult
	fun updateCategory(request: CategoryUpdateRequest): CategoryUpdateResult
	fun deleteCategory(request: CategoryDeleteRequest): CategoryDeleteResult
	fun uploadCategoryImage(request: CategoryImageUploadRequest): CategoryImageUploadResult
	fun uploadCategoryImageAsync(request: CategoryImageAsyncUploadRequest): CategoryImageAsyncUploadResult
	fun deleteCategoryImage(request: CategoryImageDeleteRequest): CategoryImageDeleteResult
	fun assignProductsToCategory(request: AssignProductsToCategoryRequest): CategoryUpdateResult
	fun unassignProductsFromCategory(request: UnassignProductsFromCategoryRequest): CategoryDeleteResult
}

@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
inline fun > CategoriesApiClient.getCategoryDetails(request: CategoryDetailsRequest): Result {
	return getCategoryDetails(request, Result::class)
}

@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
inline fun > CategoriesApiClient.searchCategories(request: CategoriesSearchRequest): Result {
	return searchCategories(request, Result::class)
}

@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
inline fun > CategoriesApiClient.searchCategoriesByPath(request: CategoriesByPathRequest): Result {
	return searchCategoriesByPath(request, Result::class)
}

@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
inline fun  CategoriesApiClient.searchCategoriesAsSequence(
	request: CategoriesSearchRequest,
): Sequence where Result : PartialResult, Result : PagingResult {
	return searchCategoriesAsSequence(
		request = request,
		resultClass = Result::class,
	)
}

@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
inline fun  CategoriesApiClient.searchCategoriesByPathAsSequence(
	request: CategoriesByPathRequest,
): Sequence where Result : PartialResult, Result : PagingResult {
	return searchCategoriesByPathAsSequence(
		request = request,
		resultClass = Result::class,
	)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy