Skip to content

Commit 7f58f4b

Browse files
feat(api): api update
1 parent bb2637a commit 7f58f4b

8 files changed

Lines changed: 2171 additions & 8 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 139
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb/orb-b13a08bfebe7b2efc4a5f8aa0b69015e2d58435a581b1578e3e67d76fdfb8cb0.yml
3-
openapi_spec_hash: bba0e6257d3d2f8612c5ad14b95839e2
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb/orb-7f97a69f22372b818e8d24a72f6020bcf2f0c6d6b3ad07abb8395c87ec4a72ee.yml
3+
openapi_spec_hash: a6261e730c54d08ad36f1b946e663fc3
44
config_hash: c01c1191b1cd696c7ca855ff6d28a8df

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

Lines changed: 946 additions & 2 deletions
Large diffs are not rendered by default.

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

Lines changed: 1072 additions & 4 deletions
Large diffs are not rendered by default.

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

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,20 @@ internal class AlertCreateForSubscriptionParamsTest {
1616
.type(AlertCreateForSubscriptionParams.Type.USAGE_EXCEEDED)
1717
.addGroupingKey("string")
1818
.metricId("metric_id")
19+
.addPriceFilter(
20+
AlertCreateForSubscriptionParams.PriceFilter.builder()
21+
.field(AlertCreateForSubscriptionParams.PriceFilter.Field.PRICE_ID)
22+
.operator(AlertCreateForSubscriptionParams.PriceFilter.Operator.INCLUDES)
23+
.addValue("string")
24+
.build()
25+
)
1926
.pricingUnitId("pricing_unit_id")
27+
.addThresholdOverride(
28+
AlertCreateForSubscriptionParams.ThresholdOverride.builder()
29+
.addGroupValue("string")
30+
.addThreshold(Threshold.builder().value(0.0).build())
31+
.build()
32+
)
2033
.build()
2134
}
2235

@@ -43,7 +56,20 @@ internal class AlertCreateForSubscriptionParamsTest {
4356
.type(AlertCreateForSubscriptionParams.Type.USAGE_EXCEEDED)
4457
.addGroupingKey("string")
4558
.metricId("metric_id")
59+
.addPriceFilter(
60+
AlertCreateForSubscriptionParams.PriceFilter.builder()
61+
.field(AlertCreateForSubscriptionParams.PriceFilter.Field.PRICE_ID)
62+
.operator(AlertCreateForSubscriptionParams.PriceFilter.Operator.INCLUDES)
63+
.addValue("string")
64+
.build()
65+
)
4666
.pricingUnitId("pricing_unit_id")
67+
.addThresholdOverride(
68+
AlertCreateForSubscriptionParams.ThresholdOverride.builder()
69+
.addGroupValue("string")
70+
.addThreshold(Threshold.builder().value(0.0).build())
71+
.build()
72+
)
4773
.build()
4874

4975
val body = params._body()
@@ -52,7 +78,22 @@ internal class AlertCreateForSubscriptionParamsTest {
5278
assertThat(body.type()).isEqualTo(AlertCreateForSubscriptionParams.Type.USAGE_EXCEEDED)
5379
assertThat(body.groupingKeys().getOrNull()).containsExactly("string")
5480
assertThat(body.metricId()).contains("metric_id")
81+
assertThat(body.priceFilters().getOrNull())
82+
.containsExactly(
83+
AlertCreateForSubscriptionParams.PriceFilter.builder()
84+
.field(AlertCreateForSubscriptionParams.PriceFilter.Field.PRICE_ID)
85+
.operator(AlertCreateForSubscriptionParams.PriceFilter.Operator.INCLUDES)
86+
.addValue("string")
87+
.build()
88+
)
5589
assertThat(body.pricingUnitId()).contains("pricing_unit_id")
90+
assertThat(body.thresholdOverrides().getOrNull())
91+
.containsExactly(
92+
AlertCreateForSubscriptionParams.ThresholdOverride.builder()
93+
.addGroupValue("string")
94+
.addThreshold(Threshold.builder().value(0.0).build())
95+
.build()
96+
)
5697
}
5798

5899
@Test

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ internal class AlertListPageResponseTest {
4646
)
4747
.addGroupingKey("string")
4848
.licenseType(Alert.LicenseType.builder().id("id").build())
49+
.addPriceFilter(
50+
Alert.PriceFilter.builder()
51+
.field(Alert.PriceFilter.Field.PRICE_ID)
52+
.operator(Alert.PriceFilter.Operator.INCLUDES)
53+
.addValue("string")
54+
.build()
55+
)
56+
.addThresholdOverride(
57+
Alert.ThresholdOverride.builder()
58+
.addGroupValue("string")
59+
.addThreshold(Threshold.builder().value(0.0).build())
60+
.build()
61+
)
4962
.build()
5063
)
5164
.paginationMetadata(
@@ -83,6 +96,19 @@ internal class AlertListPageResponseTest {
8396
)
8497
.addGroupingKey("string")
8598
.licenseType(Alert.LicenseType.builder().id("id").build())
99+
.addPriceFilter(
100+
Alert.PriceFilter.builder()
101+
.field(Alert.PriceFilter.Field.PRICE_ID)
102+
.operator(Alert.PriceFilter.Operator.INCLUDES)
103+
.addValue("string")
104+
.build()
105+
)
106+
.addThresholdOverride(
107+
Alert.ThresholdOverride.builder()
108+
.addGroupValue("string")
109+
.addThreshold(Threshold.builder().value(0.0).build())
110+
.build()
111+
)
86112
.build()
87113
)
88114
assertThat(alertListPageResponse.paginationMetadata())
@@ -126,6 +152,19 @@ internal class AlertListPageResponseTest {
126152
)
127153
.addGroupingKey("string")
128154
.licenseType(Alert.LicenseType.builder().id("id").build())
155+
.addPriceFilter(
156+
Alert.PriceFilter.builder()
157+
.field(Alert.PriceFilter.Field.PRICE_ID)
158+
.operator(Alert.PriceFilter.Operator.INCLUDES)
159+
.addValue("string")
160+
.build()
161+
)
162+
.addThresholdOverride(
163+
Alert.ThresholdOverride.builder()
164+
.addGroupValue("string")
165+
.addThreshold(Threshold.builder().value(0.0).build())
166+
.build()
167+
)
129168
.build()
130169
)
131170
.paginationMetadata(

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

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ internal class AlertTest {
4242
)
4343
.addGroupingKey("string")
4444
.licenseType(Alert.LicenseType.builder().id("id").build())
45+
.addPriceFilter(
46+
Alert.PriceFilter.builder()
47+
.field(Alert.PriceFilter.Field.PRICE_ID)
48+
.operator(Alert.PriceFilter.Operator.INCLUDES)
49+
.addValue("string")
50+
.build()
51+
)
52+
.addThresholdOverride(
53+
Alert.ThresholdOverride.builder()
54+
.addGroupValue("string")
55+
.addThreshold(Threshold.builder().value(0.0).build())
56+
.build()
57+
)
4558
.build()
4659

4760
assertThat(alert.id()).isEqualTo("XuxCbt7x9L82yyeF")
@@ -76,6 +89,21 @@ internal class AlertTest {
7689
)
7790
assertThat(alert.groupingKeys().getOrNull()).containsExactly("string")
7891
assertThat(alert.licenseType()).contains(Alert.LicenseType.builder().id("id").build())
92+
assertThat(alert.priceFilters().getOrNull())
93+
.containsExactly(
94+
Alert.PriceFilter.builder()
95+
.field(Alert.PriceFilter.Field.PRICE_ID)
96+
.operator(Alert.PriceFilter.Operator.INCLUDES)
97+
.addValue("string")
98+
.build()
99+
)
100+
assertThat(alert.thresholdOverrides().getOrNull())
101+
.containsExactly(
102+
Alert.ThresholdOverride.builder()
103+
.addGroupValue("string")
104+
.addThreshold(Threshold.builder().value(0.0).build())
105+
.build()
106+
)
79107
}
80108

