Skip to content

Commit 60cce59

Browse files
feat(client): expose request body setter and getter (#383)
1 parent 99123b3 commit 60cce59

File tree

59 files changed

+542
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+542
-74
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,17 @@ private constructor(
127127

128128
fun customerId(customerId: String) = apply { this.customerId = customerId }
129129

130+
/**
131+
* Sets the entire request body.
132+
*
133+
* This is generally only useful if you are already constructing the body separately.
134+
* Otherwise, it's more convenient to use the top-level setters instead:
135+
* - [currency]
136+
* - [type]
137+
* - [thresholds]
138+
*/
139+
fun body(body: Body) = apply { this.body = body.toBuilder() }
140+
130141
/** The case sensitive currency or custom pricing unit to use for this alert. */
131142
fun currency(currency: String) = apply { body.currency(currency) }
132143

@@ -313,7 +324,7 @@ private constructor(
313324
)
314325
}
315326

316-
@JvmSynthetic internal fun _body(): Body = body
327+
fun _body(): Body = body
317328

318329
fun _pathParam(index: Int): String =
319330
when (index) {

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,17 @@ private constructor(
133133
this.externalCustomerId = externalCustomerId
134134
}
135135

136+
/**
137+
* Sets the entire request body.
138+
*
139+
* This is generally only useful if you are already constructing the body separately.
140+
* Otherwise, it's more convenient to use the top-level setters instead:
141+
* - [currency]
142+
* - [type]
143+
* - [thresholds]
144+
*/
145+
fun body(body: Body) = apply { this.body = body.toBuilder() }
146+
136147
/** The case sensitive currency or custom pricing unit to use for this alert. */
137148
fun currency(currency: String) = apply { body.currency(currency) }
138149

@@ -319,7 +330,7 @@ private constructor(
319330
)
320331
}
321332

322-
@JvmSynthetic internal fun _body(): Body = body
333+
fun _body(): Body = body
323334

324335
fun _pathParam(index: Int): String =
325336
when (index) {

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,17 @@ private constructor(
134134

135135
fun subscriptionId(subscriptionId: String) = apply { this.subscriptionId = subscriptionId }
136136

137+
/**
138+
* Sets the entire request body.
139+
*
140+
* This is generally only useful if you are already constructing the body separately.
141+
* Otherwise, it's more convenient to use the top-level setters instead:
142+
* - [thresholds]
143+
* - [type]
144+
* - [metricId]
145+
*/
146+
fun body(body: Body) = apply { this.body = body.toBuilder() }
147+
137148
/** The thresholds that define the values at which the alert will be triggered. */
138149
fun thresholds(thresholds: List<Threshold>) = apply { body.thresholds(thresholds) }
139150

@@ -320,7 +331,7 @@ private constructor(
320331
)
321332
}
322333

323-
@JvmSynthetic internal fun _body(): Body = body
334+
fun _body(): Body = body
324335

325336
fun _pathParam(index: Int): String =
326337
when (index) {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,7 @@ private constructor(
223223
)
224224
}
225225

226-
@JvmSynthetic
227-
internal fun _body(): Optional<Map<String, JsonValue>> =
226+
fun _body(): Optional<Map<String, JsonValue>> =
228227
Optional.ofNullable(additionalBodyProperties.ifEmpty { null })
229228

230229
fun _pathParam(index: Int): String =

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,7 @@ private constructor(
223223
)
224224
}
225225

226-
@JvmSynthetic
227-
internal fun _body(): Optional<Map<String, JsonValue>> =
226+
fun _body(): Optional<Map<String, JsonValue>> =
228227
Optional.ofNullable(additionalBodyProperties.ifEmpty { null })
229228

230229
fun _pathParam(index: Int): String =

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ private constructor(
8989
this.alertConfigurationId = alertConfigurationId
9090
}
9191

92+
/**
93+
* Sets the entire request body.
94+
*
95+
* This is generally only useful if you are already constructing the body separately.
96+
* Otherwise, it's more convenient to use the top-level setters instead:
97+
* - [thresholds]
98+
*/
99+
fun body(body: Body) = apply { this.body = body.toBuilder() }
100+
92101
/** The thresholds that define the values at which the alert will be triggered. */
93102
fun thresholds(thresholds: List<Threshold>) = apply { body.thresholds(thresholds) }
94103

@@ -249,7 +258,7 @@ private constructor(
249258
)
250259
}
251260

252-
@JvmSynthetic internal fun _body(): Body = body
261+
fun _body(): Body = body
253262

254263
fun _pathParam(index: Int): String =
255264
when (index) {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ private constructor(
206206
)
207207
}
208208

209-
@JvmSynthetic
210-
internal fun _body(): Optional<Map<String, JsonValue>> =
209+
fun _body(): Optional<Map<String, JsonValue>> =
211210
Optional.ofNullable(additionalBodyProperties.ifEmpty { null })
212211

213212
fun _pathParam(index: Int): String =

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,18 @@ private constructor(
139139
additionalQueryParams = couponCreateParams.additionalQueryParams.toBuilder()
140140
}
141141

142+
/**
143+
* Sets the entire request body.
144+
*
145+
* This is generally only useful if you are already constructing the body separately.
146+
* Otherwise, it's more convenient to use the top-level setters instead:
147+
* - [discount]
148+
* - [redemptionCode]
149+
* - [durationInMonths]
150+
* - [maxRedemptions]
151+
*/
152+
fun body(body: Body) = apply { this.body = body.toBuilder() }
153+
142154
fun discount(discount: Discount) = apply { body.discount(discount) }
143155

144156
/**
@@ -398,7 +410,7 @@ private constructor(
398410
)
399411
}
400412

401-
@JvmSynthetic internal fun _body(): Body = body
413+
fun _body(): Body = body
402414

403415
override fun _headers(): Headers = additionalHeaders
404416

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@ private constructor(
109109
additionalQueryParams = creditNoteCreateParams.additionalQueryParams.toBuilder()
110110
}
111111

112+
/**
113+
* Sets the entire request body.
114+
*
115+
* This is generally only useful if you are already constructing the body separately.
116+
* Otherwise, it's more convenient to use the top-level setters instead:
117+
* - [lineItems]
118+
* - [memo]
119+
* - [reason]
120+
*/
121+
fun body(body: Body) = apply { this.body = body.toBuilder() }
122+
112123
fun lineItems(lineItems: List<LineItem>) = apply { body.lineItems(lineItems) }
113124

114125
/**
@@ -292,7 +303,7 @@ private constructor(
292303
)
293304
}
294305

295-
@JvmSynthetic internal fun _body(): Body = body
306+
fun _body(): Body = body
296307

297308
override fun _headers(): Headers = additionalHeaders
298309

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,17 @@ private constructor(
121121

122122
fun customerId(customerId: String) = apply { this.customerId = customerId }
123123

124+
/**
125+
* Sets the entire request body.
126+
*
127+
* This is generally only useful if you are already constructing the body separately.
128+
* Otherwise, it's more convenient to use the top-level setters instead:
129+
* - [amount]
130+
* - [type]
131+
* - [description]
132+
*/
133+
fun body(body: Body) = apply { this.body = body.toBuilder() }
134+
124135
fun amount(amount: String) = apply { body.amount(amount) }
125136

126137
/**
@@ -296,7 +307,7 @@ private constructor(
296307
)
297308
}
298309

299-
@JvmSynthetic internal fun _body(): Body = body
310+
fun _body(): Body = body
300311

301312
fun _pathParam(index: Int): String =
302313
when (index) {

0 commit comments

Comments
 (0)