Skip to content

Commit 74dbb8f

Browse files
committed
fixed build errors
1 parent 316c18a commit 74dbb8f

311 files changed

Lines changed: 6474 additions & 3726 deletions

File tree

Some content is hidden

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

sdks/java-v1/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@
334334
<artifactId>jersey-apache-connector</artifactId>
335335
<version>${jersey-version}</version>
336336
</dependency>
337+
337338
<!-- test dependencies -->
338339
<dependency>
339340
<groupId>org.junit.jupiter</groupId>
@@ -355,6 +356,7 @@
355356
<jackson-databind-version>2.17.1</jackson-databind-version>
356357
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
357358
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
359+
<beanvalidation-version>2.0.2</beanvalidation-version>
358360
<junit-version>5.10.0</junit-version>
359361
<spotless.version>2.21.0</spotless.version>
360362
<mockito.version>3.12.4</mockito.version>

sdks/java-v1/src/main/java/com/dropbox/sign/ApiClient.java

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -751,31 +751,11 @@ public Entity<?> serialize(
751751
if (contentType.startsWith("multipart/form-data")) {
752752
MultiPart multiPart = new MultiPart();
753753
for (Entry<String, Object> param : formParams.entrySet()) {
754-
if (param.getValue() instanceof File) {
755-
File file = (File) param.getValue();
756-
FormDataContentDisposition contentDisp =
757-
FormDataContentDisposition.name(param.getKey())
758-
.fileName(file.getName())
759-
.size(file.length())
760-
.build();
761-
762-
// Attempt to probe the content type for the file so that the form part is more
763-
// correctly
764-
// and precisely identified, but fall back to application/octet-stream if that
765-
// fails.
766-
MediaType type;
767-
try {
768-
type = MediaType.valueOf(Files.probeContentType(file.toPath()));
769-
} catch (IOException | IllegalArgumentException e) {
770-
type = MediaType.APPLICATION_OCTET_STREAM_TYPE;
771-
}
772-
773-
multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, type));
754+
if (param.getValue() instanceof Iterable<?>) {
755+
((Iterable<?>) param.getValue())
756+
.forEach(v -> addParamToMultipart(v, param.getKey(), multiPart));
774757
} else {
775-
FormDataContentDisposition contentDisp =
776-
FormDataContentDisposition.name(param.getKey()).build();
777-
multiPart.bodyPart(
778-
new FormDataBodyPart(contentDisp, parameterToString(param.getValue())));
758+
addParamToMultipart(param.getValue(), param.getKey(), multiPart);
779759
}
780760
}
781761
entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE);
@@ -826,6 +806,40 @@ public Entity<?> serialize(
826806
return entity;
827807
}
828808

809+
/**
810+
* Adds the object with the provided key to the MultiPart. Based on the object type sets
811+
* Content-Disposition and Content-Type.
812+
*
813+
* @param obj Object
814+
* @param key Key of the object
815+
* @param multiPart MultiPart to add the form param to
816+
*/
817+
private void addParamToMultipart(Object value, String key, MultiPart multiPart) {
818+
if (value instanceof File) {
819+
File file = (File) value;
820+
FormDataContentDisposition contentDisp =
821+
FormDataContentDisposition.name(key)
822+
.fileName(file.getName())
823+
.size(file.length())
824+
.build();
825+
826+
// Attempt to probe the content type for the file so that the form part is more
827+
// correctly
828+
// and precisely identified, but fall back to application/octet-stream if that fails.
829+
MediaType type;
830+
try {
831+
type = MediaType.valueOf(Files.probeContentType(file.toPath()));
832+
} catch (IOException | IllegalArgumentException e) {
833+
type = MediaType.APPLICATION_OCTET_STREAM_TYPE;
834+
}
835+
836+
multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, type));
837+
} else {
838+
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(key).build();
839+
multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(value)));
840+
}
841+
}
842+
829843
/**
830844
* Serialize the given Java object into string according the given Content-Type (only JSON, HTTP
831845
* form is supported for now).
@@ -1136,7 +1150,11 @@ private Response sendRequest(
11361150
} else if ("PUT".equals(method)) {
11371151
response = invocationBuilder.put(entity);
11381152
} else if ("DELETE".equals(method)) {
1139-
response = invocationBuilder.method("DELETE", entity);
1153+
if ("".equals(entity.getEntity())) {
1154+
response = invocationBuilder.method("DELETE");
1155+
} else {
1156+
response = invocationBuilder.method("DELETE", entity);
1157+
}
11401158
} else if ("PATCH".equals(method)) {
11411159
response = invocationBuilder.method("PATCH", entity);
11421160
} else {

sdks/java-v1/src/main/java/com/dropbox/sign/Configuration.java

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@
1212

1313
package com.dropbox.sign;
1414

15+
import java.util.Objects;
16+
import java.util.concurrent.atomic.AtomicReference;
17+
import java.util.function.Supplier;
18+
1519
@javax.annotation.Generated(
1620
value = "org.openapitools.codegen.languages.JavaClientCodegen",
1721
comments = "Generator version: 7.8.0")
1822
public class Configuration {
1923
public static final String VERSION = "1.8-dev";
2024

21-
private static ApiClient defaultApiClient = new ApiClient();
25+
private static final AtomicReference<ApiClient> defaultApiClient = new AtomicReference<>();
26+
private static volatile Supplier<ApiClient> apiClientFactory = ApiClient::new;
2227

2328
/**
2429
* Get the default API client, which would be used when creating API instances without providing
@@ -27,7 +32,18 @@ public class Configuration {
2732
* @return Default API client
2833
*/
2934
public static ApiClient getDefaultApiClient() {
30-
return defaultApiClient;
35+
ApiClient client = defaultApiClient.get();
36+
if (client == null) {
37+
client =
38+
defaultApiClient.updateAndGet(
39+
val -> {
40+
if (val != null) { // changed by another thread
41+
return val;
42+
}
43+
return apiClientFactory.get();
44+
});
45+
}
46+
return client;
3147
}
3248

