-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e32c92
commit d0f069e
Showing
4 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/kotlin/com/ecwid/apiclient/v3/dto/swatches/request/RecentSwatchColorsGetRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.ecwid.apiclient.v3.dto.swatches.request | ||
|
||
import com.ecwid.apiclient.v3.dto.ApiRequest | ||
import com.ecwid.apiclient.v3.impl.RequestInfo | ||
|
||
class RecentSwatchColorsGetRequest : ApiRequest { | ||
override fun toRequestInfo(): RequestInfo { | ||
return RequestInfo.createGetRequest( | ||
pathSegments = listOf( | ||
"swatches", | ||
"recent-colors", | ||
), | ||
) | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/main/kotlin/com/ecwid/apiclient/v3/dto/swatches/result/FetchedSwatchColor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.ecwid.apiclient.v3.dto.swatches.result | ||
|
||
import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO | ||
import com.ecwid.apiclient.v3.dto.common.ApiResultDTO | ||
|
||
data class FetchedSwatchColor( | ||
val name: String = "", | ||
val hexCode: String = "", | ||
) : ApiFetchedDTO, ApiResultDTO { | ||
override fun getModifyKind() = ApiFetchedDTO.ModifyKind.ReadOnly | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/kotlin/com/ecwid/apiclient/v3/impl/SwatchesApiClientImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
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 | ||
|
||
class SwatchesApiClientImpl( | ||
private val apiClientHelper: ApiClientHelper, | ||
) : SwatchesApiClient { | ||
|
||
override fun getRecentSwatchColors(request: RecentSwatchColorsGetRequest) = | ||
apiClientHelper.makeObjectResultRequest<Sequence<FetchedSwatchColor>>(request) | ||
} |