@@ -27,6 +27,7 @@ private constructor(
2727 private val clientType: JsonField <ClientType >,
2828 private val connectionId: JsonField <String >,
2929 private val connectionType: JsonField <ConnectionType >,
30+ private val entityIds: JsonField <List <String >>,
3031 private val products: JsonField <List <String >>,
3132 private val providerId: JsonField <String >,
3233 private val tokenType: JsonField <String >,
@@ -50,6 +51,9 @@ private constructor(
5051 @JsonProperty(" connection_type" )
5152 @ExcludeMissing
5253 connectionType: JsonField <ConnectionType > = JsonMissing .of(),
54+ @JsonProperty(" entity_ids" )
55+ @ExcludeMissing
56+ entityIds: JsonField <List <String >> = JsonMissing .of(),
5357 @JsonProperty(" products" )
5458 @ExcludeMissing
5559 products: JsonField <List <String >> = JsonMissing .of(),
@@ -67,6 +71,7 @@ private constructor(
6771 clientType,
6872 connectionId,
6973 connectionType,
74+ entityIds,
7075 products,
7176 providerId,
7277 tokenType,
@@ -110,6 +115,14 @@ private constructor(
110115 */
111116 fun connectionType (): ConnectionType = connectionType.getRequired(" connection_type" )
112117
118+ /* *
119+ * An array of entity IDs that can be accessed with this access token
120+ *
121+ * @throws FinchInvalidDataException if the JSON field has an unexpected type or is unexpectedly
122+ * missing or null (e.g. if the server responded with an unexpected value).
123+ */
124+ fun entityIds (): List <String > = entityIds.getRequired(" entity_ids" )
125+
113126 /* *
114127 * An array of the authorized products associated with the `access_token`
115128 *
@@ -197,6 +210,15 @@ private constructor(
197210 @ExcludeMissing
198211 fun _connectionType (): JsonField <ConnectionType > = connectionType
199212
213+ /* *
214+ * Returns the raw JSON value of [entityIds].
215+ *
216+ * Unlike [entityIds], this method doesn't throw if the JSON field has an unexpected type.
217+ */
218+ @JsonProperty(" entity_ids" )
219+ @ExcludeMissing
220+ fun _entityIds (): JsonField <List <String >> = entityIds
221+
200222 /* *
201223 * Returns the raw JSON value of [products].
202224 *
@@ -268,6 +290,7 @@ private constructor(
268290 * .clientType()
269291 * .connectionId()
270292 * .connectionType()
293+ * .entityIds()
271294 * .products()
272295 * .providerId()
273296 * .tokenType()
@@ -283,6 +306,7 @@ private constructor(
283306 private var clientType: JsonField <ClientType >? = null
284307 private var connectionId: JsonField <String >? = null
285308 private var connectionType: JsonField <ConnectionType >? = null
309+ private var entityIds: JsonField <MutableList <String >>? = null
286310 private var products: JsonField <MutableList <String >>? = null
287311 private var providerId: JsonField <String >? = null
288312 private var tokenType: JsonField <String >? = null
@@ -297,6 +321,7 @@ private constructor(
297321 clientType = createAccessTokenResponse.clientType
298322 connectionId = createAccessTokenResponse.connectionId
299323 connectionType = createAccessTokenResponse.connectionType
324+ entityIds = createAccessTokenResponse.entityIds.map { it.toMutableList() }
300325 products = createAccessTokenResponse.products.map { it.toMutableList() }
301326 providerId = createAccessTokenResponse.providerId
302327 tokenType = createAccessTokenResponse.tokenType
@@ -363,6 +388,32 @@ private constructor(
363388 this .connectionType = connectionType
364389 }
365390
391+ /* * An array of entity IDs that can be accessed with this access token */
392+ fun entityIds (entityIds : List <String >) = entityIds(JsonField .of(entityIds))
393+
394+ /* *
395+ * Sets [Builder.entityIds] to an arbitrary JSON value.
396+ *
397+ * You should usually call [Builder.entityIds] with a well-typed `List<String>` value
398+ * instead. This method is primarily for setting the field to an undocumented or not yet
399+ * supported value.
400+ */
401+ fun entityIds (entityIds : JsonField <List <String >>) = apply {
402+ this .entityIds = entityIds.map { it.toMutableList() }
403+ }
404+
405+ /* *
406+ * Adds a single [String] to [entityIds].
407+ *
408+ * @throws IllegalStateException if the field was previously set to a non-list.
409+ */
410+ fun addEntityId (entityId : String ) = apply {
411+ entityIds =
412+ (entityIds ? : JsonField .of(mutableListOf ())).also {
413+ checkKnown(" entityIds" , it).add(entityId)
414+ }
415+ }
416+
366417 /* * An array of the authorized products associated with the `access_token` */
367418 fun products (products : List <String >) = products(JsonField .of(products))
368419
@@ -493,6 +544,7 @@ private constructor(
493544 * .clientType()
494545 * .connectionId()
495546 * .connectionType()
547+ * .entityIds()
496548 * .products()
497549 * .providerId()
498550 * .tokenType()
@@ -506,6 +558,7 @@ private constructor(
506558 checkRequired(" clientType" , clientType),
507559 checkRequired(" connectionId" , connectionId),
508560 checkRequired(" connectionType" , connectionType),
561+ checkRequired(" entityIds" , entityIds).map { it.toImmutable() },
509562 checkRequired(" products" , products).map { it.toImmutable() },
510563 checkRequired(" providerId" , providerId),
511564 checkRequired(" tokenType" , tokenType),
@@ -527,6 +580,7 @@ private constructor(
527580 clientType().validate()
528581 connectionId()
529582 connectionType().validate()
583+ entityIds()
530584 products()
531585 providerId()
532586 tokenType()
@@ -555,6 +609,7 @@ private constructor(
555609 (clientType.asKnown().getOrNull()?.validity() ? : 0 ) +
556610 (if (connectionId.asKnown().isPresent) 1 else 0 ) +
557611 (connectionType.asKnown().getOrNull()?.validity() ? : 0 ) +
612+ (entityIds.asKnown().getOrNull()?.size ? : 0 ) +
558613 (products.asKnown().getOrNull()?.size ? : 0 ) +
559614 (if (providerId.asKnown().isPresent) 1 else 0 ) +
560615 (if (tokenType.asKnown().isPresent) 1 else 0 ) +
@@ -838,6 +893,7 @@ private constructor(
838893 clientType == other.clientType &&
839894 connectionId == other.connectionId &&
840895 connectionType == other.connectionType &&
896+ entityIds == other.entityIds &&
841897 products == other.products &&
842898 providerId == other.providerId &&
843899 tokenType == other.tokenType &&
@@ -853,6 +909,7 @@ private constructor(
853909 clientType,
854910 connectionId,
855911 connectionType,
912+ entityIds,
856913 products,
857914 providerId,
858915 tokenType,
@@ -866,5 +923,5 @@ private constructor(
866923 override fun hashCode (): Int = hashCode
867924
868925 override fun toString () =
869- " CreateAccessTokenResponse{accessToken=$accessToken , clientType=$clientType , connectionId=$connectionId , connectionType=$connectionType , products=$products , providerId=$providerId , tokenType=$tokenType , accountId=$accountId , companyId=$companyId , customerId=$customerId , additionalProperties=$additionalProperties }"
926+ " CreateAccessTokenResponse{accessToken=$accessToken , clientType=$clientType , connectionId=$connectionId , connectionType=$connectionType , entityIds= $entityIds , products=$products , providerId=$providerId , tokenType=$tokenType , accountId=$accountId , companyId=$companyId , customerId=$customerId , additionalProperties=$additionalProperties }"
870927}
0 commit comments