Skip to content

Commit 899a3be

Browse files
feat(api): add override_company_name parameter to payment create
1 parent eae0df0 commit 899a3be

File tree

5 files changed

+66
-6
lines changed

5 files changed

+66
-6
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: 190
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-17c04dd1b0508b380c21e3acc3d4cd1e86b590f81d14fa26d1973b236f660e38.yml
3-
openapi_spec_hash: f8ddee07358d2c938450a6889fbf7940
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-7349acbc90f2ba5668e44039a8e16c678944a2e83281f78e54812ba45904f49a.yml
3+
openapi_spec_hash: d749723cb9a5dca308c467a01cfdc3e9
44
config_hash: edbdfefeb0d3d927c2f9fe3402793215

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

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,7 @@ private constructor(
11521152
private val secCode: JsonField<SecCode>,
11531153
private val achHoldPeriod: JsonField<Long>,
11541154
private val addenda: JsonField<String>,
1155+
private val overrideCompanyName: JsonField<String>,
11551156
private val additionalProperties: MutableMap<String, JsonValue>,
11561157
) {
11571158

@@ -1164,7 +1165,10 @@ private constructor(
11641165
@ExcludeMissing
11651166
achHoldPeriod: JsonField<Long> = JsonMissing.of(),
11661167
@JsonProperty("addenda") @ExcludeMissing addenda: JsonField<String> = JsonMissing.of(),
1167-
) : this(secCode, achHoldPeriod, addenda, mutableMapOf())
1168+
@JsonProperty("override_company_name")
1169+
@ExcludeMissing
1170+
overrideCompanyName: JsonField<String> = JsonMissing.of(),
1171+
) : this(secCode, achHoldPeriod, addenda, overrideCompanyName, mutableMapOf())
11681172

11691173
/**
11701174
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
@@ -1186,6 +1190,16 @@ private constructor(
11861190
*/
11871191
fun addenda(): Optional<String> = addenda.getOptional("addenda")
11881192

1193+
/**
1194+
* Value to override the configured company name with. Can only be used if allowed to
1195+
* override
1196+
*
1197+
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
1198+
* server responded with an unexpected value).
1199+
*/
1200+
fun overrideCompanyName(): Optional<String> =
1201+
overrideCompanyName.getOptional("override_company_name")
1202+
11891203
/**
11901204
* Returns the raw JSON value of [secCode].
11911205
*
@@ -1210,6 +1224,16 @@ private constructor(
12101224
*/
12111225
@JsonProperty("addenda") @ExcludeMissing fun _addenda(): JsonField<String> = addenda
12121226

