Skip to content

Commit 746ee7f

Browse files
feat(api): Add tags field to card transactions
1 parent 08c0ec5 commit 746ee7f

11 files changed

Lines changed: 367 additions & 6 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 176
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-11ebfaf7523a8c0eafca9e2c914e44102537634be4b22289fe85d46b9ab3d650.yml
3-
openapi_spec_hash: 38fdabb7812d528c839eadad87d49e5a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-1307147a7305d37c3eb288d87350e35d946c27e6b40dc8c6a00967d806dbade5.yml
3+
openapi_spec_hash: 21c48156c56569871d503df54e2e1442
44
config_hash: 31d71922d7838f34ae0875c9b8026d99

lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1732,6 +1732,7 @@ private constructor(
17321732
private val result: JsonField<Transaction.DeclineResult>,
17331733
private val settledAmount: JsonField<Long>,
17341734
private val status: JsonField<Transaction.Status>,
1735+
private val tags: JsonField<Transaction.Tags>,
17351736
private val tokenInfo: JsonField<TokenInfo>,
17361737
private val updated: JsonField<OffsetDateTime>,
17371738
private val events: JsonField<List<Transaction.TransactionEvent>>,
@@ -1802,6 +1803,9 @@ private constructor(
18021803
@JsonProperty("status")
18031804
@ExcludeMissing
18041805
status: JsonField<Transaction.Status> = JsonMissing.of(),
1806+
@JsonProperty("tags")
1807+
@ExcludeMissing
1808+
tags: JsonField<Transaction.Tags> = JsonMissing.of(),
18051809
@JsonProperty("token_info")
18061810
@ExcludeMissing
18071811
tokenInfo: JsonField<TokenInfo> = JsonMissing.of(),
@@ -1836,6 +1840,7 @@ private constructor(
18361840
result,
18371841
settledAmount,
18381842
status,
1843+
tags,
18391844
tokenInfo,
18401845
updated,
18411846
events,
@@ -1868,6 +1873,7 @@ private constructor(
18681873
.result(result)
18691874
.settledAmount(settledAmount)
18701875
.status(status)
1876+
.tags(tags)
18711877
.tokenInfo(tokenInfo)
18721878
.updated(updated)
18731879
.events(events)
@@ -2066,6 +2072,15 @@ private constructor(
20662072
*/
20672073
fun status(): Transaction.Status = status.getRequired("status")
20682074

2075+
/**
2076+
* Key-value pairs for tagging resources. Tags allow you to associate arbitrary metadata
2077+
* with a resource for your own purposes.
2078+
*
2079+
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
2080+
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
2081+
*/
2082+
fun tags(): Transaction.Tags = tags.getRequired("tags")
2083+
20692084
/**
20702085
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
20712086
* server responded with an unexpected value).
@@ -2308,6 +2323,13 @@ private constructor(
23082323
@ExcludeMissing
23092324
fun _status(): JsonField<Transaction.Status> = status
23102325

2326+
/**
2327+
* Returns the raw JSON value of [tags].
2328+
*
2329+
* Unlike [tags], this method doesn't throw if the JSON field has an unexpected type.
2330+
*/
2331+
@JsonProperty("tags") @ExcludeMissing fun _tags(): JsonField<Transaction.Tags> = tags
2332+
23112333
/**
23122334
* Returns the raw JSON value of [tokenInfo].
23132335
*
@@ -2382,6 +2404,7 @@ private constructor(
23822404
* .result()
23832405
* .settledAmount()
23842406
* .status()
2407+
* .tags()
23852408
* .tokenInfo()
23862409
* .updated()
23872410
* .family()
@@ -2416,6 +2439,7 @@ private constructor(
24162439
private var result: JsonField<Transaction.DeclineResult>? = null
24172440
private var settledAmount: JsonField<Long>? = null
24182441
private var status: JsonField<Transaction.Status>? = null
2442+
private var tags: JsonField<Transaction.Tags>? = null
24192443
private var tokenInfo: JsonField<TokenInfo>? = null
24202444
private var updated: JsonField<OffsetDateTime>? = null
24212445
private var events: JsonField<MutableList<Transaction.TransactionEvent>>? = null
@@ -2447,6 +2471,7 @@ private constructor(
24472471
result = cardTransaction.result
24482472
settledAmount = cardTransaction.settledAmount
24492473
status = cardTransaction.status
2474+
tags = cardTransaction.tags
24502475
tokenInfo = cardTransaction.tokenInfo
24512476
updated = cardTransaction.updated
24522477
events = cardTransaction.events.map { it.toMutableList() }
@@ -2902,6 +2927,21 @@ private constructor(
29022927
*/
29032928
fun status(status: JsonField<Transaction.Status>) = apply { this.status = status }
29042929

2930+
/**
2931+
* Key-value pairs for tagging resources. Tags allow you to associate arbitrary metadata
2932+
* with a resource for your own purposes.
2933+
*/
2934+
fun tags(tags: Transaction.Tags) = tags(JsonField.of(tags))
2935+
2936+
/**
2937+
* Sets [Builder.tags] to an arbitrary JSON value.
2938+
*
2939+
* You should usually call [Builder.tags] with a well-typed [Transaction.Tags] value
2940+
* instead. This method is primarily for setting the field to an undocumented or not yet
2941+
* supported value.
2942+
*/
2943+
fun tags(tags: JsonField<Transaction.Tags>) = apply { this.tags = tags }
2944+
29052945
fun tokenInfo(tokenInfo: TokenInfo?) = tokenInfo(JsonField.ofNullable(tokenInfo))
29062946

29072947
/** Alias for calling [Builder.tokenInfo] with `tokenInfo.orElse(null)`. */
@@ -3014,6 +3054,7 @@ private constructor(
30143054
* .result()
30153055
* .settledAmount()
30163056
* .status()
3057+
* .tags()
30173058
* .tokenInfo()
30183059
* .updated()
30193060
* .family()
@@ -3046,6 +3087,7 @@ private constructor(
30463087
checkRequired("result", result),
30473088
checkRequired("settledAmount", settledAmount),
30483089
checkRequired("status", status),
3090+
checkRequired("tags", tags),
30493091
checkRequired("tokenInfo", tokenInfo),
30503092
checkRequired("updated", updated),
30513093
(events ?: JsonMissing.of()).map { it.toImmutable() },
@@ -3084,6 +3126,7 @@ private constructor(
30843126
result().validate()
30853127
settledAmount()
30863128
status().validate()
3129+
tags().validate()
30873130
tokenInfo().ifPresent { it.validate() }
30883131
updated()
30893132
events().ifPresent { it.forEach { it.validate() } }
@@ -3130,6 +3173,7 @@ private constructor(
31303173
(result.asKnown().getOrNull()?.validity() ?: 0) +
31313174
(if (settledAmount.asKnown().isPresent) 1 else 0) +
31323175
(status.asKnown().getOrNull()?.validity() ?: 0) +
3176+
(tags.asKnown().getOrNull()?.validity() ?: 0) +
31333177
(tokenInfo.asKnown().getOrNull()?.validity() ?: 0) +
31343178
(if (updated.asKnown().isPresent) 1 else 0) +
31353179
(events.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
@@ -3446,6 +3490,7 @@ private constructor(
34463490
result == other.result &&
34473491
settledAmount == other.settledAmount &&
34483492
status == other.status &&
3493+
tags == other.tags &&
34493494
tokenInfo == other.tokenInfo &&
34503495
updated == other.updated &&
34513496
events == other.events &&
@@ -3478,6 +3523,7 @@ private constructor(
34783523
result,
34793524
settledAmount,
34803525
status,
3526+
tags,
34813527
tokenInfo,
34823528
updated,
34833529
events,
@@ -3489,6 +3535,6 @@ private constructor(
34893535
override fun hashCode(): Int = hashCode
34903536

34913537
override fun toString() =
3492-
"CardTransaction{token=$token, accountToken=$accountToken, acquirerFee=$acquirerFee, acquirerReferenceNumber=$acquirerReferenceNumber, amount=$amount, amounts=$amounts, authorizationAmount=$authorizationAmount, authorizationCode=$authorizationCode, avs=$avs, cardToken=$cardToken, cardholderAuthentication=$cardholderAuthentication, created=$created, financialAccountToken=$financialAccountToken, merchant=$merchant, merchantAmount=$merchantAmount, merchantAuthorizationAmount=$merchantAuthorizationAmount, merchantCurrency=$merchantCurrency, network=$network, networkRiskScore=$networkRiskScore, pos=$pos, result=$result, settledAmount=$settledAmount, status=$status, tokenInfo=$tokenInfo, updated=$updated, events=$events, family=$family, additionalProperties=$additionalProperties}"
3538+
"CardTransaction{token=$token, accountToken=$accountToken, acquirerFee=$acquirerFee, acquirerReferenceNumber=$acquirerReferenceNumber, amount=$amount, amounts=$amounts, authorizationAmount=$authorizationAmount, authorizationCode=$authorizationCode, avs=$avs, cardToken=$cardToken, cardholderAuthentication=$cardholderAuthentication, created=$created, financialAccountToken=$financialAccountToken, merchant=$merchant, merchantAmount=$merchantAmount, merchantAuthorizationAmount=$merchantAuthorizationAmount, merchantCurrency=$merchantCurrency, network=$network, networkRiskScore=$networkRiskScore, pos=$pos, result=$result, settledAmount=$settledAmount, status=$status, tags=$tags, tokenInfo=$tokenInfo, updated=$updated, events=$events, family=$family, additionalProperties=$additionalProperties}"
34933539
}
34943540
}

lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1754,6 +1754,7 @@ private constructor(
17541754
private val result: JsonField<Transaction.DeclineResult>,
17551755
private val settledAmount: JsonField<Long>,
17561756
private val status: JsonField<Transaction.Status>,
1757+
private val tags: JsonField<Transaction.Tags>,
17571758
private val tokenInfo: JsonField<TokenInfo>,
17581759
private val updated: JsonField<OffsetDateTime>,
17591760
private val events: JsonField<List<Transaction.TransactionEvent>>,
@@ -1824,6 +1825,9 @@ private constructor(
18241825
@JsonProperty("status")
18251826
@ExcludeMissing
18261827
status: JsonField<Transaction.Status> = JsonMissing.of(),
1828+
@JsonProperty("tags")
1829+
@ExcludeMissing
1830+
tags: JsonField<Transaction.Tags> = JsonMissing.of(),
18271831
@JsonProperty("token_info")
18281832
@ExcludeMissing
18291833
tokenInfo: JsonField<TokenInfo> = JsonMissing.of(),
@@ -1858,6 +1862,7 @@ private constructor(
18581862
result,
18591863
settledAmount,
18601864
status,
1865+
tags,
18611866
tokenInfo,
18621867
updated,
18631868
events,
@@ -1890,6 +1895,7 @@ private constructor(
18901895
.result(result)
18911896
.settledAmount(settledAmount)
18921897
.status(status)
1898+
.tags(tags)
18931899
.tokenInfo(tokenInfo)
18941900
.updated(updated)
18951901
.events(events)
@@ -2088,6 +2094,15 @@ private constructor(
20882094
*/
20892095
fun status(): Transaction.Status = status.getRequired("status")
20902096

2097+
/**
2098+
* Key-value pairs for tagging resources. Tags allow you to associate arbitrary metadata
2099+
* with a resource for your own purposes.
2100+
*
2101+
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
2102+
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
2103+
*/
2104+
fun tags(): Transaction.Tags = tags.getRequired("tags")
2105+
20912106
/**
20922107
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
20932108
* server responded with an unexpected value).
@@ -2330,6 +2345,13 @@ private constructor(
23302345
@ExcludeMissing
23312346
fun _status(): JsonField<Transaction.Status> = status
23322347

2348+
/**
2349+
* Returns the raw JSON value of [tags].
2350+
*
2351+
* Unlike [tags], this method doesn't throw if the JSON field has an unexpected type.
2352+
*/
2353+
@JsonProperty("tags") @ExcludeMissing fun _tags(): JsonField<Transaction.Tags> = tags
2354+
23332355
/**
23342356
* Returns the raw JSON value of [tokenInfo].
23352357
*
@@ -2404,6 +2426,7 @@ private constructor(
24042426
* .result()
24052427
* .settledAmount()
24062428
* .status()
2429+
* .tags()
24072430
* .tokenInfo()
24082431
* .updated()
24092432
* .family()
@@ -2438,6 +2461,7 @@ private constructor(
24382461
private var result: JsonField<Transaction.DeclineResult>? = null
24392462
private var settledAmount: JsonField<Long>? = null
24402463
private var status: JsonField<Transaction.Status>? = null
2464+
private var tags: JsonField<Transaction.Tags>? = null
24412465
private var tokenInfo: JsonField<TokenInfo>? = null
24422466
private var updated: JsonField<OffsetDateTime>? = null
24432467
private var events: JsonField<MutableList<Transaction.TransactionEvent>>? = null
@@ -2469,6 +2493,7 @@ private constructor(
24692493
result = cardTransaction.result
24702494
settledAmount = cardTransaction.settledAmount
24712495
status = cardTransaction.status
2496+
tags = cardTransaction.tags
24722497
tokenInfo = cardTransaction.tokenInfo
24732498
updated = cardTransaction.updated
24742499
events = cardTransaction.events.map { it.toMutableList() }
@@ -2924,6 +2949,21 @@ private constructor(
29242949
*/
29252950
fun status(status: JsonField<Transaction.Status>) = apply { this.status = status }
29262951

2952+
/**
2953+
* Key-value pairs for tagging resources. Tags allow you to associate arbitrary metadata
2954+
* with a resource for your own purposes.
2955+
*/
2956+
fun tags(tags: Transaction.Tags) = tags(JsonField.of(tags))
2957+
2958+
/**
2959+
* Sets [Builder.tags] to an arbitrary JSON value.
2960+
*
2961+
* You should usually call [Builder.tags] with a well-typed [Transaction.Tags] value
2962+
* instead. This method is primarily for setting the field to an undocumented or not yet
2963+
* supported value.
2964+
*/
2965+
fun tags(tags: JsonField<Transaction.Tags>) = apply { this.tags = tags }
2966+
29272967
fun tokenInfo(tokenInfo: TokenInfo?) = tokenInfo(JsonField.ofNullable(tokenInfo))
29282968

29292969
/** Alias for calling [Builder.tokenInfo] with `tokenInfo.orElse(null)`. */
@@ -3036,6 +3076,7 @@ private constructor(
30363076
* .result()
30373077
* .settledAmount()
30383078
* .status()
3079+
* .tags()
30393080
* .tokenInfo()
30403081
* .updated()
30413082
* .family()
@@ -3068,6 +3109,7 @@ private constructor(
30683109
checkRequired("result", result),
30693110
checkRequired("settledAmount", settledAmount),
30703111
checkRequired("status", status),
3112+
checkRequired("tags", tags),
30713113
checkRequired("tokenInfo", tokenInfo),
30723114
checkRequired("updated", updated),
30733115
(events ?: JsonMissing.of()).map { it.toImmutable() },
@@ -3106,6 +3148,7 @@ private constructor(
31063148
result().validate()
31073149
settledAmount()
31083150
status().validate()
3151+
tags().validate()
31093152
tokenInfo().ifPresent { it.validate() }
31103153
updated()
31113154
events().ifPresent { it.forEach { it.validate() } }
@@ -3152,6 +3195,7 @@ private constructor(
31523195
(result.asKnown().getOrNull()?.validity() ?: 0) +
31533196
(if (settledAmount.asKnown().isPresent) 1 else 0) +
31543197
(status.asKnown().getOrNull()?.validity() ?: 0) +
3198+
(tags.asKnown().getOrNull()?.validity() ?: 0) +
31553199
(tokenInfo.asKnown().getOrNull()?.validity() ?: 0) +
31563200
(if (updated.asKnown().isPresent) 1 else 0) +
31573201
(events.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
@@ -3468,6 +3512,7 @@ private constructor(
34683512
result == other.result &&
34693513
settledAmount == other.settledAmount &&
34703514
status == other.status &&
3515+
tags == other.tags &&
34713516
tokenInfo == other.tokenInfo &&
34723517
updated == other.updated &&
34733518
events == other.events &&
@@ -3500,6 +3545,7 @@ private constructor(
35003545
result,
35013546
settledAmount,
35023547
status,
3548+
tags,
35033549
tokenInfo,
35043550
updated,
35053551
events,
@@ -3511,6 +3557,6 @@ private constructor(
35113557
override fun hashCode(): Int = hashCode
35123558

35133559
override fun toString() =
3514-
"CardTransaction{token=$token, accountToken=$accountToken, acquirerFee=$acquirerFee, acquirerReferenceNumber=$acquirerReferenceNumber, amount=$amount, amounts=$amounts, authorizationAmount=$authorizationAmount, authorizationCode=$authorizationCode, avs=$avs, cardToken=$cardToken, cardholderAuthentication=$cardholderAuthentication, created=$created, financialAccountToken=$financialAccountToken, merchant=$merchant, merchantAmount=$merchantAmount, merchantAuthorizationAmount=$merchantAuthorizationAmount, merchantCurrency=$merchantCurrency, network=$network, networkRiskScore=$networkRiskScore, pos=$pos, result=$result, settledAmount=$settledAmount, status=$status, tokenInfo=$tokenInfo, updated=$updated, events=$events, family=$family, additionalProperties=$additionalProperties}"
3560+
"CardTransaction{token=$token, accountToken=$accountToken, acquirerFee=$acquirerFee, acquirerReferenceNumber=$acquirerReferenceNumber, amount=$amount, amounts=$amounts, authorizationAmount=$authorizationAmount, authorizationCode=$authorizationCode, avs=$avs, cardToken=$cardToken, cardholderAuthentication=$cardholderAuthentication, created=$created, financialAccountToken=$financialAccountToken, merchant=$merchant, merchantAmount=$merchantAmount, merchantAuthorizationAmount=$merchantAuthorizationAmount, merchantCurrency=$merchantCurrency, network=$network, networkRiskScore=$networkRiskScore, pos=$pos, result=$result, settledAmount=$settledAmount, status=$status, tags=$tags, tokenInfo=$tokenInfo, updated=$updated, events=$events, family=$family, additionalProperties=$additionalProperties}"
35153561
}
35163562
}

0 commit comments

Comments
 (0)