Skip to content

Commit 0e0965d

Browse files
feat(client): expose request body setter and getter (#346)
1 parent a833070 commit 0e0965d

File tree

59 files changed

+542
-59
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
-59
lines changed

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

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

125125
fun customerId(customerId: String) = apply { this.customerId = customerId }
126126

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

@@ -307,7 +318,7 @@ private constructor(
307318
)
308319
}
309320

310-
internal fun _body(): Body = body
321+
fun _body(): Body = body
311322

312323
fun _pathParam(index: Int): String =
313324
when (index) {

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,17 @@ private constructor(
130130
this.externalCustomerId = externalCustomerId
131131
}
132132

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

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

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

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

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

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

132132
fun subscriptionId(subscriptionId: String) = apply { this.subscriptionId = subscriptionId }
133133

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

@@ -314,7 +325,7 @@ private constructor(
314325
)
315326
}
316327

317-
internal fun _body(): Body = body
328+
fun _body(): Body = body
318329

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ private constructor(
216216
)
217217
}
218218

219-
internal fun _body(): Map<String, JsonValue>? = additionalBodyProperties.ifEmpty { null }
219+
fun _body(): Map<String, JsonValue>? = additionalBodyProperties.ifEmpty { null }
220220

221221
fun _pathParam(index: Int): String =
222222
when (index) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ private constructor(
216216
)
217217
}
218218

219-
internal fun _body(): Map<String, JsonValue>? = additionalBodyProperties.ifEmpty { null }
219+
fun _body(): Map<String, JsonValue>? = additionalBodyProperties.ifEmpty { null }
220220

221221
fun _pathParam(index: Int): String =
222222
when (index) {

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

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

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

@@ -247,7 +256,7 @@ private constructor(
247256
)
248257
}
249258

250-
internal fun _body(): Body = body
259+
fun _body(): Body = body
251260

252261
fun _pathParam(index: Int): String =
253262
when (index) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ private constructor(
204204
)
205205
}
206206

207-
internal fun _body(): Map<String, JsonValue>? = additionalBodyProperties.ifEmpty { null }
207+
fun _body(): Map<String, JsonValue>? = additionalBodyProperties.ifEmpty { null }
208208

209209
fun _pathParam(index: Int): String =
210210
when (index) {

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,18 @@ private constructor(
136136
additionalQueryParams = couponCreateParams.additionalQueryParams.toBuilder()
137137
}
138138

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

141153
/**
@@ -387,7 +399,7 @@ private constructor(
387399
)
388400
}
389401

390-
internal fun _body(): Body = body
402+
fun _body(): Body = body
391403

392404
override fun _headers(): Headers = additionalHeaders
393405

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,17 @@ private constructor(
106106
additionalQueryParams = creditNoteCreateParams.additionalQueryParams.toBuilder()
107107
}
108108

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

111122
/**
@@ -283,7 +294,7 @@ private constructor(
283294
)
284295
}
285296

286-
internal fun _body(): Body = body
297+
fun _body(): Body = body
287298

288299
override fun _headers(): Headers = additionalHeaders
289300

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

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

119119
fun customerId(customerId: String) = apply { this.customerId = customerId }
120120

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

123134
/**
@@ -290,7 +301,7 @@ private constructor(
290301
)
291302
}
292303

293-
internal fun _body(): Body = body
304+
fun _body(): Body = body
294305

295306
fun _pathParam(index: Int): String =
296307
when (index) {

0 commit comments

Comments
 (0)