-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Right know we have a mixed api design.
Sometimes we add the ApiModels to the function, sometimes we creaet the ApiModels there.
Example - creating the ApiModel:
kmp-passenger-api/library/src/commonMain/kotlin/com/ioki/passenger/api/IokiService.kt
Lines 677 to 689 in 84ae5d1
| override suspend fun createPaymentMethodFromStripePaymentMethod( | |
| stripePaymentMethodId: String, | |
| ): ApiResult<ApiPaymentMethodResponse> = apiCall<ApiBody<ApiPaymentMethodResponse>, ApiPaymentMethodResponse> { | |
| val data = ApiPaymentMethodCreationRequest( | |
| "stripe", | |
| ApiPaymentMethodCreationRequest.Details( | |
| stripePaymentMethodId = stripePaymentMethodId, | |
| null, | |
| null, | |
| ), | |
| ) | |
| createPaymentMethod(body = ApiBody(data)) | |
| } |
Example - passing in the ApiModel:
kmp-passenger-api/library/src/commonMain/kotlin/com/ioki/passenger/api/IokiService.kt
Lines 554 to 557 in 84ae5d1
| override suspend fun createDevice(deviceRequest: ApiDeviceRequest): ApiResult<ApiDeviceResponse> = | |
| apiCall<ApiBody<ApiDeviceResponse>, ApiDeviceResponse> { | |
| createDevice(body = ApiBody(deviceRequest)) | |
| } |
We should align this and think about a common solution here.
Either passing in, or creating there.
Metadata
Metadata
Assignees
Labels
No labels