Skip to content

Commit 393d595

Browse files
committed
kotlin: Adjust to changes of the lower-level generated code
1 parent 6b3bcb0 commit 393d595

File tree

3 files changed

+25
-30
lines changed

3 files changed

+25
-30
lines changed

kotlin/lib/src/main/kotlin/BackgroundTask.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class BackgroundTask internal constructor(token: String, options: SvixOptions) {
4040
options: BackgroundTaskListOptions = BackgroundTaskListOptions()
4141
): ListResponseBackgroundTaskOut {
4242
try {
43-
return api.listBackgroundTasks(
43+
return api.v1BackgroundTasksList(
4444
options.status,
4545
options.task,
4646
options.limit,
@@ -54,7 +54,7 @@ class BackgroundTask internal constructor(token: String, options: SvixOptions) {
5454

5555
suspend fun get(taskId: String): BackgroundTaskOut {
5656
try {
57-
return api.getBackgroundTask(taskId)
57+
return api.v1BackgroundTaskGet(taskId)
5858
} catch (e: Exception) {
5959
throw ApiException.wrap(e)
6060
}

kotlin/lib/src/main/kotlin/MessageAttempt.kt

+16-21
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ class MessageAttempt internal constructor(token: String, options: SvixOptions) {
220220
options.numRetries?.let { api.numRetries = it }
221221
}
222222

223-
/** @deprecated use listByMsg or listByEndpoint instead. */
224-
@Deprecated(message = "use listByMsg or listByEndpoint instead.")
223+
/** @deprecated use listByMsg instead. */
224+
@Deprecated(message = "use listByMsg instead.")
225225
suspend fun list(
226226
appId: String,
227227
msgId: String,
@@ -382,30 +382,25 @@ class MessageAttempt internal constructor(token: String, options: SvixOptions) {
382382
}
383383
}
384384

385-
@Deprecated(message = "use listByEndpoint instead.")
385+
@Deprecated(message = "use listByMsg instead, passing the endpoint ID through options.")
386386
suspend fun listAttemptsForEndpoint(
387387
appId: String,
388388
endpointId: String,
389389
msgId: String,
390390
options: MessageAttemptListOptions = MessageAttemptListOptions(),
391-
): ListResponseMessageAttemptEndpointOut {
392-
return try {
393-
api.v1MessageAttemptListByEndpointDeprecated(
394-
appId,
395-
msgId,
396-
endpointId,
397-
options.limit,
398-
options.iterator,
399-
options.channel,
400-
options.tag,
401-
options.messageStatus,
402-
options.before,
403-
options.after,
404-
HashSet(options.eventTypes),
405-
)
406-
} catch (e: Exception) {
407-
throw ApiException.wrap(e)
408-
}
391+
): ListResponseMessageAttemptOut {
392+
val listByMsgOptions = MessageAttemptListByMsgOptions(
393+
limit: options.limit,
394+
iterator: options.iterator,
395+
channel: options.channel,
396+
tag: options.tag,
397+
messageStatus: options.messageStatus,
398+
before: options.before,
399+
after: options.after,
400+
eventTypes: options.eventTypes,
401+
endpointId: endpointId,
402+
)
403+
return listByMsg(appId, msgId, options)
409404
}
410405

411406
/** Resend a message to the specified endpoint. */

kotlin/lib/src/main/kotlin/OperationalWebhookEndpoint.kt

+7-7
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class OperationalWebhookEndpoint internal constructor(token: String, options: Sv
3939
options: OperationalWebhookEndpointListOptions = OperationalWebhookEndpointListOptions()
4040
): ListResponseOperationalWebhookEndpointOut {
4141
try {
42-
return api.listOperationalWebhookEndpoints(
42+
return api.v1OperationalWebhookEndpointList(
4343
options.limit,
4444
options.iterator,
4545
options.order,
@@ -54,15 +54,15 @@ class OperationalWebhookEndpoint internal constructor(token: String, options: Sv
5454
options: PostOptions = PostOptions(),
5555
): OperationalWebhookEndpointOut {
5656
try {
57-
return api.createOperationalWebhookEndpoint(endpointIn, options.idempotencyKey)
57+
return api.v1OperationalWebhookEndpointCreate(endpointIn, options.idempotencyKey)
5858
} catch (e: Exception) {
5959
throw ApiException.wrap(e)
6060
}
6161
}
6262

6363
suspend fun get(endpointId: String): OperationalWebhookEndpointOut {
6464
try {
65-
return api.getOperationalWebhookEndpoint(endpointId)
65+
return api.v1OperationalWebhookEndpointGet(endpointId)
6666
} catch (e: Exception) {
6767
throw ApiException.wrap(e)
6868
}
@@ -73,23 +73,23 @@ class OperationalWebhookEndpoint internal constructor(token: String, options: Sv
7373
endpointUpdate: OperationalWebhookEndpointUpdate,
7474
): OperationalWebhookEndpointOut {
7575
try {
76-
return api.updateOperationalWebhookEndpoint(endpointId, endpointUpdate)
76+
return api.v1OperationalWebhookEndpointUpdate(endpointId, endpointUpdate)
7777
} catch (e: Exception) {
7878
throw ApiException.wrap(e)
7979
}
8080
}
8181

8282
suspend fun delete(endpointId: String) {
8383
try {
84-
api.deleteOperationalWebhookEndpoint(endpointId)
84+
api.v1OperationalWebhookEndpointDelete(endpointId)
8585
} catch (e: Exception) {
8686
throw ApiException.wrap(e)
8787
}
8888
}
8989

9090
suspend fun getSecret(endpointId: String): OperationalWebhookEndpointSecretOut {
9191
try {
92-
return api.getOperationalWebhookEndpointSecret(endpointId)
92+
return api.v1OperationalWebhookEndpointGetSecret(endpointId)
9393
} catch (e: Exception) {
9494
throw ApiException.wrap(e)
9595
}
@@ -101,7 +101,7 @@ class OperationalWebhookEndpoint internal constructor(token: String, options: Sv
101101
options: PostOptions = PostOptions(),
102102
) {
103103
try {
104-
api.rotateOperationalWebhookEndpointSecret(
104+
api.v1OperationalWebhookEndpointRotateSecret(
105105
endpointId,
106106
endpointSecretRotateIn,
107107
options.idempotencyKey,

0 commit comments

Comments
 (0)