Skip to content

Commit

Permalink
Make ktlint happy by reformatting
Browse files Browse the repository at this point in the history
Automated with `ktlint --format`.
  • Loading branch information
svix-jplatte committed Apr 30, 2024
1 parent 355ed06 commit 0fb07d8
Show file tree
Hide file tree
Showing 15 changed files with 238 additions and 106 deletions.
20 changes: 16 additions & 4 deletions kotlin/lib/src/main/kotlin/Application.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,21 @@ class Application internal constructor(token: String, options: SvixOptions) {
}
}

suspend fun create(applicationIn: ApplicationIn, options: PostOptions = PostOptions()): ApplicationOut {
suspend fun create(
applicationIn: ApplicationIn,
options: PostOptions = PostOptions(),
): ApplicationOut {
try {
return api.v1ApplicationCreate(applicationIn, null, options.idempotencyKey)
} catch (e: Exception) {
throw ApiException.wrap(e)
}
}

suspend fun getOrCreate(applicationIn: ApplicationIn, options: PostOptions = PostOptions()): ApplicationOut {
suspend fun getOrCreate(
applicationIn: ApplicationIn,
options: PostOptions = PostOptions(),
): ApplicationOut {
try {
return api.v1ApplicationCreate(applicationIn, true, options.idempotencyKey)
} catch (e: Exception) {
Expand All @@ -49,15 +55,21 @@ class Application internal constructor(token: String, options: SvixOptions) {
}
}

suspend fun update(appId: String, applicationIn: ApplicationIn): ApplicationOut {
suspend fun update(
appId: String,
applicationIn: ApplicationIn,
): ApplicationOut {
try {
return api.v1ApplicationUpdate(appId, applicationIn)
} catch (e: Exception) {
throw ApiException.wrap(e)
}
}

suspend fun patch(appId: String, applicationPatch: ApplicationPatch): ApplicationOut {
suspend fun patch(
appId: String,
applicationPatch: ApplicationPatch,
): ApplicationOut {
try {
return api.v1ApplicationPatch(appId, applicationPatch)
} catch (e: Exception) {
Expand Down
7 changes: 5 additions & 2 deletions kotlin/lib/src/main/kotlin/Authentication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Authentication internal constructor(token: String, options: SvixOptions) {
suspend fun appPortalAccess(
appId: String,
appPortalAccessIn: AppPortalAccessIn,
options: PostOptions = PostOptions()
options: PostOptions = PostOptions(),
): AppPortalAccessOut {
try {
return api.v1AuthenticationAppPortalAccess(appId, appPortalAccessIn, options.idempotencyKey)
Expand All @@ -28,7 +28,10 @@ class Authentication internal constructor(token: String, options: SvixOptions) {
}
}

suspend fun dashboardAccess(appId: String, options: PostOptions = PostOptions()): DashboardAccessOut {
suspend fun dashboardAccess(
appId: String,
options: PostOptions = PostOptions(),
): DashboardAccessOut {
try {
return api.v1AuthenticationDashboardAccess(appId, options.idempotencyKey)
} catch (e: Exception) {
Expand Down
88 changes: 56 additions & 32 deletions kotlin/lib/src/main/kotlin/Endpoint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {

suspend fun list(
appId: String,
options: EndpointListOptions = EndpointListOptions()
options: EndpointListOptions = EndpointListOptions(),
): ListResponseEndpointOut {
try {
return api.v1EndpointList(
appId,
options.limit,
options.iterator,
options.order
options.order,
)
} catch (e: Exception) {
throw ApiException.wrap(e)
Expand All @@ -48,20 +48,23 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
suspend fun create(
appId: String,
endpointIn: EndpointIn,
options: PostOptions = PostOptions()
options: PostOptions = PostOptions(),
): EndpointOut {
try {
return api.v1EndpointCreate(
appId,
endpointIn,
options.idempotencyKey
options.idempotencyKey,
)
} catch (e: Exception) {
throw ApiException.wrap(e)
}
}

suspend fun get(appId: String, endpointId: String): EndpointOut {
suspend fun get(
appId: String,
endpointId: String,
): EndpointOut {
try {
return api.v1EndpointGet(endpointId, appId)
} catch (e: Exception) {
Expand All @@ -72,13 +75,13 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
suspend fun update(
appId: String,
endpointId: String,
endpointUpdate: EndpointUpdate
endpointUpdate: EndpointUpdate,
): EndpointOut {
try {
return api.v1EndpointUpdate(
appId,
endpointId,
endpointUpdate
endpointUpdate,
)
} catch (e: Exception) {
throw ApiException.wrap(e)
Expand All @@ -88,32 +91,38 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
suspend fun patch(
appId: String,
endpointId: String,
endpointPatch: EndpointPatch
endpointPatch: EndpointPatch,
): EndpointOut {
try {
return api.v1EndpointPatch(
appId,
endpointId,
endpointPatch
endpointPatch,
)
} catch (e: Exception) {
throw ApiException.wrap(e)
}
}

suspend fun delete(appId: String, endpointId: String) {
suspend fun delete(
appId: String,
endpointId: String,
) {
try {
api.v1EndpointDelete(appId, endpointId)
} catch (e: Exception) {
throw ApiException.wrap(e)
}
}

suspend fun getSecret(appId: String, endpointId: String): EndpointSecretOut {
suspend fun getSecret(
appId: String,
endpointId: String,
): EndpointSecretOut {
try {
return api.v1EndpointGetSecret(
appId,
endpointId
endpointId,
)
} catch (e: Exception) {
throw ApiException.wrap(e)
Expand All @@ -124,14 +133,14 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
appId: String,
endpointId: String,
endpointSecretRotateIn: EndpointSecretRotateIn,
options: PostOptions = PostOptions()
options: PostOptions = PostOptions(),
) {
try {
api.v1EndpointRotateSecret(
appId,
endpointId,
endpointSecretRotateIn,
options.idempotencyKey
options.idempotencyKey,
)
} catch (e: Exception) {
throw ApiException.wrap(e)
Expand All @@ -142,25 +151,28 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
appId: String,
endpointId: String,
recoverIn: RecoverIn,
options: PostOptions = PostOptions()
options: PostOptions = PostOptions(),
) {
try {
api.v1EndpointRecover(
appId,
endpointId,
recoverIn,
options.idempotencyKey
options.idempotencyKey,
)
} catch (e: Exception) {
throw ApiException.wrap(e)
}
}

suspend fun getHeaders(appId: String, endpointId: String): EndpointHeadersOut {
suspend fun getHeaders(
appId: String,
endpointId: String,
): EndpointHeadersOut {
try {
return api.v1EndpointGetHeaders(
appId,
endpointId
endpointId,
)
} catch (e: Exception) {
throw ApiException.wrap(e)
Expand All @@ -170,13 +182,13 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
suspend fun updateHeaders(
appId: String,
endpointId: String,
endpointHeadersIn: EndpointHeadersIn
endpointHeadersIn: EndpointHeadersIn,
) {
try {
api.v1EndpointUpdateHeaders(
appId,
endpointId,
endpointHeadersIn
endpointHeadersIn,
)
} catch (e: Exception) {
throw ApiException.wrap(e)
Expand All @@ -186,13 +198,13 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
suspend fun patchHeaders(
appId: String,
endpointId: String,
endpointHeadersIn: EndpointHeadersPatchIn
endpointHeadersIn: EndpointHeadersPatchIn,
) {
try {
api.v1EndpointPatchHeaders(
appId,
endpointId,
endpointHeadersIn
endpointHeadersIn,
)
} catch (e: Exception) {
throw ApiException.wrap(e)
Expand All @@ -202,14 +214,14 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
suspend fun getStats(
appId: String,
endpointId: String,
options: EndpointStatsOptions = EndpointStatsOptions()
options: EndpointStatsOptions = EndpointStatsOptions(),
): EndpointStats {
try {
return api.v1EndpointGetStats(
appId,
endpointId,
options.since,
options.until
options.until,
)
} catch (e: Exception) {
throw ApiException.wrap(e)
Expand All @@ -220,50 +232,62 @@ class Endpoint internal constructor(token: String, options: SvixOptions) {
appId: String,
endpointId: String,
replayIn: ReplayIn,
options: PostOptions = PostOptions()
options: PostOptions = PostOptions(),
) {
try {
api.v1EndpointReplay(
appId,
endpointId,
replayIn,
options.idempotencyKey
options.idempotencyKey,
)
} catch (e: Exception) {
throw ApiException.wrap(e)
}
}

suspend fun transformationGet(appId: String, endpointId: String): EndpointTransformationOut {
suspend fun transformationGet(
appId: String,
endpointId: String,
): EndpointTransformationOut {
try {
return api.v1EndpointTransformationGet(
appId,
endpointId
endpointId,
)
} catch (e: Exception) {
throw ApiException.wrap(e)
}
}

suspend fun transformationPartialUpdate(appId: String, endpointId: String, endpointTransformationIn: EndpointTransformationIn) {
suspend fun transformationPartialUpdate(
appId: String,
endpointId: String,
endpointTransformationIn: EndpointTransformationIn,
) {
try {
api.v1EndpointTransformationPartialUpdate(
appId,
endpointId,
endpointTransformationIn
endpointTransformationIn,
)
} catch (e: Exception) {
throw ApiException.wrap(e)
}
}

suspend fun sendExample(appId: String, endpointId: String, eventExampleIn: EventExampleIn, options: PostOptions = PostOptions()) {
suspend fun sendExample(
appId: String,
endpointId: String,
eventExampleIn: EventExampleIn,
options: PostOptions = PostOptions(),
) {
try {
api.v1EndpointSendExample(
appId,
endpointId,
eventExampleIn,
options.idempotencyKey
options.idempotencyKey,
)
} catch (e: Exception) {
throw ApiException.wrap(e)
Expand Down
20 changes: 16 additions & 4 deletions kotlin/lib/src/main/kotlin/EventType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ class EventType internal constructor(token: String, options: SvixOptions) {
}
}

suspend fun create(eventTypeIn: EventTypeIn, options: PostOptions = PostOptions()): EventTypeOut {
suspend fun create(
eventTypeIn: EventTypeIn,
options: PostOptions = PostOptions(),
): EventTypeOut {
try {
return api.v1EventTypeCreate(eventTypeIn, options.idempotencyKey)
} catch (e: Exception) {
Expand All @@ -44,15 +47,21 @@ class EventType internal constructor(token: String, options: SvixOptions) {
}
}

suspend fun update(eventTypeName: String, eventTypeUpdate: EventTypeUpdate): EventTypeOut {
suspend fun update(
eventTypeName: String,
eventTypeUpdate: EventTypeUpdate,
): EventTypeOut {
try {
return api.v1EventTypeUpdate(eventTypeName, eventTypeUpdate)
} catch (e: Exception) {
throw ApiException.wrap(e)
}
}

suspend fun patch(eventTypeName: String, eventTypePatch: EventTypePatch): EventTypeOut {
suspend fun patch(
eventTypeName: String,
eventTypePatch: EventTypePatch,
): EventTypeOut {
try {
return api.v1EventTypePatch(eventTypeName, eventTypePatch)
} catch (e: Exception) {
Expand All @@ -68,7 +77,10 @@ class EventType internal constructor(token: String, options: SvixOptions) {
}
}

suspend fun importOpenApi(eventTypeImportOpenApiIn: EventTypeImportOpenApiIn, options: PostOptions = PostOptions()): EventTypeImportOpenApiOut {
suspend fun importOpenApi(
eventTypeImportOpenApiIn: EventTypeImportOpenApiIn,
options: PostOptions = PostOptions(),
): EventTypeImportOpenApiOut {
try {
return api.v1EventTypeImportOpenapi(eventTypeImportOpenApiIn, options.idempotencyKey)
} catch (e: Exception) {
Expand Down
Loading

0 comments on commit 0fb07d8

Please sign in to comment.