Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add slugsWithoutIds parameter for product and category requests #323

Merged
merged 2 commits into from
Sep 7, 2023
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
Expand Up @@ -10,6 +10,7 @@ data class CategoriesSearchRequest(
val returnProductIds: Boolean? = null,
val baseUrl: String? = null,
val cleanUrls: Boolean? = null,
val slugsWithoutIds: Boolean? = null,
val offset: Int = 0,
val limit: Int = 100,
val lang: String? = null,
Expand Down Expand Up @@ -47,6 +48,7 @@ data class CategoriesSearchRequest(
request.returnProductIds?.let { put("productIds", it.toString()) }
request.baseUrl?.let { put("baseUrl", it) }
request.cleanUrls?.let { put("cleanUrls", it.toString()) }
request.slugsWithoutIds?.let { put("slugsWithoutIds", it.toString()) }
put("offset", request.offset.toString())
put("limit", request.limit.toString())
request.lang?.let { put("lang", it) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ data class CategoryDetailsRequest(
val categoryId: Int = 0,
val baseUrl: String? = null,
val cleanUrls: Boolean? = null,
val slugsWithoutIds: Boolean? = null,
val lang: String? = null,
val responseFields: ResponseFields = ResponseFields.All,
) : ApiRequest {
Expand All @@ -25,6 +26,7 @@ data class CategoryDetailsRequest(
return mutableMapOf<String, String>().apply {
request.baseUrl?.let { put("baseUrl", it) }
request.cleanUrls?.let { put("cleanUrls", it.toString()) }
request.slugsWithoutIds?.let { put("slugsWithoutIds", it.toString()) }
request.lang?.let { put("lang", it) }
}.toMap()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ data class ProductDetailsRequest(
val productId: Int = 0,
val baseUrl: String? = null,
val cleanUrls: Boolean? = null,
val slugsWithoutIds: Boolean? = null,
val lang: String? = null,
val responseFields: ResponseFields = ResponseFields.All,
) : ApiRequest {
Expand All @@ -25,6 +26,7 @@ data class ProductDetailsRequest(
return mutableMapOf<String, String>().apply {
request.baseUrl?.let { put("baseUrl", it) }
request.cleanUrls?.let { put("cleanUrls", it.toString()) }
request.slugsWithoutIds?.let { put("slugsWithoutIds", it.toString()) }
request.lang?.let { put("lang", it) }
}.toMap()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ sealed class ProductsSearchRequest : ApiRequest {
val isCustomerSetPrice: Boolean? = null,
val baseUrl: String? = null,
val cleanUrls: Boolean? = null,
val slugsWithoutIds: Boolean? = null,
val offset: Int = 0,
val limit: Int = 100,
val lang: String? = null,
Expand Down Expand Up @@ -79,6 +80,7 @@ sealed class ProductsSearchRequest : ApiRequest {
request.includeProductsFromSubcategories?.let { put("includeProductsFromSubcategories", it.toString()) }
request.baseUrl?.let { put("baseUrl", it) }
request.cleanUrls?.let { put("cleanUrls", it.toString()) }
request.slugsWithoutIds?.let { put("slugsWithoutIds", it.toString()) }
request.sortBy?.let { put("sortBy", it.name) }
put("offset", request.offset.toString())
put("limit", request.limit.toString())
Expand All @@ -92,6 +94,7 @@ sealed class ProductsSearchRequest : ApiRequest {
val productIds: List<Int> = listOf(),
val baseUrl: String? = null,
val cleanUrls: Boolean? = null,
val slugsWithoutIds: Boolean? = null,
val sortBy: SortOrder? = null,
val lang: String? = null,
val responseFields: ResponseFields = ResponseFields.All,
Expand All @@ -113,6 +116,7 @@ sealed class ProductsSearchRequest : ApiRequest {
put("productId", request.productIds.joinToString(","))
request.baseUrl?.let { put("baseUrl", it) }
request.cleanUrls?.let { put("cleanUrls", it.toString()) }
request.slugsWithoutIds?.let { put("slugsWithoutIds", it.toString()) }
request.sortBy?.let { put("sortBy", it.name) }
request.lang?.let { put("lang", it) }
}.toMap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.ecwid.apiclient.v3.rule.NullablePropertyRule.AllowNullable
val categoriesSearchRequestNullablePropertyRules: List<NullablePropertyRule<*, *>> = listOf(
AllowNullable(CategoriesSearchRequest::baseUrl),
AllowNullable(CategoriesSearchRequest::cleanUrls),
AllowNullable(CategoriesSearchRequest::slugsWithoutIds),
AllowNullable(CategoriesSearchRequest::hiddenCategories),
AllowNullable(CategoriesSearchRequest::lang),
AllowNullable(CategoriesSearchRequest::returnProductIds)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ import com.ecwid.apiclient.v3.rule.NullablePropertyRule.AllowNullable
val categoryDetailsRequestNullablePropertyRules: List<NullablePropertyRule<*, *>> = listOf(
AllowNullable(CategoryDetailsRequest::baseUrl),
AllowNullable(CategoryDetailsRequest::cleanUrls),
AllowNullable(CategoryDetailsRequest::slugsWithoutIds),
AllowNullable(CategoryDetailsRequest::lang)
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ import com.ecwid.apiclient.v3.rule.NullablePropertyRule.AllowNullable
val productDetailsRequestNullablePropertyRules: List<NullablePropertyRule<*, *>> = listOf(
AllowNullable(ProductDetailsRequest::baseUrl),
AllowNullable(ProductDetailsRequest::cleanUrls),
AllowNullable(ProductDetailsRequest::slugsWithoutIds),
AllowNullable(ProductDetailsRequest::lang)
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ val productsSearchRequestNullablePropertyRules: List<NullablePropertyRule<*, *>>
AllowNullable(ProductsSearchRequest.ByFilters::baseUrl),
AllowNullable(ProductsSearchRequest.ByFilters::categories),
AllowNullable(ProductsSearchRequest.ByFilters::cleanUrls),
AllowNullable(ProductsSearchRequest.ByFilters::slugsWithoutIds),
AllowNullable(ProductsSearchRequest.ByFilters::createdFrom),
AllowNullable(ProductsSearchRequest.ByFilters::createdTo),
AllowNullable(ProductsSearchRequest.ByFilters::enabled),
Expand All @@ -32,6 +33,7 @@ val productsSearchRequestNullablePropertyRules: List<NullablePropertyRule<*, *>>
AllowNullable(ProductsSearchRequest.ByFilters::visibleInStorefront),
AllowNullable(ProductsSearchRequest.ByIds::baseUrl),
AllowNullable(ProductsSearchRequest.ByIds::cleanUrls),
AllowNullable(ProductsSearchRequest.ByIds::slugsWithoutIds),
AllowNullable(ProductsSearchRequest.ByIds::sortBy),
AllowNullable(ProductsSearchRequest.ByIds::lang),
)