Skip to content

Commit 6aa1d53

Browse files
feat(api): api update
1 parent b3c5ffa commit 6aa1d53

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
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: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-ab79d1df8310a4fc3089fcf814f9fb00c7341acc254aafe34479af0f871d244b.yml
3-
openapi_spec_hash: 9416d6718ca4eeb3c20790187348b5b0
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-b6ec9a6bf40b74575d917ab145b2413bc61dcd6989bb9d1aa41624bf3437599e.yml
3+
openapi_spec_hash: 53cf9363c3bd9649e0af5f713abdcba7
44
config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2

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

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ private constructor(
3535
private val cursor: String?,
3636
private val customerId: List<String>?,
3737
private val externalCustomerId: List<String>?,
38+
private val externalPlanId: String?,
3839
private val limit: Long?,
40+
private val planId: String?,
3941
private val status: Status?,
4042
private val additionalHeaders: Headers,
4143
private val additionalQueryParams: QueryParams,
@@ -59,9 +61,13 @@ private constructor(
5961

6062
fun externalCustomerId(): Optional<List<String>> = Optional.ofNullable(externalCustomerId)
6163

64+
fun externalPlanId(): Optional<String> = Optional.ofNullable(externalPlanId)
65+
6266
/** The number of items to fetch. Defaults to 20. */
6367
fun limit(): Optional<Long> = Optional.ofNullable(limit)
6468

69+
fun planId(): Optional<String> = Optional.ofNullable(planId)
70+
6571
fun status(): Optional<Status> = Optional.ofNullable(status)
6672

6773
/** Additional headers to send with the request. */
@@ -90,7 +96,9 @@ private constructor(
9096
private var cursor: String? = null
9197
private var customerId: MutableList<String>? = null
9298
private var externalCustomerId: MutableList<String>? = null
99+
private var externalPlanId: String? = null
93100
private var limit: Long? = null
101+
private var planId: String? = null
94102
private var status: Status? = null
95103
private var additionalHeaders: Headers.Builder = Headers.builder()
96104
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
@@ -104,7 +112,9 @@ private constructor(
104112
cursor = subscriptionListParams.cursor
105113
customerId = subscriptionListParams.customerId?.toMutableList()
106114
externalCustomerId = subscriptionListParams.externalCustomerId?.toMutableList()
115+
externalPlanId = subscriptionListParams.externalPlanId
107116
limit = subscriptionListParams.limit
117+
planId = subscriptionListParams.planId
108118
status = subscriptionListParams.status
109119
additionalHeaders = subscriptionListParams.additionalHeaders.toBuilder()
110120
additionalQueryParams = subscriptionListParams.additionalQueryParams.toBuilder()
@@ -179,6 +189,12 @@ private constructor(
179189
(this.externalCustomerId ?: mutableListOf()).apply { add(externalCustomerId) }
180190
}
181191

192+
fun externalPlanId(externalPlanId: String?) = apply { this.externalPlanId = externalPlanId }
193+
194+
/** Alias for calling [Builder.externalPlanId] with `externalPlanId.orElse(null)`. */
195+
fun externalPlanId(externalPlanId: Optional<String>) =
196+
externalPlanId(externalPlanId.getOrNull())
197+
182198
/** The number of items to fetch. Defaults to 20. */
183199
fun limit(limit: Long?) = apply { this.limit = limit }
184200

@@ -192,6 +208,11 @@ private constructor(
192208
/** Alias for calling [Builder.limit] with `limit.orElse(null)`. */
193209
fun limit(limit: Optional<Long>) = limit(limit.getOrNull())
194210

211+
fun planId(planId: String?) = apply { this.planId = planId }
212+
213+
/** Alias for calling [Builder.planId] with `planId.orElse(null)`. */
214+
fun planId(planId: Optional<String>) = planId(planId.getOrNull())
215+
195216
fun status(status: Status?) = apply { this.status = status }
196217

197218
/** Alias for calling [Builder.status] with `status.orElse(null)`. */
@@ -309,7 +330,9 @@ private constructor(
309330
cursor,
310331
customerId?.toImmutable(),
311332
externalCustomerId?.toImmutable(),
333+
externalPlanId,
312334
limit,
335+
planId,
313336
status,
314337
additionalHeaders.build(),
315338
additionalQueryParams.build(),
@@ -336,7 +359,9 @@ private constructor(
336359
cursor?.let { put("cursor", it) }
337360
customerId?.forEach { put("customer_id[]", it) }
338361
externalCustomerId?.forEach { put("external_customer_id[]", it) }
362+
externalPlanId?.let { put("external_plan_id", it) }
339363
limit?.let { put("limit", it.toString()) }
364+
planId?.let { put("plan_id", it) }
340365
status?.let { put("status", it.toString()) }
341366
putAll(additionalQueryParams)
342367
}
@@ -485,7 +510,9 @@ private constructor(
485510
cursor == other.cursor &&
486511
customerId == other.customerId &&
487512
externalCustomerId == other.externalCustomerId &&
513+
externalPlanId == other.externalPlanId &&
488514
limit == other.limit &&
515+
planId == other.planId &&
489516
status == other.status &&
490517
additionalHeaders == other.additionalHeaders &&
491518
additionalQueryParams == other.additionalQueryParams
@@ -500,12 +527,14 @@ private constructor(
500527
cursor,
501528
customerId,
502529
externalCustomerId,
530+
externalPlanId,
503531
limit,
532+
planId,
504533
status,
505534
additionalHeaders,
506535
additionalQueryParams,
507536
)
508537

509538
override fun toString() =
510-
"SubscriptionListParams{createdAtGt=$createdAtGt, createdAtGte=$createdAtGte, createdAtLt=$createdAtLt, createdAtLte=$createdAtLte, cursor=$cursor, customerId=$customerId, externalCustomerId=$externalCustomerId, limit=$limit, status=$status, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
539+
"SubscriptionListParams{createdAtGt=$createdAtGt, createdAtGte=$createdAtGte, createdAtLt=$createdAtLt, createdAtLte=$createdAtLte, cursor=$cursor, customerId=$customerId, externalCustomerId=$externalCustomerId, externalPlanId=$externalPlanId, limit=$limit, planId=$planId, status=$status, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
511540
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ internal class SubscriptionListParamsTest {
1919
.cursor("cursor")
2020
.addCustomerId("string")
2121
.addExternalCustomerId("string")
22+
.externalPlanId("external_plan_id")
2223
.limit(1L)
24+
.planId("plan_id")
2325
.status(SubscriptionListParams.Status.ACTIVE)
2426
.build()
2527
}
@@ -35,7 +37,9 @@ internal class SubscriptionListParamsTest {
3537
.cursor("cursor")
3638
.addCustomerId("string")
3739
.addExternalCustomerId("string")
40+
.externalPlanId("external_plan_id")
3841
.limit(1L)
42+
.planId("plan_id")
3943
.status(SubscriptionListParams.Status.ACTIVE)
4044
.build()
4145

@@ -51,7 +55,9 @@ internal class SubscriptionListParamsTest {
5155
.put("cursor", "cursor")
5256
.put("customer_id[]", "string")
5357
.put("external_customer_id[]", "string")
58+
.put("external_plan_id", "external_plan_id")
5459
.put("limit", "1")
60+
.put("plan_id", "plan_id")
5561
.put("status", "active")
5662
.build()
5763
)

0 commit comments

Comments
 (0)