|
| 1 | +package so.trophy.src.main.java.resources.admin.applicationapikeys; |
| 2 | + |
| 3 | +/** |
| 4 | + * This file was auto-generated by Fern from our API Definition. |
| 5 | + */ |
| 6 | + |
| 7 | + |
| 8 | +import so.trophy.core.ClientOptions; |
| 9 | +import so.trophy.core.RequestOptions; |
| 10 | +import java.util.List; |
| 11 | +import java.util.concurrent.CompletableFuture; |
| 12 | +import so.trophy.resources.admin.applicationapikeys.requests.ApplicationApiKeysDeleteRequest; |
| 13 | +import so.trophy.types.CreateApplicationKeyRequestItem; |
| 14 | +import so.trophy.types.CreateApplicationKeysResponse; |
| 15 | +import so.trophy.types.DeleteApplicationKeysResponse; |
| 16 | + |
| 17 | +public class AsyncApplicationApiKeysClient { |
| 18 | + protected final ClientOptions clientOptions; |
| 19 | + |
| 20 | + private final AsyncRawApplicationApiKeysClient rawClient; |
| 21 | + |
| 22 | + public AsyncApplicationApiKeysClient(ClientOptions clientOptions) { |
| 23 | + this.clientOptions = clientOptions; |
| 24 | + this.rawClient = new AsyncRawApplicationApiKeysClient(clientOptions); |
| 25 | + } |
| 26 | + |
| 27 | + /** |
| 28 | + * Get responses with HTTP metadata like headers |
| 29 | + */ |
| 30 | + public AsyncRawApplicationApiKeysClient withRawResponse() { |
| 31 | + return this.rawClient; |
| 32 | + } |
| 33 | + |
| 34 | + /** |
| 35 | + * Create application API keys scoped to specific users. Each key can only perform operations on behalf of the user it was created for. |
| 36 | + */ |
| 37 | + public CompletableFuture<CreateApplicationKeysResponse> create( |
| 38 | + List<CreateApplicationKeyRequestItem> request) { |
| 39 | + return this.rawClient.create(request).thenApply(response -> response.body()); |
| 40 | + } |
| 41 | + |
| 42 | + /** |
| 43 | + * Create application API keys scoped to specific users. Each key can only perform operations on behalf of the user it was created for. |
| 44 | + */ |
| 45 | + public CompletableFuture<CreateApplicationKeysResponse> create( |
| 46 | + List<CreateApplicationKeyRequestItem> request, RequestOptions requestOptions) { |
| 47 | + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); |
| 48 | + } |
| 49 | + |
| 50 | + /** |
| 51 | + * Delete application API keys by ID. |
| 52 | + */ |
| 53 | + public CompletableFuture<DeleteApplicationKeysResponse> delete() { |
| 54 | + return this.rawClient.delete().thenApply(response -> response.body()); |
| 55 | + } |
| 56 | + |
| 57 | + /** |
| 58 | + * Delete application API keys by ID. |
| 59 | + */ |
| 60 | + public CompletableFuture<DeleteApplicationKeysResponse> delete(RequestOptions requestOptions) { |
| 61 | + return this.rawClient.delete(requestOptions).thenApply(response -> response.body()); |
| 62 | + } |
| 63 | + |
| 64 | + /** |
| 65 | + * Delete application API keys by ID. |
| 66 | + */ |
| 67 | + public CompletableFuture<DeleteApplicationKeysResponse> delete( |
| 68 | + ApplicationApiKeysDeleteRequest request) { |
| 69 | + return this.rawClient.delete(request).thenApply(response -> response.body()); |
| 70 | + } |
| 71 | + |
| 72 | + /** |
| 73 | + * Delete application API keys by ID. |
| 74 | + */ |
| 75 | + public CompletableFuture<DeleteApplicationKeysResponse> delete( |
| 76 | + ApplicationApiKeysDeleteRequest request, RequestOptions requestOptions) { |
| 77 | + return this.rawClient.delete(request, requestOptions).thenApply(response -> response.body()); |
| 78 | + } |
| 79 | +} |
0 commit comments