Skip to content

Commit

Permalink
Return FetchedSwatcheColorsResult in response instend of Sequence of …
Browse files Browse the repository at this point in the history
…FetchedSwatchColor
  • Loading branch information
aleskarova committed Jan 27, 2025
1 parent f393e9d commit bab9eee
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/com/ecwid/apiclient/v3/ApiClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import com.ecwid.apiclient.v3.dto.subscriptions.request.SubscriptionsSearchReque
import com.ecwid.apiclient.v3.dto.subscriptions.result.FetchedSubscription
import com.ecwid.apiclient.v3.dto.subscriptions.result.SubscriptionsSearchResult
import com.ecwid.apiclient.v3.dto.swatches.request.RecentSwatchColorsGetRequest
import com.ecwid.apiclient.v3.dto.swatches.result.FetchedSwatchColor
import com.ecwid.apiclient.v3.dto.swatches.result.FetchedSwatchColorsResult
import com.ecwid.apiclient.v3.dto.variation.request.*
import com.ecwid.apiclient.v3.dto.variation.result.*
import com.ecwid.apiclient.v3.httptransport.HttpTransport
Expand Down Expand Up @@ -324,5 +324,5 @@ interface ProductReviewsApiClient {

// Swatches
interface SwatchesApiClient {
fun getRecentSwatchColors(request: RecentSwatchColorsGetRequest): Sequence<FetchedSwatchColor>
fun getRecentSwatchColors(request: RecentSwatchColorsGetRequest): FetchedSwatchColorsResult
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.ecwid.apiclient.v3.dto.swatches.result

import com.ecwid.apiclient.v3.dto.common.ApiResultDTO

data class FetchedSwatchColorsResult(
val colors: List<FetchedSwatchColor> = listOf(),
) : ApiResultDTO
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package com.ecwid.apiclient.v3.impl
import com.ecwid.apiclient.v3.ApiClientHelper
import com.ecwid.apiclient.v3.SwatchesApiClient
import com.ecwid.apiclient.v3.dto.swatches.request.RecentSwatchColorsGetRequest
import com.ecwid.apiclient.v3.dto.swatches.result.FetchedSwatchColor
import com.ecwid.apiclient.v3.dto.swatches.result.FetchedSwatchColorsResult

class SwatchesApiClientImpl(
private val apiClientHelper: ApiClientHelper,
) : SwatchesApiClient {

override fun getRecentSwatchColors(request: RecentSwatchColorsGetRequest) =
apiClientHelper.makeObjectResultRequest<Sequence<FetchedSwatchColor>>(request)
apiClientHelper.makeObjectResultRequest<FetchedSwatchColorsResult>(request)
}

0 comments on commit bab9eee

Please sign in to comment.