Skip to content

Commit f406060

Browse files
feat(api): api update (#317)
1 parent c63fb87 commit f406060

10 files changed

Lines changed: 33 additions & 73 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 103
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-a2c1aa029d1e72a5fc7d3c6cd431479888ebd9a379683a2c8630da48437baa4f.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-6797b438a8e6a6856e28f4304a5a3c81bb67e74fa2d6fcc20e734880c725295a.yml

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -992,26 +992,26 @@ private constructor(
992992

993993
companion object {
994994

995-
@JvmField val USAGE_EXCEEDED = of("usage_exceeded")
996-
997-
@JvmField val COST_EXCEEDED = of("cost_exceeded")
998-
999995
@JvmField val CREDIT_BALANCE_DEPLETED = of("credit_balance_depleted")
1000996

1001997
@JvmField val CREDIT_BALANCE_DROPPED = of("credit_balance_dropped")
1002998

1003999
@JvmField val CREDIT_BALANCE_RECOVERED = of("credit_balance_recovered")
10041000

1001+
@JvmField val USAGE_EXCEEDED = of("usage_exceeded")
1002+
1003+
@JvmField val COST_EXCEEDED = of("cost_exceeded")
1004+
10051005
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
10061006
}
10071007

10081008
/** An enum containing [Type]'s known values. */
10091009
enum class Known {
1010-
USAGE_EXCEEDED,
1011-
COST_EXCEEDED,
10121010
CREDIT_BALANCE_DEPLETED,
10131011
CREDIT_BALANCE_DROPPED,
10141012
CREDIT_BALANCE_RECOVERED,
1013+
USAGE_EXCEEDED,
1014+
COST_EXCEEDED,
10151015
}
10161016

10171017
/**
@@ -1024,11 +1024,11 @@ private constructor(
10241024
* - It was constructed with an arbitrary value using the [of] method.
10251025
*/
10261026
enum class Value {
1027-
USAGE_EXCEEDED,
1028-
COST_EXCEEDED,
10291027
CREDIT_BALANCE_DEPLETED,
10301028
CREDIT_BALANCE_DROPPED,
10311029
CREDIT_BALANCE_RECOVERED,
1030+
USAGE_EXCEEDED,
1031+
COST_EXCEEDED,
10321032
/** An enum member indicating that [Type] was instantiated with an unknown value. */
10331033
_UNKNOWN,
10341034
}
@@ -1042,11 +1042,11 @@ private constructor(
10421042
*/
10431043
fun value(): Value =
10441044
when (this) {
1045-
USAGE_EXCEEDED -> Value.USAGE_EXCEEDED
1046-
COST_EXCEEDED -> Value.COST_EXCEEDED
10471045
CREDIT_BALANCE_DEPLETED -> Value.CREDIT_BALANCE_DEPLETED
10481046
CREDIT_BALANCE_DROPPED -> Value.CREDIT_BALANCE_DROPPED
10491047
CREDIT_BALANCE_RECOVERED -> Value.CREDIT_BALANCE_RECOVERED
1048+
USAGE_EXCEEDED -> Value.USAGE_EXCEEDED
1049+
COST_EXCEEDED -> Value.COST_EXCEEDED
10501050
else -> Value._UNKNOWN
10511051
}
10521052

@@ -1060,11 +1060,11 @@ private constructor(
10601060
*/
10611061
fun known(): Known =
10621062
when (this) {
1063-
USAGE_EXCEEDED -> Known.USAGE_EXCEEDED
1064-
COST_EXCEEDED -> Known.COST_EXCEEDED
10651063
CREDIT_BALANCE_DEPLETED -> Known.CREDIT_BALANCE_DEPLETED
10661064
CREDIT_BALANCE_DROPPED -> Known.CREDIT_BALANCE_DROPPED
10671065
CREDIT_BALANCE_RECOVERED -> Known.CREDIT_BALANCE_RECOVERED
1066+
USAGE_EXCEEDED -> Known.USAGE_EXCEEDED
1067+
COST_EXCEEDED -> Known.COST_EXCEEDED
10681068
else -> throw OrbInvalidDataException("Unknown Type: $value")
10691069
}
10701070

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,6 @@ private constructor(
445445

446446
companion object {
447447

448-
@JvmField val USAGE_EXCEEDED = of("usage_exceeded")
449-
450-
@JvmField val COST_EXCEEDED = of("cost_exceeded")
451-
452448
@JvmField val CREDIT_BALANCE_DEPLETED = of("credit_balance_depleted")
453449

454450
@JvmField val CREDIT_BALANCE_DROPPED = of("credit_balance_dropped")
@@ -460,8 +456,6 @@ private constructor(
460456

461457
/** An enum containing [Type]'s known values. */
462458
enum class Known {
463-
USAGE_EXCEEDED,
464-
COST_EXCEEDED,
465459
CREDIT_BALANCE_DEPLETED,
466460
CREDIT_BALANCE_DROPPED,
467461
CREDIT_BALANCE_RECOVERED,
@@ -477,8 +471,6 @@ private constructor(
477471
* - It was constructed with an arbitrary value using the [of] method.
478472
*/
479473
enum class Value {
480-
USAGE_EXCEEDED,
481-
COST_EXCEEDED,
482474
CREDIT_BALANCE_DEPLETED,
483475
CREDIT_BALANCE_DROPPED,
484476
CREDIT_BALANCE_RECOVERED,
@@ -495,8 +487,6 @@ private constructor(
495487
*/
496488
fun value(): Value =
497489
when (this) {
498-
USAGE_EXCEEDED -> Value.USAGE_EXCEEDED
499-
COST_EXCEEDED -> Value.COST_EXCEEDED
500490
CREDIT_BALANCE_DEPLETED -> Value.CREDIT_BALANCE_DEPLETED
501491
CREDIT_BALANCE_DROPPED -> Value.CREDIT_BALANCE_DROPPED
502492
CREDIT_BALANCE_RECOVERED -> Value.CREDIT_BALANCE_RECOVERED
@@ -513,8 +503,6 @@ private constructor(
513503
*/
514504
fun known(): Known =
515505
when (this) {
516-
USAGE_EXCEEDED -> Known.USAGE_EXCEEDED
517-
COST_EXCEEDED -> Known.COST_EXCEEDED
518506
CREDIT_BALANCE_DEPLETED -> Known.CREDIT_BALANCE_DEPLETED
519507
CREDIT_BALANCE_DROPPED -> Known.CREDIT_BALANCE_DROPPED
520508
CREDIT_BALANCE_RECOVERED -> Known.CREDIT_BALANCE_RECOVERED

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,6 @@ private constructor(
451451

452452
companion object {
453453

454-
@JvmField val USAGE_EXCEEDED = of("usage_exceeded")
455-
456-
@JvmField val COST_EXCEEDED = of("cost_exceeded")
457-
458454
@JvmField val CREDIT_BALANCE_DEPLETED = of("credit_balance_depleted")
459455

460456
@JvmField val CREDIT_BALANCE_DROPPED = of("credit_balance_dropped")
@@ -466,8 +462,6 @@ private constructor(
466462

467463
/** An enum containing [Type]'s known values. */
468464
enum class Known {
469-
USAGE_EXCEEDED,
470-
COST_EXCEEDED,
471465
CREDIT_BALANCE_DEPLETED,
472466
CREDIT_BALANCE_DROPPED,
473467
CREDIT_BALANCE_RECOVERED,
@@ -483,8 +477,6 @@ private constructor(
483477
* - It was constructed with an arbitrary value using the [of] method.
484478
*/
485479
enum class Value {
486-
USAGE_EXCEEDED,
487-
COST_EXCEEDED,
488480
CREDIT_BALANCE_DEPLETED,
489481
CREDIT_BALANCE_DROPPED,
490482
CREDIT_BALANCE_RECOVERED,
@@ -501,8 +493,6 @@ private constructor(
501493
*/
502494
fun value(): Value =
503495
when (this) {
504-
USAGE_EXCEEDED -> Value.USAGE_EXCEEDED
505-
COST_EXCEEDED -> Value.COST_EXCEEDED
506496
CREDIT_BALANCE_DEPLETED -> Value.CREDIT_BALANCE_DEPLETED
507497
CREDIT_BALANCE_DROPPED -> Value.CREDIT_BALANCE_DROPPED
508498
CREDIT_BALANCE_RECOVERED -> Value.CREDIT_BALANCE_RECOVERED
@@ -519,8 +509,6 @@ private constructor(
519509
*/
520510
fun known(): Known =
521511
when (this) {
522-
USAGE_EXCEEDED -> Known.USAGE_EXCEEDED
523-
COST_EXCEEDED -> Known.COST_EXCEEDED
524512
CREDIT_BALANCE_DEPLETED -> Known.CREDIT_BALANCE_DEPLETED
525513
CREDIT_BALANCE_DROPPED -> Known.CREDIT_BALANCE_DROPPED
526514
CREDIT_BALANCE_RECOVERED -> Known.CREDIT_BALANCE_RECOVERED

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -576,22 +576,13 @@ private constructor(
576576

577577
@JvmField val COST_EXCEEDED = of("cost_exceeded")
578578

579-
@JvmField val CREDIT_BALANCE_DEPLETED = of("credit_balance_depleted")
580-
581-
@JvmField val CREDIT_BALANCE_DROPPED = of("credit_balance_dropped")
582-
583-
@JvmField val CREDIT_BALANCE_RECOVERED = of("credit_balance_recovered")
584-
585579
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
586580
}
587581

588582
/** An enum containing [Type]'s known values. */
589583
enum class Known {
590584
USAGE_EXCEEDED,
591585
COST_EXCEEDED,
592-
CREDIT_BALANCE_DEPLETED,
593-
CREDIT_BALANCE_DROPPED,
594-
CREDIT_BALANCE_RECOVERED,
595586
}
596587

597588
/**
@@ -606,9 +597,6 @@ private constructor(
606597
enum class Value {
607598
USAGE_EXCEEDED,
608599
COST_EXCEEDED,
609-
CREDIT_BALANCE_DEPLETED,
610-
CREDIT_BALANCE_DROPPED,
611-
CREDIT_BALANCE_RECOVERED,
612600
/** An enum member indicating that [Type] was instantiated with an unknown value. */
613601
_UNKNOWN,
614602
}
@@ -624,9 +612,6 @@ private constructor(
624612
when (this) {
625613
USAGE_EXCEEDED -> Value.USAGE_EXCEEDED
626614
COST_EXCEEDED -> Value.COST_EXCEEDED
627-
CREDIT_BALANCE_DEPLETED -> Value.CREDIT_BALANCE_DEPLETED
628-
CREDIT_BALANCE_DROPPED -> Value.CREDIT_BALANCE_DROPPED
629-
CREDIT_BALANCE_RECOVERED -> Value.CREDIT_BALANCE_RECOVERED
630615
else -> Value._UNKNOWN
631616
}
632617

@@ -642,9 +627,6 @@ private constructor(
642627
when (this) {
643628
USAGE_EXCEEDED -> Known.USAGE_EXCEEDED
644629
COST_EXCEEDED -> Known.COST_EXCEEDED
645-
CREDIT_BALANCE_DEPLETED -> Known.CREDIT_BALANCE_DEPLETED
646-
CREDIT_BALANCE_DROPPED -> Known.CREDIT_BALANCE_DROPPED
647-
CREDIT_BALANCE_RECOVERED -> Known.CREDIT_BALANCE_RECOVERED
648630
else -> throw OrbInvalidDataException("Unknown Type: $value")
649631
}
650632

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class AlertCreateForCustomerParamsTest {
1313
AlertCreateForCustomerParams.builder()
1414
.customerId("customer_id")
1515
.currency("currency")
16-
.type(AlertCreateForCustomerParams.Type.USAGE_EXCEEDED)
16+
.type(AlertCreateForCustomerParams.Type.CREDIT_BALANCE_DEPLETED)
1717
.addThreshold(AlertCreateForCustomerParams.Threshold.builder().value(0.0).build())
1818
.build()
1919
}
@@ -24,15 +24,15 @@ class AlertCreateForCustomerParamsTest {
2424
AlertCreateForCustomerParams.builder()
2525
.customerId("customer_id")
2626
.currency("currency")
27-
.type(AlertCreateForCustomerParams.Type.USAGE_EXCEEDED)
27+
.type(AlertCreateForCustomerParams.Type.CREDIT_BALANCE_DEPLETED)
2828
.addThreshold(AlertCreateForCustomerParams.Threshold.builder().value(0.0).build())
2929
.build()
3030

3131
val body = params._body()
3232

3333
assertNotNull(body)
3434
assertThat(body.currency()).isEqualTo("currency")
35-
assertThat(body.type()).isEqualTo(AlertCreateForCustomerParams.Type.USAGE_EXCEEDED)
35+
assertThat(body.type()).isEqualTo(AlertCreateForCustomerParams.Type.CREDIT_BALANCE_DEPLETED)
3636
assertThat(body.thresholds())
3737
.contains(listOf(AlertCreateForCustomerParams.Threshold.builder().value(0.0).build()))
3838
}
@@ -43,14 +43,14 @@ class AlertCreateForCustomerParamsTest {
4343
AlertCreateForCustomerParams.builder()
4444
.customerId("customer_id")
4545
.currency("currency")
46-
.type(AlertCreateForCustomerParams.Type.USAGE_EXCEEDED)
46+
.type(AlertCreateForCustomerParams.Type.CREDIT_BALANCE_DEPLETED)
4747
.build()
4848

4949
val body = params._body()
5050

5151
assertNotNull(body)
5252
assertThat(body.currency()).isEqualTo("currency")
53-
assertThat(body.type()).isEqualTo(AlertCreateForCustomerParams.Type.USAGE_EXCEEDED)
53+
assertThat(body.type()).isEqualTo(AlertCreateForCustomerParams.Type.CREDIT_BALANCE_DEPLETED)
5454
}
5555

5656
@Test
@@ -59,7 +59,7 @@ class AlertCreateForCustomerParamsTest {
5959
AlertCreateForCustomerParams.builder()
6060
.customerId("customer_id")
6161
.currency("currency")
62-
.type(AlertCreateForCustomerParams.Type.USAGE_EXCEEDED)
62+
.type(AlertCreateForCustomerParams.Type.CREDIT_BALANCE_DEPLETED)
6363
.build()
6464
assertThat(params).isNotNull
6565
// path param "customerId"

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class AlertCreateForExternalCustomerParamsTest {
1313
AlertCreateForExternalCustomerParams.builder()
1414
.externalCustomerId("external_customer_id")
1515
.currency("currency")
16-
.type(AlertCreateForExternalCustomerParams.Type.USAGE_EXCEEDED)
16+
.type(AlertCreateForExternalCustomerParams.Type.CREDIT_BALANCE_DEPLETED)
1717
.addThreshold(
1818
AlertCreateForExternalCustomerParams.Threshold.builder().value(0.0).build()
1919
)
@@ -26,7 +26,7 @@ class AlertCreateForExternalCustomerParamsTest {
2626
AlertCreateForExternalCustomerParams.builder()
2727
.externalCustomerId("external_customer_id")
2828
.currency("currency")
29-
.type(AlertCreateForExternalCustomerParams.Type.USAGE_EXCEEDED)
29+
.type(AlertCreateForExternalCustomerParams.Type.CREDIT_BALANCE_DEPLETED)
3030
.addThreshold(
3131
AlertCreateForExternalCustomerParams.Threshold.builder().value(0.0).build()
3232
)
@@ -36,7 +36,8 @@ class AlertCreateForExternalCustomerParamsTest {
3636

3737
assertNotNull(body)
3838
assertThat(body.currency()).isEqualTo("currency")
39-
assertThat(body.type()).isEqualTo(AlertCreateForExternalCustomerParams.Type.USAGE_EXCEEDED)
39+
assertThat(body.type())
40+
.isEqualTo(AlertCreateForExternalCustomerParams.Type.CREDIT_BALANCE_DEPLETED)
4041
assertThat(body.thresholds())
4142
.contains(
4243
listOf(AlertCreateForExternalCustomerParams.Threshold.builder().value(0.0).build())
@@ -49,14 +50,15 @@ class AlertCreateForExternalCustomerParamsTest {
4950
AlertCreateForExternalCustomerParams.builder()
5051
.externalCustomerId("external_customer_id")
5152
.currency("currency")
52-
.type(AlertCreateForExternalCustomerParams.Type.USAGE_EXCEEDED)
53+
.type(AlertCreateForExternalCustomerParams.Type.CREDIT_BALANCE_DEPLETED)
5354
.build()
5455

5556
val body = params._body()
5657

5758
assertNotNull(body)
5859
assertThat(body.currency()).isEqualTo("currency")
59-
assertThat(body.type()).isEqualTo(AlertCreateForExternalCustomerParams.Type.USAGE_EXCEEDED)
60+
assertThat(body.type())
61+
.isEqualTo(AlertCreateForExternalCustomerParams.Type.CREDIT_BALANCE_DEPLETED)
6062
}
6163

6264
@Test
@@ -65,7 +67,7 @@ class AlertCreateForExternalCustomerParamsTest {
6567
AlertCreateForExternalCustomerParams.builder()
6668
.externalCustomerId("external_customer_id")
6769
.currency("currency")
68-
.type(AlertCreateForExternalCustomerParams.Type.USAGE_EXCEEDED)
70+
.type(AlertCreateForExternalCustomerParams.Type.CREDIT_BALANCE_DEPLETED)
6971
.build()
7072
assertThat(params).isNotNull
7173
// path param "externalCustomerId"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class AlertTest {
3333
)
3434
.subscription(Alert.Subscription.builder().id("VDGsT23osdLb84KD").build())
3535
.addThreshold(Alert.Threshold.builder().value(0.0).build())
36-
.type(Alert.Type.USAGE_EXCEEDED)
36+
.type(Alert.Type.CREDIT_BALANCE_DEPLETED)
3737
.build()
3838
assertThat(alert).isNotNull
3939
assertThat(alert.id()).isEqualTo("XuxCbt7x9L82yyeF")
@@ -58,6 +58,6 @@ class AlertTest {
5858
.contains(Alert.Subscription.builder().id("VDGsT23osdLb84KD").build())
5959
assertThat(alert.thresholds().get())
6060
.containsExactly(Alert.Threshold.builder().value(0.0).build())
61-
assertThat(alert.type()).isEqualTo(Alert.Type.USAGE_EXCEEDED)
61+
assertThat(alert.type()).isEqualTo(Alert.Type.CREDIT_BALANCE_DEPLETED)
6262
}
6363
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class AlertServiceAsyncTest {
8585
AlertCreateForCustomerParams.builder()
8686
.customerId("customer_id")
8787
.currency("currency")
88-
.type(AlertCreateForCustomerParams.Type.USAGE_EXCEEDED)
88+
.type(AlertCreateForCustomerParams.Type.CREDIT_BALANCE_DEPLETED)
8989
.addThreshold(
9090
AlertCreateForCustomerParams.Threshold.builder().value(0.0).build()
9191
)
@@ -110,7 +110,7 @@ class AlertServiceAsyncTest {
110110
AlertCreateForExternalCustomerParams.builder()
111111
.externalCustomerId("external_customer_id")
112112
.currency("currency")
113-
.type(AlertCreateForExternalCustomerParams.Type.USAGE_EXCEEDED)
113+
.type(AlertCreateForExternalCustomerParams.Type.CREDIT_BALANCE_DEPLETED)
114114
.addThreshold(
115115
AlertCreateForExternalCustomerParams.Threshold.builder().value(0.0).build()
116116
)

orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/AlertServiceTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class AlertServiceTest {
8181
AlertCreateForCustomerParams.builder()
8282
.customerId("customer_id")
8383
.currency("currency")
84-
.type(AlertCreateForCustomerParams.Type.USAGE_EXCEEDED)
84+
.type(AlertCreateForCustomerParams.Type.CREDIT_BALANCE_DEPLETED)
8585
.addThreshold(
8686
AlertCreateForCustomerParams.Threshold.builder().value(0.0).build()
8787
)
@@ -105,7 +105,7 @@ class AlertServiceTest {
105105
AlertCreateForExternalCustomerParams.builder()
106106
.externalCustomerId("external_customer_id")
107107
.currency("currency")
108-
.type(AlertCreateForExternalCustomerParams.Type.USAGE_EXCEEDED)
108+
.type(AlertCreateForExternalCustomerParams.Type.CREDIT_BALANCE_DEPLETED)
109109
.addThreshold(
110110
AlertCreateForExternalCustomerParams.Threshold.builder().value(0.0).build()
111111
)

0 commit comments

Comments
 (0)