Skip to content

Commit 2988157

Browse files
fix(client): remove @MustBeClosed for future returning methods
1 parent a507f84 commit 2988157

29 files changed

+0
-411
lines changed

openai-java-core/src/main/kotlin/com/openai/services/async/BatchServiceAsync.kt

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
package com.openai.services.async
44

5-
import com.google.errorprone.annotations.MustBeClosed
65
import com.openai.core.RequestOptions
76
import com.openai.core.http.HttpResponseFor
87
import com.openai.models.batches.Batch
@@ -123,12 +122,10 @@ interface BatchServiceAsync {
123122
* Returns a raw HTTP response for `post /batches`, but is otherwise the same as
124123
* [BatchServiceAsync.create].
125124
*/
126-
@MustBeClosed
127125
fun create(params: BatchCreateParams): CompletableFuture<HttpResponseFor<Batch>> =
128126
create(params, RequestOptions.none())
129127

130128
/** @see [create] */
131-
@MustBeClosed
132129
fun create(
133130
params: BatchCreateParams,
134131
requestOptions: RequestOptions = RequestOptions.none(),
@@ -138,12 +135,10 @@ interface BatchServiceAsync {
138135
* Returns a raw HTTP response for `get /batches/{batch_id}`, but is otherwise the same as
139136
* [BatchServiceAsync.retrieve].
140137
*/
141-
@MustBeClosed
142138
fun retrieve(batchId: String): CompletableFuture<HttpResponseFor<Batch>> =
143139
retrieve(batchId, BatchRetrieveParams.none())
144140

145141
/** @see [retrieve] */
146-
@MustBeClosed
147142
fun retrieve(
148143
batchId: String,
149144
params: BatchRetrieveParams = BatchRetrieveParams.none(),
@@ -152,27 +147,23 @@ interface BatchServiceAsync {
152147
retrieve(params.toBuilder().batchId(batchId).build(), requestOptions)
153148

154149
/** @see [retrieve] */
155-
@MustBeClosed
156150
fun retrieve(
157151
batchId: String,
158152
params: BatchRetrieveParams = BatchRetrieveParams.none(),
159153
): CompletableFuture<HttpResponseFor<Batch>> =
160154
retrieve(batchId, params, RequestOptions.none())
161155

162156
/** @see [retrieve] */
163-
@MustBeClosed
164157
fun retrieve(
165158
params: BatchRetrieveParams,
166159
requestOptions: RequestOptions = RequestOptions.none(),
167160
): CompletableFuture<HttpResponseFor<Batch>>
168161

169162
/** @see [retrieve] */
170-
@MustBeClosed
171163
fun retrieve(params: BatchRetrieveParams): CompletableFuture<HttpResponseFor<Batch>> =
172164
retrieve(params, RequestOptions.none())
173165

174166
/** @see [retrieve] */
175-
@MustBeClosed
176167
fun retrieve(
177168
batchId: String,
178169
requestOptions: RequestOptions,
@@ -183,26 +174,22 @@ interface BatchServiceAsync {
183174
* Returns a raw HTTP response for `get /batches`, but is otherwise the same as
184175
* [BatchServiceAsync.list].
185176
*/
186-
@MustBeClosed
187177
fun list(): CompletableFuture<HttpResponseFor<BatchListPageAsync>> =
188178
list(BatchListParams.none())
189179

190180
/** @see [list] */
191-
@MustBeClosed
192181
fun list(
193182
params: BatchListParams = BatchListParams.none(),
194183
requestOptions: RequestOptions = RequestOptions.none(),
195184
): CompletableFuture<HttpResponseFor<BatchListPageAsync>>
196185

197186
/** @see [list] */
198-
@MustBeClosed
199187
fun list(
200188
params: BatchListParams = BatchListParams.none()
201189
): CompletableFuture<HttpResponseFor<BatchListPageAsync>> =
202190
list(params, RequestOptions.none())
203191

204192
/** @see [list] */
205-
@MustBeClosed
206193
fun list(
207194
requestOptions: RequestOptions
208195
): CompletableFuture<HttpResponseFor<BatchListPageAsync>> =
@@ -212,12 +199,10 @@ interface BatchServiceAsync {
212199
* Returns a raw HTTP response for `post /batches/{batch_id}/cancel`, but is otherwise the
213200
* same as [BatchServiceAsync.cancel].
214201
*/
215-
@MustBeClosed
216202
fun cancel(batchId: String): CompletableFuture<HttpResponseFor<Batch>> =
217203
cancel(batchId, BatchCancelParams.none())
218204

219205
/** @see [cancel] */
220-
@MustBeClosed
221206
fun cancel(
222207
batchId: String,
223208
params: BatchCancelParams = BatchCancelParams.none(),
@@ -226,27 +211,23 @@ interface BatchServiceAsync {
226211
cancel(params.toBuilder().batchId(batchId).build(), requestOptions)
227212

228213
/** @see [cancel] */
229-
@MustBeClosed
230214
fun cancel(
231215
batchId: String,
232216
params: BatchCancelParams = BatchCancelParams.none(),
233217
): CompletableFuture<HttpResponseFor<Batch>> =
234218
cancel(batchId, params, RequestOptions.none())
235219

236220
/** @see [cancel] */
237-
@MustBeClosed
238221
fun cancel(
239222
params: BatchCancelParams,
240223
requestOptions: RequestOptions = RequestOptions.none(),
241224
): CompletableFuture<HttpResponseFor<Batch>>
242225

243226
/** @see [cancel] */
244-
@MustBeClosed
245227
fun cancel(params: BatchCancelParams): CompletableFuture<HttpResponseFor<Batch>> =
246228
cancel(params, RequestOptions.none())
247229

248230
/** @see [cancel] */
249-
@MustBeClosed
250231
fun cancel(
251232
batchId: String,
252233
requestOptions: RequestOptions,

openai-java-core/src/main/kotlin/com/openai/services/async/CompletionServiceAsync.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ interface CompletionServiceAsync {
4848
* Returns a raw HTTP response for `post /completions`, but is otherwise the same as
4949
* [CompletionServiceAsync.create].
5050
*/
51-
@MustBeClosed
5251
fun create(params: CompletionCreateParams): CompletableFuture<HttpResponseFor<Completion>> =
5352
create(params, RequestOptions.none())
5453

5554
/** @see [create] */
56-
@MustBeClosed
5755
fun create(
5856
params: CompletionCreateParams,
5957
requestOptions: RequestOptions = RequestOptions.none(),

openai-java-core/src/main/kotlin/com/openai/services/async/ContainerServiceAsync.kt

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
package com.openai.services.async
44

5-
import com.google.errorprone.annotations.MustBeClosed
65
import com.openai.core.RequestOptions
76
import com.openai.core.http.HttpResponse
87
import com.openai.core.http.HttpResponseFor
@@ -132,14 +131,12 @@ interface ContainerServiceAsync {
132131
* Returns a raw HTTP response for `post /containers`, but is otherwise the same as
133132
* [ContainerServiceAsync.create].
134133
*/
135-
@MustBeClosed
136134
fun create(
137135
params: ContainerCreateParams
138136
): CompletableFuture<HttpResponseFor<ContainerCreateResponse>> =
139137
create(params, RequestOptions.none())
140138

141139
/** @see [create] */
142-
@MustBeClosed
143140
fun create(
144141
params: ContainerCreateParams,
145142
requestOptions: RequestOptions = RequestOptions.none(),
@@ -149,14 +146,12 @@ interface ContainerServiceAsync {
149146
* Returns a raw HTTP response for `get /containers/{container_id}`, but is otherwise the
150147
* same as [ContainerServiceAsync.retrieve].
151148
*/
152-
@MustBeClosed
153149
fun retrieve(
154150
containerId: String
155151
): CompletableFuture<HttpResponseFor<ContainerRetrieveResponse>> =
156152
retrieve(containerId, ContainerRetrieveParams.none())
157153

158154
/** @see [retrieve] */
159-
@MustBeClosed
160155
fun retrieve(
161156
containerId: String,
162157
params: ContainerRetrieveParams = ContainerRetrieveParams.none(),
@@ -165,29 +160,25 @@ interface ContainerServiceAsync {
165160
retrieve(params.toBuilder().containerId(containerId).build(), requestOptions)
166161

167162
/** @see [retrieve] */
168-
@MustBeClosed
169163
fun retrieve(
170164
containerId: String,
171165
params: ContainerRetrieveParams = ContainerRetrieveParams.none(),
172166
): CompletableFuture<HttpResponseFor<ContainerRetrieveResponse>> =
173167
retrieve(containerId, params, RequestOptions.none())
174168

175169
/** @see [retrieve] */
176-
@MustBeClosed
177170
fun retrieve(
178171
params: ContainerRetrieveParams,
179172
requestOptions: RequestOptions = RequestOptions.none(),
180173
): CompletableFuture<HttpResponseFor<ContainerRetrieveResponse>>
181174

182175
/** @see [retrieve] */
183-
@MustBeClosed
184176
fun retrieve(
185177
params: ContainerRetrieveParams
186178
): CompletableFuture<HttpResponseFor<ContainerRetrieveResponse>> =
187179
retrieve(params, RequestOptions.none())
188180

189181
/** @see [retrieve] */
190-
@MustBeClosed
191182
fun retrieve(
192183
containerId: String,
193184
requestOptions: RequestOptions,
@@ -198,26 +189,22 @@ interface ContainerServiceAsync {
198189
* Returns a raw HTTP response for `get /containers`, but is otherwise the same as
199190
* [ContainerServiceAsync.list].
200191
*/
201-
@MustBeClosed
202192
fun list(): CompletableFuture<HttpResponseFor<ContainerListPageAsync>> =
203193
list(ContainerListParams.none())
204194

205195
/** @see [list] */
206-
@MustBeClosed
207196
fun list(
208197
params: ContainerListParams = ContainerListParams.none(),
209198
requestOptions: RequestOptions = RequestOptions.none(),
210199
): CompletableFuture<HttpResponseFor<ContainerListPageAsync>>
211200

212201
/** @see [list] */
213-
@MustBeClosed
214202
fun list(
215203
params: ContainerListParams = ContainerListParams.none()
216204
): CompletableFuture<HttpResponseFor<ContainerListPageAsync>> =
217205
list(params, RequestOptions.none())
218206

219207
/** @see [list] */
220-
@MustBeClosed
221208
fun list(
222209
requestOptions: RequestOptions
223210
): CompletableFuture<HttpResponseFor<ContainerListPageAsync>> =
@@ -227,12 +214,10 @@ interface ContainerServiceAsync {
227214
* Returns a raw HTTP response for `delete /containers/{container_id}`, but is otherwise the
228215
* same as [ContainerServiceAsync.delete].
229216
*/
230-
@MustBeClosed
231217
fun delete(containerId: String): CompletableFuture<HttpResponse> =
232218
delete(containerId, ContainerDeleteParams.none())
233219

234220
/** @see [delete] */
235-
@MustBeClosed
236221
fun delete(
237222
containerId: String,
238223
params: ContainerDeleteParams = ContainerDeleteParams.none(),
@@ -241,26 +226,22 @@ interface ContainerServiceAsync {
241226
delete(params.toBuilder().containerId(containerId).build(), requestOptions)
242227

243228
/** @see [delete] */
244-
@MustBeClosed
245229
fun delete(
246230
containerId: String,
247231
params: ContainerDeleteParams = ContainerDeleteParams.none(),
248232
): CompletableFuture<HttpResponse> = delete(containerId, params, RequestOptions.none())
249233

250234
/** @see [delete] */
251-
@MustBeClosed
252235
fun delete(
253236
params: ContainerDeleteParams,
254237
requestOptions: RequestOptions = RequestOptions.none(),
255238
): CompletableFuture<HttpResponse>
256239

257240
/** @see [delete] */
258-
@MustBeClosed
259241
fun delete(params: ContainerDeleteParams): CompletableFuture<HttpResponse> =
260242
delete(params, RequestOptions.none())
261243

262244
/** @see [delete] */
263-
@MustBeClosed
264245
fun delete(
265246
containerId: String,
266247
requestOptions: RequestOptions,

openai-java-core/src/main/kotlin/com/openai/services/async/EmbeddingServiceAsync.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
package com.openai.services.async
44

5-
import com.google.errorprone.annotations.MustBeClosed
65
import com.openai.core.RequestOptions
76
import com.openai.core.http.HttpResponseFor
87
import com.openai.models.embeddings.CreateEmbeddingResponse
@@ -35,14 +34,12 @@ interface EmbeddingServiceAsync {
3534
* Returns a raw HTTP response for `post /embeddings`, but is otherwise the same as
3635
* [EmbeddingServiceAsync.create].
3736
*/
38-
@MustBeClosed
3937
fun create(
4038
params: EmbeddingCreateParams
4139
): CompletableFuture<HttpResponseFor<CreateEmbeddingResponse>> =
4240
create(params, RequestOptions.none())
4341

4442
/** @see [create] */
45-
@MustBeClosed
4643
fun create(
4744
params: EmbeddingCreateParams,
4845
requestOptions: RequestOptions = RequestOptions.none(),

0 commit comments

Comments
 (0)