-
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.
Merge pull request #420 from Ecwid/ECWID-142216
Ecwid 142216
- Loading branch information
Showing
8 changed files
with
61 additions
and
19 deletions.
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
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,30 @@ | ||
package com.ecwid.apiclient.v3 | ||
|
||
import com.ecwid.apiclient.v3.dto.common.PartialResult | ||
import com.ecwid.apiclient.v3.dto.order.request.* | ||
import com.ecwid.apiclient.v3.dto.order.result.* | ||
import kotlin.reflect.KClass | ||
|
||
// Orders | ||
// https://developers.ecwid.com/api-documentation/orders | ||
interface OrdersApiClient { | ||
fun searchOrders(request: OrdersSearchRequest): OrdersSearchResult | ||
fun <Result> searchOrders(request: OrdersSearchRequest, resultClass: KClass<Result>): Result | ||
where Result : PartialResult<OrdersSearchResult> | ||
fun searchOrdersAsSequence(request: OrdersSearchRequest): Sequence<FetchedOrder> | ||
fun getOrderDetails(request: OrderDetailsRequest): FetchedOrder | ||
fun getOrderInvoice(request: OrderInvoiceRequest): String | ||
fun createOrder(request: OrderCreateRequest): OrderCreateResult | ||
fun updateOrder(request: OrderUpdateRequest): OrderUpdateResult | ||
fun deleteOrder(request: OrderDeleteRequest): OrderDeleteResult | ||
fun uploadOrderItemOptionFile(request: OrderItemOptionFileUploadRequest): OrderItemOptionFileUploadResult | ||
fun deleteOrderItemOptionFile(request: OrderItemOptionFileDeleteRequest): OrderItemOptionFileDeleteResult | ||
fun deleteOrderItemOptionFiles(request: OrderItemOptionFilesDeleteRequest): OrderItemOptionFileDeleteResult | ||
fun searchDeletedOrders(request: DeletedOrdersSearchRequest): DeletedOrdersSearchResult | ||
fun searchDeletedOrdersAsSequence(request: DeletedOrdersSearchRequest): Sequence<DeletedOrder> | ||
} | ||
|
||
@Suppress("EXTENSION_SHADOWED_BY_MEMBER") | ||
inline fun <reified Result : PartialResult<OrdersSearchResult>> OrdersApiClient.searchOrders(request: OrdersSearchRequest): Result { | ||
return searchOrders(request, Result::class) | ||
} |
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
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
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
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
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
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