Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): add AUTH_STREAM_ACCESS to responder endpoints #96

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ constructor(

companion object {

val AUTH_STREAM_ACCESS = Type(JsonField.of("AUTH_STREAM_ACCESS"))

val TOKENIZATION_DECISIONING = Type(JsonField.of("TOKENIZATION_DECISIONING"))

val THREE_DS_DECISIONING = Type(JsonField.of("THREE_DS_DECISIONING"))
Expand All @@ -157,25 +159,29 @@ constructor(
}

enum class Known {
AUTH_STREAM_ACCESS,
TOKENIZATION_DECISIONING,
THREE_DS_DECISIONING,
}

enum class Value {
AUTH_STREAM_ACCESS,
TOKENIZATION_DECISIONING,
THREE_DS_DECISIONING,
_UNKNOWN,
}

fun value(): Value =
when (this) {
AUTH_STREAM_ACCESS -> Value.AUTH_STREAM_ACCESS
TOKENIZATION_DECISIONING -> Value.TOKENIZATION_DECISIONING
THREE_DS_DECISIONING -> Value.THREE_DS_DECISIONING
else -> Value._UNKNOWN
}

fun known(): Known =
when (this) {
AUTH_STREAM_ACCESS -> Known.AUTH_STREAM_ACCESS
TOKENIZATION_DECISIONING -> Known.TOKENIZATION_DECISIONING
THREE_DS_DECISIONING -> Known.THREE_DS_DECISIONING
else -> throw LithicInvalidDataException("Unknown Type: $value")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ constructor(

companion object {

val AUTH_STREAM_ACCESS = Type(JsonField.of("AUTH_STREAM_ACCESS"))

val TOKENIZATION_DECISIONING = Type(JsonField.of("TOKENIZATION_DECISIONING"))

val THREE_DS_DECISIONING = Type(JsonField.of("THREE_DS_DECISIONING"))
Expand All @@ -292,25 +294,29 @@ constructor(
}

enum class Known {
AUTH_STREAM_ACCESS,
TOKENIZATION_DECISIONING,
THREE_DS_DECISIONING,
}

enum class Value {
AUTH_STREAM_ACCESS,
TOKENIZATION_DECISIONING,
THREE_DS_DECISIONING,
_UNKNOWN,
}

fun value(): Value =
when (this) {
AUTH_STREAM_ACCESS -> Value.AUTH_STREAM_ACCESS
TOKENIZATION_DECISIONING -> Value.TOKENIZATION_DECISIONING
THREE_DS_DECISIONING -> Value.THREE_DS_DECISIONING
else -> Value._UNKNOWN
}

fun known(): Known =
when (this) {
AUTH_STREAM_ACCESS -> Known.AUTH_STREAM_ACCESS
TOKENIZATION_DECISIONING -> Known.TOKENIZATION_DECISIONING
THREE_DS_DECISIONING -> Known.THREE_DS_DECISIONING
else -> throw LithicInvalidDataException("Unknown Type: $value")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ constructor(

companion object {

val AUTH_STREAM_ACCESS = Type(JsonField.of("AUTH_STREAM_ACCESS"))

val TOKENIZATION_DECISIONING = Type(JsonField.of("TOKENIZATION_DECISIONING"))

val THREE_DS_DECISIONING = Type(JsonField.of("THREE_DS_DECISIONING"))
Expand All @@ -182,25 +184,29 @@ constructor(
}

enum class Known {
AUTH_STREAM_ACCESS,
TOKENIZATION_DECISIONING,
THREE_DS_DECISIONING,
}

enum class Value {
AUTH_STREAM_ACCESS,
TOKENIZATION_DECISIONING,
THREE_DS_DECISIONING,
_UNKNOWN,
}

fun value(): Value =
when (this) {
AUTH_STREAM_ACCESS -> Value.AUTH_STREAM_ACCESS
TOKENIZATION_DECISIONING -> Value.TOKENIZATION_DECISIONING
THREE_DS_DECISIONING -> Value.THREE_DS_DECISIONING
else -> Value._UNKNOWN
}

fun known(): Known =
when (this) {
AUTH_STREAM_ACCESS -> Known.AUTH_STREAM_ACCESS
TOKENIZATION_DECISIONING -> Known.TOKENIZATION_DECISIONING
THREE_DS_DECISIONING -> Known.THREE_DS_DECISIONING
else -> throw LithicInvalidDataException("Unknown Type: $value")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ class ResponderEndpointCheckStatusParamsTest {
@Test
fun createResponderEndpointCheckStatusParams() {
ResponderEndpointCheckStatusParams.builder()
.type(ResponderEndpointCheckStatusParams.Type.TOKENIZATION_DECISIONING)
.type(ResponderEndpointCheckStatusParams.Type.AUTH_STREAM_ACCESS)
.build()
}

@Test
fun getQueryParams() {
val params =
ResponderEndpointCheckStatusParams.builder()
.type(ResponderEndpointCheckStatusParams.Type.TOKENIZATION_DECISIONING)
.type(ResponderEndpointCheckStatusParams.Type.AUTH_STREAM_ACCESS)
.build()
val expected = mutableMapOf<String, List<String>>()
expected.put(
"type",
listOf(ResponderEndpointCheckStatusParams.Type.TOKENIZATION_DECISIONING.toString())
listOf(ResponderEndpointCheckStatusParams.Type.AUTH_STREAM_ACCESS.toString())
)
assertThat(params.getQueryParams()).isEqualTo(expected)
}
Expand All @@ -33,12 +33,12 @@ class ResponderEndpointCheckStatusParamsTest {
fun getQueryParamsWithoutOptionalFields() {
val params =
ResponderEndpointCheckStatusParams.builder()
.type(ResponderEndpointCheckStatusParams.Type.TOKENIZATION_DECISIONING)
.type(ResponderEndpointCheckStatusParams.Type.AUTH_STREAM_ACCESS)
.build()
val expected = mutableMapOf<String, List<String>>()
expected.put(
"type",
listOf(ResponderEndpointCheckStatusParams.Type.TOKENIZATION_DECISIONING.toString())
listOf(ResponderEndpointCheckStatusParams.Type.AUTH_STREAM_ACCESS.toString())
)
assertThat(params.getQueryParams()).isEqualTo(expected)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ResponderEndpointCreateParamsTest {
@Test
fun createResponderEndpointCreateParams() {
ResponderEndpointCreateParams.builder()
.type(ResponderEndpointCreateParams.Type.TOKENIZATION_DECISIONING)
.type(ResponderEndpointCreateParams.Type.AUTH_STREAM_ACCESS)
.url("https://example.com")
.build()
}
Expand All @@ -20,13 +20,12 @@ class ResponderEndpointCreateParamsTest {
fun getBody() {
val params =
ResponderEndpointCreateParams.builder()
.type(ResponderEndpointCreateParams.Type.TOKENIZATION_DECISIONING)
.type(ResponderEndpointCreateParams.Type.AUTH_STREAM_ACCESS)
.url("https://example.com")
.build()
val body = params.getBody()
assertThat(body).isNotNull
assertThat(body.type())
.isEqualTo(ResponderEndpointCreateParams.Type.TOKENIZATION_DECISIONING)
assertThat(body.type()).isEqualTo(ResponderEndpointCreateParams.Type.AUTH_STREAM_ACCESS)
assertThat(body.url()).isEqualTo("https://example.com")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ class ResponderEndpointDeleteParamsTest {
@Test
fun createResponderEndpointDeleteParams() {
ResponderEndpointDeleteParams.builder()
.type(ResponderEndpointDeleteParams.Type.TOKENIZATION_DECISIONING)
.type(ResponderEndpointDeleteParams.Type.AUTH_STREAM_ACCESS)
.build()
}

@Test
fun getQueryParams() {
val params =
ResponderEndpointDeleteParams.builder()
.type(ResponderEndpointDeleteParams.Type.TOKENIZATION_DECISIONING)
.type(ResponderEndpointDeleteParams.Type.AUTH_STREAM_ACCESS)
.build()
val expected = mutableMapOf<String, List<String>>()
expected.put(
"type",
listOf(ResponderEndpointDeleteParams.Type.TOKENIZATION_DECISIONING.toString())
listOf(ResponderEndpointDeleteParams.Type.AUTH_STREAM_ACCESS.toString())
)
assertThat(params.getQueryParams()).isEqualTo(expected)
}
Expand All @@ -33,12 +33,12 @@ class ResponderEndpointDeleteParamsTest {
fun getQueryParamsWithoutOptionalFields() {
val params =
ResponderEndpointDeleteParams.builder()
.type(ResponderEndpointDeleteParams.Type.TOKENIZATION_DECISIONING)
.type(ResponderEndpointDeleteParams.Type.AUTH_STREAM_ACCESS)
.build()
val expected = mutableMapOf<String, List<String>>()
expected.put(
"type",
listOf(ResponderEndpointDeleteParams.Type.TOKENIZATION_DECISIONING.toString())
listOf(ResponderEndpointDeleteParams.Type.AUTH_STREAM_ACCESS.toString())
)
assertThat(params.getQueryParams()).isEqualTo(expected)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ResponderEndpointServiceTest {
val responderEndpointCreateResponse =
responderEndpointService.create(
ResponderEndpointCreateParams.builder()
.type(ResponderEndpointCreateParams.Type.TOKENIZATION_DECISIONING)
.type(ResponderEndpointCreateParams.Type.AUTH_STREAM_ACCESS)
.url("https://example.com")
.build()
)
Expand All @@ -42,7 +42,7 @@ class ResponderEndpointServiceTest {
val responderEndpointService = client.responderEndpoints()
responderEndpointService.delete(
ResponderEndpointDeleteParams.builder()
.type(ResponderEndpointDeleteParams.Type.TOKENIZATION_DECISIONING)
.type(ResponderEndpointDeleteParams.Type.AUTH_STREAM_ACCESS)
.build()
)
}
Expand All @@ -58,7 +58,7 @@ class ResponderEndpointServiceTest {
val responderEndpointStatus =
responderEndpointService.checkStatus(
ResponderEndpointCheckStatusParams.builder()
.type(ResponderEndpointCheckStatusParams.Type.TOKENIZATION_DECISIONING)
.type(ResponderEndpointCheckStatusParams.Type.AUTH_STREAM_ACCESS)
.build()
)
println(responderEndpointStatus)
Expand Down