3349
/**
@@ -37,6 +53,13 @@ public static ApiClient getDefaultApiClient() {
3753
* @param apiClient API client
3854
*/
3955
public static void setDefaultApiClient(ApiClient apiClient) {
40-
defaultApiClient = apiClient;
56+
defaultApiClient.set(apiClient);
57+
}
58+
59+
/** set the callback used to create new ApiClient objects */
60+
public static void setApiClientFactory(Supplier<ApiClient> factory) {
61+
apiClientFactory = Objects.requireNonNull(factory);
4162
}
63+
64+
private Configuration() {}
4265
}

sdks/java-v1/src/main/java/com/dropbox/sign/api/AccountApi.java

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public void setApiClient(ApiClient apiClient) {
5858
* @return AccountCreateResponse
5959
* @throws ApiException if fails to make API call
6060
* @http.response.details
61-
* <table summary="Response Details" border="1">
61+
* <table border="1">
62+
* <caption>Response Details</caption>
6263
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
6364
* <tr><td> 200 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
6465
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>
@@ -77,7 +78,8 @@ public AccountCreateResponse accountCreate(AccountCreateRequest accountCreateReq
7778
* @return ApiResponse&lt;AccountCreateResponse&gt;
7879
* @throws ApiException if fails to make API call
7980
* @http.response.details
80-
* <table summary="Response Details" border="1">
81+
* <table border="1">
82+
* <caption>Response Details</caption>
8183
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
8284
* <tr><td> 200 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
8385
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>
@@ -131,7 +133,8 @@ public ApiResponse<AccountCreateResponse> accountCreateWithHttpInfo(
131133
* @return AccountGetResponse
132134
* @throws ApiException if fails to make API call
133135
* @http.response.details
134-
* <table summary="Response Details" border="1">
136+
* <table border="1">
137+
* <caption>Response Details</caption>
135138
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
136139
* <tr><td> 200 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
137140
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>
@@ -191,7 +194,8 @@ public ApiResponse<AccountGetResponse> accountGetWithHttpInfo(String accountId)
191194
* @return ApiResponse&lt;AccountGetResponse&gt;
192195
* @throws ApiException if fails to make API call
193196
* @http.response.details
194-
* <table summary="Response Details" border="1">
197+
* <table border="1">
198+
* <caption>Response Details</caption>
195199
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
196200
* <tr><td> 200 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
197201
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>
@@ -238,7 +242,8 @@ public ApiResponse<AccountGetResponse> accountGetWithHttpInfo(
238242
* @return AccountGetResponse
239243
* @throws ApiException if fails to make API call
240244
* @http.response.details
241-
* <table summary="Response Details" border="1">
245+
* <table border="1">
246+
* <caption>Response Details</caption>
242247
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
243248
* <tr><td> 200 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
244249
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>
@@ -257,7 +262,8 @@ public AccountGetResponse accountUpdate(AccountUpdateRequest accountUpdateReques
257262
* @return ApiResponse&lt;AccountGetResponse&gt;
258263
* @throws ApiException if fails to make API call
259264
* @http.response.details
260-
* <table summary="Response Details" border="1">
265+
* <table border="1">
266+
* <caption>Response Details</caption>
261267
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
262268
* <tr><td> 200 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
263269
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>
@@ -308,7 +314,8 @@ public ApiResponse<AccountGetResponse> accountUpdateWithHttpInfo(
308314
* @return AccountVerifyResponse
309315
* @throws ApiException if fails to make API call
310316
* @http.response.details
311-
* <table summary="Response Details" border="1">
317+
* <table border="1">
318+
* <caption>Response Details</caption>
312319
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
313320
* <tr><td> 200 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
314321
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>
@@ -326,7 +333,8 @@ public AccountVerifyResponse accountVerify(AccountVerifyRequest accountVerifyReq
326333
* @return ApiResponse&lt;AccountVerifyResponse&gt;
327334
* @throws ApiException if fails to make API call
328335
* @http.response.details
329-
* <table summary="Response Details" border="1">
336+
* <table border="1">
337+
* <caption>Response Details</caption>
330338
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
331339
* <tr><td> 200 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
332340
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>

sdks/java-v1/src/main/java/com/dropbox/sign/api/ApiAppApi.java

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public void setApiClient(ApiClient apiClient) {
5555
* @return ApiAppGetResponse
5656
* @throws ApiException if fails to make API call
5757
* @http.response.details
58-
* <table summary="Response Details" border="1">
58+
* <table border="1">
59+
* <caption>Response Details</caption>
5960
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
6061
* <tr><td> 201 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
6162
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>
@@ -73,7 +74,8 @@ public ApiAppGetResponse apiAppCreate(ApiAppCreateRequest apiAppCreateRequest)
7374
* @return ApiResponse&lt;ApiAppGetResponse&gt;
7475
* @throws ApiException if fails to make API call
7576
* @http.response.details
76-
* <table summary="Response Details" border="1">
77+
* <table border="1">
78+
* <caption>Response Details</caption>
7779
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
7880
* <tr><td> 201 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
7981
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>
@@ -123,7 +125,8 @@ public ApiResponse<ApiAppGetResponse> apiAppCreateWithHttpInfo(
123125
* @param clientId The client id of the API App to delete. (required)
124126
* @throws ApiException if fails to make API call
125127
* @http.response.details
126-
* <table summary="Response Details" border="1">
128+
* <table border="1">
129+
* <caption>Response Details</caption>
127130
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
128131
* <tr><td> 204 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
129132
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>
@@ -140,7 +143,8 @@ public void apiAppDelete(String clientId) throws ApiException {
140143
* @return ApiResponse&lt;Void&gt;
141144
* @throws ApiException if fails to make API call
142145
* @http.response.details
143-
* <table summary="Response Details" border="1">
146+
* <table border="1">
147+
* <caption>Response Details</caption>
144148
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
145149
* <tr><td> 204 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
146150
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>
@@ -189,7 +193,8 @@ public ApiResponse<Void> apiAppDeleteWithHttpInfo(String clientId) throws ApiExc
189193
* @return ApiAppGetResponse
190194
* @throws ApiException if fails to make API call
191195
* @http.response.details
192-
* <table summary="Response Details" border="1">
196+
* <table border="1">
197+
* <caption>Response Details</caption>
193198
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
194199
* <tr><td> 200 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
195200
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>
@@ -206,7 +211,8 @@ public ApiAppGetResponse apiAppGet(String clientId) throws ApiException {
206211
* @return ApiResponse&lt;ApiAppGetResponse&gt;
207212
* @throws ApiException if fails to make API call
208213
* @http.response.details
209-
* <table summary="Response Details" border="1">
214+
* <table border="1">
215+
* <caption>Response Details</caption>
210216
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
211217
* <tr><td> 200 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
212218
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>
@@ -261,7 +267,8 @@ public ApiResponse<ApiAppGetResponse> apiAppGetWithHttpInfo(String clientId)
261267
* @return ApiAppListResponse
262268
* @throws ApiException if fails to make API call
263269
* @http.response.details
264-
* <table summary="Response Details" border="1">
270+
* <table border="1">
271+
* <caption>Response Details</caption>
265272
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
266273
* <tr><td> 200 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
267274
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>
@@ -321,7 +328,8 @@ public ApiResponse<ApiAppListResponse> apiAppListWithHttpInfo(Integer page)
321328
* @return ApiResponse&lt;ApiAppListResponse&gt;
322329
* @throws ApiException if fails to make API call
323330
* @http.response.details
324-
* <table summary="Response Details" border="1">
331+
* <table border="1">
332+
* <caption>Response Details</caption>
325333
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
326334
* <tr><td> 200 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
327335
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>
@@ -376,7 +384,8 @@ public ApiResponse<ApiAppListResponse> apiAppListWithHttpInfo(Integer page, Inte
376384
* @return ApiAppGetResponse
377385
* @throws ApiException if fails to make API call
378386
* @http.response.details
379-
* <table summary="Response Details" border="1">
387+
* <table border="1">
388+
* <caption>Response Details</caption>
380389
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
381390
* <tr><td> 200 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
382391
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>
@@ -397,7 +406,8 @@ public ApiAppGetResponse apiAppUpdate(String clientId, ApiAppUpdateRequest apiAp
397406
* @return ApiResponse&lt;ApiAppGetResponse&gt;
398407
* @throws ApiException if fails to make API call
399408
* @http.response.details
400-
* <table summary="Response Details" border="1">
409+
* <table border="1">
410+
* <caption>Response Details</caption>
401411
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
402412
* <tr><td> 200 </td><td> successful operation </td><td> * X-RateLimit-Limit - <br> * X-RateLimit-Remaining - <br> * X-Ratelimit-Reset - <br> </td></tr>
403413
* <tr><td> 4XX </td><td> failed_operation </td><td> - </td></tr>

0 commit comments

Comments
 (0)