Skip to content
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.13.2"
".": "0.14.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 22
configured_endpoints: 33
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 0.14.0 (2024-01-09)

Full Changelog: [v0.13.2...v0.14.0](https://github.com/Finch-API/finch-api-java/compare/v0.13.2...v0.14.0)

### Features

* **api:** add method to create access token ([#125](https://github.com/Finch-API/finch-api-java/issues/125)) ([b456bde](https://github.com/Finch-API/finch-api-java/commit/b456bdee9ae7effecb7a1c4c1a7faacd6b26c335))
* **api:** add sandbox APIs ([#127](https://github.com/Finch-API/finch-api-java/issues/127)) ([44671e6](https://github.com/Finch-API/finch-api-java/commit/44671e666b645dac5d43e499d29531f0b88dc34a))


### Chores

* add .keep files for examples and custom code directories ([#126](https://github.com/Finch-API/finch-api-java/issues/126)) ([98b8b4a](https://github.com/Finch-API/finch-api-java/commit/98b8b4a234444abe4dd136931524ee22df2aa2d1))
* **internal:** bump license ([#123](https://github.com/Finch-API/finch-api-java/issues/123)) ([121f7f9](https://github.com/Finch-API/finch-api-java/commit/121f7f9ffe98731113aecda46effa52976c2ee62))

## 0.13.2 (2023-12-19)

Full Changelog: [v0.13.1...v0.13.2](https://github.com/Finch-API/finch-api-java/compare/v0.13.1...v0.13.2)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2023 Finch
Copyright 2024 Finch

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- x-release-please-start-version -->

[![Maven Central](https://img.shields.io/maven-central/v/com.tryfinch.api/finch-java)](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/0.13.2)
[![Maven Central](https://img.shields.io/maven-central/v/com.tryfinch.api/finch-java)](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/0.14.0)

<!-- x-release-please-end -->

Expand All @@ -25,7 +25,7 @@ The API documentation can be found [in the Finch Documentation Center](https://
<!-- x-release-please-start-version -->

```kotlin
implementation("com.tryfinch.api:finch-java:0.13.2")
implementation("com.tryfinch.api:finch-java:0.14.0")
```

#### Maven
Expand All @@ -34,7 +34,7 @@ implementation("com.tryfinch.api:finch-java:0.13.2")
<dependency>
<groupId>com.tryfinch.api</groupId>
<artifactId>finch-java</artifactId>
<version>0.13.2</version>
<version>0.14.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

allprojects {
group = "com.tryfinch.api"
version = "0.13.2" // x-release-please-version
version = "0.14.0" // x-release-please-version
}

nexusPublishing {
Expand Down
4 changes: 4 additions & 0 deletions examples/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
File generated from our OpenAPI spec by Stainless.

This directory can be used to store example files demonstrating usage of this SDK.
It is ignored by Stainless code generation and its content (other than this keep file) won't be touched.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ interface FinchClient {

fun async(): FinchClientAsync

fun accessTokens(): AccessTokenService

fun hris(): HrisService

fun providers(): ProviderService
Expand All @@ -24,6 +26,10 @@ interface FinchClient {

fun jobs(): JobService

fun auth(): AuthService

fun sandbox(): SandboxService

fun getAccessToken(
clientId: String,
clientSecret: String,
Expand All @@ -33,6 +39,8 @@ interface FinchClient {

fun getAuthUrl(products: String, redirectUri: String, sandbox: Boolean): String

fun withAccessToken(accessToken: String): FinchClient

private data class GetAccessTokenParams(
@JsonProperty("client_id") val clientId: String,
@JsonProperty("client_secret") val clientSecret: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ interface FinchClientAsync {

fun sync(): FinchClient

fun accessTokens(): AccessTokenServiceAsync

fun hris(): HrisServiceAsync

fun providers(): ProviderServiceAsync
Expand All @@ -25,6 +27,10 @@ interface FinchClientAsync {

fun jobs(): JobServiceAsync

fun auth(): AuthServiceAsync

fun sandbox(): SandboxServiceAsync

fun getAccessToken(
clientId: String,
clientSecret: String,
Expand All @@ -34,6 +40,8 @@ interface FinchClientAsync {

fun getAuthUrl(products: String, redirectUri: String, sandbox: Boolean): String

fun withAccessToken(accessToken: String): FinchClientAsync

private data class GetAccessTokenParams(
@JsonProperty("client_id") val clientId: String,
@JsonProperty("client_secret") val clientSecret: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ constructor(

private val sync: FinchClient by lazy { FinchClientImpl(clientOptions) }

private val accessTokens: AccessTokenServiceAsync by lazy {
AccessTokenServiceAsyncImpl(clientOptions)
}

private val hris: HrisServiceAsync by lazy { HrisServiceAsyncImpl(clientOptions) }

private val providers: ProviderServiceAsync by lazy { ProviderServiceAsyncImpl(clientOptions) }
Expand All @@ -41,11 +45,17 @@ constructor(

private val jobs: JobServiceAsync by lazy { JobServiceAsyncImpl(clientOptions) }

private val auth: AuthServiceAsync by lazy { AuthServiceAsyncImpl(clientOptions) }

private val sandbox: SandboxServiceAsync by lazy { SandboxServiceAsyncImpl(clientOptions) }

private val getAccessTokenHandler: Handler<GetAccessTokenResponse> =
jsonHandler<GetAccessTokenResponse>(clientOptions.jsonMapper).withErrorHandler(errorHandler)

override fun sync(): FinchClient = sync

override fun accessTokens(): AccessTokenServiceAsync = accessTokens

override fun hris(): HrisServiceAsync = hris

override fun providers(): ProviderServiceAsync = providers
Expand All @@ -58,6 +68,10 @@ constructor(

override fun jobs(): JobServiceAsync = jobs

override fun auth(): AuthServiceAsync = auth

override fun sandbox(): SandboxServiceAsync = sandbox

override fun getAccessToken(
clientId: String,
clientSecret: String,
Expand Down Expand Up @@ -102,6 +116,23 @@ constructor(
"&sandbox=${if (sandbox) "true" else "false"}"
}

override fun withAccessToken(accessToken: String): FinchClientAsync {
return FinchClientAsyncImpl(
ClientOptions.builder()
.httpClient(clientOptions.httpClient)
.jsonMapper(clientOptions.jsonMapper)
.clock(clientOptions.clock)
.baseUrl(clientOptions.baseUrl)
.accessToken(accessToken)
.clientId(clientOptions.clientId)
.clientSecret(clientOptions.clientSecret)
.webhookSecret(clientOptions.webhookSecret)
.headers(clientOptions.headers.asMap())
.responseValidation(clientOptions.responseValidation)
.build()
)
}

private data class GetAccessTokenParams(
@JsonProperty("client_id") val clientId: String,
@JsonProperty("client_secret") val clientSecret: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ constructor(

private val async: FinchClientAsync by lazy { FinchClientAsyncImpl(clientOptions) }

private val accessTokens: AccessTokenService by lazy { AccessTokenServiceImpl(clientOptions) }

private val hris: HrisService by lazy { HrisServiceImpl(clientOptions) }

private val providers: ProviderService by lazy { ProviderServiceImpl(clientOptions) }
Expand All @@ -40,11 +42,17 @@ constructor(

private val jobs: JobService by lazy { JobServiceImpl(clientOptions) }

private val auth: AuthService by lazy { AuthServiceImpl(clientOptions) }

private val sandbox: SandboxService by lazy { SandboxServiceImpl(clientOptions) }

private val getAccessTokenHandler: Handler<GetAccessTokenResponse> =
jsonHandler<GetAccessTokenResponse>(clientOptions.jsonMapper).withErrorHandler(errorHandler)

override fun async(): FinchClientAsync = async

override fun accessTokens(): AccessTokenService = accessTokens

override fun hris(): HrisService = hris

override fun providers(): ProviderService = providers
Expand All @@ -57,6 +65,10 @@ constructor(

override fun jobs(): JobService = jobs

override fun auth(): AuthService = auth

override fun sandbox(): SandboxService = sandbox

override fun getAccessToken(
clientId: String,
clientSecret: String,
Expand Down Expand Up @@ -101,6 +113,23 @@ constructor(
"&sandbox=${if (sandbox) "true" else "false"}"
}

override fun withAccessToken(accessToken: String): FinchClient {
return FinchClientImpl(
ClientOptions.builder()
.httpClient(clientOptions.httpClient)
.jsonMapper(clientOptions.jsonMapper)
.clock(clientOptions.clock)
.baseUrl(clientOptions.baseUrl)
.accessToken(accessToken)
.clientId(clientOptions.clientId)
.clientSecret(clientOptions.clientSecret)
.webhookSecret(clientOptions.webhookSecret)
.headers(clientOptions.headers.asMap())
.responseValidation(clientOptions.responseValidation)
.build()
)
}

private data class GetAccessTokenParams(
@JsonProperty("client_id") val clientId: String,
@JsonProperty("client_secret") val clientSecret: String,
Expand Down
Loading