Skip to content

Commit 47fccba

Browse files
fix(api): naming for sync_payment_methods methods (#389)
fix naming for sync_payment_methods methods (by customer_id and by external_customer_id were swapped)
1 parent 1090267 commit 47fccba

11 files changed

Lines changed: 54 additions & 57 deletions

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 103
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-95a3d7780935a38e0cf076d4ad2d68bd1a5641bced8398d972db2e92751d364a.yml
33
openapi_spec_hash: 9ebe818c4ad4f2d9c4e473b5192d7544
4-
config_hash: 3dc5bc1df028fc7301fb2ada9846f038
4+
config_hash: 54edf41f0377bc235f622fdaa7405f22

orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams.kt

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ import java.util.Optional
2121
*/
2222
class CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams
2323
private constructor(
24-
private val customerId: String,
24+
private val externalCustomerId: String,
2525
private val additionalHeaders: Headers,
2626
private val additionalQueryParams: QueryParams,
2727
private val additionalBodyProperties: Map<String, JsonValue>,
2828
) : Params {
2929

30-
fun customerId(): String = customerId
30+
fun externalCustomerId(): String = externalCustomerId
3131

3232
fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties
3333

@@ -45,7 +45,7 @@ private constructor(
4545
*
4646
* The following fields are required:
4747
* ```java
48-
* .customerId()
48+
* .externalCustomerId()
4949
* ```
5050
*/
5151
@JvmStatic fun builder() = Builder()
@@ -54,7 +54,7 @@ private constructor(
5454
/** A builder for [CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams]. */
5555
class Builder internal constructor() {
5656

57-
private var customerId: String? = null
57+
private var externalCustomerId: String? = null
5858
private var additionalHeaders: Headers.Builder = Headers.builder()
5959
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
6060
private var additionalBodyProperties: MutableMap<String, JsonValue> = mutableMapOf()
@@ -64,7 +64,8 @@ private constructor(
6464
customerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams:
6565
CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams
6666
) = apply {
67-
customerId = customerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams.customerId
67+
externalCustomerId =
68+
customerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams.externalCustomerId
6869
additionalHeaders =
6970
customerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams.additionalHeaders
7071
.toBuilder()
@@ -78,7 +79,9 @@ private constructor(
7879
.toMutableMap()
7980
}
8081

81-
fun customerId(customerId: String) = apply { this.customerId = customerId }
82+
fun externalCustomerId(externalCustomerId: String) = apply {
83+
this.externalCustomerId = externalCustomerId
84+
}
8285

8386
fun additionalHeaders(additionalHeaders: Headers) = apply {
8487
this.additionalHeaders.clear()
@@ -208,14 +211,14 @@ private constructor(
208211
*
209212
* The following fields are required:
210213
* ```java
211-
* .customerId()
214+
* .externalCustomerId()
212215
* ```
213216
*
214217
* @throws IllegalStateException if any required field is unset.
215218
*/
216219
fun build(): CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams =
217220
CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams(
218-
checkRequired("customerId", customerId),
221+
checkRequired("externalCustomerId", externalCustomerId),
219222
additionalHeaders.build(),
220223
additionalQueryParams.build(),
221224
additionalBodyProperties.toImmutable(),
@@ -227,7 +230,7 @@ private constructor(
227230

228231
fun _pathParam(index: Int): String =
229232
when (index) {
230-
0 -> customerId
233+
0 -> externalCustomerId
231234
else -> ""
232235
}
233236

@@ -240,11 +243,11 @@ private constructor(
240243
return true
241244
}
242245

243-
return /* spotless:off */ other is CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams && customerId == other.customerId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
246+
return /* spotless:off */ other is CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams && externalCustomerId == other.externalCustomerId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
244247
}
245248

246-
override fun hashCode(): Int = /* spotless:off */ Objects.hash(customerId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
249+
override fun hashCode(): Int = /* spotless:off */ Objects.hash(externalCustomerId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
247250

248251
override fun toString() =
249-
"CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams{customerId=$customerId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
252+
"CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams{externalCustomerId=$externalCustomerId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
250253
}

orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerSyncPaymentMethodsFromGatewayParams.kt

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ import java.util.Optional
2121
*/
2222
class CustomerSyncPaymentMethodsFromGatewayParams
2323
private constructor(
24-
private val externalCustomerId: String,
24+
private val customerId: String,
2525
private val additionalHeaders: Headers,
2626
private val additionalQueryParams: QueryParams,
2727
private val additionalBodyProperties: Map<String, JsonValue>,
2828
) : Params {
2929

30-
fun externalCustomerId(): String = externalCustomerId
30+
fun customerId(): String = customerId
3131

3232
fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties
3333

@@ -45,7 +45,7 @@ private constructor(
4545
*
4646
* The following fields are required:
4747
* ```java
48-
* .externalCustomerId()
48+
* .customerId()
4949
* ```
5050
*/
5151
@JvmStatic fun builder() = Builder()
@@ -54,7 +54,7 @@ private constructor(
5454
/** A builder for [CustomerSyncPaymentMethodsFromGatewayParams]. */
5555
class Builder internal constructor() {
5656

57-
private var externalCustomerId: String? = null
57+
private var customerId: String? = null
5858
private var additionalHeaders: Headers.Builder = Headers.builder()
5959
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
6060
private var additionalBodyProperties: MutableMap<String, JsonValue> = mutableMapOf()
@@ -63,7 +63,7 @@ private constructor(
6363
internal fun from(
6464
customerSyncPaymentMethodsFromGatewayParams: CustomerSyncPaymentMethodsFromGatewayParams
6565
) = apply {
66-
externalCustomerId = customerSyncPaymentMethodsFromGatewayParams.externalCustomerId
66+
customerId = customerSyncPaymentMethodsFromGatewayParams.customerId
6767
additionalHeaders =
6868
customerSyncPaymentMethodsFromGatewayParams.additionalHeaders.toBuilder()
6969
additionalQueryParams =
@@ -72,9 +72,7 @@ private constructor(
7272
customerSyncPaymentMethodsFromGatewayParams.additionalBodyProperties.toMutableMap()
7373
}
7474

75-
fun externalCustomerId(externalCustomerId: String) = apply {
76-
this.externalCustomerId = externalCustomerId
77-
}
75+
fun customerId(customerId: String) = apply { this.customerId = customerId }
7876

7977
fun additionalHeaders(additionalHeaders: Headers) = apply {
8078
this.additionalHeaders.clear()
@@ -203,14 +201,14 @@ private constructor(
203201
*
204202
* The following fields are required:
205203
* ```java
206-
* .externalCustomerId()
204+
* .customerId()
207205
* ```
208206
*
209207
* @throws IllegalStateException if any required field is unset.
210208
*/
211209
fun build(): CustomerSyncPaymentMethodsFromGatewayParams =
212210
CustomerSyncPaymentMethodsFromGatewayParams(
213-
checkRequired("externalCustomerId", externalCustomerId),
211+
checkRequired("customerId", customerId),
214212
additionalHeaders.build(),
215213
additionalQueryParams.build(),
216214
additionalBodyProperties.toImmutable(),
@@ -222,7 +220,7 @@ private constructor(
222220

223221
fun _pathParam(index: Int): String =
224222
when (index) {
225-
0 -> externalCustomerId
223+
0 -> customerId
226224
else -> ""
227225
}
228226

@@ -235,11 +233,11 @@ private constructor(
235233
return true
236234
}
237235

238-
return /* spotless:off */ other is CustomerSyncPaymentMethodsFromGatewayParams && externalCustomerId == other.externalCustomerId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
236+
return /* spotless:off */ other is CustomerSyncPaymentMethodsFromGatewayParams && customerId == other.customerId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
239237
}
240238

241-
override fun hashCode(): Int = /* spotless:off */ Objects.hash(externalCustomerId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
239+
override fun hashCode(): Int = /* spotless:off */ Objects.hash(customerId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
242240

243241
override fun toString() =
244-
"CustomerSyncPaymentMethodsFromGatewayParams{externalCustomerId=$externalCustomerId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
242+
"CustomerSyncPaymentMethodsFromGatewayParams{customerId=$customerId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
245243
}

orb-java-core/src/main/kotlin/com/withorb/api/services/async/CustomerServiceAsync.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,8 @@ interface CustomerServiceAsync {
323323

324324
/**
325325
* Returns a raw HTTP response for `post
326-
* /customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway`,
327-
* but is otherwise the same as [CustomerServiceAsync.syncPaymentMethodsFromGateway].
326+
* /customers/{customer_id}/sync_payment_methods_from_gateway`, but is otherwise the same as
327+
* [CustomerServiceAsync.syncPaymentMethodsFromGateway].
328328
*/
329329
@MustBeClosed
330330
fun syncPaymentMethodsFromGateway(
@@ -341,7 +341,8 @@ interface CustomerServiceAsync {
341341

342342
/**
343343
* Returns a raw HTTP response for `post
344-
* /customers/{customer_id}/sync_payment_methods_from_gateway`, but is otherwise the same as
344+
* /customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway`,
345+
* but is otherwise the same as
345346
* [CustomerServiceAsync.syncPaymentMethodsFromGatewayByExternalCustomerId].
346347
*/
347348
@MustBeClosed

orb-java-core/src/main/kotlin/com/withorb/api/services/async/CustomerServiceAsyncImpl.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,15 @@ class CustomerServiceAsyncImpl internal constructor(private val clientOptions: C
105105
params: CustomerSyncPaymentMethodsFromGatewayParams,
106106
requestOptions: RequestOptions,
107107
): CompletableFuture<Void?> =
108-
// post
109-
// /customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway
108+
// post /customers/{customer_id}/sync_payment_methods_from_gateway
110109
withRawResponse().syncPaymentMethodsFromGateway(params, requestOptions).thenAccept {}
111110

112111
override fun syncPaymentMethodsFromGatewayByExternalCustomerId(
113112
params: CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams,
114113
requestOptions: RequestOptions,
115114
): CompletableFuture<Void?> =
116-
// post /customers/{customer_id}/sync_payment_methods_from_gateway
115+
// post
116+
// /customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway
117117
withRawResponse()
118118
.syncPaymentMethodsFromGatewayByExternalCustomerId(params, requestOptions)
119119
.thenAccept {}
@@ -337,7 +337,6 @@ class CustomerServiceAsyncImpl internal constructor(private val clientOptions: C
337337
.method(HttpMethod.POST)
338338
.addPathSegments(
339339
"customers",
340-
"external_customer_id",
341340
params._pathParam(0),
342341
"sync_payment_methods_from_gateway",
343342
)
@@ -366,6 +365,7 @@ class CustomerServiceAsyncImpl internal constructor(private val clientOptions: C
366365
.method(HttpMethod.POST)
367366
.addPathSegments(
368367
"customers",
368+
"external_customer_id",
369369
params._pathParam(0),
370370
"sync_payment_methods_from_gateway",
371371
)

orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CustomerService.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ interface CustomerService {
304304

305305
/**
306306
* Returns a raw HTTP response for `post
307-
* /customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway`,
308-
* but is otherwise the same as [CustomerService.syncPaymentMethodsFromGateway].
307+
* /customers/{customer_id}/sync_payment_methods_from_gateway`, but is otherwise the same as
308+
* [CustomerService.syncPaymentMethodsFromGateway].
309309
*/
310310
@MustBeClosed
311311
fun syncPaymentMethodsFromGateway(
@@ -321,7 +321,8 @@ interface CustomerService {
321321

322322
/**
323323
* Returns a raw HTTP response for `post
324-
* /customers/{customer_id}/sync_payment_methods_from_gateway`, but is otherwise the same as
324+
* /customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway`,
325+
* but is otherwise the same as
325326
* [CustomerService.syncPaymentMethodsFromGatewayByExternalCustomerId].
326327
*/
327328
@MustBeClosed

orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CustomerServiceImpl.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,16 @@ class CustomerServiceImpl internal constructor(private val clientOptions: Client
9393
params: CustomerSyncPaymentMethodsFromGatewayParams,
9494
requestOptions: RequestOptions,
9595
) {
96-
// post
97-
// /customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway
96+
// post /customers/{customer_id}/sync_payment_methods_from_gateway
9897
withRawResponse().syncPaymentMethodsFromGateway(params, requestOptions)
9998
}
10099

101100
override fun syncPaymentMethodsFromGatewayByExternalCustomerId(
102101
params: CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams,
103102
requestOptions: RequestOptions,
104103
) {
105-
// post /customers/{customer_id}/sync_payment_methods_from_gateway
104+
// post
105+
// /customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway
106106
withRawResponse().syncPaymentMethodsFromGatewayByExternalCustomerId(params, requestOptions)
107107
}
108108

@@ -301,7 +301,6 @@ class CustomerServiceImpl internal constructor(private val clientOptions: Client
301301
.method(HttpMethod.POST)
302302
.addPathSegments(
303303
"customers",
304-
"external_customer_id",
305304
params._pathParam(0),
306305
"sync_payment_methods_from_gateway",
307306
)
@@ -327,6 +326,7 @@ class CustomerServiceImpl internal constructor(private val clientOptions: Client
327326
.method(HttpMethod.POST)
328327
.addPathSegments(
329328
"customers",
329+
"external_customer_id",
330330
params._pathParam(0),
331331
"sync_payment_methods_from_gateway",
332332
)

orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParamsTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ internal class CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParamsTe
1010
@Test
1111
fun create() {
1212
CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams.builder()
13-
.customerId("customer_id")
13+
.externalCustomerId("external_customer_id")
1414
.build()
1515
}
1616

1717
@Test
1818
fun pathParams() {
1919
val params =
2020
CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams.builder()
21-
.customerId("customer_id")
21+
.externalCustomerId("external_customer_id")
2222
.build()
2323

24-
assertThat(params._pathParam(0)).isEqualTo("customer_id")
24+
assertThat(params._pathParam(0)).isEqualTo("external_customer_id")
2525
// out-of-bound path param
2626
assertThat(params._pathParam(1)).isEqualTo("")
2727
}

orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerSyncPaymentMethodsFromGatewayParamsTest.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,15 @@ internal class CustomerSyncPaymentMethodsFromGatewayParamsTest {
99

1010
@Test
1111
fun create() {
12-
CustomerSyncPaymentMethodsFromGatewayParams.builder()
13-
.externalCustomerId("external_customer_id")
14-
.build()
12+
CustomerSyncPaymentMethodsFromGatewayParams.builder().customerId("customer_id").build()
1513
}
1614

1715
@Test
1816
fun pathParams() {
1917
val params =
20-
CustomerSyncPaymentMethodsFromGatewayParams.builder()
21-
.externalCustomerId("external_customer_id")
22-
.build()
18+
CustomerSyncPaymentMethodsFromGatewayParams.builder().customerId("customer_id").build()
2319

24-
assertThat(params._pathParam(0)).isEqualTo("external_customer_id")
20+
assertThat(params._pathParam(0)).isEqualTo("customer_id")
2521
// out-of-bound path param
2622
assertThat(params._pathParam(1)).isEqualTo("")
2723
}

orb-java-core/src/test/kotlin/com/withorb/api/services/async/CustomerServiceAsyncTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ internal class CustomerServiceAsyncTest {
287287
val future =
288288
customerServiceAsync.syncPaymentMethodsFromGateway(
289289
CustomerSyncPaymentMethodsFromGatewayParams.builder()
290-
.externalCustomerId("external_customer_id")
290+
.customerId("customer_id")
291291
.build()
292292
)
293293

@@ -306,7 +306,7 @@ internal class CustomerServiceAsyncTest {
306306
val future =
307307
customerServiceAsync.syncPaymentMethodsFromGatewayByExternalCustomerId(
308308
CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams.builder()
309-
.customerId("customer_id")
309+
.externalCustomerId("external_customer_id")
310310
.build()
311311
)
312312

0 commit comments

Comments
 (0)