Skip to content

Commit 44864b7

Browse files
feat(api): api update
1 parent 71bc2ee commit 44864b7

File tree

13 files changed

+23
-453
lines changed

13 files changed

+23
-453
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 45
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-ef0b0fb4ec85648855da514cbc53018cb429fb37bce8570bc6c44254eb32c62f.yml
3-
openapi_spec_hash: 38622a4a3cdef04686053018329616f2
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-df44cda9b18320f8a8117d5c8dfa02ebd6739fc77fc87eb284748c987a7412a4.yml
3+
openapi_spec_hash: 69524ddfedf3c4492e77826561f7c7d8
44
config_hash: 6d3585c0032e08d723d077d660fc8448

finch-java-core/src/main/kotlin/com/tryfinch/api/models/Introspection.kt

Lines changed: 1 addition & 224 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ private constructor(
4949
private val customerEmail: JsonField<String>,
5050
private val customerId: JsonField<String>,
5151
private val customerName: JsonField<String>,
52-
private val entityIds: JsonField<List<String>>,
53-
private val entityMode: JsonField<EntityMode>,
5452
private val manual: JsonField<Boolean>,
5553
private val payrollProviderId: JsonField<String>,
5654
private val username: JsonField<String>,
@@ -93,12 +91,6 @@ private constructor(
9391
@JsonProperty("customer_name")
9492
@ExcludeMissing
9593
customerName: JsonField<String> = JsonMissing.of(),
96-
@JsonProperty("entity_ids")
97-
@ExcludeMissing
98-
entityIds: JsonField<List<String>> = JsonMissing.of(),
99-
@JsonProperty("entity_mode")
100-
@ExcludeMissing
101-
entityMode: JsonField<EntityMode> = JsonMissing.of(),
10294
@JsonProperty("manual") @ExcludeMissing manual: JsonField<Boolean> = JsonMissing.of(),
10395
@JsonProperty("payroll_provider_id")
10496
@ExcludeMissing
@@ -119,8 +111,6 @@ private constructor(
119111
customerEmail,
120112
customerId,
121113
customerName,
122-
entityIds,
123-
entityMode,
124114
manual,
125115
payrollProviderId,
126116
username,
@@ -246,22 +236,6 @@ private constructor(
246236
*/
247237
fun customerName(): Optional<String> = customerName.getOptional("customer_name")
248238

249-
/**
250-
* Array of entity IDs associated with this connection.
251-
*
252-
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
253-
* server responded with an unexpected value).
254-
*/
255-
fun entityIds(): Optional<List<String>> = entityIds.getOptional("entity_ids")
256-
257-
/**
258-
* Indicates whether this connection manages a single entity or multiple entities.
259-
*
260-
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
261-
* server responded with an unexpected value).
262-
*/
263-
fun entityMode(): Optional<EntityMode> = entityMode.getOptional("entity_mode")
264-
265239
/**
266240
* Whether the connection associated with the `access_token` uses the Assisted Connect Flow.
267241
* (`true` if using Assisted Connect, `false` if connection is automated)
@@ -409,24 +383,6 @@ private constructor(
409383
@ExcludeMissing
410384
fun _customerName(): JsonField<String> = customerName
411385

412-
/**
413-
* Returns the raw JSON value of [entityIds].
414-
*
415-
* Unlike [entityIds], this method doesn't throw if the JSON field has an unexpected type.
416-
*/
417-
@JsonProperty("entity_ids")
418-
@ExcludeMissing
419-
fun _entityIds(): JsonField<List<String>> = entityIds
420-
421-
/**
422-
* Returns the raw JSON value of [entityMode].
423-
*
424-
* Unlike [entityMode], this method doesn't throw if the JSON field has an unexpected type.
425-
*/
426-
@JsonProperty("entity_mode")
427-
@ExcludeMissing
428-
fun _entityMode(): JsonField<EntityMode> = entityMode
429-
430386
/**
431387
* Returns the raw JSON value of [manual].
432388
*
@@ -502,8 +458,6 @@ private constructor(
502458
private var customerEmail: JsonField<String> = JsonMissing.of()
503459
private var customerId: JsonField<String> = JsonMissing.of()
504460
private var customerName: JsonField<String> = JsonMissing.of()
505-
private var entityIds: JsonField<MutableList<String>>? = null
506-
private var entityMode: JsonField<EntityMode> = JsonMissing.of()
507461
private var manual: JsonField<Boolean> = JsonMissing.of()
508462
private var payrollProviderId: JsonField<String> = JsonMissing.of()
509463
private var username: JsonField<String> = JsonMissing.of()
@@ -525,8 +479,6 @@ private constructor(
525479
customerEmail = introspection.customerEmail
526480
customerId = introspection.customerId
527481
customerName = introspection.customerName
528-
entityIds = introspection.entityIds.map { it.toMutableList() }
529-
entityMode = introspection.entityMode
530482
manual = introspection.manual
531483
payrollProviderId = introspection.payrollProviderId
532484
username = introspection.username
@@ -772,44 +724,6 @@ private constructor(
772724
this.customerName = customerName
773725
}
774726

775-
/** Array of entity IDs associated with this connection. */
776-
fun entityIds(entityIds: List<String>) = entityIds(JsonField.of(entityIds))
777-
778-
/**
779-
* Sets [Builder.entityIds] to an arbitrary JSON value.
780-
*
781-
* You should usually call [Builder.entityIds] with a well-typed `List<String>` value
782-
* instead. This method is primarily for setting the field to an undocumented or not yet
783-
* supported value.
784-
*/
785-
fun entityIds(entityIds: JsonField<List<String>>) = apply {
786-
this.entityIds = entityIds.map { it.toMutableList() }
787-
}
788-
789-
/**
790-
* Adds a single [String] to [entityIds].
791-
*
792-
* @throws IllegalStateException if the field was previously set to a non-list.
793-
*/
794-
fun addEntityId(entityId: String) = apply {
795-
entityIds =
796-
(entityIds ?: JsonField.of(mutableListOf())).also {
797-
checkKnown("entityIds", it).add(entityId)
798-
}
799-
}
800-
801-
/** Indicates whether this connection manages a single entity or multiple entities. */
802-
fun entityMode(entityMode: EntityMode) = entityMode(JsonField.of(entityMode))
803-
804-
/**
805-
* Sets [Builder.entityMode] to an arbitrary JSON value.
806-
*
807-
* You should usually call [Builder.entityMode] with a well-typed [EntityMode] value
808-
* instead. This method is primarily for setting the field to an undocumented or not yet
809-
* supported value.
810-
*/
811-
fun entityMode(entityMode: JsonField<EntityMode>) = apply { this.entityMode = entityMode }
812-
813727
/**
814728
* Whether the connection associated with the `access_token` uses the Assisted Connect Flow.
815729
* (`true` if using Assisted Connect, `false` if connection is automated)
@@ -912,8 +826,6 @@ private constructor(
912826
customerEmail,
913827
customerId,
914828
customerName,
915-
(entityIds ?: JsonMissing.of()).map { it.toImmutable() },
916-
entityMode,
917829
manual,
918830
payrollProviderId,
919831
username,
@@ -942,8 +854,6 @@ private constructor(
942854
customerEmail()
943855
customerId()
944856
customerName()
945-
entityIds()
946-
entityMode().ifPresent { it.validate() }
947857
manual()
948858
payrollProviderId()
949859
username()
@@ -979,8 +889,6 @@ private constructor(
979889
(if (customerEmail.asKnown().isPresent) 1 else 0) +
980890
(if (customerId.asKnown().isPresent) 1 else 0) +
981891
(if (customerName.asKnown().isPresent) 1 else 0) +
982-
(entityIds.asKnown().getOrNull()?.size ?: 0) +
983-
(entityMode.asKnown().getOrNull()?.validity() ?: 0) +
984892
(if (manual.asKnown().isPresent) 1 else 0) +
985893
(if (payrollProviderId.asKnown().isPresent) 1 else 0) +
986894
(if (username.asKnown().isPresent) 1 else 0)
@@ -2542,133 +2450,6 @@ private constructor(
25422450
"AuthenticationMethodDetail{type=$type, connectionStatus=$connectionStatus, products=$products, additionalProperties=$additionalProperties}"
25432451
}
25442452

2545-
/** Indicates whether this connection manages a single entity or multiple entities. */
2546-
class EntityMode @JsonCreator private constructor(private val value: JsonField<String>) : Enum {
2547-
2548-
/**
2549-
* Returns this class instance's raw value.
2550-
*
2551-
* This is usually only useful if this instance was deserialized from data that doesn't
2552-
* match any known member, and you want to know that value. For example, if the SDK is on an
2553-
* older version than the API, then the API may respond with new members that the SDK is
2554-
* unaware of.
2555-
*/
2556-
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
2557-
2558-
companion object {
2559-
2560-
@JvmField val SINGLE = of("single")
2561-
2562-
@JvmField val MULTI = of("multi")
2563-
2564-
@JvmStatic fun of(value: String) = EntityMode(JsonField.of(value))
2565-
}
2566-
2567-
/** An enum containing [EntityMode]'s known values. */
2568-
enum class Known {
2569-
SINGLE,
2570-
MULTI,
2571-
}
2572-
2573-
/**
2574-
* An enum containing [EntityMode]'s known values, as well as an [_UNKNOWN] member.
2575-
*
2576-
* An instance of [EntityMode] can contain an unknown value in a couple of cases:
2577-
* - It was deserialized from data that doesn't match any known member. For example, if the
2578-
* SDK is on an older version than the API, then the API may respond with new members that
2579-
* the SDK is unaware of.
2580-
* - It was constructed with an arbitrary value using the [of] method.
2581-
*/
2582-
enum class Value {
2583-
SINGLE,
2584-
MULTI,
2585-
/**
2586-
* An enum member indicating that [EntityMode] was instantiated with an unknown value.
2587-
*/
2588-
_UNKNOWN,
2589-
}
2590-
2591-
/**
2592-
* Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
2593-
* if the class was instantiated with an unknown value.
2594-
*
2595-
* Use the [known] method instead if you're certain the value is always known or if you want
2596-
* to throw for the unknown case.
2597-
*/
2598-
fun value(): Value =
2599-
when (this) {
2600-
SINGLE -> Value.SINGLE
2601-
MULTI -> Value.MULTI
2602-
else -> Value._UNKNOWN
2603-
}
2604-
2605-
/**
2606-
* Returns an enum member corresponding to this class instance's value.
2607-
*
2608-
* Use the [value] method instead if you're uncertain the value is always known and don't
2609-
* want to throw for the unknown case.
2610-
*
2611-
* @throws FinchInvalidDataException if this class instance's value is a not a known member.
2612-
*/
2613-
fun known(): Known =
2614-
when (this) {
2615-
SINGLE -> Known.SINGLE
2616-
MULTI -> Known.MULTI
2617-
else -> throw FinchInvalidDataException("Unknown EntityMode: $value")
2618-
}
2619-
2620-
/**
2621-
* Returns this class instance's primitive wire representation.
2622-
*
2623-
* This differs from the [toString] method because that method is primarily for debugging
2624-
* and generally doesn't throw.
2625-
*
2626-
* @throws FinchInvalidDataException if this class instance's value does not have the
2627-
* expected primitive type.
2628-
*/
2629-
fun asString(): String =
2630-
_value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") }
2631-
2632-
private var validated: Boolean = false
2633-
2634-
fun validate(): EntityMode = apply {
2635-
if (validated) {
2636-
return@apply
2637-
}
2638-
2639-
known()
2640-
validated = true
2641-
}
2642-
2643-
fun isValid(): Boolean =
2644-
try {
2645-
validate()
2646-
true
2647-
} catch (e: FinchInvalidDataException) {
2648-
false
2649-
}
2650-
2651-
/**
2652-
* Returns a score indicating how many valid values are contained in this object
2653-
* recursively.
2654-
*
2655-
* Used for best match union deserialization.
2656-
*/
2657-
@JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
2658-
2659-
override fun equals(other: Any?): Boolean {
2660-
if (this === other) {
2661-
return true
2662-
}
2663-
2664-
return other is EntityMode && value == other.value
2665-
}
2666-
2667-
override fun hashCode() = value.hashCode()
2668-
2669-
override fun toString() = value.toString()
2670-
}
2671-
26722453
override fun equals(other: Any?): Boolean {
26732454
if (this === other) {
26742455
return true
@@ -2689,8 +2470,6 @@ private constructor(
26892470
customerEmail == other.customerEmail &&
26902471
customerId == other.customerId &&
26912472
customerName == other.customerName &&
2692-
entityIds == other.entityIds &&
2693-
entityMode == other.entityMode &&
26942473
manual == other.manual &&
26952474
payrollProviderId == other.payrollProviderId &&
26962475
username == other.username &&
@@ -2713,8 +2492,6 @@ private constructor(
27132492
customerEmail,
27142493
customerId,
27152494
customerName,
2716-
entityIds,
2717-
entityMode,
27182495
manual,
27192496
payrollProviderId,
27202497
username,
@@ -2725,5 +2502,5 @@ private constructor(
27252502
override fun hashCode(): Int = hashCode
27262503

27272504
override fun toString() =
2728-
"Introspection{id=$id, clientId=$clientId, clientType=$clientType, connectionId=$connectionId, connectionStatus=$connectionStatus, connectionType=$connectionType, products=$products, providerId=$providerId, accountId=$accountId, authenticationMethods=$authenticationMethods, companyId=$companyId, customerEmail=$customerEmail, customerId=$customerId, customerName=$customerName, entityIds=$entityIds, entityMode=$entityMode, manual=$manual, payrollProviderId=$payrollProviderId, username=$username, additionalProperties=$additionalProperties}"
2505+
"Introspection{id=$id, clientId=$clientId, clientType=$clientType, connectionId=$connectionId, connectionStatus=$connectionStatus, connectionType=$connectionType, products=$products, providerId=$providerId, accountId=$accountId, authenticationMethods=$authenticationMethods, companyId=$companyId, customerEmail=$customerEmail, customerId=$customerId, customerName=$customerName, manual=$manual, payrollProviderId=$payrollProviderId, username=$username, additionalProperties=$additionalProperties}"
27292506
}

0 commit comments

Comments
 (0)