Skip to content

Commit cc8d266

Browse files
authored
kotlin: Format with ktfmt --kotlinlang-style (#1575)
Like #1574. We want to replace some files with auto-generated ones, to reduce the diff and make it readable once it's generated, we should apply auto-formatting at all times. I tried setting up a gradle plugin for this, but unfortunately things are a bit broken for me locally, so that didn't work out.
2 parents 4f71b19 + ea76cfc commit cc8d266

16 files changed

+131
-254
lines changed

kotlin/lib/src/main/kotlin/Application.kt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ class Application internal constructor(token: String, options: SvixOptions) {
1717
options.numRetries?.let { api.numRetries = it }
1818
}
1919

20-
suspend fun list(options: ApplicationListOptions = ApplicationListOptions()): ListResponseApplicationOut {
20+
suspend fun list(
21+
options: ApplicationListOptions = ApplicationListOptions()
22+
): ListResponseApplicationOut {
2123
try {
2224
return api.v1ApplicationList(options.limit, options.iterator, options.order)
2325
} catch (e: Exception) {
@@ -55,21 +57,15 @@ class Application internal constructor(token: String, options: SvixOptions) {
5557
}
5658
}
5759

58-
suspend fun update(
59-
appId: String,
60-
applicationIn: ApplicationIn,
61-
): ApplicationOut {
60+
suspend fun update(appId: String, applicationIn: ApplicationIn): ApplicationOut {
6261
try {
6362
return api.v1ApplicationUpdate(appId, applicationIn)
6463
} catch (e: Exception) {
6564
throw ApiException.wrap(e)
6665
}
6766
}
6867

69-
suspend fun patch(
70-
appId: String,
71-
applicationPatch: ApplicationPatch,
72-
): ApplicationOut {
68+
suspend fun patch(appId: String, applicationPatch: ApplicationPatch): ApplicationOut {
7369
try {
7470
return api.v1ApplicationPatch(appId, applicationPatch)
7571
} catch (e: Exception) {

kotlin/lib/src/main/kotlin/ApplicationListOptions.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ class ApplicationListOptions : ListOptions() {
77

88
fun order(order: Ordering) = apply { this.order = order }
99

10-
override fun iterator(iterator: String): ApplicationListOptions = apply { super.iterator(iterator) }
10+
override fun iterator(iterator: String): ApplicationListOptions = apply {
11+
super.iterator(iterator)
12+
}
1113

1214
override fun limit(limit: Int) = apply { super.limit(limit) }
1315
}

kotlin/lib/src/main/kotlin/Authentication.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ class Authentication internal constructor(token: String, options: SvixOptions) {
2222
options: PostOptions = PostOptions(),
2323
): AppPortalAccessOut {
2424
try {
25-
return api.v1AuthenticationAppPortalAccess(appId, appPortalAccessIn, options.idempotencyKey)
25+
return api.v1AuthenticationAppPortalAccess(
26+
appId,
27+
appPortalAccessIn,
28+
options.idempotencyKey,
29+
)
2630
} catch (e: Exception) {
2731
throw ApiException.wrap(e)
2832
}

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,17 @@ class BackgroundTask internal constructor(token: String, options: SvixOptions) {
1515
options.numRetries?.let { api.numRetries = it }
1616
}
1717

18-
suspend fun list(options: BackgroundTaskListOptions = BackgroundTaskListOptions()): ListResponseBackgroundTaskOut {
18+
suspend fun list(
19+
options: BackgroundTaskListOptions = BackgroundTaskListOptions()
20+
): ListResponseBackgroundTaskOut {
1921
try {
20-
return api.listBackgroundTasks(options.status, options.task, options.limit, options.iterator, options.order)
22+
return api.listBackgroundTasks(
23+
options.status,
24+
options.task,
25+
options.limit,
26+
options.iterator,
27+
options.order,
28+
)
2129
} catch (e: Exception) {
2230
throw ApiException.wrap(e)
2331
}

kotlin/lib/src/main/kotlin/Endpoint.kt

Lines changed: 19 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
3434
options: EndpointListOptions = EndpointListOptions(),
3535
): ListResponseEndpointOut {
3636
try {
37-
return api.v1EndpointList(
38-
appId,
39-
options.limit,
40-
options.iterator,
41-
options.order,
42-
)
37+
return api.v1EndpointList(appId, options.limit, options.iterator, options.order)
4338
} catch (e: Exception) {
4439
throw ApiException.wrap(e)
4540
}
@@ -51,20 +46,13 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
5146
options: PostOptions = PostOptions(),
5247
): EndpointOut {
5348
try {
54-
return api.v1EndpointCreate(
55-
appId,
56-
endpointIn,
57-
options.idempotencyKey,
58-
)
49+
return api.v1EndpointCreate(appId, endpointIn, options.idempotencyKey)
5950
} catch (e: Exception) {
6051
throw ApiException.wrap(e)
6152
}
6253
}
6354

64-
suspend fun get(
65-
appId: String,
66-
endpointId: String,
67-
): EndpointOut {
55+
suspend fun get(appId: String, endpointId: String): EndpointOut {
6856
try {
6957
return api.v1EndpointGet(endpointId, appId)
7058
} catch (e: Exception) {
@@ -78,11 +66,7 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
7866
endpointUpdate: EndpointUpdate,
7967
): EndpointOut {
8068
try {
81-
return api.v1EndpointUpdate(
82-
appId,
83-
endpointId,
84-
endpointUpdate,
85-
)
69+
return api.v1EndpointUpdate(appId, endpointId, endpointUpdate)
8670
} catch (e: Exception) {
8771
throw ApiException.wrap(e)
8872
}
@@ -94,36 +78,23 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
9478
endpointPatch: EndpointPatch,
9579
): EndpointOut {
9680
try {
97-
return api.v1EndpointPatch(
98-
appId,
99-
endpointId,
100-
endpointPatch,
101-
)
81+
return api.v1EndpointPatch(appId, endpointId, endpointPatch)
10282
} catch (e: Exception) {
10383
throw ApiException.wrap(e)
10484
}
10585
}
10686

107-
suspend fun delete(
108-
appId: String,
109-
endpointId: String,
110-
) {
87+
suspend fun delete(appId: String, endpointId: String) {
11188
try {
11289
api.v1EndpointDelete(appId, endpointId)
11390
} catch (e: Exception) {
11491
throw ApiException.wrap(e)
11592
}
11693
}
11794

118-
suspend fun getSecret(
119-
appId: String,
120-
endpointId: String,
121-
): EndpointSecretOut {
95+
suspend fun getSecret(appId: String, endpointId: String): EndpointSecretOut {
12296
try {
123-
return api.v1EndpointGetSecret(
124-
appId,
125-
endpointId,
126-
)
97+
return api.v1EndpointGetSecret(appId, endpointId)
12798
} catch (e: Exception) {
12899
throw ApiException.wrap(e)
129100
}
@@ -154,26 +125,15 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
154125
options: PostOptions = PostOptions(),
155126
) {
156127
try {
157-
api.v1EndpointRecover(
158-
appId,
159-
endpointId,
160-
recoverIn,
161-
options.idempotencyKey,
162-
)
128+
api.v1EndpointRecover(appId, endpointId, recoverIn, options.idempotencyKey)
163129
} catch (e: Exception) {
164130
throw ApiException.wrap(e)
165131
}
166132
}
167133

168-
suspend fun getHeaders(
169-
appId: String,
170-
endpointId: String,
171-
): EndpointHeadersOut {
134+
suspend fun getHeaders(appId: String, endpointId: String): EndpointHeadersOut {
172135
try {
173-
return api.v1EndpointGetHeaders(
174-
appId,
175-
endpointId,
176-
)
136+
return api.v1EndpointGetHeaders(appId, endpointId)
177137
} catch (e: Exception) {
178138
throw ApiException.wrap(e)
179139
}
@@ -185,11 +145,7 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
185145
endpointHeadersIn: EndpointHeadersIn,
186146
) {
187147
try {
188-
api.v1EndpointUpdateHeaders(
189-
appId,
190-
endpointId,
191-
endpointHeadersIn,
192-
)
148+
api.v1EndpointUpdateHeaders(appId, endpointId, endpointHeadersIn)
193149
} catch (e: Exception) {
194150
throw ApiException.wrap(e)
195151
}
@@ -201,11 +157,7 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
201157
endpointHeadersIn: EndpointHeadersPatchIn,
202158
) {
203159
try {
204-
api.v1EndpointPatchHeaders(
205-
appId,
206-
endpointId,
207-
endpointHeadersIn,
208-
)
160+
api.v1EndpointPatchHeaders(appId, endpointId, endpointHeadersIn)
209161
} catch (e: Exception) {
210162
throw ApiException.wrap(e)
211163
}
@@ -217,12 +169,7 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
217169
options: EndpointStatsOptions = EndpointStatsOptions(),
218170
): EndpointStats {
219171
try {
220-
return api.v1EndpointGetStats(
221-
appId,
222-
endpointId,
223-
options.since,
224-
options.until,
225-
)
172+
return api.v1EndpointGetStats(appId, endpointId, options.since, options.until)
226173
} catch (e: Exception) {
227174
throw ApiException.wrap(e)
228175
}
@@ -235,26 +182,15 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
235182
options: PostOptions = PostOptions(),
236183
) {
237184
try {
238-
api.v1EndpointReplay(
239-
appId,
240-
endpointId,
241-
replayIn,
242-
options.idempotencyKey,
243-
)
185+
api.v1EndpointReplay(appId, endpointId, replayIn, options.idempotencyKey)
244186
} catch (e: Exception) {
245187
throw ApiException.wrap(e)
246188
}
247189
}
248190

249-
suspend fun transformationGet(
250-
appId: String,
251-
endpointId: String,
252-
): EndpointTransformationOut {
191+
suspend fun transformationGet(appId: String, endpointId: String): EndpointTransformationOut {
253192
try {
254-
return api.v1EndpointTransformationGet(
255-
appId,
256-
endpointId,
257-
)
193+
return api.v1EndpointTransformationGet(appId, endpointId)
258194
} catch (e: Exception) {
259195
throw ApiException.wrap(e)
260196
}
@@ -266,11 +202,7 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
266202
endpointTransformationIn: EndpointTransformationIn,
267203
) {
268204
try {
269-
api.v1EndpointTransformationPartialUpdate(
270-
appId,
271-
endpointId,
272-
endpointTransformationIn,
273-
)
205+
api.v1EndpointTransformationPartialUpdate(appId, endpointId, endpointTransformationIn)
274206
} catch (e: Exception) {
275207
throw ApiException.wrap(e)
276208
}
@@ -283,12 +215,7 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
283215
options: PostOptions = PostOptions(),
284216
) {
285217
try {
286-
api.v1EndpointSendExample(
287-
appId,
288-
endpointId,
289-
eventExampleIn,
290-
options.idempotencyKey,
291-
)
218+
api.v1EndpointSendExample(appId, endpointId, eventExampleIn, options.idempotencyKey)
292219
} catch (e: Exception) {
293220
throw ApiException.wrap(e)
294221
}

kotlin/lib/src/main/kotlin/EventType.kt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,17 @@ class EventType internal constructor(token: String, options: SvixOptions) {
2020
options.numRetries?.let { api.numRetries = it }
2121
}
2222

23-
suspend fun list(options: EventTypeListOptions = EventTypeListOptions()): ListResponseEventTypeOut {
23+
suspend fun list(
24+
options: EventTypeListOptions = EventTypeListOptions()
25+
): ListResponseEventTypeOut {
2426
try {
25-
return api.v1EventTypeList(options.limit, options.iterator, null, options.includeAchived, options.withContent)
27+
return api.v1EventTypeList(
28+
options.limit,
29+
options.iterator,
30+
null,
31+
options.includeAchived,
32+
options.withContent,
33+
)
2634
} catch (e: Exception) {
2735
throw ApiException.wrap(e)
2836
}
@@ -47,21 +55,15 @@ class EventType internal constructor(token: String, options: SvixOptions) {
4755
}
4856
}
4957

50-
suspend fun update(
51-
eventTypeName: String,
52-
eventTypeUpdate: EventTypeUpdate,
53-
): EventTypeOut {
58+
suspend fun update(eventTypeName: String, eventTypeUpdate: EventTypeUpdate): EventTypeOut {
5459
try {
5560
return api.v1EventTypeUpdate(eventTypeName, eventTypeUpdate)
5661
} catch (e: Exception) {
5762
throw ApiException.wrap(e)
5863
}
5964
}
6065

61-
suspend fun patch(
62-
eventTypeName: String,
63-
eventTypePatch: EventTypePatch,
64-
): EventTypeOut {
66+
suspend fun patch(eventTypeName: String, eventTypePatch: EventTypePatch): EventTypeOut {
6567
try {
6668
return api.v1EventTypePatch(eventTypeName, eventTypePatch)
6769
} catch (e: Exception) {

kotlin/lib/src/main/kotlin/Integration.kt

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ class Integration internal constructor(token: String, options: SvixOptions) {
4141
}
4242
}
4343

44-
suspend fun get(
45-
appId: String,
46-
integId: String,
47-
): IntegrationOut {
44+
suspend fun get(appId: String, integId: String): IntegrationOut {
4845
try {
4946
return api.v1IntegrationGet(appId, integId)
5047
} catch (e: Exception) {
@@ -64,21 +61,15 @@ class Integration internal constructor(token: String, options: SvixOptions) {
6461
}
6562
}
6663

67-
suspend fun delete(
68-
appId: String,
69-
integId: String,
70-
) {
64+
suspend fun delete(appId: String, integId: String) {
7165
try {
7266
api.v1IntegrationDelete(appId, integId)
7367
} catch (e: Exception) {
7468
throw ApiException.wrap(e)
7569
}
7670
}
7771

78-
suspend fun getKey(
79-
appId: String,
80-
integId: String,
81-
): IntegrationKeyOut {
72+
suspend fun getKey(appId: String, integId: String): IntegrationKeyOut {
8273
try {
8374
return api.v1IntegrationGetKey(appId, integId)
8475
} catch (e: Exception) {
@@ -92,11 +83,7 @@ class Integration internal constructor(token: String, options: SvixOptions) {
9283
options: PostOptions = PostOptions(),
9384
): IntegrationKeyOut {
9485
try {
95-
return api.v1IntegrationRotateKey(
96-
appId,
97-
integId,
98-
options.idempotencyKey,
99-
)
86+
return api.v1IntegrationRotateKey(appId, integId, options.idempotencyKey)
10087
} catch (e: Exception) {
10188
throw ApiException.wrap(e)
10289
}

0 commit comments

Comments
 (0)