@@ -23,6 +23,7 @@ import kotlin.jvm.optionals.getOrNull
2323
2424class Introspection
2525private constructor (
26+ private val id: JsonField <String >,
2627 private val accountId: JsonField <String >,
2728 private val authenticationMethods: JsonField <List <AuthenticationMethod >>,
2829 private val clientId: JsonField <String >,
@@ -44,6 +45,7 @@ private constructor(
4445
4546 @JsonCreator
4647 private constructor (
48+ @JsonProperty(" id" ) @ExcludeMissing id: JsonField <String > = JsonMissing .of(),
4749 @JsonProperty(" account_id" ) @ExcludeMissing accountId: JsonField <String > = JsonMissing .of(),
4850 @JsonProperty(" authentication_methods" )
4951 @ExcludeMissing
@@ -83,6 +85,7 @@ private constructor(
8385 providerId: JsonField <String > = JsonMissing .of(),
8486 @JsonProperty(" username" ) @ExcludeMissing username: JsonField <String > = JsonMissing .of(),
8587 ) : this (
88+ id,
8689 accountId,
8790 authenticationMethods,
8891 clientId,
@@ -102,6 +105,14 @@ private constructor(
102105 mutableMapOf (),
103106 )
104107
108+ /* *
109+ * The Finch UUID of the token being introspected.
110+ *
111+ * @throws FinchInvalidDataException if the JSON field has an unexpected type or is unexpectedly
112+ * missing or null (e.g. if the server responded with an unexpected value).
113+ */
114+ fun id (): String = id.getRequired(" id" )
115+
105116 /* *
106117 * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of this
107118 * account ID.
@@ -236,6 +247,13 @@ private constructor(
236247 */
237248 fun username (): String = username.getRequired(" username" )
238249
250+ /* *
251+ * Returns the raw JSON value of [id].
252+ *
253+ * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
254+ */
255+ @JsonProperty(" id" ) @ExcludeMissing fun _id (): JsonField <String > = id
256+
239257 /* *
240258 * Returns the raw JSON value of [accountId].
241259 *
@@ -393,6 +411,7 @@ private constructor(
393411 *
394412 * The following fields are required:
395413 * ```java
414+ * .id()
396415 * .accountId()
397416 * .authenticationMethods()
398417 * .clientId()
@@ -417,6 +436,7 @@ private constructor(
417436 /* * A builder for [Introspection]. */
418437 class Builder internal constructor() {
419438
439+ private var id: JsonField <String >? = null
420440 private var accountId: JsonField <String >? = null
421441 private var authenticationMethods: JsonField <MutableList <AuthenticationMethod >>? = null
422442 private var clientId: JsonField <String >? = null
@@ -437,6 +457,7 @@ private constructor(
437457
438458 @JvmSynthetic
439459 internal fun from (introspection : Introspection ) = apply {
460+ id = introspection.id
440461 accountId = introspection.accountId
441462 authenticationMethods = introspection.authenticationMethods.map { it.toMutableList() }
442463 clientId = introspection.clientId
@@ -456,6 +477,17 @@ private constructor(
456477 additionalProperties = introspection.additionalProperties.toMutableMap()
457478 }
458479
480+ /* * The Finch UUID of the token being introspected. */
481+ fun id (id : String ) = id(JsonField .of(id))
482+
483+ /* *
484+ * Sets [Builder.id] to an arbitrary JSON value.
485+ *
486+ * You should usually call [Builder.id] with a well-typed [String] value instead. This
487+ * method is primarily for setting the field to an undocumented or not yet supported value.
488+ */
489+ fun id (id : JsonField <String >) = apply { this .id = id }
490+
459491 /* *
460492 * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of
461493 * this account ID.
@@ -756,6 +788,7 @@ private constructor(
756788 *
757789 * The following fields are required:
758790 * ```java
791+ * .id()
759792 * .accountId()
760793 * .authenticationMethods()
761794 * .clientId()
@@ -778,6 +811,7 @@ private constructor(
778811 */
779812 fun build (): Introspection =
780813 Introspection (
814+ checkRequired(" id" , id),
781815 checkRequired(" accountId" , accountId),
782816 checkRequired(" authenticationMethods" , authenticationMethods).map {
783817 it.toImmutable()
@@ -807,6 +841,7 @@ private constructor(
807841 return @apply
808842 }
809843
844+ id()
810845 accountId()
811846 authenticationMethods().forEach { it.validate() }
812847 clientId()
@@ -841,7 +876,8 @@ private constructor(
841876 */
842877 @JvmSynthetic
843878 internal fun validity (): Int =
844- (if (accountId.asKnown().isPresent) 1 else 0 ) +
879+ (if (id.asKnown().isPresent) 1 else 0 ) +
880+ (if (accountId.asKnown().isPresent) 1 else 0 ) +
845881 (authenticationMethods.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ? : 0 ) +
846882 (if (clientId.asKnown().isPresent) 1 else 0 ) +
847883 (clientType.asKnown().getOrNull()?.validity() ? : 0 ) +
@@ -1913,15 +1949,15 @@ private constructor(
19131949 return true
19141950 }
19151951
1916- 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 */
1952+ 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 */
19171953 }
19181954
19191955 /* spotless:off */
1920- 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) }
1956+ 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) }
19211957 /* spotless:on */
19221958
19231959 override fun hashCode (): Int = hashCode
19241960
19251961 override fun toString () =
1926- " 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 }"
1962+ " 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 }"
19271963}
0 commit comments