81109
@Test
@@ -110,6 +138,19 @@ internal class AlertTest {
110138
)
111139
.addGroupingKey("string")
112140
.licenseType(Alert.LicenseType.builder().id("id").build())
141+
.addPriceFilter(
142+
Alert.PriceFilter.builder()
143+
.field(Alert.PriceFilter.Field.PRICE_ID)
144+
.operator(Alert.PriceFilter.Operator.INCLUDES)
145+
.addValue("string")
146+
.build()
147+
)
148+
.addThresholdOverride(
149+
Alert.ThresholdOverride.builder()
150+
.addGroupValue("string")
151+
.addThreshold(Threshold.builder().value(0.0).build())
152+
.build()
153+
)
113154
.build()
114155

115156
val roundtrippedAlert =

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,22 @@ internal class AlertServiceAsyncTest {
133133
.type(AlertCreateForSubscriptionParams.Type.USAGE_EXCEEDED)
134134
.addGroupingKey("string")
135135
.metricId("metric_id")
136+
.addPriceFilter(
137+
AlertCreateForSubscriptionParams.PriceFilter.builder()
138+
.field(AlertCreateForSubscriptionParams.PriceFilter.Field.PRICE_ID)
139+
.operator(
140+
AlertCreateForSubscriptionParams.PriceFilter.Operator.INCLUDES
141+
)
142+
.addValue("string")
143+
.build()
144+
)
136145
.pricingUnitId("pricing_unit_id")
146+
.addThresholdOverride(
147+
AlertCreateForSubscriptionParams.ThresholdOverride.builder()
148+
.addGroupValue("string")
149+
.addThreshold(Threshold.builder().value(0.0).build())
150+
.build()
151+
)
137152
.build()
138153
)
139154

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,22 @@ internal class AlertServiceTest {
128128
.type(AlertCreateForSubscriptionParams.Type.USAGE_EXCEEDED)
129129
.addGroupingKey("string")
130130
.metricId("metric_id")
131+
.addPriceFilter(
132+
AlertCreateForSubscriptionParams.PriceFilter.builder()
133+
.field(AlertCreateForSubscriptionParams.PriceFilter.Field.PRICE_ID)
134+
.operator(
135+
AlertCreateForSubscriptionParams.PriceFilter.Operator.INCLUDES
136+
)
137+
.addValue("string")
138+
.build()
139+
)
131140
.pricingUnitId("pricing_unit_id")
141+
.addThresholdOverride(
142+
AlertCreateForSubscriptionParams.ThresholdOverride.builder()
143+
.addGroupValue("string")
144+
.addThreshold(Threshold.builder().value(0.0).build())
145+
.build()
146+
)
132147
.build()
133148
)
134149

0 commit comments

Comments
 (0)