Skip to content

Commit 1b97fe6

Browse files
feat(client): expose request body setter and getter (#524)
1 parent 842bb3f commit 1b97fe6

22 files changed

+226
-24
lines changed

finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,18 @@ private constructor(
114114
additionalQueryParams = accessTokenCreateParams.additionalQueryParams.toBuilder()
115115
}
116116

117+
/**
118+
* Sets the entire request body.
119+
*
120+
* This is generally only useful if you are already constructing the body separately.
121+
* Otherwise, it's more convenient to use the top-level setters instead:
122+
* - [code]
123+
* - [clientId]
124+
* - [clientSecret]
125+
* - [redirectUri]
126+
*/
127+
fun body(body: Body) = apply { this.body = body.toBuilder() }
128+
117129
fun code(code: String) = apply { body.code(code) }
118130

119131
/**
@@ -295,7 +307,7 @@ private constructor(
295307
)
296308
}
297309

298-
@JvmSynthetic internal fun _body(): Body = body
310+
fun _body(): Body = body
299311

300312
override fun _headers(): Headers = additionalHeaders
301313

finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ private constructor(
182182
)
183183
}
184184

185-
@JvmSynthetic
186-
internal fun _body(): Optional<Map<String, JsonValue>> =
185+
fun _body(): Optional<Map<String, JsonValue>> =
187186
Optional.ofNullable(additionalBodyProperties.ifEmpty { null })
188187

189188
override fun _headers(): Headers = additionalHeaders

finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,20 @@ private constructor(
187187
additionalQueryParams = connectSessionNewParams.additionalQueryParams.toBuilder()
188188
}
189189

190+
/**
191+
* Sets the entire request body.
192+
*
193+
* This is generally only useful if you are already constructing the body separately.
194+
* Otherwise, it's more convenient to use the top-level setters instead:
195+
* - [customerId]
196+
* - [customerName]
197+
* - [products]
198+
* - [customerEmail]
199+
* - [integration]
200+
* - etc.
201+
*/
202+
fun body(body: Body) = apply { this.body = body.toBuilder() }
203+
190204
fun customerId(customerId: String) = apply { body.customerId(customerId) }
191205

192206
/**
@@ -477,7 +491,7 @@ private constructor(
477491
)
478492
}
479493

480-
@JvmSynthetic internal fun _body(): Body = body
494+
fun _body(): Body = body
481495

482496
override fun _headers(): Headers = additionalHeaders
483497

finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,18 @@ private constructor(
129129
connectSessionReauthenticateParams.additionalQueryParams.toBuilder()
130130
}
131131

132+
/**
133+
* Sets the entire request body.
134+
*
135+
* This is generally only useful if you are already constructing the body separately.
136+
* Otherwise, it's more convenient to use the top-level setters instead:
137+
* - [connectionId]
138+
* - [minutesToExpire]
139+
* - [products]
140+
* - [redirectUri]
141+
*/
142+
fun body(body: Body) = apply { this.body = body.toBuilder() }
143+
132144
/** The ID of the existing connection to reauthenticate */
133145
fun connectionId(connectionId: String) = apply { body.connectionId(connectionId) }
134146

@@ -346,7 +358,7 @@ private constructor(
346358
)
347359
}
348360

349-
@JvmSynthetic internal fun _body(): Body = body
361+
fun _body(): Body = body
350362

351363
override fun _headers(): Headers = additionalHeaders
352364

finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,17 @@ private constructor(
106106
additionalQueryParams = hrisBenefitCreateParams.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+
* - [description]
115+
* - [frequency]
116+
* - [type]
117+
*/
118+
fun body(body: Body) = apply { this.body = body.toBuilder() }
119+
109120
/**
110121
* Name of the benefit as it appears in the provider and pay statements. Recommend limiting
111122
* this to <30 characters due to limitations in specific providers (e.g. Justworks).
@@ -281,7 +292,7 @@ private constructor(
281292
)
282293
}
283294

284-
@JvmSynthetic internal fun _body(): Body = body
295+
fun _body(): Body = body
285296

286297
override fun _headers(): Headers = additionalHeaders
287298

finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ private constructor(
9292

9393
fun benefitId(benefitId: String) = apply { this.benefitId = benefitId }
9494

95+
/**
96+
* Sets the entire request body.
97+
*
98+
* This is generally only useful if you are already constructing the body separately.
99+
* Otherwise, it's more convenient to use the top-level setters instead:
100+
* - [individualIds]
101+
*/
102+
fun body(body: Body) = apply { this.body = body.toBuilder() }
103+
95104
/** Array of individual_ids to unenroll. */
96105
fun individualIds(individualIds: List<String>) = apply { body.individualIds(individualIds) }
97106

@@ -251,7 +260,7 @@ private constructor(
251260
)
252261
}
253262

254-
@JvmSynthetic internal fun _body(): Body = body
263+
fun _body(): Body = body
255264

256265
fun _pathParam(index: Int): String =
257266
when (index) {

finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ private constructor(
8484

8585
fun benefitId(benefitId: String) = apply { this.benefitId = benefitId }
8686

87+
/**
88+
* Sets the entire request body.
89+
*
90+
* This is generally only useful if you are already constructing the body separately.
91+
* Otherwise, it's more convenient to use the top-level setters instead:
92+
* - [description]
93+
*/
94+
fun body(body: Body) = apply { this.body = body.toBuilder() }
95+
8796
/** Updated name or description. */
8897
fun description(description: String) = apply { body.description(description) }
8998

@@ -234,7 +243,7 @@ private constructor(
234243
)
235244
}
236245

237-
@JvmSynthetic internal fun _body(): Body = body
246+
fun _body(): Body = body
238247

239248
fun _pathParam(index: Int): String =
240249
when (index) {

finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParams.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ private constructor(
8282
hrisEmploymentRetrieveManyParams.additionalQueryParams.toBuilder()
8383
}
8484

85+
/**
86+
* Sets the entire request body.
87+
*
88+
* This is generally only useful if you are already constructing the body separately.
89+
* Otherwise, it's more convenient to use the top-level setters instead:
90+
* - [requests]
91+
*/
92+
fun body(body: Body) = apply { this.body = body.toBuilder() }
93+
8594
/** The array of batch requests. */
8695
fun requests(requests: List<Request>) = apply { body.requests(requests) }
8796

@@ -238,7 +247,7 @@ private constructor(
238247
)
239248
}
240249

241-
@JvmSynthetic internal fun _body(): Body = body
250+
fun _body(): Body = body
242251

243252
override fun _headers(): Headers = additionalHeaders
244253

finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ private constructor(
9090
hrisIndividualRetrieveManyParams.additionalQueryParams.toBuilder()
9191
}
9292

93+
/**
94+
* Sets the entire request body.
95+
*
96+
* This is generally only useful if you are already constructing the body separately.
97+
* Otherwise, it's more convenient to use the top-level setters instead:
98+
* - [options]
99+
* - [requests]
100+
*/
101+
fun body(body: Body) = apply { this.body = body.toBuilder() }
102+
93103
fun options(options: Options?) = apply { body.options(options) }
94104

95105
/** Alias for calling [Builder.options] with `options.orElse(null)`. */
@@ -251,7 +261,7 @@ private constructor(
251261
)
252262
}
253263

254-
@JvmSynthetic internal fun _body(): Body = body
264+
fun _body(): Body = body
255265

256266
override fun _headers(): Headers = additionalHeaders
257267

finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ private constructor(
8787
hrisPayStatementRetrieveManyParams.additionalQueryParams.toBuilder()
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+
* - [requests]
96+
*/
97+
fun body(body: Body) = apply { this.body = body.toBuilder() }
98+
9099
/** The array of batch requests. */
91100
fun requests(requests: List<Request>) = apply { body.requests(requests) }
92101

@@ -243,7 +252,7 @@ private constructor(
243252
)
244253
}
245254

246-
@JvmSynthetic internal fun _body(): Body = body
255+
fun _body(): Body = body
247256

248257
override fun _headers(): Headers = additionalHeaders
249258

0 commit comments

Comments
 (0)