Skip to content

Commit c3bafb7

Browse files
feat: regenerate API client from OpenAPI spec
1 parent a85e912 commit c3bafb7

66 files changed

Lines changed: 3555 additions & 1597 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.

‎src/main/java/com/getconvoy/api/OnboardApi.java‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
import com.getconvoy.models.BulkOnboard200Response;
2222
import com.getconvoy.models.BulkOnboard202Response;
23-
import java.io.File;
2423
import com.getconvoy.models.GetProjects400Response;
24+
import com.getconvoy.models.ModelsBulkOnboardRequest;
2525

2626
import com.fasterxml.jackson.core.type.TypeReference;
2727
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -170,26 +170,26 @@ private File prepareDownloadFile(HttpResponse<InputStream> response) throws IOEx
170170
* This endpoint accepts a CSV file or JSON body to bulk-create endpoints with subscriptions
171171
* @param projectID Project ID (required)
172172
* @param dryRun Validate without creating (optional)
173-
* @param body Onboard Details (JSON) (optional)
173+
* @param modelsBulkOnboardRequest Onboard Details (JSON) (optional)
174174
* @return BulkOnboard200Response
175175
* @throws ApiException if fails to make API call
176176
*/
177-
public BulkOnboard200Response bulkOnboard(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable File body) throws ApiException {
178-
return bulkOnboard(projectID, dryRun, body, null);
177+
public BulkOnboard200Response bulkOnboard(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable ModelsBulkOnboardRequest modelsBulkOnboardRequest) throws ApiException {
178+
return bulkOnboard(projectID, dryRun, modelsBulkOnboardRequest, null);
179179
}
180180

181181
/**
182182
* Bulk onboard endpoints with subscriptions
183183
* This endpoint accepts a CSV file or JSON body to bulk-create endpoints with subscriptions
184184
* @param projectID Project ID (required)
185185
* @param dryRun Validate without creating (optional)
186-
* @param body Onboard Details (JSON) (optional)
186+
* @param modelsBulkOnboardRequest Onboard Details (JSON) (optional)
187187
* @param headers Optional headers to include in the request
188188
* @return BulkOnboard200Response
189189
* @throws ApiException if fails to make API call
190190
*/
191-
public BulkOnboard200Response bulkOnboard(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable File body, Map<String, String> headers) throws ApiException {
192-
ApiResponse<BulkOnboard200Response> localVarResponse = bulkOnboardWithHttpInfo(projectID, dryRun, body, headers);
191+
public BulkOnboard200Response bulkOnboard(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable ModelsBulkOnboardRequest modelsBulkOnboardRequest, Map<String, String> headers) throws ApiException {
192+
ApiResponse<BulkOnboard200Response> localVarResponse = bulkOnboardWithHttpInfo(projectID, dryRun, modelsBulkOnboardRequest, headers);
193193
return localVarResponse.getData();
194194
}
195195

@@ -198,26 +198,26 @@ public BulkOnboard200Response bulkOnboard(@jakarta.annotation.Nonnull String pro
198198
* This endpoint accepts a CSV file or JSON body to bulk-create endpoints with subscriptions
199199
* @param projectID Project ID (required)
200200
* @param dryRun Validate without creating (optional)
201-
* @param body Onboard Details (JSON) (optional)
201+
* @param modelsBulkOnboardRequest Onboard Details (JSON) (optional)
202202
* @return ApiResponse&lt;BulkOnboard200Response&gt;
203203
* @throws ApiException if fails to make API call
204204
*/
205-
public ApiResponse<BulkOnboard200Response> bulkOnboardWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable File body) throws ApiException {
206-
return bulkOnboardWithHttpInfo(projectID, dryRun, body, null);
205+
public ApiResponse<BulkOnboard200Response> bulkOnboardWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable ModelsBulkOnboardRequest modelsBulkOnboardRequest) throws ApiException {
206+
return bulkOnboardWithHttpInfo(projectID, dryRun, modelsBulkOnboardRequest, null);
207207
}
208208

209209
/**
210210
* Bulk onboard endpoints with subscriptions
211211
* This endpoint accepts a CSV file or JSON body to bulk-create endpoints with subscriptions
212212
* @param projectID Project ID (required)
213213
* @param dryRun Validate without creating (optional)
214-
* @param body Onboard Details (JSON) (optional)
214+
* @param modelsBulkOnboardRequest Onboard Details (JSON) (optional)
215215
* @param headers Optional headers to include in the request
216216
* @return ApiResponse&lt;BulkOnboard200Response&gt;
217217
* @throws ApiException if fails to make API call
218218
*/
219-
public ApiResponse<BulkOnboard200Response> bulkOnboardWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable File body, Map<String, String> headers) throws ApiException {
220-
HttpRequest.Builder localVarRequestBuilder = bulkOnboardRequestBuilder(projectID, dryRun, body, headers);
219+
public ApiResponse<BulkOnboard200Response> bulkOnboardWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable ModelsBulkOnboardRequest modelsBulkOnboardRequest, Map<String, String> headers) throws ApiException {
220+
HttpRequest.Builder localVarRequestBuilder = bulkOnboardRequestBuilder(projectID, dryRun, modelsBulkOnboardRequest, headers);
221221
try {
222222
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
223223
localVarRequestBuilder.build(),
@@ -264,7 +264,7 @@ public ApiResponse<BulkOnboard200Response> bulkOnboardWithHttpInfo(@jakarta.anno
264264
}
265265
}
266266

267-
private HttpRequest.Builder bulkOnboardRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable File body, Map<String, String> headers) throws ApiException {
267+
private HttpRequest.Builder bulkOnboardRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable ModelsBulkOnboardRequest modelsBulkOnboardRequest, Map<String, String> headers) throws ApiException {
268268
// verify the required parameter 'projectID' is set
269269
if (projectID == null) {
270270
throw new ApiException(400, "Missing the required parameter 'projectID' when calling bulkOnboard");
@@ -292,11 +292,11 @@ private HttpRequest.Builder bulkOnboardRequestBuilder(@jakarta.annotation.Nonnul
292292
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
293293
}
294294

295-
localVarRequestBuilder.header("Content-Type", "application/octet-stream");
295+
localVarRequestBuilder.header("Content-Type", "application/json");
296296
localVarRequestBuilder.header("Accept", "application/json");
297297

298298
try {
299-
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
299+
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsBulkOnboardRequest);
300300
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
301301
} catch (IOException e) {
302302
throw new ApiException(e);

‎src/main/java/com/getconvoy/models/AuthRoleType.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ public enum AuthRoleType {
5858
/**
5959
*
6060
*/
61-
RoleAPI("api");
61+
RoleAPI("api"),
62+
63+
EMPTY("");
6264

6365
private String value;
6466

‎src/main/java/com/getconvoy/models/ConfigRequestIDHeaderProvider.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
*/
3131
public enum ConfigRequestIDHeaderProvider {
3232

33-
DefaultRequestIDHeader("X-Convoy-Idempotency-Key");
33+
DefaultRequestIDHeader("X-Convoy-Idempotency-Key"),
34+
35+
EMPTY("");
3436

3537
private String value;
3638

‎src/main/java/com/getconvoy/models/ConfigSignatureHeaderProvider.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
*/
3131
public enum ConfigSignatureHeaderProvider {
3232

33-
DefaultSignatureHeader("X-Convoy-Signature");
33+
DefaultSignatureHeader("X-Convoy-Signature"),
34+
35+
EMPTY("");
3436

3537
private String value;
3638

‎src/main/java/com/getconvoy/models/DatastoreAPIKeyResponse.java‎

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
import com.fasterxml.jackson.annotation.JsonValue;
2727
import com.getconvoy.models.DatastoreRole;
2828
import java.util.Arrays;
29+
import org.openapitools.jackson.nullable.JsonNullable;
30+
import com.fasterxml.jackson.annotation.JsonIgnore;
31+
import org.openapitools.jackson.nullable.JsonNullable;
32+
import java.util.NoSuchElementException;
2933
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
3034

3135

@@ -50,8 +54,7 @@ public class DatastoreAPIKeyResponse {
5054
private String createdAt;
5155

5256
public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at";
53-
@jakarta.annotation.Nullable
54-
private String expiresAt;
57+
private JsonNullable<String> expiresAt = JsonNullable.<String>undefined();
5558

5659
public static final String JSON_PROPERTY_KEY = "key";
5760
@jakarta.annotation.Nullable
@@ -105,7 +108,7 @@ public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) {
105108

106109

107110
public DatastoreAPIKeyResponse expiresAt(@jakarta.annotation.Nullable String expiresAt) {
108-
this.expiresAt = expiresAt;
111+
this.expiresAt = JsonNullable.<String>of(expiresAt);
109112
return this;
110113
}
111114

@@ -114,19 +117,27 @@ public DatastoreAPIKeyResponse expiresAt(@jakarta.annotation.Nullable String exp
114117
* @return expiresAt
115118
*/
116119
@jakarta.annotation.Nullable
117-
@JsonProperty(value = JSON_PROPERTY_EXPIRES_AT, required = false)
118-
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
120+
@JsonIgnore
119121
public String getExpiresAt() {
120-
return expiresAt;
122+
return expiresAt.orElse(null);
121123
}
122124

123-
124125
@JsonProperty(value = JSON_PROPERTY_EXPIRES_AT, required = false)
125126
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
126-
public void setExpiresAt(@jakarta.annotation.Nullable String expiresAt) {
127+
128+
public JsonNullable<String> getExpiresAt_JsonNullable() {
129+
return expiresAt;
130+
}
131+
132+
@JsonProperty(JSON_PROPERTY_EXPIRES_AT)
133+
public void setExpiresAt_JsonNullable(JsonNullable<String> expiresAt) {
127134
this.expiresAt = expiresAt;
128135
}
129136

137+
public void setExpiresAt(@jakarta.annotation.Nullable String expiresAt) {
138+
this.expiresAt = JsonNullable.<String>of(expiresAt);
139+
}
140+
130141

131142
public DatastoreAPIKeyResponse key(@jakarta.annotation.Nullable String key) {
132143
this.key = key;
@@ -285,7 +296,7 @@ public boolean equals(Object o) {
285296
}
286297
DatastoreAPIKeyResponse datastoreAPIKeyResponse = (DatastoreAPIKeyResponse) o;
287298
return Objects.equals(this.createdAt, datastoreAPIKeyResponse.createdAt) &&
288-
Objects.equals(this.expiresAt, datastoreAPIKeyResponse.expiresAt) &&
299+
equalsNullable(this.expiresAt, datastoreAPIKeyResponse.expiresAt) &&
289300
Objects.equals(this.key, datastoreAPIKeyResponse.key) &&
290301
Objects.equals(this.keyType, datastoreAPIKeyResponse.keyType) &&
291302
Objects.equals(this.name, datastoreAPIKeyResponse.name) &&
@@ -294,9 +305,20 @@ public boolean equals(Object o) {
294305
Objects.equals(this.userId, datastoreAPIKeyResponse.userId);
295306
}
296307

308+
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
309+
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
310+
}
311+
297312
@Override
298313
public int hashCode() {
299-
return Objects.hash(createdAt, expiresAt, key, keyType, name, role, uid, userId);
314+
return Objects.hash(createdAt, hashCodeNullable(expiresAt), key, keyType, name, role, uid, userId);
315+
}
316+
317+
private static <T> int hashCodeNullable(JsonNullable<T> a) {
318+
if (a == null) {
319+
return 1;
320+
}
321+
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
300322
}
301323

302324
@Override

0 commit comments

Comments
 (0)