Skip to content

Commit bab9eee

Browse files
committed
Return FetchedSwatcheColorsResult in response instend of Sequence of FetchedSwatchColor
1 parent f393e9d commit bab9eee

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/main/kotlin/com/ecwid/apiclient/v3/ApiClient.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import com.ecwid.apiclient.v3.dto.subscriptions.request.SubscriptionsSearchReque
4444
import com.ecwid.apiclient.v3.dto.subscriptions.result.FetchedSubscription
4545
import com.ecwid.apiclient.v3.dto.subscriptions.result.SubscriptionsSearchResult
4646
import com.ecwid.apiclient.v3.dto.swatches.request.RecentSwatchColorsGetRequest
47-
import com.ecwid.apiclient.v3.dto.swatches.result.FetchedSwatchColor
47+
import com.ecwid.apiclient.v3.dto.swatches.result.FetchedSwatchColorsResult
4848
import com.ecwid.apiclient.v3.dto.variation.request.*
4949
import com.ecwid.apiclient.v3.dto.variation.result.*
5050
import com.ecwid.apiclient.v3.httptransport.HttpTransport
@@ -324,5 +324,5 @@ interface ProductReviewsApiClient {
324324

325325
// Swatches
326326
interface SwatchesApiClient {
327-
fun getRecentSwatchColors(request: RecentSwatchColorsGetRequest): Sequence<FetchedSwatchColor>
327+
fun getRecentSwatchColors(request: RecentSwatchColorsGetRequest): FetchedSwatchColorsResult
328328
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.ecwid.apiclient.v3.dto.swatches.result
2+
3+
import com.ecwid.apiclient.v3.dto.common.ApiResultDTO
4+
5+
data class FetchedSwatchColorsResult(
6+
val colors: List<FetchedSwatchColor> = listOf(),
7+
) : ApiResultDTO

src/main/kotlin/com/ecwid/apiclient/v3/impl/SwatchesApiClientImpl.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ package com.ecwid.apiclient.v3.impl
33
import com.ecwid.apiclient.v3.ApiClientHelper
44
import com.ecwid.apiclient.v3.SwatchesApiClient
55
import com.ecwid.apiclient.v3.dto.swatches.request.RecentSwatchColorsGetRequest
6-
import com.ecwid.apiclient.v3.dto.swatches.result.FetchedSwatchColor
6+
import com.ecwid.apiclient.v3.dto.swatches.result.FetchedSwatchColorsResult
77

88
class SwatchesApiClientImpl(
99
private val apiClientHelper: ApiClientHelper,
1010
) : SwatchesApiClient {
1111

1212
override fun getRecentSwatchColors(request: RecentSwatchColorsGetRequest) =
13-
apiClientHelper.makeObjectResultRequest<Sequence<FetchedSwatchColor>>(request)
13+
apiClientHelper.makeObjectResultRequest<FetchedSwatchColorsResult>(request)
1414
}

0 commit comments

Comments
 (0)