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 @@
{
".": "5.1.0"
".": "5.2.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 45
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-bf858f37d7ab420841ddc6329dad8c46377308b6a5c8e935908011d0f9845e22.yml
openapi_spec_hash: 2523952a32436e3c7fd3b55508c2e7ee
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-ff61a38530dfae03860bceb49379e84bfc7434eeb5d2f1dc9677cb162014faf1.yml
openapi_spec_hash: df3bdaf4acf575bb07767cae7ca24d69
config_hash: 53778a0b839c4f6ad34fbba051f5e8a6
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 5.2.0 (2025-04-12)

Full Changelog: [v5.1.0...v5.2.0](https://github.com/Finch-API/finch-api-java/compare/v5.1.0...v5.2.0)

### Features

* **api:** api update ([544560e](https://github.com/Finch-API/finch-api-java/commit/544560e359f1a248bda35b6d076f0711bcec181b))

## 5.1.0 (2025-04-11)

Full Changelog: [v5.0.0...v5.1.0](https://github.com/Finch-API/finch-api-java/compare/v5.0.0...v5.1.0)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<!-- 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/5.1.0)
[![javadoc](https://javadoc.io/badge2/com.tryfinch.api/finch-java/5.1.0/javadoc.svg)](https://javadoc.io/doc/com.tryfinch.api/finch-java/5.1.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.tryfinch.api/finch-java)](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/5.2.0)
[![javadoc](https://javadoc.io/badge2/com.tryfinch.api/finch-java/5.2.0/javadoc.svg)](https://javadoc.io/doc/com.tryfinch.api/finch-java/5.2.0)

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

Expand All @@ -15,7 +15,7 @@ It is generated with [Stainless](https://www.stainless.com/).

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

The REST API documentation can be found on [developer.tryfinch.com](https://developer.tryfinch.com/). Javadocs are also available on [javadoc.io](https://javadoc.io/doc/com.tryfinch.api/finch-java/5.1.0).
The REST API documentation can be found on [developer.tryfinch.com](https://developer.tryfinch.com/). Javadocs are also available on [javadoc.io](https://javadoc.io/doc/com.tryfinch.api/finch-java/5.2.0).

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

Expand All @@ -26,7 +26,7 @@ The REST API documentation can be found on [developer.tryfinch.com](https://deve
### Gradle

```kotlin
implementation("com.tryfinch.api:finch-java:5.1.0")
implementation("com.tryfinch.api:finch-java:5.2.0")
```

### Maven
Expand All @@ -35,7 +35,7 @@ implementation("com.tryfinch.api:finch-java:5.1.0")
<dependency>
<groupId>com.tryfinch.api</groupId>
<artifactId>finch-java</artifactId>
<version>5.1.0</version>
<version>5.2.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 @@ -8,7 +8,7 @@ repositories {

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

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import kotlin.jvm.optionals.getOrNull

class Introspection
private constructor(
private val id: JsonField<String>,
private val accountId: JsonField<String>,
private val authenticationMethods: JsonField<List<AuthenticationMethod>>,
private val clientId: JsonField<String>,
Expand All @@ -44,6 +45,7 @@ private constructor(

@JsonCreator
private constructor(
@JsonProperty("id") @ExcludeMissing id: JsonField<String> = JsonMissing.of(),
@JsonProperty("account_id") @ExcludeMissing accountId: JsonField<String> = JsonMissing.of(),
@JsonProperty("authentication_methods")
@ExcludeMissing
Expand Down Expand Up @@ -83,6 +85,7 @@ private constructor(
providerId: JsonField<String> = JsonMissing.of(),
@JsonProperty("username") @ExcludeMissing username: JsonField<String> = JsonMissing.of(),
) : this(
id,
accountId,
authenticationMethods,
clientId,
Expand All @@ -102,6 +105,14 @@ private constructor(
mutableMapOf(),
)

/**
* The Finch UUID of the token being introspected.
*
* @throws FinchInvalidDataException if the JSON field has an unexpected type or is unexpectedly
* missing or null (e.g. if the server responded with an unexpected value).
*/
fun id(): String = id.getRequired("id")

/**
* [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of this
* account ID.
Expand Down Expand Up @@ -236,6 +247,13 @@ private constructor(
*/
fun username(): String = username.getRequired("username")

/**
* Returns the raw JSON value of [id].
*
* Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
*/
@JsonProperty("id") @ExcludeMissing fun _id(): JsonField<String> = id

/**
* Returns the raw JSON value of [accountId].
*
Expand Down Expand Up @@ -393,6 +411,7 @@ private constructor(
*
* The following fields are required:
* ```java
* .id()
* .accountId()
* .authenticationMethods()
* .clientId()
Expand All @@ -417,6 +436,7 @@ private constructor(
/** A builder for [Introspection]. */
class Builder internal constructor() {

private var id: JsonField<String>? = null
private var accountId: JsonField<String>? = null
private var authenticationMethods: JsonField<MutableList<AuthenticationMethod>>? = null
private var clientId: JsonField<String>? = null
Expand All @@ -437,6 +457,7 @@ private constructor(

@JvmSynthetic
internal fun from(introspection: Introspection) = apply {
id = introspection.id
accountId = introspection.accountId
authenticationMethods = introspection.authenticationMethods.map { it.toMutableList() }
clientId = introspection.clientId
Expand All @@ -456,6 +477,17 @@ private constructor(
additionalProperties = introspection.additionalProperties.toMutableMap()
}

/** The Finch UUID of the token being introspected. */
fun id(id: String) = id(JsonField.of(id))

/**
* Sets [Builder.id] to an arbitrary JSON value.
*
* You should usually call [Builder.id] with a well-typed [String] value instead. This
* method is primarily for setting the field to an undocumented or not yet supported value.
*/
fun id(id: JsonField<String>) = apply { this.id = id }

/**
* [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of
* this account ID.
Expand Down Expand Up @@ -756,6 +788,7 @@ private constructor(
*
* The following fields are required:
* ```java
* .id()
* .accountId()
* .authenticationMethods()
* .clientId()
Expand All @@ -778,6 +811,7 @@ private constructor(
*/
fun build(): Introspection =
Introspection(
checkRequired("id", id),
checkRequired("accountId", accountId),
checkRequired("authenticationMethods", authenticationMethods).map {
it.toImmutable()
Expand Down Expand Up @@ -807,6 +841,7 @@ private constructor(
return@apply
}

id()
accountId()
authenticationMethods().forEach { it.validate() }
clientId()
Expand Down Expand Up @@ -841,7 +876,8 @@ private constructor(
*/
@JvmSynthetic
internal fun validity(): Int =
(if (accountId.asKnown().isPresent) 1 else 0) +
(if (id.asKnown().isPresent) 1 else 0) +
(if (accountId.asKnown().isPresent) 1 else 0) +
(authenticationMethods.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(if (clientId.asKnown().isPresent) 1 else 0) +
(clientType.asKnown().getOrNull()?.validity() ?: 0) +
Expand Down Expand Up @@ -1913,15 +1949,15 @@ private constructor(
return true
}

return /* spotless:off */ other is Introspection && accountId == other.accountId && authenticationMethods == other.authenticationMethods && clientId == other.clientId && clientType == other.clientType && companyId == other.companyId && connectionId == other.connectionId && connectionStatus == other.connectionStatus && connectionType == other.connectionType && customerEmail == other.customerEmail && customerId == other.customerId && customerName == other.customerName && manual == other.manual && payrollProviderId == other.payrollProviderId && products == other.products && providerId == other.providerId && username == other.username && additionalProperties == other.additionalProperties /* spotless:on */
return /* spotless:off */ other is Introspection && id == other.id && accountId == other.accountId && authenticationMethods == other.authenticationMethods && clientId == other.clientId && clientType == other.clientType && companyId == other.companyId && connectionId == other.connectionId && connectionStatus == other.connectionStatus && connectionType == other.connectionType && customerEmail == other.customerEmail && customerId == other.customerId && customerName == other.customerName && manual == other.manual && payrollProviderId == other.payrollProviderId && products == other.products && providerId == other.providerId && username == other.username && additionalProperties == other.additionalProperties /* spotless:on */
}

/* spotless:off */
private val hashCode: Int by lazy { Objects.hash(accountId, authenticationMethods, clientId, clientType, companyId, connectionId, connectionStatus, connectionType, customerEmail, customerId, customerName, manual, payrollProviderId, products, providerId, username, additionalProperties) }
private val hashCode: Int by lazy { Objects.hash(id, accountId, authenticationMethods, clientId, clientType, companyId, connectionId, connectionStatus, connectionType, customerEmail, customerId, customerName, manual, payrollProviderId, products, providerId, username, additionalProperties) }
/* spotless:on */

override fun hashCode(): Int = hashCode

override fun toString() =
"Introspection{accountId=$accountId, authenticationMethods=$authenticationMethods, clientId=$clientId, clientType=$clientType, companyId=$companyId, connectionId=$connectionId, connectionStatus=$connectionStatus, connectionType=$connectionType, customerEmail=$customerEmail, customerId=$customerId, customerName=$customerName, manual=$manual, payrollProviderId=$payrollProviderId, products=$products, providerId=$providerId, username=$username, additionalProperties=$additionalProperties}"
"Introspection{id=$id, accountId=$accountId, authenticationMethods=$authenticationMethods, clientId=$clientId, clientType=$clientType, companyId=$companyId, connectionId=$connectionId, connectionStatus=$connectionStatus, connectionType=$connectionType, customerEmail=$customerEmail, customerId=$customerId, customerName=$customerName, manual=$manual, payrollProviderId=$payrollProviderId, products=$products, providerId=$providerId, username=$username, additionalProperties=$additionalProperties}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ internal class IntrospectionTest {
fun create() {
val introspection =
Introspection.builder()
.id("id")
.accountId("account_id")
.addAuthenticationMethod(
Introspection.AuthenticationMethod.builder()
Expand Down Expand Up @@ -49,6 +50,7 @@ internal class IntrospectionTest {
.username("username")
.build()

assertThat(introspection.id()).isEqualTo("id")
assertThat(introspection.accountId()).isEqualTo("account_id")
assertThat(introspection.authenticationMethods())
.containsExactly(
Expand Down Expand Up @@ -91,6 +93,7 @@ internal class IntrospectionTest {
val jsonMapper = jsonMapper()
val introspection =
Introspection.builder()
.id("id")
.accountId("account_id")
.addAuthenticationMethod(
Introspection.AuthenticationMethod.builder()
Expand Down