Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonsonKein authored and a2xchip committed Mar 16, 2024
1 parent 14ace4e commit 7332805
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/model/AuditLog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
package com.jeliuc.turso.sdk.model

import com.jeliuc.turso.sdk.serializer.LocalDateTimeSerializer
import java.time.LocalDateTime
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonElement
import java.time.LocalDateTime

@Serializable
data class ListAuditLogsResponse(
Expand Down
3 changes: 1 addition & 2 deletions src/main/kotlin/model/Organization.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
package com.jeliuc.turso.sdk.model

import com.jeliuc.turso.sdk.serializer.LocalDateTimeSerializer
import java.time.LocalDateTime
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import java.time.LocalDateTime

@Serializable
data class Organization(
Expand Down Expand Up @@ -60,7 +60,6 @@ enum class MemberRole {
@SerialName("admin")
ADMIN,


@Suppress("unused")
@SerialName("member")
MEMBER,
Expand Down
24 changes: 12 additions & 12 deletions src/main/kotlin/resource/Databases.kt
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,18 @@ class Databases(private val client: TursoClient) : ResponseHandler() {
contentType(ContentType.MultiPart.FormData)
setBody(
body =
MultiPartFormDataContent(
formData {
append(
"file",
file.readBytes(),
Headers.build {
append(HttpHeaders.ContentType, ContentType.Application.OctetStream.toString())
append(HttpHeaders.ContentDisposition, "form-data; name=file; filename=${file.name}")
},
)
},
),
MultiPartFormDataContent(
formData {
append(
"file",
file.readBytes(),
Headers.build {
append(HttpHeaders.ContentType, ContentType.Application.OctetStream.toString())
append(HttpHeaders.ContentDisposition, "form-data; name=file; filename=${file.name}")
},
)
},
),
)
}.let { response ->
handleResponse<UploadDumpResponse>(response)
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/serializer/LocalDateTimeSerializer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

package com.jeliuc.turso.sdk.serializer

import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializer
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter

@OptIn(ExperimentalSerializationApi::class)
@Serializer(forClass = LocalDateTime::class)
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/resource/ApiTokensTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import io.ktor.client.engine.mock.respond
import io.ktor.http.ContentType
import io.ktor.http.HttpMethod
import io.ktor.http.headersOf
import kotlinx.coroutines.runBlocking
import kotlin.test.Test
import kotlin.test.assertIs
import kotlinx.coroutines.runBlocking

private fun mockEngine() =
MockEngine { request ->
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/resource/AuditLogsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import io.ktor.client.engine.mock.respond
import io.ktor.http.ContentType
import io.ktor.http.HttpMethod
import io.ktor.http.headersOf
import kotlinx.coroutines.runBlocking
import kotlin.test.Test
import kotlin.test.assertIs
import kotlinx.coroutines.runBlocking

private fun mockEngine(): HttpClientEngine =
MockEngine { request ->
Expand Down
30 changes: 15 additions & 15 deletions src/test/kotlin/resource/DatabasesTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import io.ktor.client.engine.mock.respond
import io.ktor.http.ContentType
import io.ktor.http.HttpMethod
import io.ktor.http.headersOf
import kotlinx.coroutines.runBlocking
import kotlin.test.Test
import kotlin.test.assertIs
import kotlinx.coroutines.runBlocking

private fun mockEngine(): HttpClientEngine =
MockEngine { request ->
Expand All @@ -41,15 +41,15 @@ private fun mockEngine(): HttpClientEngine =
val data = Fixture.content("$fixturesBasePath/list.json")
respond(
data,
headers = headersOf("Content-Type" to listOf(ContentType.Application.Json.toString()))
headers = headersOf("Content-Type" to listOf(ContentType.Application.Json.toString())),
)
}

HttpMethod.Post -> {
val data = Fixture.content("$fixturesBasePath/create.json")
respond(
data,
headers = headersOf("Content-Type" to listOf(ContentType.Application.Json.toString()))
headers = headersOf("Content-Type" to listOf(ContentType.Application.Json.toString())),
)
}

Expand Down Expand Up @@ -107,9 +107,9 @@ private fun mockEngine(): HttpClientEngine =
respond(
data,
headers =
headersOf(
"Content-Type" to listOf(ContentType.Application.Json.toString()),
),
headersOf(
"Content-Type" to listOf(ContentType.Application.Json.toString()),
),
)
}

Expand All @@ -123,9 +123,9 @@ private fun mockEngine(): HttpClientEngine =
respond(
"",
headers =
headersOf(
"Content-Type" to listOf(ContentType.Application.Json.toString()),
),
headersOf(
"Content-Type" to listOf(ContentType.Application.Json.toString()),
),
)
}

Expand All @@ -140,9 +140,9 @@ private fun mockEngine(): HttpClientEngine =
respond(
data,
headers =
headersOf(
"Content-Type" to listOf(ContentType.Application.Json.toString()),
),
headersOf(
"Content-Type" to listOf(ContentType.Application.Json.toString()),
),
)
}

Expand All @@ -157,9 +157,9 @@ private fun mockEngine(): HttpClientEngine =
respond(
data,
headers =
headersOf(
"Content-Type" to listOf(ContentType.Application.Json.toString()),
),
headersOf(
"Content-Type" to listOf(ContentType.Application.Json.toString()),
),
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/resource/GroupsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import io.ktor.client.engine.mock.respond
import io.ktor.http.ContentType
import io.ktor.http.HttpMethod
import io.ktor.http.headersOf
import kotlinx.coroutines.runBlocking
import kotlin.test.Test
import kotlin.test.assertIs
import kotlinx.coroutines.runBlocking

private fun mockEngine() =
MockEngine { request ->
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/resource/LocationsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import io.ktor.client.engine.mock.respond
import io.ktor.http.ContentType
import io.ktor.http.HttpMethod
import io.ktor.http.headersOf
import kotlinx.coroutines.runBlocking
import kotlin.test.Test
import kotlin.test.assertIs
import kotlinx.coroutines.runBlocking

private fun mockEngine(): HttpClientEngine =
MockEngine { request ->
Expand Down
4 changes: 2 additions & 2 deletions src/test/kotlin/resource/OrganizationsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import io.ktor.client.engine.mock.respond
import io.ktor.http.ContentType
import io.ktor.http.HttpMethod
import io.ktor.http.headersOf
import kotlin.test.Test
import kotlin.test.assertIs
import kotlinx.coroutines.runBlocking
import org.junit.jupiter.api.assertThrows
import kotlin.test.Test
import kotlin.test.assertIs

private fun mockEngine() =
MockEngine { request ->
Expand Down

0 comments on commit 7332805

Please sign in to comment.