1227+
/**
1228+
* Returns the raw JSON value of [overrideCompanyName].
1229+
*
1230+
* Unlike [overrideCompanyName], this method doesn't throw if the JSON field has an
1231+
* unexpected type.
1232+
*/
1233+
@JsonProperty("override_company_name")
1234+
@ExcludeMissing
1235+
fun _overrideCompanyName(): JsonField<String> = overrideCompanyName
1236+
12131237
@JsonAnySetter
12141238
private fun putAdditionalProperty(key: String, value: JsonValue) {
12151239
additionalProperties.put(key, value)
@@ -1242,6 +1266,7 @@ private constructor(
12421266
private var secCode: JsonField<SecCode>? = null
12431267
private var achHoldPeriod: JsonField<Long> = JsonMissing.of()
12441268
private var addenda: JsonField<String> = JsonMissing.of()
1269+
private var overrideCompanyName: JsonField<String> = JsonMissing.of()
12451270
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
12461271

12471272
@JvmSynthetic
@@ -1250,6 +1275,7 @@ private constructor(
12501275
secCode = paymentMethodRequestAttributes.secCode
12511276
achHoldPeriod = paymentMethodRequestAttributes.achHoldPeriod
12521277
addenda = paymentMethodRequestAttributes.addenda
1278+
overrideCompanyName = paymentMethodRequestAttributes.overrideCompanyName
12531279
additionalProperties =
12541280
paymentMethodRequestAttributes.additionalProperties.toMutableMap()
12551281
}
@@ -1293,6 +1319,31 @@ private constructor(
12931319
*/
12941320
fun addenda(addenda: JsonField<String>) = apply { this.addenda = addenda }
12951321

1322+
/**
1323+
* Value to override the configured company name with. Can only be used if allowed to
1324+
* override
1325+
*/
1326+
fun overrideCompanyName(overrideCompanyName: String?) =
1327+
overrideCompanyName(JsonField.ofNullable(overrideCompanyName))
1328+
1329+
/**
1330+
* Alias for calling [Builder.overrideCompanyName] with
1331+
* `overrideCompanyName.orElse(null)`.
1332+
*/
1333+
fun overrideCompanyName(overrideCompanyName: Optional<String>) =
1334+
overrideCompanyName(overrideCompanyName.getOrNull())
1335+
1336+
/**
1337+
* Sets [Builder.overrideCompanyName] to an arbitrary JSON value.
1338+
*
1339+
* You should usually call [Builder.overrideCompanyName] with a well-typed [String]
1340+
* value instead. This method is primarily for setting the field to an undocumented or
1341+
* not yet supported value.
1342+
*/
1343+
fun overrideCompanyName(overrideCompanyName: JsonField<String>) = apply {
1344+
this.overrideCompanyName = overrideCompanyName
1345+
}
1346+
12961347
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
12971348
this.additionalProperties.clear()
12981349
putAllAdditionalProperties(additionalProperties)
@@ -1329,6 +1380,7 @@ private constructor(
13291380
checkRequired("secCode", secCode),
13301381
achHoldPeriod,
13311382
addenda,
1383+
overrideCompanyName,
13321384
additionalProperties.toMutableMap(),
13331385
)
13341386
}
@@ -1343,6 +1395,7 @@ private constructor(
13431395
secCode().validate()
13441396
achHoldPeriod()
13451397
addenda()
1398+
overrideCompanyName()
13461399
validated = true
13471400
}
13481401

@@ -1364,7 +1417,8 @@ private constructor(
13641417
internal fun validity(): Int =
13651418
(secCode.asKnown().getOrNull()?.validity() ?: 0) +
13661419
(if (achHoldPeriod.asKnown().isPresent) 1 else 0) +
1367-
(if (addenda.asKnown().isPresent) 1 else 0)
1420+
(if (addenda.asKnown().isPresent) 1 else 0) +
1421+
(if (overrideCompanyName.asKnown().isPresent) 1 else 0)
13681422

13691423
class SecCode @JsonCreator private constructor(private val value: JsonField<String>) :
13701424
Enum {
@@ -1511,17 +1565,18 @@ private constructor(
15111565
secCode == other.secCode &&
15121566
achHoldPeriod == other.achHoldPeriod &&
15131567
addenda == other.addenda &&
1568+
overrideCompanyName == other.overrideCompanyName &&
15141569
additionalProperties == other.additionalProperties
15151570
}
15161571

15171572
private val hashCode: Int by lazy {
1518-
Objects.hash(secCode, achHoldPeriod, addenda, additionalProperties)
1573+
Objects.hash(secCode, achHoldPeriod, addenda, overrideCompanyName, additionalProperties)
15191574
}
15201575

15211576
override fun hashCode(): Int = hashCode
15221577

15231578
override fun toString() =
1524-
"PaymentMethodRequestAttributes{secCode=$secCode, achHoldPeriod=$achHoldPeriod, addenda=$addenda, additionalProperties=$additionalProperties}"
1579+
"PaymentMethodRequestAttributes{secCode=$secCode, achHoldPeriod=$achHoldPeriod, addenda=$addenda, overrideCompanyName=$overrideCompanyName, additionalProperties=$additionalProperties}"
15251580
}
15261581

15271582
class Type @JsonCreator private constructor(private val value: JsonField<String>) : Enum {

lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateParamsTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ internal class PaymentCreateParamsTest {
1919
.secCode(PaymentCreateParams.PaymentMethodRequestAttributes.SecCode.CCD)
2020
.achHoldPeriod(0L)
2121
.addenda("addenda")
22+
.overrideCompanyName("override_company_name")
2223
.build()
2324
)
2425
.type(PaymentCreateParams.Type.COLLECTION)
@@ -46,6 +47,7 @@ internal class PaymentCreateParamsTest {
4647
.secCode(PaymentCreateParams.PaymentMethodRequestAttributes.SecCode.CCD)
4748
.achHoldPeriod(0L)
4849
.addenda("addenda")
50+
.overrideCompanyName("override_company_name")
4951
.build()
5052
)
5153
.type(PaymentCreateParams.Type.COLLECTION)
@@ -72,6 +74,7 @@ internal class PaymentCreateParamsTest {
7274
.secCode(PaymentCreateParams.PaymentMethodRequestAttributes.SecCode.CCD)
7375
.achHoldPeriod(0L)
7476
.addenda("addenda")
77+
.overrideCompanyName("override_company_name")
7578
.build()
7679
)
7780
assertThat(body.type()).isEqualTo(PaymentCreateParams.Type.COLLECTION)

lithic-java-core/src/test/kotlin/com/lithic/api/services/async/PaymentServiceAsyncTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ internal class PaymentServiceAsyncTest {
3838
.secCode(PaymentCreateParams.PaymentMethodRequestAttributes.SecCode.CCD)
3939
.achHoldPeriod(0L)
4040
.addenda("addenda")
41+
.overrideCompanyName("override_company_name")
4142
.build()
4243
)
4344
.type(PaymentCreateParams.Type.COLLECTION)

lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/PaymentServiceTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ internal class PaymentServiceTest {
3838
.secCode(PaymentCreateParams.PaymentMethodRequestAttributes.SecCode.CCD)
3939
.achHoldPeriod(0L)
4040
.addenda("addenda")
41+
.overrideCompanyName("override_company_name")
4142
.build()
4243
)
4344
.type(PaymentCreateParams.Type.COLLECTION)

0 commit comments

Comments
 (0)