Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleyphu committed Aug 13, 2024
1 parent fb1a12b commit 2af8ceb
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 25 deletions.
1 change: 0 additions & 1 deletion src/main/kotlin/com/workos/WorkOS.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.workos

import com.fasterxml.jackson.core.type.TypeReference
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.module.kotlin.jacksonMapperBuilder
import com.github.kittinunf.fuel.core.FuelManager
Expand Down
17 changes: 15 additions & 2 deletions src/main/kotlin/com/workos/fga/FgaApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,21 @@ package com.workos.fga

import com.workos.WorkOS
import com.workos.common.http.RequestConfig
import com.workos.fga.models.*
import com.workos.fga.types.*
import com.workos.fga.models.CheckResponse
import com.workos.fga.models.QueryResponse
import com.workos.fga.models.Resource
import com.workos.fga.models.Resources
import com.workos.fga.models.Warrants
import com.workos.fga.models.WriteWarrantResponse
import com.workos.fga.types.CheckBatchOptions
import com.workos.fga.types.CheckOptions
import com.workos.fga.types.CheckRequestOptions
import com.workos.fga.types.CreateResourceOptions
import com.workos.fga.types.ListResourcesOptions
import com.workos.fga.types.ListWarrantsOptions
import com.workos.fga.types.QueryOptions
import com.workos.fga.types.UpdateResourceOptions
import com.workos.fga.types.WriteWarrantOptions

class FgaApi(private val workos: WorkOS) {
/** Get an existing resource. */
Expand Down
1 change: 0 additions & 1 deletion src/main/kotlin/com/workos/fga/types/QueryResult.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.workos.fga.types

import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.annotation.JsonProperty
import com.workos.common.models.Order
import com.workos.fga.models.Warrant

@JsonInclude(JsonInclude.Include.NON_NULL)
Expand Down
1 change: 0 additions & 1 deletion src/test/kotlin/com/workos/test/TestBase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import com.github.tomakehurst.wiremock.client.WireMock.* // ktlint-disable no-wi
import com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig
import com.github.tomakehurst.wiremock.junit.WireMockRule
import com.github.tomakehurst.wiremock.matching.StringValuePattern
import com.github.tomakehurst.wiremock.stubbing.Scenario.STARTED
import com.github.tomakehurst.wiremock.stubbing.StubMapping
import com.workos.WorkOS
import org.junit.ClassRule
Expand Down
48 changes: 28 additions & 20 deletions src/test/kotlin/com/workos/test/fga/FgaApiTest.kt
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
package com.workos.test.fga

import com.github.tomakehurst.wiremock.stubbing.Scenario.STARTED
import com.workos.WorkOS
import com.workos.common.exceptions.GenericServerException
import com.workos.common.models.ListMetadata
import com.workos.common.models.Order
import com.workos.fga.builders.*
import com.workos.fga.builders.CheckBatchOptionsBuilder
import com.workos.fga.builders.CheckOptionsBuilder
import com.workos.fga.builders.CreateResourceOptionsBuilder
import com.workos.fga.builders.ListResourcesOptionsBuilder
import com.workos.fga.builders.ListWarrantsOptionsBuilder
import com.workos.fga.builders.QueryOptionsBuilder
import com.workos.fga.builders.UpdateResourceOptionsBuilder
import com.workos.fga.builders.WriteWarrantOptionsBuilder
import com.workos.fga.models.Resource
import com.workos.fga.models.Subject
import com.workos.fga.models.Warrant
import com.workos.fga.types.DeleteResourceOptions
import com.workos.fga.types.GetResourceOptions
import com.workos.fga.types.WarrantCheckOptions
import com.workos.test.TestBase
import org.junit.jupiter.api.Assertions.assertDoesNotThrow
import kotlin.test.*
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.test.assertNotNull
import kotlin.test.assertNull

class FgaApiTest : TestBase() {
val workos = createWorkOSClient()
Expand Down Expand Up @@ -513,7 +521,7 @@ class FgaApiTest : TestBase() {
"""{
"warrant_token": "new_token"
}""",
requestBody=
requestBody =
"""{
"op": "create",
"resource_type": "role",
Expand Down Expand Up @@ -542,7 +550,7 @@ class FgaApiTest : TestBase() {
"""{
"warrant_token": "new_token"
}""",
requestBody=
requestBody =
"""{
"op": "delete",
"resource_type": "role",
Expand Down Expand Up @@ -571,7 +579,7 @@ class FgaApiTest : TestBase() {
"""{
"warrant_token": "new_token"
}""",
requestBody=
requestBody =
"""[
{
"op": "delete",
Expand Down Expand Up @@ -614,7 +622,7 @@ class FgaApiTest : TestBase() {
"result": "authorized",
"is_implicit": false
}""",
requestBody=
requestBody =
"""{
"checks": [
{
Expand Down Expand Up @@ -709,7 +717,7 @@ class FgaApiTest : TestBase() {
}
}
}""",
requestBody=
requestBody =
"""{
"checks": [
{
Expand Down Expand Up @@ -796,7 +804,7 @@ class FgaApiTest : TestBase() {
"is_implicit": true
}
]""",
requestBody=
requestBody =
"""{
"op": "batch",
"checks": [
Expand Down Expand Up @@ -825,16 +833,16 @@ class FgaApiTest : TestBase() {
val options = CheckBatchOptionsBuilder(
listOf(
WarrantCheckOptions(
"role",
"admin",
"member",
Subject("user", "tony-stark")
"role",
"admin",
"member",
Subject("user", "tony-stark")
),
WarrantCheckOptions(
"tenant",
"stark-industries",
"member",
Subject("user", "tony-stark")
"tenant",
"stark-industries",
"member",
Subject("user", "tony-stark")
)
)
).build()
Expand Down Expand Up @@ -929,7 +937,7 @@ class FgaApiTest : TestBase() {
}
}
]""",
requestBody=
requestBody =
"""{
"op": "batch",
"checks": [
Expand Down

0 comments on commit 2af8ceb

Please sign in to comment.