diff --git a/.github/workflows/sdk_generation.yaml b/.github/workflows/sdk_generation.yaml new file mode 100644 index 0000000..61a5fd3 --- /dev/null +++ b/.github/workflows/sdk_generation.yaml @@ -0,0 +1,123 @@ +name: SDK Generation + +# Generator: OpenAPI Generator (java, native library) via scripts/generate.sh. +# +# Keeps the same workflow filename and dispatch inputs as the other SDK repos +# (convoy.js, convoy-python) so the frain-dev/convoy dispatcher +# (speakeasy-sdk.yml) works unchanged. + +on: + workflow_dispatch: + inputs: + force: + # Accepted for dispatcher compatibility. Generation is deterministic + # from the spec, so there is nothing to force: no diff means no PR. + description: Accepted for compatibility; regeneration is always run + required: false + default: "false" + type: string + feature_branch: + description: Branch for SDK changes + required: false + type: string + schedule: + - cron: "0 6 * * 1" + +# Serialize generations: overlapping cron/dispatch runs race on the same +# branch/PR. Queue instead of cancel so a triggered regen is never dropped. +concurrency: + group: sdk-generation + cancel-in-progress: false + +permissions: + contents: write + pull-requests: write + +jobs: + generate: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 + with: + # Regen branches are always derived from main: the spec is pulled + # from convoy main, so a dispatch from another ref must not silently + # commit generated output onto that ref's base. + ref: main + # Prefer a PAT: PRs opened with GITHUB_TOKEN do not trigger + # pull_request workflows, so verify CI would never run on them. + token: ${{ secrets.SDK_BOT_PAT || secrets.GITHUB_TOKEN }} + + - name: Setup Java + uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0 + with: + distribution: temurin + java-version: "17" + + - name: Regenerate client + run: ./scripts/generate.sh + + - name: Compile and test regenerated client + # Never open a PR for a client that does not compile or breaks the + # verify tests. PR CI (ci.yml) re-proves this on the PR itself. + run: ./gradlew test + + - name: Detect changes + id: diff + run: | + if git diff --quiet && [ -z "$(git status --porcelain)" ]; then + echo "changed=false" >> "$GITHUB_OUTPUT" + echo "No client changes; skipping PR." >> "$GITHUB_STEP_SUMMARY" + else + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Prepare feature branch + if: steps.diff.outputs.changed == 'true' + id: branch + env: + # Never interpolate free-form dispatch inputs into run: directly. + FEATURE_BRANCH_INPUT: ${{ inputs.feature_branch }} + run: | + if [ -n "$FEATURE_BRANCH_INPUT" ]; then + # SDK PRs must come from a reviewable feature branch, never a + # protected ref or an option-looking / metacharacter name. + # refs/* is blocked too: "refs/heads/main" would bypass the + # literal main check and force-push the default branch. + case "$FEATURE_BRANCH_INPUT" in + main|master|release/*|refs/*|-*|*[!a-zA-Z0-9._/-]*) + echo "::error::Invalid feature_branch '$FEATURE_BRANCH_INPUT'" + exit 1 + ;; + esac + echo "name=$FEATURE_BRANCH_INPUT" >> "$GITHUB_OUTPUT" + else + echo "name=sdk-regen-$(date -u +%Y%m%d)" >> "$GITHUB_OUTPUT" + fi + + - name: Push branch and open PR + if: steps.diff.outputs.changed == 'true' + env: + GH_TOKEN: ${{ secrets.SDK_BOT_PAT || secrets.GITHUB_TOKEN }} + BRANCH: ${{ steps.branch.outputs.name }} + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + git checkout -B "$BRANCH" + git add -A + git commit -m "feat: regenerate API client from OpenAPI spec" + # Force push is safe: the regen branch is fully derived from main + # plus this deterministic generation; any previous content is stale. + git push --force origin "$BRANCH" + + existing=$(gh pr list --head "$BRANCH" --state open --json number --jq '.[0].number // empty') + if [ -z "$existing" ]; then + gh pr create \ + --head "$BRANCH" \ + --title "feat: regenerate API client from OpenAPI spec" \ + --body "Automated regeneration via OpenAPI Generator (java/native) from \`docs/v3/openapi3.yaml\` on frain-dev/convoy main. Hand-written webhook verify (\`src/main/java/com/getconvoy/webhook/\`) is untouched by the sync script." + echo "Opened PR for $BRANCH" >> "$GITHUB_STEP_SUMMARY" + else + echo "Updated existing PR #$existing" >> "$GITHUB_STEP_SUMMARY" + fi diff --git a/.gitignore b/.gitignore index 91e1398..7f7f2c3 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ bin/ local.properties *.gpg *.asc +.cache/ diff --git a/README.md b/README.md index 3bd2c17..0af0a9b 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ # Convoy Java SDK -Official Convoy SDK for Java. - -> Status: this initial release provides **webhook signature verification**. The -> generated API client will follow once the OpenAPI spec covers the full API -> surface. +Official Convoy SDK for Java: **webhook signature verification** (hand-written) +and an **API client** generated from Convoy's OpenAPI spec via +[OpenAPI Generator](https://openapi-generator.tech/) (java, `native` library — +JDK `java.net.http`, Jackson). ## Install @@ -12,7 +11,7 @@ Gradle (Kotlin DSL): ```kotlin dependencies { - implementation("com.getconvoy:convoy:0.1.0") + implementation("com.getconvoy:convoy:0.2.0") } ``` @@ -22,10 +21,32 @@ Maven: com.getconvoy convoy - 0.1.0 + 0.2.0 ``` +## Use the API client + +```java +import com.getconvoy.api.EventsApi; +import com.getconvoy.client.ApiClient; +import com.getconvoy.models.ModelsCreateEvent; + +import java.util.Map; + +ApiClient client = new ApiClient(); +// Default base URI is https://us.getconvoy.cloud/api; point elsewhere for +// EU cloud or self-hosted instances. +client.updateBaseUri("https://us.getconvoy.cloud/api"); +client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + apiKey)); + +EventsApi events = new EventsApi(client); +events.createEndpointEvent("project-id", new ModelsCreateEvent() + .endpointId("endpoint-id") + .eventType("invoice.paid") + .data(Map.of("amount", 100, "currency", "USD"))); +``` + ## Verify webhook signatures Verify with the raw request body, before parsing it. `verify` returns `true` @@ -64,6 +85,20 @@ new Webhook("endpoint-secret", "SHA512", "base64", 300); Tests verify against `signature-vectors.json`, a shared cross-SDK vector set generated from the server signing code so every Convoy SDK verifies identically. +### Regenerating the API client + +The client (`com.getconvoy.api`, `com.getconvoy.client`, `com.getconvoy.models`) +is generated; do not edit it by hand. The hand-written verify package +(`com.getconvoy.webhook`) is never touched by generation. + +CI on `frain-dev/convoy` dispatches `sdk_generation.yaml` when OpenAPI +artifacts change. Locally: + +```bash +./scripts/generate.sh # requires java 17+, curl, rsync +./gradlew test +``` + ## License [MIT](LICENSE) diff --git a/build.gradle.kts b/build.gradle.kts index 45e3606..fcef0a8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,8 +5,8 @@ plugins { } group = "com.getconvoy" -version = "0.1.0" -description = "Convoy SDK for Java. Currently provides webhook signature verification." +version = "0.2.0" +description = "Convoy SDK for Java: webhook signature verification and an OpenAPI-generated API client." repositories { mavenCentral() @@ -21,6 +21,16 @@ java { } dependencies { + // Generated API client (com.getconvoy.{api,client,models}); versions must + // match what OpenAPI Generator (pinned in scripts/generate.sh) targets. + implementation("com.google.code.findbugs:jsr305:3.0.2") + implementation("com.fasterxml.jackson.core:jackson-core:2.21.1") + implementation("com.fasterxml.jackson.core:jackson-annotations:2.21") + implementation("com.fasterxml.jackson.core:jackson-databind:2.21.1") + implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.1") + implementation("org.openapitools:jackson-databind-nullable:0.2.10") + implementation("jakarta.annotation:jakarta.annotation-api:2.1.1") + testImplementation(platform("org.junit:junit-bom:5.11.3")) testImplementation("org.junit.jupiter:junit-jupiter") testImplementation("com.google.code.gson:gson:2.11.0") diff --git a/scripts/generate.sh b/scripts/generate.sh new file mode 100755 index 0000000..811c9a1 --- /dev/null +++ b/scripts/generate.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Regenerate the API client from Convoy's OpenAPI spec with OpenAPI Generator +# (java, native library), then sync it into src/main/java/com/getconvoy/ +# without touching the hand-written webhook verify package. +# +# Requires: java 17+, rsync, curl. Run from the repo root. + +SPEC_URL="${SPEC_URL:-https://raw.githubusercontent.com/frain-dev/convoy/main/docs/v3/openapi3.yaml}" +# Pin so regeneration output is reproducible; bump deliberately. +GENERATOR_VERSION="7.23.0" +GENERATOR_JAR="${GENERATOR_JAR:-.cache/openapi-generator-cli-${GENERATOR_VERSION}.jar}" + +tmp="$(mktemp -d)" +trap 'rm -rf "$tmp"' EXIT + +if [ ! -f "$GENERATOR_JAR" ]; then + mkdir -p "$(dirname "$GENERATOR_JAR")" + curl -fsSL -o "$GENERATOR_JAR" \ + "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/${GENERATOR_VERSION}/openapi-generator-cli-${GENERATOR_VERSION}.jar" +fi + +curl -fsSL "$SPEC_URL" -o "$tmp/openapi3.yaml" + +# hideGenerationTimestamp: @Generated annotations must not embed a wall-clock +# date or every regeneration diffs all 200+ files and "no diff, no PR" breaks. +java -jar "$GENERATOR_JAR" generate \ + -i "$tmp/openapi3.yaml" \ + -g java \ + --library native \ + -o "$tmp/gen" \ + --additional-properties=groupId=com.getconvoy,artifactId=convoy,apiPackage=com.getconvoy.api,modelPackage=com.getconvoy.models,invokerPackage=com.getconvoy.client,useJakartaEe=true,hideGenerationTimestamp=true + +# Mirror only the three generated packages. The hand-written verify package +# (com/getconvoy/webhook) is a sibling and is never created or removed here. +# --delete keeps each generated package an exact mirror of generator output. +for pkg in api client models; do + rsync -a --delete "$tmp/gen/src/main/java/com/getconvoy/$pkg/" \ + "src/main/java/com/getconvoy/$pkg/" +done + +echo "Generated client synced into src/main/java/com/getconvoy/{api,client,models}" diff --git a/src/main/java/com/getconvoy/api/DeliveryAttemptsApi.java b/src/main/java/com/getconvoy/api/DeliveryAttemptsApi.java new file mode 100644 index 0000000..4de50f6 --- /dev/null +++ b/src/main/java/com/getconvoy/api/DeliveryAttemptsApi.java @@ -0,0 +1,430 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.getconvoy.api; + +import com.getconvoy.client.ApiClient; +import com.getconvoy.client.ApiException; +import com.getconvoy.client.ApiResponse; +import com.getconvoy.client.Configuration; +import com.getconvoy.client.Pair; + +import com.getconvoy.models.GetDeliveryAttempt200Response; +import com.getconvoy.models.GetDeliveryAttempts200Response; +import com.getconvoy.models.GetProjects400Response; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DeliveryAttemptsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public DeliveryAttemptsApi() { + this(Configuration.getDefaultApiClient()); + } + + public DeliveryAttemptsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Retrieve a delivery attempt + * This endpoint fetches an app event delivery attempt + * @param projectID Project ID (required) + * @param eventDeliveryID event delivery id (required) + * @param deliveryAttemptID delivery attempt id (required) + * @return GetDeliveryAttempt200Response + * @throws ApiException if fails to make API call + */ + public GetDeliveryAttempt200Response getDeliveryAttempt(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, @jakarta.annotation.Nonnull String deliveryAttemptID) throws ApiException { + return getDeliveryAttempt(projectID, eventDeliveryID, deliveryAttemptID, null); + } + + /** + * Retrieve a delivery attempt + * This endpoint fetches an app event delivery attempt + * @param projectID Project ID (required) + * @param eventDeliveryID event delivery id (required) + * @param deliveryAttemptID delivery attempt id (required) + * @param headers Optional headers to include in the request + * @return GetDeliveryAttempt200Response + * @throws ApiException if fails to make API call + */ + public GetDeliveryAttempt200Response getDeliveryAttempt(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, @jakarta.annotation.Nonnull String deliveryAttemptID, Map headers) throws ApiException { + ApiResponse localVarResponse = getDeliveryAttemptWithHttpInfo(projectID, eventDeliveryID, deliveryAttemptID, headers); + return localVarResponse.getData(); + } + + /** + * Retrieve a delivery attempt + * This endpoint fetches an app event delivery attempt + * @param projectID Project ID (required) + * @param eventDeliveryID event delivery id (required) + * @param deliveryAttemptID delivery attempt id (required) + * @return ApiResponse<GetDeliveryAttempt200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDeliveryAttemptWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, @jakarta.annotation.Nonnull String deliveryAttemptID) throws ApiException { + return getDeliveryAttemptWithHttpInfo(projectID, eventDeliveryID, deliveryAttemptID, null); + } + + /** + * Retrieve a delivery attempt + * This endpoint fetches an app event delivery attempt + * @param projectID Project ID (required) + * @param eventDeliveryID event delivery id (required) + * @param deliveryAttemptID delivery attempt id (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetDeliveryAttempt200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDeliveryAttemptWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, @jakarta.annotation.Nonnull String deliveryAttemptID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDeliveryAttemptRequestBuilder(projectID, eventDeliveryID, deliveryAttemptID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getDeliveryAttempt", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetDeliveryAttempt200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDeliveryAttemptRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, @jakarta.annotation.Nonnull String deliveryAttemptID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getDeliveryAttempt"); + } + // verify the required parameter 'eventDeliveryID' is set + if (eventDeliveryID == null) { + throw new ApiException(400, "Missing the required parameter 'eventDeliveryID' when calling getDeliveryAttempt"); + } + // verify the required parameter 'deliveryAttemptID' is set + if (deliveryAttemptID == null) { + throw new ApiException(400, "Missing the required parameter 'deliveryAttemptID' when calling getDeliveryAttempt"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/eventdeliveries/{eventDeliveryID}/deliveryattempts/{deliveryAttemptID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{eventDeliveryID}", ApiClient.urlEncode(eventDeliveryID.toString())) + .replace("{deliveryAttemptID}", ApiClient.urlEncode(deliveryAttemptID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List delivery attempts + * This endpoint fetches an app message's delivery attempts + * @param projectID Project ID (required) + * @param eventDeliveryID event delivery id (required) + * @return GetDeliveryAttempts200Response + * @throws ApiException if fails to make API call + */ + public GetDeliveryAttempts200Response getDeliveryAttempts(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID) throws ApiException { + return getDeliveryAttempts(projectID, eventDeliveryID, null); + } + + /** + * List delivery attempts + * This endpoint fetches an app message's delivery attempts + * @param projectID Project ID (required) + * @param eventDeliveryID event delivery id (required) + * @param headers Optional headers to include in the request + * @return GetDeliveryAttempts200Response + * @throws ApiException if fails to make API call + */ + public GetDeliveryAttempts200Response getDeliveryAttempts(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException { + ApiResponse localVarResponse = getDeliveryAttemptsWithHttpInfo(projectID, eventDeliveryID, headers); + return localVarResponse.getData(); + } + + /** + * List delivery attempts + * This endpoint fetches an app message's delivery attempts + * @param projectID Project ID (required) + * @param eventDeliveryID event delivery id (required) + * @return ApiResponse<GetDeliveryAttempts200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDeliveryAttemptsWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID) throws ApiException { + return getDeliveryAttemptsWithHttpInfo(projectID, eventDeliveryID, null); + } + + /** + * List delivery attempts + * This endpoint fetches an app message's delivery attempts + * @param projectID Project ID (required) + * @param eventDeliveryID event delivery id (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetDeliveryAttempts200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDeliveryAttemptsWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDeliveryAttemptsRequestBuilder(projectID, eventDeliveryID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getDeliveryAttempts", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetDeliveryAttempts200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDeliveryAttemptsRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getDeliveryAttempts"); + } + // verify the required parameter 'eventDeliveryID' is set + if (eventDeliveryID == null) { + throw new ApiException(400, "Missing the required parameter 'eventDeliveryID' when calling getDeliveryAttempts"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/eventdeliveries/{eventDeliveryID}/deliveryattempts" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{eventDeliveryID}", ApiClient.urlEncode(eventDeliveryID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/src/main/java/com/getconvoy/api/EndpointsApi.java b/src/main/java/com/getconvoy/api/EndpointsApi.java new file mode 100644 index 0000000..075b92a --- /dev/null +++ b/src/main/java/com/getconvoy/api/EndpointsApi.java @@ -0,0 +1,1399 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.getconvoy.api; + +import com.getconvoy.client.ApiClient; +import com.getconvoy.client.ApiException; +import com.getconvoy.client.ApiResponse; +import com.getconvoy.client.Configuration; +import com.getconvoy.client.Pair; + +import com.getconvoy.models.CreateEndpoint201Response; +import com.getconvoy.models.GetEndpoints200Response; +import com.getconvoy.models.GetProjects400Response; +import com.getconvoy.models.ModelsCreateEndpoint; +import com.getconvoy.models.ModelsExpireSecret; +import com.getconvoy.models.ModelsTestOAuth2Request; +import com.getconvoy.models.ModelsUpdateEndpoint; +import com.getconvoy.models.TestOAuth2Connection200Response; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class EndpointsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public EndpointsApi() { + this(Configuration.getDefaultApiClient()); + } + + public EndpointsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Activate endpoint + * Activated an inactive endpoint + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @return CreateEndpoint201Response + * @throws ApiException if fails to make API call + */ + public CreateEndpoint201Response activateEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID) throws ApiException { + return activateEndpoint(projectID, endpointID, null); + } + + /** + * Activate endpoint + * Activated an inactive endpoint + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @param headers Optional headers to include in the request + * @return CreateEndpoint201Response + * @throws ApiException if fails to make API call + */ + public CreateEndpoint201Response activateEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException { + ApiResponse localVarResponse = activateEndpointWithHttpInfo(projectID, endpointID, headers); + return localVarResponse.getData(); + } + + /** + * Activate endpoint + * Activated an inactive endpoint + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @return ApiResponse<CreateEndpoint201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse activateEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID) throws ApiException { + return activateEndpointWithHttpInfo(projectID, endpointID, null); + } + + /** + * Activate endpoint + * Activated an inactive endpoint + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateEndpoint201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse activateEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = activateEndpointRequestBuilder(projectID, endpointID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("activateEndpoint", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateEndpoint201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder activateEndpointRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling activateEndpoint"); + } + // verify the required parameter 'endpointID' is set + if (endpointID == null) { + throw new ApiException(400, "Missing the required parameter 'endpointID' when calling activateEndpoint"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/endpoints/{endpointID}/activate" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{endpointID}", ApiClient.urlEncode(endpointID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create an endpoint + * This endpoint creates an endpoint + * @param projectID Project ID (required) + * @param modelsCreateEndpoint Endpoint Details (required) + * @return CreateEndpoint201Response + * @throws ApiException if fails to make API call + */ + public CreateEndpoint201Response createEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEndpoint modelsCreateEndpoint) throws ApiException { + return createEndpoint(projectID, modelsCreateEndpoint, null); + } + + /** + * Create an endpoint + * This endpoint creates an endpoint + * @param projectID Project ID (required) + * @param modelsCreateEndpoint Endpoint Details (required) + * @param headers Optional headers to include in the request + * @return CreateEndpoint201Response + * @throws ApiException if fails to make API call + */ + public CreateEndpoint201Response createEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEndpoint modelsCreateEndpoint, Map headers) throws ApiException { + ApiResponse localVarResponse = createEndpointWithHttpInfo(projectID, modelsCreateEndpoint, headers); + return localVarResponse.getData(); + } + + /** + * Create an endpoint + * This endpoint creates an endpoint + * @param projectID Project ID (required) + * @param modelsCreateEndpoint Endpoint Details (required) + * @return ApiResponse<CreateEndpoint201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEndpoint modelsCreateEndpoint) throws ApiException { + return createEndpointWithHttpInfo(projectID, modelsCreateEndpoint, null); + } + + /** + * Create an endpoint + * This endpoint creates an endpoint + * @param projectID Project ID (required) + * @param modelsCreateEndpoint Endpoint Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateEndpoint201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEndpoint modelsCreateEndpoint, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createEndpointRequestBuilder(projectID, modelsCreateEndpoint, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createEndpoint", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateEndpoint201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createEndpointRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEndpoint modelsCreateEndpoint, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling createEndpoint"); + } + // verify the required parameter 'modelsCreateEndpoint' is set + if (modelsCreateEndpoint == null) { + throw new ApiException(400, "Missing the required parameter 'modelsCreateEndpoint' when calling createEndpoint"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/endpoints" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsCreateEndpoint); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete endpoint + * This endpoint deletes an endpoint + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response deleteEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID) throws ApiException { + return deleteEndpoint(projectID, endpointID, null); + } + + /** + * Delete endpoint + * This endpoint deletes an endpoint + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @param headers Optional headers to include in the request + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response deleteEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException { + ApiResponse localVarResponse = deleteEndpointWithHttpInfo(projectID, endpointID, headers); + return localVarResponse.getData(); + } + + /** + * Delete endpoint + * This endpoint deletes an endpoint + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID) throws ApiException { + return deleteEndpointWithHttpInfo(projectID, endpointID, null); + } + + /** + * Delete endpoint + * This endpoint deletes an endpoint + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteEndpointRequestBuilder(projectID, endpointID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("deleteEndpoint", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetProjects400Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteEndpointRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling deleteEndpoint"); + } + // verify the required parameter 'endpointID' is set + if (endpointID == null) { + throw new ApiException(400, "Missing the required parameter 'endpointID' when calling deleteEndpoint"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/endpoints/{endpointID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{endpointID}", ApiClient.urlEncode(endpointID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Roll endpoint secret + * This endpoint expires and re-generates the endpoint secret. + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @param modelsExpireSecret Expire Secret Body Parameters (required) + * @return CreateEndpoint201Response + * @throws ApiException if fails to make API call + */ + public CreateEndpoint201Response expireSecret(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsExpireSecret modelsExpireSecret) throws ApiException { + return expireSecret(projectID, endpointID, modelsExpireSecret, null); + } + + /** + * Roll endpoint secret + * This endpoint expires and re-generates the endpoint secret. + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @param modelsExpireSecret Expire Secret Body Parameters (required) + * @param headers Optional headers to include in the request + * @return CreateEndpoint201Response + * @throws ApiException if fails to make API call + */ + public CreateEndpoint201Response expireSecret(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsExpireSecret modelsExpireSecret, Map headers) throws ApiException { + ApiResponse localVarResponse = expireSecretWithHttpInfo(projectID, endpointID, modelsExpireSecret, headers); + return localVarResponse.getData(); + } + + /** + * Roll endpoint secret + * This endpoint expires and re-generates the endpoint secret. + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @param modelsExpireSecret Expire Secret Body Parameters (required) + * @return ApiResponse<CreateEndpoint201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse expireSecretWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsExpireSecret modelsExpireSecret) throws ApiException { + return expireSecretWithHttpInfo(projectID, endpointID, modelsExpireSecret, null); + } + + /** + * Roll endpoint secret + * This endpoint expires and re-generates the endpoint secret. + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @param modelsExpireSecret Expire Secret Body Parameters (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateEndpoint201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse expireSecretWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsExpireSecret modelsExpireSecret, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = expireSecretRequestBuilder(projectID, endpointID, modelsExpireSecret, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("expireSecret", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateEndpoint201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder expireSecretRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsExpireSecret modelsExpireSecret, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling expireSecret"); + } + // verify the required parameter 'endpointID' is set + if (endpointID == null) { + throw new ApiException(400, "Missing the required parameter 'endpointID' when calling expireSecret"); + } + // verify the required parameter 'modelsExpireSecret' is set + if (modelsExpireSecret == null) { + throw new ApiException(400, "Missing the required parameter 'modelsExpireSecret' when calling expireSecret"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/endpoints/{endpointID}/expire_secret" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{endpointID}", ApiClient.urlEncode(endpointID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsExpireSecret); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Retrieve endpoint + * This endpoint fetches an endpoint + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @return CreateEndpoint201Response + * @throws ApiException if fails to make API call + */ + public CreateEndpoint201Response getEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID) throws ApiException { + return getEndpoint(projectID, endpointID, null); + } + + /** + * Retrieve endpoint + * This endpoint fetches an endpoint + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @param headers Optional headers to include in the request + * @return CreateEndpoint201Response + * @throws ApiException if fails to make API call + */ + public CreateEndpoint201Response getEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException { + ApiResponse localVarResponse = getEndpointWithHttpInfo(projectID, endpointID, headers); + return localVarResponse.getData(); + } + + /** + * Retrieve endpoint + * This endpoint fetches an endpoint + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @return ApiResponse<CreateEndpoint201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID) throws ApiException { + return getEndpointWithHttpInfo(projectID, endpointID, null); + } + + /** + * Retrieve endpoint + * This endpoint fetches an endpoint + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateEndpoint201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getEndpointRequestBuilder(projectID, endpointID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getEndpoint", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateEndpoint201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getEndpointRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getEndpoint"); + } + // verify the required parameter 'endpointID' is set + if (endpointID == null) { + throw new ApiException(400, "Missing the required parameter 'endpointID' when calling getEndpoint"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/endpoints/{endpointID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{endpointID}", ApiClient.urlEncode(endpointID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List all endpoints + * This endpoint fetches an endpoints + * @param projectID Project ID (required) + * @param direction (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param ownerId The owner ID of the endpoint (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param q The name of the endpoint (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @return GetEndpoints200Response + * @throws ApiException if fails to make API call + */ + public GetEndpoints200Response getEndpoints(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable String ownerId, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String q, @jakarta.annotation.Nullable String sort) throws ApiException { + return getEndpoints(projectID, direction, nextPageCursor, ownerId, perPage, prevPageCursor, q, sort, null); + } + + /** + * List all endpoints + * This endpoint fetches an endpoints + * @param projectID Project ID (required) + * @param direction (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param ownerId The owner ID of the endpoint (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param q The name of the endpoint (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param headers Optional headers to include in the request + * @return GetEndpoints200Response + * @throws ApiException if fails to make API call + */ + public GetEndpoints200Response getEndpoints(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable String ownerId, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String q, @jakarta.annotation.Nullable String sort, Map headers) throws ApiException { + ApiResponse localVarResponse = getEndpointsWithHttpInfo(projectID, direction, nextPageCursor, ownerId, perPage, prevPageCursor, q, sort, headers); + return localVarResponse.getData(); + } + + /** + * List all endpoints + * This endpoint fetches an endpoints + * @param projectID Project ID (required) + * @param direction (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param ownerId The owner ID of the endpoint (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param q The name of the endpoint (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @return ApiResponse<GetEndpoints200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEndpointsWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable String ownerId, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String q, @jakarta.annotation.Nullable String sort) throws ApiException { + return getEndpointsWithHttpInfo(projectID, direction, nextPageCursor, ownerId, perPage, prevPageCursor, q, sort, null); + } + + /** + * List all endpoints + * This endpoint fetches an endpoints + * @param projectID Project ID (required) + * @param direction (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param ownerId The owner ID of the endpoint (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param q The name of the endpoint (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetEndpoints200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEndpointsWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable String ownerId, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String q, @jakarta.annotation.Nullable String sort, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getEndpointsRequestBuilder(projectID, direction, nextPageCursor, ownerId, perPage, prevPageCursor, q, sort, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getEndpoints", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetEndpoints200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getEndpointsRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable String ownerId, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String q, @jakarta.annotation.Nullable String sort, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getEndpoints"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/endpoints" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "direction"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("direction", direction)); + localVarQueryParameterBaseName = "next_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("next_page_cursor", nextPageCursor)); + localVarQueryParameterBaseName = "ownerId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("ownerId", ownerId)); + localVarQueryParameterBaseName = "perPage"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("perPage", perPage)); + localVarQueryParameterBaseName = "prev_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("prev_page_cursor", prevPageCursor)); + localVarQueryParameterBaseName = "q"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("q", q)); + localVarQueryParameterBaseName = "sort"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sort", sort)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Pause endpoint + * Toggles an endpoint's status between active and paused states + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @return CreateEndpoint201Response + * @throws ApiException if fails to make API call + */ + public CreateEndpoint201Response pauseEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID) throws ApiException { + return pauseEndpoint(projectID, endpointID, null); + } + + /** + * Pause endpoint + * Toggles an endpoint's status between active and paused states + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @param headers Optional headers to include in the request + * @return CreateEndpoint201Response + * @throws ApiException if fails to make API call + */ + public CreateEndpoint201Response pauseEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException { + ApiResponse localVarResponse = pauseEndpointWithHttpInfo(projectID, endpointID, headers); + return localVarResponse.getData(); + } + + /** + * Pause endpoint + * Toggles an endpoint's status between active and paused states + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @return ApiResponse<CreateEndpoint201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse pauseEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID) throws ApiException { + return pauseEndpointWithHttpInfo(projectID, endpointID, null); + } + + /** + * Pause endpoint + * Toggles an endpoint's status between active and paused states + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateEndpoint201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse pauseEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = pauseEndpointRequestBuilder(projectID, endpointID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("pauseEndpoint", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateEndpoint201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder pauseEndpointRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling pauseEndpoint"); + } + // verify the required parameter 'endpointID' is set + if (endpointID == null) { + throw new ApiException(400, "Missing the required parameter 'endpointID' when calling pauseEndpoint"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/endpoints/{endpointID}/pause" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{endpointID}", ApiClient.urlEncode(endpointID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Test OAuth2 connection + * This endpoint tests the OAuth2 connection by attempting to exchange a token + * @param projectID Project ID (required) + * @param modelsTestOAuth2Request OAuth2 Configuration (required) + * @return TestOAuth2Connection200Response + * @throws ApiException if fails to make API call + */ + public TestOAuth2Connection200Response testOAuth2Connection(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsTestOAuth2Request modelsTestOAuth2Request) throws ApiException { + return testOAuth2Connection(projectID, modelsTestOAuth2Request, null); + } + + /** + * Test OAuth2 connection + * This endpoint tests the OAuth2 connection by attempting to exchange a token + * @param projectID Project ID (required) + * @param modelsTestOAuth2Request OAuth2 Configuration (required) + * @param headers Optional headers to include in the request + * @return TestOAuth2Connection200Response + * @throws ApiException if fails to make API call + */ + public TestOAuth2Connection200Response testOAuth2Connection(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsTestOAuth2Request modelsTestOAuth2Request, Map headers) throws ApiException { + ApiResponse localVarResponse = testOAuth2ConnectionWithHttpInfo(projectID, modelsTestOAuth2Request, headers); + return localVarResponse.getData(); + } + + /** + * Test OAuth2 connection + * This endpoint tests the OAuth2 connection by attempting to exchange a token + * @param projectID Project ID (required) + * @param modelsTestOAuth2Request OAuth2 Configuration (required) + * @return ApiResponse<TestOAuth2Connection200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse testOAuth2ConnectionWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsTestOAuth2Request modelsTestOAuth2Request) throws ApiException { + return testOAuth2ConnectionWithHttpInfo(projectID, modelsTestOAuth2Request, null); + } + + /** + * Test OAuth2 connection + * This endpoint tests the OAuth2 connection by attempting to exchange a token + * @param projectID Project ID (required) + * @param modelsTestOAuth2Request OAuth2 Configuration (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<TestOAuth2Connection200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse testOAuth2ConnectionWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsTestOAuth2Request modelsTestOAuth2Request, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testOAuth2ConnectionRequestBuilder(projectID, modelsTestOAuth2Request, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testOAuth2Connection", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + TestOAuth2Connection200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testOAuth2ConnectionRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsTestOAuth2Request modelsTestOAuth2Request, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling testOAuth2Connection"); + } + // verify the required parameter 'modelsTestOAuth2Request' is set + if (modelsTestOAuth2Request == null) { + throw new ApiException(400, "Missing the required parameter 'modelsTestOAuth2Request' when calling testOAuth2Connection"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/endpoints/oauth2/test" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsTestOAuth2Request); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update an endpoint + * This endpoint updates an endpoint + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @param modelsUpdateEndpoint Endpoint Details (required) + * @return CreateEndpoint201Response + * @throws ApiException if fails to make API call + */ + public CreateEndpoint201Response updateEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsUpdateEndpoint modelsUpdateEndpoint) throws ApiException { + return updateEndpoint(projectID, endpointID, modelsUpdateEndpoint, null); + } + + /** + * Update an endpoint + * This endpoint updates an endpoint + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @param modelsUpdateEndpoint Endpoint Details (required) + * @param headers Optional headers to include in the request + * @return CreateEndpoint201Response + * @throws ApiException if fails to make API call + */ + public CreateEndpoint201Response updateEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsUpdateEndpoint modelsUpdateEndpoint, Map headers) throws ApiException { + ApiResponse localVarResponse = updateEndpointWithHttpInfo(projectID, endpointID, modelsUpdateEndpoint, headers); + return localVarResponse.getData(); + } + + /** + * Update an endpoint + * This endpoint updates an endpoint + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @param modelsUpdateEndpoint Endpoint Details (required) + * @return ApiResponse<CreateEndpoint201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsUpdateEndpoint modelsUpdateEndpoint) throws ApiException { + return updateEndpointWithHttpInfo(projectID, endpointID, modelsUpdateEndpoint, null); + } + + /** + * Update an endpoint + * This endpoint updates an endpoint + * @param projectID Project ID (required) + * @param endpointID Endpoint ID (required) + * @param modelsUpdateEndpoint Endpoint Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateEndpoint201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsUpdateEndpoint modelsUpdateEndpoint, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateEndpointRequestBuilder(projectID, endpointID, modelsUpdateEndpoint, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("updateEndpoint", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateEndpoint201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateEndpointRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsUpdateEndpoint modelsUpdateEndpoint, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling updateEndpoint"); + } + // verify the required parameter 'endpointID' is set + if (endpointID == null) { + throw new ApiException(400, "Missing the required parameter 'endpointID' when calling updateEndpoint"); + } + // verify the required parameter 'modelsUpdateEndpoint' is set + if (modelsUpdateEndpoint == null) { + throw new ApiException(400, "Missing the required parameter 'modelsUpdateEndpoint' when calling updateEndpoint"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/endpoints/{endpointID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{endpointID}", ApiClient.urlEncode(endpointID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsUpdateEndpoint); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/src/main/java/com/getconvoy/api/EventDeliveriesApi.java b/src/main/java/com/getconvoy/api/EventDeliveriesApi.java new file mode 100644 index 0000000..3be0be5 --- /dev/null +++ b/src/main/java/com/getconvoy/api/EventDeliveriesApi.java @@ -0,0 +1,972 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.getconvoy.api; + +import com.getconvoy.client.ApiClient; +import com.getconvoy.client.ApiException; +import com.getconvoy.client.ApiResponse; +import com.getconvoy.client.Configuration; +import com.getconvoy.client.Pair; + +import com.getconvoy.models.GetEventDeliveriesPaged200Response; +import com.getconvoy.models.GetEventDelivery200Response; +import com.getconvoy.models.GetProjects400Response; +import com.getconvoy.models.ModelsIDs; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class EventDeliveriesApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public EventDeliveriesApi() { + this(Configuration.getDefaultApiClient()); + } + + public EventDeliveriesApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Batch retry event delivery + * This endpoint batch retries multiple event deliveries at once. + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint IDs to filter by (optional) + * @param eventId Event ID to filter by (optional) + * @param eventType EventType to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param startDate The start date (optional) + * @param status A list of event delivery statuses to filter by (optional) + * @param subscriptionId SubscriptionID to filter by (optional) + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response batchRetryEventDelivery(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId) throws ApiException { + return batchRetryEventDelivery(projectID, direction, endDate, endpointId, eventId, eventType, idempotencyKey, nextPageCursor, perPage, prevPageCursor, sort, startDate, status, subscriptionId, null); + } + + /** + * Batch retry event delivery + * This endpoint batch retries multiple event deliveries at once. + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint IDs to filter by (optional) + * @param eventId Event ID to filter by (optional) + * @param eventType EventType to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param startDate The start date (optional) + * @param status A list of event delivery statuses to filter by (optional) + * @param subscriptionId SubscriptionID to filter by (optional) + * @param headers Optional headers to include in the request + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response batchRetryEventDelivery(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId, Map headers) throws ApiException { + ApiResponse localVarResponse = batchRetryEventDeliveryWithHttpInfo(projectID, direction, endDate, endpointId, eventId, eventType, idempotencyKey, nextPageCursor, perPage, prevPageCursor, sort, startDate, status, subscriptionId, headers); + return localVarResponse.getData(); + } + + /** + * Batch retry event delivery + * This endpoint batch retries multiple event deliveries at once. + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint IDs to filter by (optional) + * @param eventId Event ID to filter by (optional) + * @param eventType EventType to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param startDate The start date (optional) + * @param status A list of event delivery statuses to filter by (optional) + * @param subscriptionId SubscriptionID to filter by (optional) + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse batchRetryEventDeliveryWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId) throws ApiException { + return batchRetryEventDeliveryWithHttpInfo(projectID, direction, endDate, endpointId, eventId, eventType, idempotencyKey, nextPageCursor, perPage, prevPageCursor, sort, startDate, status, subscriptionId, null); + } + + /** + * Batch retry event delivery + * This endpoint batch retries multiple event deliveries at once. + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint IDs to filter by (optional) + * @param eventId Event ID to filter by (optional) + * @param eventType EventType to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param startDate The start date (optional) + * @param status A list of event delivery statuses to filter by (optional) + * @param subscriptionId SubscriptionID to filter by (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse batchRetryEventDeliveryWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = batchRetryEventDeliveryRequestBuilder(projectID, direction, endDate, endpointId, eventId, eventType, idempotencyKey, nextPageCursor, perPage, prevPageCursor, sort, startDate, status, subscriptionId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("batchRetryEventDelivery", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetProjects400Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder batchRetryEventDeliveryRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling batchRetryEventDelivery"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/eventdeliveries/batchretry" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "direction"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("direction", direction)); + localVarQueryParameterBaseName = "endDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("endDate", endDate)); + localVarQueryParameterBaseName = "endpointId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "endpointId", endpointId)); + localVarQueryParameterBaseName = "eventId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("eventId", eventId)); + localVarQueryParameterBaseName = "event_type"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("event_type", eventType)); + localVarQueryParameterBaseName = "idempotencyKey"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("idempotencyKey", idempotencyKey)); + localVarQueryParameterBaseName = "next_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("next_page_cursor", nextPageCursor)); + localVarQueryParameterBaseName = "perPage"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("perPage", perPage)); + localVarQueryParameterBaseName = "prev_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("prev_page_cursor", prevPageCursor)); + localVarQueryParameterBaseName = "sort"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sort", sort)); + localVarQueryParameterBaseName = "startDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startDate", startDate)); + localVarQueryParameterBaseName = "status"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "status", status)); + localVarQueryParameterBaseName = "subscriptionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subscriptionId", subscriptionId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Force retry event delivery + * This endpoint enables you retry a previously successful event delivery + * @param projectID Project ID (required) + * @param modelsIDs event delivery ids (required) + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response forceResendEventDeliveries(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsIDs modelsIDs) throws ApiException { + return forceResendEventDeliveries(projectID, modelsIDs, null); + } + + /** + * Force retry event delivery + * This endpoint enables you retry a previously successful event delivery + * @param projectID Project ID (required) + * @param modelsIDs event delivery ids (required) + * @param headers Optional headers to include in the request + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response forceResendEventDeliveries(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsIDs modelsIDs, Map headers) throws ApiException { + ApiResponse localVarResponse = forceResendEventDeliveriesWithHttpInfo(projectID, modelsIDs, headers); + return localVarResponse.getData(); + } + + /** + * Force retry event delivery + * This endpoint enables you retry a previously successful event delivery + * @param projectID Project ID (required) + * @param modelsIDs event delivery ids (required) + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse forceResendEventDeliveriesWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsIDs modelsIDs) throws ApiException { + return forceResendEventDeliveriesWithHttpInfo(projectID, modelsIDs, null); + } + + /** + * Force retry event delivery + * This endpoint enables you retry a previously successful event delivery + * @param projectID Project ID (required) + * @param modelsIDs event delivery ids (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse forceResendEventDeliveriesWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsIDs modelsIDs, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = forceResendEventDeliveriesRequestBuilder(projectID, modelsIDs, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("forceResendEventDeliveries", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetProjects400Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder forceResendEventDeliveriesRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsIDs modelsIDs, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling forceResendEventDeliveries"); + } + // verify the required parameter 'modelsIDs' is set + if (modelsIDs == null) { + throw new ApiException(400, "Missing the required parameter 'modelsIDs' when calling forceResendEventDeliveries"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/eventdeliveries/forceresend" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsIDs); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List all event deliveries + * This endpoint retrieves all event deliveries paginated. + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint IDs to filter by (optional) + * @param eventId Event ID to filter by (optional) + * @param eventType EventType to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param startDate The start date (optional) + * @param status A list of event delivery statuses to filter by (optional) + * @param subscriptionId SubscriptionID to filter by (optional) + * @return GetEventDeliveriesPaged200Response + * @throws ApiException if fails to make API call + */ + public GetEventDeliveriesPaged200Response getEventDeliveriesPaged(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId) throws ApiException { + return getEventDeliveriesPaged(projectID, direction, endDate, endpointId, eventId, eventType, idempotencyKey, nextPageCursor, perPage, prevPageCursor, sort, startDate, status, subscriptionId, null); + } + + /** + * List all event deliveries + * This endpoint retrieves all event deliveries paginated. + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint IDs to filter by (optional) + * @param eventId Event ID to filter by (optional) + * @param eventType EventType to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param startDate The start date (optional) + * @param status A list of event delivery statuses to filter by (optional) + * @param subscriptionId SubscriptionID to filter by (optional) + * @param headers Optional headers to include in the request + * @return GetEventDeliveriesPaged200Response + * @throws ApiException if fails to make API call + */ + public GetEventDeliveriesPaged200Response getEventDeliveriesPaged(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId, Map headers) throws ApiException { + ApiResponse localVarResponse = getEventDeliveriesPagedWithHttpInfo(projectID, direction, endDate, endpointId, eventId, eventType, idempotencyKey, nextPageCursor, perPage, prevPageCursor, sort, startDate, status, subscriptionId, headers); + return localVarResponse.getData(); + } + + /** + * List all event deliveries + * This endpoint retrieves all event deliveries paginated. + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint IDs to filter by (optional) + * @param eventId Event ID to filter by (optional) + * @param eventType EventType to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param startDate The start date (optional) + * @param status A list of event delivery statuses to filter by (optional) + * @param subscriptionId SubscriptionID to filter by (optional) + * @return ApiResponse<GetEventDeliveriesPaged200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEventDeliveriesPagedWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId) throws ApiException { + return getEventDeliveriesPagedWithHttpInfo(projectID, direction, endDate, endpointId, eventId, eventType, idempotencyKey, nextPageCursor, perPage, prevPageCursor, sort, startDate, status, subscriptionId, null); + } + + /** + * List all event deliveries + * This endpoint retrieves all event deliveries paginated. + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint IDs to filter by (optional) + * @param eventId Event ID to filter by (optional) + * @param eventType EventType to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param startDate The start date (optional) + * @param status A list of event delivery statuses to filter by (optional) + * @param subscriptionId SubscriptionID to filter by (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetEventDeliveriesPaged200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEventDeliveriesPagedWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getEventDeliveriesPagedRequestBuilder(projectID, direction, endDate, endpointId, eventId, eventType, idempotencyKey, nextPageCursor, perPage, prevPageCursor, sort, startDate, status, subscriptionId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getEventDeliveriesPaged", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetEventDeliveriesPaged200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getEventDeliveriesPagedRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getEventDeliveriesPaged"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/eventdeliveries" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "direction"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("direction", direction)); + localVarQueryParameterBaseName = "endDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("endDate", endDate)); + localVarQueryParameterBaseName = "endpointId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "endpointId", endpointId)); + localVarQueryParameterBaseName = "eventId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("eventId", eventId)); + localVarQueryParameterBaseName = "event_type"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("event_type", eventType)); + localVarQueryParameterBaseName = "idempotencyKey"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("idempotencyKey", idempotencyKey)); + localVarQueryParameterBaseName = "next_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("next_page_cursor", nextPageCursor)); + localVarQueryParameterBaseName = "perPage"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("perPage", perPage)); + localVarQueryParameterBaseName = "prev_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("prev_page_cursor", prevPageCursor)); + localVarQueryParameterBaseName = "sort"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sort", sort)); + localVarQueryParameterBaseName = "startDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startDate", startDate)); + localVarQueryParameterBaseName = "status"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "status", status)); + localVarQueryParameterBaseName = "subscriptionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subscriptionId", subscriptionId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Retrieve an event delivery + * This endpoint fetches an event delivery. + * @param projectID Project ID (required) + * @param eventDeliveryID event delivery id (required) + * @return GetEventDelivery200Response + * @throws ApiException if fails to make API call + */ + public GetEventDelivery200Response getEventDelivery(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID) throws ApiException { + return getEventDelivery(projectID, eventDeliveryID, null); + } + + /** + * Retrieve an event delivery + * This endpoint fetches an event delivery. + * @param projectID Project ID (required) + * @param eventDeliveryID event delivery id (required) + * @param headers Optional headers to include in the request + * @return GetEventDelivery200Response + * @throws ApiException if fails to make API call + */ + public GetEventDelivery200Response getEventDelivery(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException { + ApiResponse localVarResponse = getEventDeliveryWithHttpInfo(projectID, eventDeliveryID, headers); + return localVarResponse.getData(); + } + + /** + * Retrieve an event delivery + * This endpoint fetches an event delivery. + * @param projectID Project ID (required) + * @param eventDeliveryID event delivery id (required) + * @return ApiResponse<GetEventDelivery200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEventDeliveryWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID) throws ApiException { + return getEventDeliveryWithHttpInfo(projectID, eventDeliveryID, null); + } + + /** + * Retrieve an event delivery + * This endpoint fetches an event delivery. + * @param projectID Project ID (required) + * @param eventDeliveryID event delivery id (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetEventDelivery200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEventDeliveryWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getEventDeliveryRequestBuilder(projectID, eventDeliveryID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getEventDelivery", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetEventDelivery200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getEventDeliveryRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getEventDelivery"); + } + // verify the required parameter 'eventDeliveryID' is set + if (eventDeliveryID == null) { + throw new ApiException(400, "Missing the required parameter 'eventDeliveryID' when calling getEventDelivery"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/eventdeliveries/{eventDeliveryID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{eventDeliveryID}", ApiClient.urlEncode(eventDeliveryID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Retry event delivery + * This endpoint retries an event delivery. + * @param projectID Project ID (required) + * @param eventDeliveryID event delivery id (required) + * @return GetEventDelivery200Response + * @throws ApiException if fails to make API call + */ + public GetEventDelivery200Response resendEventDelivery(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID) throws ApiException { + return resendEventDelivery(projectID, eventDeliveryID, null); + } + + /** + * Retry event delivery + * This endpoint retries an event delivery. + * @param projectID Project ID (required) + * @param eventDeliveryID event delivery id (required) + * @param headers Optional headers to include in the request + * @return GetEventDelivery200Response + * @throws ApiException if fails to make API call + */ + public GetEventDelivery200Response resendEventDelivery(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException { + ApiResponse localVarResponse = resendEventDeliveryWithHttpInfo(projectID, eventDeliveryID, headers); + return localVarResponse.getData(); + } + + /** + * Retry event delivery + * This endpoint retries an event delivery. + * @param projectID Project ID (required) + * @param eventDeliveryID event delivery id (required) + * @return ApiResponse<GetEventDelivery200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse resendEventDeliveryWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID) throws ApiException { + return resendEventDeliveryWithHttpInfo(projectID, eventDeliveryID, null); + } + + /** + * Retry event delivery + * This endpoint retries an event delivery. + * @param projectID Project ID (required) + * @param eventDeliveryID event delivery id (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetEventDelivery200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse resendEventDeliveryWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = resendEventDeliveryRequestBuilder(projectID, eventDeliveryID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("resendEventDelivery", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetEventDelivery200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder resendEventDeliveryRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling resendEventDelivery"); + } + // verify the required parameter 'eventDeliveryID' is set + if (eventDeliveryID == null) { + throw new ApiException(400, "Missing the required parameter 'eventDeliveryID' when calling resendEventDelivery"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/eventdeliveries/{eventDeliveryID}/resend" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{eventDeliveryID}", ApiClient.urlEncode(eventDeliveryID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/src/main/java/com/getconvoy/api/EventTypesApi.java b/src/main/java/com/getconvoy/api/EventTypesApi.java new file mode 100644 index 0000000..ae1f5cc --- /dev/null +++ b/src/main/java/com/getconvoy/api/EventTypesApi.java @@ -0,0 +1,820 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.getconvoy.api; + +import com.getconvoy.client.ApiClient; +import com.getconvoy.client.ApiException; +import com.getconvoy.client.ApiResponse; +import com.getconvoy.client.Configuration; +import com.getconvoy.client.Pair; + +import com.getconvoy.models.CreateEventType201Response; +import com.getconvoy.models.GetEventTypes200Response; +import com.getconvoy.models.GetProjects400Response; +import com.getconvoy.models.ModelsCreateEventType; +import com.getconvoy.models.ModelsImportOpenAPISpec; +import com.getconvoy.models.ModelsUpdateEventType; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class EventTypesApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public EventTypesApi() { + this(Configuration.getDefaultApiClient()); + } + + public EventTypesApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Create an event type + * This endpoint creates an event type + * @param projectID Project ID (required) + * @param modelsCreateEventType Event Type Details (required) + * @return CreateEventType201Response + * @throws ApiException if fails to make API call + */ + public CreateEventType201Response createEventType(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEventType modelsCreateEventType) throws ApiException { + return createEventType(projectID, modelsCreateEventType, null); + } + + /** + * Create an event type + * This endpoint creates an event type + * @param projectID Project ID (required) + * @param modelsCreateEventType Event Type Details (required) + * @param headers Optional headers to include in the request + * @return CreateEventType201Response + * @throws ApiException if fails to make API call + */ + public CreateEventType201Response createEventType(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEventType modelsCreateEventType, Map headers) throws ApiException { + ApiResponse localVarResponse = createEventTypeWithHttpInfo(projectID, modelsCreateEventType, headers); + return localVarResponse.getData(); + } + + /** + * Create an event type + * This endpoint creates an event type + * @param projectID Project ID (required) + * @param modelsCreateEventType Event Type Details (required) + * @return ApiResponse<CreateEventType201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createEventTypeWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEventType modelsCreateEventType) throws ApiException { + return createEventTypeWithHttpInfo(projectID, modelsCreateEventType, null); + } + + /** + * Create an event type + * This endpoint creates an event type + * @param projectID Project ID (required) + * @param modelsCreateEventType Event Type Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateEventType201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createEventTypeWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEventType modelsCreateEventType, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createEventTypeRequestBuilder(projectID, modelsCreateEventType, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createEventType", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateEventType201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createEventTypeRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEventType modelsCreateEventType, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling createEventType"); + } + // verify the required parameter 'modelsCreateEventType' is set + if (modelsCreateEventType == null) { + throw new ApiException(400, "Missing the required parameter 'modelsCreateEventType' when calling createEventType"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/event-types" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsCreateEventType); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Deprecates an event type + * This endpoint deprecates an event type + * @param projectID Project ID (required) + * @param eventTypeId Event Type ID (required) + * @return CreateEventType201Response + * @throws ApiException if fails to make API call + */ + public CreateEventType201Response deprecateEventType(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventTypeId) throws ApiException { + return deprecateEventType(projectID, eventTypeId, null); + } + + /** + * Deprecates an event type + * This endpoint deprecates an event type + * @param projectID Project ID (required) + * @param eventTypeId Event Type ID (required) + * @param headers Optional headers to include in the request + * @return CreateEventType201Response + * @throws ApiException if fails to make API call + */ + public CreateEventType201Response deprecateEventType(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventTypeId, Map headers) throws ApiException { + ApiResponse localVarResponse = deprecateEventTypeWithHttpInfo(projectID, eventTypeId, headers); + return localVarResponse.getData(); + } + + /** + * Deprecates an event type + * This endpoint deprecates an event type + * @param projectID Project ID (required) + * @param eventTypeId Event Type ID (required) + * @return ApiResponse<CreateEventType201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse deprecateEventTypeWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventTypeId) throws ApiException { + return deprecateEventTypeWithHttpInfo(projectID, eventTypeId, null); + } + + /** + * Deprecates an event type + * This endpoint deprecates an event type + * @param projectID Project ID (required) + * @param eventTypeId Event Type ID (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateEventType201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse deprecateEventTypeWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventTypeId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deprecateEventTypeRequestBuilder(projectID, eventTypeId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("deprecateEventType", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateEventType201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deprecateEventTypeRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventTypeId, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling deprecateEventType"); + } + // verify the required parameter 'eventTypeId' is set + if (eventTypeId == null) { + throw new ApiException(400, "Missing the required parameter 'eventTypeId' when calling deprecateEventType"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/event-types/{eventTypeId}/deprecate" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{eventTypeId}", ApiClient.urlEncode(eventTypeId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Retrieves a project's event types + * This endpoint fetches the project's event types + * @param projectID Project ID (required) + * @return GetEventTypes200Response + * @throws ApiException if fails to make API call + */ + public GetEventTypes200Response getEventTypes(@jakarta.annotation.Nonnull String projectID) throws ApiException { + return getEventTypes(projectID, null); + } + + /** + * Retrieves a project's event types + * This endpoint fetches the project's event types + * @param projectID Project ID (required) + * @param headers Optional headers to include in the request + * @return GetEventTypes200Response + * @throws ApiException if fails to make API call + */ + public GetEventTypes200Response getEventTypes(@jakarta.annotation.Nonnull String projectID, Map headers) throws ApiException { + ApiResponse localVarResponse = getEventTypesWithHttpInfo(projectID, headers); + return localVarResponse.getData(); + } + + /** + * Retrieves a project's event types + * This endpoint fetches the project's event types + * @param projectID Project ID (required) + * @return ApiResponse<GetEventTypes200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEventTypesWithHttpInfo(@jakarta.annotation.Nonnull String projectID) throws ApiException { + return getEventTypesWithHttpInfo(projectID, null); + } + + /** + * Retrieves a project's event types + * This endpoint fetches the project's event types + * @param projectID Project ID (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetEventTypes200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEventTypesWithHttpInfo(@jakarta.annotation.Nonnull String projectID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getEventTypesRequestBuilder(projectID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getEventTypes", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetEventTypes200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getEventTypesRequestBuilder(@jakarta.annotation.Nonnull String projectID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getEventTypes"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/event-types" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Import event types from OpenAPI spec + * This endpoint imports event types from an OpenAPI specification + * @param projectID Project ID (required) + * @param modelsImportOpenAPISpec OpenAPI specification (required) + * @return GetEventTypes200Response + * @throws ApiException if fails to make API call + */ + public GetEventTypes200Response importOpenApiSpec(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsImportOpenAPISpec modelsImportOpenAPISpec) throws ApiException { + return importOpenApiSpec(projectID, modelsImportOpenAPISpec, null); + } + + /** + * Import event types from OpenAPI spec + * This endpoint imports event types from an OpenAPI specification + * @param projectID Project ID (required) + * @param modelsImportOpenAPISpec OpenAPI specification (required) + * @param headers Optional headers to include in the request + * @return GetEventTypes200Response + * @throws ApiException if fails to make API call + */ + public GetEventTypes200Response importOpenApiSpec(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsImportOpenAPISpec modelsImportOpenAPISpec, Map headers) throws ApiException { + ApiResponse localVarResponse = importOpenApiSpecWithHttpInfo(projectID, modelsImportOpenAPISpec, headers); + return localVarResponse.getData(); + } + + /** + * Import event types from OpenAPI spec + * This endpoint imports event types from an OpenAPI specification + * @param projectID Project ID (required) + * @param modelsImportOpenAPISpec OpenAPI specification (required) + * @return ApiResponse<GetEventTypes200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse importOpenApiSpecWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsImportOpenAPISpec modelsImportOpenAPISpec) throws ApiException { + return importOpenApiSpecWithHttpInfo(projectID, modelsImportOpenAPISpec, null); + } + + /** + * Import event types from OpenAPI spec + * This endpoint imports event types from an OpenAPI specification + * @param projectID Project ID (required) + * @param modelsImportOpenAPISpec OpenAPI specification (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetEventTypes200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse importOpenApiSpecWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsImportOpenAPISpec modelsImportOpenAPISpec, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = importOpenApiSpecRequestBuilder(projectID, modelsImportOpenAPISpec, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("importOpenApiSpec", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetEventTypes200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder importOpenApiSpecRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsImportOpenAPISpec modelsImportOpenAPISpec, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling importOpenApiSpec"); + } + // verify the required parameter 'modelsImportOpenAPISpec' is set + if (modelsImportOpenAPISpec == null) { + throw new ApiException(400, "Missing the required parameter 'modelsImportOpenAPISpec' when calling importOpenApiSpec"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/event-types/import" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsImportOpenAPISpec); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates an event type + * This endpoint updates an event type + * @param projectID Project ID (required) + * @param eventTypeId Event Type ID (required) + * @param modelsUpdateEventType Event Type Details (required) + * @return CreateEventType201Response + * @throws ApiException if fails to make API call + */ + public CreateEventType201Response updateEventType(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventTypeId, @jakarta.annotation.Nonnull ModelsUpdateEventType modelsUpdateEventType) throws ApiException { + return updateEventType(projectID, eventTypeId, modelsUpdateEventType, null); + } + + /** + * Updates an event type + * This endpoint updates an event type + * @param projectID Project ID (required) + * @param eventTypeId Event Type ID (required) + * @param modelsUpdateEventType Event Type Details (required) + * @param headers Optional headers to include in the request + * @return CreateEventType201Response + * @throws ApiException if fails to make API call + */ + public CreateEventType201Response updateEventType(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventTypeId, @jakarta.annotation.Nonnull ModelsUpdateEventType modelsUpdateEventType, Map headers) throws ApiException { + ApiResponse localVarResponse = updateEventTypeWithHttpInfo(projectID, eventTypeId, modelsUpdateEventType, headers); + return localVarResponse.getData(); + } + + /** + * Updates an event type + * This endpoint updates an event type + * @param projectID Project ID (required) + * @param eventTypeId Event Type ID (required) + * @param modelsUpdateEventType Event Type Details (required) + * @return ApiResponse<CreateEventType201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateEventTypeWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventTypeId, @jakarta.annotation.Nonnull ModelsUpdateEventType modelsUpdateEventType) throws ApiException { + return updateEventTypeWithHttpInfo(projectID, eventTypeId, modelsUpdateEventType, null); + } + + /** + * Updates an event type + * This endpoint updates an event type + * @param projectID Project ID (required) + * @param eventTypeId Event Type ID (required) + * @param modelsUpdateEventType Event Type Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateEventType201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateEventTypeWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventTypeId, @jakarta.annotation.Nonnull ModelsUpdateEventType modelsUpdateEventType, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateEventTypeRequestBuilder(projectID, eventTypeId, modelsUpdateEventType, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("updateEventType", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateEventType201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateEventTypeRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventTypeId, @jakarta.annotation.Nonnull ModelsUpdateEventType modelsUpdateEventType, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling updateEventType"); + } + // verify the required parameter 'eventTypeId' is set + if (eventTypeId == null) { + throw new ApiException(400, "Missing the required parameter 'eventTypeId' when calling updateEventType"); + } + // verify the required parameter 'modelsUpdateEventType' is set + if (modelsUpdateEventType == null) { + throw new ApiException(400, "Missing the required parameter 'modelsUpdateEventType' when calling updateEventType"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/event-types/{eventTypeId}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{eventTypeId}", ApiClient.urlEncode(eventTypeId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsUpdateEventType); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/src/main/java/com/getconvoy/api/EventsApi.java b/src/main/java/com/getconvoy/api/EventsApi.java new file mode 100644 index 0000000..7fc187c --- /dev/null +++ b/src/main/java/com/getconvoy/api/EventsApi.java @@ -0,0 +1,1546 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.getconvoy.api; + +import com.getconvoy.client.ApiClient; +import com.getconvoy.client.ApiException; +import com.getconvoy.client.ApiResponse; +import com.getconvoy.client.Configuration; +import com.getconvoy.client.Pair; + +import com.getconvoy.models.BatchReplayEvents200Response; +import com.getconvoy.models.CountAffectedEvents200Response; +import com.getconvoy.models.CreateBroadcastEvent201Response; +import com.getconvoy.models.GetEventsPaged200Response; +import com.getconvoy.models.GetProjects400Response; +import com.getconvoy.models.ModelsBroadcastEvent; +import com.getconvoy.models.ModelsCreateEvent; +import com.getconvoy.models.ModelsDynamicEvent; +import com.getconvoy.models.ModelsFanoutEvent; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class EventsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public EventsApi() { + this(Configuration.getDefaultApiClient()); + } + + public EventsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Batch replay events + * This endpoint replays multiple events at once. + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint ids to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param query Any arbitrary value to filter the events payload (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param sourceId A list of Source IDs to filter the events by. (optional) + * @param startDate The start date (optional) + * @return BatchReplayEvents200Response + * @throws ApiException if fails to make API call + */ + public BatchReplayEvents200Response batchReplayEvents(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String query, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable List sourceId, @jakarta.annotation.Nullable String startDate) throws ApiException { + return batchReplayEvents(projectID, direction, endDate, endpointId, idempotencyKey, nextPageCursor, perPage, prevPageCursor, query, sort, sourceId, startDate, null); + } + + /** + * Batch replay events + * This endpoint replays multiple events at once. + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint ids to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param query Any arbitrary value to filter the events payload (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param sourceId A list of Source IDs to filter the events by. (optional) + * @param startDate The start date (optional) + * @param headers Optional headers to include in the request + * @return BatchReplayEvents200Response + * @throws ApiException if fails to make API call + */ + public BatchReplayEvents200Response batchReplayEvents(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String query, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable List sourceId, @jakarta.annotation.Nullable String startDate, Map headers) throws ApiException { + ApiResponse localVarResponse = batchReplayEventsWithHttpInfo(projectID, direction, endDate, endpointId, idempotencyKey, nextPageCursor, perPage, prevPageCursor, query, sort, sourceId, startDate, headers); + return localVarResponse.getData(); + } + + /** + * Batch replay events + * This endpoint replays multiple events at once. + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint ids to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param query Any arbitrary value to filter the events payload (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param sourceId A list of Source IDs to filter the events by. (optional) + * @param startDate The start date (optional) + * @return ApiResponse<BatchReplayEvents200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse batchReplayEventsWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String query, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable List sourceId, @jakarta.annotation.Nullable String startDate) throws ApiException { + return batchReplayEventsWithHttpInfo(projectID, direction, endDate, endpointId, idempotencyKey, nextPageCursor, perPage, prevPageCursor, query, sort, sourceId, startDate, null); + } + + /** + * Batch replay events + * This endpoint replays multiple events at once. + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint ids to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param query Any arbitrary value to filter the events payload (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param sourceId A list of Source IDs to filter the events by. (optional) + * @param startDate The start date (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BatchReplayEvents200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse batchReplayEventsWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String query, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable List sourceId, @jakarta.annotation.Nullable String startDate, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = batchReplayEventsRequestBuilder(projectID, direction, endDate, endpointId, idempotencyKey, nextPageCursor, perPage, prevPageCursor, query, sort, sourceId, startDate, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("batchReplayEvents", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + BatchReplayEvents200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder batchReplayEventsRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String query, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable List sourceId, @jakarta.annotation.Nullable String startDate, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling batchReplayEvents"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/events/batchreplay" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "direction"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("direction", direction)); + localVarQueryParameterBaseName = "endDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("endDate", endDate)); + localVarQueryParameterBaseName = "endpointId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "endpointId", endpointId)); + localVarQueryParameterBaseName = "idempotencyKey"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("idempotencyKey", idempotencyKey)); + localVarQueryParameterBaseName = "next_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("next_page_cursor", nextPageCursor)); + localVarQueryParameterBaseName = "perPage"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("perPage", perPage)); + localVarQueryParameterBaseName = "prev_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("prev_page_cursor", prevPageCursor)); + localVarQueryParameterBaseName = "query"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("query", query)); + localVarQueryParameterBaseName = "sort"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sort", sort)); + localVarQueryParameterBaseName = "sourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sourceId", sourceId)); + localVarQueryParameterBaseName = "startDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startDate", startDate)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Count events matching batch replay filters + * This endpoint returns how many events would be affected by a batch replay with the given filters. + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint ids to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param query Any arbitrary value to filter the events payload (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param sourceId A list of Source IDs to filter the events by. (optional) + * @param startDate The start date (optional) + * @return CountAffectedEvents200Response + * @throws ApiException if fails to make API call + */ + public CountAffectedEvents200Response countAffectedEvents(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String query, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable List sourceId, @jakarta.annotation.Nullable String startDate) throws ApiException { + return countAffectedEvents(projectID, direction, endDate, endpointId, idempotencyKey, nextPageCursor, perPage, prevPageCursor, query, sort, sourceId, startDate, null); + } + + /** + * Count events matching batch replay filters + * This endpoint returns how many events would be affected by a batch replay with the given filters. + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint ids to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param query Any arbitrary value to filter the events payload (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param sourceId A list of Source IDs to filter the events by. (optional) + * @param startDate The start date (optional) + * @param headers Optional headers to include in the request + * @return CountAffectedEvents200Response + * @throws ApiException if fails to make API call + */ + public CountAffectedEvents200Response countAffectedEvents(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String query, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable List sourceId, @jakarta.annotation.Nullable String startDate, Map headers) throws ApiException { + ApiResponse localVarResponse = countAffectedEventsWithHttpInfo(projectID, direction, endDate, endpointId, idempotencyKey, nextPageCursor, perPage, prevPageCursor, query, sort, sourceId, startDate, headers); + return localVarResponse.getData(); + } + + /** + * Count events matching batch replay filters + * This endpoint returns how many events would be affected by a batch replay with the given filters. + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint ids to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param query Any arbitrary value to filter the events payload (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param sourceId A list of Source IDs to filter the events by. (optional) + * @param startDate The start date (optional) + * @return ApiResponse<CountAffectedEvents200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse countAffectedEventsWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String query, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable List sourceId, @jakarta.annotation.Nullable String startDate) throws ApiException { + return countAffectedEventsWithHttpInfo(projectID, direction, endDate, endpointId, idempotencyKey, nextPageCursor, perPage, prevPageCursor, query, sort, sourceId, startDate, null); + } + + /** + * Count events matching batch replay filters + * This endpoint returns how many events would be affected by a batch replay with the given filters. + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint ids to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param query Any arbitrary value to filter the events payload (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param sourceId A list of Source IDs to filter the events by. (optional) + * @param startDate The start date (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<CountAffectedEvents200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse countAffectedEventsWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String query, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable List sourceId, @jakarta.annotation.Nullable String startDate, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = countAffectedEventsRequestBuilder(projectID, direction, endDate, endpointId, idempotencyKey, nextPageCursor, perPage, prevPageCursor, query, sort, sourceId, startDate, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("countAffectedEvents", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CountAffectedEvents200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder countAffectedEventsRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String query, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable List sourceId, @jakarta.annotation.Nullable String startDate, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling countAffectedEvents"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/events/countbatchreplayevents" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "direction"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("direction", direction)); + localVarQueryParameterBaseName = "endDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("endDate", endDate)); + localVarQueryParameterBaseName = "endpointId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "endpointId", endpointId)); + localVarQueryParameterBaseName = "idempotencyKey"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("idempotencyKey", idempotencyKey)); + localVarQueryParameterBaseName = "next_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("next_page_cursor", nextPageCursor)); + localVarQueryParameterBaseName = "perPage"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("perPage", perPage)); + localVarQueryParameterBaseName = "prev_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("prev_page_cursor", prevPageCursor)); + localVarQueryParameterBaseName = "query"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("query", query)); + localVarQueryParameterBaseName = "sort"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sort", sort)); + localVarQueryParameterBaseName = "sourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sourceId", sourceId)); + localVarQueryParameterBaseName = "startDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startDate", startDate)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a broadcast event + * This endpoint creates a event that is broadcast to every endpoint whose subscription matches the given event type. + * @param projectID Project ID (required) + * @param modelsBroadcastEvent Broadcast Event Details (required) + * @return CreateBroadcastEvent201Response + * @throws ApiException if fails to make API call + */ + public CreateBroadcastEvent201Response createBroadcastEvent(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsBroadcastEvent modelsBroadcastEvent) throws ApiException { + return createBroadcastEvent(projectID, modelsBroadcastEvent, null); + } + + /** + * Create a broadcast event + * This endpoint creates a event that is broadcast to every endpoint whose subscription matches the given event type. + * @param projectID Project ID (required) + * @param modelsBroadcastEvent Broadcast Event Details (required) + * @param headers Optional headers to include in the request + * @return CreateBroadcastEvent201Response + * @throws ApiException if fails to make API call + */ + public CreateBroadcastEvent201Response createBroadcastEvent(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsBroadcastEvent modelsBroadcastEvent, Map headers) throws ApiException { + ApiResponse localVarResponse = createBroadcastEventWithHttpInfo(projectID, modelsBroadcastEvent, headers); + return localVarResponse.getData(); + } + + /** + * Create a broadcast event + * This endpoint creates a event that is broadcast to every endpoint whose subscription matches the given event type. + * @param projectID Project ID (required) + * @param modelsBroadcastEvent Broadcast Event Details (required) + * @return ApiResponse<CreateBroadcastEvent201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createBroadcastEventWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsBroadcastEvent modelsBroadcastEvent) throws ApiException { + return createBroadcastEventWithHttpInfo(projectID, modelsBroadcastEvent, null); + } + + /** + * Create a broadcast event + * This endpoint creates a event that is broadcast to every endpoint whose subscription matches the given event type. + * @param projectID Project ID (required) + * @param modelsBroadcastEvent Broadcast Event Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateBroadcastEvent201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createBroadcastEventWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsBroadcastEvent modelsBroadcastEvent, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createBroadcastEventRequestBuilder(projectID, modelsBroadcastEvent, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createBroadcastEvent", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateBroadcastEvent201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createBroadcastEventRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsBroadcastEvent modelsBroadcastEvent, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling createBroadcastEvent"); + } + // verify the required parameter 'modelsBroadcastEvent' is set + if (modelsBroadcastEvent == null) { + throw new ApiException(400, "Missing the required parameter 'modelsBroadcastEvent' when calling createBroadcastEvent"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/events/broadcast" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsBroadcastEvent); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Dynamic Events + * This endpoint does not require creating endpoint and subscriptions ahead of time. Instead, you supply the endpoint and the payload, and Convoy delivers the events + * @param projectID Project ID (required) + * @param modelsDynamicEvent Event Details (required) + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response createDynamicEvent(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsDynamicEvent modelsDynamicEvent) throws ApiException { + return createDynamicEvent(projectID, modelsDynamicEvent, null); + } + + /** + * Dynamic Events + * This endpoint does not require creating endpoint and subscriptions ahead of time. Instead, you supply the endpoint and the payload, and Convoy delivers the events + * @param projectID Project ID (required) + * @param modelsDynamicEvent Event Details (required) + * @param headers Optional headers to include in the request + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response createDynamicEvent(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsDynamicEvent modelsDynamicEvent, Map headers) throws ApiException { + ApiResponse localVarResponse = createDynamicEventWithHttpInfo(projectID, modelsDynamicEvent, headers); + return localVarResponse.getData(); + } + + /** + * Dynamic Events + * This endpoint does not require creating endpoint and subscriptions ahead of time. Instead, you supply the endpoint and the payload, and Convoy delivers the events + * @param projectID Project ID (required) + * @param modelsDynamicEvent Event Details (required) + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createDynamicEventWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsDynamicEvent modelsDynamicEvent) throws ApiException { + return createDynamicEventWithHttpInfo(projectID, modelsDynamicEvent, null); + } + + /** + * Dynamic Events + * This endpoint does not require creating endpoint and subscriptions ahead of time. Instead, you supply the endpoint and the payload, and Convoy delivers the events + * @param projectID Project ID (required) + * @param modelsDynamicEvent Event Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createDynamicEventWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsDynamicEvent modelsDynamicEvent, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createDynamicEventRequestBuilder(projectID, modelsDynamicEvent, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createDynamicEvent", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetProjects400Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createDynamicEventRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsDynamicEvent modelsDynamicEvent, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling createDynamicEvent"); + } + // verify the required parameter 'modelsDynamicEvent' is set + if (modelsDynamicEvent == null) { + throw new ApiException(400, "Missing the required parameter 'modelsDynamicEvent' when calling createDynamicEvent"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/events/dynamic" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsDynamicEvent); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create an event + * This endpoint creates an endpoint event + * @param projectID Project ID (required) + * @param modelsCreateEvent Event Details (required) + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response createEndpointEvent(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEvent modelsCreateEvent) throws ApiException { + return createEndpointEvent(projectID, modelsCreateEvent, null); + } + + /** + * Create an event + * This endpoint creates an endpoint event + * @param projectID Project ID (required) + * @param modelsCreateEvent Event Details (required) + * @param headers Optional headers to include in the request + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response createEndpointEvent(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEvent modelsCreateEvent, Map headers) throws ApiException { + ApiResponse localVarResponse = createEndpointEventWithHttpInfo(projectID, modelsCreateEvent, headers); + return localVarResponse.getData(); + } + + /** + * Create an event + * This endpoint creates an endpoint event + * @param projectID Project ID (required) + * @param modelsCreateEvent Event Details (required) + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createEndpointEventWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEvent modelsCreateEvent) throws ApiException { + return createEndpointEventWithHttpInfo(projectID, modelsCreateEvent, null); + } + + /** + * Create an event + * This endpoint creates an endpoint event + * @param projectID Project ID (required) + * @param modelsCreateEvent Event Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createEndpointEventWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEvent modelsCreateEvent, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createEndpointEventRequestBuilder(projectID, modelsCreateEvent, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createEndpointEvent", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetProjects400Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createEndpointEventRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEvent modelsCreateEvent, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling createEndpointEvent"); + } + // verify the required parameter 'modelsCreateEvent' is set + if (modelsCreateEvent == null) { + throw new ApiException(400, "Missing the required parameter 'modelsCreateEvent' when calling createEndpointEvent"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/events" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsCreateEvent); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Fan out an event + * This endpoint uses the owner_id to fan out an event to multiple endpoints. + * @param projectID Project ID (required) + * @param modelsFanoutEvent Event Details (required) + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response createEndpointFanoutEvent(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsFanoutEvent modelsFanoutEvent) throws ApiException { + return createEndpointFanoutEvent(projectID, modelsFanoutEvent, null); + } + + /** + * Fan out an event + * This endpoint uses the owner_id to fan out an event to multiple endpoints. + * @param projectID Project ID (required) + * @param modelsFanoutEvent Event Details (required) + * @param headers Optional headers to include in the request + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response createEndpointFanoutEvent(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsFanoutEvent modelsFanoutEvent, Map headers) throws ApiException { + ApiResponse localVarResponse = createEndpointFanoutEventWithHttpInfo(projectID, modelsFanoutEvent, headers); + return localVarResponse.getData(); + } + + /** + * Fan out an event + * This endpoint uses the owner_id to fan out an event to multiple endpoints. + * @param projectID Project ID (required) + * @param modelsFanoutEvent Event Details (required) + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createEndpointFanoutEventWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsFanoutEvent modelsFanoutEvent) throws ApiException { + return createEndpointFanoutEventWithHttpInfo(projectID, modelsFanoutEvent, null); + } + + /** + * Fan out an event + * This endpoint uses the owner_id to fan out an event to multiple endpoints. + * @param projectID Project ID (required) + * @param modelsFanoutEvent Event Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createEndpointFanoutEventWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsFanoutEvent modelsFanoutEvent, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createEndpointFanoutEventRequestBuilder(projectID, modelsFanoutEvent, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createEndpointFanoutEvent", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetProjects400Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createEndpointFanoutEventRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsFanoutEvent modelsFanoutEvent, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling createEndpointFanoutEvent"); + } + // verify the required parameter 'modelsFanoutEvent' is set + if (modelsFanoutEvent == null) { + throw new ApiException(400, "Missing the required parameter 'modelsFanoutEvent' when calling createEndpointFanoutEvent"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/events/fanout" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsFanoutEvent); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Retrieve an event + * This endpoint retrieves an event + * @param projectID Project ID (required) + * @param eventID event id (required) + * @return CreateBroadcastEvent201Response + * @throws ApiException if fails to make API call + */ + public CreateBroadcastEvent201Response getEndpointEvent(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventID) throws ApiException { + return getEndpointEvent(projectID, eventID, null); + } + + /** + * Retrieve an event + * This endpoint retrieves an event + * @param projectID Project ID (required) + * @param eventID event id (required) + * @param headers Optional headers to include in the request + * @return CreateBroadcastEvent201Response + * @throws ApiException if fails to make API call + */ + public CreateBroadcastEvent201Response getEndpointEvent(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventID, Map headers) throws ApiException { + ApiResponse localVarResponse = getEndpointEventWithHttpInfo(projectID, eventID, headers); + return localVarResponse.getData(); + } + + /** + * Retrieve an event + * This endpoint retrieves an event + * @param projectID Project ID (required) + * @param eventID event id (required) + * @return ApiResponse<CreateBroadcastEvent201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEndpointEventWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventID) throws ApiException { + return getEndpointEventWithHttpInfo(projectID, eventID, null); + } + + /** + * Retrieve an event + * This endpoint retrieves an event + * @param projectID Project ID (required) + * @param eventID event id (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateBroadcastEvent201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEndpointEventWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getEndpointEventRequestBuilder(projectID, eventID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getEndpointEvent", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateBroadcastEvent201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getEndpointEventRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getEndpointEvent"); + } + // verify the required parameter 'eventID' is set + if (eventID == null) { + throw new ApiException(400, "Missing the required parameter 'eventID' when calling getEndpointEvent"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/events/{eventID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{eventID}", ApiClient.urlEncode(eventID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List all events + * This endpoint fetches app events with pagination + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint ids to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param query Any arbitrary value to filter the events payload (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param sourceId A list of Source IDs to filter the events by. (optional) + * @param startDate The start date (optional) + * @return GetEventsPaged200Response + * @throws ApiException if fails to make API call + */ + public GetEventsPaged200Response getEventsPaged(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String query, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable List sourceId, @jakarta.annotation.Nullable String startDate) throws ApiException { + return getEventsPaged(projectID, direction, endDate, endpointId, idempotencyKey, nextPageCursor, perPage, prevPageCursor, query, sort, sourceId, startDate, null); + } + + /** + * List all events + * This endpoint fetches app events with pagination + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint ids to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param query Any arbitrary value to filter the events payload (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param sourceId A list of Source IDs to filter the events by. (optional) + * @param startDate The start date (optional) + * @param headers Optional headers to include in the request + * @return GetEventsPaged200Response + * @throws ApiException if fails to make API call + */ + public GetEventsPaged200Response getEventsPaged(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String query, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable List sourceId, @jakarta.annotation.Nullable String startDate, Map headers) throws ApiException { + ApiResponse localVarResponse = getEventsPagedWithHttpInfo(projectID, direction, endDate, endpointId, idempotencyKey, nextPageCursor, perPage, prevPageCursor, query, sort, sourceId, startDate, headers); + return localVarResponse.getData(); + } + + /** + * List all events + * This endpoint fetches app events with pagination + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint ids to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param query Any arbitrary value to filter the events payload (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param sourceId A list of Source IDs to filter the events by. (optional) + * @param startDate The start date (optional) + * @return ApiResponse<GetEventsPaged200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEventsPagedWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String query, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable List sourceId, @jakarta.annotation.Nullable String startDate) throws ApiException { + return getEventsPagedWithHttpInfo(projectID, direction, endDate, endpointId, idempotencyKey, nextPageCursor, perPage, prevPageCursor, query, sort, sourceId, startDate, null); + } + + /** + * List all events + * This endpoint fetches app events with pagination + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param endpointId A list of endpoint ids to filter by (optional) + * @param idempotencyKey IdempotencyKey to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param query Any arbitrary value to filter the events payload (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param sourceId A list of Source IDs to filter the events by. (optional) + * @param startDate The start date (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetEventsPaged200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEventsPagedWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String query, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable List sourceId, @jakarta.annotation.Nullable String startDate, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getEventsPagedRequestBuilder(projectID, direction, endDate, endpointId, idempotencyKey, nextPageCursor, perPage, prevPageCursor, query, sort, sourceId, startDate, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getEventsPaged", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetEventsPaged200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getEventsPagedRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String query, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable List sourceId, @jakarta.annotation.Nullable String startDate, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getEventsPaged"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/events" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "direction"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("direction", direction)); + localVarQueryParameterBaseName = "endDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("endDate", endDate)); + localVarQueryParameterBaseName = "endpointId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "endpointId", endpointId)); + localVarQueryParameterBaseName = "idempotencyKey"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("idempotencyKey", idempotencyKey)); + localVarQueryParameterBaseName = "next_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("next_page_cursor", nextPageCursor)); + localVarQueryParameterBaseName = "perPage"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("perPage", perPage)); + localVarQueryParameterBaseName = "prev_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("prev_page_cursor", prevPageCursor)); + localVarQueryParameterBaseName = "query"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("query", query)); + localVarQueryParameterBaseName = "sort"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sort", sort)); + localVarQueryParameterBaseName = "sourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sourceId", sourceId)); + localVarQueryParameterBaseName = "startDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startDate", startDate)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Replay event + * This endpoint replays an event afresh assuming it is a new event. + * @param projectID Project ID (required) + * @param eventID event id (required) + * @return CreateBroadcastEvent201Response + * @throws ApiException if fails to make API call + */ + public CreateBroadcastEvent201Response replayEndpointEvent(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventID) throws ApiException { + return replayEndpointEvent(projectID, eventID, null); + } + + /** + * Replay event + * This endpoint replays an event afresh assuming it is a new event. + * @param projectID Project ID (required) + * @param eventID event id (required) + * @param headers Optional headers to include in the request + * @return CreateBroadcastEvent201Response + * @throws ApiException if fails to make API call + */ + public CreateBroadcastEvent201Response replayEndpointEvent(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventID, Map headers) throws ApiException { + ApiResponse localVarResponse = replayEndpointEventWithHttpInfo(projectID, eventID, headers); + return localVarResponse.getData(); + } + + /** + * Replay event + * This endpoint replays an event afresh assuming it is a new event. + * @param projectID Project ID (required) + * @param eventID event id (required) + * @return ApiResponse<CreateBroadcastEvent201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse replayEndpointEventWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventID) throws ApiException { + return replayEndpointEventWithHttpInfo(projectID, eventID, null); + } + + /** + * Replay event + * This endpoint replays an event afresh assuming it is a new event. + * @param projectID Project ID (required) + * @param eventID event id (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateBroadcastEvent201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse replayEndpointEventWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = replayEndpointEventRequestBuilder(projectID, eventID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("replayEndpointEvent", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateBroadcastEvent201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder replayEndpointEventRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling replayEndpointEvent"); + } + // verify the required parameter 'eventID' is set + if (eventID == null) { + throw new ApiException(400, "Missing the required parameter 'eventID' when calling replayEndpointEvent"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/events/{eventID}/replay" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{eventID}", ApiClient.urlEncode(eventID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/src/main/java/com/getconvoy/api/FiltersApi.java b/src/main/java/com/getconvoy/api/FiltersApi.java new file mode 100644 index 0000000..45cbb1f --- /dev/null +++ b/src/main/java/com/getconvoy/api/FiltersApi.java @@ -0,0 +1,1294 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.getconvoy.api; + +import com.getconvoy.client.ApiClient; +import com.getconvoy.client.ApiException; +import com.getconvoy.client.ApiResponse; +import com.getconvoy.client.Configuration; +import com.getconvoy.client.Pair; + +import com.getconvoy.models.CreateFilter201Response; +import com.getconvoy.models.GetFilters200Response; +import com.getconvoy.models.GetProjects400Response; +import com.getconvoy.models.ModelsBulkUpdateFilterRequest; +import com.getconvoy.models.ModelsCreateFilterRequest; +import com.getconvoy.models.ModelsTestFilterRequest; +import com.getconvoy.models.ModelsUpdateFilterRequest; +import com.getconvoy.models.TestFilter200Response; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class FiltersApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public FiltersApi() { + this(Configuration.getDefaultApiClient()); + } + + public FiltersApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Create multiple subscription filters + * This endpoint creates multiple filters for a subscription + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param modelsCreateFilterRequest Filters to create (required) + * @return GetFilters200Response + * @throws ApiException if fails to make API call + */ + public GetFilters200Response bulkCreateFilters(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull List modelsCreateFilterRequest) throws ApiException { + return bulkCreateFilters(projectID, subscriptionID, modelsCreateFilterRequest, null); + } + + /** + * Create multiple subscription filters + * This endpoint creates multiple filters for a subscription + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param modelsCreateFilterRequest Filters to create (required) + * @param headers Optional headers to include in the request + * @return GetFilters200Response + * @throws ApiException if fails to make API call + */ + public GetFilters200Response bulkCreateFilters(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull List modelsCreateFilterRequest, Map headers) throws ApiException { + ApiResponse localVarResponse = bulkCreateFiltersWithHttpInfo(projectID, subscriptionID, modelsCreateFilterRequest, headers); + return localVarResponse.getData(); + } + + /** + * Create multiple subscription filters + * This endpoint creates multiple filters for a subscription + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param modelsCreateFilterRequest Filters to create (required) + * @return ApiResponse<GetFilters200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse bulkCreateFiltersWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull List modelsCreateFilterRequest) throws ApiException { + return bulkCreateFiltersWithHttpInfo(projectID, subscriptionID, modelsCreateFilterRequest, null); + } + + /** + * Create multiple subscription filters + * This endpoint creates multiple filters for a subscription + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param modelsCreateFilterRequest Filters to create (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetFilters200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse bulkCreateFiltersWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull List modelsCreateFilterRequest, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = bulkCreateFiltersRequestBuilder(projectID, subscriptionID, modelsCreateFilterRequest, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("bulkCreateFilters", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetFilters200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder bulkCreateFiltersRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull List modelsCreateFilterRequest, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling bulkCreateFilters"); + } + // verify the required parameter 'subscriptionID' is set + if (subscriptionID == null) { + throw new ApiException(400, "Missing the required parameter 'subscriptionID' when calling bulkCreateFilters"); + } + // verify the required parameter 'modelsCreateFilterRequest' is set + if (modelsCreateFilterRequest == null) { + throw new ApiException(400, "Missing the required parameter 'modelsCreateFilterRequest' when calling bulkCreateFilters"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/bulk" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{subscriptionID}", ApiClient.urlEncode(subscriptionID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsCreateFilterRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update multiple subscription filters + * This endpoint updates multiple filters for a subscription + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param modelsBulkUpdateFilterRequest Filters to update (required) + * @return GetFilters200Response + * @throws ApiException if fails to make API call + */ + public GetFilters200Response bulkUpdateFilters(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull List modelsBulkUpdateFilterRequest) throws ApiException { + return bulkUpdateFilters(projectID, subscriptionID, modelsBulkUpdateFilterRequest, null); + } + + /** + * Update multiple subscription filters + * This endpoint updates multiple filters for a subscription + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param modelsBulkUpdateFilterRequest Filters to update (required) + * @param headers Optional headers to include in the request + * @return GetFilters200Response + * @throws ApiException if fails to make API call + */ + public GetFilters200Response bulkUpdateFilters(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull List modelsBulkUpdateFilterRequest, Map headers) throws ApiException { + ApiResponse localVarResponse = bulkUpdateFiltersWithHttpInfo(projectID, subscriptionID, modelsBulkUpdateFilterRequest, headers); + return localVarResponse.getData(); + } + + /** + * Update multiple subscription filters + * This endpoint updates multiple filters for a subscription + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param modelsBulkUpdateFilterRequest Filters to update (required) + * @return ApiResponse<GetFilters200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse bulkUpdateFiltersWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull List modelsBulkUpdateFilterRequest) throws ApiException { + return bulkUpdateFiltersWithHttpInfo(projectID, subscriptionID, modelsBulkUpdateFilterRequest, null); + } + + /** + * Update multiple subscription filters + * This endpoint updates multiple filters for a subscription + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param modelsBulkUpdateFilterRequest Filters to update (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetFilters200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse bulkUpdateFiltersWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull List modelsBulkUpdateFilterRequest, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = bulkUpdateFiltersRequestBuilder(projectID, subscriptionID, modelsBulkUpdateFilterRequest, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("bulkUpdateFilters", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetFilters200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder bulkUpdateFiltersRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull List modelsBulkUpdateFilterRequest, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling bulkUpdateFilters"); + } + // verify the required parameter 'subscriptionID' is set + if (subscriptionID == null) { + throw new ApiException(400, "Missing the required parameter 'subscriptionID' when calling bulkUpdateFilters"); + } + // verify the required parameter 'modelsBulkUpdateFilterRequest' is set + if (modelsBulkUpdateFilterRequest == null) { + throw new ApiException(400, "Missing the required parameter 'modelsBulkUpdateFilterRequest' when calling bulkUpdateFilters"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/bulk_update" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{subscriptionID}", ApiClient.urlEncode(subscriptionID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsBulkUpdateFilterRequest); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a new filter + * This endpoint creates a new filter for a subscription + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param modelsCreateFilterRequest Filter to create (required) + * @return CreateFilter201Response + * @throws ApiException if fails to make API call + */ + public CreateFilter201Response createFilter(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull ModelsCreateFilterRequest modelsCreateFilterRequest) throws ApiException { + return createFilter(projectID, subscriptionID, modelsCreateFilterRequest, null); + } + + /** + * Create a new filter + * This endpoint creates a new filter for a subscription + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param modelsCreateFilterRequest Filter to create (required) + * @param headers Optional headers to include in the request + * @return CreateFilter201Response + * @throws ApiException if fails to make API call + */ + public CreateFilter201Response createFilter(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull ModelsCreateFilterRequest modelsCreateFilterRequest, Map headers) throws ApiException { + ApiResponse localVarResponse = createFilterWithHttpInfo(projectID, subscriptionID, modelsCreateFilterRequest, headers); + return localVarResponse.getData(); + } + + /** + * Create a new filter + * This endpoint creates a new filter for a subscription + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param modelsCreateFilterRequest Filter to create (required) + * @return ApiResponse<CreateFilter201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createFilterWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull ModelsCreateFilterRequest modelsCreateFilterRequest) throws ApiException { + return createFilterWithHttpInfo(projectID, subscriptionID, modelsCreateFilterRequest, null); + } + + /** + * Create a new filter + * This endpoint creates a new filter for a subscription + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param modelsCreateFilterRequest Filter to create (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateFilter201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createFilterWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull ModelsCreateFilterRequest modelsCreateFilterRequest, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createFilterRequestBuilder(projectID, subscriptionID, modelsCreateFilterRequest, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createFilter", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateFilter201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createFilterRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull ModelsCreateFilterRequest modelsCreateFilterRequest, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling createFilter"); + } + // verify the required parameter 'subscriptionID' is set + if (subscriptionID == null) { + throw new ApiException(400, "Missing the required parameter 'subscriptionID' when calling createFilter"); + } + // verify the required parameter 'modelsCreateFilterRequest' is set + if (modelsCreateFilterRequest == null) { + throw new ApiException(400, "Missing the required parameter 'modelsCreateFilterRequest' when calling createFilter"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{subscriptionID}", ApiClient.urlEncode(subscriptionID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsCreateFilterRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete a filter + * This endpoint deletes a filter + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param filterID Filter ID (required) + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response deleteFilter(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String filterID) throws ApiException { + return deleteFilter(projectID, subscriptionID, filterID, null); + } + + /** + * Delete a filter + * This endpoint deletes a filter + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param filterID Filter ID (required) + * @param headers Optional headers to include in the request + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response deleteFilter(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String filterID, Map headers) throws ApiException { + ApiResponse localVarResponse = deleteFilterWithHttpInfo(projectID, subscriptionID, filterID, headers); + return localVarResponse.getData(); + } + + /** + * Delete a filter + * This endpoint deletes a filter + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param filterID Filter ID (required) + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteFilterWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String filterID) throws ApiException { + return deleteFilterWithHttpInfo(projectID, subscriptionID, filterID, null); + } + + /** + * Delete a filter + * This endpoint deletes a filter + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param filterID Filter ID (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteFilterWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String filterID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteFilterRequestBuilder(projectID, subscriptionID, filterID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("deleteFilter", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetProjects400Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteFilterRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String filterID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling deleteFilter"); + } + // verify the required parameter 'subscriptionID' is set + if (subscriptionID == null) { + throw new ApiException(400, "Missing the required parameter 'subscriptionID' when calling deleteFilter"); + } + // verify the required parameter 'filterID' is set + if (filterID == null) { + throw new ApiException(400, "Missing the required parameter 'filterID' when calling deleteFilter"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/{filterID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{subscriptionID}", ApiClient.urlEncode(subscriptionID.toString())) + .replace("{filterID}", ApiClient.urlEncode(filterID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get a filter + * This endpoint retrieves a single filter + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param filterID Filter ID (required) + * @return CreateFilter201Response + * @throws ApiException if fails to make API call + */ + public CreateFilter201Response getFilter(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String filterID) throws ApiException { + return getFilter(projectID, subscriptionID, filterID, null); + } + + /** + * Get a filter + * This endpoint retrieves a single filter + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param filterID Filter ID (required) + * @param headers Optional headers to include in the request + * @return CreateFilter201Response + * @throws ApiException if fails to make API call + */ + public CreateFilter201Response getFilter(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String filterID, Map headers) throws ApiException { + ApiResponse localVarResponse = getFilterWithHttpInfo(projectID, subscriptionID, filterID, headers); + return localVarResponse.getData(); + } + + /** + * Get a filter + * This endpoint retrieves a single filter + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param filterID Filter ID (required) + * @return ApiResponse<CreateFilter201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFilterWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String filterID) throws ApiException { + return getFilterWithHttpInfo(projectID, subscriptionID, filterID, null); + } + + /** + * Get a filter + * This endpoint retrieves a single filter + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param filterID Filter ID (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateFilter201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFilterWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String filterID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFilterRequestBuilder(projectID, subscriptionID, filterID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getFilter", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateFilter201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getFilterRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String filterID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getFilter"); + } + // verify the required parameter 'subscriptionID' is set + if (subscriptionID == null) { + throw new ApiException(400, "Missing the required parameter 'subscriptionID' when calling getFilter"); + } + // verify the required parameter 'filterID' is set + if (filterID == null) { + throw new ApiException(400, "Missing the required parameter 'filterID' when calling getFilter"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/{filterID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{subscriptionID}", ApiClient.urlEncode(subscriptionID.toString())) + .replace("{filterID}", ApiClient.urlEncode(filterID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List all filters + * This endpoint fetches all filters for a subscription + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @return GetFilters200Response + * @throws ApiException if fails to make API call + */ + public GetFilters200Response getFilters(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID) throws ApiException { + return getFilters(projectID, subscriptionID, null); + } + + /** + * List all filters + * This endpoint fetches all filters for a subscription + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param headers Optional headers to include in the request + * @return GetFilters200Response + * @throws ApiException if fails to make API call + */ + public GetFilters200Response getFilters(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, Map headers) throws ApiException { + ApiResponse localVarResponse = getFiltersWithHttpInfo(projectID, subscriptionID, headers); + return localVarResponse.getData(); + } + + /** + * List all filters + * This endpoint fetches all filters for a subscription + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @return ApiResponse<GetFilters200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFiltersWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID) throws ApiException { + return getFiltersWithHttpInfo(projectID, subscriptionID, null); + } + + /** + * List all filters + * This endpoint fetches all filters for a subscription + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetFilters200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFiltersWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFiltersRequestBuilder(projectID, subscriptionID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getFilters", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetFilters200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getFiltersRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getFilters"); + } + // verify the required parameter 'subscriptionID' is set + if (subscriptionID == null) { + throw new ApiException(400, "Missing the required parameter 'subscriptionID' when calling getFilters"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{subscriptionID}", ApiClient.urlEncode(subscriptionID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Test a filter + * This endpoint tests a filter against a payload + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param eventType Event Type (required) + * @param modelsTestFilterRequest Payload to test (required) + * @return TestFilter200Response + * @throws ApiException if fails to make API call + */ + public TestFilter200Response testFilter(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String eventType, @jakarta.annotation.Nonnull ModelsTestFilterRequest modelsTestFilterRequest) throws ApiException { + return testFilter(projectID, subscriptionID, eventType, modelsTestFilterRequest, null); + } + + /** + * Test a filter + * This endpoint tests a filter against a payload + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param eventType Event Type (required) + * @param modelsTestFilterRequest Payload to test (required) + * @param headers Optional headers to include in the request + * @return TestFilter200Response + * @throws ApiException if fails to make API call + */ + public TestFilter200Response testFilter(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String eventType, @jakarta.annotation.Nonnull ModelsTestFilterRequest modelsTestFilterRequest, Map headers) throws ApiException { + ApiResponse localVarResponse = testFilterWithHttpInfo(projectID, subscriptionID, eventType, modelsTestFilterRequest, headers); + return localVarResponse.getData(); + } + + /** + * Test a filter + * This endpoint tests a filter against a payload + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param eventType Event Type (required) + * @param modelsTestFilterRequest Payload to test (required) + * @return ApiResponse<TestFilter200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse testFilterWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String eventType, @jakarta.annotation.Nonnull ModelsTestFilterRequest modelsTestFilterRequest) throws ApiException { + return testFilterWithHttpInfo(projectID, subscriptionID, eventType, modelsTestFilterRequest, null); + } + + /** + * Test a filter + * This endpoint tests a filter against a payload + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param eventType Event Type (required) + * @param modelsTestFilterRequest Payload to test (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<TestFilter200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse testFilterWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String eventType, @jakarta.annotation.Nonnull ModelsTestFilterRequest modelsTestFilterRequest, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testFilterRequestBuilder(projectID, subscriptionID, eventType, modelsTestFilterRequest, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testFilter", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + TestFilter200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testFilterRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String eventType, @jakarta.annotation.Nonnull ModelsTestFilterRequest modelsTestFilterRequest, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling testFilter"); + } + // verify the required parameter 'subscriptionID' is set + if (subscriptionID == null) { + throw new ApiException(400, "Missing the required parameter 'subscriptionID' when calling testFilter"); + } + // verify the required parameter 'eventType' is set + if (eventType == null) { + throw new ApiException(400, "Missing the required parameter 'eventType' when calling testFilter"); + } + // verify the required parameter 'modelsTestFilterRequest' is set + if (modelsTestFilterRequest == null) { + throw new ApiException(400, "Missing the required parameter 'modelsTestFilterRequest' when calling testFilter"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/test/{eventType}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{subscriptionID}", ApiClient.urlEncode(subscriptionID.toString())) + .replace("{eventType}", ApiClient.urlEncode(eventType.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsTestFilterRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update a filter + * This endpoint updates an existing filter + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param filterID Filter ID (required) + * @param modelsUpdateFilterRequest Updated filter (required) + * @return CreateFilter201Response + * @throws ApiException if fails to make API call + */ + public CreateFilter201Response updateFilter(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String filterID, @jakarta.annotation.Nonnull ModelsUpdateFilterRequest modelsUpdateFilterRequest) throws ApiException { + return updateFilter(projectID, subscriptionID, filterID, modelsUpdateFilterRequest, null); + } + + /** + * Update a filter + * This endpoint updates an existing filter + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param filterID Filter ID (required) + * @param modelsUpdateFilterRequest Updated filter (required) + * @param headers Optional headers to include in the request + * @return CreateFilter201Response + * @throws ApiException if fails to make API call + */ + public CreateFilter201Response updateFilter(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String filterID, @jakarta.annotation.Nonnull ModelsUpdateFilterRequest modelsUpdateFilterRequest, Map headers) throws ApiException { + ApiResponse localVarResponse = updateFilterWithHttpInfo(projectID, subscriptionID, filterID, modelsUpdateFilterRequest, headers); + return localVarResponse.getData(); + } + + /** + * Update a filter + * This endpoint updates an existing filter + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param filterID Filter ID (required) + * @param modelsUpdateFilterRequest Updated filter (required) + * @return ApiResponse<CreateFilter201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateFilterWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String filterID, @jakarta.annotation.Nonnull ModelsUpdateFilterRequest modelsUpdateFilterRequest) throws ApiException { + return updateFilterWithHttpInfo(projectID, subscriptionID, filterID, modelsUpdateFilterRequest, null); + } + + /** + * Update a filter + * This endpoint updates an existing filter + * @param projectID Project ID (required) + * @param subscriptionID Subscription ID (required) + * @param filterID Filter ID (required) + * @param modelsUpdateFilterRequest Updated filter (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateFilter201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateFilterWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String filterID, @jakarta.annotation.Nonnull ModelsUpdateFilterRequest modelsUpdateFilterRequest, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateFilterRequestBuilder(projectID, subscriptionID, filterID, modelsUpdateFilterRequest, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("updateFilter", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateFilter201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateFilterRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull String filterID, @jakarta.annotation.Nonnull ModelsUpdateFilterRequest modelsUpdateFilterRequest, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling updateFilter"); + } + // verify the required parameter 'subscriptionID' is set + if (subscriptionID == null) { + throw new ApiException(400, "Missing the required parameter 'subscriptionID' when calling updateFilter"); + } + // verify the required parameter 'filterID' is set + if (filterID == null) { + throw new ApiException(400, "Missing the required parameter 'filterID' when calling updateFilter"); + } + // verify the required parameter 'modelsUpdateFilterRequest' is set + if (modelsUpdateFilterRequest == null) { + throw new ApiException(400, "Missing the required parameter 'modelsUpdateFilterRequest' when calling updateFilter"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/{filterID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{subscriptionID}", ApiClient.urlEncode(subscriptionID.toString())) + .replace("{filterID}", ApiClient.urlEncode(filterID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsUpdateFilterRequest); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/src/main/java/com/getconvoy/api/MetaEventsApi.java b/src/main/java/com/getconvoy/api/MetaEventsApi.java new file mode 100644 index 0000000..f9483b2 --- /dev/null +++ b/src/main/java/com/getconvoy/api/MetaEventsApi.java @@ -0,0 +1,594 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.getconvoy.api; + +import com.getconvoy.client.ApiClient; +import com.getconvoy.client.ApiException; +import com.getconvoy.client.ApiResponse; +import com.getconvoy.client.Configuration; +import com.getconvoy.client.Pair; + +import com.getconvoy.models.GetMetaEvent200Response; +import com.getconvoy.models.GetMetaEventsPaged200Response; +import com.getconvoy.models.GetProjects400Response; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class MetaEventsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public MetaEventsApi() { + this(Configuration.getDefaultApiClient()); + } + + public MetaEventsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Retrieve a meta event + * This endpoint retrieves a meta event + * @param projectID Project ID (required) + * @param metaEventID meta event id (required) + * @return GetMetaEvent200Response + * @throws ApiException if fails to make API call + */ + public GetMetaEvent200Response getMetaEvent(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String metaEventID) throws ApiException { + return getMetaEvent(projectID, metaEventID, null); + } + + /** + * Retrieve a meta event + * This endpoint retrieves a meta event + * @param projectID Project ID (required) + * @param metaEventID meta event id (required) + * @param headers Optional headers to include in the request + * @return GetMetaEvent200Response + * @throws ApiException if fails to make API call + */ + public GetMetaEvent200Response getMetaEvent(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String metaEventID, Map headers) throws ApiException { + ApiResponse localVarResponse = getMetaEventWithHttpInfo(projectID, metaEventID, headers); + return localVarResponse.getData(); + } + + /** + * Retrieve a meta event + * This endpoint retrieves a meta event + * @param projectID Project ID (required) + * @param metaEventID meta event id (required) + * @return ApiResponse<GetMetaEvent200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMetaEventWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String metaEventID) throws ApiException { + return getMetaEventWithHttpInfo(projectID, metaEventID, null); + } + + /** + * Retrieve a meta event + * This endpoint retrieves a meta event + * @param projectID Project ID (required) + * @param metaEventID meta event id (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetMetaEvent200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMetaEventWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String metaEventID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMetaEventRequestBuilder(projectID, metaEventID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getMetaEvent", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetMetaEvent200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMetaEventRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String metaEventID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getMetaEvent"); + } + // verify the required parameter 'metaEventID' is set + if (metaEventID == null) { + throw new ApiException(400, "Missing the required parameter 'metaEventID' when calling getMetaEvent"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/meta-events/{metaEventID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{metaEventID}", ApiClient.urlEncode(metaEventID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List all meta events + * This endpoint fetches meta events with pagination + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param startDate The start date (optional) + * @return GetMetaEventsPaged200Response + * @throws ApiException if fails to make API call + */ + public GetMetaEventsPaged200Response getMetaEventsPaged(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate) throws ApiException { + return getMetaEventsPaged(projectID, direction, endDate, nextPageCursor, perPage, prevPageCursor, sort, startDate, null); + } + + /** + * List all meta events + * This endpoint fetches meta events with pagination + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param startDate The start date (optional) + * @param headers Optional headers to include in the request + * @return GetMetaEventsPaged200Response + * @throws ApiException if fails to make API call + */ + public GetMetaEventsPaged200Response getMetaEventsPaged(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, Map headers) throws ApiException { + ApiResponse localVarResponse = getMetaEventsPagedWithHttpInfo(projectID, direction, endDate, nextPageCursor, perPage, prevPageCursor, sort, startDate, headers); + return localVarResponse.getData(); + } + + /** + * List all meta events + * This endpoint fetches meta events with pagination + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param startDate The start date (optional) + * @return ApiResponse<GetMetaEventsPaged200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMetaEventsPagedWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate) throws ApiException { + return getMetaEventsPagedWithHttpInfo(projectID, direction, endDate, nextPageCursor, perPage, prevPageCursor, sort, startDate, null); + } + + /** + * List all meta events + * This endpoint fetches meta events with pagination + * @param projectID Project ID (required) + * @param direction (optional) + * @param endDate The end date (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param startDate The start date (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetMetaEventsPaged200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMetaEventsPagedWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMetaEventsPagedRequestBuilder(projectID, direction, endDate, nextPageCursor, perPage, prevPageCursor, sort, startDate, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getMetaEventsPaged", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetMetaEventsPaged200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMetaEventsPagedRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getMetaEventsPaged"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/meta-events" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "direction"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("direction", direction)); + localVarQueryParameterBaseName = "endDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("endDate", endDate)); + localVarQueryParameterBaseName = "next_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("next_page_cursor", nextPageCursor)); + localVarQueryParameterBaseName = "perPage"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("perPage", perPage)); + localVarQueryParameterBaseName = "prev_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("prev_page_cursor", prevPageCursor)); + localVarQueryParameterBaseName = "sort"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sort", sort)); + localVarQueryParameterBaseName = "startDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startDate", startDate)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Retry meta event + * This endpoint retries a meta event + * @param projectID Project ID (required) + * @param metaEventID meta event id (required) + * @return GetMetaEvent200Response + * @throws ApiException if fails to make API call + */ + public GetMetaEvent200Response resendMetaEvent(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String metaEventID) throws ApiException { + return resendMetaEvent(projectID, metaEventID, null); + } + + /** + * Retry meta event + * This endpoint retries a meta event + * @param projectID Project ID (required) + * @param metaEventID meta event id (required) + * @param headers Optional headers to include in the request + * @return GetMetaEvent200Response + * @throws ApiException if fails to make API call + */ + public GetMetaEvent200Response resendMetaEvent(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String metaEventID, Map headers) throws ApiException { + ApiResponse localVarResponse = resendMetaEventWithHttpInfo(projectID, metaEventID, headers); + return localVarResponse.getData(); + } + + /** + * Retry meta event + * This endpoint retries a meta event + * @param projectID Project ID (required) + * @param metaEventID meta event id (required) + * @return ApiResponse<GetMetaEvent200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse resendMetaEventWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String metaEventID) throws ApiException { + return resendMetaEventWithHttpInfo(projectID, metaEventID, null); + } + + /** + * Retry meta event + * This endpoint retries a meta event + * @param projectID Project ID (required) + * @param metaEventID meta event id (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetMetaEvent200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse resendMetaEventWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String metaEventID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = resendMetaEventRequestBuilder(projectID, metaEventID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("resendMetaEvent", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetMetaEvent200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder resendMetaEventRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String metaEventID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling resendMetaEvent"); + } + // verify the required parameter 'metaEventID' is set + if (metaEventID == null) { + throw new ApiException(400, "Missing the required parameter 'metaEventID' when calling resendMetaEvent"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/meta-events/{metaEventID}/resend" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{metaEventID}", ApiClient.urlEncode(metaEventID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/src/main/java/com/getconvoy/api/OnboardApi.java b/src/main/java/com/getconvoy/api/OnboardApi.java new file mode 100644 index 0000000..a1f3dfc --- /dev/null +++ b/src/main/java/com/getconvoy/api/OnboardApi.java @@ -0,0 +1,315 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.getconvoy.api; + +import com.getconvoy.client.ApiClient; +import com.getconvoy.client.ApiException; +import com.getconvoy.client.ApiResponse; +import com.getconvoy.client.Configuration; +import com.getconvoy.client.Pair; + +import com.getconvoy.models.BulkOnboard200Response; +import com.getconvoy.models.BulkOnboard202Response; +import java.io.File; +import com.getconvoy.models.GetProjects400Response; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class OnboardApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public OnboardApi() { + this(Configuration.getDefaultApiClient()); + } + + public OnboardApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Bulk onboard endpoints with subscriptions + * This endpoint accepts a CSV file or JSON body to bulk-create endpoints with subscriptions + * @param projectID Project ID (required) + * @param dryRun Validate without creating (optional) + * @param body Onboard Details (JSON) (optional) + * @return BulkOnboard200Response + * @throws ApiException if fails to make API call + */ + public BulkOnboard200Response bulkOnboard(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable File body) throws ApiException { + return bulkOnboard(projectID, dryRun, body, null); + } + + /** + * Bulk onboard endpoints with subscriptions + * This endpoint accepts a CSV file or JSON body to bulk-create endpoints with subscriptions + * @param projectID Project ID (required) + * @param dryRun Validate without creating (optional) + * @param body Onboard Details (JSON) (optional) + * @param headers Optional headers to include in the request + * @return BulkOnboard200Response + * @throws ApiException if fails to make API call + */ + public BulkOnboard200Response bulkOnboard(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable File body, Map headers) throws ApiException { + ApiResponse localVarResponse = bulkOnboardWithHttpInfo(projectID, dryRun, body, headers); + return localVarResponse.getData(); + } + + /** + * Bulk onboard endpoints with subscriptions + * This endpoint accepts a CSV file or JSON body to bulk-create endpoints with subscriptions + * @param projectID Project ID (required) + * @param dryRun Validate without creating (optional) + * @param body Onboard Details (JSON) (optional) + * @return ApiResponse<BulkOnboard200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse bulkOnboardWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable File body) throws ApiException { + return bulkOnboardWithHttpInfo(projectID, dryRun, body, null); + } + + /** + * Bulk onboard endpoints with subscriptions + * This endpoint accepts a CSV file or JSON body to bulk-create endpoints with subscriptions + * @param projectID Project ID (required) + * @param dryRun Validate without creating (optional) + * @param body Onboard Details (JSON) (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BulkOnboard200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse bulkOnboardWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable File body, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = bulkOnboardRequestBuilder(projectID, dryRun, body, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("bulkOnboard", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + BulkOnboard200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder bulkOnboardRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable File body, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling bulkOnboard"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/onboard" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "dry_run"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("dry_run", dryRun)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/octet-stream"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/src/main/java/com/getconvoy/api/PortalLinksApi.java b/src/main/java/com/getconvoy/api/PortalLinksApi.java new file mode 100644 index 0000000..876b943 --- /dev/null +++ b/src/main/java/com/getconvoy/api/PortalLinksApi.java @@ -0,0 +1,997 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.getconvoy.api; + +import com.getconvoy.client.ApiClient; +import com.getconvoy.client.ApiException; +import com.getconvoy.client.ApiResponse; +import com.getconvoy.client.Configuration; +import com.getconvoy.client.Pair; + +import com.getconvoy.models.BatchReplayEvents200Response; +import com.getconvoy.models.CreatePortalLink201Response; +import com.getconvoy.models.DatastoreCreatePortalLinkRequest; +import com.getconvoy.models.DatastoreUpdatePortalLinkRequest; +import com.getconvoy.models.GetProjects400Response; +import com.getconvoy.models.LoadPortalLinksPaged200Response; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class PortalLinksApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public PortalLinksApi() { + this(Configuration.getDefaultApiClient()); + } + + public PortalLinksApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Create a portal link + * This endpoint creates a portal link + * @param projectID Project ID (required) + * @param datastoreCreatePortalLinkRequest Portal Link Details (required) + * @return CreatePortalLink201Response + * @throws ApiException if fails to make API call + */ + public CreatePortalLink201Response createPortalLink(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull DatastoreCreatePortalLinkRequest datastoreCreatePortalLinkRequest) throws ApiException { + return createPortalLink(projectID, datastoreCreatePortalLinkRequest, null); + } + + /** + * Create a portal link + * This endpoint creates a portal link + * @param projectID Project ID (required) + * @param datastoreCreatePortalLinkRequest Portal Link Details (required) + * @param headers Optional headers to include in the request + * @return CreatePortalLink201Response + * @throws ApiException if fails to make API call + */ + public CreatePortalLink201Response createPortalLink(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull DatastoreCreatePortalLinkRequest datastoreCreatePortalLinkRequest, Map headers) throws ApiException { + ApiResponse localVarResponse = createPortalLinkWithHttpInfo(projectID, datastoreCreatePortalLinkRequest, headers); + return localVarResponse.getData(); + } + + /** + * Create a portal link + * This endpoint creates a portal link + * @param projectID Project ID (required) + * @param datastoreCreatePortalLinkRequest Portal Link Details (required) + * @return ApiResponse<CreatePortalLink201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createPortalLinkWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull DatastoreCreatePortalLinkRequest datastoreCreatePortalLinkRequest) throws ApiException { + return createPortalLinkWithHttpInfo(projectID, datastoreCreatePortalLinkRequest, null); + } + + /** + * Create a portal link + * This endpoint creates a portal link + * @param projectID Project ID (required) + * @param datastoreCreatePortalLinkRequest Portal Link Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreatePortalLink201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createPortalLinkWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull DatastoreCreatePortalLinkRequest datastoreCreatePortalLinkRequest, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createPortalLinkRequestBuilder(projectID, datastoreCreatePortalLinkRequest, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createPortalLink", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreatePortalLink201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createPortalLinkRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull DatastoreCreatePortalLinkRequest datastoreCreatePortalLinkRequest, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling createPortalLink"); + } + // verify the required parameter 'datastoreCreatePortalLinkRequest' is set + if (datastoreCreatePortalLinkRequest == null) { + throw new ApiException(400, "Missing the required parameter 'datastoreCreatePortalLinkRequest' when calling createPortalLink"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/portal-links" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(datastoreCreatePortalLinkRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Retrieve a portal link + * This endpoint retrieves a portal link by its id. + * @param projectID Project ID (required) + * @param portalLinkID portal link id (required) + * @return CreatePortalLink201Response + * @throws ApiException if fails to make API call + */ + public CreatePortalLink201Response getPortalLink(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID) throws ApiException { + return getPortalLink(projectID, portalLinkID, null); + } + + /** + * Retrieve a portal link + * This endpoint retrieves a portal link by its id. + * @param projectID Project ID (required) + * @param portalLinkID portal link id (required) + * @param headers Optional headers to include in the request + * @return CreatePortalLink201Response + * @throws ApiException if fails to make API call + */ + public CreatePortalLink201Response getPortalLink(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID, Map headers) throws ApiException { + ApiResponse localVarResponse = getPortalLinkWithHttpInfo(projectID, portalLinkID, headers); + return localVarResponse.getData(); + } + + /** + * Retrieve a portal link + * This endpoint retrieves a portal link by its id. + * @param projectID Project ID (required) + * @param portalLinkID portal link id (required) + * @return ApiResponse<CreatePortalLink201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPortalLinkWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID) throws ApiException { + return getPortalLinkWithHttpInfo(projectID, portalLinkID, null); + } + + /** + * Retrieve a portal link + * This endpoint retrieves a portal link by its id. + * @param projectID Project ID (required) + * @param portalLinkID portal link id (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreatePortalLink201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPortalLinkWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPortalLinkRequestBuilder(projectID, portalLinkID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getPortalLink", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreatePortalLink201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPortalLinkRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getPortalLink"); + } + // verify the required parameter 'portalLinkID' is set + if (portalLinkID == null) { + throw new ApiException(400, "Missing the required parameter 'portalLinkID' when calling getPortalLink"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/portal-links/{portalLinkID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{portalLinkID}", ApiClient.urlEncode(portalLinkID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List all portal links + * This endpoint fetches multiple portal links + * @param projectID Project ID (required) + * @param direction (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param ownerId The owner ID of the endpoint (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param q The name of the endpoint (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @return LoadPortalLinksPaged200Response + * @throws ApiException if fails to make API call + */ + public LoadPortalLinksPaged200Response loadPortalLinksPaged(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable String ownerId, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String q, @jakarta.annotation.Nullable String sort) throws ApiException { + return loadPortalLinksPaged(projectID, direction, nextPageCursor, ownerId, perPage, prevPageCursor, q, sort, null); + } + + /** + * List all portal links + * This endpoint fetches multiple portal links + * @param projectID Project ID (required) + * @param direction (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param ownerId The owner ID of the endpoint (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param q The name of the endpoint (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param headers Optional headers to include in the request + * @return LoadPortalLinksPaged200Response + * @throws ApiException if fails to make API call + */ + public LoadPortalLinksPaged200Response loadPortalLinksPaged(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable String ownerId, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String q, @jakarta.annotation.Nullable String sort, Map headers) throws ApiException { + ApiResponse localVarResponse = loadPortalLinksPagedWithHttpInfo(projectID, direction, nextPageCursor, ownerId, perPage, prevPageCursor, q, sort, headers); + return localVarResponse.getData(); + } + + /** + * List all portal links + * This endpoint fetches multiple portal links + * @param projectID Project ID (required) + * @param direction (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param ownerId The owner ID of the endpoint (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param q The name of the endpoint (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @return ApiResponse<LoadPortalLinksPaged200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse loadPortalLinksPagedWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable String ownerId, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String q, @jakarta.annotation.Nullable String sort) throws ApiException { + return loadPortalLinksPagedWithHttpInfo(projectID, direction, nextPageCursor, ownerId, perPage, prevPageCursor, q, sort, null); + } + + /** + * List all portal links + * This endpoint fetches multiple portal links + * @param projectID Project ID (required) + * @param direction (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param ownerId The owner ID of the endpoint (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param q The name of the endpoint (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<LoadPortalLinksPaged200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse loadPortalLinksPagedWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable String ownerId, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String q, @jakarta.annotation.Nullable String sort, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = loadPortalLinksPagedRequestBuilder(projectID, direction, nextPageCursor, ownerId, perPage, prevPageCursor, q, sort, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("loadPortalLinksPaged", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + LoadPortalLinksPaged200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder loadPortalLinksPagedRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable String ownerId, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String q, @jakarta.annotation.Nullable String sort, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling loadPortalLinksPaged"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/portal-links" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "direction"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("direction", direction)); + localVarQueryParameterBaseName = "next_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("next_page_cursor", nextPageCursor)); + localVarQueryParameterBaseName = "ownerId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("ownerId", ownerId)); + localVarQueryParameterBaseName = "perPage"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("perPage", perPage)); + localVarQueryParameterBaseName = "prev_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("prev_page_cursor", prevPageCursor)); + localVarQueryParameterBaseName = "q"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("q", q)); + localVarQueryParameterBaseName = "sort"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sort", sort)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get a portal link auth token + * This endpoint retrieves a portal link auth token + * @param projectID Project ID (required) + * @param portalLinkID portal link id (required) + * @return BatchReplayEvents200Response + * @throws ApiException if fails to make API call + */ + public BatchReplayEvents200Response refreshPortalLinkAuthToken(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID) throws ApiException { + return refreshPortalLinkAuthToken(projectID, portalLinkID, null); + } + + /** + * Get a portal link auth token + * This endpoint retrieves a portal link auth token + * @param projectID Project ID (required) + * @param portalLinkID portal link id (required) + * @param headers Optional headers to include in the request + * @return BatchReplayEvents200Response + * @throws ApiException if fails to make API call + */ + public BatchReplayEvents200Response refreshPortalLinkAuthToken(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID, Map headers) throws ApiException { + ApiResponse localVarResponse = refreshPortalLinkAuthTokenWithHttpInfo(projectID, portalLinkID, headers); + return localVarResponse.getData(); + } + + /** + * Get a portal link auth token + * This endpoint retrieves a portal link auth token + * @param projectID Project ID (required) + * @param portalLinkID portal link id (required) + * @return ApiResponse<BatchReplayEvents200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse refreshPortalLinkAuthTokenWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID) throws ApiException { + return refreshPortalLinkAuthTokenWithHttpInfo(projectID, portalLinkID, null); + } + + /** + * Get a portal link auth token + * This endpoint retrieves a portal link auth token + * @param projectID Project ID (required) + * @param portalLinkID portal link id (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<BatchReplayEvents200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse refreshPortalLinkAuthTokenWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = refreshPortalLinkAuthTokenRequestBuilder(projectID, portalLinkID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("refreshPortalLinkAuthToken", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + BatchReplayEvents200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder refreshPortalLinkAuthTokenRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling refreshPortalLinkAuthToken"); + } + // verify the required parameter 'portalLinkID' is set + if (portalLinkID == null) { + throw new ApiException(400, "Missing the required parameter 'portalLinkID' when calling refreshPortalLinkAuthToken"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/portal-links/{portalLinkID}/refresh_token" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{portalLinkID}", ApiClient.urlEncode(portalLinkID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Revoke a portal link + * This endpoint revokes a portal link + * @param projectID Project ID (required) + * @param portalLinkID portal link id (required) + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response revokePortalLink(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID) throws ApiException { + return revokePortalLink(projectID, portalLinkID, null); + } + + /** + * Revoke a portal link + * This endpoint revokes a portal link + * @param projectID Project ID (required) + * @param portalLinkID portal link id (required) + * @param headers Optional headers to include in the request + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response revokePortalLink(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID, Map headers) throws ApiException { + ApiResponse localVarResponse = revokePortalLinkWithHttpInfo(projectID, portalLinkID, headers); + return localVarResponse.getData(); + } + + /** + * Revoke a portal link + * This endpoint revokes a portal link + * @param projectID Project ID (required) + * @param portalLinkID portal link id (required) + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse revokePortalLinkWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID) throws ApiException { + return revokePortalLinkWithHttpInfo(projectID, portalLinkID, null); + } + + /** + * Revoke a portal link + * This endpoint revokes a portal link + * @param projectID Project ID (required) + * @param portalLinkID portal link id (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse revokePortalLinkWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = revokePortalLinkRequestBuilder(projectID, portalLinkID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("revokePortalLink", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetProjects400Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder revokePortalLinkRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling revokePortalLink"); + } + // verify the required parameter 'portalLinkID' is set + if (portalLinkID == null) { + throw new ApiException(400, "Missing the required parameter 'portalLinkID' when calling revokePortalLink"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/portal-links/{portalLinkID}/revoke" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{portalLinkID}", ApiClient.urlEncode(portalLinkID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update a portal link + * This endpoint updates a portal link + * @param projectID Project ID (required) + * @param portalLinkID portal link id (required) + * @param datastoreUpdatePortalLinkRequest Portal Link Details (required) + * @return CreatePortalLink201Response + * @throws ApiException if fails to make API call + */ + public CreatePortalLink201Response updatePortalLink(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID, @jakarta.annotation.Nonnull DatastoreUpdatePortalLinkRequest datastoreUpdatePortalLinkRequest) throws ApiException { + return updatePortalLink(projectID, portalLinkID, datastoreUpdatePortalLinkRequest, null); + } + + /** + * Update a portal link + * This endpoint updates a portal link + * @param projectID Project ID (required) + * @param portalLinkID portal link id (required) + * @param datastoreUpdatePortalLinkRequest Portal Link Details (required) + * @param headers Optional headers to include in the request + * @return CreatePortalLink201Response + * @throws ApiException if fails to make API call + */ + public CreatePortalLink201Response updatePortalLink(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID, @jakarta.annotation.Nonnull DatastoreUpdatePortalLinkRequest datastoreUpdatePortalLinkRequest, Map headers) throws ApiException { + ApiResponse localVarResponse = updatePortalLinkWithHttpInfo(projectID, portalLinkID, datastoreUpdatePortalLinkRequest, headers); + return localVarResponse.getData(); + } + + /** + * Update a portal link + * This endpoint updates a portal link + * @param projectID Project ID (required) + * @param portalLinkID portal link id (required) + * @param datastoreUpdatePortalLinkRequest Portal Link Details (required) + * @return ApiResponse<CreatePortalLink201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse updatePortalLinkWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID, @jakarta.annotation.Nonnull DatastoreUpdatePortalLinkRequest datastoreUpdatePortalLinkRequest) throws ApiException { + return updatePortalLinkWithHttpInfo(projectID, portalLinkID, datastoreUpdatePortalLinkRequest, null); + } + + /** + * Update a portal link + * This endpoint updates a portal link + * @param projectID Project ID (required) + * @param portalLinkID portal link id (required) + * @param datastoreUpdatePortalLinkRequest Portal Link Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreatePortalLink201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse updatePortalLinkWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID, @jakarta.annotation.Nonnull DatastoreUpdatePortalLinkRequest datastoreUpdatePortalLinkRequest, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updatePortalLinkRequestBuilder(projectID, portalLinkID, datastoreUpdatePortalLinkRequest, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("updatePortalLink", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreatePortalLink201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updatePortalLinkRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String portalLinkID, @jakarta.annotation.Nonnull DatastoreUpdatePortalLinkRequest datastoreUpdatePortalLinkRequest, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling updatePortalLink"); + } + // verify the required parameter 'portalLinkID' is set + if (portalLinkID == null) { + throw new ApiException(400, "Missing the required parameter 'portalLinkID' when calling updatePortalLink"); + } + // verify the required parameter 'datastoreUpdatePortalLinkRequest' is set + if (datastoreUpdatePortalLinkRequest == null) { + throw new ApiException(400, "Missing the required parameter 'datastoreUpdatePortalLinkRequest' when calling updatePortalLink"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/portal-links/{portalLinkID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{portalLinkID}", ApiClient.urlEncode(portalLinkID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(datastoreUpdatePortalLinkRequest); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/src/main/java/com/getconvoy/api/ProjectsApi.java b/src/main/java/com/getconvoy/api/ProjectsApi.java new file mode 100644 index 0000000..247c0cd --- /dev/null +++ b/src/main/java/com/getconvoy/api/ProjectsApi.java @@ -0,0 +1,816 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.getconvoy.api; + +import com.getconvoy.client.ApiClient; +import com.getconvoy.client.ApiException; +import com.getconvoy.client.ApiResponse; +import com.getconvoy.client.Configuration; +import com.getconvoy.client.Pair; + +import com.getconvoy.models.CreateProject201Response; +import com.getconvoy.models.GetProject200Response; +import com.getconvoy.models.GetProjects200Response; +import com.getconvoy.models.GetProjects400Response; +import com.getconvoy.models.ModelsCreateProject; +import com.getconvoy.models.ModelsUpdateProject; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ProjectsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ProjectsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ProjectsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Create a project + * This endpoint creates a project. Authenticate with a personal API key or JWT and pass the organisation id as the orgID query parameter. The response includes the project and a one-time project API key. + * @param orgID Organisation ID (required) + * @param modelsCreateProject Project Details (required) + * @return CreateProject201Response + * @throws ApiException if fails to make API call + */ + public CreateProject201Response createProject(@jakarta.annotation.Nonnull String orgID, @jakarta.annotation.Nonnull ModelsCreateProject modelsCreateProject) throws ApiException { + return createProject(orgID, modelsCreateProject, null); + } + + /** + * Create a project + * This endpoint creates a project. Authenticate with a personal API key or JWT and pass the organisation id as the orgID query parameter. The response includes the project and a one-time project API key. + * @param orgID Organisation ID (required) + * @param modelsCreateProject Project Details (required) + * @param headers Optional headers to include in the request + * @return CreateProject201Response + * @throws ApiException if fails to make API call + */ + public CreateProject201Response createProject(@jakarta.annotation.Nonnull String orgID, @jakarta.annotation.Nonnull ModelsCreateProject modelsCreateProject, Map headers) throws ApiException { + ApiResponse localVarResponse = createProjectWithHttpInfo(orgID, modelsCreateProject, headers); + return localVarResponse.getData(); + } + + /** + * Create a project + * This endpoint creates a project. Authenticate with a personal API key or JWT and pass the organisation id as the orgID query parameter. The response includes the project and a one-time project API key. + * @param orgID Organisation ID (required) + * @param modelsCreateProject Project Details (required) + * @return ApiResponse<CreateProject201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createProjectWithHttpInfo(@jakarta.annotation.Nonnull String orgID, @jakarta.annotation.Nonnull ModelsCreateProject modelsCreateProject) throws ApiException { + return createProjectWithHttpInfo(orgID, modelsCreateProject, null); + } + + /** + * Create a project + * This endpoint creates a project. Authenticate with a personal API key or JWT and pass the organisation id as the orgID query parameter. The response includes the project and a one-time project API key. + * @param orgID Organisation ID (required) + * @param modelsCreateProject Project Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateProject201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createProjectWithHttpInfo(@jakarta.annotation.Nonnull String orgID, @jakarta.annotation.Nonnull ModelsCreateProject modelsCreateProject, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createProjectRequestBuilder(orgID, modelsCreateProject, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createProject", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateProject201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createProjectRequestBuilder(@jakarta.annotation.Nonnull String orgID, @jakarta.annotation.Nonnull ModelsCreateProject modelsCreateProject, Map headers) throws ApiException { + // verify the required parameter 'orgID' is set + if (orgID == null) { + throw new ApiException(400, "Missing the required parameter 'orgID' when calling createProject"); + } + // verify the required parameter 'modelsCreateProject' is set + if (modelsCreateProject == null) { + throw new ApiException(400, "Missing the required parameter 'modelsCreateProject' when calling createProject"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "orgID"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("orgID", orgID)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsCreateProject); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete a project + * This endpoint deletes a project + * @param projectID Project ID (required) + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response deleteProject(@jakarta.annotation.Nonnull String projectID) throws ApiException { + return deleteProject(projectID, null); + } + + /** + * Delete a project + * This endpoint deletes a project + * @param projectID Project ID (required) + * @param headers Optional headers to include in the request + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response deleteProject(@jakarta.annotation.Nonnull String projectID, Map headers) throws ApiException { + ApiResponse localVarResponse = deleteProjectWithHttpInfo(projectID, headers); + return localVarResponse.getData(); + } + + /** + * Delete a project + * This endpoint deletes a project + * @param projectID Project ID (required) + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteProjectWithHttpInfo(@jakarta.annotation.Nonnull String projectID) throws ApiException { + return deleteProjectWithHttpInfo(projectID, null); + } + + /** + * Delete a project + * This endpoint deletes a project + * @param projectID Project ID (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteProjectWithHttpInfo(@jakarta.annotation.Nonnull String projectID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteProjectRequestBuilder(projectID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("deleteProject", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetProjects400Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteProjectRequestBuilder(@jakarta.annotation.Nonnull String projectID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling deleteProject"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Retrieve a project + * This endpoint fetches a project by its id + * @param projectID Project ID (required) + * @return GetProject200Response + * @throws ApiException if fails to make API call + */ + public GetProject200Response getProject(@jakarta.annotation.Nonnull String projectID) throws ApiException { + return getProject(projectID, null); + } + + /** + * Retrieve a project + * This endpoint fetches a project by its id + * @param projectID Project ID (required) + * @param headers Optional headers to include in the request + * @return GetProject200Response + * @throws ApiException if fails to make API call + */ + public GetProject200Response getProject(@jakarta.annotation.Nonnull String projectID, Map headers) throws ApiException { + ApiResponse localVarResponse = getProjectWithHttpInfo(projectID, headers); + return localVarResponse.getData(); + } + + /** + * Retrieve a project + * This endpoint fetches a project by its id + * @param projectID Project ID (required) + * @return ApiResponse<GetProject200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getProjectWithHttpInfo(@jakarta.annotation.Nonnull String projectID) throws ApiException { + return getProjectWithHttpInfo(projectID, null); + } + + /** + * Retrieve a project + * This endpoint fetches a project by its id + * @param projectID Project ID (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetProject200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getProjectWithHttpInfo(@jakarta.annotation.Nonnull String projectID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getProjectRequestBuilder(projectID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getProject", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetProject200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getProjectRequestBuilder(@jakarta.annotation.Nonnull String projectID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getProject"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List all projects + * This endpoint fetches projects for an organisation. Authenticate with a personal API key or JWT and pass the organisation id as the orgID query parameter. + * @param orgID Organisation ID (required) + * @return GetProjects200Response + * @throws ApiException if fails to make API call + */ + public GetProjects200Response getProjects(@jakarta.annotation.Nonnull String orgID) throws ApiException { + return getProjects(orgID, null); + } + + /** + * List all projects + * This endpoint fetches projects for an organisation. Authenticate with a personal API key or JWT and pass the organisation id as the orgID query parameter. + * @param orgID Organisation ID (required) + * @param headers Optional headers to include in the request + * @return GetProjects200Response + * @throws ApiException if fails to make API call + */ + public GetProjects200Response getProjects(@jakarta.annotation.Nonnull String orgID, Map headers) throws ApiException { + ApiResponse localVarResponse = getProjectsWithHttpInfo(orgID, headers); + return localVarResponse.getData(); + } + + /** + * List all projects + * This endpoint fetches projects for an organisation. Authenticate with a personal API key or JWT and pass the organisation id as the orgID query parameter. + * @param orgID Organisation ID (required) + * @return ApiResponse<GetProjects200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getProjectsWithHttpInfo(@jakarta.annotation.Nonnull String orgID) throws ApiException { + return getProjectsWithHttpInfo(orgID, null); + } + + /** + * List all projects + * This endpoint fetches projects for an organisation. Authenticate with a personal API key or JWT and pass the organisation id as the orgID query parameter. + * @param orgID Organisation ID (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetProjects200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getProjectsWithHttpInfo(@jakarta.annotation.Nonnull String orgID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getProjectsRequestBuilder(orgID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getProjects", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetProjects200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getProjectsRequestBuilder(@jakarta.annotation.Nonnull String orgID, Map headers) throws ApiException { + // verify the required parameter 'orgID' is set + if (orgID == null) { + throw new ApiException(400, "Missing the required parameter 'orgID' when calling getProjects"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "orgID"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("orgID", orgID)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update a project + * This endpoint updates a project's name, logo, and config + * @param projectID Project ID (required) + * @param modelsUpdateProject Project Details (required) + * @return GetProject200Response + * @throws ApiException if fails to make API call + */ + public GetProject200Response updateProject(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsUpdateProject modelsUpdateProject) throws ApiException { + return updateProject(projectID, modelsUpdateProject, null); + } + + /** + * Update a project + * This endpoint updates a project's name, logo, and config + * @param projectID Project ID (required) + * @param modelsUpdateProject Project Details (required) + * @param headers Optional headers to include in the request + * @return GetProject200Response + * @throws ApiException if fails to make API call + */ + public GetProject200Response updateProject(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsUpdateProject modelsUpdateProject, Map headers) throws ApiException { + ApiResponse localVarResponse = updateProjectWithHttpInfo(projectID, modelsUpdateProject, headers); + return localVarResponse.getData(); + } + + /** + * Update a project + * This endpoint updates a project's name, logo, and config + * @param projectID Project ID (required) + * @param modelsUpdateProject Project Details (required) + * @return ApiResponse<GetProject200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateProjectWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsUpdateProject modelsUpdateProject) throws ApiException { + return updateProjectWithHttpInfo(projectID, modelsUpdateProject, null); + } + + /** + * Update a project + * This endpoint updates a project's name, logo, and config + * @param projectID Project ID (required) + * @param modelsUpdateProject Project Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetProject200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateProjectWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsUpdateProject modelsUpdateProject, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateProjectRequestBuilder(projectID, modelsUpdateProject, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("updateProject", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetProject200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateProjectRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsUpdateProject modelsUpdateProject, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling updateProject"); + } + // verify the required parameter 'modelsUpdateProject' is set + if (modelsUpdateProject == null) { + throw new ApiException(400, "Missing the required parameter 'modelsUpdateProject' when calling updateProject"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsUpdateProject); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/src/main/java/com/getconvoy/api/SourcesApi.java b/src/main/java/com/getconvoy/api/SourcesApi.java new file mode 100644 index 0000000..d3cb073 --- /dev/null +++ b/src/main/java/com/getconvoy/api/SourcesApi.java @@ -0,0 +1,869 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.getconvoy.api; + +import com.getconvoy.client.ApiClient; +import com.getconvoy.client.ApiException; +import com.getconvoy.client.ApiResponse; +import com.getconvoy.client.Configuration; +import com.getconvoy.client.Pair; + +import com.getconvoy.models.CreateSource201Response; +import com.getconvoy.models.GetProjects400Response; +import com.getconvoy.models.LoadSourcesPaged200Response; +import com.getconvoy.models.ModelsCreateSource; +import com.getconvoy.models.ModelsUpdateSource; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class SourcesApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public SourcesApi() { + this(Configuration.getDefaultApiClient()); + } + + public SourcesApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Create a source + * This endpoint creates a source + * @param projectID Project ID (required) + * @param modelsCreateSource Source Details (required) + * @return CreateSource201Response + * @throws ApiException if fails to make API call + */ + public CreateSource201Response createSource(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateSource modelsCreateSource) throws ApiException { + return createSource(projectID, modelsCreateSource, null); + } + + /** + * Create a source + * This endpoint creates a source + * @param projectID Project ID (required) + * @param modelsCreateSource Source Details (required) + * @param headers Optional headers to include in the request + * @return CreateSource201Response + * @throws ApiException if fails to make API call + */ + public CreateSource201Response createSource(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateSource modelsCreateSource, Map headers) throws ApiException { + ApiResponse localVarResponse = createSourceWithHttpInfo(projectID, modelsCreateSource, headers); + return localVarResponse.getData(); + } + + /** + * Create a source + * This endpoint creates a source + * @param projectID Project ID (required) + * @param modelsCreateSource Source Details (required) + * @return ApiResponse<CreateSource201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createSourceWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateSource modelsCreateSource) throws ApiException { + return createSourceWithHttpInfo(projectID, modelsCreateSource, null); + } + + /** + * Create a source + * This endpoint creates a source + * @param projectID Project ID (required) + * @param modelsCreateSource Source Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateSource201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createSourceWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateSource modelsCreateSource, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createSourceRequestBuilder(projectID, modelsCreateSource, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createSource", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateSource201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createSourceRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateSource modelsCreateSource, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling createSource"); + } + // verify the required parameter 'modelsCreateSource' is set + if (modelsCreateSource == null) { + throw new ApiException(400, "Missing the required parameter 'modelsCreateSource' when calling createSource"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/sources" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsCreateSource); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete a source + * This endpoint deletes a source + * @param projectID Project ID (required) + * @param sourceID source id (required) + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response deleteSource(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String sourceID) throws ApiException { + return deleteSource(projectID, sourceID, null); + } + + /** + * Delete a source + * This endpoint deletes a source + * @param projectID Project ID (required) + * @param sourceID source id (required) + * @param headers Optional headers to include in the request + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response deleteSource(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String sourceID, Map headers) throws ApiException { + ApiResponse localVarResponse = deleteSourceWithHttpInfo(projectID, sourceID, headers); + return localVarResponse.getData(); + } + + /** + * Delete a source + * This endpoint deletes a source + * @param projectID Project ID (required) + * @param sourceID source id (required) + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteSourceWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String sourceID) throws ApiException { + return deleteSourceWithHttpInfo(projectID, sourceID, null); + } + + /** + * Delete a source + * This endpoint deletes a source + * @param projectID Project ID (required) + * @param sourceID source id (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteSourceWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String sourceID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteSourceRequestBuilder(projectID, sourceID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("deleteSource", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetProjects400Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteSourceRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String sourceID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling deleteSource"); + } + // verify the required parameter 'sourceID' is set + if (sourceID == null) { + throw new ApiException(400, "Missing the required parameter 'sourceID' when calling deleteSource"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/sources/{sourceID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{sourceID}", ApiClient.urlEncode(sourceID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Retrieve a source + * This endpoint retrieves a source by its id + * @param projectID Project ID (required) + * @param sourceID Source ID (required) + * @return CreateSource201Response + * @throws ApiException if fails to make API call + */ + public CreateSource201Response getSource(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String sourceID) throws ApiException { + return getSource(projectID, sourceID, null); + } + + /** + * Retrieve a source + * This endpoint retrieves a source by its id + * @param projectID Project ID (required) + * @param sourceID Source ID (required) + * @param headers Optional headers to include in the request + * @return CreateSource201Response + * @throws ApiException if fails to make API call + */ + public CreateSource201Response getSource(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String sourceID, Map headers) throws ApiException { + ApiResponse localVarResponse = getSourceWithHttpInfo(projectID, sourceID, headers); + return localVarResponse.getData(); + } + + /** + * Retrieve a source + * This endpoint retrieves a source by its id + * @param projectID Project ID (required) + * @param sourceID Source ID (required) + * @return ApiResponse<CreateSource201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSourceWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String sourceID) throws ApiException { + return getSourceWithHttpInfo(projectID, sourceID, null); + } + + /** + * Retrieve a source + * This endpoint retrieves a source by its id + * @param projectID Project ID (required) + * @param sourceID Source ID (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateSource201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSourceWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String sourceID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSourceRequestBuilder(projectID, sourceID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getSource", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateSource201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSourceRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String sourceID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getSource"); + } + // verify the required parameter 'sourceID' is set + if (sourceID == null) { + throw new ApiException(400, "Missing the required parameter 'sourceID' when calling getSource"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/sources/{sourceID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{sourceID}", ApiClient.urlEncode(sourceID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List all sources + * This endpoint fetches multiple sources + * @param projectID Project ID (required) + * @param direction (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param provider The custom source provider e.g. twitter, shopify (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param type The source type e.g. http, pub_sub (optional) + * @return LoadSourcesPaged200Response + * @throws ApiException if fails to make API call + */ + public LoadSourcesPaged200Response loadSourcesPaged(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String provider, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String type) throws ApiException { + return loadSourcesPaged(projectID, direction, nextPageCursor, perPage, prevPageCursor, provider, sort, type, null); + } + + /** + * List all sources + * This endpoint fetches multiple sources + * @param projectID Project ID (required) + * @param direction (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param provider The custom source provider e.g. twitter, shopify (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param type The source type e.g. http, pub_sub (optional) + * @param headers Optional headers to include in the request + * @return LoadSourcesPaged200Response + * @throws ApiException if fails to make API call + */ + public LoadSourcesPaged200Response loadSourcesPaged(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String provider, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String type, Map headers) throws ApiException { + ApiResponse localVarResponse = loadSourcesPagedWithHttpInfo(projectID, direction, nextPageCursor, perPage, prevPageCursor, provider, sort, type, headers); + return localVarResponse.getData(); + } + + /** + * List all sources + * This endpoint fetches multiple sources + * @param projectID Project ID (required) + * @param direction (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param provider The custom source provider e.g. twitter, shopify (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param type The source type e.g. http, pub_sub (optional) + * @return ApiResponse<LoadSourcesPaged200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse loadSourcesPagedWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String provider, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String type) throws ApiException { + return loadSourcesPagedWithHttpInfo(projectID, direction, nextPageCursor, perPage, prevPageCursor, provider, sort, type, null); + } + + /** + * List all sources + * This endpoint fetches multiple sources + * @param projectID Project ID (required) + * @param direction (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param provider The custom source provider e.g. twitter, shopify (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param type The source type e.g. http, pub_sub (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<LoadSourcesPaged200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse loadSourcesPagedWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String provider, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String type, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = loadSourcesPagedRequestBuilder(projectID, direction, nextPageCursor, perPage, prevPageCursor, provider, sort, type, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("loadSourcesPaged", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + LoadSourcesPaged200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder loadSourcesPagedRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String provider, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String type, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling loadSourcesPaged"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/sources" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "direction"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("direction", direction)); + localVarQueryParameterBaseName = "next_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("next_page_cursor", nextPageCursor)); + localVarQueryParameterBaseName = "perPage"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("perPage", perPage)); + localVarQueryParameterBaseName = "prev_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("prev_page_cursor", prevPageCursor)); + localVarQueryParameterBaseName = "provider"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("provider", provider)); + localVarQueryParameterBaseName = "sort"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sort", sort)); + localVarQueryParameterBaseName = "type"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("type", type)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update a source + * This endpoint updates a source + * @param projectID Project ID (required) + * @param sourceID source id (required) + * @param modelsUpdateSource Source Details (required) + * @return CreateSource201Response + * @throws ApiException if fails to make API call + */ + public CreateSource201Response updateSource(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String sourceID, @jakarta.annotation.Nonnull ModelsUpdateSource modelsUpdateSource) throws ApiException { + return updateSource(projectID, sourceID, modelsUpdateSource, null); + } + + /** + * Update a source + * This endpoint updates a source + * @param projectID Project ID (required) + * @param sourceID source id (required) + * @param modelsUpdateSource Source Details (required) + * @param headers Optional headers to include in the request + * @return CreateSource201Response + * @throws ApiException if fails to make API call + */ + public CreateSource201Response updateSource(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String sourceID, @jakarta.annotation.Nonnull ModelsUpdateSource modelsUpdateSource, Map headers) throws ApiException { + ApiResponse localVarResponse = updateSourceWithHttpInfo(projectID, sourceID, modelsUpdateSource, headers); + return localVarResponse.getData(); + } + + /** + * Update a source + * This endpoint updates a source + * @param projectID Project ID (required) + * @param sourceID source id (required) + * @param modelsUpdateSource Source Details (required) + * @return ApiResponse<CreateSource201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateSourceWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String sourceID, @jakarta.annotation.Nonnull ModelsUpdateSource modelsUpdateSource) throws ApiException { + return updateSourceWithHttpInfo(projectID, sourceID, modelsUpdateSource, null); + } + + /** + * Update a source + * This endpoint updates a source + * @param projectID Project ID (required) + * @param sourceID source id (required) + * @param modelsUpdateSource Source Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateSource201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateSourceWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String sourceID, @jakarta.annotation.Nonnull ModelsUpdateSource modelsUpdateSource, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateSourceRequestBuilder(projectID, sourceID, modelsUpdateSource, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("updateSource", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateSource201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateSourceRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String sourceID, @jakarta.annotation.Nonnull ModelsUpdateSource modelsUpdateSource, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling updateSource"); + } + // verify the required parameter 'sourceID' is set + if (sourceID == null) { + throw new ApiException(400, "Missing the required parameter 'sourceID' when calling updateSource"); + } + // verify the required parameter 'modelsUpdateSource' is set + if (modelsUpdateSource == null) { + throw new ApiException(400, "Missing the required parameter 'modelsUpdateSource' when calling updateSource"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/sources/{sourceID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{sourceID}", ApiClient.urlEncode(sourceID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsUpdateSource); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/src/main/java/com/getconvoy/api/SubscriptionsApi.java b/src/main/java/com/getconvoy/api/SubscriptionsApi.java new file mode 100644 index 0000000..dfb94b7 --- /dev/null +++ b/src/main/java/com/getconvoy/api/SubscriptionsApi.java @@ -0,0 +1,1396 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.getconvoy.api; + +import com.getconvoy.client.ApiClient; +import com.getconvoy.client.ApiException; +import com.getconvoy.client.ApiResponse; +import com.getconvoy.client.Configuration; +import com.getconvoy.client.Pair; + +import com.getconvoy.models.CreateSubscription201Response; +import com.getconvoy.models.GetProjects400Response; +import com.getconvoy.models.GetSubscriptions200Response; +import com.getconvoy.models.ModelsCreateSubscription; +import com.getconvoy.models.ModelsFunctionRequest; +import com.getconvoy.models.ModelsTestFilter; +import com.getconvoy.models.ModelsUpdateSubscription; +import com.getconvoy.models.TestSubscriptionFilter200Response; +import com.getconvoy.models.V1ProjectsProjectIDSourcesTestFunctionPost200Response; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class SubscriptionsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public SubscriptionsApi() { + this(Configuration.getDefaultApiClient()); + } + + public SubscriptionsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Create a subscription + * This endpoint creates a subscriptions + * @param projectID Project ID (required) + * @param modelsCreateSubscription Subscription details (required) + * @return CreateSubscription201Response + * @throws ApiException if fails to make API call + */ + public CreateSubscription201Response createSubscription(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateSubscription modelsCreateSubscription) throws ApiException { + return createSubscription(projectID, modelsCreateSubscription, null); + } + + /** + * Create a subscription + * This endpoint creates a subscriptions + * @param projectID Project ID (required) + * @param modelsCreateSubscription Subscription details (required) + * @param headers Optional headers to include in the request + * @return CreateSubscription201Response + * @throws ApiException if fails to make API call + */ + public CreateSubscription201Response createSubscription(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateSubscription modelsCreateSubscription, Map headers) throws ApiException { + ApiResponse localVarResponse = createSubscriptionWithHttpInfo(projectID, modelsCreateSubscription, headers); + return localVarResponse.getData(); + } + + /** + * Create a subscription + * This endpoint creates a subscriptions + * @param projectID Project ID (required) + * @param modelsCreateSubscription Subscription details (required) + * @return ApiResponse<CreateSubscription201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createSubscriptionWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateSubscription modelsCreateSubscription) throws ApiException { + return createSubscriptionWithHttpInfo(projectID, modelsCreateSubscription, null); + } + + /** + * Create a subscription + * This endpoint creates a subscriptions + * @param projectID Project ID (required) + * @param modelsCreateSubscription Subscription details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateSubscription201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createSubscriptionWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateSubscription modelsCreateSubscription, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createSubscriptionRequestBuilder(projectID, modelsCreateSubscription, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createSubscription", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateSubscription201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createSubscriptionRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateSubscription modelsCreateSubscription, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling createSubscription"); + } + // verify the required parameter 'modelsCreateSubscription' is set + if (modelsCreateSubscription == null) { + throw new ApiException(400, "Missing the required parameter 'modelsCreateSubscription' when calling createSubscription"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/subscriptions" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsCreateSubscription); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete subscription + * This endpoint deletes a subscription + * @param projectID Project ID (required) + * @param subscriptionID subscription id (required) + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response deleteSubscription(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID) throws ApiException { + return deleteSubscription(projectID, subscriptionID, null); + } + + /** + * Delete subscription + * This endpoint deletes a subscription + * @param projectID Project ID (required) + * @param subscriptionID subscription id (required) + * @param headers Optional headers to include in the request + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response deleteSubscription(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, Map headers) throws ApiException { + ApiResponse localVarResponse = deleteSubscriptionWithHttpInfo(projectID, subscriptionID, headers); + return localVarResponse.getData(); + } + + /** + * Delete subscription + * This endpoint deletes a subscription + * @param projectID Project ID (required) + * @param subscriptionID subscription id (required) + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteSubscriptionWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID) throws ApiException { + return deleteSubscriptionWithHttpInfo(projectID, subscriptionID, null); + } + + /** + * Delete subscription + * This endpoint deletes a subscription + * @param projectID Project ID (required) + * @param subscriptionID subscription id (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteSubscriptionWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteSubscriptionRequestBuilder(projectID, subscriptionID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("deleteSubscription", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetProjects400Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteSubscriptionRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling deleteSubscription"); + } + // verify the required parameter 'subscriptionID' is set + if (subscriptionID == null) { + throw new ApiException(400, "Missing the required parameter 'subscriptionID' when calling deleteSubscription"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/subscriptions/{subscriptionID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{subscriptionID}", ApiClient.urlEncode(subscriptionID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Retrieve a subscription + * This endpoint retrieves a single subscription + * @param projectID Project ID (required) + * @param subscriptionID subscription id (required) + * @return CreateSubscription201Response + * @throws ApiException if fails to make API call + */ + public CreateSubscription201Response getSubscription(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID) throws ApiException { + return getSubscription(projectID, subscriptionID, null); + } + + /** + * Retrieve a subscription + * This endpoint retrieves a single subscription + * @param projectID Project ID (required) + * @param subscriptionID subscription id (required) + * @param headers Optional headers to include in the request + * @return CreateSubscription201Response + * @throws ApiException if fails to make API call + */ + public CreateSubscription201Response getSubscription(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, Map headers) throws ApiException { + ApiResponse localVarResponse = getSubscriptionWithHttpInfo(projectID, subscriptionID, headers); + return localVarResponse.getData(); + } + + /** + * Retrieve a subscription + * This endpoint retrieves a single subscription + * @param projectID Project ID (required) + * @param subscriptionID subscription id (required) + * @return ApiResponse<CreateSubscription201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSubscriptionWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID) throws ApiException { + return getSubscriptionWithHttpInfo(projectID, subscriptionID, null); + } + + /** + * Retrieve a subscription + * This endpoint retrieves a single subscription + * @param projectID Project ID (required) + * @param subscriptionID subscription id (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateSubscription201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSubscriptionWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSubscriptionRequestBuilder(projectID, subscriptionID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getSubscription", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateSubscription201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSubscriptionRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getSubscription"); + } + // verify the required parameter 'subscriptionID' is set + if (subscriptionID == null) { + throw new ApiException(400, "Missing the required parameter 'subscriptionID' when calling getSubscription"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/subscriptions/{subscriptionID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{subscriptionID}", ApiClient.urlEncode(subscriptionID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List all subscriptions + * This endpoint fetches all the subscriptions + * @param projectID Project ID (required) + * @param direction (optional) + * @param endpointId A list of endpointIDs to filter by (optional) + * @param name Subscription name to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @return GetSubscriptions200Response + * @throws ApiException if fails to make API call + */ + public GetSubscriptions200Response getSubscriptions(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String name, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort) throws ApiException { + return getSubscriptions(projectID, direction, endpointId, name, nextPageCursor, perPage, prevPageCursor, sort, null); + } + + /** + * List all subscriptions + * This endpoint fetches all the subscriptions + * @param projectID Project ID (required) + * @param direction (optional) + * @param endpointId A list of endpointIDs to filter by (optional) + * @param name Subscription name to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param headers Optional headers to include in the request + * @return GetSubscriptions200Response + * @throws ApiException if fails to make API call + */ + public GetSubscriptions200Response getSubscriptions(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String name, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, Map headers) throws ApiException { + ApiResponse localVarResponse = getSubscriptionsWithHttpInfo(projectID, direction, endpointId, name, nextPageCursor, perPage, prevPageCursor, sort, headers); + return localVarResponse.getData(); + } + + /** + * List all subscriptions + * This endpoint fetches all the subscriptions + * @param projectID Project ID (required) + * @param direction (optional) + * @param endpointId A list of endpointIDs to filter by (optional) + * @param name Subscription name to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @return ApiResponse<GetSubscriptions200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSubscriptionsWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String name, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort) throws ApiException { + return getSubscriptionsWithHttpInfo(projectID, direction, endpointId, name, nextPageCursor, perPage, prevPageCursor, sort, null); + } + + /** + * List all subscriptions + * This endpoint fetches all the subscriptions + * @param projectID Project ID (required) + * @param direction (optional) + * @param endpointId A list of endpointIDs to filter by (optional) + * @param name Subscription name to filter by (optional) + * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional) + * @param perPage The number of items to return per page (optional) + * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional) + * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetSubscriptions200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSubscriptionsWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String name, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSubscriptionsRequestBuilder(projectID, direction, endpointId, name, nextPageCursor, perPage, prevPageCursor, sort, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getSubscriptions", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetSubscriptions200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSubscriptionsRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String name, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling getSubscriptions"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/subscriptions" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "direction"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("direction", direction)); + localVarQueryParameterBaseName = "endpointId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "endpointId", endpointId)); + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + localVarQueryParameterBaseName = "next_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("next_page_cursor", nextPageCursor)); + localVarQueryParameterBaseName = "perPage"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("perPage", perPage)); + localVarQueryParameterBaseName = "prev_page_cursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("prev_page_cursor", prevPageCursor)); + localVarQueryParameterBaseName = "sort"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sort", sort)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Validate subscription filter + * This endpoint validates that a filter will match a certain payload structure. + * @param projectID Project ID (required) + * @param modelsTestFilter Filter Details (required) + * @return TestSubscriptionFilter200Response + * @throws ApiException if fails to make API call + */ + public TestSubscriptionFilter200Response testSubscriptionFilter(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsTestFilter modelsTestFilter) throws ApiException { + return testSubscriptionFilter(projectID, modelsTestFilter, null); + } + + /** + * Validate subscription filter + * This endpoint validates that a filter will match a certain payload structure. + * @param projectID Project ID (required) + * @param modelsTestFilter Filter Details (required) + * @param headers Optional headers to include in the request + * @return TestSubscriptionFilter200Response + * @throws ApiException if fails to make API call + */ + public TestSubscriptionFilter200Response testSubscriptionFilter(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsTestFilter modelsTestFilter, Map headers) throws ApiException { + ApiResponse localVarResponse = testSubscriptionFilterWithHttpInfo(projectID, modelsTestFilter, headers); + return localVarResponse.getData(); + } + + /** + * Validate subscription filter + * This endpoint validates that a filter will match a certain payload structure. + * @param projectID Project ID (required) + * @param modelsTestFilter Filter Details (required) + * @return ApiResponse<TestSubscriptionFilter200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse testSubscriptionFilterWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsTestFilter modelsTestFilter) throws ApiException { + return testSubscriptionFilterWithHttpInfo(projectID, modelsTestFilter, null); + } + + /** + * Validate subscription filter + * This endpoint validates that a filter will match a certain payload structure. + * @param projectID Project ID (required) + * @param modelsTestFilter Filter Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<TestSubscriptionFilter200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse testSubscriptionFilterWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsTestFilter modelsTestFilter, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testSubscriptionFilterRequestBuilder(projectID, modelsTestFilter, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testSubscriptionFilter", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + TestSubscriptionFilter200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testSubscriptionFilterRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsTestFilter modelsTestFilter, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling testSubscriptionFilter"); + } + // verify the required parameter 'modelsTestFilter' is set + if (modelsTestFilter == null) { + throw new ApiException(400, "Missing the required parameter 'modelsTestFilter' when calling testSubscriptionFilter"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/subscriptions/test_filter" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsTestFilter); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Test a subscription function + * This endpoint test runs a transform function against a payload. + * @param projectID Project ID (required) + * @param modelsFunctionRequest Function Details (required) + * @return V1ProjectsProjectIDSourcesTestFunctionPost200Response + * @throws ApiException if fails to make API call + */ + public V1ProjectsProjectIDSourcesTestFunctionPost200Response testSubscriptionFunction(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsFunctionRequest modelsFunctionRequest) throws ApiException { + return testSubscriptionFunction(projectID, modelsFunctionRequest, null); + } + + /** + * Test a subscription function + * This endpoint test runs a transform function against a payload. + * @param projectID Project ID (required) + * @param modelsFunctionRequest Function Details (required) + * @param headers Optional headers to include in the request + * @return V1ProjectsProjectIDSourcesTestFunctionPost200Response + * @throws ApiException if fails to make API call + */ + public V1ProjectsProjectIDSourcesTestFunctionPost200Response testSubscriptionFunction(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsFunctionRequest modelsFunctionRequest, Map headers) throws ApiException { + ApiResponse localVarResponse = testSubscriptionFunctionWithHttpInfo(projectID, modelsFunctionRequest, headers); + return localVarResponse.getData(); + } + + /** + * Test a subscription function + * This endpoint test runs a transform function against a payload. + * @param projectID Project ID (required) + * @param modelsFunctionRequest Function Details (required) + * @return ApiResponse<V1ProjectsProjectIDSourcesTestFunctionPost200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse testSubscriptionFunctionWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsFunctionRequest modelsFunctionRequest) throws ApiException { + return testSubscriptionFunctionWithHttpInfo(projectID, modelsFunctionRequest, null); + } + + /** + * Test a subscription function + * This endpoint test runs a transform function against a payload. + * @param projectID Project ID (required) + * @param modelsFunctionRequest Function Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<V1ProjectsProjectIDSourcesTestFunctionPost200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse testSubscriptionFunctionWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsFunctionRequest modelsFunctionRequest, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testSubscriptionFunctionRequestBuilder(projectID, modelsFunctionRequest, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testSubscriptionFunction", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + V1ProjectsProjectIDSourcesTestFunctionPost200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testSubscriptionFunctionRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsFunctionRequest modelsFunctionRequest, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling testSubscriptionFunction"); + } + // verify the required parameter 'modelsFunctionRequest' is set + if (modelsFunctionRequest == null) { + throw new ApiException(400, "Missing the required parameter 'modelsFunctionRequest' when calling testSubscriptionFunction"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/subscriptions/test_function" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsFunctionRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Toggle subscription status + * This endpoint toggles a subscription status. Retained for backward compatibility. + * @param projectID Project ID (required) + * @param subscriptionID subscription id (required) + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response toggleSubscriptionStatus(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID) throws ApiException { + return toggleSubscriptionStatus(projectID, subscriptionID, null); + } + + /** + * Toggle subscription status + * This endpoint toggles a subscription status. Retained for backward compatibility. + * @param projectID Project ID (required) + * @param subscriptionID subscription id (required) + * @param headers Optional headers to include in the request + * @return GetProjects400Response + * @throws ApiException if fails to make API call + */ + public GetProjects400Response toggleSubscriptionStatus(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, Map headers) throws ApiException { + ApiResponse localVarResponse = toggleSubscriptionStatusWithHttpInfo(projectID, subscriptionID, headers); + return localVarResponse.getData(); + } + + /** + * Toggle subscription status + * This endpoint toggles a subscription status. Retained for backward compatibility. + * @param projectID Project ID (required) + * @param subscriptionID subscription id (required) + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse toggleSubscriptionStatusWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID) throws ApiException { + return toggleSubscriptionStatusWithHttpInfo(projectID, subscriptionID, null); + } + + /** + * Toggle subscription status + * This endpoint toggles a subscription status. Retained for backward compatibility. + * @param projectID Project ID (required) + * @param subscriptionID subscription id (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<GetProjects400Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse toggleSubscriptionStatusWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = toggleSubscriptionStatusRequestBuilder(projectID, subscriptionID, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("toggleSubscriptionStatus", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + GetProjects400Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder toggleSubscriptionStatusRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling toggleSubscriptionStatus"); + } + // verify the required parameter 'subscriptionID' is set + if (subscriptionID == null) { + throw new ApiException(400, "Missing the required parameter 'subscriptionID' when calling toggleSubscriptionStatus"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/subscriptions/{subscriptionID}/toggle_status" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{subscriptionID}", ApiClient.urlEncode(subscriptionID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update a subscription + * This endpoint updates a subscription + * @param projectID Project ID (required) + * @param subscriptionID subscription id (required) + * @param modelsUpdateSubscription Subscription Details (required) + * @return CreateSubscription201Response + * @throws ApiException if fails to make API call + */ + public CreateSubscription201Response updateSubscription(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull ModelsUpdateSubscription modelsUpdateSubscription) throws ApiException { + return updateSubscription(projectID, subscriptionID, modelsUpdateSubscription, null); + } + + /** + * Update a subscription + * This endpoint updates a subscription + * @param projectID Project ID (required) + * @param subscriptionID subscription id (required) + * @param modelsUpdateSubscription Subscription Details (required) + * @param headers Optional headers to include in the request + * @return CreateSubscription201Response + * @throws ApiException if fails to make API call + */ + public CreateSubscription201Response updateSubscription(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull ModelsUpdateSubscription modelsUpdateSubscription, Map headers) throws ApiException { + ApiResponse localVarResponse = updateSubscriptionWithHttpInfo(projectID, subscriptionID, modelsUpdateSubscription, headers); + return localVarResponse.getData(); + } + + /** + * Update a subscription + * This endpoint updates a subscription + * @param projectID Project ID (required) + * @param subscriptionID subscription id (required) + * @param modelsUpdateSubscription Subscription Details (required) + * @return ApiResponse<CreateSubscription201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateSubscriptionWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull ModelsUpdateSubscription modelsUpdateSubscription) throws ApiException { + return updateSubscriptionWithHttpInfo(projectID, subscriptionID, modelsUpdateSubscription, null); + } + + /** + * Update a subscription + * This endpoint updates a subscription + * @param projectID Project ID (required) + * @param subscriptionID subscription id (required) + * @param modelsUpdateSubscription Subscription Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<CreateSubscription201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateSubscriptionWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull ModelsUpdateSubscription modelsUpdateSubscription, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateSubscriptionRequestBuilder(projectID, subscriptionID, modelsUpdateSubscription, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("updateSubscription", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + CreateSubscription201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateSubscriptionRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String subscriptionID, @jakarta.annotation.Nonnull ModelsUpdateSubscription modelsUpdateSubscription, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling updateSubscription"); + } + // verify the required parameter 'subscriptionID' is set + if (subscriptionID == null) { + throw new ApiException(400, "Missing the required parameter 'subscriptionID' when calling updateSubscription"); + } + // verify the required parameter 'modelsUpdateSubscription' is set + if (modelsUpdateSubscription == null) { + throw new ApiException(400, "Missing the required parameter 'modelsUpdateSubscription' when calling updateSubscription"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/subscriptions/{subscriptionID}" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())) + .replace("{subscriptionID}", ApiClient.urlEncode(subscriptionID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsUpdateSubscription); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Validate source function + * This endpoint validates that a filter will match a certain payload structure. + * @param projectID Project ID (required) + * @param modelsFunctionRequest Function Details (required) + * @return V1ProjectsProjectIDSourcesTestFunctionPost200Response + * @throws ApiException if fails to make API call + */ + public V1ProjectsProjectIDSourcesTestFunctionPost200Response v1ProjectsProjectIDSourcesTestFunctionPost(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsFunctionRequest modelsFunctionRequest) throws ApiException { + return v1ProjectsProjectIDSourcesTestFunctionPost(projectID, modelsFunctionRequest, null); + } + + /** + * Validate source function + * This endpoint validates that a filter will match a certain payload structure. + * @param projectID Project ID (required) + * @param modelsFunctionRequest Function Details (required) + * @param headers Optional headers to include in the request + * @return V1ProjectsProjectIDSourcesTestFunctionPost200Response + * @throws ApiException if fails to make API call + */ + public V1ProjectsProjectIDSourcesTestFunctionPost200Response v1ProjectsProjectIDSourcesTestFunctionPost(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsFunctionRequest modelsFunctionRequest, Map headers) throws ApiException { + ApiResponse localVarResponse = v1ProjectsProjectIDSourcesTestFunctionPostWithHttpInfo(projectID, modelsFunctionRequest, headers); + return localVarResponse.getData(); + } + + /** + * Validate source function + * This endpoint validates that a filter will match a certain payload structure. + * @param projectID Project ID (required) + * @param modelsFunctionRequest Function Details (required) + * @return ApiResponse<V1ProjectsProjectIDSourcesTestFunctionPost200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse v1ProjectsProjectIDSourcesTestFunctionPostWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsFunctionRequest modelsFunctionRequest) throws ApiException { + return v1ProjectsProjectIDSourcesTestFunctionPostWithHttpInfo(projectID, modelsFunctionRequest, null); + } + + /** + * Validate source function + * This endpoint validates that a filter will match a certain payload structure. + * @param projectID Project ID (required) + * @param modelsFunctionRequest Function Details (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<V1ProjectsProjectIDSourcesTestFunctionPost200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse v1ProjectsProjectIDSourcesTestFunctionPostWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsFunctionRequest modelsFunctionRequest, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = v1ProjectsProjectIDSourcesTestFunctionPostRequestBuilder(projectID, modelsFunctionRequest, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("v1ProjectsProjectIDSourcesTestFunctionPost", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + V1ProjectsProjectIDSourcesTestFunctionPost200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder v1ProjectsProjectIDSourcesTestFunctionPostRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsFunctionRequest modelsFunctionRequest, Map headers) throws ApiException { + // verify the required parameter 'projectID' is set + if (projectID == null) { + throw new ApiException(400, "Missing the required parameter 'projectID' when calling v1ProjectsProjectIDSourcesTestFunctionPost"); + } + // verify the required parameter 'modelsFunctionRequest' is set + if (modelsFunctionRequest == null) { + throw new ApiException(400, "Missing the required parameter 'modelsFunctionRequest' when calling v1ProjectsProjectIDSourcesTestFunctionPost"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/projects/{projectID}/sources/test_function" + .replace("{projectID}", ApiClient.urlEncode(projectID.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsFunctionRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/src/main/java/com/getconvoy/client/ApiClient.java b/src/main/java/com/getconvoy/client/ApiClient.java new file mode 100644 index 0000000..a5704eb --- /dev/null +++ b/src/main/java/com/getconvoy/client/ApiClient.java @@ -0,0 +1,488 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.getconvoy.client; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.openapitools.jackson.nullable.JsonNullableModule; + +import java.io.InputStream; +import java.io.IOException; +import java.net.URI; +import java.net.URLEncoder; +import java.net.http.HttpClient; +import java.net.http.HttpConnectTimeoutException; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.StringJoiner; +import java.util.function.Consumer; +import java.util.Optional; +import java.util.zip.GZIPInputStream; +import java.util.stream.Collectors; + +import static java.nio.charset.StandardCharsets.UTF_8; + +/** + * Configuration and utility class for API clients. + * + *

This class can be constructed and modified, then used to instantiate the + * various API classes. The API classes use the settings in this class to + * configure themselves, but otherwise do not store a link to this class.

+ * + *

This class is mutable and not synchronized, so it is not thread-safe. + * The API classes generated from this are immutable and thread-safe.

+ * + *

The setter methods of this class return the current object to facilitate + * a fluent style of configuration.

+ */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ApiClient { + + protected HttpClient.Builder builder; + protected ObjectMapper mapper; + protected String scheme; + protected String host; + protected int port; + protected String basePath; + protected Consumer interceptor; + protected Consumer> responseInterceptor; + protected Consumer> asyncResponseInterceptor; + protected Duration readTimeout; + protected Duration connectTimeout; + + public static String valueToString(Object value) { + if (value == null) { + return ""; + } + if (value instanceof OffsetDateTime) { + return ((OffsetDateTime) value).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + return value.toString(); + } + + /** + * URL encode a string in the UTF-8 encoding. + * + * @param s String to encode. + * @return URL-encoded representation of the input string. + */ + public static String urlEncode(String s) { + return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%20"); + } + + /** + * Convert a URL query name/value parameter to a list of encoded {@link Pair} + * objects. + * + *

The value can be null, in which case an empty list is returned.

+ * + * @param name The query name parameter. + * @param value The query value, which may not be a collection but may be + * null. + * @return A singleton list of the {@link Pair} objects representing the input + * parameters, which is encoded for use in a URL. If the value is null, an + * empty list is returned. + */ + public static List parameterToPairs(String name, Object value) { + if (name == null || name.isEmpty() || value == null) { + return Collections.emptyList(); + } + return Collections.singletonList(new Pair(urlEncode(name), urlEncode(valueToString(value)))); + } + + /** + * Convert a URL query name/collection parameter to a list of encoded + * {@link Pair} objects. + * + * @param collectionFormat The swagger collectionFormat string (csv, tsv, etc). + * @param name The query name parameter. + * @param values A collection of values for the given query name, which may be + * null. + * @return A list of {@link Pair} objects representing the input parameters, + * which is encoded for use in a URL. If the values collection is null, an + * empty list is returned. + */ + public static List parameterToPairs( + String collectionFormat, String name, Collection values) { + if (name == null || name.isEmpty() || values == null || values.isEmpty()) { + return Collections.emptyList(); + } + + // get the collection format (default: csv) + String format = collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat; + + // create the params based on the collection format + if ("multi".equals(format)) { + return values.stream() + .map(value -> new Pair(urlEncode(name), urlEncode(valueToString(value)))) + .collect(Collectors.toList()); + } + + String delimiter; + switch(format) { + case "csv": + delimiter = urlEncode(","); + break; + case "ssv": + delimiter = urlEncode(" "); + break; + case "tsv": + delimiter = urlEncode("\t"); + break; + case "pipes": + delimiter = urlEncode("|"); + break; + default: + throw new IllegalArgumentException("Illegal collection format: " + collectionFormat); + } + + StringJoiner joiner = new StringJoiner(delimiter); + for (Object value : values) { + joiner.add(urlEncode(valueToString(value))); + } + + return Collections.singletonList(new Pair(urlEncode(name), joiner.toString())); + } + + /** + * Create an instance of ApiClient. + */ + public ApiClient() { + this.builder = createDefaultHttpClientBuilder(); + this.mapper = createDefaultObjectMapper(); + updateBaseUri("https://us.getconvoy.cloud/api"); + interceptor = null; + readTimeout = null; + connectTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; + } + + /** + * Create an instance of ApiClient. + * + * @param builder Http client builder. + * @param mapper Object mapper. + * @param baseUri Base URI + */ + public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { + this.builder = builder; + this.mapper = mapper; + updateBaseUri(baseUri != null ? baseUri : "https://us.getconvoy.cloud/api"); + interceptor = null; + readTimeout = null; + connectTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; + } + + public static ObjectMapper createDefaultObjectMapper() { + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); + mapper.registerModule(new JavaTimeModule()); + mapper.registerModule(new JsonNullableModule()); + mapper.registerModule(new RFC3339JavaTimeModule()); + return mapper; + } + + protected final String getDefaultBaseUri() { + return basePath; + } + + public static HttpClient.Builder createDefaultHttpClientBuilder() { + return HttpClient.newBuilder(); + } + + public final void updateBaseUri(String baseUri) { + URI uri = URI.create(baseUri); + scheme = uri.getScheme(); + host = uri.getHost(); + port = uri.getPort(); + basePath = uri.getRawPath(); + } + + /** + * Set a custom {@link HttpClient.Builder} object to use when creating the + * {@link HttpClient} that is used by the API client. + * + * @param builder Custom client builder. + * @return This object. + */ + public ApiClient setHttpClientBuilder(HttpClient.Builder builder) { + this.builder = builder; + return this; + } + + /** + * Get an {@link HttpClient} based on the current {@link HttpClient.Builder}. + * + *

The returned object is immutable and thread-safe.

+ * + * @return The HTTP client. + */ + public HttpClient getHttpClient() { + return builder.build(); + } + + /** + * Set a custom {@link ObjectMapper} to serialize and deserialize the request + * and response bodies. + * + * @param mapper Custom object mapper. + * @return This object. + */ + public ApiClient setObjectMapper(ObjectMapper mapper) { + this.mapper = mapper; + return this; + } + + /** + * Get a copy of the current {@link ObjectMapper}. + * + * @return A copy of the current object mapper. + */ + public ObjectMapper getObjectMapper() { + return mapper.copy(); + } + + /** + * Set a custom host name for the target service. + * + * @param host The host name of the target service. + * @return This object. + */ + public ApiClient setHost(String host) { + this.host = host; + return this; + } + + /** + * Set a custom port number for the target service. + * + * @param port The port of the target service. Set this to -1 to reset the + * value to the default for the scheme. + * @return This object. + */ + public ApiClient setPort(int port) { + this.port = port; + return this; + } + + /** + * Set a custom base path for the target service, for example '/v2'. + * + * @param basePath The base path against which the rest of the path is + * resolved. + * @return This object. + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get the base URI to resolve the endpoint paths against. + * + * @return The complete base URI that the rest of the API parameters are + * resolved against. + */ + public String getBaseUri() { + return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath; + } + + /** + * Set a custom scheme for the target service, for example 'https'. + * + * @param scheme The scheme of the target service + * @return This object. + */ + public ApiClient setScheme(String scheme){ + this.scheme = scheme; + return this; + } + + /** + * Set a custom request interceptor. + * + *

A request interceptor is a mechanism for altering each request before it + * is sent. After the request has been fully configured but not yet built, the + * request builder is passed into this function for further modification, + * after which it is sent out.

+ * + *

This is useful for altering the requests in a custom manner, such as + * adding headers. It could also be used for logging and monitoring.

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. + */ + public ApiClient setRequestInterceptor(Consumer interceptor) { + this.interceptor = interceptor; + return this; + } + + /** + * Get the custom interceptor. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer getRequestInterceptor() { + return interceptor; + } + + /** + * Set a custom response interceptor. + * + *

This is useful for logging, monitoring or extraction of header variables

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. + */ + public ApiClient setResponseInterceptor(Consumer> interceptor) { + this.responseInterceptor = interceptor; + return this; + } + + /** + * Get the custom response interceptor. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer> getResponseInterceptor() { + return responseInterceptor; + } + + /** + * Set a custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. + * + *

This is useful for logging, monitoring or extraction of header variables

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. + */ + public ApiClient setAsyncResponseInterceptor(Consumer> interceptor) { + this.asyncResponseInterceptor = interceptor; + return this; + } + + /** + * Get the custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer> getAsyncResponseInterceptor() { + return asyncResponseInterceptor; + } + + /** + * Set the read timeout for the http client. + * + *

This is the value used by default for each request, though it can be + * overridden on a per-request basis with a request interceptor.

+ * + * @param readTimeout The read timeout used by default by the http client. + * Setting this value to null resets the timeout to an + * effectively infinite value. + * @return This object. + */ + public ApiClient setReadTimeout(Duration readTimeout) { + this.readTimeout = readTimeout; + return this; + } + + /** + * Get the read timeout that was set. + * + * @return The read timeout, or null if no timeout was set. Null represents + * an infinite wait time. + */ + public Duration getReadTimeout() { + return readTimeout; + } + /** + * Sets the connect timeout (in milliseconds) for the http client. + * + *

In the case where a new connection needs to be established, if + * the connection cannot be established within the given {@code + * duration}, then {@link HttpClient#send(HttpRequest,BodyHandler) + * HttpClient::send} throws an {@link HttpConnectTimeoutException}, or + * {@link HttpClient#sendAsync(HttpRequest,BodyHandler) + * HttpClient::sendAsync} completes exceptionally with an + * {@code HttpConnectTimeoutException}. If a new connection does not + * need to be established, for example if a connection can be reused + * from a previous request, then this timeout duration has no effect. + * + * @param connectTimeout connection timeout in milliseconds + * + * @return This object. + */ + public ApiClient setConnectTimeout(Duration connectTimeout) { + this.connectTimeout = connectTimeout; + this.builder.connectTimeout(connectTimeout); + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public Duration getConnectTimeout() { + return connectTimeout; + } + + /** + * Returns the response body InputStream, transparently decoding gzip-compressed + * payloads when the server sets {@code Content-Encoding: gzip}. + * + * @param response HTTP response whose body should be consumed + * @return Original or decompressed InputStream for the response body + * @throws IOException if the response body cannot be accessed or wrapping fails + */ + public static InputStream getResponseBody(HttpResponse response) throws IOException { + if (response == null) { + return null; + } + InputStream body = response.body(); + if (body == null) { + return null; + } + Optional encoding = response.headers().firstValue("Content-Encoding"); + if (encoding.isPresent()) { + for (String token : encoding.get().split(",")) { + if ("gzip".equalsIgnoreCase(token.trim())) { + return new GZIPInputStream(body, 8192); + } + } + } + return body; + } + +} diff --git a/src/main/java/com/getconvoy/client/ApiException.java b/src/main/java/com/getconvoy/client/ApiException.java new file mode 100644 index 0000000..fa50c95 --- /dev/null +++ b/src/main/java/com/getconvoy/client/ApiException.java @@ -0,0 +1,92 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.client; + +import java.net.http.HttpHeaders; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private int code = 0; + private HttpHeaders responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, HttpHeaders responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, HttpHeaders responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, HttpHeaders responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return Headers as an HttpHeaders object + */ + public HttpHeaders getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/src/main/java/com/getconvoy/client/ApiResponse.java b/src/main/java/com/getconvoy/client/ApiResponse.java new file mode 100644 index 0000000..a63ca40 --- /dev/null +++ b/src/main/java/com/getconvoy/client/ApiResponse.java @@ -0,0 +1,60 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + public int getStatusCode() { + return statusCode; + } + + public Map> getHeaders() { + return headers; + } + + public T getData() { + return data; + } +} diff --git a/src/main/java/com/getconvoy/client/Configuration.java b/src/main/java/com/getconvoy/client/Configuration.java new file mode 100644 index 0000000..4808125 --- /dev/null +++ b/src/main/java/com/getconvoy/client/Configuration.java @@ -0,0 +1,63 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.client; + +import java.util.Objects; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class Configuration { + public static final String VERSION = "26.3.5"; + + private static final AtomicReference defaultApiClient = new AtomicReference<>(); + private static volatile Supplier apiClientFactory = ApiClient::new; + + /** + * Get the default API client, which would be used when creating API instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + ApiClient client = defaultApiClient.get(); + if (client == null) { + client = defaultApiClient.updateAndGet(val -> { + if (val != null) { // changed by another thread + return val; + } + return apiClientFactory.get(); + }); + } + return client; + } + + /** + * Set the default API client, which would be used when creating API instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient.set(apiClient); + } + + /** + * set the callback used to create new ApiClient objects + */ + public static void setApiClientFactory(Supplier factory) { + apiClientFactory = Objects.requireNonNull(factory); + } + + private Configuration() { + } +} \ No newline at end of file diff --git a/src/main/java/com/getconvoy/client/JSON.java b/src/main/java/com/getconvoy/client/JSON.java new file mode 100644 index 0000000..e586726 --- /dev/null +++ b/src/main/java/com/getconvoy/client/JSON.java @@ -0,0 +1,264 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.client; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.json.JsonMapper; +import org.openapitools.jackson.nullable.JsonNullableModule; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.getconvoy.models.*; + +import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class JSON { + private ObjectMapper mapper; + + public JSON() { + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .disable(MapperFeature.ALLOW_COERCION_OF_SCALARS) + .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .enable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()) + .build(); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { return mapper; } + + /** + * Returns the target model class that should be used to deserialize the input data. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + * + * @return the target model class. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet>()); + } + return null; + } + + /** + * Helper class to register the discriminator mappings. + */ + @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. + * This function can be invoked for anyOf/oneOf composed models with discriminator mappings. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + * + * @return the target model class. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + * The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, + * so it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + * @param visitedClasses The set of classes that have already been visited. + * + * @return true if inst is an instance of modelClass in the OpenAPI model hierarchy. + */ + public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map> descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (Class childType : descendants.values()) { + if (isInstanceOf(childType, inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** + * A map of discriminators for all model classes. + */ + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); + + /** + * A map of oneOf/anyOf descendants for each model class. + */ + private static Map, Map>> modelDescendants = new HashMap<>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator(Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants(Class modelClass, Map> descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } +} diff --git a/src/main/java/com/getconvoy/client/Pair.java b/src/main/java/com/getconvoy/client/Pair.java new file mode 100644 index 0000000..643a036 --- /dev/null +++ b/src/main/java/com/getconvoy/client/Pair.java @@ -0,0 +1,37 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.client; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class Pair { + private final String name; + private final String value; + + public Pair(String name, String value) { + this.name = isValidString(name) ? name : ""; + this.value = isValidString(value) ? value : ""; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private static boolean isValidString(String arg) { + return arg != null; + } +} diff --git a/src/main/java/com/getconvoy/client/RFC3339DateFormat.java b/src/main/java/com/getconvoy/client/RFC3339DateFormat.java new file mode 100644 index 0000000..d6e92dc --- /dev/null +++ b/src/main/java/com/getconvoy/client/RFC3339DateFormat.java @@ -0,0 +1,57 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.getconvoy.client; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; +import com.fasterxml.jackson.databind.util.StdDateFormat; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} diff --git a/src/main/java/com/getconvoy/client/RFC3339InstantDeserializer.java b/src/main/java/com/getconvoy/client/RFC3339InstantDeserializer.java new file mode 100644 index 0000000..09ebd8d --- /dev/null +++ b/src/main/java/com/getconvoy/client/RFC3339InstantDeserializer.java @@ -0,0 +1,100 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.getconvoy.client; + +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.time.temporal.Temporal; +import java.time.temporal.TemporalAccessor; +import java.util.function.BiFunction; +import java.util.function.Function; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature; +import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class RFC3339InstantDeserializer extends InstantDeserializer { + private static final long serialVersionUID = 1L; + private final static boolean DEFAULT_NORMALIZE_ZONE_ID = JavaTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault(); + private final static boolean DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS + = JavaTimeFeature.ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS.enabledByDefault(); + + public static final RFC3339InstantDeserializer INSTANT = new RFC3339InstantDeserializer<>( + Instant.class, DateTimeFormatter.ISO_INSTANT, + Instant::from, + a -> Instant.ofEpochMilli( a.value ), + a -> Instant.ofEpochSecond( a.integer, a.fraction ), + null, + true, // yes, replace zero offset with Z + DEFAULT_NORMALIZE_ZONE_ID, + DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS + ); + + public static final RFC3339InstantDeserializer OFFSET_DATE_TIME = new RFC3339InstantDeserializer<>( + OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, + OffsetDateTime::from, + a -> OffsetDateTime.ofInstant( Instant.ofEpochMilli( a.value ), a.zoneId ), + a -> OffsetDateTime.ofInstant( Instant.ofEpochSecond( a.integer, a.fraction ), a.zoneId ), + (d, z) -> ( d.isEqual( OffsetDateTime.MIN ) || d.isEqual( OffsetDateTime.MAX ) ? + d : + d.withOffsetSameInstant( z.getRules().getOffset( d.toLocalDateTime() ) ) ), + true, // yes, replace zero offset with Z + DEFAULT_NORMALIZE_ZONE_ID, + DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS + ); + + public static final RFC3339InstantDeserializer ZONED_DATE_TIME = new RFC3339InstantDeserializer<>( + ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, + ZonedDateTime::from, + a -> ZonedDateTime.ofInstant( Instant.ofEpochMilli( a.value ), a.zoneId ), + a -> ZonedDateTime.ofInstant( Instant.ofEpochSecond( a.integer, a.fraction ), a.zoneId ), + ZonedDateTime::withZoneSameInstant, + false, // keep zero offset and Z separate since zones explicitly supported + DEFAULT_NORMALIZE_ZONE_ID, + DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS + ); + + protected RFC3339InstantDeserializer( + Class supportedType, + DateTimeFormatter formatter, + Function parsedToValue, + Function fromMilliseconds, + Function fromNanoseconds, + BiFunction adjust, + boolean replaceZeroOffsetAsZ, + boolean normalizeZoneId, + boolean readNumericStringsAsTimestamp) { + super( + supportedType, + formatter, + parsedToValue, + fromMilliseconds, + fromNanoseconds, + adjust, + replaceZeroOffsetAsZ, + normalizeZoneId, + readNumericStringsAsTimestamp + ); + } + + @Override + protected T _fromString(JsonParser p, DeserializationContext ctxt, String string0) throws IOException { + return super._fromString(p, ctxt, string0.replace( ' ', 'T' )); + } +} \ No newline at end of file diff --git a/src/main/java/com/getconvoy/client/RFC3339JavaTimeModule.java b/src/main/java/com/getconvoy/client/RFC3339JavaTimeModule.java new file mode 100644 index 0000000..2a4b4fb --- /dev/null +++ b/src/main/java/com/getconvoy/client/RFC3339JavaTimeModule.java @@ -0,0 +1,39 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.getconvoy.client; + +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZonedDateTime; + +import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.databind.Module.SetupContext; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class RFC3339JavaTimeModule extends SimpleModule { + private static final long serialVersionUID = 1L; + + public RFC3339JavaTimeModule() { + super("RFC3339JavaTimeModule"); + } + + @Override + public void setupModule(SetupContext context) { + super.setupModule(context); + + addDeserializer(Instant.class, RFC3339InstantDeserializer.INSTANT); + addDeserializer(OffsetDateTime.class, RFC3339InstantDeserializer.OFFSET_DATE_TIME); + addDeserializer(ZonedDateTime.class, RFC3339InstantDeserializer.ZONED_DATE_TIME); + } + +} diff --git a/src/main/java/com/getconvoy/client/ServerConfiguration.java b/src/main/java/com/getconvoy/client/ServerConfiguration.java new file mode 100644 index 0000000..0dd6580 --- /dev/null +++ b/src/main/java/com/getconvoy/client/ServerConfiguration.java @@ -0,0 +1,72 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/src/main/java/com/getconvoy/client/ServerVariable.java b/src/main/java/com/getconvoy/client/ServerVariable.java new file mode 100644 index 0000000..2e86f56 --- /dev/null +++ b/src/main/java/com/getconvoy/client/ServerVariable.java @@ -0,0 +1,37 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/src/main/java/com/getconvoy/models/AbstractOpenApiSchema.java b/src/main/java/com/getconvoy/models/AbstractOpenApiSchema.java new file mode 100644 index 0000000..bcab7a6 --- /dev/null +++ b/src/main/java/com/getconvoy/models/AbstractOpenApiSchema.java @@ -0,0 +1,144 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + @JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/src/main/java/com/getconvoy/models/AuthRoleType.java b/src/main/java/com/getconvoy/models/AuthRoleType.java new file mode 100644 index 0000000..c7d6271 --- /dev/null +++ b/src/main/java/com/getconvoy/models/AuthRoleType.java @@ -0,0 +1,104 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets auth.RoleType + */ +public enum AuthRoleType { + + /** + * Instance level - can manage all orgs and projects + */ + RoleInstanceAdmin("instance_admin"), + + /** + * Organisation level - can manage org and all projects + */ + RoleOrganisationAdmin("organisation_admin"), + + /** + * Organisation level - can manage billing only TODO: + */ + RoleBillingAdmin("billing_admin"), + + /** + * Project level - can manage project settings and users + */ + RoleProjectAdmin("project_admin"), + + /** + * Project level - can view project data only + */ + RoleProjectViewer("project_viewer"), + + /** + * + */ + RoleAPI("api"); + + private String value; + + AuthRoleType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static AuthRoleType fromValue(String value) { + for (AuthRoleType b : AuthRoleType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/BatchReplayEvents200Response.java b/src/main/java/com/getconvoy/models/BatchReplayEvents200Response.java new file mode 100644 index 0000000..b42853d --- /dev/null +++ b/src/main/java/com/getconvoy/models/BatchReplayEvents200Response.java @@ -0,0 +1,220 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * BatchReplayEvents200Response + */ +@JsonPropertyOrder({ + BatchReplayEvents200Response.JSON_PROPERTY_MESSAGE, + BatchReplayEvents200Response.JSON_PROPERTY_STATUS, + BatchReplayEvents200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class BatchReplayEvents200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private String data; + + public BatchReplayEvents200Response() { + } + + public BatchReplayEvents200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public BatchReplayEvents200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public BatchReplayEvents200Response data(@jakarta.annotation.Nullable String data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable String data) { + this.data = data; + } + + + /** + * Return true if this BatchReplayEvents_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchReplayEvents200Response batchReplayEvents200Response = (BatchReplayEvents200Response) o; + return Objects.equals(this.message, batchReplayEvents200Response.message) && + Objects.equals(this.status, batchReplayEvents200Response.status) && + Objects.equals(this.data, batchReplayEvents200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchReplayEvents200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdata%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getData())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/BulkOnboard200Response.java b/src/main/java/com/getconvoy/models/BulkOnboard200Response.java new file mode 100644 index 0000000..e57116f --- /dev/null +++ b/src/main/java/com/getconvoy/models/BulkOnboard200Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsBulkOnboardDryRunResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * BulkOnboard200Response + */ +@JsonPropertyOrder({ + BulkOnboard200Response.JSON_PROPERTY_MESSAGE, + BulkOnboard200Response.JSON_PROPERTY_STATUS, + BulkOnboard200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class BulkOnboard200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private ModelsBulkOnboardDryRunResponse data; + + public BulkOnboard200Response() { + } + + public BulkOnboard200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public BulkOnboard200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public BulkOnboard200Response data(@jakarta.annotation.Nullable ModelsBulkOnboardDryRunResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsBulkOnboardDryRunResponse getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable ModelsBulkOnboardDryRunResponse data) { + this.data = data; + } + + + /** + * Return true if this BulkOnboard_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BulkOnboard200Response bulkOnboard200Response = (BulkOnboard200Response) o; + return Objects.equals(this.message, bulkOnboard200Response.message) && + Objects.equals(this.status, bulkOnboard200Response.status) && + Objects.equals(this.data, bulkOnboard200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkOnboard200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/BulkOnboard202Response.java b/src/main/java/com/getconvoy/models/BulkOnboard202Response.java new file mode 100644 index 0000000..c74e4d9 --- /dev/null +++ b/src/main/java/com/getconvoy/models/BulkOnboard202Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsBulkOnboardAcceptedResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * BulkOnboard202Response + */ +@JsonPropertyOrder({ + BulkOnboard202Response.JSON_PROPERTY_MESSAGE, + BulkOnboard202Response.JSON_PROPERTY_STATUS, + BulkOnboard202Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class BulkOnboard202Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private ModelsBulkOnboardAcceptedResponse data; + + public BulkOnboard202Response() { + } + + public BulkOnboard202Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public BulkOnboard202Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public BulkOnboard202Response data(@jakarta.annotation.Nullable ModelsBulkOnboardAcceptedResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsBulkOnboardAcceptedResponse getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable ModelsBulkOnboardAcceptedResponse data) { + this.data = data; + } + + + /** + * Return true if this BulkOnboard_202_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BulkOnboard202Response bulkOnboard202Response = (BulkOnboard202Response) o; + return Objects.equals(this.message, bulkOnboard202Response.message) && + Objects.equals(this.status, bulkOnboard202Response.status) && + Objects.equals(this.data, bulkOnboard202Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkOnboard202Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ConfigRequestIDHeaderProvider.java b/src/main/java/com/getconvoy/models/ConfigRequestIDHeaderProvider.java new file mode 100644 index 0000000..00fc245 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ConfigRequestIDHeaderProvider.java @@ -0,0 +1,76 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets config.RequestIDHeaderProvider + */ +public enum ConfigRequestIDHeaderProvider { + + DefaultRequestIDHeader("X-Convoy-Idempotency-Key"); + + private String value; + + ConfigRequestIDHeaderProvider(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ConfigRequestIDHeaderProvider fromValue(String value) { + for (ConfigRequestIDHeaderProvider b : ConfigRequestIDHeaderProvider.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/ConfigSignatureHeaderProvider.java b/src/main/java/com/getconvoy/models/ConfigSignatureHeaderProvider.java new file mode 100644 index 0000000..ca334f1 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ConfigSignatureHeaderProvider.java @@ -0,0 +1,76 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets config.SignatureHeaderProvider + */ +public enum ConfigSignatureHeaderProvider { + + DefaultSignatureHeader("X-Convoy-Signature"); + + private String value; + + ConfigSignatureHeaderProvider(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ConfigSignatureHeaderProvider fromValue(String value) { + for (ConfigSignatureHeaderProvider b : ConfigSignatureHeaderProvider.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/CountAffectedEvents200Response.java b/src/main/java/com/getconvoy/models/CountAffectedEvents200Response.java new file mode 100644 index 0000000..6cf902f --- /dev/null +++ b/src/main/java/com/getconvoy/models/CountAffectedEvents200Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsCountResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * CountAffectedEvents200Response + */ +@JsonPropertyOrder({ + CountAffectedEvents200Response.JSON_PROPERTY_MESSAGE, + CountAffectedEvents200Response.JSON_PROPERTY_STATUS, + CountAffectedEvents200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class CountAffectedEvents200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private ModelsCountResponse data; + + public CountAffectedEvents200Response() { + } + + public CountAffectedEvents200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public CountAffectedEvents200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public CountAffectedEvents200Response data(@jakarta.annotation.Nullable ModelsCountResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsCountResponse getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable ModelsCountResponse data) { + this.data = data; + } + + + /** + * Return true if this CountAffectedEvents_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CountAffectedEvents200Response countAffectedEvents200Response = (CountAffectedEvents200Response) o; + return Objects.equals(this.message, countAffectedEvents200Response.message) && + Objects.equals(this.status, countAffectedEvents200Response.status) && + Objects.equals(this.data, countAffectedEvents200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CountAffectedEvents200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/CreateBroadcastEvent201Response.java b/src/main/java/com/getconvoy/models/CreateBroadcastEvent201Response.java new file mode 100644 index 0000000..ae86242 --- /dev/null +++ b/src/main/java/com/getconvoy/models/CreateBroadcastEvent201Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsEventResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * CreateBroadcastEvent201Response + */ +@JsonPropertyOrder({ + CreateBroadcastEvent201Response.JSON_PROPERTY_MESSAGE, + CreateBroadcastEvent201Response.JSON_PROPERTY_STATUS, + CreateBroadcastEvent201Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class CreateBroadcastEvent201Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private ModelsEventResponse data; + + public CreateBroadcastEvent201Response() { + } + + public CreateBroadcastEvent201Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public CreateBroadcastEvent201Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public CreateBroadcastEvent201Response data(@jakarta.annotation.Nullable ModelsEventResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsEventResponse getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable ModelsEventResponse data) { + this.data = data; + } + + + /** + * Return true if this CreateBroadcastEvent_201_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBroadcastEvent201Response createBroadcastEvent201Response = (CreateBroadcastEvent201Response) o; + return Objects.equals(this.message, createBroadcastEvent201Response.message) && + Objects.equals(this.status, createBroadcastEvent201Response.status) && + Objects.equals(this.data, createBroadcastEvent201Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateBroadcastEvent201Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/CreateEndpoint201Response.java b/src/main/java/com/getconvoy/models/CreateEndpoint201Response.java new file mode 100644 index 0000000..e08fbba --- /dev/null +++ b/src/main/java/com/getconvoy/models/CreateEndpoint201Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsEndpointResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * CreateEndpoint201Response + */ +@JsonPropertyOrder({ + CreateEndpoint201Response.JSON_PROPERTY_MESSAGE, + CreateEndpoint201Response.JSON_PROPERTY_STATUS, + CreateEndpoint201Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class CreateEndpoint201Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private ModelsEndpointResponse data; + + public CreateEndpoint201Response() { + } + + public CreateEndpoint201Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public CreateEndpoint201Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public CreateEndpoint201Response data(@jakarta.annotation.Nullable ModelsEndpointResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsEndpointResponse getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable ModelsEndpointResponse data) { + this.data = data; + } + + + /** + * Return true if this CreateEndpoint_201_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEndpoint201Response createEndpoint201Response = (CreateEndpoint201Response) o; + return Objects.equals(this.message, createEndpoint201Response.message) && + Objects.equals(this.status, createEndpoint201Response.status) && + Objects.equals(this.data, createEndpoint201Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEndpoint201Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/CreateEventType201Response.java b/src/main/java/com/getconvoy/models/CreateEventType201Response.java new file mode 100644 index 0000000..23bf66e --- /dev/null +++ b/src/main/java/com/getconvoy/models/CreateEventType201Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsEventTypeResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * CreateEventType201Response + */ +@JsonPropertyOrder({ + CreateEventType201Response.JSON_PROPERTY_MESSAGE, + CreateEventType201Response.JSON_PROPERTY_STATUS, + CreateEventType201Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class CreateEventType201Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private ModelsEventTypeResponse data; + + public CreateEventType201Response() { + } + + public CreateEventType201Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public CreateEventType201Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public CreateEventType201Response data(@jakarta.annotation.Nullable ModelsEventTypeResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsEventTypeResponse getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable ModelsEventTypeResponse data) { + this.data = data; + } + + + /** + * Return true if this CreateEventType_201_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEventType201Response createEventType201Response = (CreateEventType201Response) o; + return Objects.equals(this.message, createEventType201Response.message) && + Objects.equals(this.status, createEventType201Response.status) && + Objects.equals(this.data, createEventType201Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEventType201Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/CreateFilter201Response.java b/src/main/java/com/getconvoy/models/CreateFilter201Response.java new file mode 100644 index 0000000..87bdb92 --- /dev/null +++ b/src/main/java/com/getconvoy/models/CreateFilter201Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsFilterResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * CreateFilter201Response + */ +@JsonPropertyOrder({ + CreateFilter201Response.JSON_PROPERTY_MESSAGE, + CreateFilter201Response.JSON_PROPERTY_STATUS, + CreateFilter201Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class CreateFilter201Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private ModelsFilterResponse data; + + public CreateFilter201Response() { + } + + public CreateFilter201Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public CreateFilter201Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public CreateFilter201Response data(@jakarta.annotation.Nullable ModelsFilterResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsFilterResponse getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable ModelsFilterResponse data) { + this.data = data; + } + + + /** + * Return true if this CreateFilter_201_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateFilter201Response createFilter201Response = (CreateFilter201Response) o; + return Objects.equals(this.message, createFilter201Response.message) && + Objects.equals(this.status, createFilter201Response.status) && + Objects.equals(this.data, createFilter201Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateFilter201Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/CreatePortalLink201Response.java b/src/main/java/com/getconvoy/models/CreatePortalLink201Response.java new file mode 100644 index 0000000..eb8da6b --- /dev/null +++ b/src/main/java/com/getconvoy/models/CreatePortalLink201Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastorePortalLinkResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * CreatePortalLink201Response + */ +@JsonPropertyOrder({ + CreatePortalLink201Response.JSON_PROPERTY_MESSAGE, + CreatePortalLink201Response.JSON_PROPERTY_STATUS, + CreatePortalLink201Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class CreatePortalLink201Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private DatastorePortalLinkResponse data; + + public CreatePortalLink201Response() { + } + + public CreatePortalLink201Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public CreatePortalLink201Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public CreatePortalLink201Response data(@jakarta.annotation.Nullable DatastorePortalLinkResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastorePortalLinkResponse getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable DatastorePortalLinkResponse data) { + this.data = data; + } + + + /** + * Return true if this CreatePortalLink_201_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePortalLink201Response createPortalLink201Response = (CreatePortalLink201Response) o; + return Objects.equals(this.message, createPortalLink201Response.message) && + Objects.equals(this.status, createPortalLink201Response.status) && + Objects.equals(this.data, createPortalLink201Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreatePortalLink201Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/CreateProject201Response.java b/src/main/java/com/getconvoy/models/CreateProject201Response.java new file mode 100644 index 0000000..598e162 --- /dev/null +++ b/src/main/java/com/getconvoy/models/CreateProject201Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsCreateProjectResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * CreateProject201Response + */ +@JsonPropertyOrder({ + CreateProject201Response.JSON_PROPERTY_MESSAGE, + CreateProject201Response.JSON_PROPERTY_STATUS, + CreateProject201Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class CreateProject201Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private ModelsCreateProjectResponse data; + + public CreateProject201Response() { + } + + public CreateProject201Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public CreateProject201Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public CreateProject201Response data(@jakarta.annotation.Nullable ModelsCreateProjectResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsCreateProjectResponse getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable ModelsCreateProjectResponse data) { + this.data = data; + } + + + /** + * Return true if this CreateProject_201_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateProject201Response createProject201Response = (CreateProject201Response) o; + return Objects.equals(this.message, createProject201Response.message) && + Objects.equals(this.status, createProject201Response.status) && + Objects.equals(this.data, createProject201Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateProject201Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/CreateSource201Response.java b/src/main/java/com/getconvoy/models/CreateSource201Response.java new file mode 100644 index 0000000..934ec41 --- /dev/null +++ b/src/main/java/com/getconvoy/models/CreateSource201Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsSourceResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * CreateSource201Response + */ +@JsonPropertyOrder({ + CreateSource201Response.JSON_PROPERTY_MESSAGE, + CreateSource201Response.JSON_PROPERTY_STATUS, + CreateSource201Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class CreateSource201Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private ModelsSourceResponse data; + + public CreateSource201Response() { + } + + public CreateSource201Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public CreateSource201Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public CreateSource201Response data(@jakarta.annotation.Nullable ModelsSourceResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsSourceResponse getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable ModelsSourceResponse data) { + this.data = data; + } + + + /** + * Return true if this CreateSource_201_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSource201Response createSource201Response = (CreateSource201Response) o; + return Objects.equals(this.message, createSource201Response.message) && + Objects.equals(this.status, createSource201Response.status) && + Objects.equals(this.data, createSource201Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSource201Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/CreateSubscription201Response.java b/src/main/java/com/getconvoy/models/CreateSubscription201Response.java new file mode 100644 index 0000000..17a6da7 --- /dev/null +++ b/src/main/java/com/getconvoy/models/CreateSubscription201Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsSubscriptionResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * CreateSubscription201Response + */ +@JsonPropertyOrder({ + CreateSubscription201Response.JSON_PROPERTY_MESSAGE, + CreateSubscription201Response.JSON_PROPERTY_STATUS, + CreateSubscription201Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class CreateSubscription201Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private ModelsSubscriptionResponse data; + + public CreateSubscription201Response() { + } + + public CreateSubscription201Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public CreateSubscription201Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public CreateSubscription201Response data(@jakarta.annotation.Nullable ModelsSubscriptionResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsSubscriptionResponse getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable ModelsSubscriptionResponse data) { + this.data = data; + } + + + /** + * Return true if this CreateSubscription_201_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSubscription201Response createSubscription201Response = (CreateSubscription201Response) o; + return Objects.equals(this.message, createSubscription201Response.message) && + Objects.equals(this.status, createSubscription201Response.status) && + Objects.equals(this.data, createSubscription201Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSubscription201Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreAPIKeyResponse.java b/src/main/java/com/getconvoy/models/DatastoreAPIKeyResponse.java new file mode 100644 index 0000000..deb6ccc --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreAPIKeyResponse.java @@ -0,0 +1,401 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreRole; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreAPIKeyResponse + */ +@JsonPropertyOrder({ + DatastoreAPIKeyResponse.JSON_PROPERTY_CREATED_AT, + DatastoreAPIKeyResponse.JSON_PROPERTY_EXPIRES_AT, + DatastoreAPIKeyResponse.JSON_PROPERTY_KEY, + DatastoreAPIKeyResponse.JSON_PROPERTY_KEY_TYPE, + DatastoreAPIKeyResponse.JSON_PROPERTY_NAME, + DatastoreAPIKeyResponse.JSON_PROPERTY_ROLE, + DatastoreAPIKeyResponse.JSON_PROPERTY_UID, + DatastoreAPIKeyResponse.JSON_PROPERTY_USER_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreAPIKeyResponse { + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @jakarta.annotation.Nullable + private String expiresAt; + + public static final String JSON_PROPERTY_KEY = "key"; + @jakarta.annotation.Nullable + private String key; + + public static final String JSON_PROPERTY_KEY_TYPE = "key_type"; + @jakarta.annotation.Nullable + private String keyType; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_ROLE = "role"; + @jakarta.annotation.Nullable + private DatastoreRole role; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public static final String JSON_PROPERTY_USER_ID = "user_id"; + @jakarta.annotation.Nullable + private String userId; + + public DatastoreAPIKeyResponse() { + } + + public DatastoreAPIKeyResponse createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public DatastoreAPIKeyResponse expiresAt(@jakarta.annotation.Nullable String expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * Get expiresAt + * @return expiresAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EXPIRES_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(value = JSON_PROPERTY_EXPIRES_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@jakarta.annotation.Nullable String expiresAt) { + this.expiresAt = expiresAt; + } + + + public DatastoreAPIKeyResponse key(@jakarta.annotation.Nullable String key) { + this.key = key; + return this; + } + + /** + * Get key + * @return key + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + + @JsonProperty(value = JSON_PROPERTY_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(@jakarta.annotation.Nullable String key) { + this.key = key; + } + + + public DatastoreAPIKeyResponse keyType(@jakarta.annotation.Nullable String keyType) { + this.keyType = keyType; + return this; + } + + /** + * Get keyType + * @return keyType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_KEY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKeyType() { + return keyType; + } + + + @JsonProperty(value = JSON_PROPERTY_KEY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKeyType(@jakarta.annotation.Nullable String keyType) { + this.keyType = keyType; + } + + + public DatastoreAPIKeyResponse name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public DatastoreAPIKeyResponse role(@jakarta.annotation.Nullable DatastoreRole role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ROLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreRole getRole() { + return role; + } + + + @JsonProperty(value = JSON_PROPERTY_ROLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRole(@jakarta.annotation.Nullable DatastoreRole role) { + this.role = role; + } + + + public DatastoreAPIKeyResponse uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + public DatastoreAPIKeyResponse userId(@jakarta.annotation.Nullable String userId) { + this.userId = userId; + return this; + } + + /** + * Get userId + * @return userId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_USER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserId() { + return userId; + } + + + @JsonProperty(value = JSON_PROPERTY_USER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@jakarta.annotation.Nullable String userId) { + this.userId = userId; + } + + + /** + * Return true if this datastore.APIKeyResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreAPIKeyResponse datastoreAPIKeyResponse = (DatastoreAPIKeyResponse) o; + return Objects.equals(this.createdAt, datastoreAPIKeyResponse.createdAt) && + Objects.equals(this.expiresAt, datastoreAPIKeyResponse.expiresAt) && + Objects.equals(this.key, datastoreAPIKeyResponse.key) && + Objects.equals(this.keyType, datastoreAPIKeyResponse.keyType) && + Objects.equals(this.name, datastoreAPIKeyResponse.name) && + Objects.equals(this.role, datastoreAPIKeyResponse.role) && + Objects.equals(this.uid, datastoreAPIKeyResponse.uid) && + Objects.equals(this.userId, datastoreAPIKeyResponse.userId); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, expiresAt, key, keyType, name, role, uid, userId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreAPIKeyResponse {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" keyType: ").append(toIndentedString(keyType)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `expires_at` to the URL query string + if (getExpiresAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sexpires_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getExpiresAt())))); + } + + // add `key` to the URL query string + if (getKey() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%skey%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getKey())))); + } + + // add `key_type` to the URL query string + if (getKeyType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%skey_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getKeyType())))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `role` to the URL query string + if (getRole() != null) { + joiner.add(getRole().toUrlQueryString(prefix + "role" + suffix)); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + // add `user_id` to the URL query string + if (getUserId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suser_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreAlertConfiguration.java b/src/main/java/com/getconvoy/models/DatastoreAlertConfiguration.java new file mode 100644 index 0000000..7ba655c --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreAlertConfiguration.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreAlertConfiguration + */ +@JsonPropertyOrder({ + DatastoreAlertConfiguration.JSON_PROPERTY_COUNT, + DatastoreAlertConfiguration.JSON_PROPERTY_THRESHOLD +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreAlertConfiguration { + public static final String JSON_PROPERTY_COUNT = "count"; + @jakarta.annotation.Nullable + private Integer count; + + public static final String JSON_PROPERTY_THRESHOLD = "threshold"; + @jakarta.annotation.Nullable + private String threshold; + + public DatastoreAlertConfiguration() { + } + + public DatastoreAlertConfiguration count(@jakarta.annotation.Nullable Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * @return count + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCount() { + return count; + } + + + @JsonProperty(value = JSON_PROPERTY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(@jakarta.annotation.Nullable Integer count) { + this.count = count; + } + + + public DatastoreAlertConfiguration threshold(@jakarta.annotation.Nullable String threshold) { + this.threshold = threshold; + return this; + } + + /** + * Get threshold + * @return threshold + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_THRESHOLD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getThreshold() { + return threshold; + } + + + @JsonProperty(value = JSON_PROPERTY_THRESHOLD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThreshold(@jakarta.annotation.Nullable String threshold) { + this.threshold = threshold; + } + + + /** + * Return true if this datastore.AlertConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreAlertConfiguration datastoreAlertConfiguration = (DatastoreAlertConfiguration) o; + return Objects.equals(this.count, datastoreAlertConfiguration.count) && + Objects.equals(this.threshold, datastoreAlertConfiguration.threshold); + } + + @Override + public int hashCode() { + return Objects.hash(count, threshold); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreAlertConfiguration {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" threshold: ").append(toIndentedString(threshold)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `count` to the URL query string + if (getCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scount%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCount())))); + } + + // add `threshold` to the URL query string + if (getThreshold() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sthreshold%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getThreshold())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreAmqpCredentials.java b/src/main/java/com/getconvoy/models/DatastoreAmqpCredentials.java new file mode 100644 index 0000000..5f63f35 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreAmqpCredentials.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreAmqpCredentials + */ +@JsonPropertyOrder({ + DatastoreAmqpCredentials.JSON_PROPERTY_PASSWORD, + DatastoreAmqpCredentials.JSON_PROPERTY_USER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreAmqpCredentials { + public static final String JSON_PROPERTY_PASSWORD = "password"; + @jakarta.annotation.Nullable + private String password; + + public static final String JSON_PROPERTY_USER = "user"; + @jakarta.annotation.Nullable + private String user; + + public DatastoreAmqpCredentials() { + } + + public DatastoreAmqpCredentials password(@jakarta.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(@jakarta.annotation.Nullable String password) { + this.password = password; + } + + + public DatastoreAmqpCredentials user(@jakarta.annotation.Nullable String user) { + this.user = user; + return this; + } + + /** + * Get user + * @return user + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_USER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUser() { + return user; + } + + + @JsonProperty(value = JSON_PROPERTY_USER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUser(@jakarta.annotation.Nullable String user) { + this.user = user; + } + + + /** + * Return true if this datastore.AmqpCredentials object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreAmqpCredentials datastoreAmqpCredentials = (DatastoreAmqpCredentials) o; + return Objects.equals(this.password, datastoreAmqpCredentials.password) && + Objects.equals(this.user, datastoreAmqpCredentials.user); + } + + @Override + public int hashCode() { + return Objects.hash(password, user); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreAmqpCredentials {\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `password` to the URL query string + if (getPassword() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spassword%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPassword())))); + } + + // add `user` to the URL query string + if (getUser() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suser%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUser())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreAmqpPubSubConfig.java b/src/main/java/com/getconvoy/models/DatastoreAmqpPubSubConfig.java new file mode 100644 index 0000000..f19dc69 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreAmqpPubSubConfig.java @@ -0,0 +1,437 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreAmqpCredentials; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreAmqpPubSubConfig + */ +@JsonPropertyOrder({ + DatastoreAmqpPubSubConfig.JSON_PROPERTY_HOST, + DatastoreAmqpPubSubConfig.JSON_PROPERTY_AUTH, + DatastoreAmqpPubSubConfig.JSON_PROPERTY_BINDED_EXCHANGE, + DatastoreAmqpPubSubConfig.JSON_PROPERTY_DEAD_LETTER_EXCHANGE, + DatastoreAmqpPubSubConfig.JSON_PROPERTY_PORT, + DatastoreAmqpPubSubConfig.JSON_PROPERTY_QUEUE, + DatastoreAmqpPubSubConfig.JSON_PROPERTY_ROUTING_KEY, + DatastoreAmqpPubSubConfig.JSON_PROPERTY_SCHEMA, + DatastoreAmqpPubSubConfig.JSON_PROPERTY_VHOST +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreAmqpPubSubConfig { + public static final String JSON_PROPERTY_HOST = "host"; + @jakarta.annotation.Nullable + private String host; + + public static final String JSON_PROPERTY_AUTH = "auth"; + @jakarta.annotation.Nullable + private DatastoreAmqpCredentials auth; + + public static final String JSON_PROPERTY_BINDED_EXCHANGE = "bindedExchange"; + @jakarta.annotation.Nullable + private String bindedExchange; + + public static final String JSON_PROPERTY_DEAD_LETTER_EXCHANGE = "deadLetterExchange"; + @jakarta.annotation.Nullable + private String deadLetterExchange; + + public static final String JSON_PROPERTY_PORT = "port"; + @jakarta.annotation.Nullable + private String port; + + public static final String JSON_PROPERTY_QUEUE = "queue"; + @jakarta.annotation.Nullable + private String queue; + + public static final String JSON_PROPERTY_ROUTING_KEY = "routingKey"; + @jakarta.annotation.Nullable + private String routingKey; + + public static final String JSON_PROPERTY_SCHEMA = "schema"; + @jakarta.annotation.Nullable + private String schema; + + public static final String JSON_PROPERTY_VHOST = "vhost"; + @jakarta.annotation.Nullable + private String vhost; + + public DatastoreAmqpPubSubConfig() { + } + + public DatastoreAmqpPubSubConfig host(@jakarta.annotation.Nullable String host) { + this.host = host; + return this; + } + + /** + * Get host + * @return host + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HOST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHost() { + return host; + } + + + @JsonProperty(value = JSON_PROPERTY_HOST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHost(@jakarta.annotation.Nullable String host) { + this.host = host; + } + + + public DatastoreAmqpPubSubConfig auth(@jakarta.annotation.Nullable DatastoreAmqpCredentials auth) { + this.auth = auth; + return this; + } + + /** + * Get auth + * @return auth + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreAmqpCredentials getAuth() { + return auth; + } + + + @JsonProperty(value = JSON_PROPERTY_AUTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuth(@jakarta.annotation.Nullable DatastoreAmqpCredentials auth) { + this.auth = auth; + } + + + public DatastoreAmqpPubSubConfig bindedExchange(@jakarta.annotation.Nullable String bindedExchange) { + this.bindedExchange = bindedExchange; + return this; + } + + /** + * Get bindedExchange + * @return bindedExchange + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BINDED_EXCHANGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBindedExchange() { + return bindedExchange; + } + + + @JsonProperty(value = JSON_PROPERTY_BINDED_EXCHANGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBindedExchange(@jakarta.annotation.Nullable String bindedExchange) { + this.bindedExchange = bindedExchange; + } + + + public DatastoreAmqpPubSubConfig deadLetterExchange(@jakarta.annotation.Nullable String deadLetterExchange) { + this.deadLetterExchange = deadLetterExchange; + return this; + } + + /** + * Get deadLetterExchange + * @return deadLetterExchange + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DEAD_LETTER_EXCHANGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeadLetterExchange() { + return deadLetterExchange; + } + + + @JsonProperty(value = JSON_PROPERTY_DEAD_LETTER_EXCHANGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeadLetterExchange(@jakarta.annotation.Nullable String deadLetterExchange) { + this.deadLetterExchange = deadLetterExchange; + } + + + public DatastoreAmqpPubSubConfig port(@jakarta.annotation.Nullable String port) { + this.port = port; + return this; + } + + /** + * Get port + * @return port + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PORT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPort() { + return port; + } + + + @JsonProperty(value = JSON_PROPERTY_PORT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPort(@jakarta.annotation.Nullable String port) { + this.port = port; + } + + + public DatastoreAmqpPubSubConfig queue(@jakarta.annotation.Nullable String queue) { + this.queue = queue; + return this; + } + + /** + * Get queue + * @return queue + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_QUEUE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQueue() { + return queue; + } + + + @JsonProperty(value = JSON_PROPERTY_QUEUE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQueue(@jakarta.annotation.Nullable String queue) { + this.queue = queue; + } + + + public DatastoreAmqpPubSubConfig routingKey(@jakarta.annotation.Nullable String routingKey) { + this.routingKey = routingKey; + return this; + } + + /** + * Get routingKey + * @return routingKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ROUTING_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRoutingKey() { + return routingKey; + } + + + @JsonProperty(value = JSON_PROPERTY_ROUTING_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRoutingKey(@jakarta.annotation.Nullable String routingKey) { + this.routingKey = routingKey; + } + + + public DatastoreAmqpPubSubConfig schema(@jakarta.annotation.Nullable String schema) { + this.schema = schema; + return this; + } + + /** + * Get schema + * @return schema + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SCHEMA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSchema() { + return schema; + } + + + @JsonProperty(value = JSON_PROPERTY_SCHEMA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSchema(@jakarta.annotation.Nullable String schema) { + this.schema = schema; + } + + + public DatastoreAmqpPubSubConfig vhost(@jakarta.annotation.Nullable String vhost) { + this.vhost = vhost; + return this; + } + + /** + * Get vhost + * @return vhost + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_VHOST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVhost() { + return vhost; + } + + + @JsonProperty(value = JSON_PROPERTY_VHOST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVhost(@jakarta.annotation.Nullable String vhost) { + this.vhost = vhost; + } + + + /** + * Return true if this datastore.AmqpPubSubConfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreAmqpPubSubConfig datastoreAmqpPubSubConfig = (DatastoreAmqpPubSubConfig) o; + return Objects.equals(this.host, datastoreAmqpPubSubConfig.host) && + Objects.equals(this.auth, datastoreAmqpPubSubConfig.auth) && + Objects.equals(this.bindedExchange, datastoreAmqpPubSubConfig.bindedExchange) && + Objects.equals(this.deadLetterExchange, datastoreAmqpPubSubConfig.deadLetterExchange) && + Objects.equals(this.port, datastoreAmqpPubSubConfig.port) && + Objects.equals(this.queue, datastoreAmqpPubSubConfig.queue) && + Objects.equals(this.routingKey, datastoreAmqpPubSubConfig.routingKey) && + Objects.equals(this.schema, datastoreAmqpPubSubConfig.schema) && + Objects.equals(this.vhost, datastoreAmqpPubSubConfig.vhost); + } + + @Override + public int hashCode() { + return Objects.hash(host, auth, bindedExchange, deadLetterExchange, port, queue, routingKey, schema, vhost); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreAmqpPubSubConfig {\n"); + sb.append(" host: ").append(toIndentedString(host)).append("\n"); + sb.append(" auth: ").append(toIndentedString(auth)).append("\n"); + sb.append(" bindedExchange: ").append(toIndentedString(bindedExchange)).append("\n"); + sb.append(" deadLetterExchange: ").append(toIndentedString(deadLetterExchange)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append(" queue: ").append(toIndentedString(queue)).append("\n"); + sb.append(" routingKey: ").append(toIndentedString(routingKey)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); + sb.append(" vhost: ").append(toIndentedString(vhost)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `host` to the URL query string + if (getHost() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shost%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHost())))); + } + + // add `auth` to the URL query string + if (getAuth() != null) { + joiner.add(getAuth().toUrlQueryString(prefix + "auth" + suffix)); + } + + // add `bindedExchange` to the URL query string + if (getBindedExchange() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbindedExchange%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBindedExchange())))); + } + + // add `deadLetterExchange` to the URL query string + if (getDeadLetterExchange() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeadLetterExchange%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeadLetterExchange())))); + } + + // add `port` to the URL query string + if (getPort() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sport%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPort())))); + } + + // add `queue` to the URL query string + if (getQueue() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%squeue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getQueue())))); + } + + // add `routingKey` to the URL query string + if (getRoutingKey() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sroutingKey%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRoutingKey())))); + } + + // add `schema` to the URL query string + if (getSchema() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sschema%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSchema())))); + } + + // add `vhost` to the URL query string + if (getVhost() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%svhost%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVhost())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreApiKey.java b/src/main/java/com/getconvoy/models/DatastoreApiKey.java new file mode 100644 index 0000000..fbe8806 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreApiKey.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreApiKey + */ +@JsonPropertyOrder({ + DatastoreApiKey.JSON_PROPERTY_HEADER_NAME, + DatastoreApiKey.JSON_PROPERTY_HEADER_VALUE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreApiKey { + public static final String JSON_PROPERTY_HEADER_NAME = "header_name"; + @jakarta.annotation.Nullable + private String headerName; + + public static final String JSON_PROPERTY_HEADER_VALUE = "header_value"; + @jakarta.annotation.Nullable + private String headerValue; + + public DatastoreApiKey() { + } + + public DatastoreApiKey headerName(@jakarta.annotation.Nullable String headerName) { + this.headerName = headerName; + return this; + } + + /** + * Get headerName + * @return headerName + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADER_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHeaderName() { + return headerName; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADER_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaderName(@jakarta.annotation.Nullable String headerName) { + this.headerName = headerName; + } + + + public DatastoreApiKey headerValue(@jakarta.annotation.Nullable String headerValue) { + this.headerValue = headerValue; + return this; + } + + /** + * Get headerValue + * @return headerValue + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADER_VALUE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHeaderValue() { + return headerValue; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADER_VALUE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaderValue(@jakarta.annotation.Nullable String headerValue) { + this.headerValue = headerValue; + } + + + /** + * Return true if this datastore.ApiKey object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreApiKey datastoreApiKey = (DatastoreApiKey) o; + return Objects.equals(this.headerName, datastoreApiKey.headerName) && + Objects.equals(this.headerValue, datastoreApiKey.headerValue); + } + + @Override + public int hashCode() { + return Objects.hash(headerName, headerValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreApiKey {\n"); + sb.append(" headerName: ").append(toIndentedString(headerName)).append("\n"); + sb.append(" headerValue: ").append(toIndentedString(headerValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `header_name` to the URL query string + if (getHeaderName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheader_name%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHeaderName())))); + } + + // add `header_value` to the URL query string + if (getHeaderValue() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheader_value%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHeaderValue())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreBasicAuth.java b/src/main/java/com/getconvoy/models/DatastoreBasicAuth.java new file mode 100644 index 0000000..425a83a --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreBasicAuth.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreBasicAuth + */ +@JsonPropertyOrder({ + DatastoreBasicAuth.JSON_PROPERTY_PASSWORD, + DatastoreBasicAuth.JSON_PROPERTY_USERNAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreBasicAuth { + public static final String JSON_PROPERTY_PASSWORD = "password"; + @jakarta.annotation.Nullable + private String password; + + public static final String JSON_PROPERTY_USERNAME = "username"; + @jakarta.annotation.Nullable + private String username; + + public DatastoreBasicAuth() { + } + + public DatastoreBasicAuth password(@jakarta.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(@jakarta.annotation.Nullable String password) { + this.password = password; + } + + + public DatastoreBasicAuth username(@jakarta.annotation.Nullable String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; + } + + + @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(@jakarta.annotation.Nullable String username) { + this.username = username; + } + + + /** + * Return true if this datastore.BasicAuth object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreBasicAuth datastoreBasicAuth = (DatastoreBasicAuth) o; + return Objects.equals(this.password, datastoreBasicAuth.password) && + Objects.equals(this.username, datastoreBasicAuth.username); + } + + @Override + public int hashCode() { + return Objects.hash(password, username); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreBasicAuth {\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `password` to the URL query string + if (getPassword() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spassword%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPassword())))); + } + + // add `username` to the URL query string + if (getUsername() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%susername%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUsername())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreCLIMetadata.java b/src/main/java/com/getconvoy/models/DatastoreCLIMetadata.java new file mode 100644 index 0000000..6bfff71 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreCLIMetadata.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreCLIMetadata + */ +@JsonPropertyOrder({ + DatastoreCLIMetadata.JSON_PROPERTY_EVENT_TYPE, + DatastoreCLIMetadata.JSON_PROPERTY_SOURCE_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreCLIMetadata { + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @jakarta.annotation.Nullable + private String eventType; + + public static final String JSON_PROPERTY_SOURCE_ID = "source_id"; + @jakarta.annotation.Nullable + private String sourceId; + + public DatastoreCLIMetadata() { + } + + public DatastoreCLIMetadata eventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get eventType + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventType() { + return eventType; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + } + + + public DatastoreCLIMetadata sourceId(@jakarta.annotation.Nullable String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get sourceId + * @return sourceId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SOURCE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceId() { + return sourceId; + } + + + @JsonProperty(value = JSON_PROPERTY_SOURCE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceId(@jakarta.annotation.Nullable String sourceId) { + this.sourceId = sourceId; + } + + + /** + * Return true if this datastore.CLIMetadata object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreCLIMetadata datastoreCLIMetadata = (DatastoreCLIMetadata) o; + return Objects.equals(this.eventType, datastoreCLIMetadata.eventType) && + Objects.equals(this.sourceId, datastoreCLIMetadata.sourceId); + } + + @Override + public int hashCode() { + return Objects.hash(eventType, sourceId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreCLIMetadata {\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `event_type` to the URL query string + if (getEventType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventType())))); + } + + // add `source_id` to the URL query string + if (getSourceId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssource_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSourceId())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreCircuitBreakerConfiguration.java b/src/main/java/com/getconvoy/models/DatastoreCircuitBreakerConfiguration.java new file mode 100644 index 0000000..107582e --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreCircuitBreakerConfiguration.java @@ -0,0 +1,364 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreCircuitBreakerConfiguration + */ +@JsonPropertyOrder({ + DatastoreCircuitBreakerConfiguration.JSON_PROPERTY_CONSECUTIVE_FAILURE_THRESHOLD, + DatastoreCircuitBreakerConfiguration.JSON_PROPERTY_ERROR_TIMEOUT, + DatastoreCircuitBreakerConfiguration.JSON_PROPERTY_FAILURE_THRESHOLD, + DatastoreCircuitBreakerConfiguration.JSON_PROPERTY_MINIMUM_REQUEST_COUNT, + DatastoreCircuitBreakerConfiguration.JSON_PROPERTY_OBSERVABILITY_WINDOW, + DatastoreCircuitBreakerConfiguration.JSON_PROPERTY_SAMPLE_RATE, + DatastoreCircuitBreakerConfiguration.JSON_PROPERTY_SUCCESS_THRESHOLD +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreCircuitBreakerConfiguration { + public static final String JSON_PROPERTY_CONSECUTIVE_FAILURE_THRESHOLD = "consecutive_failure_threshold"; + @jakarta.annotation.Nullable + private Integer consecutiveFailureThreshold; + + public static final String JSON_PROPERTY_ERROR_TIMEOUT = "error_timeout"; + @jakarta.annotation.Nullable + private Integer errorTimeout; + + public static final String JSON_PROPERTY_FAILURE_THRESHOLD = "failure_threshold"; + @jakarta.annotation.Nullable + private Integer failureThreshold; + + public static final String JSON_PROPERTY_MINIMUM_REQUEST_COUNT = "minimum_request_count"; + @jakarta.annotation.Nullable + private Integer minimumRequestCount; + + public static final String JSON_PROPERTY_OBSERVABILITY_WINDOW = "observability_window"; + @jakarta.annotation.Nullable + private Integer observabilityWindow; + + public static final String JSON_PROPERTY_SAMPLE_RATE = "sample_rate"; + @jakarta.annotation.Nullable + private Integer sampleRate; + + public static final String JSON_PROPERTY_SUCCESS_THRESHOLD = "success_threshold"; + @jakarta.annotation.Nullable + private Integer successThreshold; + + public DatastoreCircuitBreakerConfiguration() { + } + + public DatastoreCircuitBreakerConfiguration consecutiveFailureThreshold(@jakarta.annotation.Nullable Integer consecutiveFailureThreshold) { + this.consecutiveFailureThreshold = consecutiveFailureThreshold; + return this; + } + + /** + * Get consecutiveFailureThreshold + * @return consecutiveFailureThreshold + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONSECUTIVE_FAILURE_THRESHOLD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getConsecutiveFailureThreshold() { + return consecutiveFailureThreshold; + } + + + @JsonProperty(value = JSON_PROPERTY_CONSECUTIVE_FAILURE_THRESHOLD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConsecutiveFailureThreshold(@jakarta.annotation.Nullable Integer consecutiveFailureThreshold) { + this.consecutiveFailureThreshold = consecutiveFailureThreshold; + } + + + public DatastoreCircuitBreakerConfiguration errorTimeout(@jakarta.annotation.Nullable Integer errorTimeout) { + this.errorTimeout = errorTimeout; + return this; + } + + /** + * Get errorTimeout + * @return errorTimeout + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ERROR_TIMEOUT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getErrorTimeout() { + return errorTimeout; + } + + + @JsonProperty(value = JSON_PROPERTY_ERROR_TIMEOUT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorTimeout(@jakarta.annotation.Nullable Integer errorTimeout) { + this.errorTimeout = errorTimeout; + } + + + public DatastoreCircuitBreakerConfiguration failureThreshold(@jakarta.annotation.Nullable Integer failureThreshold) { + this.failureThreshold = failureThreshold; + return this; + } + + /** + * Get failureThreshold + * @return failureThreshold + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FAILURE_THRESHOLD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getFailureThreshold() { + return failureThreshold; + } + + + @JsonProperty(value = JSON_PROPERTY_FAILURE_THRESHOLD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFailureThreshold(@jakarta.annotation.Nullable Integer failureThreshold) { + this.failureThreshold = failureThreshold; + } + + + public DatastoreCircuitBreakerConfiguration minimumRequestCount(@jakarta.annotation.Nullable Integer minimumRequestCount) { + this.minimumRequestCount = minimumRequestCount; + return this; + } + + /** + * Get minimumRequestCount + * @return minimumRequestCount + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MINIMUM_REQUEST_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMinimumRequestCount() { + return minimumRequestCount; + } + + + @JsonProperty(value = JSON_PROPERTY_MINIMUM_REQUEST_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinimumRequestCount(@jakarta.annotation.Nullable Integer minimumRequestCount) { + this.minimumRequestCount = minimumRequestCount; + } + + + public DatastoreCircuitBreakerConfiguration observabilityWindow(@jakarta.annotation.Nullable Integer observabilityWindow) { + this.observabilityWindow = observabilityWindow; + return this; + } + + /** + * Get observabilityWindow + * @return observabilityWindow + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OBSERVABILITY_WINDOW, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getObservabilityWindow() { + return observabilityWindow; + } + + + @JsonProperty(value = JSON_PROPERTY_OBSERVABILITY_WINDOW, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setObservabilityWindow(@jakarta.annotation.Nullable Integer observabilityWindow) { + this.observabilityWindow = observabilityWindow; + } + + + public DatastoreCircuitBreakerConfiguration sampleRate(@jakarta.annotation.Nullable Integer sampleRate) { + this.sampleRate = sampleRate; + return this; + } + + /** + * Get sampleRate + * @return sampleRate + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SAMPLE_RATE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSampleRate() { + return sampleRate; + } + + + @JsonProperty(value = JSON_PROPERTY_SAMPLE_RATE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSampleRate(@jakarta.annotation.Nullable Integer sampleRate) { + this.sampleRate = sampleRate; + } + + + public DatastoreCircuitBreakerConfiguration successThreshold(@jakarta.annotation.Nullable Integer successThreshold) { + this.successThreshold = successThreshold; + return this; + } + + /** + * Get successThreshold + * @return successThreshold + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SUCCESS_THRESHOLD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSuccessThreshold() { + return successThreshold; + } + + + @JsonProperty(value = JSON_PROPERTY_SUCCESS_THRESHOLD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSuccessThreshold(@jakarta.annotation.Nullable Integer successThreshold) { + this.successThreshold = successThreshold; + } + + + /** + * Return true if this datastore.CircuitBreakerConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreCircuitBreakerConfiguration datastoreCircuitBreakerConfiguration = (DatastoreCircuitBreakerConfiguration) o; + return Objects.equals(this.consecutiveFailureThreshold, datastoreCircuitBreakerConfiguration.consecutiveFailureThreshold) && + Objects.equals(this.errorTimeout, datastoreCircuitBreakerConfiguration.errorTimeout) && + Objects.equals(this.failureThreshold, datastoreCircuitBreakerConfiguration.failureThreshold) && + Objects.equals(this.minimumRequestCount, datastoreCircuitBreakerConfiguration.minimumRequestCount) && + Objects.equals(this.observabilityWindow, datastoreCircuitBreakerConfiguration.observabilityWindow) && + Objects.equals(this.sampleRate, datastoreCircuitBreakerConfiguration.sampleRate) && + Objects.equals(this.successThreshold, datastoreCircuitBreakerConfiguration.successThreshold); + } + + @Override + public int hashCode() { + return Objects.hash(consecutiveFailureThreshold, errorTimeout, failureThreshold, minimumRequestCount, observabilityWindow, sampleRate, successThreshold); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreCircuitBreakerConfiguration {\n"); + sb.append(" consecutiveFailureThreshold: ").append(toIndentedString(consecutiveFailureThreshold)).append("\n"); + sb.append(" errorTimeout: ").append(toIndentedString(errorTimeout)).append("\n"); + sb.append(" failureThreshold: ").append(toIndentedString(failureThreshold)).append("\n"); + sb.append(" minimumRequestCount: ").append(toIndentedString(minimumRequestCount)).append("\n"); + sb.append(" observabilityWindow: ").append(toIndentedString(observabilityWindow)).append("\n"); + sb.append(" sampleRate: ").append(toIndentedString(sampleRate)).append("\n"); + sb.append(" successThreshold: ").append(toIndentedString(successThreshold)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `consecutive_failure_threshold` to the URL query string + if (getConsecutiveFailureThreshold() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sconsecutive_failure_threshold%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getConsecutiveFailureThreshold())))); + } + + // add `error_timeout` to the URL query string + if (getErrorTimeout() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%serror_timeout%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getErrorTimeout())))); + } + + // add `failure_threshold` to the URL query string + if (getFailureThreshold() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sfailure_threshold%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFailureThreshold())))); + } + + // add `minimum_request_count` to the URL query string + if (getMinimumRequestCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sminimum_request_count%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMinimumRequestCount())))); + } + + // add `observability_window` to the URL query string + if (getObservabilityWindow() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sobservability_window%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getObservabilityWindow())))); + } + + // add `sample_rate` to the URL query string + if (getSampleRate() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssample_rate%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSampleRate())))); + } + + // add `success_threshold` to the URL query string + if (getSuccessThreshold() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssuccess_threshold%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSuccessThreshold())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreCreatePortalLinkRequest.java b/src/main/java/com/getconvoy/models/DatastoreCreatePortalLinkRequest.java new file mode 100644 index 0000000..565b87a --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreCreatePortalLinkRequest.java @@ -0,0 +1,306 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreCreatePortalLinkRequest + */ +@JsonPropertyOrder({ + DatastoreCreatePortalLinkRequest.JSON_PROPERTY_AUTH_TYPE, + DatastoreCreatePortalLinkRequest.JSON_PROPERTY_CAN_MANAGE_ENDPOINT, + DatastoreCreatePortalLinkRequest.JSON_PROPERTY_ENDPOINTS, + DatastoreCreatePortalLinkRequest.JSON_PROPERTY_NAME, + DatastoreCreatePortalLinkRequest.JSON_PROPERTY_OWNER_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreCreatePortalLinkRequest { + public static final String JSON_PROPERTY_AUTH_TYPE = "auth_type"; + @jakarta.annotation.Nullable + private String authType; + + public static final String JSON_PROPERTY_CAN_MANAGE_ENDPOINT = "can_manage_endpoint"; + @jakarta.annotation.Nullable + private Boolean canManageEndpoint; + + public static final String JSON_PROPERTY_ENDPOINTS = "endpoints"; + @jakarta.annotation.Nullable + private List endpoints = new ArrayList<>(); + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_OWNER_ID = "owner_id"; + @jakarta.annotation.Nullable + private String ownerId; + + public DatastoreCreatePortalLinkRequest() { + } + + public DatastoreCreatePortalLinkRequest authType(@jakarta.annotation.Nullable String authType) { + this.authType = authType; + return this; + } + + /** + * Get authType + * @return authType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUTH_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthType() { + return authType; + } + + + @JsonProperty(value = JSON_PROPERTY_AUTH_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthType(@jakarta.annotation.Nullable String authType) { + this.authType = authType; + } + + + public DatastoreCreatePortalLinkRequest canManageEndpoint(@jakarta.annotation.Nullable Boolean canManageEndpoint) { + this.canManageEndpoint = canManageEndpoint; + return this; + } + + /** + * Specify whether endpoint management can be done through the Portal Link UI + * @return canManageEndpoint + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CAN_MANAGE_ENDPOINT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanManageEndpoint() { + return canManageEndpoint; + } + + + @JsonProperty(value = JSON_PROPERTY_CAN_MANAGE_ENDPOINT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanManageEndpoint(@jakarta.annotation.Nullable Boolean canManageEndpoint) { + this.canManageEndpoint = canManageEndpoint; + } + + + public DatastoreCreatePortalLinkRequest endpoints(@jakarta.annotation.Nullable List endpoints) { + this.endpoints = endpoints; + return this; + } + + public DatastoreCreatePortalLinkRequest addEndpointsItem(String endpointsItem) { + if (this.endpoints == null) { + this.endpoints = new ArrayList<>(); + } + this.endpoints.add(endpointsItem); + return this; + } + + /** + * Deprecated IDs of endpoints in this portal link + * @return endpoints + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEndpoints() { + return endpoints; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpoints(@jakarta.annotation.Nullable List endpoints) { + this.endpoints = endpoints; + } + + + public DatastoreCreatePortalLinkRequest name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Portal Link Name + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public DatastoreCreatePortalLinkRequest ownerId(@jakarta.annotation.Nullable String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * OwnerID, the portal link will inherit all the endpoints with this owner ID + * @return ownerId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OWNER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOwnerId() { + return ownerId; + } + + + @JsonProperty(value = JSON_PROPERTY_OWNER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOwnerId(@jakarta.annotation.Nullable String ownerId) { + this.ownerId = ownerId; + } + + + /** + * Return true if this datastore.CreatePortalLinkRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreCreatePortalLinkRequest datastoreCreatePortalLinkRequest = (DatastoreCreatePortalLinkRequest) o; + return Objects.equals(this.authType, datastoreCreatePortalLinkRequest.authType) && + Objects.equals(this.canManageEndpoint, datastoreCreatePortalLinkRequest.canManageEndpoint) && + Objects.equals(this.endpoints, datastoreCreatePortalLinkRequest.endpoints) && + Objects.equals(this.name, datastoreCreatePortalLinkRequest.name) && + Objects.equals(this.ownerId, datastoreCreatePortalLinkRequest.ownerId); + } + + @Override + public int hashCode() { + return Objects.hash(authType, canManageEndpoint, endpoints, name, ownerId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreCreatePortalLinkRequest {\n"); + sb.append(" authType: ").append(toIndentedString(authType)).append("\n"); + sb.append(" canManageEndpoint: ").append(toIndentedString(canManageEndpoint)).append("\n"); + sb.append(" endpoints: ").append(toIndentedString(endpoints)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `auth_type` to the URL query string + if (getAuthType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sauth_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAuthType())))); + } + + // add `can_manage_endpoint` to the URL query string + if (getCanManageEndpoint() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scan_manage_endpoint%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCanManageEndpoint())))); + } + + // add `endpoints` to the URL query string + if (getEndpoints() != null) { + for (int i = 0; i < getEndpoints().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sendpoints%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEndpoints().get(i))))); + } + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `owner_id` to the URL query string + if (getOwnerId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sowner_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOwnerId())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreCustomResponse.java b/src/main/java/com/getconvoy/models/DatastoreCustomResponse.java new file mode 100644 index 0000000..580691d --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreCustomResponse.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreCustomResponse + */ +@JsonPropertyOrder({ + DatastoreCustomResponse.JSON_PROPERTY_BODY, + DatastoreCustomResponse.JSON_PROPERTY_CONTENT_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreCustomResponse { + public static final String JSON_PROPERTY_BODY = "body"; + @jakarta.annotation.Nullable + private String body; + + public static final String JSON_PROPERTY_CONTENT_TYPE = "content_type"; + @jakarta.annotation.Nullable + private String contentType; + + public DatastoreCustomResponse() { + } + + public DatastoreCustomResponse body(@jakarta.annotation.Nullable String body) { + this.body = body; + return this; + } + + /** + * Get body + * @return body + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBody() { + return body; + } + + + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBody(@jakarta.annotation.Nullable String body) { + this.body = body; + } + + + public DatastoreCustomResponse contentType(@jakarta.annotation.Nullable String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get contentType + * @return contentType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONTENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContentType() { + return contentType; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentType(@jakarta.annotation.Nullable String contentType) { + this.contentType = contentType; + } + + + /** + * Return true if this datastore.CustomResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreCustomResponse datastoreCustomResponse = (DatastoreCustomResponse) o; + return Objects.equals(this.body, datastoreCustomResponse.body) && + Objects.equals(this.contentType, datastoreCustomResponse.contentType); + } + + @Override + public int hashCode() { + return Objects.hash(body, contentType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreCustomResponse {\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `body` to the URL query string + if (getBody() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbody%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBody())))); + } + + // add `content_type` to the URL query string + if (getContentType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scontent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getContentType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreDeliveryAttempt.java b/src/main/java/com/getconvoy/models/DatastoreDeliveryAttempt.java new file mode 100644 index 0000000..7064086 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreDeliveryAttempt.java @@ -0,0 +1,822 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreDeliveryAttempt + */ +@JsonPropertyOrder({ + DatastoreDeliveryAttempt.JSON_PROPERTY_API_VERSION, + DatastoreDeliveryAttempt.JSON_PROPERTY_CREATED_AT, + DatastoreDeliveryAttempt.JSON_PROPERTY_DELETED_AT, + DatastoreDeliveryAttempt.JSON_PROPERTY_ENDPOINT_ID, + DatastoreDeliveryAttempt.JSON_PROPERTY_ERROR, + DatastoreDeliveryAttempt.JSON_PROPERTY_HTTP_STATUS, + DatastoreDeliveryAttempt.JSON_PROPERTY_IP_ADDRESS, + DatastoreDeliveryAttempt.JSON_PROPERTY_METHOD, + DatastoreDeliveryAttempt.JSON_PROPERTY_MSG_ID, + DatastoreDeliveryAttempt.JSON_PROPERTY_PROJECT_ID, + DatastoreDeliveryAttempt.JSON_PROPERTY_REQUEST_HTTP_HEADER, + DatastoreDeliveryAttempt.JSON_PROPERTY_REQUESTED_AT, + DatastoreDeliveryAttempt.JSON_PROPERTY_RESPONDED_AT, + DatastoreDeliveryAttempt.JSON_PROPERTY_RESPONSE_DATA, + DatastoreDeliveryAttempt.JSON_PROPERTY_RESPONSE_HTTP_HEADER, + DatastoreDeliveryAttempt.JSON_PROPERTY_STATUS, + DatastoreDeliveryAttempt.JSON_PROPERTY_UID, + DatastoreDeliveryAttempt.JSON_PROPERTY_UPDATED_AT, + DatastoreDeliveryAttempt.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreDeliveryAttempt { + public static final String JSON_PROPERTY_API_VERSION = "api_version"; + @jakarta.annotation.Nullable + private String apiVersion; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + @jakarta.annotation.Nullable + private String deletedAt; + + public static final String JSON_PROPERTY_ENDPOINT_ID = "endpoint_id"; + @jakarta.annotation.Nullable + private String endpointId; + + public static final String JSON_PROPERTY_ERROR = "error"; + @jakarta.annotation.Nullable + private String error; + + public static final String JSON_PROPERTY_HTTP_STATUS = "http_status"; + @jakarta.annotation.Nullable + private String httpStatus; + + public static final String JSON_PROPERTY_IP_ADDRESS = "ip_address"; + @jakarta.annotation.Nullable + private String ipAddress; + + public static final String JSON_PROPERTY_METHOD = "method"; + @jakarta.annotation.Nullable + private String method; + + public static final String JSON_PROPERTY_MSG_ID = "msg_id"; + @jakarta.annotation.Nullable + private String msgId; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + @jakarta.annotation.Nullable + private String projectId; + + public static final String JSON_PROPERTY_REQUEST_HTTP_HEADER = "request_http_header"; + @jakarta.annotation.Nullable + private Map requestHttpHeader = new HashMap<>(); + + public static final String JSON_PROPERTY_REQUESTED_AT = "requested_at"; + @jakarta.annotation.Nullable + private String requestedAt; + + public static final String JSON_PROPERTY_RESPONDED_AT = "responded_at"; + @jakarta.annotation.Nullable + private String respondedAt; + + public static final String JSON_PROPERTY_RESPONSE_DATA = "response_data"; + @jakarta.annotation.Nullable + private String responseData; + + public static final String JSON_PROPERTY_RESPONSE_HTTP_HEADER = "response_http_header"; + @jakarta.annotation.Nullable + private Map responseHttpHeader = new HashMap<>(); + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + @jakarta.annotation.Nullable + private String updatedAt; + + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nullable + private String url; + + public DatastoreDeliveryAttempt() { + } + + public DatastoreDeliveryAttempt apiVersion(@jakarta.annotation.Nullable String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * Get apiVersion + * @return apiVersion + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_API_VERSION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getApiVersion() { + return apiVersion; + } + + + @JsonProperty(value = JSON_PROPERTY_API_VERSION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiVersion(@jakarta.annotation.Nullable String apiVersion) { + this.apiVersion = apiVersion; + } + + + public DatastoreDeliveryAttempt createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public DatastoreDeliveryAttempt deletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Get deletedAt + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + } + + + public DatastoreDeliveryAttempt endpointId(@jakarta.annotation.Nullable String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * Get endpointId + * @return endpointId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEndpointId() { + return endpointId; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpointId(@jakarta.annotation.Nullable String endpointId) { + this.endpointId = endpointId; + } + + + public DatastoreDeliveryAttempt error(@jakarta.annotation.Nullable String error) { + this.error = error; + return this; + } + + /** + * Get error + * @return error + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ERROR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getError() { + return error; + } + + + @JsonProperty(value = JSON_PROPERTY_ERROR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setError(@jakarta.annotation.Nullable String error) { + this.error = error; + } + + + public DatastoreDeliveryAttempt httpStatus(@jakarta.annotation.Nullable String httpStatus) { + this.httpStatus = httpStatus; + return this; + } + + /** + * Get httpStatus + * @return httpStatus + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HTTP_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHttpStatus() { + return httpStatus; + } + + + @JsonProperty(value = JSON_PROPERTY_HTTP_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHttpStatus(@jakarta.annotation.Nullable String httpStatus) { + this.httpStatus = httpStatus; + } + + + public DatastoreDeliveryAttempt ipAddress(@jakarta.annotation.Nullable String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get ipAddress + * @return ipAddress + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IP_ADDRESS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIpAddress() { + return ipAddress; + } + + + @JsonProperty(value = JSON_PROPERTY_IP_ADDRESS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIpAddress(@jakarta.annotation.Nullable String ipAddress) { + this.ipAddress = ipAddress; + } + + + public DatastoreDeliveryAttempt method(@jakarta.annotation.Nullable String method) { + this.method = method; + return this; + } + + /** + * Get method + * @return method + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_METHOD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMethod() { + return method; + } + + + @JsonProperty(value = JSON_PROPERTY_METHOD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMethod(@jakarta.annotation.Nullable String method) { + this.method = method; + } + + + public DatastoreDeliveryAttempt msgId(@jakarta.annotation.Nullable String msgId) { + this.msgId = msgId; + return this; + } + + /** + * Get msgId + * @return msgId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MSG_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMsgId() { + return msgId; + } + + + @JsonProperty(value = JSON_PROPERTY_MSG_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMsgId(@jakarta.annotation.Nullable String msgId) { + this.msgId = msgId; + } + + + public DatastoreDeliveryAttempt projectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Get projectId + * @return projectId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectId() { + return projectId; + } + + + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProjectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + } + + + public DatastoreDeliveryAttempt requestHttpHeader(@jakarta.annotation.Nullable Map requestHttpHeader) { + this.requestHttpHeader = requestHttpHeader; + return this; + } + + public DatastoreDeliveryAttempt putRequestHttpHeaderItem(String key, String requestHttpHeaderItem) { + if (this.requestHttpHeader == null) { + this.requestHttpHeader = new HashMap<>(); + } + this.requestHttpHeader.put(key, requestHttpHeaderItem); + return this; + } + + /** + * Get requestHttpHeader + * @return requestHttpHeader + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_REQUEST_HTTP_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getRequestHttpHeader() { + return requestHttpHeader; + } + + + @JsonProperty(value = JSON_PROPERTY_REQUEST_HTTP_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestHttpHeader(@jakarta.annotation.Nullable Map requestHttpHeader) { + this.requestHttpHeader = requestHttpHeader; + } + + + public DatastoreDeliveryAttempt requestedAt(@jakarta.annotation.Nullable String requestedAt) { + this.requestedAt = requestedAt; + return this; + } + + /** + * Get requestedAt + * @return requestedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_REQUESTED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRequestedAt() { + return requestedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_REQUESTED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestedAt(@jakarta.annotation.Nullable String requestedAt) { + this.requestedAt = requestedAt; + } + + + public DatastoreDeliveryAttempt respondedAt(@jakarta.annotation.Nullable String respondedAt) { + this.respondedAt = respondedAt; + return this; + } + + /** + * Get respondedAt + * @return respondedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RESPONDED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRespondedAt() { + return respondedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_RESPONDED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRespondedAt(@jakarta.annotation.Nullable String respondedAt) { + this.respondedAt = respondedAt; + } + + + public DatastoreDeliveryAttempt responseData(@jakarta.annotation.Nullable String responseData) { + this.responseData = responseData; + return this; + } + + /** + * Get responseData + * @return responseData + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RESPONSE_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getResponseData() { + return responseData; + } + + + @JsonProperty(value = JSON_PROPERTY_RESPONSE_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponseData(@jakarta.annotation.Nullable String responseData) { + this.responseData = responseData; + } + + + public DatastoreDeliveryAttempt responseHttpHeader(@jakarta.annotation.Nullable Map responseHttpHeader) { + this.responseHttpHeader = responseHttpHeader; + return this; + } + + public DatastoreDeliveryAttempt putResponseHttpHeaderItem(String key, String responseHttpHeaderItem) { + if (this.responseHttpHeader == null) { + this.responseHttpHeader = new HashMap<>(); + } + this.responseHttpHeader.put(key, responseHttpHeaderItem); + return this; + } + + /** + * Get responseHttpHeader + * @return responseHttpHeader + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RESPONSE_HTTP_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getResponseHttpHeader() { + return responseHttpHeader; + } + + + @JsonProperty(value = JSON_PROPERTY_RESPONSE_HTTP_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponseHttpHeader(@jakarta.annotation.Nullable Map responseHttpHeader) { + this.responseHttpHeader = responseHttpHeader; + } + + + public DatastoreDeliveryAttempt status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public DatastoreDeliveryAttempt uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + public DatastoreDeliveryAttempt updatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + public DatastoreDeliveryAttempt url(@jakarta.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = url; + } + + + /** + * Return true if this datastore.DeliveryAttempt object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreDeliveryAttempt datastoreDeliveryAttempt = (DatastoreDeliveryAttempt) o; + return Objects.equals(this.apiVersion, datastoreDeliveryAttempt.apiVersion) && + Objects.equals(this.createdAt, datastoreDeliveryAttempt.createdAt) && + Objects.equals(this.deletedAt, datastoreDeliveryAttempt.deletedAt) && + Objects.equals(this.endpointId, datastoreDeliveryAttempt.endpointId) && + Objects.equals(this.error, datastoreDeliveryAttempt.error) && + Objects.equals(this.httpStatus, datastoreDeliveryAttempt.httpStatus) && + Objects.equals(this.ipAddress, datastoreDeliveryAttempt.ipAddress) && + Objects.equals(this.method, datastoreDeliveryAttempt.method) && + Objects.equals(this.msgId, datastoreDeliveryAttempt.msgId) && + Objects.equals(this.projectId, datastoreDeliveryAttempt.projectId) && + Objects.equals(this.requestHttpHeader, datastoreDeliveryAttempt.requestHttpHeader) && + Objects.equals(this.requestedAt, datastoreDeliveryAttempt.requestedAt) && + Objects.equals(this.respondedAt, datastoreDeliveryAttempt.respondedAt) && + Objects.equals(this.responseData, datastoreDeliveryAttempt.responseData) && + Objects.equals(this.responseHttpHeader, datastoreDeliveryAttempt.responseHttpHeader) && + Objects.equals(this.status, datastoreDeliveryAttempt.status) && + Objects.equals(this.uid, datastoreDeliveryAttempt.uid) && + Objects.equals(this.updatedAt, datastoreDeliveryAttempt.updatedAt) && + Objects.equals(this.url, datastoreDeliveryAttempt.url); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, createdAt, deletedAt, endpointId, error, httpStatus, ipAddress, method, msgId, projectId, requestHttpHeader, requestedAt, respondedAt, responseData, responseHttpHeader, status, uid, updatedAt, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreDeliveryAttempt {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" endpointId: ").append(toIndentedString(endpointId)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" httpStatus: ").append(toIndentedString(httpStatus)).append("\n"); + sb.append(" ipAddress: ").append(toIndentedString(ipAddress)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" msgId: ").append(toIndentedString(msgId)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" requestHttpHeader: ").append(toIndentedString(requestHttpHeader)).append("\n"); + sb.append(" requestedAt: ").append(toIndentedString(requestedAt)).append("\n"); + sb.append(" respondedAt: ").append(toIndentedString(respondedAt)).append("\n"); + sb.append(" responseData: ").append(toIndentedString(responseData)).append("\n"); + sb.append(" responseHttpHeader: ").append(toIndentedString(responseHttpHeader)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `api_version` to the URL query string + if (getApiVersion() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sapi_version%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getApiVersion())))); + } + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `deleted_at` to the URL query string + if (getDeletedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeleted_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeletedAt())))); + } + + // add `endpoint_id` to the URL query string + if (getEndpointId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sendpoint_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEndpointId())))); + } + + // add `error` to the URL query string + if (getError() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%serror%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getError())))); + } + + // add `http_status` to the URL query string + if (getHttpStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shttp_status%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHttpStatus())))); + } + + // add `ip_address` to the URL query string + if (getIpAddress() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sip_address%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIpAddress())))); + } + + // add `method` to the URL query string + if (getMethod() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smethod%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMethod())))); + } + + // add `msg_id` to the URL query string + if (getMsgId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smsg_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMsgId())))); + } + + // add `project_id` to the URL query string + if (getProjectId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sproject_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProjectId())))); + } + + // add `request_http_header` to the URL query string + if (getRequestHttpHeader() != null) { + for (String _key : getRequestHttpHeader().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%srequest_http_header%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getRequestHttpHeader().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getRequestHttpHeader().get(_key))))); + } + } + + // add `requested_at` to the URL query string + if (getRequestedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%srequested_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRequestedAt())))); + } + + // add `responded_at` to the URL query string + if (getRespondedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sresponded_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRespondedAt())))); + } + + // add `response_data` to the URL query string + if (getResponseData() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sresponse_data%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getResponseData())))); + } + + // add `response_http_header` to the URL query string + if (getResponseHttpHeader() != null) { + for (String _key : getResponseHttpHeader().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sresponse_http_header%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getResponseHttpHeader().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getResponseHttpHeader().get(_key))))); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + // add `updated_at` to the URL query string + if (getUpdatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%supdated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpdatedAt())))); + } + + // add `url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreDeliveryMode.java b/src/main/java/com/getconvoy/models/DatastoreDeliveryMode.java new file mode 100644 index 0000000..f328e7e --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreDeliveryMode.java @@ -0,0 +1,78 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.DeliveryMode + */ +public enum DatastoreDeliveryMode { + + AtLeastOnceDeliveryMode("at_least_once"), + + AtMostOnceDeliveryMode("at_most_once"); + + private String value; + + DatastoreDeliveryMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastoreDeliveryMode fromValue(String value) { + for (DatastoreDeliveryMode b : DatastoreDeliveryMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreDevice.java b/src/main/java/com/getconvoy/models/DatastoreDevice.java new file mode 100644 index 0000000..4b7f296 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreDevice.java @@ -0,0 +1,437 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreDeviceStatus; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreDevice + */ +@JsonPropertyOrder({ + DatastoreDevice.JSON_PROPERTY_CREATED_AT, + DatastoreDevice.JSON_PROPERTY_DELETED_AT, + DatastoreDevice.JSON_PROPERTY_ENDPOINT_ID, + DatastoreDevice.JSON_PROPERTY_HOST_NAME, + DatastoreDevice.JSON_PROPERTY_LAST_SEEN_AT, + DatastoreDevice.JSON_PROPERTY_PROJECT_ID, + DatastoreDevice.JSON_PROPERTY_STATUS, + DatastoreDevice.JSON_PROPERTY_UID, + DatastoreDevice.JSON_PROPERTY_UPDATED_AT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreDevice { + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + @jakarta.annotation.Nullable + private String deletedAt; + + public static final String JSON_PROPERTY_ENDPOINT_ID = "endpoint_id"; + @jakarta.annotation.Nullable + private String endpointId; + + public static final String JSON_PROPERTY_HOST_NAME = "host_name"; + @jakarta.annotation.Nullable + private String hostName; + + public static final String JSON_PROPERTY_LAST_SEEN_AT = "last_seen_at"; + @jakarta.annotation.Nullable + private String lastSeenAt; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + @jakarta.annotation.Nullable + private String projectId; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private DatastoreDeviceStatus status; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + @jakarta.annotation.Nullable + private String updatedAt; + + public DatastoreDevice() { + } + + public DatastoreDevice createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public DatastoreDevice deletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Get deletedAt + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + } + + + public DatastoreDevice endpointId(@jakarta.annotation.Nullable String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * Get endpointId + * @return endpointId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEndpointId() { + return endpointId; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpointId(@jakarta.annotation.Nullable String endpointId) { + this.endpointId = endpointId; + } + + + public DatastoreDevice hostName(@jakarta.annotation.Nullable String hostName) { + this.hostName = hostName; + return this; + } + + /** + * Get hostName + * @return hostName + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HOST_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHostName() { + return hostName; + } + + + @JsonProperty(value = JSON_PROPERTY_HOST_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHostName(@jakarta.annotation.Nullable String hostName) { + this.hostName = hostName; + } + + + public DatastoreDevice lastSeenAt(@jakarta.annotation.Nullable String lastSeenAt) { + this.lastSeenAt = lastSeenAt; + return this; + } + + /** + * Get lastSeenAt + * @return lastSeenAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_LAST_SEEN_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastSeenAt() { + return lastSeenAt; + } + + + @JsonProperty(value = JSON_PROPERTY_LAST_SEEN_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastSeenAt(@jakarta.annotation.Nullable String lastSeenAt) { + this.lastSeenAt = lastSeenAt; + } + + + public DatastoreDevice projectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Get projectId + * @return projectId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectId() { + return projectId; + } + + + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProjectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + } + + + public DatastoreDevice status(@jakarta.annotation.Nullable DatastoreDeviceStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreDeviceStatus getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable DatastoreDeviceStatus status) { + this.status = status; + } + + + public DatastoreDevice uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + public DatastoreDevice updatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + /** + * Return true if this datastore.Device object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreDevice datastoreDevice = (DatastoreDevice) o; + return Objects.equals(this.createdAt, datastoreDevice.createdAt) && + Objects.equals(this.deletedAt, datastoreDevice.deletedAt) && + Objects.equals(this.endpointId, datastoreDevice.endpointId) && + Objects.equals(this.hostName, datastoreDevice.hostName) && + Objects.equals(this.lastSeenAt, datastoreDevice.lastSeenAt) && + Objects.equals(this.projectId, datastoreDevice.projectId) && + Objects.equals(this.status, datastoreDevice.status) && + Objects.equals(this.uid, datastoreDevice.uid) && + Objects.equals(this.updatedAt, datastoreDevice.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, deletedAt, endpointId, hostName, lastSeenAt, projectId, status, uid, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreDevice {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" endpointId: ").append(toIndentedString(endpointId)).append("\n"); + sb.append(" hostName: ").append(toIndentedString(hostName)).append("\n"); + sb.append(" lastSeenAt: ").append(toIndentedString(lastSeenAt)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `deleted_at` to the URL query string + if (getDeletedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeleted_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeletedAt())))); + } + + // add `endpoint_id` to the URL query string + if (getEndpointId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sendpoint_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEndpointId())))); + } + + // add `host_name` to the URL query string + if (getHostName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shost_name%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHostName())))); + } + + // add `last_seen_at` to the URL query string + if (getLastSeenAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%slast_seen_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLastSeenAt())))); + } + + // add `project_id` to the URL query string + if (getProjectId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sproject_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProjectId())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + // add `updated_at` to the URL query string + if (getUpdatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%supdated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpdatedAt())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreDeviceStatus.java b/src/main/java/com/getconvoy/models/DatastoreDeviceStatus.java new file mode 100644 index 0000000..d35cb1a --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreDeviceStatus.java @@ -0,0 +1,80 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.DeviceStatus + */ +public enum DatastoreDeviceStatus { + + DeviceStatusOffline("offline"), + + DeviceStatusOnline("online"), + + DeviceStatusDisabled("disabled"); + + private String value; + + DatastoreDeviceStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastoreDeviceStatus fromValue(String value) { + for (DatastoreDeviceStatus b : DatastoreDeviceStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreEncodingType.java b/src/main/java/com/getconvoy/models/DatastoreEncodingType.java new file mode 100644 index 0000000..68135ac --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreEncodingType.java @@ -0,0 +1,78 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.EncodingType + */ +public enum DatastoreEncodingType { + + Base64Encoding("base64"), + + HexEncoding("hex"); + + private String value; + + DatastoreEncodingType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastoreEncodingType fromValue(String value) { + for (DatastoreEncodingType b : DatastoreEncodingType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreEndpoint.java b/src/main/java/com/getconvoy/models/DatastoreEndpoint.java new file mode 100644 index 0000000..0fb1858 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreEndpoint.java @@ -0,0 +1,1104 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreEndpointAuthentication; +import com.getconvoy.models.DatastoreEndpointStatus; +import com.getconvoy.models.DatastoreMtlsClientCert; +import com.getconvoy.models.DatastoreSecret; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreEndpoint + */ +@JsonPropertyOrder({ + DatastoreEndpoint.JSON_PROPERTY_ADVANCED_SIGNATURES, + DatastoreEndpoint.JSON_PROPERTY_AUTHENTICATION, + DatastoreEndpoint.JSON_PROPERTY_CB_STATE, + DatastoreEndpoint.JSON_PROPERTY_CONTENT_TYPE, + DatastoreEndpoint.JSON_PROPERTY_CREATED_AT, + DatastoreEndpoint.JSON_PROPERTY_DELETED_AT, + DatastoreEndpoint.JSON_PROPERTY_DESCRIPTION, + DatastoreEndpoint.JSON_PROPERTY_EVENTS, + DatastoreEndpoint.JSON_PROPERTY_FAILURE_COUNT, + DatastoreEndpoint.JSON_PROPERTY_FAILURE_RATE, + DatastoreEndpoint.JSON_PROPERTY_HTTP_TIMEOUT, + DatastoreEndpoint.JSON_PROPERTY_MTLS_CLIENT_CERT, + DatastoreEndpoint.JSON_PROPERTY_NAME, + DatastoreEndpoint.JSON_PROPERTY_OWNER_ID, + DatastoreEndpoint.JSON_PROPERTY_PERIOD_FAILURE_RATE, + DatastoreEndpoint.JSON_PROPERTY_PROJECT_ID, + DatastoreEndpoint.JSON_PROPERTY_RATE_LIMIT, + DatastoreEndpoint.JSON_PROPERTY_RATE_LIMIT_DURATION, + DatastoreEndpoint.JSON_PROPERTY_RETRY_COUNT, + DatastoreEndpoint.JSON_PROPERTY_SECRETS, + DatastoreEndpoint.JSON_PROPERTY_SLACK_WEBHOOK_URL, + DatastoreEndpoint.JSON_PROPERTY_STATUS, + DatastoreEndpoint.JSON_PROPERTY_SUCCESS_COUNT, + DatastoreEndpoint.JSON_PROPERTY_SUPPORT_EMAIL, + DatastoreEndpoint.JSON_PROPERTY_UID, + DatastoreEndpoint.JSON_PROPERTY_UPDATED_AT, + DatastoreEndpoint.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreEndpoint { + public static final String JSON_PROPERTY_ADVANCED_SIGNATURES = "advanced_signatures"; + @jakarta.annotation.Nullable + private Boolean advancedSignatures; + + public static final String JSON_PROPERTY_AUTHENTICATION = "authentication"; + @jakarta.annotation.Nullable + private DatastoreEndpointAuthentication authentication; + + public static final String JSON_PROPERTY_CB_STATE = "cb_state"; + @jakarta.annotation.Nullable + private String cbState; + + public static final String JSON_PROPERTY_CONTENT_TYPE = "content_type"; + @jakarta.annotation.Nullable + private String contentType; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + @jakarta.annotation.Nullable + private String deletedAt; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + @jakarta.annotation.Nullable + private String description; + + public static final String JSON_PROPERTY_EVENTS = "events"; + @jakarta.annotation.Nullable + private Integer events; + + public static final String JSON_PROPERTY_FAILURE_COUNT = "failure_count"; + @jakarta.annotation.Nullable + private Integer failureCount; + + public static final String JSON_PROPERTY_FAILURE_RATE = "failure_rate"; + @jakarta.annotation.Nullable + private BigDecimal failureRate; + + public static final String JSON_PROPERTY_HTTP_TIMEOUT = "http_timeout"; + @jakarta.annotation.Nullable + private Integer httpTimeout; + + public static final String JSON_PROPERTY_MTLS_CLIENT_CERT = "mtls_client_cert"; + @jakarta.annotation.Nullable + private DatastoreMtlsClientCert mtlsClientCert; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_OWNER_ID = "owner_id"; + @jakarta.annotation.Nullable + private String ownerId; + + public static final String JSON_PROPERTY_PERIOD_FAILURE_RATE = "period_failure_rate"; + @jakarta.annotation.Nullable + private BigDecimal periodFailureRate; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + @jakarta.annotation.Nullable + private String projectId; + + public static final String JSON_PROPERTY_RATE_LIMIT = "rate_limit"; + @jakarta.annotation.Nullable + private Integer rateLimit; + + public static final String JSON_PROPERTY_RATE_LIMIT_DURATION = "rate_limit_duration"; + @jakarta.annotation.Nullable + private Integer rateLimitDuration; + + public static final String JSON_PROPERTY_RETRY_COUNT = "retry_count"; + @jakarta.annotation.Nullable + private Integer retryCount; + + public static final String JSON_PROPERTY_SECRETS = "secrets"; + @jakarta.annotation.Nullable + private List secrets = new ArrayList<>(); + + public static final String JSON_PROPERTY_SLACK_WEBHOOK_URL = "slack_webhook_url"; + @jakarta.annotation.Nullable + private String slackWebhookUrl; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private DatastoreEndpointStatus status; + + public static final String JSON_PROPERTY_SUCCESS_COUNT = "success_count"; + @jakarta.annotation.Nullable + private Integer successCount; + + public static final String JSON_PROPERTY_SUPPORT_EMAIL = "support_email"; + @jakarta.annotation.Nullable + private String supportEmail; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + @jakarta.annotation.Nullable + private String updatedAt; + + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nullable + private String url; + + public DatastoreEndpoint() { + } + + public DatastoreEndpoint advancedSignatures(@jakarta.annotation.Nullable Boolean advancedSignatures) { + this.advancedSignatures = advancedSignatures; + return this; + } + + /** + * Get advancedSignatures + * @return advancedSignatures + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ADVANCED_SIGNATURES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAdvancedSignatures() { + return advancedSignatures; + } + + + @JsonProperty(value = JSON_PROPERTY_ADVANCED_SIGNATURES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdvancedSignatures(@jakarta.annotation.Nullable Boolean advancedSignatures) { + this.advancedSignatures = advancedSignatures; + } + + + public DatastoreEndpoint authentication(@jakarta.annotation.Nullable DatastoreEndpointAuthentication authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get authentication + * @return authentication + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUTHENTICATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreEndpointAuthentication getAuthentication() { + return authentication; + } + + + @JsonProperty(value = JSON_PROPERTY_AUTHENTICATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthentication(@jakarta.annotation.Nullable DatastoreEndpointAuthentication authentication) { + this.authentication = authentication; + } + + + public DatastoreEndpoint cbState(@jakarta.annotation.Nullable String cbState) { + this.cbState = cbState; + return this; + } + + /** + * CBState is the circuit breaker state (\"open\", \"half-open\", \"closed\") so the UI can reflect a tripped breaker on the endpoint status. Nil when CB is off/unlicensed or has no sample for this endpoint. + * @return cbState + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CB_STATE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCbState() { + return cbState; + } + + + @JsonProperty(value = JSON_PROPERTY_CB_STATE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCbState(@jakarta.annotation.Nullable String cbState) { + this.cbState = cbState; + } + + + public DatastoreEndpoint contentType(@jakarta.annotation.Nullable String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get contentType + * @return contentType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONTENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContentType() { + return contentType; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentType(@jakarta.annotation.Nullable String contentType) { + this.contentType = contentType; + } + + + public DatastoreEndpoint createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public DatastoreEndpoint deletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Get deletedAt + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + } + + + public DatastoreEndpoint description(@jakarta.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@jakarta.annotation.Nullable String description) { + this.description = description; + } + + + public DatastoreEndpoint events(@jakarta.annotation.Nullable Integer events) { + this.events = events; + return this; + } + + /** + * Get events + * @return events + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getEvents() { + return events; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEvents(@jakarta.annotation.Nullable Integer events) { + this.events = events; + } + + + public DatastoreEndpoint failureCount(@jakarta.annotation.Nullable Integer failureCount) { + this.failureCount = failureCount; + return this; + } + + /** + * Get failureCount + * @return failureCount + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FAILURE_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getFailureCount() { + return failureCount; + } + + + @JsonProperty(value = JSON_PROPERTY_FAILURE_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFailureCount(@jakarta.annotation.Nullable Integer failureCount) { + this.failureCount = failureCount; + } + + + public DatastoreEndpoint failureRate(@jakarta.annotation.Nullable BigDecimal failureRate) { + this.failureRate = failureRate; + return this; + } + + /** + * FailureRate is the circuit breaker's rolling failure rate for this endpoint. It is a pointer so the API can return null when no rate was computed (circuit breaker feature off, or sampler not running), distinct from a genuine 0%. + * @return failureRate + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FAILURE_RATE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getFailureRate() { + return failureRate; + } + + + @JsonProperty(value = JSON_PROPERTY_FAILURE_RATE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFailureRate(@jakarta.annotation.Nullable BigDecimal failureRate) { + this.failureRate = failureRate; + } + + + public DatastoreEndpoint httpTimeout(@jakarta.annotation.Nullable Integer httpTimeout) { + this.httpTimeout = httpTimeout; + return this; + } + + /** + * Get httpTimeout + * @return httpTimeout + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HTTP_TIMEOUT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHttpTimeout() { + return httpTimeout; + } + + + @JsonProperty(value = JSON_PROPERTY_HTTP_TIMEOUT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHttpTimeout(@jakarta.annotation.Nullable Integer httpTimeout) { + this.httpTimeout = httpTimeout; + } + + + public DatastoreEndpoint mtlsClientCert(@jakarta.annotation.Nullable DatastoreMtlsClientCert mtlsClientCert) { + this.mtlsClientCert = mtlsClientCert; + return this; + } + + /** + * mTLS client certificate configuration + * @return mtlsClientCert + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MTLS_CLIENT_CERT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreMtlsClientCert getMtlsClientCert() { + return mtlsClientCert; + } + + + @JsonProperty(value = JSON_PROPERTY_MTLS_CLIENT_CERT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMtlsClientCert(@jakarta.annotation.Nullable DatastoreMtlsClientCert mtlsClientCert) { + this.mtlsClientCert = mtlsClientCert; + } + + + public DatastoreEndpoint name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public DatastoreEndpoint ownerId(@jakarta.annotation.Nullable String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Get ownerId + * @return ownerId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OWNER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOwnerId() { + return ownerId; + } + + + @JsonProperty(value = JSON_PROPERTY_OWNER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOwnerId(@jakarta.annotation.Nullable String ownerId) { + this.ownerId = ownerId; + } + + + public DatastoreEndpoint periodFailureRate(@jakarta.annotation.Nullable BigDecimal periodFailureRate) { + this.periodFailureRate = periodFailureRate; + return this; + } + + /** + * PeriodFailureRate is the period failure rate from event_deliveries, (Failure+Retry)/(Success+Failure+Retry). Retry counts as failed-so-far. Nil when the range has no counted deliveries; sibling counts are transient. + * @return periodFailureRate + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PERIOD_FAILURE_RATE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPeriodFailureRate() { + return periodFailureRate; + } + + + @JsonProperty(value = JSON_PROPERTY_PERIOD_FAILURE_RATE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPeriodFailureRate(@jakarta.annotation.Nullable BigDecimal periodFailureRate) { + this.periodFailureRate = periodFailureRate; + } + + + public DatastoreEndpoint projectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Get projectId + * @return projectId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectId() { + return projectId; + } + + + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProjectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + } + + + public DatastoreEndpoint rateLimit(@jakarta.annotation.Nullable Integer rateLimit) { + this.rateLimit = rateLimit; + return this; + } + + /** + * Get rateLimit + * @return rateLimit + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRateLimit() { + return rateLimit; + } + + + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRateLimit(@jakarta.annotation.Nullable Integer rateLimit) { + this.rateLimit = rateLimit; + } + + + public DatastoreEndpoint rateLimitDuration(@jakarta.annotation.Nullable Integer rateLimitDuration) { + this.rateLimitDuration = rateLimitDuration; + return this; + } + + /** + * Get rateLimitDuration + * @return rateLimitDuration + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRateLimitDuration() { + return rateLimitDuration; + } + + + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRateLimitDuration(@jakarta.annotation.Nullable Integer rateLimitDuration) { + this.rateLimitDuration = rateLimitDuration; + } + + + public DatastoreEndpoint retryCount(@jakarta.annotation.Nullable Integer retryCount) { + this.retryCount = retryCount; + return this; + } + + /** + * Get retryCount + * @return retryCount + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RETRY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRetryCount() { + return retryCount; + } + + + @JsonProperty(value = JSON_PROPERTY_RETRY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRetryCount(@jakarta.annotation.Nullable Integer retryCount) { + this.retryCount = retryCount; + } + + + public DatastoreEndpoint secrets(@jakarta.annotation.Nullable List secrets) { + this.secrets = secrets; + return this; + } + + public DatastoreEndpoint addSecretsItem(DatastoreSecret secretsItem) { + if (this.secrets == null) { + this.secrets = new ArrayList<>(); + } + this.secrets.add(secretsItem); + return this; + } + + /** + * Get secrets + * @return secrets + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SECRETS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSecrets() { + return secrets; + } + + + @JsonProperty(value = JSON_PROPERTY_SECRETS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecrets(@jakarta.annotation.Nullable List secrets) { + this.secrets = secrets; + } + + + public DatastoreEndpoint slackWebhookUrl(@jakarta.annotation.Nullable String slackWebhookUrl) { + this.slackWebhookUrl = slackWebhookUrl; + return this; + } + + /** + * Get slackWebhookUrl + * @return slackWebhookUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SLACK_WEBHOOK_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSlackWebhookUrl() { + return slackWebhookUrl; + } + + + @JsonProperty(value = JSON_PROPERTY_SLACK_WEBHOOK_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSlackWebhookUrl(@jakarta.annotation.Nullable String slackWebhookUrl) { + this.slackWebhookUrl = slackWebhookUrl; + } + + + public DatastoreEndpoint status(@jakarta.annotation.Nullable DatastoreEndpointStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreEndpointStatus getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable DatastoreEndpointStatus status) { + this.status = status; + } + + + public DatastoreEndpoint successCount(@jakarta.annotation.Nullable Integer successCount) { + this.successCount = successCount; + return this; + } + + /** + * Get successCount + * @return successCount + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SUCCESS_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSuccessCount() { + return successCount; + } + + + @JsonProperty(value = JSON_PROPERTY_SUCCESS_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSuccessCount(@jakarta.annotation.Nullable Integer successCount) { + this.successCount = successCount; + } + + + public DatastoreEndpoint supportEmail(@jakarta.annotation.Nullable String supportEmail) { + this.supportEmail = supportEmail; + return this; + } + + /** + * Get supportEmail + * @return supportEmail + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SUPPORT_EMAIL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSupportEmail() { + return supportEmail; + } + + + @JsonProperty(value = JSON_PROPERTY_SUPPORT_EMAIL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportEmail(@jakarta.annotation.Nullable String supportEmail) { + this.supportEmail = supportEmail; + } + + + public DatastoreEndpoint uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + public DatastoreEndpoint updatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + public DatastoreEndpoint url(@jakarta.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = url; + } + + + /** + * Return true if this datastore.Endpoint object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreEndpoint datastoreEndpoint = (DatastoreEndpoint) o; + return Objects.equals(this.advancedSignatures, datastoreEndpoint.advancedSignatures) && + Objects.equals(this.authentication, datastoreEndpoint.authentication) && + Objects.equals(this.cbState, datastoreEndpoint.cbState) && + Objects.equals(this.contentType, datastoreEndpoint.contentType) && + Objects.equals(this.createdAt, datastoreEndpoint.createdAt) && + Objects.equals(this.deletedAt, datastoreEndpoint.deletedAt) && + Objects.equals(this.description, datastoreEndpoint.description) && + Objects.equals(this.events, datastoreEndpoint.events) && + Objects.equals(this.failureCount, datastoreEndpoint.failureCount) && + Objects.equals(this.failureRate, datastoreEndpoint.failureRate) && + Objects.equals(this.httpTimeout, datastoreEndpoint.httpTimeout) && + Objects.equals(this.mtlsClientCert, datastoreEndpoint.mtlsClientCert) && + Objects.equals(this.name, datastoreEndpoint.name) && + Objects.equals(this.ownerId, datastoreEndpoint.ownerId) && + Objects.equals(this.periodFailureRate, datastoreEndpoint.periodFailureRate) && + Objects.equals(this.projectId, datastoreEndpoint.projectId) && + Objects.equals(this.rateLimit, datastoreEndpoint.rateLimit) && + Objects.equals(this.rateLimitDuration, datastoreEndpoint.rateLimitDuration) && + Objects.equals(this.retryCount, datastoreEndpoint.retryCount) && + Objects.equals(this.secrets, datastoreEndpoint.secrets) && + Objects.equals(this.slackWebhookUrl, datastoreEndpoint.slackWebhookUrl) && + Objects.equals(this.status, datastoreEndpoint.status) && + Objects.equals(this.successCount, datastoreEndpoint.successCount) && + Objects.equals(this.supportEmail, datastoreEndpoint.supportEmail) && + Objects.equals(this.uid, datastoreEndpoint.uid) && + Objects.equals(this.updatedAt, datastoreEndpoint.updatedAt) && + Objects.equals(this.url, datastoreEndpoint.url); + } + + @Override + public int hashCode() { + return Objects.hash(advancedSignatures, authentication, cbState, contentType, createdAt, deletedAt, description, events, failureCount, failureRate, httpTimeout, mtlsClientCert, name, ownerId, periodFailureRate, projectId, rateLimit, rateLimitDuration, retryCount, secrets, slackWebhookUrl, status, successCount, supportEmail, uid, updatedAt, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreEndpoint {\n"); + sb.append(" advancedSignatures: ").append(toIndentedString(advancedSignatures)).append("\n"); + sb.append(" authentication: ").append(toIndentedString(authentication)).append("\n"); + sb.append(" cbState: ").append(toIndentedString(cbState)).append("\n"); + sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" events: ").append(toIndentedString(events)).append("\n"); + sb.append(" failureCount: ").append(toIndentedString(failureCount)).append("\n"); + sb.append(" failureRate: ").append(toIndentedString(failureRate)).append("\n"); + sb.append(" httpTimeout: ").append(toIndentedString(httpTimeout)).append("\n"); + sb.append(" mtlsClientCert: ").append(toIndentedString(mtlsClientCert)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append(" periodFailureRate: ").append(toIndentedString(periodFailureRate)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" rateLimit: ").append(toIndentedString(rateLimit)).append("\n"); + sb.append(" rateLimitDuration: ").append(toIndentedString(rateLimitDuration)).append("\n"); + sb.append(" retryCount: ").append(toIndentedString(retryCount)).append("\n"); + sb.append(" secrets: ").append(toIndentedString(secrets)).append("\n"); + sb.append(" slackWebhookUrl: ").append(toIndentedString(slackWebhookUrl)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" successCount: ").append(toIndentedString(successCount)).append("\n"); + sb.append(" supportEmail: ").append(toIndentedString(supportEmail)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `advanced_signatures` to the URL query string + if (getAdvancedSignatures() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sadvanced_signatures%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAdvancedSignatures())))); + } + + // add `authentication` to the URL query string + if (getAuthentication() != null) { + joiner.add(getAuthentication().toUrlQueryString(prefix + "authentication" + suffix)); + } + + // add `cb_state` to the URL query string + if (getCbState() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scb_state%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCbState())))); + } + + // add `content_type` to the URL query string + if (getContentType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scontent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getContentType())))); + } + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `deleted_at` to the URL query string + if (getDeletedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeleted_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeletedAt())))); + } + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdescription%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `events` to the URL query string + if (getEvents() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevents%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEvents())))); + } + + // add `failure_count` to the URL query string + if (getFailureCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sfailure_count%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFailureCount())))); + } + + // add `failure_rate` to the URL query string + if (getFailureRate() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sfailure_rate%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFailureRate())))); + } + + // add `http_timeout` to the URL query string + if (getHttpTimeout() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shttp_timeout%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHttpTimeout())))); + } + + // add `mtls_client_cert` to the URL query string + if (getMtlsClientCert() != null) { + joiner.add(getMtlsClientCert().toUrlQueryString(prefix + "mtls_client_cert" + suffix)); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `owner_id` to the URL query string + if (getOwnerId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sowner_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOwnerId())))); + } + + // add `period_failure_rate` to the URL query string + if (getPeriodFailureRate() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%speriod_failure_rate%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPeriodFailureRate())))); + } + + // add `project_id` to the URL query string + if (getProjectId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sproject_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProjectId())))); + } + + // add `rate_limit` to the URL query string + if (getRateLimit() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%srate_limit%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRateLimit())))); + } + + // add `rate_limit_duration` to the URL query string + if (getRateLimitDuration() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%srate_limit_duration%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRateLimitDuration())))); + } + + // add `retry_count` to the URL query string + if (getRetryCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sretry_count%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRetryCount())))); + } + + // add `secrets` to the URL query string + if (getSecrets() != null) { + for (int i = 0; i < getSecrets().size(); i++) { + if (getSecrets().get(i) != null) { + joiner.add(getSecrets().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%ssecrets%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `slack_webhook_url` to the URL query string + if (getSlackWebhookUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sslack_webhook_url%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSlackWebhookUrl())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `success_count` to the URL query string + if (getSuccessCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssuccess_count%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSuccessCount())))); + } + + // add `support_email` to the URL query string + if (getSupportEmail() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssupport_email%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSupportEmail())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + // add `updated_at` to the URL query string + if (getUpdatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%supdated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpdatedAt())))); + } + + // add `url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreEndpointAuthentication.java b/src/main/java/com/getconvoy/models/DatastoreEndpointAuthentication.java new file mode 100644 index 0000000..99bf4a1 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreEndpointAuthentication.java @@ -0,0 +1,260 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreApiKey; +import com.getconvoy.models.DatastoreBasicAuth; +import com.getconvoy.models.DatastoreEndpointAuthenticationType; +import com.getconvoy.models.DatastoreOAuth2; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreEndpointAuthentication + */ +@JsonPropertyOrder({ + DatastoreEndpointAuthentication.JSON_PROPERTY_API_KEY, + DatastoreEndpointAuthentication.JSON_PROPERTY_BASIC_AUTH, + DatastoreEndpointAuthentication.JSON_PROPERTY_OAUTH2, + DatastoreEndpointAuthentication.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreEndpointAuthentication { + public static final String JSON_PROPERTY_API_KEY = "api_key"; + @jakarta.annotation.Nullable + private DatastoreApiKey apiKey; + + public static final String JSON_PROPERTY_BASIC_AUTH = "basic_auth"; + @jakarta.annotation.Nullable + private DatastoreBasicAuth basicAuth; + + public static final String JSON_PROPERTY_OAUTH2 = "oauth2"; + @jakarta.annotation.Nullable + private DatastoreOAuth2 oauth2; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private DatastoreEndpointAuthenticationType type; + + public DatastoreEndpointAuthentication() { + } + + public DatastoreEndpointAuthentication apiKey(@jakarta.annotation.Nullable DatastoreApiKey apiKey) { + this.apiKey = apiKey; + return this; + } + + /** + * Get apiKey + * @return apiKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_API_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreApiKey getApiKey() { + return apiKey; + } + + + @JsonProperty(value = JSON_PROPERTY_API_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiKey(@jakarta.annotation.Nullable DatastoreApiKey apiKey) { + this.apiKey = apiKey; + } + + + public DatastoreEndpointAuthentication basicAuth(@jakarta.annotation.Nullable DatastoreBasicAuth basicAuth) { + this.basicAuth = basicAuth; + return this; + } + + /** + * Get basicAuth + * @return basicAuth + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BASIC_AUTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreBasicAuth getBasicAuth() { + return basicAuth; + } + + + @JsonProperty(value = JSON_PROPERTY_BASIC_AUTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBasicAuth(@jakarta.annotation.Nullable DatastoreBasicAuth basicAuth) { + this.basicAuth = basicAuth; + } + + + public DatastoreEndpointAuthentication oauth2(@jakarta.annotation.Nullable DatastoreOAuth2 oauth2) { + this.oauth2 = oauth2; + return this; + } + + /** + * Get oauth2 + * @return oauth2 + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OAUTH2, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreOAuth2 getOauth2() { + return oauth2; + } + + + @JsonProperty(value = JSON_PROPERTY_OAUTH2, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOauth2(@jakarta.annotation.Nullable DatastoreOAuth2 oauth2) { + this.oauth2 = oauth2; + } + + + public DatastoreEndpointAuthentication type(@jakarta.annotation.Nullable DatastoreEndpointAuthenticationType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreEndpointAuthenticationType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable DatastoreEndpointAuthenticationType type) { + this.type = type; + } + + + /** + * Return true if this datastore.EndpointAuthentication object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreEndpointAuthentication datastoreEndpointAuthentication = (DatastoreEndpointAuthentication) o; + return Objects.equals(this.apiKey, datastoreEndpointAuthentication.apiKey) && + Objects.equals(this.basicAuth, datastoreEndpointAuthentication.basicAuth) && + Objects.equals(this.oauth2, datastoreEndpointAuthentication.oauth2) && + Objects.equals(this.type, datastoreEndpointAuthentication.type); + } + + @Override + public int hashCode() { + return Objects.hash(apiKey, basicAuth, oauth2, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreEndpointAuthentication {\n"); + sb.append(" apiKey: ").append(toIndentedString(apiKey)).append("\n"); + sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n"); + sb.append(" oauth2: ").append(toIndentedString(oauth2)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `api_key` to the URL query string + if (getApiKey() != null) { + joiner.add(getApiKey().toUrlQueryString(prefix + "api_key" + suffix)); + } + + // add `basic_auth` to the URL query string + if (getBasicAuth() != null) { + joiner.add(getBasicAuth().toUrlQueryString(prefix + "basic_auth" + suffix)); + } + + // add `oauth2` to the URL query string + if (getOauth2() != null) { + joiner.add(getOauth2().toUrlQueryString(prefix + "oauth2" + suffix)); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreEndpointAuthenticationType.java b/src/main/java/com/getconvoy/models/DatastoreEndpointAuthenticationType.java new file mode 100644 index 0000000..535466a --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreEndpointAuthenticationType.java @@ -0,0 +1,80 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.EndpointAuthenticationType + */ +public enum DatastoreEndpointAuthenticationType { + + APIKeyAuthentication("api_key"), + + OAuth2Authentication("oauth2"), + + BasicAuthentication("basic_auth"); + + private String value; + + DatastoreEndpointAuthenticationType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastoreEndpointAuthenticationType fromValue(String value) { + for (DatastoreEndpointAuthenticationType b : DatastoreEndpointAuthenticationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreEndpointStatus.java b/src/main/java/com/getconvoy/models/DatastoreEndpointStatus.java new file mode 100644 index 0000000..15fe99f --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreEndpointStatus.java @@ -0,0 +1,80 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.EndpointStatus + */ +public enum DatastoreEndpointStatus { + + ActiveEndpointStatus("active"), + + InactiveEndpointStatus("inactive"), + + PausedEndpointStatus("paused"); + + private String value; + + DatastoreEndpointStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastoreEndpointStatus fromValue(String value) { + for (DatastoreEndpointStatus b : DatastoreEndpointStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreEvent.java b/src/main/java/com/getconvoy/models/DatastoreEvent.java new file mode 100644 index 0000000..b43c9fb --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreEvent.java @@ -0,0 +1,924 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreEndpoint; +import com.getconvoy.models.DatastoreEventStatus; +import com.getconvoy.models.DatastoreSource; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreEvent + */ +@JsonPropertyOrder({ + DatastoreEvent.JSON_PROPERTY_ACKNOWLEDGED_AT, + DatastoreEvent.JSON_PROPERTY_APP_ID, + DatastoreEvent.JSON_PROPERTY_CREATED_AT, + DatastoreEvent.JSON_PROPERTY_DATA, + DatastoreEvent.JSON_PROPERTY_DELETED_AT, + DatastoreEvent.JSON_PROPERTY_ENDPOINT_METADATA, + DatastoreEvent.JSON_PROPERTY_ENDPOINTS, + DatastoreEvent.JSON_PROPERTY_EVENT_TYPE, + DatastoreEvent.JSON_PROPERTY_HEADERS, + DatastoreEvent.JSON_PROPERTY_IDEMPOTENCY_KEY, + DatastoreEvent.JSON_PROPERTY_IS_DUPLICATE_EVENT, + DatastoreEvent.JSON_PROPERTY_METADATA, + DatastoreEvent.JSON_PROPERTY_PROJECT_ID, + DatastoreEvent.JSON_PROPERTY_RAW, + DatastoreEvent.JSON_PROPERTY_SOURCE_ID, + DatastoreEvent.JSON_PROPERTY_SOURCE_METADATA, + DatastoreEvent.JSON_PROPERTY_STATUS, + DatastoreEvent.JSON_PROPERTY_UID, + DatastoreEvent.JSON_PROPERTY_UPDATED_AT, + DatastoreEvent.JSON_PROPERTY_URL_PATH, + DatastoreEvent.JSON_PROPERTY_URL_QUERY_PARAMS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreEvent { + public static final String JSON_PROPERTY_ACKNOWLEDGED_AT = "acknowledged_at"; + @jakarta.annotation.Nullable + private String acknowledgedAt; + + public static final String JSON_PROPERTY_APP_ID = "app_id"; + @jakarta.annotation.Nullable + private String appId; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private Map data = new HashMap<>(); + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + @jakarta.annotation.Nullable + private String deletedAt; + + public static final String JSON_PROPERTY_ENDPOINT_METADATA = "endpoint_metadata"; + @jakarta.annotation.Nullable + private List endpointMetadata = new ArrayList<>(); + + public static final String JSON_PROPERTY_ENDPOINTS = "endpoints"; + @jakarta.annotation.Nullable + private List endpoints = new ArrayList<>(); + + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @jakarta.annotation.Nullable + private String eventType; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + @jakarta.annotation.Nullable + private Map> headers = new HashMap<>(); + + public static final String JSON_PROPERTY_IDEMPOTENCY_KEY = "idempotency_key"; + @jakarta.annotation.Nullable + private String idempotencyKey; + + public static final String JSON_PROPERTY_IS_DUPLICATE_EVENT = "is_duplicate_event"; + @jakarta.annotation.Nullable + private Boolean isDuplicateEvent; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @jakarta.annotation.Nullable + private String metadata; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + @jakarta.annotation.Nullable + private String projectId; + + public static final String JSON_PROPERTY_RAW = "raw"; + @jakarta.annotation.Nullable + private String raw; + + public static final String JSON_PROPERTY_SOURCE_ID = "source_id"; + @jakarta.annotation.Nullable + private String sourceId; + + public static final String JSON_PROPERTY_SOURCE_METADATA = "source_metadata"; + @jakarta.annotation.Nullable + private DatastoreSource sourceMetadata; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private DatastoreEventStatus status; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + @jakarta.annotation.Nullable + private String updatedAt; + + public static final String JSON_PROPERTY_URL_PATH = "url_path"; + @jakarta.annotation.Nullable + private String urlPath; + + public static final String JSON_PROPERTY_URL_QUERY_PARAMS = "url_query_params"; + @jakarta.annotation.Nullable + private String urlQueryParams; + + public DatastoreEvent() { + } + + public DatastoreEvent acknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { + this.acknowledgedAt = acknowledgedAt; + return this; + } + + /** + * Get acknowledgedAt + * @return acknowledgedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ACKNOWLEDGED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAcknowledgedAt() { + return acknowledgedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_ACKNOWLEDGED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { + this.acknowledgedAt = acknowledgedAt; + } + + + public DatastoreEvent appId(@jakarta.annotation.Nullable String appId) { + this.appId = appId; + return this; + } + + /** + * Deprecated + * @return appId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_APP_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppId() { + return appId; + } + + + @JsonProperty(value = JSON_PROPERTY_APP_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppId(@jakarta.annotation.Nullable String appId) { + this.appId = appId; + } + + + public DatastoreEvent createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public DatastoreEvent data(@jakarta.annotation.Nullable Map data) { + this.data = data; + return this; + } + + public DatastoreEvent putDataItem(String key, Object dataItem) { + if (this.data == null) { + this.data = new HashMap<>(); + } + this.data.put(key, dataItem); + return this; + } + + /** + * Data is an arbitrary JSON value that gets sent as the body of the webhook to the endpoints + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable Map data) { + this.data = data; + } + + + public DatastoreEvent deletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Get deletedAt + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + } + + + public DatastoreEvent endpointMetadata(@jakarta.annotation.Nullable List endpointMetadata) { + this.endpointMetadata = endpointMetadata; + return this; + } + + public DatastoreEvent addEndpointMetadataItem(DatastoreEndpoint endpointMetadataItem) { + if (this.endpointMetadata == null) { + this.endpointMetadata = new ArrayList<>(); + } + this.endpointMetadata.add(endpointMetadataItem); + return this; + } + + /** + * Get endpointMetadata + * @return endpointMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEndpointMetadata() { + return endpointMetadata; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpointMetadata(@jakarta.annotation.Nullable List endpointMetadata) { + this.endpointMetadata = endpointMetadata; + } + + + public DatastoreEvent endpoints(@jakarta.annotation.Nullable List endpoints) { + this.endpoints = endpoints; + return this; + } + + public DatastoreEvent addEndpointsItem(String endpointsItem) { + if (this.endpoints == null) { + this.endpoints = new ArrayList<>(); + } + this.endpoints.add(endpointsItem); + return this; + } + + /** + * Get endpoints + * @return endpoints + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEndpoints() { + return endpoints; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpoints(@jakarta.annotation.Nullable List endpoints) { + this.endpoints = endpoints; + } + + + public DatastoreEvent eventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get eventType + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventType() { + return eventType; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + } + + + public DatastoreEvent headers(@jakarta.annotation.Nullable Map> headers) { + this.headers = headers; + return this; + } + + public DatastoreEvent putHeadersItem(String key, List headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * Get headers + * @return headers + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getHeaders() { + return headers; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(@jakarta.annotation.Nullable Map> headers) { + this.headers = headers; + } + + + public DatastoreEvent idempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + + /** + * Get idempotencyKey + * @return idempotencyKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIdempotencyKey() { + return idempotencyKey; + } + + + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + } + + + public DatastoreEvent isDuplicateEvent(@jakarta.annotation.Nullable Boolean isDuplicateEvent) { + this.isDuplicateEvent = isDuplicateEvent; + return this; + } + + /** + * Get isDuplicateEvent + * @return isDuplicateEvent + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IS_DUPLICATE_EVENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsDuplicateEvent() { + return isDuplicateEvent; + } + + + @JsonProperty(value = JSON_PROPERTY_IS_DUPLICATE_EVENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDuplicateEvent(@jakarta.annotation.Nullable Boolean isDuplicateEvent) { + this.isDuplicateEvent = isDuplicateEvent; + } + + + public DatastoreEvent metadata(@jakarta.annotation.Nullable String metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadata() { + return metadata; + } + + + @JsonProperty(value = JSON_PROPERTY_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@jakarta.annotation.Nullable String metadata) { + this.metadata = metadata; + } + + + public DatastoreEvent projectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Get projectId + * @return projectId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectId() { + return projectId; + } + + + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProjectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + } + + + public DatastoreEvent raw(@jakarta.annotation.Nullable String raw) { + this.raw = raw; + return this; + } + + /** + * Get raw + * @return raw + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RAW, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRaw() { + return raw; + } + + + @JsonProperty(value = JSON_PROPERTY_RAW, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRaw(@jakarta.annotation.Nullable String raw) { + this.raw = raw; + } + + + public DatastoreEvent sourceId(@jakarta.annotation.Nullable String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get sourceId + * @return sourceId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SOURCE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceId() { + return sourceId; + } + + + @JsonProperty(value = JSON_PROPERTY_SOURCE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceId(@jakarta.annotation.Nullable String sourceId) { + this.sourceId = sourceId; + } + + + public DatastoreEvent sourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { + this.sourceMetadata = sourceMetadata; + return this; + } + + /** + * Get sourceMetadata + * @return sourceMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SOURCE_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreSource getSourceMetadata() { + return sourceMetadata; + } + + + @JsonProperty(value = JSON_PROPERTY_SOURCE_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { + this.sourceMetadata = sourceMetadata; + } + + + public DatastoreEvent status(@jakarta.annotation.Nullable DatastoreEventStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreEventStatus getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable DatastoreEventStatus status) { + this.status = status; + } + + + public DatastoreEvent uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + public DatastoreEvent updatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + public DatastoreEvent urlPath(@jakarta.annotation.Nullable String urlPath) { + this.urlPath = urlPath; + return this; + } + + /** + * Get urlPath + * @return urlPath + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL_PATH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrlPath() { + return urlPath; + } + + + @JsonProperty(value = JSON_PROPERTY_URL_PATH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrlPath(@jakarta.annotation.Nullable String urlPath) { + this.urlPath = urlPath; + } + + + public DatastoreEvent urlQueryParams(@jakarta.annotation.Nullable String urlQueryParams) { + this.urlQueryParams = urlQueryParams; + return this; + } + + /** + * Get urlQueryParams + * @return urlQueryParams + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL_QUERY_PARAMS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrlQueryParams() { + return urlQueryParams; + } + + + @JsonProperty(value = JSON_PROPERTY_URL_QUERY_PARAMS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrlQueryParams(@jakarta.annotation.Nullable String urlQueryParams) { + this.urlQueryParams = urlQueryParams; + } + + + /** + * Return true if this datastore.Event object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreEvent datastoreEvent = (DatastoreEvent) o; + return Objects.equals(this.acknowledgedAt, datastoreEvent.acknowledgedAt) && + Objects.equals(this.appId, datastoreEvent.appId) && + Objects.equals(this.createdAt, datastoreEvent.createdAt) && + Objects.equals(this.data, datastoreEvent.data) && + Objects.equals(this.deletedAt, datastoreEvent.deletedAt) && + Objects.equals(this.endpointMetadata, datastoreEvent.endpointMetadata) && + Objects.equals(this.endpoints, datastoreEvent.endpoints) && + Objects.equals(this.eventType, datastoreEvent.eventType) && + Objects.equals(this.headers, datastoreEvent.headers) && + Objects.equals(this.idempotencyKey, datastoreEvent.idempotencyKey) && + Objects.equals(this.isDuplicateEvent, datastoreEvent.isDuplicateEvent) && + Objects.equals(this.metadata, datastoreEvent.metadata) && + Objects.equals(this.projectId, datastoreEvent.projectId) && + Objects.equals(this.raw, datastoreEvent.raw) && + Objects.equals(this.sourceId, datastoreEvent.sourceId) && + Objects.equals(this.sourceMetadata, datastoreEvent.sourceMetadata) && + Objects.equals(this.status, datastoreEvent.status) && + Objects.equals(this.uid, datastoreEvent.uid) && + Objects.equals(this.updatedAt, datastoreEvent.updatedAt) && + Objects.equals(this.urlPath, datastoreEvent.urlPath) && + Objects.equals(this.urlQueryParams, datastoreEvent.urlQueryParams); + } + + @Override + public int hashCode() { + return Objects.hash(acknowledgedAt, appId, createdAt, data, deletedAt, endpointMetadata, endpoints, eventType, headers, idempotencyKey, isDuplicateEvent, metadata, projectId, raw, sourceId, sourceMetadata, status, uid, updatedAt, urlPath, urlQueryParams); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreEvent {\n"); + sb.append(" acknowledgedAt: ").append(toIndentedString(acknowledgedAt)).append("\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" endpointMetadata: ").append(toIndentedString(endpointMetadata)).append("\n"); + sb.append(" endpoints: ").append(toIndentedString(endpoints)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" idempotencyKey: ").append(toIndentedString(idempotencyKey)).append("\n"); + sb.append(" isDuplicateEvent: ").append(toIndentedString(isDuplicateEvent)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" raw: ").append(toIndentedString(raw)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" sourceMetadata: ").append(toIndentedString(sourceMetadata)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" urlPath: ").append(toIndentedString(urlPath)).append("\n"); + sb.append(" urlQueryParams: ").append(toIndentedString(urlQueryParams)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `acknowledged_at` to the URL query string + if (getAcknowledgedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sacknowledged_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAcknowledgedAt())))); + } + + // add `app_id` to the URL query string + if (getAppId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sapp_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAppId())))); + } + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `data` to the URL query string + if (getData() != null) { + for (String _key : getData().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdata%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getData().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getData().get(_key))))); + } + } + + // add `deleted_at` to the URL query string + if (getDeletedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeleted_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeletedAt())))); + } + + // add `endpoint_metadata` to the URL query string + if (getEndpointMetadata() != null) { + for (int i = 0; i < getEndpointMetadata().size(); i++) { + if (getEndpointMetadata().get(i) != null) { + joiner.add(getEndpointMetadata().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sendpoint_metadata%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `endpoints` to the URL query string + if (getEndpoints() != null) { + for (int i = 0; i < getEndpoints().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sendpoints%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEndpoints().get(i))))); + } + } + + // add `event_type` to the URL query string + if (getEventType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventType())))); + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (String _key : getHeaders().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getHeaders().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getHeaders().get(_key))))); + } + } + + // add `idempotency_key` to the URL query string + if (getIdempotencyKey() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sidempotency_key%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIdempotencyKey())))); + } + + // add `is_duplicate_event` to the URL query string + if (getIsDuplicateEvent() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sis_duplicate_event%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIsDuplicateEvent())))); + } + + // add `metadata` to the URL query string + if (getMetadata() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smetadata%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMetadata())))); + } + + // add `project_id` to the URL query string + if (getProjectId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sproject_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProjectId())))); + } + + // add `raw` to the URL query string + if (getRaw() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sraw%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRaw())))); + } + + // add `source_id` to the URL query string + if (getSourceId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssource_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSourceId())))); + } + + // add `source_metadata` to the URL query string + if (getSourceMetadata() != null) { + joiner.add(getSourceMetadata().toUrlQueryString(prefix + "source_metadata" + suffix)); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + // add `updated_at` to the URL query string + if (getUpdatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%supdated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpdatedAt())))); + } + + // add `url_path` to the URL query string + if (getUrlPath() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl_path%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrlPath())))); + } + + // add `url_query_params` to the URL query string + if (getUrlQueryParams() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl_query_params%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrlQueryParams())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreEventDeliveryStatus.java b/src/main/java/com/getconvoy/models/DatastoreEventDeliveryStatus.java new file mode 100644 index 0000000..57aad7a --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreEventDeliveryStatus.java @@ -0,0 +1,86 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.EventDeliveryStatus + */ +public enum DatastoreEventDeliveryStatus { + + ScheduledEventStatus("Scheduled"), + + ProcessingEventStatus("Processing"), + + DiscardedEventStatus("Discarded"), + + FailureEventStatus("Failure"), + + SuccessEventStatus("Success"), + + RetryEventStatus("Retry"); + + private String value; + + DatastoreEventDeliveryStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastoreEventDeliveryStatus fromValue(String value) { + for (DatastoreEventDeliveryStatus b : DatastoreEventDeliveryStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreEventStatus.java b/src/main/java/com/getconvoy/models/DatastoreEventStatus.java new file mode 100644 index 0000000..39d5768 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreEventStatus.java @@ -0,0 +1,84 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.EventStatus + */ +public enum DatastoreEventStatus { + + ProcessingStatus("Processing"), + + FailureStatus("Failure"), + + SuccessStatus("Success"), + + RetryStatus("Retry"), + + PendingStatus("Pending"); + + private String value; + + DatastoreEventStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastoreEventStatus fromValue(String value) { + for (DatastoreEventStatus b : DatastoreEventStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreFilterConfiguration.java b/src/main/java/com/getconvoy/models/DatastoreFilterConfiguration.java new file mode 100644 index 0000000..b293bb4 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreFilterConfiguration.java @@ -0,0 +1,199 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreFilterSchema; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreFilterConfiguration + */ +@JsonPropertyOrder({ + DatastoreFilterConfiguration.JSON_PROPERTY_EVENT_TYPES, + DatastoreFilterConfiguration.JSON_PROPERTY_FILTER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreFilterConfiguration { + public static final String JSON_PROPERTY_EVENT_TYPES = "event_types"; + @jakarta.annotation.Nullable + private List eventTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_FILTER = "filter"; + @jakarta.annotation.Nullable + private DatastoreFilterSchema filter; + + public DatastoreFilterConfiguration() { + } + + public DatastoreFilterConfiguration eventTypes(@jakarta.annotation.Nullable List eventTypes) { + this.eventTypes = eventTypes; + return this; + } + + public DatastoreFilterConfiguration addEventTypesItem(String eventTypesItem) { + if (this.eventTypes == null) { + this.eventTypes = new ArrayList<>(); + } + this.eventTypes.add(eventTypesItem); + return this; + } + + /** + * Get eventTypes + * @return eventTypes + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEventTypes() { + return eventTypes; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventTypes(@jakarta.annotation.Nullable List eventTypes) { + this.eventTypes = eventTypes; + } + + + public DatastoreFilterConfiguration filter(@jakarta.annotation.Nullable DatastoreFilterSchema filter) { + this.filter = filter; + return this; + } + + /** + * Get filter + * @return filter + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FILTER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreFilterSchema getFilter() { + return filter; + } + + + @JsonProperty(value = JSON_PROPERTY_FILTER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilter(@jakarta.annotation.Nullable DatastoreFilterSchema filter) { + this.filter = filter; + } + + + /** + * Return true if this datastore.FilterConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreFilterConfiguration datastoreFilterConfiguration = (DatastoreFilterConfiguration) o; + return Objects.equals(this.eventTypes, datastoreFilterConfiguration.eventTypes) && + Objects.equals(this.filter, datastoreFilterConfiguration.filter); + } + + @Override + public int hashCode() { + return Objects.hash(eventTypes, filter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreFilterConfiguration {\n"); + sb.append(" eventTypes: ").append(toIndentedString(eventTypes)).append("\n"); + sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `event_types` to the URL query string + if (getEventTypes() != null) { + for (int i = 0; i < getEventTypes().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_types%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEventTypes().get(i))))); + } + } + + // add `filter` to the URL query string + if (getFilter() != null) { + joiner.add(getFilter().toUrlQueryString(prefix + "filter" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreFilterSchema.java b/src/main/java/com/getconvoy/models/DatastoreFilterSchema.java new file mode 100644 index 0000000..d4e7150 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreFilterSchema.java @@ -0,0 +1,342 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreFilterSchema + */ +@JsonPropertyOrder({ + DatastoreFilterSchema.JSON_PROPERTY_BODY, + DatastoreFilterSchema.JSON_PROPERTY_HEADERS, + DatastoreFilterSchema.JSON_PROPERTY_IS_FLATTENED, + DatastoreFilterSchema.JSON_PROPERTY_PATH, + DatastoreFilterSchema.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreFilterSchema { + public static final String JSON_PROPERTY_BODY = "body"; + @jakarta.annotation.Nullable + private Map body = new HashMap<>(); + + public static final String JSON_PROPERTY_HEADERS = "headers"; + @jakarta.annotation.Nullable + private Map headers = new HashMap<>(); + + public static final String JSON_PROPERTY_IS_FLATTENED = "is_flattened"; + @jakarta.annotation.Nullable + private Boolean isFlattened; + + public static final String JSON_PROPERTY_PATH = "path"; + @jakarta.annotation.Nullable + private Map path = new HashMap<>(); + + public static final String JSON_PROPERTY_QUERY = "query"; + @jakarta.annotation.Nullable + private Map query = new HashMap<>(); + + public DatastoreFilterSchema() { + } + + public DatastoreFilterSchema body(@jakarta.annotation.Nullable Map body) { + this.body = body; + return this; + } + + public DatastoreFilterSchema putBodyItem(String key, Object bodyItem) { + if (this.body == null) { + this.body = new HashMap<>(); + } + this.body.put(key, bodyItem); + return this; + } + + /** + * Get body + * @return body + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getBody() { + return body; + } + + + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setBody(@jakarta.annotation.Nullable Map body) { + this.body = body; + } + + + public DatastoreFilterSchema headers(@jakarta.annotation.Nullable Map headers) { + this.headers = headers; + return this; + } + + public DatastoreFilterSchema putHeadersItem(String key, Object headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * Get headers + * @return headers + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getHeaders() { + return headers; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(@jakarta.annotation.Nullable Map headers) { + this.headers = headers; + } + + + public DatastoreFilterSchema isFlattened(@jakarta.annotation.Nullable Boolean isFlattened) { + this.isFlattened = isFlattened; + return this; + } + + /** + * Get isFlattened + * @return isFlattened + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IS_FLATTENED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsFlattened() { + return isFlattened; + } + + + @JsonProperty(value = JSON_PROPERTY_IS_FLATTENED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsFlattened(@jakarta.annotation.Nullable Boolean isFlattened) { + this.isFlattened = isFlattened; + } + + + public DatastoreFilterSchema path(@jakarta.annotation.Nullable Map path) { + this.path = path; + return this; + } + + public DatastoreFilterSchema putPathItem(String key, Object pathItem) { + if (this.path == null) { + this.path = new HashMap<>(); + } + this.path.put(key, pathItem); + return this; + } + + /** + * Get path + * @return path + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PATH, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getPath() { + return path; + } + + + @JsonProperty(value = JSON_PROPERTY_PATH, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@jakarta.annotation.Nullable Map path) { + this.path = path; + } + + + public DatastoreFilterSchema query(@jakarta.annotation.Nullable Map query) { + this.query = query; + return this; + } + + public DatastoreFilterSchema putQueryItem(String key, Object queryItem) { + if (this.query == null) { + this.query = new HashMap<>(); + } + this.query.put(key, queryItem); + return this; + } + + /** + * Get query + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getQuery() { + return query; + } + + + @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setQuery(@jakarta.annotation.Nullable Map query) { + this.query = query; + } + + + /** + * Return true if this datastore.FilterSchema object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreFilterSchema datastoreFilterSchema = (DatastoreFilterSchema) o; + return Objects.equals(this.body, datastoreFilterSchema.body) && + Objects.equals(this.headers, datastoreFilterSchema.headers) && + Objects.equals(this.isFlattened, datastoreFilterSchema.isFlattened) && + Objects.equals(this.path, datastoreFilterSchema.path) && + Objects.equals(this.query, datastoreFilterSchema.query); + } + + @Override + public int hashCode() { + return Objects.hash(body, headers, isFlattened, path, query); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreFilterSchema {\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" isFlattened: ").append(toIndentedString(isFlattened)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `body` to the URL query string + if (getBody() != null) { + for (String _key : getBody().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbody%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getBody().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBody().get(_key))))); + } + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (String _key : getHeaders().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getHeaders().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getHeaders().get(_key))))); + } + } + + // add `is_flattened` to the URL query string + if (getIsFlattened() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sis_flattened%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIsFlattened())))); + } + + // add `path` to the URL query string + if (getPath() != null) { + for (String _key : getPath().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%spath%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getPath().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getPath().get(_key))))); + } + } + + // add `query` to the URL query string + if (getQuery() != null) { + for (String _key : getQuery().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%squery%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getQuery().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getQuery().get(_key))))); + } + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreGooglePubSubConfig.java b/src/main/java/com/getconvoy/models/DatastoreGooglePubSubConfig.java new file mode 100644 index 0000000..52d614a --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreGooglePubSubConfig.java @@ -0,0 +1,220 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreGooglePubSubConfig + */ +@JsonPropertyOrder({ + DatastoreGooglePubSubConfig.JSON_PROPERTY_PROJECT_ID, + DatastoreGooglePubSubConfig.JSON_PROPERTY_SERVICE_ACCOUNT, + DatastoreGooglePubSubConfig.JSON_PROPERTY_SUBSCRIPTION_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreGooglePubSubConfig { + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + @jakarta.annotation.Nullable + private String projectId; + + public static final String JSON_PROPERTY_SERVICE_ACCOUNT = "service_account"; + @jakarta.annotation.Nullable + private byte[] serviceAccount; + + public static final String JSON_PROPERTY_SUBSCRIPTION_ID = "subscription_id"; + @jakarta.annotation.Nullable + private String subscriptionId; + + public DatastoreGooglePubSubConfig() { + } + + public DatastoreGooglePubSubConfig projectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Get projectId + * @return projectId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectId() { + return projectId; + } + + + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProjectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + } + + + public DatastoreGooglePubSubConfig serviceAccount(@jakarta.annotation.Nullable byte[] serviceAccount) { + this.serviceAccount = serviceAccount; + return this; + } + + /** + * encoding/json marshals []byte as a base64 string on the wire. + * @return serviceAccount + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SERVICE_ACCOUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getServiceAccount() { + return serviceAccount; + } + + + @JsonProperty(value = JSON_PROPERTY_SERVICE_ACCOUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServiceAccount(@jakarta.annotation.Nullable byte[] serviceAccount) { + this.serviceAccount = serviceAccount; + } + + + public DatastoreGooglePubSubConfig subscriptionId(@jakarta.annotation.Nullable String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get subscriptionId + * @return subscriptionId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SUBSCRIPTION_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubscriptionId() { + return subscriptionId; + } + + + @JsonProperty(value = JSON_PROPERTY_SUBSCRIPTION_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubscriptionId(@jakarta.annotation.Nullable String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + + /** + * Return true if this datastore.GooglePubSubConfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreGooglePubSubConfig datastoreGooglePubSubConfig = (DatastoreGooglePubSubConfig) o; + return Objects.equals(this.projectId, datastoreGooglePubSubConfig.projectId) && + Arrays.equals(this.serviceAccount, datastoreGooglePubSubConfig.serviceAccount) && + Objects.equals(this.subscriptionId, datastoreGooglePubSubConfig.subscriptionId); + } + + @Override + public int hashCode() { + return Objects.hash(projectId, Arrays.hashCode(serviceAccount), subscriptionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreGooglePubSubConfig {\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" serviceAccount: ").append(toIndentedString(serviceAccount)).append("\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `project_id` to the URL query string + if (getProjectId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sproject_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProjectId())))); + } + + // add `service_account` to the URL query string + if (getServiceAccount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sservice_account%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getServiceAccount())))); + } + + // add `subscription_id` to the URL query string + if (getSubscriptionId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssubscription_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSubscriptionId())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreHMac.java b/src/main/java/com/getconvoy/models/DatastoreHMac.java new file mode 100644 index 0000000..a53d3ad --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreHMac.java @@ -0,0 +1,257 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreEncodingType; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreHMac + */ +@JsonPropertyOrder({ + DatastoreHMac.JSON_PROPERTY_ENCODING, + DatastoreHMac.JSON_PROPERTY_HASH, + DatastoreHMac.JSON_PROPERTY_HEADER, + DatastoreHMac.JSON_PROPERTY_SECRET +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreHMac { + public static final String JSON_PROPERTY_ENCODING = "encoding"; + @jakarta.annotation.Nullable + private DatastoreEncodingType encoding; + + public static final String JSON_PROPERTY_HASH = "hash"; + @jakarta.annotation.Nullable + private String hash; + + public static final String JSON_PROPERTY_HEADER = "header"; + @jakarta.annotation.Nullable + private String header; + + public static final String JSON_PROPERTY_SECRET = "secret"; + @jakarta.annotation.Nullable + private String secret; + + public DatastoreHMac() { + } + + public DatastoreHMac encoding(@jakarta.annotation.Nullable DatastoreEncodingType encoding) { + this.encoding = encoding; + return this; + } + + /** + * Get encoding + * @return encoding + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENCODING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreEncodingType getEncoding() { + return encoding; + } + + + @JsonProperty(value = JSON_PROPERTY_ENCODING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncoding(@jakarta.annotation.Nullable DatastoreEncodingType encoding) { + this.encoding = encoding; + } + + + public DatastoreHMac hash(@jakarta.annotation.Nullable String hash) { + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HASH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHash() { + return hash; + } + + + @JsonProperty(value = JSON_PROPERTY_HASH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHash(@jakarta.annotation.Nullable String hash) { + this.hash = hash; + } + + + public DatastoreHMac header(@jakarta.annotation.Nullable String header) { + this.header = header; + return this; + } + + /** + * Get header + * @return header + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHeader() { + return header; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeader(@jakarta.annotation.Nullable String header) { + this.header = header; + } + + + public DatastoreHMac secret(@jakarta.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecret() { + return secret; + } + + + @JsonProperty(value = JSON_PROPERTY_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(@jakarta.annotation.Nullable String secret) { + this.secret = secret; + } + + + /** + * Return true if this datastore.HMac object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreHMac datastoreHMac = (DatastoreHMac) o; + return Objects.equals(this.encoding, datastoreHMac.encoding) && + Objects.equals(this.hash, datastoreHMac.hash) && + Objects.equals(this.header, datastoreHMac.header) && + Objects.equals(this.secret, datastoreHMac.secret); + } + + @Override + public int hashCode() { + return Objects.hash(encoding, hash, header, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreHMac {\n"); + sb.append(" encoding: ").append(toIndentedString(encoding)).append("\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `encoding` to the URL query string + if (getEncoding() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sencoding%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEncoding())))); + } + + // add `hash` to the URL query string + if (getHash() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shash%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHash())))); + } + + // add `header` to the URL query string + if (getHeader() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheader%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHeader())))); + } + + // add `secret` to the URL query string + if (getSecret() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssecret%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSecret())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreKafkaAuth.java b/src/main/java/com/getconvoy/models/DatastoreKafkaAuth.java new file mode 100644 index 0000000..f67bb15 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreKafkaAuth.java @@ -0,0 +1,292 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreKafkaAuth + */ +@JsonPropertyOrder({ + DatastoreKafkaAuth.JSON_PROPERTY_HASH, + DatastoreKafkaAuth.JSON_PROPERTY_PASSWORD, + DatastoreKafkaAuth.JSON_PROPERTY_TLS, + DatastoreKafkaAuth.JSON_PROPERTY_TYPE, + DatastoreKafkaAuth.JSON_PROPERTY_USERNAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreKafkaAuth { + public static final String JSON_PROPERTY_HASH = "hash"; + @jakarta.annotation.Nullable + private String hash; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + @jakarta.annotation.Nullable + private String password; + + public static final String JSON_PROPERTY_TLS = "tls"; + @jakarta.annotation.Nullable + private Boolean tls; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private String type; + + public static final String JSON_PROPERTY_USERNAME = "username"; + @jakarta.annotation.Nullable + private String username; + + public DatastoreKafkaAuth() { + } + + public DatastoreKafkaAuth hash(@jakarta.annotation.Nullable String hash) { + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HASH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHash() { + return hash; + } + + + @JsonProperty(value = JSON_PROPERTY_HASH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHash(@jakarta.annotation.Nullable String hash) { + this.hash = hash; + } + + + public DatastoreKafkaAuth password(@jakarta.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(@jakarta.annotation.Nullable String password) { + this.password = password; + } + + + public DatastoreKafkaAuth tls(@jakarta.annotation.Nullable Boolean tls) { + this.tls = tls; + return this; + } + + /** + * Get tls + * @return tls + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TLS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTls() { + return tls; + } + + + @JsonProperty(value = JSON_PROPERTY_TLS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTls(@jakarta.annotation.Nullable Boolean tls) { + this.tls = tls; + } + + + public DatastoreKafkaAuth type(@jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + + public DatastoreKafkaAuth username(@jakarta.annotation.Nullable String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; + } + + + @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(@jakarta.annotation.Nullable String username) { + this.username = username; + } + + + /** + * Return true if this datastore.KafkaAuth object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreKafkaAuth datastoreKafkaAuth = (DatastoreKafkaAuth) o; + return Objects.equals(this.hash, datastoreKafkaAuth.hash) && + Objects.equals(this.password, datastoreKafkaAuth.password) && + Objects.equals(this.tls, datastoreKafkaAuth.tls) && + Objects.equals(this.type, datastoreKafkaAuth.type) && + Objects.equals(this.username, datastoreKafkaAuth.username); + } + + @Override + public int hashCode() { + return Objects.hash(hash, password, tls, type, username); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreKafkaAuth {\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" tls: ").append(toIndentedString(tls)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `hash` to the URL query string + if (getHash() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shash%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHash())))); + } + + // add `password` to the URL query string + if (getPassword() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spassword%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPassword())))); + } + + // add `tls` to the URL query string + if (getTls() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stls%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTls())))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `username` to the URL query string + if (getUsername() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%susername%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUsername())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreKafkaPubSubConfig.java b/src/main/java/com/getconvoy/models/DatastoreKafkaPubSubConfig.java new file mode 100644 index 0000000..c17cd55 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreKafkaPubSubConfig.java @@ -0,0 +1,271 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreKafkaAuth; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreKafkaPubSubConfig + */ +@JsonPropertyOrder({ + DatastoreKafkaPubSubConfig.JSON_PROPERTY_AUTH, + DatastoreKafkaPubSubConfig.JSON_PROPERTY_BROKERS, + DatastoreKafkaPubSubConfig.JSON_PROPERTY_CONSUMER_GROUP_ID, + DatastoreKafkaPubSubConfig.JSON_PROPERTY_TOPIC_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreKafkaPubSubConfig { + public static final String JSON_PROPERTY_AUTH = "auth"; + @jakarta.annotation.Nullable + private DatastoreKafkaAuth auth; + + public static final String JSON_PROPERTY_BROKERS = "brokers"; + @jakarta.annotation.Nullable + private List brokers = new ArrayList<>(); + + public static final String JSON_PROPERTY_CONSUMER_GROUP_ID = "consumer_group_id"; + @jakarta.annotation.Nullable + private String consumerGroupId; + + public static final String JSON_PROPERTY_TOPIC_NAME = "topic_name"; + @jakarta.annotation.Nullable + private String topicName; + + public DatastoreKafkaPubSubConfig() { + } + + public DatastoreKafkaPubSubConfig auth(@jakarta.annotation.Nullable DatastoreKafkaAuth auth) { + this.auth = auth; + return this; + } + + /** + * Get auth + * @return auth + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreKafkaAuth getAuth() { + return auth; + } + + + @JsonProperty(value = JSON_PROPERTY_AUTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuth(@jakarta.annotation.Nullable DatastoreKafkaAuth auth) { + this.auth = auth; + } + + + public DatastoreKafkaPubSubConfig brokers(@jakarta.annotation.Nullable List brokers) { + this.brokers = brokers; + return this; + } + + public DatastoreKafkaPubSubConfig addBrokersItem(String brokersItem) { + if (this.brokers == null) { + this.brokers = new ArrayList<>(); + } + this.brokers.add(brokersItem); + return this; + } + + /** + * Get brokers + * @return brokers + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BROKERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBrokers() { + return brokers; + } + + + @JsonProperty(value = JSON_PROPERTY_BROKERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBrokers(@jakarta.annotation.Nullable List brokers) { + this.brokers = brokers; + } + + + public DatastoreKafkaPubSubConfig consumerGroupId(@jakarta.annotation.Nullable String consumerGroupId) { + this.consumerGroupId = consumerGroupId; + return this; + } + + /** + * Get consumerGroupId + * @return consumerGroupId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONSUMER_GROUP_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getConsumerGroupId() { + return consumerGroupId; + } + + + @JsonProperty(value = JSON_PROPERTY_CONSUMER_GROUP_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConsumerGroupId(@jakarta.annotation.Nullable String consumerGroupId) { + this.consumerGroupId = consumerGroupId; + } + + + public DatastoreKafkaPubSubConfig topicName(@jakarta.annotation.Nullable String topicName) { + this.topicName = topicName; + return this; + } + + /** + * Get topicName + * @return topicName + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TOPIC_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTopicName() { + return topicName; + } + + + @JsonProperty(value = JSON_PROPERTY_TOPIC_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTopicName(@jakarta.annotation.Nullable String topicName) { + this.topicName = topicName; + } + + + /** + * Return true if this datastore.KafkaPubSubConfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreKafkaPubSubConfig datastoreKafkaPubSubConfig = (DatastoreKafkaPubSubConfig) o; + return Objects.equals(this.auth, datastoreKafkaPubSubConfig.auth) && + Objects.equals(this.brokers, datastoreKafkaPubSubConfig.brokers) && + Objects.equals(this.consumerGroupId, datastoreKafkaPubSubConfig.consumerGroupId) && + Objects.equals(this.topicName, datastoreKafkaPubSubConfig.topicName); + } + + @Override + public int hashCode() { + return Objects.hash(auth, brokers, consumerGroupId, topicName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreKafkaPubSubConfig {\n"); + sb.append(" auth: ").append(toIndentedString(auth)).append("\n"); + sb.append(" brokers: ").append(toIndentedString(brokers)).append("\n"); + sb.append(" consumerGroupId: ").append(toIndentedString(consumerGroupId)).append("\n"); + sb.append(" topicName: ").append(toIndentedString(topicName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `auth` to the URL query string + if (getAuth() != null) { + joiner.add(getAuth().toUrlQueryString(prefix + "auth" + suffix)); + } + + // add `brokers` to the URL query string + if (getBrokers() != null) { + for (int i = 0; i < getBrokers().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbrokers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getBrokers().get(i))))); + } + } + + // add `consumer_group_id` to the URL query string + if (getConsumerGroupId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sconsumer_group_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getConsumerGroupId())))); + } + + // add `topic_name` to the URL query string + if (getTopicName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stopic_name%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTopicName())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreMetaEventAttempt.java b/src/main/java/com/getconvoy/models/DatastoreMetaEventAttempt.java new file mode 100644 index 0000000..a9d9493 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreMetaEventAttempt.java @@ -0,0 +1,246 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreMetaEventAttempt + */ +@JsonPropertyOrder({ + DatastoreMetaEventAttempt.JSON_PROPERTY_REQUEST_HTTP_HEADER, + DatastoreMetaEventAttempt.JSON_PROPERTY_RESPONSE_DATA, + DatastoreMetaEventAttempt.JSON_PROPERTY_RESPONSE_HTTP_HEADER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreMetaEventAttempt { + public static final String JSON_PROPERTY_REQUEST_HTTP_HEADER = "request_http_header"; + @jakarta.annotation.Nullable + private Map requestHttpHeader = new HashMap<>(); + + public static final String JSON_PROPERTY_RESPONSE_DATA = "response_data"; + @jakarta.annotation.Nullable + private String responseData; + + public static final String JSON_PROPERTY_RESPONSE_HTTP_HEADER = "response_http_header"; + @jakarta.annotation.Nullable + private Map responseHttpHeader = new HashMap<>(); + + public DatastoreMetaEventAttempt() { + } + + public DatastoreMetaEventAttempt requestHttpHeader(@jakarta.annotation.Nullable Map requestHttpHeader) { + this.requestHttpHeader = requestHttpHeader; + return this; + } + + public DatastoreMetaEventAttempt putRequestHttpHeaderItem(String key, String requestHttpHeaderItem) { + if (this.requestHttpHeader == null) { + this.requestHttpHeader = new HashMap<>(); + } + this.requestHttpHeader.put(key, requestHttpHeaderItem); + return this; + } + + /** + * Get requestHttpHeader + * @return requestHttpHeader + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_REQUEST_HTTP_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getRequestHttpHeader() { + return requestHttpHeader; + } + + + @JsonProperty(value = JSON_PROPERTY_REQUEST_HTTP_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestHttpHeader(@jakarta.annotation.Nullable Map requestHttpHeader) { + this.requestHttpHeader = requestHttpHeader; + } + + + public DatastoreMetaEventAttempt responseData(@jakarta.annotation.Nullable String responseData) { + this.responseData = responseData; + return this; + } + + /** + * Get responseData + * @return responseData + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RESPONSE_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getResponseData() { + return responseData; + } + + + @JsonProperty(value = JSON_PROPERTY_RESPONSE_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponseData(@jakarta.annotation.Nullable String responseData) { + this.responseData = responseData; + } + + + public DatastoreMetaEventAttempt responseHttpHeader(@jakarta.annotation.Nullable Map responseHttpHeader) { + this.responseHttpHeader = responseHttpHeader; + return this; + } + + public DatastoreMetaEventAttempt putResponseHttpHeaderItem(String key, String responseHttpHeaderItem) { + if (this.responseHttpHeader == null) { + this.responseHttpHeader = new HashMap<>(); + } + this.responseHttpHeader.put(key, responseHttpHeaderItem); + return this; + } + + /** + * Get responseHttpHeader + * @return responseHttpHeader + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RESPONSE_HTTP_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getResponseHttpHeader() { + return responseHttpHeader; + } + + + @JsonProperty(value = JSON_PROPERTY_RESPONSE_HTTP_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponseHttpHeader(@jakarta.annotation.Nullable Map responseHttpHeader) { + this.responseHttpHeader = responseHttpHeader; + } + + + /** + * Return true if this datastore.MetaEventAttempt object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreMetaEventAttempt datastoreMetaEventAttempt = (DatastoreMetaEventAttempt) o; + return Objects.equals(this.requestHttpHeader, datastoreMetaEventAttempt.requestHttpHeader) && + Objects.equals(this.responseData, datastoreMetaEventAttempt.responseData) && + Objects.equals(this.responseHttpHeader, datastoreMetaEventAttempt.responseHttpHeader); + } + + @Override + public int hashCode() { + return Objects.hash(requestHttpHeader, responseData, responseHttpHeader); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreMetaEventAttempt {\n"); + sb.append(" requestHttpHeader: ").append(toIndentedString(requestHttpHeader)).append("\n"); + sb.append(" responseData: ").append(toIndentedString(responseData)).append("\n"); + sb.append(" responseHttpHeader: ").append(toIndentedString(responseHttpHeader)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `request_http_header` to the URL query string + if (getRequestHttpHeader() != null) { + for (String _key : getRequestHttpHeader().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%srequest_http_header%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getRequestHttpHeader().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getRequestHttpHeader().get(_key))))); + } + } + + // add `response_data` to the URL query string + if (getResponseData() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sresponse_data%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getResponseData())))); + } + + // add `response_http_header` to the URL query string + if (getResponseHttpHeader() != null) { + for (String _key : getResponseHttpHeader().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sresponse_http_header%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getResponseHttpHeader().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getResponseHttpHeader().get(_key))))); + } + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreMetaEventConfiguration.java b/src/main/java/com/getconvoy/models/DatastoreMetaEventConfiguration.java new file mode 100644 index 0000000..79b4c6d --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreMetaEventConfiguration.java @@ -0,0 +1,344 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreMetaEventType; +import com.getconvoy.models.DatastorePubSubConfig; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreMetaEventConfiguration + */ +@JsonPropertyOrder({ + DatastoreMetaEventConfiguration.JSON_PROPERTY_EVENT_TYPE, + DatastoreMetaEventConfiguration.JSON_PROPERTY_IS_ENABLED, + DatastoreMetaEventConfiguration.JSON_PROPERTY_PUB_SUB, + DatastoreMetaEventConfiguration.JSON_PROPERTY_SECRET, + DatastoreMetaEventConfiguration.JSON_PROPERTY_TYPE, + DatastoreMetaEventConfiguration.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreMetaEventConfiguration { + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @jakarta.annotation.Nullable + private List eventType = new ArrayList<>(); + + public static final String JSON_PROPERTY_IS_ENABLED = "is_enabled"; + @jakarta.annotation.Nullable + private Boolean isEnabled; + + public static final String JSON_PROPERTY_PUB_SUB = "pub_sub"; + @jakarta.annotation.Nullable + private DatastorePubSubConfig pubSub; + + public static final String JSON_PROPERTY_SECRET = "secret"; + @jakarta.annotation.Nullable + private String secret; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private DatastoreMetaEventType type; + + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nullable + private String url; + + public DatastoreMetaEventConfiguration() { + } + + public DatastoreMetaEventConfiguration eventType(@jakarta.annotation.Nullable List eventType) { + this.eventType = eventType; + return this; + } + + public DatastoreMetaEventConfiguration addEventTypeItem(String eventTypeItem) { + if (this.eventType == null) { + this.eventType = new ArrayList<>(); + } + this.eventType.add(eventTypeItem); + return this; + } + + /** + * Get eventType + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEventType() { + return eventType; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventType(@jakarta.annotation.Nullable List eventType) { + this.eventType = eventType; + } + + + public DatastoreMetaEventConfiguration isEnabled(@jakarta.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get isEnabled + * @return isEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IS_ENABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsEnabled() { + return isEnabled; + } + + + @JsonProperty(value = JSON_PROPERTY_IS_ENABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsEnabled(@jakarta.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + + public DatastoreMetaEventConfiguration pubSub(@jakarta.annotation.Nullable DatastorePubSubConfig pubSub) { + this.pubSub = pubSub; + return this; + } + + /** + * Get pubSub + * @return pubSub + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PUB_SUB, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastorePubSubConfig getPubSub() { + return pubSub; + } + + + @JsonProperty(value = JSON_PROPERTY_PUB_SUB, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPubSub(@jakarta.annotation.Nullable DatastorePubSubConfig pubSub) { + this.pubSub = pubSub; + } + + + public DatastoreMetaEventConfiguration secret(@jakarta.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecret() { + return secret; + } + + + @JsonProperty(value = JSON_PROPERTY_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(@jakarta.annotation.Nullable String secret) { + this.secret = secret; + } + + + public DatastoreMetaEventConfiguration type(@jakarta.annotation.Nullable DatastoreMetaEventType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreMetaEventType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable DatastoreMetaEventType type) { + this.type = type; + } + + + public DatastoreMetaEventConfiguration url(@jakarta.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = url; + } + + + /** + * Return true if this datastore.MetaEventConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreMetaEventConfiguration datastoreMetaEventConfiguration = (DatastoreMetaEventConfiguration) o; + return Objects.equals(this.eventType, datastoreMetaEventConfiguration.eventType) && + Objects.equals(this.isEnabled, datastoreMetaEventConfiguration.isEnabled) && + Objects.equals(this.pubSub, datastoreMetaEventConfiguration.pubSub) && + Objects.equals(this.secret, datastoreMetaEventConfiguration.secret) && + Objects.equals(this.type, datastoreMetaEventConfiguration.type) && + Objects.equals(this.url, datastoreMetaEventConfiguration.url); + } + + @Override + public int hashCode() { + return Objects.hash(eventType, isEnabled, pubSub, secret, type, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreMetaEventConfiguration {\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" pubSub: ").append(toIndentedString(pubSub)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `event_type` to the URL query string + if (getEventType() != null) { + for (int i = 0; i < getEventType().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEventType().get(i))))); + } + } + + // add `is_enabled` to the URL query string + if (getIsEnabled() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sis_enabled%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIsEnabled())))); + } + + // add `pub_sub` to the URL query string + if (getPubSub() != null) { + joiner.add(getPubSub().toUrlQueryString(prefix + "pub_sub" + suffix)); + } + + // add `secret` to the URL query string + if (getSecret() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssecret%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSecret())))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreMetaEventType.java b/src/main/java/com/getconvoy/models/DatastoreMetaEventType.java new file mode 100644 index 0000000..0dea45f --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreMetaEventType.java @@ -0,0 +1,78 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.MetaEventType + */ +public enum DatastoreMetaEventType { + + HTTPMetaEvent("http"), + + PubSubMetaEvent("pub_sub"); + + private String value; + + DatastoreMetaEventType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastoreMetaEventType fromValue(String value) { + for (DatastoreMetaEventType b : DatastoreMetaEventType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreMetadata.java b/src/main/java/com/getconvoy/models/DatastoreMetadata.java new file mode 100644 index 0000000..17d2e4a --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreMetadata.java @@ -0,0 +1,415 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreStrategyProvider; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreMetadata + */ +@JsonPropertyOrder({ + DatastoreMetadata.JSON_PROPERTY_DATA, + DatastoreMetadata.JSON_PROPERTY_INTERVAL_SECONDS, + DatastoreMetadata.JSON_PROPERTY_MAX_RETRY_SECONDS, + DatastoreMetadata.JSON_PROPERTY_NEXT_SEND_TIME, + DatastoreMetadata.JSON_PROPERTY_NUM_TRIALS, + DatastoreMetadata.JSON_PROPERTY_RAW, + DatastoreMetadata.JSON_PROPERTY_RETRY_LIMIT, + DatastoreMetadata.JSON_PROPERTY_STRATEGY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreMetadata { + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private Map data = new HashMap<>(); + + public static final String JSON_PROPERTY_INTERVAL_SECONDS = "interval_seconds"; + @jakarta.annotation.Nullable + private Integer intervalSeconds; + + public static final String JSON_PROPERTY_MAX_RETRY_SECONDS = "max_retry_seconds"; + @jakarta.annotation.Nullable + private Integer maxRetrySeconds; + + public static final String JSON_PROPERTY_NEXT_SEND_TIME = "next_send_time"; + @jakarta.annotation.Nullable + private String nextSendTime; + + public static final String JSON_PROPERTY_NUM_TRIALS = "num_trials"; + @jakarta.annotation.Nullable + private Integer numTrials; + + public static final String JSON_PROPERTY_RAW = "raw"; + @jakarta.annotation.Nullable + private String raw; + + public static final String JSON_PROPERTY_RETRY_LIMIT = "retry_limit"; + @jakarta.annotation.Nullable + private Integer retryLimit; + + public static final String JSON_PROPERTY_STRATEGY = "strategy"; + @jakarta.annotation.Nullable + private DatastoreStrategyProvider strategy; + + public DatastoreMetadata() { + } + + public DatastoreMetadata data(@jakarta.annotation.Nullable Map data) { + this.data = data; + return this; + } + + public DatastoreMetadata putDataItem(String key, Object dataItem) { + if (this.data == null) { + this.data = new HashMap<>(); + } + this.data.put(key, dataItem); + return this; + } + + /** + * Data to be sent to endpoint. + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable Map data) { + this.data = data; + } + + + public DatastoreMetadata intervalSeconds(@jakarta.annotation.Nullable Integer intervalSeconds) { + this.intervalSeconds = intervalSeconds; + return this; + } + + /** + * Get intervalSeconds + * @return intervalSeconds + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_INTERVAL_SECONDS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIntervalSeconds() { + return intervalSeconds; + } + + + @JsonProperty(value = JSON_PROPERTY_INTERVAL_SECONDS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIntervalSeconds(@jakarta.annotation.Nullable Integer intervalSeconds) { + this.intervalSeconds = intervalSeconds; + } + + + public DatastoreMetadata maxRetrySeconds(@jakarta.annotation.Nullable Integer maxRetrySeconds) { + this.maxRetrySeconds = maxRetrySeconds; + return this; + } + + /** + * Get maxRetrySeconds + * @return maxRetrySeconds + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAX_RETRY_SECONDS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxRetrySeconds() { + return maxRetrySeconds; + } + + + @JsonProperty(value = JSON_PROPERTY_MAX_RETRY_SECONDS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxRetrySeconds(@jakarta.annotation.Nullable Integer maxRetrySeconds) { + this.maxRetrySeconds = maxRetrySeconds; + } + + + public DatastoreMetadata nextSendTime(@jakarta.annotation.Nullable String nextSendTime) { + this.nextSendTime = nextSendTime; + return this; + } + + /** + * Get nextSendTime + * @return nextSendTime + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NEXT_SEND_TIME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNextSendTime() { + return nextSendTime; + } + + + @JsonProperty(value = JSON_PROPERTY_NEXT_SEND_TIME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNextSendTime(@jakarta.annotation.Nullable String nextSendTime) { + this.nextSendTime = nextSendTime; + } + + + public DatastoreMetadata numTrials(@jakarta.annotation.Nullable Integer numTrials) { + this.numTrials = numTrials; + return this; + } + + /** + * NumTrials: number of times we have tried to deliver this Event to an application + * @return numTrials + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NUM_TRIALS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNumTrials() { + return numTrials; + } + + + @JsonProperty(value = JSON_PROPERTY_NUM_TRIALS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumTrials(@jakarta.annotation.Nullable Integer numTrials) { + this.numTrials = numTrials; + } + + + public DatastoreMetadata raw(@jakarta.annotation.Nullable String raw) { + this.raw = raw; + return this; + } + + /** + * Get raw + * @return raw + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RAW, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRaw() { + return raw; + } + + + @JsonProperty(value = JSON_PROPERTY_RAW, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRaw(@jakarta.annotation.Nullable String raw) { + this.raw = raw; + } + + + public DatastoreMetadata retryLimit(@jakarta.annotation.Nullable Integer retryLimit) { + this.retryLimit = retryLimit; + return this; + } + + /** + * Get retryLimit + * @return retryLimit + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RETRY_LIMIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRetryLimit() { + return retryLimit; + } + + + @JsonProperty(value = JSON_PROPERTY_RETRY_LIMIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRetryLimit(@jakarta.annotation.Nullable Integer retryLimit) { + this.retryLimit = retryLimit; + } + + + public DatastoreMetadata strategy(@jakarta.annotation.Nullable DatastoreStrategyProvider strategy) { + this.strategy = strategy; + return this; + } + + /** + * Get strategy + * @return strategy + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STRATEGY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreStrategyProvider getStrategy() { + return strategy; + } + + + @JsonProperty(value = JSON_PROPERTY_STRATEGY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStrategy(@jakarta.annotation.Nullable DatastoreStrategyProvider strategy) { + this.strategy = strategy; + } + + + /** + * Return true if this datastore.Metadata object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreMetadata datastoreMetadata = (DatastoreMetadata) o; + return Objects.equals(this.data, datastoreMetadata.data) && + Objects.equals(this.intervalSeconds, datastoreMetadata.intervalSeconds) && + Objects.equals(this.maxRetrySeconds, datastoreMetadata.maxRetrySeconds) && + Objects.equals(this.nextSendTime, datastoreMetadata.nextSendTime) && + Objects.equals(this.numTrials, datastoreMetadata.numTrials) && + Objects.equals(this.raw, datastoreMetadata.raw) && + Objects.equals(this.retryLimit, datastoreMetadata.retryLimit) && + Objects.equals(this.strategy, datastoreMetadata.strategy); + } + + @Override + public int hashCode() { + return Objects.hash(data, intervalSeconds, maxRetrySeconds, nextSendTime, numTrials, raw, retryLimit, strategy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreMetadata {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" intervalSeconds: ").append(toIndentedString(intervalSeconds)).append("\n"); + sb.append(" maxRetrySeconds: ").append(toIndentedString(maxRetrySeconds)).append("\n"); + sb.append(" nextSendTime: ").append(toIndentedString(nextSendTime)).append("\n"); + sb.append(" numTrials: ").append(toIndentedString(numTrials)).append("\n"); + sb.append(" raw: ").append(toIndentedString(raw)).append("\n"); + sb.append(" retryLimit: ").append(toIndentedString(retryLimit)).append("\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `data` to the URL query string + if (getData() != null) { + for (String _key : getData().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdata%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getData().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getData().get(_key))))); + } + } + + // add `interval_seconds` to the URL query string + if (getIntervalSeconds() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sinterval_seconds%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIntervalSeconds())))); + } + + // add `max_retry_seconds` to the URL query string + if (getMaxRetrySeconds() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smax_retry_seconds%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMaxRetrySeconds())))); + } + + // add `next_send_time` to the URL query string + if (getNextSendTime() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%snext_send_time%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNextSendTime())))); + } + + // add `num_trials` to the URL query string + if (getNumTrials() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%snum_trials%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumTrials())))); + } + + // add `raw` to the URL query string + if (getRaw() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sraw%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRaw())))); + } + + // add `retry_limit` to the URL query string + if (getRetryLimit() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sretry_limit%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRetryLimit())))); + } + + // add `strategy` to the URL query string + if (getStrategy() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstrategy%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStrategy())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreMtlsClientCert.java b/src/main/java/com/getconvoy/models/DatastoreMtlsClientCert.java new file mode 100644 index 0000000..e7c6447 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreMtlsClientCert.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreMtlsClientCert + */ +@JsonPropertyOrder({ + DatastoreMtlsClientCert.JSON_PROPERTY_CLIENT_CERT, + DatastoreMtlsClientCert.JSON_PROPERTY_CLIENT_KEY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreMtlsClientCert { + public static final String JSON_PROPERTY_CLIENT_CERT = "client_cert"; + @jakarta.annotation.Nullable + private String clientCert; + + public static final String JSON_PROPERTY_CLIENT_KEY = "client_key"; + @jakarta.annotation.Nullable + private String clientKey; + + public DatastoreMtlsClientCert() { + } + + public DatastoreMtlsClientCert clientCert(@jakarta.annotation.Nullable String clientCert) { + this.clientCert = clientCert; + return this; + } + + /** + * ClientCert is the client certificate PEM string + * @return clientCert + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CLIENT_CERT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientCert() { + return clientCert; + } + + + @JsonProperty(value = JSON_PROPERTY_CLIENT_CERT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientCert(@jakarta.annotation.Nullable String clientCert) { + this.clientCert = clientCert; + } + + + public DatastoreMtlsClientCert clientKey(@jakarta.annotation.Nullable String clientKey) { + this.clientKey = clientKey; + return this; + } + + /** + * ClientKey is the client private key PEM string + * @return clientKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CLIENT_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientKey() { + return clientKey; + } + + + @JsonProperty(value = JSON_PROPERTY_CLIENT_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientKey(@jakarta.annotation.Nullable String clientKey) { + this.clientKey = clientKey; + } + + + /** + * Return true if this datastore.MtlsClientCert object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreMtlsClientCert datastoreMtlsClientCert = (DatastoreMtlsClientCert) o; + return Objects.equals(this.clientCert, datastoreMtlsClientCert.clientCert) && + Objects.equals(this.clientKey, datastoreMtlsClientCert.clientKey); + } + + @Override + public int hashCode() { + return Objects.hash(clientCert, clientKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreMtlsClientCert {\n"); + sb.append(" clientCert: ").append(toIndentedString(clientCert)).append("\n"); + sb.append(" clientKey: ").append(toIndentedString(clientKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `client_cert` to the URL query string + if (getClientCert() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclient_cert%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getClientCert())))); + } + + // add `client_key` to the URL query string + if (getClientKey() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclient_key%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getClientKey())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreOAuth2.java b/src/main/java/com/getconvoy/models/DatastoreOAuth2.java new file mode 100644 index 0000000..e6a4a4e --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreOAuth2.java @@ -0,0 +1,584 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreOAuth2AuthenticationType; +import com.getconvoy.models.DatastoreOAuth2ExpiryTimeUnit; +import com.getconvoy.models.DatastoreOAuth2FieldMapping; +import com.getconvoy.models.DatastoreOAuth2SigningKey; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreOAuth2 + */ +@JsonPropertyOrder({ + DatastoreOAuth2.JSON_PROPERTY_AUDIENCE, + DatastoreOAuth2.JSON_PROPERTY_AUTHENTICATION_TYPE, + DatastoreOAuth2.JSON_PROPERTY_CLIENT_ID, + DatastoreOAuth2.JSON_PROPERTY_CLIENT_SECRET, + DatastoreOAuth2.JSON_PROPERTY_EXPIRY_TIME_UNIT, + DatastoreOAuth2.JSON_PROPERTY_FIELD_MAPPING, + DatastoreOAuth2.JSON_PROPERTY_GRANT_TYPE, + DatastoreOAuth2.JSON_PROPERTY_ISSUER, + DatastoreOAuth2.JSON_PROPERTY_SCOPE, + DatastoreOAuth2.JSON_PROPERTY_SIGNING_ALGORITHM, + DatastoreOAuth2.JSON_PROPERTY_SIGNING_KEY, + DatastoreOAuth2.JSON_PROPERTY_SUBJECT, + DatastoreOAuth2.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreOAuth2 { + public static final String JSON_PROPERTY_AUDIENCE = "audience"; + @jakarta.annotation.Nullable + private String audience; + + public static final String JSON_PROPERTY_AUTHENTICATION_TYPE = "authentication_type"; + @jakarta.annotation.Nullable + private DatastoreOAuth2AuthenticationType authenticationType; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @jakarta.annotation.Nullable + private String clientId; + + public static final String JSON_PROPERTY_CLIENT_SECRET = "client_secret"; + @jakarta.annotation.Nullable + private String clientSecret; + + public static final String JSON_PROPERTY_EXPIRY_TIME_UNIT = "expiry_time_unit"; + @jakarta.annotation.Nullable + private DatastoreOAuth2ExpiryTimeUnit expiryTimeUnit; + + public static final String JSON_PROPERTY_FIELD_MAPPING = "field_mapping"; + @jakarta.annotation.Nullable + private DatastoreOAuth2FieldMapping fieldMapping; + + public static final String JSON_PROPERTY_GRANT_TYPE = "grant_type"; + @jakarta.annotation.Nullable + private String grantType; + + public static final String JSON_PROPERTY_ISSUER = "issuer"; + @jakarta.annotation.Nullable + private String issuer; + + public static final String JSON_PROPERTY_SCOPE = "scope"; + @jakarta.annotation.Nullable + private String scope; + + public static final String JSON_PROPERTY_SIGNING_ALGORITHM = "signing_algorithm"; + @jakarta.annotation.Nullable + private String signingAlgorithm; + + public static final String JSON_PROPERTY_SIGNING_KEY = "signing_key"; + @jakarta.annotation.Nullable + private DatastoreOAuth2SigningKey signingKey; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @jakarta.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nullable + private String url; + + public DatastoreOAuth2() { + } + + public DatastoreOAuth2 audience(@jakarta.annotation.Nullable String audience) { + this.audience = audience; + return this; + } + + /** + * Get audience + * @return audience + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUDIENCE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAudience() { + return audience; + } + + + @JsonProperty(value = JSON_PROPERTY_AUDIENCE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudience(@jakarta.annotation.Nullable String audience) { + this.audience = audience; + } + + + public DatastoreOAuth2 authenticationType(@jakarta.annotation.Nullable DatastoreOAuth2AuthenticationType authenticationType) { + this.authenticationType = authenticationType; + return this; + } + + /** + * Get authenticationType + * @return authenticationType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUTHENTICATION_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreOAuth2AuthenticationType getAuthenticationType() { + return authenticationType; + } + + + @JsonProperty(value = JSON_PROPERTY_AUTHENTICATION_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthenticationType(@jakarta.annotation.Nullable DatastoreOAuth2AuthenticationType authenticationType) { + this.authenticationType = authenticationType; + } + + + public DatastoreOAuth2 clientId(@jakarta.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CLIENT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientId() { + return clientId; + } + + + @JsonProperty(value = JSON_PROPERTY_CLIENT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(@jakarta.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public DatastoreOAuth2 clientSecret(@jakarta.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Encrypted at rest + * @return clientSecret + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CLIENT_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientSecret() { + return clientSecret; + } + + + @JsonProperty(value = JSON_PROPERTY_CLIENT_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientSecret(@jakarta.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + + public DatastoreOAuth2 expiryTimeUnit(@jakarta.annotation.Nullable DatastoreOAuth2ExpiryTimeUnit expiryTimeUnit) { + this.expiryTimeUnit = expiryTimeUnit; + return this; + } + + /** + * Expiry time unit (seconds, milliseconds, minutes, hours) + * @return expiryTimeUnit + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EXPIRY_TIME_UNIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreOAuth2ExpiryTimeUnit getExpiryTimeUnit() { + return expiryTimeUnit; + } + + + @JsonProperty(value = JSON_PROPERTY_EXPIRY_TIME_UNIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiryTimeUnit(@jakarta.annotation.Nullable DatastoreOAuth2ExpiryTimeUnit expiryTimeUnit) { + this.expiryTimeUnit = expiryTimeUnit; + } + + + public DatastoreOAuth2 fieldMapping(@jakarta.annotation.Nullable DatastoreOAuth2FieldMapping fieldMapping) { + this.fieldMapping = fieldMapping; + return this; + } + + /** + * Field mapping for flexible token response parsing + * @return fieldMapping + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FIELD_MAPPING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreOAuth2FieldMapping getFieldMapping() { + return fieldMapping; + } + + + @JsonProperty(value = JSON_PROPERTY_FIELD_MAPPING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldMapping(@jakarta.annotation.Nullable DatastoreOAuth2FieldMapping fieldMapping) { + this.fieldMapping = fieldMapping; + } + + + public DatastoreOAuth2 grantType(@jakarta.annotation.Nullable String grantType) { + this.grantType = grantType; + return this; + } + + /** + * Get grantType + * @return grantType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_GRANT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGrantType() { + return grantType; + } + + + @JsonProperty(value = JSON_PROPERTY_GRANT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGrantType(@jakarta.annotation.Nullable String grantType) { + this.grantType = grantType; + } + + + public DatastoreOAuth2 issuer(@jakarta.annotation.Nullable String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get issuer + * @return issuer + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ISSUER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIssuer() { + return issuer; + } + + + @JsonProperty(value = JSON_PROPERTY_ISSUER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIssuer(@jakarta.annotation.Nullable String issuer) { + this.issuer = issuer; + } + + + public DatastoreOAuth2 scope(@jakarta.annotation.Nullable String scope) { + this.scope = scope; + return this; + } + + /** + * Get scope + * @return scope + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SCOPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScope() { + return scope; + } + + + @JsonProperty(value = JSON_PROPERTY_SCOPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScope(@jakarta.annotation.Nullable String scope) { + this.scope = scope; + } + + + public DatastoreOAuth2 signingAlgorithm(@jakarta.annotation.Nullable String signingAlgorithm) { + this.signingAlgorithm = signingAlgorithm; + return this; + } + + /** + * Get signingAlgorithm + * @return signingAlgorithm + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SIGNING_ALGORITHM, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningAlgorithm() { + return signingAlgorithm; + } + + + @JsonProperty(value = JSON_PROPERTY_SIGNING_ALGORITHM, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningAlgorithm(@jakarta.annotation.Nullable String signingAlgorithm) { + this.signingAlgorithm = signingAlgorithm; + } + + + public DatastoreOAuth2 signingKey(@jakarta.annotation.Nullable DatastoreOAuth2SigningKey signingKey) { + this.signingKey = signingKey; + return this; + } + + /** + * Encrypted at rest + * @return signingKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SIGNING_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreOAuth2SigningKey getSigningKey() { + return signingKey; + } + + + @JsonProperty(value = JSON_PROPERTY_SIGNING_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningKey(@jakarta.annotation.Nullable DatastoreOAuth2SigningKey signingKey) { + this.signingKey = signingKey; + } + + + public DatastoreOAuth2 subject(@jakarta.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * Get subject + * @return subject + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SUBJECT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } + + + @JsonProperty(value = JSON_PROPERTY_SUBJECT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@jakarta.annotation.Nullable String subject) { + this.subject = subject; + } + + + public DatastoreOAuth2 url(@jakarta.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = url; + } + + + /** + * Return true if this datastore.OAuth2 object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreOAuth2 datastoreOAuth2 = (DatastoreOAuth2) o; + return Objects.equals(this.audience, datastoreOAuth2.audience) && + Objects.equals(this.authenticationType, datastoreOAuth2.authenticationType) && + Objects.equals(this.clientId, datastoreOAuth2.clientId) && + Objects.equals(this.clientSecret, datastoreOAuth2.clientSecret) && + Objects.equals(this.expiryTimeUnit, datastoreOAuth2.expiryTimeUnit) && + Objects.equals(this.fieldMapping, datastoreOAuth2.fieldMapping) && + Objects.equals(this.grantType, datastoreOAuth2.grantType) && + Objects.equals(this.issuer, datastoreOAuth2.issuer) && + Objects.equals(this.scope, datastoreOAuth2.scope) && + Objects.equals(this.signingAlgorithm, datastoreOAuth2.signingAlgorithm) && + Objects.equals(this.signingKey, datastoreOAuth2.signingKey) && + Objects.equals(this.subject, datastoreOAuth2.subject) && + Objects.equals(this.url, datastoreOAuth2.url); + } + + @Override + public int hashCode() { + return Objects.hash(audience, authenticationType, clientId, clientSecret, expiryTimeUnit, fieldMapping, grantType, issuer, scope, signingAlgorithm, signingKey, subject, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreOAuth2 {\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append(" authenticationType: ").append(toIndentedString(authenticationType)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" expiryTimeUnit: ").append(toIndentedString(expiryTimeUnit)).append("\n"); + sb.append(" fieldMapping: ").append(toIndentedString(fieldMapping)).append("\n"); + sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" signingAlgorithm: ").append(toIndentedString(signingAlgorithm)).append("\n"); + sb.append(" signingKey: ").append(toIndentedString(signingKey)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `audience` to the URL query string + if (getAudience() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%saudience%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAudience())))); + } + + // add `authentication_type` to the URL query string + if (getAuthenticationType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sauthentication_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAuthenticationType())))); + } + + // add `client_id` to the URL query string + if (getClientId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclient_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getClientId())))); + } + + // add `client_secret` to the URL query string + if (getClientSecret() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclient_secret%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getClientSecret())))); + } + + // add `expiry_time_unit` to the URL query string + if (getExpiryTimeUnit() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sexpiry_time_unit%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getExpiryTimeUnit())))); + } + + // add `field_mapping` to the URL query string + if (getFieldMapping() != null) { + joiner.add(getFieldMapping().toUrlQueryString(prefix + "field_mapping" + suffix)); + } + + // add `grant_type` to the URL query string + if (getGrantType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sgrant_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getGrantType())))); + } + + // add `issuer` to the URL query string + if (getIssuer() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sissuer%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIssuer())))); + } + + // add `scope` to the URL query string + if (getScope() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sscope%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getScope())))); + } + + // add `signing_algorithm` to the URL query string + if (getSigningAlgorithm() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssigning_algorithm%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSigningAlgorithm())))); + } + + // add `signing_key` to the URL query string + if (getSigningKey() != null) { + joiner.add(getSigningKey().toUrlQueryString(prefix + "signing_key" + suffix)); + } + + // add `subject` to the URL query string + if (getSubject() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssubject%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSubject())))); + } + + // add `url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreOAuth2AuthenticationType.java b/src/main/java/com/getconvoy/models/DatastoreOAuth2AuthenticationType.java new file mode 100644 index 0000000..c5bf614 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreOAuth2AuthenticationType.java @@ -0,0 +1,78 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.OAuth2AuthenticationType + */ +public enum DatastoreOAuth2AuthenticationType { + + SharedSecretAuth("shared_secret"), + + ClientAssertionAuth("client_assertion"); + + private String value; + + DatastoreOAuth2AuthenticationType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastoreOAuth2AuthenticationType fromValue(String value) { + for (DatastoreOAuth2AuthenticationType b : DatastoreOAuth2AuthenticationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreOAuth2ExpiryTimeUnit.java b/src/main/java/com/getconvoy/models/DatastoreOAuth2ExpiryTimeUnit.java new file mode 100644 index 0000000..377eacd --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreOAuth2ExpiryTimeUnit.java @@ -0,0 +1,82 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.OAuth2ExpiryTimeUnit + */ +public enum DatastoreOAuth2ExpiryTimeUnit { + + ExpiryTimeUnitSeconds("seconds"), + + ExpiryTimeUnitMilliseconds("milliseconds"), + + ExpiryTimeUnitMinutes("minutes"), + + ExpiryTimeUnitHours("hours"); + + private String value; + + DatastoreOAuth2ExpiryTimeUnit(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastoreOAuth2ExpiryTimeUnit fromValue(String value) { + for (DatastoreOAuth2ExpiryTimeUnit b : DatastoreOAuth2ExpiryTimeUnit.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreOAuth2FieldMapping.java b/src/main/java/com/getconvoy/models/DatastoreOAuth2FieldMapping.java new file mode 100644 index 0000000..3045372 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreOAuth2FieldMapping.java @@ -0,0 +1,220 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreOAuth2FieldMapping + */ +@JsonPropertyOrder({ + DatastoreOAuth2FieldMapping.JSON_PROPERTY_ACCESS_TOKEN, + DatastoreOAuth2FieldMapping.JSON_PROPERTY_EXPIRES_IN, + DatastoreOAuth2FieldMapping.JSON_PROPERTY_TOKEN_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreOAuth2FieldMapping { + public static final String JSON_PROPERTY_ACCESS_TOKEN = "access_token"; + @jakarta.annotation.Nullable + private String accessToken; + + public static final String JSON_PROPERTY_EXPIRES_IN = "expires_in"; + @jakarta.annotation.Nullable + private String expiresIn; + + public static final String JSON_PROPERTY_TOKEN_TYPE = "token_type"; + @jakarta.annotation.Nullable + private String tokenType; + + public DatastoreOAuth2FieldMapping() { + } + + public DatastoreOAuth2FieldMapping accessToken(@jakarta.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Field name for access token (e.g., \"accessToken\", \"access_token\", \"token\") + * @return accessToken + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ACCESS_TOKEN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccessToken() { + return accessToken; + } + + + @JsonProperty(value = JSON_PROPERTY_ACCESS_TOKEN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessToken(@jakarta.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public DatastoreOAuth2FieldMapping expiresIn(@jakarta.annotation.Nullable String expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Field name for expiry time (e.g., \"expiresIn\", \"expires_in\", \"expiresAt\") + * @return expiresIn + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EXPIRES_IN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpiresIn() { + return expiresIn; + } + + + @JsonProperty(value = JSON_PROPERTY_EXPIRES_IN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresIn(@jakarta.annotation.Nullable String expiresIn) { + this.expiresIn = expiresIn; + } + + + public DatastoreOAuth2FieldMapping tokenType(@jakarta.annotation.Nullable String tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Field name for token type (e.g., \"tokenType\", \"token_type\") + * @return tokenType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TOKEN_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTokenType() { + return tokenType; + } + + + @JsonProperty(value = JSON_PROPERTY_TOKEN_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTokenType(@jakarta.annotation.Nullable String tokenType) { + this.tokenType = tokenType; + } + + + /** + * Return true if this datastore.OAuth2FieldMapping object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreOAuth2FieldMapping datastoreOAuth2FieldMapping = (DatastoreOAuth2FieldMapping) o; + return Objects.equals(this.accessToken, datastoreOAuth2FieldMapping.accessToken) && + Objects.equals(this.expiresIn, datastoreOAuth2FieldMapping.expiresIn) && + Objects.equals(this.tokenType, datastoreOAuth2FieldMapping.tokenType); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, expiresIn, tokenType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreOAuth2FieldMapping {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `access_token` to the URL query string + if (getAccessToken() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%saccess_token%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAccessToken())))); + } + + // add `expires_in` to the URL query string + if (getExpiresIn() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sexpires_in%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getExpiresIn())))); + } + + // add `token_type` to the URL query string + if (getTokenType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stoken_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTokenType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreOAuth2SigningKey.java b/src/main/java/com/getconvoy/models/DatastoreOAuth2SigningKey.java new file mode 100644 index 0000000..3370bfd --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreOAuth2SigningKey.java @@ -0,0 +1,580 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreOAuth2SigningKey + */ +@JsonPropertyOrder({ + DatastoreOAuth2SigningKey.JSON_PROPERTY_CRV, + DatastoreOAuth2SigningKey.JSON_PROPERTY_D, + DatastoreOAuth2SigningKey.JSON_PROPERTY_DP, + DatastoreOAuth2SigningKey.JSON_PROPERTY_DQ, + DatastoreOAuth2SigningKey.JSON_PROPERTY_E, + DatastoreOAuth2SigningKey.JSON_PROPERTY_KID, + DatastoreOAuth2SigningKey.JSON_PROPERTY_KTY, + DatastoreOAuth2SigningKey.JSON_PROPERTY_N, + DatastoreOAuth2SigningKey.JSON_PROPERTY_P, + DatastoreOAuth2SigningKey.JSON_PROPERTY_Q, + DatastoreOAuth2SigningKey.JSON_PROPERTY_QI, + DatastoreOAuth2SigningKey.JSON_PROPERTY_X, + DatastoreOAuth2SigningKey.JSON_PROPERTY_Y +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreOAuth2SigningKey { + public static final String JSON_PROPERTY_CRV = "crv"; + @jakarta.annotation.Nullable + private String crv; + + public static final String JSON_PROPERTY_D = "d"; + @jakarta.annotation.Nullable + private String d; + + public static final String JSON_PROPERTY_DP = "dp"; + @jakarta.annotation.Nullable + private String dp; + + public static final String JSON_PROPERTY_DQ = "dq"; + @jakarta.annotation.Nullable + private String dq; + + public static final String JSON_PROPERTY_E = "e"; + @jakarta.annotation.Nullable + private String e; + + public static final String JSON_PROPERTY_KID = "kid"; + @jakarta.annotation.Nullable + private String kid; + + public static final String JSON_PROPERTY_KTY = "kty"; + @jakarta.annotation.Nullable + private String kty; + + public static final String JSON_PROPERTY_N = "n"; + @jakarta.annotation.Nullable + private String n; + + public static final String JSON_PROPERTY_P = "p"; + @jakarta.annotation.Nullable + private String p; + + public static final String JSON_PROPERTY_Q = "q"; + @jakarta.annotation.Nullable + private String q; + + public static final String JSON_PROPERTY_QI = "qi"; + @jakarta.annotation.Nullable + private String qi; + + public static final String JSON_PROPERTY_X = "x"; + @jakarta.annotation.Nullable + private String x; + + public static final String JSON_PROPERTY_Y = "y"; + @jakarta.annotation.Nullable + private String y; + + public DatastoreOAuth2SigningKey() { + } + + public DatastoreOAuth2SigningKey crv(@jakarta.annotation.Nullable String crv) { + this.crv = crv; + return this; + } + + /** + * EC (Elliptic Curve) key fields + * @return crv + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CRV, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCrv() { + return crv; + } + + + @JsonProperty(value = JSON_PROPERTY_CRV, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCrv(@jakarta.annotation.Nullable String crv) { + this.crv = crv; + } + + + public DatastoreOAuth2SigningKey d(@jakarta.annotation.Nullable String d) { + this.d = d; + return this; + } + + /** + * Private key (EC only) + * @return d + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_D, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getD() { + return d; + } + + + @JsonProperty(value = JSON_PROPERTY_D, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setD(@jakarta.annotation.Nullable String d) { + this.d = d; + } + + + public DatastoreOAuth2SigningKey dp(@jakarta.annotation.Nullable String dp) { + this.dp = dp; + return this; + } + + /** + * RSA first factor CRT exponent (RSA private key only) + * @return dp + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDp() { + return dp; + } + + + @JsonProperty(value = JSON_PROPERTY_DP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDp(@jakarta.annotation.Nullable String dp) { + this.dp = dp; + } + + + public DatastoreOAuth2SigningKey dq(@jakarta.annotation.Nullable String dq) { + this.dq = dq; + return this; + } + + /** + * RSA second factor CRT exponent (RSA private key only) + * @return dq + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DQ, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDq() { + return dq; + } + + + @JsonProperty(value = JSON_PROPERTY_DQ, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDq(@jakarta.annotation.Nullable String dq) { + this.dq = dq; + } + + + public DatastoreOAuth2SigningKey e(@jakarta.annotation.Nullable String e) { + this.e = e; + return this; + } + + /** + * RSA public exponent (RSA only) + * @return e + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_E, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getE() { + return e; + } + + + @JsonProperty(value = JSON_PROPERTY_E, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setE(@jakarta.annotation.Nullable String e) { + this.e = e; + } + + + public DatastoreOAuth2SigningKey kid(@jakarta.annotation.Nullable String kid) { + this.kid = kid; + return this; + } + + /** + * Key ID + * @return kid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_KID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKid() { + return kid; + } + + + @JsonProperty(value = JSON_PROPERTY_KID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKid(@jakarta.annotation.Nullable String kid) { + this.kid = kid; + } + + + public DatastoreOAuth2SigningKey kty(@jakarta.annotation.Nullable String kty) { + this.kty = kty; + return this; + } + + /** + * Key type: \"EC\" or \"RSA\" + * @return kty + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_KTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKty() { + return kty; + } + + + @JsonProperty(value = JSON_PROPERTY_KTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKty(@jakarta.annotation.Nullable String kty) { + this.kty = kty; + } + + + public DatastoreOAuth2SigningKey n(@jakarta.annotation.Nullable String n) { + this.n = n; + return this; + } + + /** + * RSA key fields + * @return n + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_N, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getN() { + return n; + } + + + @JsonProperty(value = JSON_PROPERTY_N, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setN(@jakarta.annotation.Nullable String n) { + this.n = n; + } + + + public DatastoreOAuth2SigningKey p(@jakarta.annotation.Nullable String p) { + this.p = p; + return this; + } + + /** + * RSA first prime factor (RSA private key only) + * @return p + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_P, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getP() { + return p; + } + + + @JsonProperty(value = JSON_PROPERTY_P, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setP(@jakarta.annotation.Nullable String p) { + this.p = p; + } + + + public DatastoreOAuth2SigningKey q(@jakarta.annotation.Nullable String q) { + this.q = q; + return this; + } + + /** + * RSA second prime factor (RSA private key only) + * @return q + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_Q, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQ() { + return q; + } + + + @JsonProperty(value = JSON_PROPERTY_Q, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQ(@jakarta.annotation.Nullable String q) { + this.q = q; + } + + + public DatastoreOAuth2SigningKey qi(@jakarta.annotation.Nullable String qi) { + this.qi = qi; + return this; + } + + /** + * RSA first CRT coefficient (RSA private key only) + * @return qi + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_QI, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQi() { + return qi; + } + + + @JsonProperty(value = JSON_PROPERTY_QI, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQi(@jakarta.annotation.Nullable String qi) { + this.qi = qi; + } + + + public DatastoreOAuth2SigningKey x(@jakarta.annotation.Nullable String x) { + this.x = x; + return this; + } + + /** + * X coordinate (EC only) + * @return x + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_X, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getX() { + return x; + } + + + @JsonProperty(value = JSON_PROPERTY_X, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setX(@jakarta.annotation.Nullable String x) { + this.x = x; + } + + + public DatastoreOAuth2SigningKey y(@jakarta.annotation.Nullable String y) { + this.y = y; + return this; + } + + /** + * Y coordinate (EC only) + * @return y + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_Y, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getY() { + return y; + } + + + @JsonProperty(value = JSON_PROPERTY_Y, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setY(@jakarta.annotation.Nullable String y) { + this.y = y; + } + + + /** + * Return true if this datastore.OAuth2SigningKey object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreOAuth2SigningKey datastoreOAuth2SigningKey = (DatastoreOAuth2SigningKey) o; + return Objects.equals(this.crv, datastoreOAuth2SigningKey.crv) && + Objects.equals(this.d, datastoreOAuth2SigningKey.d) && + Objects.equals(this.dp, datastoreOAuth2SigningKey.dp) && + Objects.equals(this.dq, datastoreOAuth2SigningKey.dq) && + Objects.equals(this.e, datastoreOAuth2SigningKey.e) && + Objects.equals(this.kid, datastoreOAuth2SigningKey.kid) && + Objects.equals(this.kty, datastoreOAuth2SigningKey.kty) && + Objects.equals(this.n, datastoreOAuth2SigningKey.n) && + Objects.equals(this.p, datastoreOAuth2SigningKey.p) && + Objects.equals(this.q, datastoreOAuth2SigningKey.q) && + Objects.equals(this.qi, datastoreOAuth2SigningKey.qi) && + Objects.equals(this.x, datastoreOAuth2SigningKey.x) && + Objects.equals(this.y, datastoreOAuth2SigningKey.y); + } + + @Override + public int hashCode() { + return Objects.hash(crv, d, dp, dq, e, kid, kty, n, p, q, qi, x, y); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreOAuth2SigningKey {\n"); + sb.append(" crv: ").append(toIndentedString(crv)).append("\n"); + sb.append(" d: ").append(toIndentedString(d)).append("\n"); + sb.append(" dp: ").append(toIndentedString(dp)).append("\n"); + sb.append(" dq: ").append(toIndentedString(dq)).append("\n"); + sb.append(" e: ").append(toIndentedString(e)).append("\n"); + sb.append(" kid: ").append(toIndentedString(kid)).append("\n"); + sb.append(" kty: ").append(toIndentedString(kty)).append("\n"); + sb.append(" n: ").append(toIndentedString(n)).append("\n"); + sb.append(" p: ").append(toIndentedString(p)).append("\n"); + sb.append(" q: ").append(toIndentedString(q)).append("\n"); + sb.append(" qi: ").append(toIndentedString(qi)).append("\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `crv` to the URL query string + if (getCrv() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scrv%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCrv())))); + } + + // add `d` to the URL query string + if (getD() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sd%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getD())))); + } + + // add `dp` to the URL query string + if (getDp() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdp%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDp())))); + } + + // add `dq` to the URL query string + if (getDq() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdq%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDq())))); + } + + // add `e` to the URL query string + if (getE() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%se%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getE())))); + } + + // add `kid` to the URL query string + if (getKid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%skid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getKid())))); + } + + // add `kty` to the URL query string + if (getKty() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%skty%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getKty())))); + } + + // add `n` to the URL query string + if (getN() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sn%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getN())))); + } + + // add `p` to the URL query string + if (getP() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sp%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getP())))); + } + + // add `q` to the URL query string + if (getQ() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sq%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getQ())))); + } + + // add `qi` to the URL query string + if (getQi() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sqi%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getQi())))); + } + + // add `x` to the URL query string + if (getX() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sx%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getX())))); + } + + // add `y` to the URL query string + if (getY() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sy%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getY())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastorePageDirection.java b/src/main/java/com/getconvoy/models/DatastorePageDirection.java new file mode 100644 index 0000000..e94b81c --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastorePageDirection.java @@ -0,0 +1,78 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.PageDirection + */ +public enum DatastorePageDirection { + + Next("next"), + + Prev("prev"); + + private String value; + + DatastorePageDirection(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastorePageDirection fromValue(String value) { + for (DatastorePageDirection b : DatastorePageDirection.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastorePaginationData.java b/src/main/java/com/getconvoy/models/DatastorePaginationData.java new file mode 100644 index 0000000..635d6f8 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastorePaginationData.java @@ -0,0 +1,328 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastorePaginationData + */ +@JsonPropertyOrder({ + DatastorePaginationData.JSON_PROPERTY_HAS_NEXT_PAGE, + DatastorePaginationData.JSON_PROPERTY_HAS_PREV_PAGE, + DatastorePaginationData.JSON_PROPERTY_NEXT_PAGE_CURSOR, + DatastorePaginationData.JSON_PROPERTY_PER_PAGE, + DatastorePaginationData.JSON_PROPERTY_PREV_PAGE_CURSOR, + DatastorePaginationData.JSON_PROPERTY_TOTAL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastorePaginationData { + public static final String JSON_PROPERTY_HAS_NEXT_PAGE = "has_next_page"; + @jakarta.annotation.Nullable + private Boolean hasNextPage; + + public static final String JSON_PROPERTY_HAS_PREV_PAGE = "has_prev_page"; + @jakarta.annotation.Nullable + private Boolean hasPrevPage; + + public static final String JSON_PROPERTY_NEXT_PAGE_CURSOR = "next_page_cursor"; + @jakarta.annotation.Nullable + private String nextPageCursor; + + public static final String JSON_PROPERTY_PER_PAGE = "per_page"; + @jakarta.annotation.Nullable + private Integer perPage; + + public static final String JSON_PROPERTY_PREV_PAGE_CURSOR = "prev_page_cursor"; + @jakarta.annotation.Nullable + private String prevPageCursor; + + public static final String JSON_PROPERTY_TOTAL = "total"; + @jakarta.annotation.Nullable + private Integer total; + + public DatastorePaginationData() { + } + + public DatastorePaginationData hasNextPage(@jakarta.annotation.Nullable Boolean hasNextPage) { + this.hasNextPage = hasNextPage; + return this; + } + + /** + * Get hasNextPage + * @return hasNextPage + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HAS_NEXT_PAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasNextPage() { + return hasNextPage; + } + + + @JsonProperty(value = JSON_PROPERTY_HAS_NEXT_PAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasNextPage(@jakarta.annotation.Nullable Boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + + public DatastorePaginationData hasPrevPage(@jakarta.annotation.Nullable Boolean hasPrevPage) { + this.hasPrevPage = hasPrevPage; + return this; + } + + /** + * Get hasPrevPage + * @return hasPrevPage + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HAS_PREV_PAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasPrevPage() { + return hasPrevPage; + } + + + @JsonProperty(value = JSON_PROPERTY_HAS_PREV_PAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasPrevPage(@jakarta.annotation.Nullable Boolean hasPrevPage) { + this.hasPrevPage = hasPrevPage; + } + + + public DatastorePaginationData nextPageCursor(@jakarta.annotation.Nullable String nextPageCursor) { + this.nextPageCursor = nextPageCursor; + return this; + } + + /** + * Get nextPageCursor + * @return nextPageCursor + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NEXT_PAGE_CURSOR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNextPageCursor() { + return nextPageCursor; + } + + + @JsonProperty(value = JSON_PROPERTY_NEXT_PAGE_CURSOR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNextPageCursor(@jakarta.annotation.Nullable String nextPageCursor) { + this.nextPageCursor = nextPageCursor; + } + + + public DatastorePaginationData perPage(@jakarta.annotation.Nullable Integer perPage) { + this.perPage = perPage; + return this; + } + + /** + * Get perPage + * @return perPage + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PER_PAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPerPage() { + return perPage; + } + + + @JsonProperty(value = JSON_PROPERTY_PER_PAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPerPage(@jakarta.annotation.Nullable Integer perPage) { + this.perPage = perPage; + } + + + public DatastorePaginationData prevPageCursor(@jakarta.annotation.Nullable String prevPageCursor) { + this.prevPageCursor = prevPageCursor; + return this; + } + + /** + * Get prevPageCursor + * @return prevPageCursor + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PREV_PAGE_CURSOR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrevPageCursor() { + return prevPageCursor; + } + + + @JsonProperty(value = JSON_PROPERTY_PREV_PAGE_CURSOR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrevPageCursor(@jakarta.annotation.Nullable String prevPageCursor) { + this.prevPageCursor = prevPageCursor; + } + + + public DatastorePaginationData total(@jakarta.annotation.Nullable Integer total) { + this.total = total; + return this; + } + + /** + * Get total + * @return total + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TOTAL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotal() { + return total; + } + + + @JsonProperty(value = JSON_PROPERTY_TOTAL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotal(@jakarta.annotation.Nullable Integer total) { + this.total = total; + } + + + /** + * Return true if this datastore.PaginationData object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastorePaginationData datastorePaginationData = (DatastorePaginationData) o; + return Objects.equals(this.hasNextPage, datastorePaginationData.hasNextPage) && + Objects.equals(this.hasPrevPage, datastorePaginationData.hasPrevPage) && + Objects.equals(this.nextPageCursor, datastorePaginationData.nextPageCursor) && + Objects.equals(this.perPage, datastorePaginationData.perPage) && + Objects.equals(this.prevPageCursor, datastorePaginationData.prevPageCursor) && + Objects.equals(this.total, datastorePaginationData.total); + } + + @Override + public int hashCode() { + return Objects.hash(hasNextPage, hasPrevPage, nextPageCursor, perPage, prevPageCursor, total); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastorePaginationData {\n"); + sb.append(" hasNextPage: ").append(toIndentedString(hasNextPage)).append("\n"); + sb.append(" hasPrevPage: ").append(toIndentedString(hasPrevPage)).append("\n"); + sb.append(" nextPageCursor: ").append(toIndentedString(nextPageCursor)).append("\n"); + sb.append(" perPage: ").append(toIndentedString(perPage)).append("\n"); + sb.append(" prevPageCursor: ").append(toIndentedString(prevPageCursor)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `has_next_page` to the URL query string + if (getHasNextPage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shas_next_page%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHasNextPage())))); + } + + // add `has_prev_page` to the URL query string + if (getHasPrevPage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shas_prev_page%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHasPrevPage())))); + } + + // add `next_page_cursor` to the URL query string + if (getNextPageCursor() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%snext_page_cursor%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNextPageCursor())))); + } + + // add `per_page` to the URL query string + if (getPerPage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sper_page%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPerPage())))); + } + + // add `prev_page_cursor` to the URL query string + if (getPrevPageCursor() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sprev_page_cursor%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPrevPageCursor())))); + } + + // add `total` to the URL query string + if (getTotal() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stotal%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTotal())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastorePortalAuthType.java b/src/main/java/com/getconvoy/models/DatastorePortalAuthType.java new file mode 100644 index 0000000..227c496 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastorePortalAuthType.java @@ -0,0 +1,78 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.PortalAuthType + */ +public enum DatastorePortalAuthType { + + PortalAuthTypeRefreshToken("refresh_token"), + + PortalAuthTypeStaticToken("static_token"); + + private String value; + + DatastorePortalAuthType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastorePortalAuthType fromValue(String value) { + for (DatastorePortalAuthType b : DatastorePortalAuthType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastorePortalLinkResponse.java b/src/main/java/com/getconvoy/models/DatastorePortalLinkResponse.java new file mode 100644 index 0000000..98f18ad --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastorePortalLinkResponse.java @@ -0,0 +1,681 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreEndpoint; +import com.getconvoy.models.DatastorePortalAuthType; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastorePortalLinkResponse + */ +@JsonPropertyOrder({ + DatastorePortalLinkResponse.JSON_PROPERTY_AUTH_KEY, + DatastorePortalLinkResponse.JSON_PROPERTY_AUTH_TYPE, + DatastorePortalLinkResponse.JSON_PROPERTY_CAN_MANAGE_ENDPOINT, + DatastorePortalLinkResponse.JSON_PROPERTY_CREATED_AT, + DatastorePortalLinkResponse.JSON_PROPERTY_DELETED_AT, + DatastorePortalLinkResponse.JSON_PROPERTY_ENDPOINT_COUNT, + DatastorePortalLinkResponse.JSON_PROPERTY_ENDPOINTS, + DatastorePortalLinkResponse.JSON_PROPERTY_ENDPOINTS_METADATA, + DatastorePortalLinkResponse.JSON_PROPERTY_NAME, + DatastorePortalLinkResponse.JSON_PROPERTY_OWNER_ID, + DatastorePortalLinkResponse.JSON_PROPERTY_PROJECT_ID, + DatastorePortalLinkResponse.JSON_PROPERTY_TOKEN, + DatastorePortalLinkResponse.JSON_PROPERTY_UID, + DatastorePortalLinkResponse.JSON_PROPERTY_UPDATED_AT, + DatastorePortalLinkResponse.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastorePortalLinkResponse { + public static final String JSON_PROPERTY_AUTH_KEY = "auth_key"; + @jakarta.annotation.Nullable + private String authKey; + + public static final String JSON_PROPERTY_AUTH_TYPE = "auth_type"; + @jakarta.annotation.Nullable + private DatastorePortalAuthType authType; + + public static final String JSON_PROPERTY_CAN_MANAGE_ENDPOINT = "can_manage_endpoint"; + @jakarta.annotation.Nullable + private Boolean canManageEndpoint; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + @jakarta.annotation.Nullable + private String deletedAt; + + public static final String JSON_PROPERTY_ENDPOINT_COUNT = "endpoint_count"; + @jakarta.annotation.Nullable + private Integer endpointCount; + + public static final String JSON_PROPERTY_ENDPOINTS = "endpoints"; + @jakarta.annotation.Nullable + private List endpoints = new ArrayList<>(); + + public static final String JSON_PROPERTY_ENDPOINTS_METADATA = "endpoints_metadata"; + @jakarta.annotation.Nullable + private List endpointsMetadata = new ArrayList<>(); + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_OWNER_ID = "owner_id"; + @jakarta.annotation.Nullable + private String ownerId; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + @jakarta.annotation.Nullable + private String projectId; + + public static final String JSON_PROPERTY_TOKEN = "token"; + @jakarta.annotation.Nullable + private String token; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + @jakarta.annotation.Nullable + private String updatedAt; + + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nullable + private String url; + + public DatastorePortalLinkResponse() { + } + + public DatastorePortalLinkResponse authKey(@jakarta.annotation.Nullable String authKey) { + this.authKey = authKey; + return this; + } + + /** + * Get authKey + * @return authKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUTH_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthKey() { + return authKey; + } + + + @JsonProperty(value = JSON_PROPERTY_AUTH_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthKey(@jakarta.annotation.Nullable String authKey) { + this.authKey = authKey; + } + + + public DatastorePortalLinkResponse authType(@jakarta.annotation.Nullable DatastorePortalAuthType authType) { + this.authType = authType; + return this; + } + + /** + * Get authType + * @return authType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUTH_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastorePortalAuthType getAuthType() { + return authType; + } + + + @JsonProperty(value = JSON_PROPERTY_AUTH_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthType(@jakarta.annotation.Nullable DatastorePortalAuthType authType) { + this.authType = authType; + } + + + public DatastorePortalLinkResponse canManageEndpoint(@jakarta.annotation.Nullable Boolean canManageEndpoint) { + this.canManageEndpoint = canManageEndpoint; + return this; + } + + /** + * Get canManageEndpoint + * @return canManageEndpoint + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CAN_MANAGE_ENDPOINT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanManageEndpoint() { + return canManageEndpoint; + } + + + @JsonProperty(value = JSON_PROPERTY_CAN_MANAGE_ENDPOINT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanManageEndpoint(@jakarta.annotation.Nullable Boolean canManageEndpoint) { + this.canManageEndpoint = canManageEndpoint; + } + + + public DatastorePortalLinkResponse createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public DatastorePortalLinkResponse deletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Get deletedAt + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + } + + + public DatastorePortalLinkResponse endpointCount(@jakarta.annotation.Nullable Integer endpointCount) { + this.endpointCount = endpointCount; + return this; + } + + /** + * Get endpointCount + * @return endpointCount + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getEndpointCount() { + return endpointCount; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpointCount(@jakarta.annotation.Nullable Integer endpointCount) { + this.endpointCount = endpointCount; + } + + + public DatastorePortalLinkResponse endpoints(@jakarta.annotation.Nullable List endpoints) { + this.endpoints = endpoints; + return this; + } + + public DatastorePortalLinkResponse addEndpointsItem(String endpointsItem) { + if (this.endpoints == null) { + this.endpoints = new ArrayList<>(); + } + this.endpoints.add(endpointsItem); + return this; + } + + /** + * Get endpoints + * @return endpoints + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEndpoints() { + return endpoints; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpoints(@jakarta.annotation.Nullable List endpoints) { + this.endpoints = endpoints; + } + + + public DatastorePortalLinkResponse endpointsMetadata(@jakarta.annotation.Nullable List endpointsMetadata) { + this.endpointsMetadata = endpointsMetadata; + return this; + } + + public DatastorePortalLinkResponse addEndpointsMetadataItem(DatastoreEndpoint endpointsMetadataItem) { + if (this.endpointsMetadata == null) { + this.endpointsMetadata = new ArrayList<>(); + } + this.endpointsMetadata.add(endpointsMetadataItem); + return this; + } + + /** + * Get endpointsMetadata + * @return endpointsMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINTS_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEndpointsMetadata() { + return endpointsMetadata; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINTS_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpointsMetadata(@jakarta.annotation.Nullable List endpointsMetadata) { + this.endpointsMetadata = endpointsMetadata; + } + + + public DatastorePortalLinkResponse name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public DatastorePortalLinkResponse ownerId(@jakarta.annotation.Nullable String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Get ownerId + * @return ownerId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OWNER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOwnerId() { + return ownerId; + } + + + @JsonProperty(value = JSON_PROPERTY_OWNER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOwnerId(@jakarta.annotation.Nullable String ownerId) { + this.ownerId = ownerId; + } + + + public DatastorePortalLinkResponse projectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Get projectId + * @return projectId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectId() { + return projectId; + } + + + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProjectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + } + + + public DatastorePortalLinkResponse token(@jakarta.annotation.Nullable String token) { + this.token = token; + return this; + } + + /** + * Get token + * @return token + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TOKEN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getToken() { + return token; + } + + + @JsonProperty(value = JSON_PROPERTY_TOKEN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setToken(@jakarta.annotation.Nullable String token) { + this.token = token; + } + + + public DatastorePortalLinkResponse uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + public DatastorePortalLinkResponse updatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + public DatastorePortalLinkResponse url(@jakarta.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = url; + } + + + /** + * Return true if this datastore.PortalLinkResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastorePortalLinkResponse datastorePortalLinkResponse = (DatastorePortalLinkResponse) o; + return Objects.equals(this.authKey, datastorePortalLinkResponse.authKey) && + Objects.equals(this.authType, datastorePortalLinkResponse.authType) && + Objects.equals(this.canManageEndpoint, datastorePortalLinkResponse.canManageEndpoint) && + Objects.equals(this.createdAt, datastorePortalLinkResponse.createdAt) && + Objects.equals(this.deletedAt, datastorePortalLinkResponse.deletedAt) && + Objects.equals(this.endpointCount, datastorePortalLinkResponse.endpointCount) && + Objects.equals(this.endpoints, datastorePortalLinkResponse.endpoints) && + Objects.equals(this.endpointsMetadata, datastorePortalLinkResponse.endpointsMetadata) && + Objects.equals(this.name, datastorePortalLinkResponse.name) && + Objects.equals(this.ownerId, datastorePortalLinkResponse.ownerId) && + Objects.equals(this.projectId, datastorePortalLinkResponse.projectId) && + Objects.equals(this.token, datastorePortalLinkResponse.token) && + Objects.equals(this.uid, datastorePortalLinkResponse.uid) && + Objects.equals(this.updatedAt, datastorePortalLinkResponse.updatedAt) && + Objects.equals(this.url, datastorePortalLinkResponse.url); + } + + @Override + public int hashCode() { + return Objects.hash(authKey, authType, canManageEndpoint, createdAt, deletedAt, endpointCount, endpoints, endpointsMetadata, name, ownerId, projectId, token, uid, updatedAt, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastorePortalLinkResponse {\n"); + sb.append(" authKey: ").append(toIndentedString(authKey)).append("\n"); + sb.append(" authType: ").append(toIndentedString(authType)).append("\n"); + sb.append(" canManageEndpoint: ").append(toIndentedString(canManageEndpoint)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" endpointCount: ").append(toIndentedString(endpointCount)).append("\n"); + sb.append(" endpoints: ").append(toIndentedString(endpoints)).append("\n"); + sb.append(" endpointsMetadata: ").append(toIndentedString(endpointsMetadata)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `auth_key` to the URL query string + if (getAuthKey() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sauth_key%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAuthKey())))); + } + + // add `auth_type` to the URL query string + if (getAuthType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sauth_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAuthType())))); + } + + // add `can_manage_endpoint` to the URL query string + if (getCanManageEndpoint() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scan_manage_endpoint%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCanManageEndpoint())))); + } + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `deleted_at` to the URL query string + if (getDeletedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeleted_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeletedAt())))); + } + + // add `endpoint_count` to the URL query string + if (getEndpointCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sendpoint_count%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEndpointCount())))); + } + + // add `endpoints` to the URL query string + if (getEndpoints() != null) { + for (int i = 0; i < getEndpoints().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sendpoints%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEndpoints().get(i))))); + } + } + + // add `endpoints_metadata` to the URL query string + if (getEndpointsMetadata() != null) { + for (int i = 0; i < getEndpointsMetadata().size(); i++) { + if (getEndpointsMetadata().get(i) != null) { + joiner.add(getEndpointsMetadata().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sendpoints_metadata%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `owner_id` to the URL query string + if (getOwnerId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sowner_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOwnerId())))); + } + + // add `project_id` to the URL query string + if (getProjectId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sproject_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProjectId())))); + } + + // add `token` to the URL query string + if (getToken() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stoken%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getToken())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + // add `updated_at` to the URL query string + if (getUpdatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%supdated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpdatedAt())))); + } + + // add `url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreProjectConfig.java b/src/main/java/com/getconvoy/models/DatastoreProjectConfig.java new file mode 100644 index 0000000..b36934f --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreProjectConfig.java @@ -0,0 +1,587 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ConfigRequestIDHeaderProvider; +import com.getconvoy.models.DatastoreCircuitBreakerConfiguration; +import com.getconvoy.models.DatastoreMetaEventConfiguration; +import com.getconvoy.models.DatastoreRateLimitConfiguration; +import com.getconvoy.models.DatastoreSSLConfiguration; +import com.getconvoy.models.DatastoreSignatureConfiguration; +import com.getconvoy.models.DatastoreStrategyConfiguration; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreProjectConfig + */ +@JsonPropertyOrder({ + DatastoreProjectConfig.JSON_PROPERTY_ADD_EVENT_ID_TRACE_HEADERS, + DatastoreProjectConfig.JSON_PROPERTY_CIRCUIT_BREAKER, + DatastoreProjectConfig.JSON_PROPERTY_DISABLE_ENDPOINT, + DatastoreProjectConfig.JSON_PROPERTY_MAX_PAYLOAD_READ_SIZE, + DatastoreProjectConfig.JSON_PROPERTY_META_EVENT, + DatastoreProjectConfig.JSON_PROPERTY_MULTIPLE_ENDPOINT_SUBSCRIPTIONS, + DatastoreProjectConfig.JSON_PROPERTY_RATELIMIT, + DatastoreProjectConfig.JSON_PROPERTY_REPLAY_ATTACKS_PREVENTION_ENABLED, + DatastoreProjectConfig.JSON_PROPERTY_REQUEST_ID_HEADER, + DatastoreProjectConfig.JSON_PROPERTY_SEARCH_POLICY, + DatastoreProjectConfig.JSON_PROPERTY_SIGNATURE, + DatastoreProjectConfig.JSON_PROPERTY_SSL, + DatastoreProjectConfig.JSON_PROPERTY_STRATEGY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreProjectConfig { + public static final String JSON_PROPERTY_ADD_EVENT_ID_TRACE_HEADERS = "add_event_id_trace_headers"; + @jakarta.annotation.Nullable + private Boolean addEventIdTraceHeaders; + + public static final String JSON_PROPERTY_CIRCUIT_BREAKER = "circuit_breaker"; + @jakarta.annotation.Nullable + private DatastoreCircuitBreakerConfiguration circuitBreaker; + + public static final String JSON_PROPERTY_DISABLE_ENDPOINT = "disable_endpoint"; + @jakarta.annotation.Nullable + private Boolean disableEndpoint; + + public static final String JSON_PROPERTY_MAX_PAYLOAD_READ_SIZE = "max_payload_read_size"; + @jakarta.annotation.Nullable + private Integer maxPayloadReadSize; + + public static final String JSON_PROPERTY_META_EVENT = "meta_event"; + @jakarta.annotation.Nullable + private DatastoreMetaEventConfiguration metaEvent; + + public static final String JSON_PROPERTY_MULTIPLE_ENDPOINT_SUBSCRIPTIONS = "multiple_endpoint_subscriptions"; + @jakarta.annotation.Nullable + private Boolean multipleEndpointSubscriptions; + + public static final String JSON_PROPERTY_RATELIMIT = "ratelimit"; + @jakarta.annotation.Nullable + private DatastoreRateLimitConfiguration ratelimit; + + public static final String JSON_PROPERTY_REPLAY_ATTACKS_PREVENTION_ENABLED = "replay_attacks_prevention_enabled"; + @jakarta.annotation.Nullable + private Boolean replayAttacksPreventionEnabled; + + public static final String JSON_PROPERTY_REQUEST_ID_HEADER = "request_id_header"; + @jakarta.annotation.Nullable + private ConfigRequestIDHeaderProvider requestIdHeader; + + public static final String JSON_PROPERTY_SEARCH_POLICY = "search_policy"; + @jakarta.annotation.Nullable + private String searchPolicy; + + public static final String JSON_PROPERTY_SIGNATURE = "signature"; + @jakarta.annotation.Nullable + private DatastoreSignatureConfiguration signature; + + public static final String JSON_PROPERTY_SSL = "ssl"; + @jakarta.annotation.Nullable + private DatastoreSSLConfiguration ssl; + + public static final String JSON_PROPERTY_STRATEGY = "strategy"; + @jakarta.annotation.Nullable + private DatastoreStrategyConfiguration strategy; + + public DatastoreProjectConfig() { + } + + public DatastoreProjectConfig addEventIdTraceHeaders(@jakarta.annotation.Nullable Boolean addEventIdTraceHeaders) { + this.addEventIdTraceHeaders = addEventIdTraceHeaders; + return this; + } + + /** + * Get addEventIdTraceHeaders + * @return addEventIdTraceHeaders + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ADD_EVENT_ID_TRACE_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAddEventIdTraceHeaders() { + return addEventIdTraceHeaders; + } + + + @JsonProperty(value = JSON_PROPERTY_ADD_EVENT_ID_TRACE_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAddEventIdTraceHeaders(@jakarta.annotation.Nullable Boolean addEventIdTraceHeaders) { + this.addEventIdTraceHeaders = addEventIdTraceHeaders; + } + + + public DatastoreProjectConfig circuitBreaker(@jakarta.annotation.Nullable DatastoreCircuitBreakerConfiguration circuitBreaker) { + this.circuitBreaker = circuitBreaker; + return this; + } + + /** + * Get circuitBreaker + * @return circuitBreaker + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CIRCUIT_BREAKER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreCircuitBreakerConfiguration getCircuitBreaker() { + return circuitBreaker; + } + + + @JsonProperty(value = JSON_PROPERTY_CIRCUIT_BREAKER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCircuitBreaker(@jakarta.annotation.Nullable DatastoreCircuitBreakerConfiguration circuitBreaker) { + this.circuitBreaker = circuitBreaker; + } + + + public DatastoreProjectConfig disableEndpoint(@jakarta.annotation.Nullable Boolean disableEndpoint) { + this.disableEndpoint = disableEndpoint; + return this; + } + + /** + * Get disableEndpoint + * @return disableEndpoint + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DISABLE_ENDPOINT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDisableEndpoint() { + return disableEndpoint; + } + + + @JsonProperty(value = JSON_PROPERTY_DISABLE_ENDPOINT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisableEndpoint(@jakarta.annotation.Nullable Boolean disableEndpoint) { + this.disableEndpoint = disableEndpoint; + } + + + public DatastoreProjectConfig maxPayloadReadSize(@jakarta.annotation.Nullable Integer maxPayloadReadSize) { + this.maxPayloadReadSize = maxPayloadReadSize; + return this; + } + + /** + * Get maxPayloadReadSize + * @return maxPayloadReadSize + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAX_PAYLOAD_READ_SIZE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxPayloadReadSize() { + return maxPayloadReadSize; + } + + + @JsonProperty(value = JSON_PROPERTY_MAX_PAYLOAD_READ_SIZE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxPayloadReadSize(@jakarta.annotation.Nullable Integer maxPayloadReadSize) { + this.maxPayloadReadSize = maxPayloadReadSize; + } + + + public DatastoreProjectConfig metaEvent(@jakarta.annotation.Nullable DatastoreMetaEventConfiguration metaEvent) { + this.metaEvent = metaEvent; + return this; + } + + /** + * Get metaEvent + * @return metaEvent + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_META_EVENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreMetaEventConfiguration getMetaEvent() { + return metaEvent; + } + + + @JsonProperty(value = JSON_PROPERTY_META_EVENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetaEvent(@jakarta.annotation.Nullable DatastoreMetaEventConfiguration metaEvent) { + this.metaEvent = metaEvent; + } + + + public DatastoreProjectConfig multipleEndpointSubscriptions(@jakarta.annotation.Nullable Boolean multipleEndpointSubscriptions) { + this.multipleEndpointSubscriptions = multipleEndpointSubscriptions; + return this; + } + + /** + * Get multipleEndpointSubscriptions + * @return multipleEndpointSubscriptions + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MULTIPLE_ENDPOINT_SUBSCRIPTIONS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMultipleEndpointSubscriptions() { + return multipleEndpointSubscriptions; + } + + + @JsonProperty(value = JSON_PROPERTY_MULTIPLE_ENDPOINT_SUBSCRIPTIONS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMultipleEndpointSubscriptions(@jakarta.annotation.Nullable Boolean multipleEndpointSubscriptions) { + this.multipleEndpointSubscriptions = multipleEndpointSubscriptions; + } + + + public DatastoreProjectConfig ratelimit(@jakarta.annotation.Nullable DatastoreRateLimitConfiguration ratelimit) { + this.ratelimit = ratelimit; + return this; + } + + /** + * Get ratelimit + * @return ratelimit + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RATELIMIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreRateLimitConfiguration getRatelimit() { + return ratelimit; + } + + + @JsonProperty(value = JSON_PROPERTY_RATELIMIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRatelimit(@jakarta.annotation.Nullable DatastoreRateLimitConfiguration ratelimit) { + this.ratelimit = ratelimit; + } + + + public DatastoreProjectConfig replayAttacksPreventionEnabled(@jakarta.annotation.Nullable Boolean replayAttacksPreventionEnabled) { + this.replayAttacksPreventionEnabled = replayAttacksPreventionEnabled; + return this; + } + + /** + * Get replayAttacksPreventionEnabled + * @return replayAttacksPreventionEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_REPLAY_ATTACKS_PREVENTION_ENABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getReplayAttacksPreventionEnabled() { + return replayAttacksPreventionEnabled; + } + + + @JsonProperty(value = JSON_PROPERTY_REPLAY_ATTACKS_PREVENTION_ENABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReplayAttacksPreventionEnabled(@jakarta.annotation.Nullable Boolean replayAttacksPreventionEnabled) { + this.replayAttacksPreventionEnabled = replayAttacksPreventionEnabled; + } + + + public DatastoreProjectConfig requestIdHeader(@jakarta.annotation.Nullable ConfigRequestIDHeaderProvider requestIdHeader) { + this.requestIdHeader = requestIdHeader; + return this; + } + + /** + * Get requestIdHeader + * @return requestIdHeader + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_REQUEST_ID_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ConfigRequestIDHeaderProvider getRequestIdHeader() { + return requestIdHeader; + } + + + @JsonProperty(value = JSON_PROPERTY_REQUEST_ID_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestIdHeader(@jakarta.annotation.Nullable ConfigRequestIDHeaderProvider requestIdHeader) { + this.requestIdHeader = requestIdHeader; + } + + + public DatastoreProjectConfig searchPolicy(@jakarta.annotation.Nullable String searchPolicy) { + this.searchPolicy = searchPolicy; + return this; + } + + /** + * Get searchPolicy + * @return searchPolicy + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SEARCH_POLICY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchPolicy() { + return searchPolicy; + } + + + @JsonProperty(value = JSON_PROPERTY_SEARCH_POLICY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchPolicy(@jakarta.annotation.Nullable String searchPolicy) { + this.searchPolicy = searchPolicy; + } + + + public DatastoreProjectConfig signature(@jakarta.annotation.Nullable DatastoreSignatureConfiguration signature) { + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SIGNATURE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreSignatureConfiguration getSignature() { + return signature; + } + + + @JsonProperty(value = JSON_PROPERTY_SIGNATURE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignature(@jakarta.annotation.Nullable DatastoreSignatureConfiguration signature) { + this.signature = signature; + } + + + public DatastoreProjectConfig ssl(@jakarta.annotation.Nullable DatastoreSSLConfiguration ssl) { + this.ssl = ssl; + return this; + } + + /** + * Get ssl + * @return ssl + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SSL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreSSLConfiguration getSsl() { + return ssl; + } + + + @JsonProperty(value = JSON_PROPERTY_SSL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSsl(@jakarta.annotation.Nullable DatastoreSSLConfiguration ssl) { + this.ssl = ssl; + } + + + public DatastoreProjectConfig strategy(@jakarta.annotation.Nullable DatastoreStrategyConfiguration strategy) { + this.strategy = strategy; + return this; + } + + /** + * Get strategy + * @return strategy + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STRATEGY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreStrategyConfiguration getStrategy() { + return strategy; + } + + + @JsonProperty(value = JSON_PROPERTY_STRATEGY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStrategy(@jakarta.annotation.Nullable DatastoreStrategyConfiguration strategy) { + this.strategy = strategy; + } + + + /** + * Return true if this datastore.ProjectConfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreProjectConfig datastoreProjectConfig = (DatastoreProjectConfig) o; + return Objects.equals(this.addEventIdTraceHeaders, datastoreProjectConfig.addEventIdTraceHeaders) && + Objects.equals(this.circuitBreaker, datastoreProjectConfig.circuitBreaker) && + Objects.equals(this.disableEndpoint, datastoreProjectConfig.disableEndpoint) && + Objects.equals(this.maxPayloadReadSize, datastoreProjectConfig.maxPayloadReadSize) && + Objects.equals(this.metaEvent, datastoreProjectConfig.metaEvent) && + Objects.equals(this.multipleEndpointSubscriptions, datastoreProjectConfig.multipleEndpointSubscriptions) && + Objects.equals(this.ratelimit, datastoreProjectConfig.ratelimit) && + Objects.equals(this.replayAttacksPreventionEnabled, datastoreProjectConfig.replayAttacksPreventionEnabled) && + Objects.equals(this.requestIdHeader, datastoreProjectConfig.requestIdHeader) && + Objects.equals(this.searchPolicy, datastoreProjectConfig.searchPolicy) && + Objects.equals(this.signature, datastoreProjectConfig.signature) && + Objects.equals(this.ssl, datastoreProjectConfig.ssl) && + Objects.equals(this.strategy, datastoreProjectConfig.strategy); + } + + @Override + public int hashCode() { + return Objects.hash(addEventIdTraceHeaders, circuitBreaker, disableEndpoint, maxPayloadReadSize, metaEvent, multipleEndpointSubscriptions, ratelimit, replayAttacksPreventionEnabled, requestIdHeader, searchPolicy, signature, ssl, strategy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreProjectConfig {\n"); + sb.append(" addEventIdTraceHeaders: ").append(toIndentedString(addEventIdTraceHeaders)).append("\n"); + sb.append(" circuitBreaker: ").append(toIndentedString(circuitBreaker)).append("\n"); + sb.append(" disableEndpoint: ").append(toIndentedString(disableEndpoint)).append("\n"); + sb.append(" maxPayloadReadSize: ").append(toIndentedString(maxPayloadReadSize)).append("\n"); + sb.append(" metaEvent: ").append(toIndentedString(metaEvent)).append("\n"); + sb.append(" multipleEndpointSubscriptions: ").append(toIndentedString(multipleEndpointSubscriptions)).append("\n"); + sb.append(" ratelimit: ").append(toIndentedString(ratelimit)).append("\n"); + sb.append(" replayAttacksPreventionEnabled: ").append(toIndentedString(replayAttacksPreventionEnabled)).append("\n"); + sb.append(" requestIdHeader: ").append(toIndentedString(requestIdHeader)).append("\n"); + sb.append(" searchPolicy: ").append(toIndentedString(searchPolicy)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" ssl: ").append(toIndentedString(ssl)).append("\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `add_event_id_trace_headers` to the URL query string + if (getAddEventIdTraceHeaders() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sadd_event_id_trace_headers%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAddEventIdTraceHeaders())))); + } + + // add `circuit_breaker` to the URL query string + if (getCircuitBreaker() != null) { + joiner.add(getCircuitBreaker().toUrlQueryString(prefix + "circuit_breaker" + suffix)); + } + + // add `disable_endpoint` to the URL query string + if (getDisableEndpoint() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdisable_endpoint%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDisableEndpoint())))); + } + + // add `max_payload_read_size` to the URL query string + if (getMaxPayloadReadSize() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smax_payload_read_size%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMaxPayloadReadSize())))); + } + + // add `meta_event` to the URL query string + if (getMetaEvent() != null) { + joiner.add(getMetaEvent().toUrlQueryString(prefix + "meta_event" + suffix)); + } + + // add `multiple_endpoint_subscriptions` to the URL query string + if (getMultipleEndpointSubscriptions() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smultiple_endpoint_subscriptions%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMultipleEndpointSubscriptions())))); + } + + // add `ratelimit` to the URL query string + if (getRatelimit() != null) { + joiner.add(getRatelimit().toUrlQueryString(prefix + "ratelimit" + suffix)); + } + + // add `replay_attacks_prevention_enabled` to the URL query string + if (getReplayAttacksPreventionEnabled() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sreplay_attacks_prevention_enabled%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getReplayAttacksPreventionEnabled())))); + } + + // add `request_id_header` to the URL query string + if (getRequestIdHeader() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%srequest_id_header%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRequestIdHeader())))); + } + + // add `search_policy` to the URL query string + if (getSearchPolicy() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssearch_policy%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSearchPolicy())))); + } + + // add `signature` to the URL query string + if (getSignature() != null) { + joiner.add(getSignature().toUrlQueryString(prefix + "signature" + suffix)); + } + + // add `ssl` to the URL query string + if (getSsl() != null) { + joiner.add(getSsl().toUrlQueryString(prefix + "ssl" + suffix)); + } + + // add `strategy` to the URL query string + if (getStrategy() != null) { + joiner.add(getStrategy().toUrlQueryString(prefix + "strategy" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreProjectStatistics.java b/src/main/java/com/getconvoy/models/DatastoreProjectStatistics.java new file mode 100644 index 0000000..467c788 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreProjectStatistics.java @@ -0,0 +1,256 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreProjectStatistics + */ +@JsonPropertyOrder({ + DatastoreProjectStatistics.JSON_PROPERTY_ENDPOINTS_EXIST, + DatastoreProjectStatistics.JSON_PROPERTY_EVENTS_EXIST, + DatastoreProjectStatistics.JSON_PROPERTY_SOURCES_EXIST, + DatastoreProjectStatistics.JSON_PROPERTY_SUBSCRIPTIONS_EXIST +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreProjectStatistics { + public static final String JSON_PROPERTY_ENDPOINTS_EXIST = "endpoints_exist"; + @jakarta.annotation.Nullable + private Boolean endpointsExist; + + public static final String JSON_PROPERTY_EVENTS_EXIST = "events_exist"; + @jakarta.annotation.Nullable + private Boolean eventsExist; + + public static final String JSON_PROPERTY_SOURCES_EXIST = "sources_exist"; + @jakarta.annotation.Nullable + private Boolean sourcesExist; + + public static final String JSON_PROPERTY_SUBSCRIPTIONS_EXIST = "subscriptions_exist"; + @jakarta.annotation.Nullable + private Boolean subscriptionsExist; + + public DatastoreProjectStatistics() { + } + + public DatastoreProjectStatistics endpointsExist(@jakarta.annotation.Nullable Boolean endpointsExist) { + this.endpointsExist = endpointsExist; + return this; + } + + /** + * Get endpointsExist + * @return endpointsExist + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINTS_EXIST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEndpointsExist() { + return endpointsExist; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINTS_EXIST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpointsExist(@jakarta.annotation.Nullable Boolean endpointsExist) { + this.endpointsExist = endpointsExist; + } + + + public DatastoreProjectStatistics eventsExist(@jakarta.annotation.Nullable Boolean eventsExist) { + this.eventsExist = eventsExist; + return this; + } + + /** + * Get eventsExist + * @return eventsExist + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENTS_EXIST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEventsExist() { + return eventsExist; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENTS_EXIST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventsExist(@jakarta.annotation.Nullable Boolean eventsExist) { + this.eventsExist = eventsExist; + } + + + public DatastoreProjectStatistics sourcesExist(@jakarta.annotation.Nullable Boolean sourcesExist) { + this.sourcesExist = sourcesExist; + return this; + } + + /** + * Get sourcesExist + * @return sourcesExist + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SOURCES_EXIST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSourcesExist() { + return sourcesExist; + } + + + @JsonProperty(value = JSON_PROPERTY_SOURCES_EXIST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourcesExist(@jakarta.annotation.Nullable Boolean sourcesExist) { + this.sourcesExist = sourcesExist; + } + + + public DatastoreProjectStatistics subscriptionsExist(@jakarta.annotation.Nullable Boolean subscriptionsExist) { + this.subscriptionsExist = subscriptionsExist; + return this; + } + + /** + * Get subscriptionsExist + * @return subscriptionsExist + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SUBSCRIPTIONS_EXIST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSubscriptionsExist() { + return subscriptionsExist; + } + + + @JsonProperty(value = JSON_PROPERTY_SUBSCRIPTIONS_EXIST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubscriptionsExist(@jakarta.annotation.Nullable Boolean subscriptionsExist) { + this.subscriptionsExist = subscriptionsExist; + } + + + /** + * Return true if this datastore.ProjectStatistics object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreProjectStatistics datastoreProjectStatistics = (DatastoreProjectStatistics) o; + return Objects.equals(this.endpointsExist, datastoreProjectStatistics.endpointsExist) && + Objects.equals(this.eventsExist, datastoreProjectStatistics.eventsExist) && + Objects.equals(this.sourcesExist, datastoreProjectStatistics.sourcesExist) && + Objects.equals(this.subscriptionsExist, datastoreProjectStatistics.subscriptionsExist); + } + + @Override + public int hashCode() { + return Objects.hash(endpointsExist, eventsExist, sourcesExist, subscriptionsExist); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreProjectStatistics {\n"); + sb.append(" endpointsExist: ").append(toIndentedString(endpointsExist)).append("\n"); + sb.append(" eventsExist: ").append(toIndentedString(eventsExist)).append("\n"); + sb.append(" sourcesExist: ").append(toIndentedString(sourcesExist)).append("\n"); + sb.append(" subscriptionsExist: ").append(toIndentedString(subscriptionsExist)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `endpoints_exist` to the URL query string + if (getEndpointsExist() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sendpoints_exist%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEndpointsExist())))); + } + + // add `events_exist` to the URL query string + if (getEventsExist() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevents_exist%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventsExist())))); + } + + // add `sources_exist` to the URL query string + if (getSourcesExist() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssources_exist%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSourcesExist())))); + } + + // add `subscriptions_exist` to the URL query string + if (getSubscriptionsExist() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssubscriptions_exist%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSubscriptionsExist())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreProjectType.java b/src/main/java/com/getconvoy/models/DatastoreProjectType.java new file mode 100644 index 0000000..541c721 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreProjectType.java @@ -0,0 +1,78 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.ProjectType + */ +public enum DatastoreProjectType { + + OutgoingProject("outgoing"), + + IncomingProject("incoming"); + + private String value; + + DatastoreProjectType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastoreProjectType fromValue(String value) { + for (DatastoreProjectType b : DatastoreProjectType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreProviderConfig.java b/src/main/java/com/getconvoy/models/DatastoreProviderConfig.java new file mode 100644 index 0000000..f45d88f --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreProviderConfig.java @@ -0,0 +1,149 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreTwitterProviderConfig; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreProviderConfig + */ +@JsonPropertyOrder({ + DatastoreProviderConfig.JSON_PROPERTY_TWITTER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreProviderConfig { + public static final String JSON_PROPERTY_TWITTER = "twitter"; + @jakarta.annotation.Nullable + private DatastoreTwitterProviderConfig twitter; + + public DatastoreProviderConfig() { + } + + public DatastoreProviderConfig twitter(@jakarta.annotation.Nullable DatastoreTwitterProviderConfig twitter) { + this.twitter = twitter; + return this; + } + + /** + * Get twitter + * @return twitter + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TWITTER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreTwitterProviderConfig getTwitter() { + return twitter; + } + + + @JsonProperty(value = JSON_PROPERTY_TWITTER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTwitter(@jakarta.annotation.Nullable DatastoreTwitterProviderConfig twitter) { + this.twitter = twitter; + } + + + /** + * Return true if this datastore.ProviderConfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreProviderConfig datastoreProviderConfig = (DatastoreProviderConfig) o; + return Objects.equals(this.twitter, datastoreProviderConfig.twitter); + } + + @Override + public int hashCode() { + return Objects.hash(twitter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreProviderConfig {\n"); + sb.append(" twitter: ").append(toIndentedString(twitter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `twitter` to the URL query string + if (getTwitter() != null) { + joiner.add(getTwitter().toUrlQueryString(prefix + "twitter" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastorePubSubConfig.java b/src/main/java/com/getconvoy/models/DatastorePubSubConfig.java new file mode 100644 index 0000000..7ba16af --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastorePubSubConfig.java @@ -0,0 +1,333 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreAmqpPubSubConfig; +import com.getconvoy.models.DatastoreGooglePubSubConfig; +import com.getconvoy.models.DatastoreKafkaPubSubConfig; +import com.getconvoy.models.DatastorePubSubType; +import com.getconvoy.models.DatastoreSQSPubSubConfig; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastorePubSubConfig + */ +@JsonPropertyOrder({ + DatastorePubSubConfig.JSON_PROPERTY_AMQP, + DatastorePubSubConfig.JSON_PROPERTY_GOOGLE, + DatastorePubSubConfig.JSON_PROPERTY_KAFKA, + DatastorePubSubConfig.JSON_PROPERTY_SQS, + DatastorePubSubConfig.JSON_PROPERTY_TYPE, + DatastorePubSubConfig.JSON_PROPERTY_WORKERS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastorePubSubConfig { + public static final String JSON_PROPERTY_AMQP = "amqp"; + @jakarta.annotation.Nullable + private DatastoreAmqpPubSubConfig amqp; + + public static final String JSON_PROPERTY_GOOGLE = "google"; + @jakarta.annotation.Nullable + private DatastoreGooglePubSubConfig google; + + public static final String JSON_PROPERTY_KAFKA = "kafka"; + @jakarta.annotation.Nullable + private DatastoreKafkaPubSubConfig kafka; + + public static final String JSON_PROPERTY_SQS = "sqs"; + @jakarta.annotation.Nullable + private DatastoreSQSPubSubConfig sqs; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private DatastorePubSubType type; + + public static final String JSON_PROPERTY_WORKERS = "workers"; + @jakarta.annotation.Nullable + private Integer workers; + + public DatastorePubSubConfig() { + } + + public DatastorePubSubConfig amqp(@jakarta.annotation.Nullable DatastoreAmqpPubSubConfig amqp) { + this.amqp = amqp; + return this; + } + + /** + * Get amqp + * @return amqp + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AMQP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreAmqpPubSubConfig getAmqp() { + return amqp; + } + + + @JsonProperty(value = JSON_PROPERTY_AMQP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmqp(@jakarta.annotation.Nullable DatastoreAmqpPubSubConfig amqp) { + this.amqp = amqp; + } + + + public DatastorePubSubConfig google(@jakarta.annotation.Nullable DatastoreGooglePubSubConfig google) { + this.google = google; + return this; + } + + /** + * Get google + * @return google + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_GOOGLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreGooglePubSubConfig getGoogle() { + return google; + } + + + @JsonProperty(value = JSON_PROPERTY_GOOGLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGoogle(@jakarta.annotation.Nullable DatastoreGooglePubSubConfig google) { + this.google = google; + } + + + public DatastorePubSubConfig kafka(@jakarta.annotation.Nullable DatastoreKafkaPubSubConfig kafka) { + this.kafka = kafka; + return this; + } + + /** + * Get kafka + * @return kafka + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_KAFKA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreKafkaPubSubConfig getKafka() { + return kafka; + } + + + @JsonProperty(value = JSON_PROPERTY_KAFKA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKafka(@jakarta.annotation.Nullable DatastoreKafkaPubSubConfig kafka) { + this.kafka = kafka; + } + + + public DatastorePubSubConfig sqs(@jakarta.annotation.Nullable DatastoreSQSPubSubConfig sqs) { + this.sqs = sqs; + return this; + } + + /** + * Get sqs + * @return sqs + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SQS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreSQSPubSubConfig getSqs() { + return sqs; + } + + + @JsonProperty(value = JSON_PROPERTY_SQS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSqs(@jakarta.annotation.Nullable DatastoreSQSPubSubConfig sqs) { + this.sqs = sqs; + } + + + public DatastorePubSubConfig type(@jakarta.annotation.Nullable DatastorePubSubType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastorePubSubType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable DatastorePubSubType type) { + this.type = type; + } + + + public DatastorePubSubConfig workers(@jakarta.annotation.Nullable Integer workers) { + this.workers = workers; + return this; + } + + /** + * Get workers + * @return workers + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_WORKERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWorkers() { + return workers; + } + + + @JsonProperty(value = JSON_PROPERTY_WORKERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWorkers(@jakarta.annotation.Nullable Integer workers) { + this.workers = workers; + } + + + /** + * Return true if this datastore.PubSubConfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastorePubSubConfig datastorePubSubConfig = (DatastorePubSubConfig) o; + return Objects.equals(this.amqp, datastorePubSubConfig.amqp) && + Objects.equals(this.google, datastorePubSubConfig.google) && + Objects.equals(this.kafka, datastorePubSubConfig.kafka) && + Objects.equals(this.sqs, datastorePubSubConfig.sqs) && + Objects.equals(this.type, datastorePubSubConfig.type) && + Objects.equals(this.workers, datastorePubSubConfig.workers); + } + + @Override + public int hashCode() { + return Objects.hash(amqp, google, kafka, sqs, type, workers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastorePubSubConfig {\n"); + sb.append(" amqp: ").append(toIndentedString(amqp)).append("\n"); + sb.append(" google: ").append(toIndentedString(google)).append("\n"); + sb.append(" kafka: ").append(toIndentedString(kafka)).append("\n"); + sb.append(" sqs: ").append(toIndentedString(sqs)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" workers: ").append(toIndentedString(workers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `amqp` to the URL query string + if (getAmqp() != null) { + joiner.add(getAmqp().toUrlQueryString(prefix + "amqp" + suffix)); + } + + // add `google` to the URL query string + if (getGoogle() != null) { + joiner.add(getGoogle().toUrlQueryString(prefix + "google" + suffix)); + } + + // add `kafka` to the URL query string + if (getKafka() != null) { + joiner.add(getKafka().toUrlQueryString(prefix + "kafka" + suffix)); + } + + // add `sqs` to the URL query string + if (getSqs() != null) { + joiner.add(getSqs().toUrlQueryString(prefix + "sqs" + suffix)); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `workers` to the URL query string + if (getWorkers() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sworkers%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getWorkers())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastorePubSubType.java b/src/main/java/com/getconvoy/models/DatastorePubSubType.java new file mode 100644 index 0000000..b3b8b0a --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastorePubSubType.java @@ -0,0 +1,82 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.PubSubType + */ +public enum DatastorePubSubType { + + SqsPubSub("sqs"), + + GooglePubSub("google"), + + KafkaPubSub("kafka"), + + AmqpPubSub("amqp"); + + private String value; + + DatastorePubSubType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastorePubSubType fromValue(String value) { + for (DatastorePubSubType b : DatastorePubSubType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreRateLimitConfiguration.java b/src/main/java/com/getconvoy/models/DatastoreRateLimitConfiguration.java new file mode 100644 index 0000000..5c2c2d3 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreRateLimitConfiguration.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreRateLimitConfiguration + */ +@JsonPropertyOrder({ + DatastoreRateLimitConfiguration.JSON_PROPERTY_COUNT, + DatastoreRateLimitConfiguration.JSON_PROPERTY_DURATION +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreRateLimitConfiguration { + public static final String JSON_PROPERTY_COUNT = "count"; + @jakarta.annotation.Nullable + private Integer count; + + public static final String JSON_PROPERTY_DURATION = "duration"; + @jakarta.annotation.Nullable + private Integer duration; + + public DatastoreRateLimitConfiguration() { + } + + public DatastoreRateLimitConfiguration count(@jakarta.annotation.Nullable Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * @return count + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCount() { + return count; + } + + + @JsonProperty(value = JSON_PROPERTY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(@jakarta.annotation.Nullable Integer count) { + this.count = count; + } + + + public DatastoreRateLimitConfiguration duration(@jakarta.annotation.Nullable Integer duration) { + this.duration = duration; + return this; + } + + /** + * Get duration + * @return duration + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDuration() { + return duration; + } + + + @JsonProperty(value = JSON_PROPERTY_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDuration(@jakarta.annotation.Nullable Integer duration) { + this.duration = duration; + } + + + /** + * Return true if this datastore.RateLimitConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreRateLimitConfiguration datastoreRateLimitConfiguration = (DatastoreRateLimitConfiguration) o; + return Objects.equals(this.count, datastoreRateLimitConfiguration.count) && + Objects.equals(this.duration, datastoreRateLimitConfiguration.duration); + } + + @Override + public int hashCode() { + return Objects.hash(count, duration); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreRateLimitConfiguration {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `count` to the URL query string + if (getCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scount%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCount())))); + } + + // add `duration` to the URL query string + if (getDuration() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sduration%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDuration())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreRetryConfiguration.java b/src/main/java/com/getconvoy/models/DatastoreRetryConfiguration.java new file mode 100644 index 0000000..5b54aa2 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreRetryConfiguration.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreStrategyProvider; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreRetryConfiguration + */ +@JsonPropertyOrder({ + DatastoreRetryConfiguration.JSON_PROPERTY_DURATION, + DatastoreRetryConfiguration.JSON_PROPERTY_RETRY_COUNT, + DatastoreRetryConfiguration.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreRetryConfiguration { + public static final String JSON_PROPERTY_DURATION = "duration"; + @jakarta.annotation.Nullable + private Integer duration; + + public static final String JSON_PROPERTY_RETRY_COUNT = "retry_count"; + @jakarta.annotation.Nullable + private Integer retryCount; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private DatastoreStrategyProvider type; + + public DatastoreRetryConfiguration() { + } + + public DatastoreRetryConfiguration duration(@jakarta.annotation.Nullable Integer duration) { + this.duration = duration; + return this; + } + + /** + * Get duration + * @return duration + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDuration() { + return duration; + } + + + @JsonProperty(value = JSON_PROPERTY_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDuration(@jakarta.annotation.Nullable Integer duration) { + this.duration = duration; + } + + + public DatastoreRetryConfiguration retryCount(@jakarta.annotation.Nullable Integer retryCount) { + this.retryCount = retryCount; + return this; + } + + /** + * Get retryCount + * @return retryCount + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RETRY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRetryCount() { + return retryCount; + } + + + @JsonProperty(value = JSON_PROPERTY_RETRY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRetryCount(@jakarta.annotation.Nullable Integer retryCount) { + this.retryCount = retryCount; + } + + + public DatastoreRetryConfiguration type(@jakarta.annotation.Nullable DatastoreStrategyProvider type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreStrategyProvider getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable DatastoreStrategyProvider type) { + this.type = type; + } + + + /** + * Return true if this datastore.RetryConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreRetryConfiguration datastoreRetryConfiguration = (DatastoreRetryConfiguration) o; + return Objects.equals(this.duration, datastoreRetryConfiguration.duration) && + Objects.equals(this.retryCount, datastoreRetryConfiguration.retryCount) && + Objects.equals(this.type, datastoreRetryConfiguration.type); + } + + @Override + public int hashCode() { + return Objects.hash(duration, retryCount, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreRetryConfiguration {\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" retryCount: ").append(toIndentedString(retryCount)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `duration` to the URL query string + if (getDuration() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sduration%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDuration())))); + } + + // add `retry_count` to the URL query string + if (getRetryCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sretry_count%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRetryCount())))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreRole.java b/src/main/java/com/getconvoy/models/DatastoreRole.java new file mode 100644 index 0000000..7eb243d --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreRole.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.AuthRoleType; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreRole + */ +@JsonPropertyOrder({ + DatastoreRole.JSON_PROPERTY_APP, + DatastoreRole.JSON_PROPERTY_PROJECT, + DatastoreRole.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreRole { + public static final String JSON_PROPERTY_APP = "app"; + @jakarta.annotation.Nullable + private String app; + + public static final String JSON_PROPERTY_PROJECT = "project"; + @jakarta.annotation.Nullable + private String project; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private AuthRoleType type; + + public DatastoreRole() { + } + + public DatastoreRole app(@jakarta.annotation.Nullable String app) { + this.app = app; + return this; + } + + /** + * Get app + * @return app + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_APP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getApp() { + return app; + } + + + @JsonProperty(value = JSON_PROPERTY_APP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApp(@jakarta.annotation.Nullable String app) { + this.app = app; + } + + + public DatastoreRole project(@jakarta.annotation.Nullable String project) { + this.project = project; + return this; + } + + /** + * Get project + * @return project + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROJECT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProject() { + return project; + } + + + @JsonProperty(value = JSON_PROPERTY_PROJECT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProject(@jakarta.annotation.Nullable String project) { + this.project = project; + } + + + public DatastoreRole type(@jakarta.annotation.Nullable AuthRoleType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AuthRoleType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable AuthRoleType type) { + this.type = type; + } + + + /** + * Return true if this datastore.Role object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreRole datastoreRole = (DatastoreRole) o; + return Objects.equals(this.app, datastoreRole.app) && + Objects.equals(this.project, datastoreRole.project) && + Objects.equals(this.type, datastoreRole.type); + } + + @Override + public int hashCode() { + return Objects.hash(app, project, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreRole {\n"); + sb.append(" app: ").append(toIndentedString(app)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `app` to the URL query string + if (getApp() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sapp%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getApp())))); + } + + // add `project` to the URL query string + if (getProject() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sproject%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProject())))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreSQSPubSubConfig.java b/src/main/java/com/getconvoy/models/DatastoreSQSPubSubConfig.java new file mode 100644 index 0000000..84e97dc --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreSQSPubSubConfig.java @@ -0,0 +1,292 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreSQSPubSubConfig + */ +@JsonPropertyOrder({ + DatastoreSQSPubSubConfig.JSON_PROPERTY_ACCESS_KEY_ID, + DatastoreSQSPubSubConfig.JSON_PROPERTY_DEFAULT_REGION, + DatastoreSQSPubSubConfig.JSON_PROPERTY_ENDPOINT, + DatastoreSQSPubSubConfig.JSON_PROPERTY_QUEUE_NAME, + DatastoreSQSPubSubConfig.JSON_PROPERTY_SECRET_KEY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreSQSPubSubConfig { + public static final String JSON_PROPERTY_ACCESS_KEY_ID = "access_key_id"; + @jakarta.annotation.Nullable + private String accessKeyId; + + public static final String JSON_PROPERTY_DEFAULT_REGION = "default_region"; + @jakarta.annotation.Nullable + private String defaultRegion; + + public static final String JSON_PROPERTY_ENDPOINT = "endpoint"; + @jakarta.annotation.Nullable + private String endpoint; + + public static final String JSON_PROPERTY_QUEUE_NAME = "queue_name"; + @jakarta.annotation.Nullable + private String queueName; + + public static final String JSON_PROPERTY_SECRET_KEY = "secret_key"; + @jakarta.annotation.Nullable + private String secretKey; + + public DatastoreSQSPubSubConfig() { + } + + public DatastoreSQSPubSubConfig accessKeyId(@jakarta.annotation.Nullable String accessKeyId) { + this.accessKeyId = accessKeyId; + return this; + } + + /** + * Get accessKeyId + * @return accessKeyId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ACCESS_KEY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccessKeyId() { + return accessKeyId; + } + + + @JsonProperty(value = JSON_PROPERTY_ACCESS_KEY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessKeyId(@jakarta.annotation.Nullable String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + + public DatastoreSQSPubSubConfig defaultRegion(@jakarta.annotation.Nullable String defaultRegion) { + this.defaultRegion = defaultRegion; + return this; + } + + /** + * Get defaultRegion + * @return defaultRegion + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DEFAULT_REGION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDefaultRegion() { + return defaultRegion; + } + + + @JsonProperty(value = JSON_PROPERTY_DEFAULT_REGION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultRegion(@jakarta.annotation.Nullable String defaultRegion) { + this.defaultRegion = defaultRegion; + } + + + public DatastoreSQSPubSubConfig endpoint(@jakarta.annotation.Nullable String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Optional: for LocalStack testing + * @return endpoint + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEndpoint() { + return endpoint; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpoint(@jakarta.annotation.Nullable String endpoint) { + this.endpoint = endpoint; + } + + + public DatastoreSQSPubSubConfig queueName(@jakarta.annotation.Nullable String queueName) { + this.queueName = queueName; + return this; + } + + /** + * Get queueName + * @return queueName + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_QUEUE_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQueueName() { + return queueName; + } + + + @JsonProperty(value = JSON_PROPERTY_QUEUE_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQueueName(@jakarta.annotation.Nullable String queueName) { + this.queueName = queueName; + } + + + public DatastoreSQSPubSubConfig secretKey(@jakarta.annotation.Nullable String secretKey) { + this.secretKey = secretKey; + return this; + } + + /** + * Get secretKey + * @return secretKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SECRET_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecretKey() { + return secretKey; + } + + + @JsonProperty(value = JSON_PROPERTY_SECRET_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecretKey(@jakarta.annotation.Nullable String secretKey) { + this.secretKey = secretKey; + } + + + /** + * Return true if this datastore.SQSPubSubConfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreSQSPubSubConfig datastoreSQSPubSubConfig = (DatastoreSQSPubSubConfig) o; + return Objects.equals(this.accessKeyId, datastoreSQSPubSubConfig.accessKeyId) && + Objects.equals(this.defaultRegion, datastoreSQSPubSubConfig.defaultRegion) && + Objects.equals(this.endpoint, datastoreSQSPubSubConfig.endpoint) && + Objects.equals(this.queueName, datastoreSQSPubSubConfig.queueName) && + Objects.equals(this.secretKey, datastoreSQSPubSubConfig.secretKey); + } + + @Override + public int hashCode() { + return Objects.hash(accessKeyId, defaultRegion, endpoint, queueName, secretKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreSQSPubSubConfig {\n"); + sb.append(" accessKeyId: ").append(toIndentedString(accessKeyId)).append("\n"); + sb.append(" defaultRegion: ").append(toIndentedString(defaultRegion)).append("\n"); + sb.append(" endpoint: ").append(toIndentedString(endpoint)).append("\n"); + sb.append(" queueName: ").append(toIndentedString(queueName)).append("\n"); + sb.append(" secretKey: ").append(toIndentedString(secretKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `access_key_id` to the URL query string + if (getAccessKeyId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%saccess_key_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAccessKeyId())))); + } + + // add `default_region` to the URL query string + if (getDefaultRegion() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdefault_region%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDefaultRegion())))); + } + + // add `endpoint` to the URL query string + if (getEndpoint() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sendpoint%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEndpoint())))); + } + + // add `queue_name` to the URL query string + if (getQueueName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%squeue_name%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getQueueName())))); + } + + // add `secret_key` to the URL query string + if (getSecretKey() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssecret_key%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSecretKey())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreSSLConfiguration.java b/src/main/java/com/getconvoy/models/DatastoreSSLConfiguration.java new file mode 100644 index 0000000..4380a64 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreSSLConfiguration.java @@ -0,0 +1,148 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreSSLConfiguration + */ +@JsonPropertyOrder({ + DatastoreSSLConfiguration.JSON_PROPERTY_ENFORCE_SECURE_ENDPOINTS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreSSLConfiguration { + public static final String JSON_PROPERTY_ENFORCE_SECURE_ENDPOINTS = "enforce_secure_endpoints"; + @jakarta.annotation.Nullable + private Boolean enforceSecureEndpoints; + + public DatastoreSSLConfiguration() { + } + + public DatastoreSSLConfiguration enforceSecureEndpoints(@jakarta.annotation.Nullable Boolean enforceSecureEndpoints) { + this.enforceSecureEndpoints = enforceSecureEndpoints; + return this; + } + + /** + * Get enforceSecureEndpoints + * @return enforceSecureEndpoints + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENFORCE_SECURE_ENDPOINTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnforceSecureEndpoints() { + return enforceSecureEndpoints; + } + + + @JsonProperty(value = JSON_PROPERTY_ENFORCE_SECURE_ENDPOINTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnforceSecureEndpoints(@jakarta.annotation.Nullable Boolean enforceSecureEndpoints) { + this.enforceSecureEndpoints = enforceSecureEndpoints; + } + + + /** + * Return true if this datastore.SSLConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreSSLConfiguration datastoreSSLConfiguration = (DatastoreSSLConfiguration) o; + return Objects.equals(this.enforceSecureEndpoints, datastoreSSLConfiguration.enforceSecureEndpoints); + } + + @Override + public int hashCode() { + return Objects.hash(enforceSecureEndpoints); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreSSLConfiguration {\n"); + sb.append(" enforceSecureEndpoints: ").append(toIndentedString(enforceSecureEndpoints)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `enforce_secure_endpoints` to the URL query string + if (getEnforceSecureEndpoints() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%senforce_secure_endpoints%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEnforceSecureEndpoints())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreSecret.java b/src/main/java/com/getconvoy/models/DatastoreSecret.java new file mode 100644 index 0000000..94f2c69 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreSecret.java @@ -0,0 +1,328 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreSecret + */ +@JsonPropertyOrder({ + DatastoreSecret.JSON_PROPERTY_CREATED_AT, + DatastoreSecret.JSON_PROPERTY_DELETED_AT, + DatastoreSecret.JSON_PROPERTY_EXPIRES_AT, + DatastoreSecret.JSON_PROPERTY_UID, + DatastoreSecret.JSON_PROPERTY_UPDATED_AT, + DatastoreSecret.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreSecret { + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + @jakarta.annotation.Nullable + private String deletedAt; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @jakarta.annotation.Nullable + private String expiresAt; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + @jakarta.annotation.Nullable + private String updatedAt; + + public static final String JSON_PROPERTY_VALUE = "value"; + @jakarta.annotation.Nullable + private String value; + + public DatastoreSecret() { + } + + public DatastoreSecret createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public DatastoreSecret deletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Get deletedAt + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + } + + + public DatastoreSecret expiresAt(@jakarta.annotation.Nullable String expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * Get expiresAt + * @return expiresAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EXPIRES_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(value = JSON_PROPERTY_EXPIRES_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@jakarta.annotation.Nullable String expiresAt) { + this.expiresAt = expiresAt; + } + + + public DatastoreSecret uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + public DatastoreSecret updatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + public DatastoreSecret value(@jakarta.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_VALUE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + + @JsonProperty(value = JSON_PROPERTY_VALUE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@jakarta.annotation.Nullable String value) { + this.value = value; + } + + + /** + * Return true if this datastore.Secret object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreSecret datastoreSecret = (DatastoreSecret) o; + return Objects.equals(this.createdAt, datastoreSecret.createdAt) && + Objects.equals(this.deletedAt, datastoreSecret.deletedAt) && + Objects.equals(this.expiresAt, datastoreSecret.expiresAt) && + Objects.equals(this.uid, datastoreSecret.uid) && + Objects.equals(this.updatedAt, datastoreSecret.updatedAt) && + Objects.equals(this.value, datastoreSecret.value); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, deletedAt, expiresAt, uid, updatedAt, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreSecret {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `deleted_at` to the URL query string + if (getDeletedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeleted_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeletedAt())))); + } + + // add `expires_at` to the URL query string + if (getExpiresAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sexpires_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getExpiresAt())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + // add `updated_at` to the URL query string + if (getUpdatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%supdated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpdatedAt())))); + } + + // add `value` to the URL query string + if (getValue() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%svalue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getValue())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreSignatureConfiguration.java b/src/main/java/com/getconvoy/models/DatastoreSignatureConfiguration.java new file mode 100644 index 0000000..68c4e11 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreSignatureConfiguration.java @@ -0,0 +1,201 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ConfigSignatureHeaderProvider; +import com.getconvoy.models.DatastoreSignatureVersion; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreSignatureConfiguration + */ +@JsonPropertyOrder({ + DatastoreSignatureConfiguration.JSON_PROPERTY_HEADER, + DatastoreSignatureConfiguration.JSON_PROPERTY_VERSIONS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreSignatureConfiguration { + public static final String JSON_PROPERTY_HEADER = "header"; + @jakarta.annotation.Nullable + private ConfigSignatureHeaderProvider header; + + public static final String JSON_PROPERTY_VERSIONS = "versions"; + @jakarta.annotation.Nullable + private List versions = new ArrayList<>(); + + public DatastoreSignatureConfiguration() { + } + + public DatastoreSignatureConfiguration header(@jakarta.annotation.Nullable ConfigSignatureHeaderProvider header) { + this.header = header; + return this; + } + + /** + * Get header + * @return header + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ConfigSignatureHeaderProvider getHeader() { + return header; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeader(@jakarta.annotation.Nullable ConfigSignatureHeaderProvider header) { + this.header = header; + } + + + public DatastoreSignatureConfiguration versions(@jakarta.annotation.Nullable List versions) { + this.versions = versions; + return this; + } + + public DatastoreSignatureConfiguration addVersionsItem(DatastoreSignatureVersion versionsItem) { + if (this.versions == null) { + this.versions = new ArrayList<>(); + } + this.versions.add(versionsItem); + return this; + } + + /** + * Get versions + * @return versions + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_VERSIONS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getVersions() { + return versions; + } + + + @JsonProperty(value = JSON_PROPERTY_VERSIONS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersions(@jakarta.annotation.Nullable List versions) { + this.versions = versions; + } + + + /** + * Return true if this datastore.SignatureConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreSignatureConfiguration datastoreSignatureConfiguration = (DatastoreSignatureConfiguration) o; + return Objects.equals(this.header, datastoreSignatureConfiguration.header) && + Objects.equals(this.versions, datastoreSignatureConfiguration.versions); + } + + @Override + public int hashCode() { + return Objects.hash(header, versions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreSignatureConfiguration {\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" versions: ").append(toIndentedString(versions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `header` to the URL query string + if (getHeader() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheader%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHeader())))); + } + + // add `versions` to the URL query string + if (getVersions() != null) { + for (int i = 0; i < getVersions().size(); i++) { + if (getVersions().get(i) != null) { + joiner.add(getVersions().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sversions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreSignatureVersion.java b/src/main/java/com/getconvoy/models/DatastoreSignatureVersion.java new file mode 100644 index 0000000..3de353f --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreSignatureVersion.java @@ -0,0 +1,257 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreEncodingType; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreSignatureVersion + */ +@JsonPropertyOrder({ + DatastoreSignatureVersion.JSON_PROPERTY_CREATED_AT, + DatastoreSignatureVersion.JSON_PROPERTY_ENCODING, + DatastoreSignatureVersion.JSON_PROPERTY_HASH, + DatastoreSignatureVersion.JSON_PROPERTY_UID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreSignatureVersion { + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_ENCODING = "encoding"; + @jakarta.annotation.Nullable + private DatastoreEncodingType encoding; + + public static final String JSON_PROPERTY_HASH = "hash"; + @jakarta.annotation.Nullable + private String hash; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public DatastoreSignatureVersion() { + } + + public DatastoreSignatureVersion createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public DatastoreSignatureVersion encoding(@jakarta.annotation.Nullable DatastoreEncodingType encoding) { + this.encoding = encoding; + return this; + } + + /** + * Get encoding + * @return encoding + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENCODING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreEncodingType getEncoding() { + return encoding; + } + + + @JsonProperty(value = JSON_PROPERTY_ENCODING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncoding(@jakarta.annotation.Nullable DatastoreEncodingType encoding) { + this.encoding = encoding; + } + + + public DatastoreSignatureVersion hash(@jakarta.annotation.Nullable String hash) { + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HASH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHash() { + return hash; + } + + + @JsonProperty(value = JSON_PROPERTY_HASH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHash(@jakarta.annotation.Nullable String hash) { + this.hash = hash; + } + + + public DatastoreSignatureVersion uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + /** + * Return true if this datastore.SignatureVersion object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreSignatureVersion datastoreSignatureVersion = (DatastoreSignatureVersion) o; + return Objects.equals(this.createdAt, datastoreSignatureVersion.createdAt) && + Objects.equals(this.encoding, datastoreSignatureVersion.encoding) && + Objects.equals(this.hash, datastoreSignatureVersion.hash) && + Objects.equals(this.uid, datastoreSignatureVersion.uid); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, encoding, hash, uid); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreSignatureVersion {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" encoding: ").append(toIndentedString(encoding)).append("\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `encoding` to the URL query string + if (getEncoding() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sencoding%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEncoding())))); + } + + // add `hash` to the URL query string + if (getHash() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shash%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHash())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreSource.java b/src/main/java/com/getconvoy/models/DatastoreSource.java new file mode 100644 index 0000000..0b865f8 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreSource.java @@ -0,0 +1,864 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreCustomResponse; +import com.getconvoy.models.DatastoreProviderConfig; +import com.getconvoy.models.DatastorePubSubConfig; +import com.getconvoy.models.DatastoreSourceProvider; +import com.getconvoy.models.DatastoreSourceType; +import com.getconvoy.models.DatastoreVerifierConfig; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreSource + */ +@JsonPropertyOrder({ + DatastoreSource.JSON_PROPERTY_BODY_FUNCTION, + DatastoreSource.JSON_PROPERTY_CREATED_AT, + DatastoreSource.JSON_PROPERTY_CUSTOM_RESPONSE, + DatastoreSource.JSON_PROPERTY_DELETED_AT, + DatastoreSource.JSON_PROPERTY_EVENT_TYPE_LOCATION, + DatastoreSource.JSON_PROPERTY_FORWARD_HEADERS, + DatastoreSource.JSON_PROPERTY_HEADER_FUNCTION, + DatastoreSource.JSON_PROPERTY_IDEMPOTENCY_KEYS, + DatastoreSource.JSON_PROPERTY_IS_DISABLED, + DatastoreSource.JSON_PROPERTY_MASK_ID, + DatastoreSource.JSON_PROPERTY_NAME, + DatastoreSource.JSON_PROPERTY_PROJECT_ID, + DatastoreSource.JSON_PROPERTY_PROVIDER, + DatastoreSource.JSON_PROPERTY_PROVIDER_CONFIG, + DatastoreSource.JSON_PROPERTY_PUB_SUB, + DatastoreSource.JSON_PROPERTY_TYPE, + DatastoreSource.JSON_PROPERTY_UID, + DatastoreSource.JSON_PROPERTY_UPDATED_AT, + DatastoreSource.JSON_PROPERTY_URL, + DatastoreSource.JSON_PROPERTY_VERIFIER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreSource { + public static final String JSON_PROPERTY_BODY_FUNCTION = "body_function"; + @jakarta.annotation.Nullable + private String bodyFunction; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_CUSTOM_RESPONSE = "custom_response"; + @jakarta.annotation.Nullable + private DatastoreCustomResponse customResponse; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + @jakarta.annotation.Nullable + private String deletedAt; + + public static final String JSON_PROPERTY_EVENT_TYPE_LOCATION = "event_type_location"; + @jakarta.annotation.Nullable + private String eventTypeLocation; + + public static final String JSON_PROPERTY_FORWARD_HEADERS = "forward_headers"; + @jakarta.annotation.Nullable + private List forwardHeaders = new ArrayList<>(); + + public static final String JSON_PROPERTY_HEADER_FUNCTION = "header_function"; + @jakarta.annotation.Nullable + private String headerFunction; + + public static final String JSON_PROPERTY_IDEMPOTENCY_KEYS = "idempotency_keys"; + @jakarta.annotation.Nullable + private List idempotencyKeys = new ArrayList<>(); + + public static final String JSON_PROPERTY_IS_DISABLED = "is_disabled"; + @jakarta.annotation.Nullable + private Boolean isDisabled; + + public static final String JSON_PROPERTY_MASK_ID = "mask_id"; + @jakarta.annotation.Nullable + private String maskId; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + @jakarta.annotation.Nullable + private String projectId; + + public static final String JSON_PROPERTY_PROVIDER = "provider"; + @jakarta.annotation.Nullable + private DatastoreSourceProvider provider; + + public static final String JSON_PROPERTY_PROVIDER_CONFIG = "provider_config"; + @jakarta.annotation.Nullable + private DatastoreProviderConfig providerConfig; + + public static final String JSON_PROPERTY_PUB_SUB = "pub_sub"; + @jakarta.annotation.Nullable + private DatastorePubSubConfig pubSub; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private DatastoreSourceType type; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + @jakarta.annotation.Nullable + private String updatedAt; + + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nullable + private String url; + + public static final String JSON_PROPERTY_VERIFIER = "verifier"; + @jakarta.annotation.Nullable + private DatastoreVerifierConfig verifier; + + public DatastoreSource() { + } + + public DatastoreSource bodyFunction(@jakarta.annotation.Nullable String bodyFunction) { + this.bodyFunction = bodyFunction; + return this; + } + + /** + * Get bodyFunction + * @return bodyFunction + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BODY_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBodyFunction() { + return bodyFunction; + } + + + @JsonProperty(value = JSON_PROPERTY_BODY_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBodyFunction(@jakarta.annotation.Nullable String bodyFunction) { + this.bodyFunction = bodyFunction; + } + + + public DatastoreSource createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public DatastoreSource customResponse(@jakarta.annotation.Nullable DatastoreCustomResponse customResponse) { + this.customResponse = customResponse; + return this; + } + + /** + * Get customResponse + * @return customResponse + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CUSTOM_RESPONSE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreCustomResponse getCustomResponse() { + return customResponse; + } + + + @JsonProperty(value = JSON_PROPERTY_CUSTOM_RESPONSE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomResponse(@jakarta.annotation.Nullable DatastoreCustomResponse customResponse) { + this.customResponse = customResponse; + } + + + public DatastoreSource deletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Get deletedAt + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + } + + + public DatastoreSource eventTypeLocation(@jakarta.annotation.Nullable String eventTypeLocation) { + this.eventTypeLocation = eventTypeLocation; + return this; + } + + /** + * Get eventTypeLocation + * @return eventTypeLocation + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE_LOCATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventTypeLocation() { + return eventTypeLocation; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE_LOCATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventTypeLocation(@jakarta.annotation.Nullable String eventTypeLocation) { + this.eventTypeLocation = eventTypeLocation; + } + + + public DatastoreSource forwardHeaders(@jakarta.annotation.Nullable List forwardHeaders) { + this.forwardHeaders = forwardHeaders; + return this; + } + + public DatastoreSource addForwardHeadersItem(String forwardHeadersItem) { + if (this.forwardHeaders == null) { + this.forwardHeaders = new ArrayList<>(); + } + this.forwardHeaders.add(forwardHeadersItem); + return this; + } + + /** + * Get forwardHeaders + * @return forwardHeaders + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FORWARD_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getForwardHeaders() { + return forwardHeaders; + } + + + @JsonProperty(value = JSON_PROPERTY_FORWARD_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForwardHeaders(@jakarta.annotation.Nullable List forwardHeaders) { + this.forwardHeaders = forwardHeaders; + } + + + public DatastoreSource headerFunction(@jakarta.annotation.Nullable String headerFunction) { + this.headerFunction = headerFunction; + return this; + } + + /** + * Get headerFunction + * @return headerFunction + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADER_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHeaderFunction() { + return headerFunction; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADER_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaderFunction(@jakarta.annotation.Nullable String headerFunction) { + this.headerFunction = headerFunction; + } + + + public DatastoreSource idempotencyKeys(@jakarta.annotation.Nullable List idempotencyKeys) { + this.idempotencyKeys = idempotencyKeys; + return this; + } + + public DatastoreSource addIdempotencyKeysItem(String idempotencyKeysItem) { + if (this.idempotencyKeys == null) { + this.idempotencyKeys = new ArrayList<>(); + } + this.idempotencyKeys.add(idempotencyKeysItem); + return this; + } + + /** + * Get idempotencyKeys + * @return idempotencyKeys + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEYS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIdempotencyKeys() { + return idempotencyKeys; + } + + + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEYS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdempotencyKeys(@jakarta.annotation.Nullable List idempotencyKeys) { + this.idempotencyKeys = idempotencyKeys; + } + + + public DatastoreSource isDisabled(@jakarta.annotation.Nullable Boolean isDisabled) { + this.isDisabled = isDisabled; + return this; + } + + /** + * Get isDisabled + * @return isDisabled + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IS_DISABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsDisabled() { + return isDisabled; + } + + + @JsonProperty(value = JSON_PROPERTY_IS_DISABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDisabled(@jakarta.annotation.Nullable Boolean isDisabled) { + this.isDisabled = isDisabled; + } + + + public DatastoreSource maskId(@jakarta.annotation.Nullable String maskId) { + this.maskId = maskId; + return this; + } + + /** + * Get maskId + * @return maskId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MASK_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMaskId() { + return maskId; + } + + + @JsonProperty(value = JSON_PROPERTY_MASK_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaskId(@jakarta.annotation.Nullable String maskId) { + this.maskId = maskId; + } + + + public DatastoreSource name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public DatastoreSource projectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Get projectId + * @return projectId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectId() { + return projectId; + } + + + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProjectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + } + + + public DatastoreSource provider(@jakarta.annotation.Nullable DatastoreSourceProvider provider) { + this.provider = provider; + return this; + } + + /** + * Get provider + * @return provider + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROVIDER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreSourceProvider getProvider() { + return provider; + } + + + @JsonProperty(value = JSON_PROPERTY_PROVIDER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProvider(@jakarta.annotation.Nullable DatastoreSourceProvider provider) { + this.provider = provider; + } + + + public DatastoreSource providerConfig(@jakarta.annotation.Nullable DatastoreProviderConfig providerConfig) { + this.providerConfig = providerConfig; + return this; + } + + /** + * Get providerConfig + * @return providerConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROVIDER_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreProviderConfig getProviderConfig() { + return providerConfig; + } + + + @JsonProperty(value = JSON_PROPERTY_PROVIDER_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderConfig(@jakarta.annotation.Nullable DatastoreProviderConfig providerConfig) { + this.providerConfig = providerConfig; + } + + + public DatastoreSource pubSub(@jakarta.annotation.Nullable DatastorePubSubConfig pubSub) { + this.pubSub = pubSub; + return this; + } + + /** + * Get pubSub + * @return pubSub + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PUB_SUB, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastorePubSubConfig getPubSub() { + return pubSub; + } + + + @JsonProperty(value = JSON_PROPERTY_PUB_SUB, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPubSub(@jakarta.annotation.Nullable DatastorePubSubConfig pubSub) { + this.pubSub = pubSub; + } + + + public DatastoreSource type(@jakarta.annotation.Nullable DatastoreSourceType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreSourceType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable DatastoreSourceType type) { + this.type = type; + } + + + public DatastoreSource uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + public DatastoreSource updatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + public DatastoreSource url(@jakarta.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = url; + } + + + public DatastoreSource verifier(@jakarta.annotation.Nullable DatastoreVerifierConfig verifier) { + this.verifier = verifier; + return this; + } + + /** + * Get verifier + * @return verifier + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_VERIFIER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreVerifierConfig getVerifier() { + return verifier; + } + + + @JsonProperty(value = JSON_PROPERTY_VERIFIER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVerifier(@jakarta.annotation.Nullable DatastoreVerifierConfig verifier) { + this.verifier = verifier; + } + + + /** + * Return true if this datastore.Source object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreSource datastoreSource = (DatastoreSource) o; + return Objects.equals(this.bodyFunction, datastoreSource.bodyFunction) && + Objects.equals(this.createdAt, datastoreSource.createdAt) && + Objects.equals(this.customResponse, datastoreSource.customResponse) && + Objects.equals(this.deletedAt, datastoreSource.deletedAt) && + Objects.equals(this.eventTypeLocation, datastoreSource.eventTypeLocation) && + Objects.equals(this.forwardHeaders, datastoreSource.forwardHeaders) && + Objects.equals(this.headerFunction, datastoreSource.headerFunction) && + Objects.equals(this.idempotencyKeys, datastoreSource.idempotencyKeys) && + Objects.equals(this.isDisabled, datastoreSource.isDisabled) && + Objects.equals(this.maskId, datastoreSource.maskId) && + Objects.equals(this.name, datastoreSource.name) && + Objects.equals(this.projectId, datastoreSource.projectId) && + Objects.equals(this.provider, datastoreSource.provider) && + Objects.equals(this.providerConfig, datastoreSource.providerConfig) && + Objects.equals(this.pubSub, datastoreSource.pubSub) && + Objects.equals(this.type, datastoreSource.type) && + Objects.equals(this.uid, datastoreSource.uid) && + Objects.equals(this.updatedAt, datastoreSource.updatedAt) && + Objects.equals(this.url, datastoreSource.url) && + Objects.equals(this.verifier, datastoreSource.verifier); + } + + @Override + public int hashCode() { + return Objects.hash(bodyFunction, createdAt, customResponse, deletedAt, eventTypeLocation, forwardHeaders, headerFunction, idempotencyKeys, isDisabled, maskId, name, projectId, provider, providerConfig, pubSub, type, uid, updatedAt, url, verifier); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreSource {\n"); + sb.append(" bodyFunction: ").append(toIndentedString(bodyFunction)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" customResponse: ").append(toIndentedString(customResponse)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" eventTypeLocation: ").append(toIndentedString(eventTypeLocation)).append("\n"); + sb.append(" forwardHeaders: ").append(toIndentedString(forwardHeaders)).append("\n"); + sb.append(" headerFunction: ").append(toIndentedString(headerFunction)).append("\n"); + sb.append(" idempotencyKeys: ").append(toIndentedString(idempotencyKeys)).append("\n"); + sb.append(" isDisabled: ").append(toIndentedString(isDisabled)).append("\n"); + sb.append(" maskId: ").append(toIndentedString(maskId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" providerConfig: ").append(toIndentedString(providerConfig)).append("\n"); + sb.append(" pubSub: ").append(toIndentedString(pubSub)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" verifier: ").append(toIndentedString(verifier)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `body_function` to the URL query string + if (getBodyFunction() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbody_function%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBodyFunction())))); + } + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `custom_response` to the URL query string + if (getCustomResponse() != null) { + joiner.add(getCustomResponse().toUrlQueryString(prefix + "custom_response" + suffix)); + } + + // add `deleted_at` to the URL query string + if (getDeletedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeleted_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeletedAt())))); + } + + // add `event_type_location` to the URL query string + if (getEventTypeLocation() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type_location%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventTypeLocation())))); + } + + // add `forward_headers` to the URL query string + if (getForwardHeaders() != null) { + for (int i = 0; i < getForwardHeaders().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sforward_headers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getForwardHeaders().get(i))))); + } + } + + // add `header_function` to the URL query string + if (getHeaderFunction() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheader_function%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHeaderFunction())))); + } + + // add `idempotency_keys` to the URL query string + if (getIdempotencyKeys() != null) { + for (int i = 0; i < getIdempotencyKeys().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sidempotency_keys%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getIdempotencyKeys().get(i))))); + } + } + + // add `is_disabled` to the URL query string + if (getIsDisabled() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sis_disabled%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIsDisabled())))); + } + + // add `mask_id` to the URL query string + if (getMaskId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smask_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMaskId())))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `project_id` to the URL query string + if (getProjectId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sproject_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProjectId())))); + } + + // add `provider` to the URL query string + if (getProvider() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sprovider%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProvider())))); + } + + // add `provider_config` to the URL query string + if (getProviderConfig() != null) { + joiner.add(getProviderConfig().toUrlQueryString(prefix + "provider_config" + suffix)); + } + + // add `pub_sub` to the URL query string + if (getPubSub() != null) { + joiner.add(getPubSub().toUrlQueryString(prefix + "pub_sub" + suffix)); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + // add `updated_at` to the URL query string + if (getUpdatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%supdated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpdatedAt())))); + } + + // add `url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + // add `verifier` to the URL query string + if (getVerifier() != null) { + joiner.add(getVerifier().toUrlQueryString(prefix + "verifier" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreSourceProvider.java b/src/main/java/com/getconvoy/models/DatastoreSourceProvider.java new file mode 100644 index 0000000..ec3d904 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreSourceProvider.java @@ -0,0 +1,80 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.SourceProvider + */ +public enum DatastoreSourceProvider { + + GithubSourceProvider("github"), + + TwitterSourceProvider("twitter"), + + ShopifySourceProvider("shopify"); + + private String value; + + DatastoreSourceProvider(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastoreSourceProvider fromValue(String value) { + for (DatastoreSourceProvider b : DatastoreSourceProvider.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreSourceType.java b/src/main/java/com/getconvoy/models/DatastoreSourceType.java new file mode 100644 index 0000000..141ab4a --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreSourceType.java @@ -0,0 +1,82 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.SourceType + */ +public enum DatastoreSourceType { + + HTTPSource("http"), + + RestApiSource("rest_api"), + + PubSubSource("pub_sub"), + + DBChangeStream("db_change_stream"); + + private String value; + + DatastoreSourceType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastoreSourceType fromValue(String value) { + for (DatastoreSourceType b : DatastoreSourceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreStrategyConfiguration.java b/src/main/java/com/getconvoy/models/DatastoreStrategyConfiguration.java new file mode 100644 index 0000000..0dcbfaa --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreStrategyConfiguration.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreStrategyProvider; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreStrategyConfiguration + */ +@JsonPropertyOrder({ + DatastoreStrategyConfiguration.JSON_PROPERTY_DURATION, + DatastoreStrategyConfiguration.JSON_PROPERTY_RETRY_COUNT, + DatastoreStrategyConfiguration.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreStrategyConfiguration { + public static final String JSON_PROPERTY_DURATION = "duration"; + @jakarta.annotation.Nullable + private Integer duration; + + public static final String JSON_PROPERTY_RETRY_COUNT = "retry_count"; + @jakarta.annotation.Nullable + private Integer retryCount; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private DatastoreStrategyProvider type; + + public DatastoreStrategyConfiguration() { + } + + public DatastoreStrategyConfiguration duration(@jakarta.annotation.Nullable Integer duration) { + this.duration = duration; + return this; + } + + /** + * Get duration + * @return duration + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDuration() { + return duration; + } + + + @JsonProperty(value = JSON_PROPERTY_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDuration(@jakarta.annotation.Nullable Integer duration) { + this.duration = duration; + } + + + public DatastoreStrategyConfiguration retryCount(@jakarta.annotation.Nullable Integer retryCount) { + this.retryCount = retryCount; + return this; + } + + /** + * Get retryCount + * @return retryCount + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RETRY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRetryCount() { + return retryCount; + } + + + @JsonProperty(value = JSON_PROPERTY_RETRY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRetryCount(@jakarta.annotation.Nullable Integer retryCount) { + this.retryCount = retryCount; + } + + + public DatastoreStrategyConfiguration type(@jakarta.annotation.Nullable DatastoreStrategyProvider type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreStrategyProvider getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable DatastoreStrategyProvider type) { + this.type = type; + } + + + /** + * Return true if this datastore.StrategyConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreStrategyConfiguration datastoreStrategyConfiguration = (DatastoreStrategyConfiguration) o; + return Objects.equals(this.duration, datastoreStrategyConfiguration.duration) && + Objects.equals(this.retryCount, datastoreStrategyConfiguration.retryCount) && + Objects.equals(this.type, datastoreStrategyConfiguration.type); + } + + @Override + public int hashCode() { + return Objects.hash(duration, retryCount, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreStrategyConfiguration {\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" retryCount: ").append(toIndentedString(retryCount)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `duration` to the URL query string + if (getDuration() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sduration%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDuration())))); + } + + // add `retry_count` to the URL query string + if (getRetryCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sretry_count%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRetryCount())))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreStrategyProvider.java b/src/main/java/com/getconvoy/models/DatastoreStrategyProvider.java new file mode 100644 index 0000000..31c8fc0 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreStrategyProvider.java @@ -0,0 +1,78 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.StrategyProvider + */ +public enum DatastoreStrategyProvider { + + LinearStrategyProvider("linear"), + + ExponentialStrategyProvider("exponential"); + + private String value; + + DatastoreStrategyProvider(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastoreStrategyProvider fromValue(String value) { + for (DatastoreStrategyProvider b : DatastoreStrategyProvider.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreSubscriptionType.java b/src/main/java/com/getconvoy/models/DatastoreSubscriptionType.java new file mode 100644 index 0000000..3213f18 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreSubscriptionType.java @@ -0,0 +1,78 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.SubscriptionType + */ +public enum DatastoreSubscriptionType { + + SubscriptionTypeCLI("cli"), + + SubscriptionTypeAPI("api"); + + private String value; + + DatastoreSubscriptionType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastoreSubscriptionType fromValue(String value) { + for (DatastoreSubscriptionType b : DatastoreSubscriptionType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreTwitterProviderConfig.java b/src/main/java/com/getconvoy/models/DatastoreTwitterProviderConfig.java new file mode 100644 index 0000000..9cae824 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreTwitterProviderConfig.java @@ -0,0 +1,148 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreTwitterProviderConfig + */ +@JsonPropertyOrder({ + DatastoreTwitterProviderConfig.JSON_PROPERTY_CRC_VERIFIED_AT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreTwitterProviderConfig { + public static final String JSON_PROPERTY_CRC_VERIFIED_AT = "crc_verified_at"; + @jakarta.annotation.Nullable + private String crcVerifiedAt; + + public DatastoreTwitterProviderConfig() { + } + + public DatastoreTwitterProviderConfig crcVerifiedAt(@jakarta.annotation.Nullable String crcVerifiedAt) { + this.crcVerifiedAt = crcVerifiedAt; + return this; + } + + /** + * Get crcVerifiedAt + * @return crcVerifiedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CRC_VERIFIED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCrcVerifiedAt() { + return crcVerifiedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CRC_VERIFIED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCrcVerifiedAt(@jakarta.annotation.Nullable String crcVerifiedAt) { + this.crcVerifiedAt = crcVerifiedAt; + } + + + /** + * Return true if this datastore.TwitterProviderConfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreTwitterProviderConfig datastoreTwitterProviderConfig = (DatastoreTwitterProviderConfig) o; + return Objects.equals(this.crcVerifiedAt, datastoreTwitterProviderConfig.crcVerifiedAt); + } + + @Override + public int hashCode() { + return Objects.hash(crcVerifiedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreTwitterProviderConfig {\n"); + sb.append(" crcVerifiedAt: ").append(toIndentedString(crcVerifiedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `crc_verified_at` to the URL query string + if (getCrcVerifiedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scrc_verified_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCrcVerifiedAt())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreUpdatePortalLinkRequest.java b/src/main/java/com/getconvoy/models/DatastoreUpdatePortalLinkRequest.java new file mode 100644 index 0000000..5a87012 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreUpdatePortalLinkRequest.java @@ -0,0 +1,306 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreUpdatePortalLinkRequest + */ +@JsonPropertyOrder({ + DatastoreUpdatePortalLinkRequest.JSON_PROPERTY_AUTH_TYPE, + DatastoreUpdatePortalLinkRequest.JSON_PROPERTY_CAN_MANAGE_ENDPOINT, + DatastoreUpdatePortalLinkRequest.JSON_PROPERTY_ENDPOINTS, + DatastoreUpdatePortalLinkRequest.JSON_PROPERTY_NAME, + DatastoreUpdatePortalLinkRequest.JSON_PROPERTY_OWNER_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreUpdatePortalLinkRequest { + public static final String JSON_PROPERTY_AUTH_TYPE = "auth_type"; + @jakarta.annotation.Nullable + private String authType; + + public static final String JSON_PROPERTY_CAN_MANAGE_ENDPOINT = "can_manage_endpoint"; + @jakarta.annotation.Nullable + private Boolean canManageEndpoint; + + public static final String JSON_PROPERTY_ENDPOINTS = "endpoints"; + @jakarta.annotation.Nullable + private List endpoints = new ArrayList<>(); + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_OWNER_ID = "owner_id"; + @jakarta.annotation.Nullable + private String ownerId; + + public DatastoreUpdatePortalLinkRequest() { + } + + public DatastoreUpdatePortalLinkRequest authType(@jakarta.annotation.Nullable String authType) { + this.authType = authType; + return this; + } + + /** + * Get authType + * @return authType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUTH_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthType() { + return authType; + } + + + @JsonProperty(value = JSON_PROPERTY_AUTH_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthType(@jakarta.annotation.Nullable String authType) { + this.authType = authType; + } + + + public DatastoreUpdatePortalLinkRequest canManageEndpoint(@jakarta.annotation.Nullable Boolean canManageEndpoint) { + this.canManageEndpoint = canManageEndpoint; + return this; + } + + /** + * Specify whether endpoint management can be done through the Portal Link UI + * @return canManageEndpoint + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CAN_MANAGE_ENDPOINT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanManageEndpoint() { + return canManageEndpoint; + } + + + @JsonProperty(value = JSON_PROPERTY_CAN_MANAGE_ENDPOINT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanManageEndpoint(@jakarta.annotation.Nullable Boolean canManageEndpoint) { + this.canManageEndpoint = canManageEndpoint; + } + + + public DatastoreUpdatePortalLinkRequest endpoints(@jakarta.annotation.Nullable List endpoints) { + this.endpoints = endpoints; + return this; + } + + public DatastoreUpdatePortalLinkRequest addEndpointsItem(String endpointsItem) { + if (this.endpoints == null) { + this.endpoints = new ArrayList<>(); + } + this.endpoints.add(endpointsItem); + return this; + } + + /** + * Deprecated IDs of endpoints in this portal link + * @return endpoints + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEndpoints() { + return endpoints; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpoints(@jakarta.annotation.Nullable List endpoints) { + this.endpoints = endpoints; + } + + + public DatastoreUpdatePortalLinkRequest name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Portal Link Name + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public DatastoreUpdatePortalLinkRequest ownerId(@jakarta.annotation.Nullable String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * OwnerID, the portal link will inherit all the endpoints with this owner ID + * @return ownerId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OWNER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOwnerId() { + return ownerId; + } + + + @JsonProperty(value = JSON_PROPERTY_OWNER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOwnerId(@jakarta.annotation.Nullable String ownerId) { + this.ownerId = ownerId; + } + + + /** + * Return true if this datastore.UpdatePortalLinkRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreUpdatePortalLinkRequest datastoreUpdatePortalLinkRequest = (DatastoreUpdatePortalLinkRequest) o; + return Objects.equals(this.authType, datastoreUpdatePortalLinkRequest.authType) && + Objects.equals(this.canManageEndpoint, datastoreUpdatePortalLinkRequest.canManageEndpoint) && + Objects.equals(this.endpoints, datastoreUpdatePortalLinkRequest.endpoints) && + Objects.equals(this.name, datastoreUpdatePortalLinkRequest.name) && + Objects.equals(this.ownerId, datastoreUpdatePortalLinkRequest.ownerId); + } + + @Override + public int hashCode() { + return Objects.hash(authType, canManageEndpoint, endpoints, name, ownerId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreUpdatePortalLinkRequest {\n"); + sb.append(" authType: ").append(toIndentedString(authType)).append("\n"); + sb.append(" canManageEndpoint: ").append(toIndentedString(canManageEndpoint)).append("\n"); + sb.append(" endpoints: ").append(toIndentedString(endpoints)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `auth_type` to the URL query string + if (getAuthType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sauth_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAuthType())))); + } + + // add `can_manage_endpoint` to the URL query string + if (getCanManageEndpoint() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scan_manage_endpoint%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCanManageEndpoint())))); + } + + // add `endpoints` to the URL query string + if (getEndpoints() != null) { + for (int i = 0; i < getEndpoints().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sendpoints%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEndpoints().get(i))))); + } + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `owner_id` to the URL query string + if (getOwnerId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sowner_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOwnerId())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreVerifierConfig.java b/src/main/java/com/getconvoy/models/DatastoreVerifierConfig.java new file mode 100644 index 0000000..d36c50a --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreVerifierConfig.java @@ -0,0 +1,260 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreApiKey; +import com.getconvoy.models.DatastoreBasicAuth; +import com.getconvoy.models.DatastoreHMac; +import com.getconvoy.models.DatastoreVerifierType; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * DatastoreVerifierConfig + */ +@JsonPropertyOrder({ + DatastoreVerifierConfig.JSON_PROPERTY_API_KEY, + DatastoreVerifierConfig.JSON_PROPERTY_BASIC_AUTH, + DatastoreVerifierConfig.JSON_PROPERTY_HMAC, + DatastoreVerifierConfig.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class DatastoreVerifierConfig { + public static final String JSON_PROPERTY_API_KEY = "api_key"; + @jakarta.annotation.Nullable + private DatastoreApiKey apiKey; + + public static final String JSON_PROPERTY_BASIC_AUTH = "basic_auth"; + @jakarta.annotation.Nullable + private DatastoreBasicAuth basicAuth; + + public static final String JSON_PROPERTY_HMAC = "hmac"; + @jakarta.annotation.Nullable + private DatastoreHMac hmac; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private DatastoreVerifierType type; + + public DatastoreVerifierConfig() { + } + + public DatastoreVerifierConfig apiKey(@jakarta.annotation.Nullable DatastoreApiKey apiKey) { + this.apiKey = apiKey; + return this; + } + + /** + * Get apiKey + * @return apiKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_API_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreApiKey getApiKey() { + return apiKey; + } + + + @JsonProperty(value = JSON_PROPERTY_API_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiKey(@jakarta.annotation.Nullable DatastoreApiKey apiKey) { + this.apiKey = apiKey; + } + + + public DatastoreVerifierConfig basicAuth(@jakarta.annotation.Nullable DatastoreBasicAuth basicAuth) { + this.basicAuth = basicAuth; + return this; + } + + /** + * Get basicAuth + * @return basicAuth + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BASIC_AUTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreBasicAuth getBasicAuth() { + return basicAuth; + } + + + @JsonProperty(value = JSON_PROPERTY_BASIC_AUTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBasicAuth(@jakarta.annotation.Nullable DatastoreBasicAuth basicAuth) { + this.basicAuth = basicAuth; + } + + + public DatastoreVerifierConfig hmac(@jakarta.annotation.Nullable DatastoreHMac hmac) { + this.hmac = hmac; + return this; + } + + /** + * Get hmac + * @return hmac + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HMAC, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreHMac getHmac() { + return hmac; + } + + + @JsonProperty(value = JSON_PROPERTY_HMAC, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHmac(@jakarta.annotation.Nullable DatastoreHMac hmac) { + this.hmac = hmac; + } + + + public DatastoreVerifierConfig type(@jakarta.annotation.Nullable DatastoreVerifierType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreVerifierType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable DatastoreVerifierType type) { + this.type = type; + } + + + /** + * Return true if this datastore.VerifierConfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreVerifierConfig datastoreVerifierConfig = (DatastoreVerifierConfig) o; + return Objects.equals(this.apiKey, datastoreVerifierConfig.apiKey) && + Objects.equals(this.basicAuth, datastoreVerifierConfig.basicAuth) && + Objects.equals(this.hmac, datastoreVerifierConfig.hmac) && + Objects.equals(this.type, datastoreVerifierConfig.type); + } + + @Override + public int hashCode() { + return Objects.hash(apiKey, basicAuth, hmac, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreVerifierConfig {\n"); + sb.append(" apiKey: ").append(toIndentedString(apiKey)).append("\n"); + sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n"); + sb.append(" hmac: ").append(toIndentedString(hmac)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `api_key` to the URL query string + if (getApiKey() != null) { + joiner.add(getApiKey().toUrlQueryString(prefix + "api_key" + suffix)); + } + + // add `basic_auth` to the URL query string + if (getBasicAuth() != null) { + joiner.add(getBasicAuth().toUrlQueryString(prefix + "basic_auth" + suffix)); + } + + // add `hmac` to the URL query string + if (getHmac() != null) { + joiner.add(getHmac().toUrlQueryString(prefix + "hmac" + suffix)); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/DatastoreVerifierType.java b/src/main/java/com/getconvoy/models/DatastoreVerifierType.java new file mode 100644 index 0000000..fc4ce11 --- /dev/null +++ b/src/main/java/com/getconvoy/models/DatastoreVerifierType.java @@ -0,0 +1,82 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets datastore.VerifierType + */ +public enum DatastoreVerifierType { + + NoopVerifier("noop"), + + HMacVerifier("hmac"), + + BasicAuthVerifier("basic_auth"), + + APIKeyVerifier("api_key"); + + private String value; + + DatastoreVerifierType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DatastoreVerifierType fromValue(String value) { + for (DatastoreVerifierType b : DatastoreVerifierType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/src/main/java/com/getconvoy/models/GetDeliveryAttempt200Response.java b/src/main/java/com/getconvoy/models/GetDeliveryAttempt200Response.java new file mode 100644 index 0000000..3b44ba8 --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetDeliveryAttempt200Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreDeliveryAttempt; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetDeliveryAttempt200Response + */ +@JsonPropertyOrder({ + GetDeliveryAttempt200Response.JSON_PROPERTY_MESSAGE, + GetDeliveryAttempt200Response.JSON_PROPERTY_STATUS, + GetDeliveryAttempt200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetDeliveryAttempt200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private DatastoreDeliveryAttempt data; + + public GetDeliveryAttempt200Response() { + } + + public GetDeliveryAttempt200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public GetDeliveryAttempt200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public GetDeliveryAttempt200Response data(@jakarta.annotation.Nullable DatastoreDeliveryAttempt data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreDeliveryAttempt getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable DatastoreDeliveryAttempt data) { + this.data = data; + } + + + /** + * Return true if this GetDeliveryAttempt_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDeliveryAttempt200Response getDeliveryAttempt200Response = (GetDeliveryAttempt200Response) o; + return Objects.equals(this.message, getDeliveryAttempt200Response.message) && + Objects.equals(this.status, getDeliveryAttempt200Response.status) && + Objects.equals(this.data, getDeliveryAttempt200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDeliveryAttempt200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetDeliveryAttempts200Response.java b/src/main/java/com/getconvoy/models/GetDeliveryAttempts200Response.java new file mode 100644 index 0000000..a100a92 --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetDeliveryAttempts200Response.java @@ -0,0 +1,236 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreDeliveryAttempt; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetDeliveryAttempts200Response + */ +@JsonPropertyOrder({ + GetDeliveryAttempts200Response.JSON_PROPERTY_MESSAGE, + GetDeliveryAttempts200Response.JSON_PROPERTY_STATUS, + GetDeliveryAttempts200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetDeliveryAttempts200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private List data = new ArrayList<>(); + + public GetDeliveryAttempts200Response() { + } + + public GetDeliveryAttempts200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public GetDeliveryAttempts200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public GetDeliveryAttempts200Response data(@jakarta.annotation.Nullable List data) { + this.data = data; + return this; + } + + public GetDeliveryAttempts200Response addDataItem(DatastoreDeliveryAttempt dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable List data) { + this.data = data; + } + + + /** + * Return true if this GetDeliveryAttempts_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDeliveryAttempts200Response getDeliveryAttempts200Response = (GetDeliveryAttempts200Response) o; + return Objects.equals(this.message, getDeliveryAttempts200Response.message) && + Objects.equals(this.status, getDeliveryAttempts200Response.status) && + Objects.equals(this.data, getDeliveryAttempts200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDeliveryAttempts200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + for (int i = 0; i < getData().size(); i++) { + if (getData().get(i) != null) { + joiner.add(getData().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sdata%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetEndpoints200Response.java b/src/main/java/com/getconvoy/models/GetEndpoints200Response.java new file mode 100644 index 0000000..3735d43 --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetEndpoints200Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.GetEndpoints200ResponseAllOfData; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetEndpoints200Response + */ +@JsonPropertyOrder({ + GetEndpoints200Response.JSON_PROPERTY_MESSAGE, + GetEndpoints200Response.JSON_PROPERTY_STATUS, + GetEndpoints200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetEndpoints200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private GetEndpoints200ResponseAllOfData data; + + public GetEndpoints200Response() { + } + + public GetEndpoints200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public GetEndpoints200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public GetEndpoints200Response data(@jakarta.annotation.Nullable GetEndpoints200ResponseAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GetEndpoints200ResponseAllOfData getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable GetEndpoints200ResponseAllOfData data) { + this.data = data; + } + + + /** + * Return true if this GetEndpoints_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEndpoints200Response getEndpoints200Response = (GetEndpoints200Response) o; + return Objects.equals(this.message, getEndpoints200Response.message) && + Objects.equals(this.status, getEndpoints200Response.status) && + Objects.equals(this.data, getEndpoints200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEndpoints200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetEndpoints200ResponseAllOfData.java b/src/main/java/com/getconvoy/models/GetEndpoints200ResponseAllOfData.java new file mode 100644 index 0000000..ea838b1 --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetEndpoints200ResponseAllOfData.java @@ -0,0 +1,223 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastorePaginationData; +import com.getconvoy.models.ModelsEndpointResponse; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetEndpoints200ResponseAllOfData + */ +@JsonPropertyOrder({ + GetEndpoints200ResponseAllOfData.JSON_PROPERTY_CONTENT, + GetEndpoints200ResponseAllOfData.JSON_PROPERTY_PAGINATION +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetEndpoints200ResponseAllOfData { + public static final String JSON_PROPERTY_CONTENT = "content"; + @jakarta.annotation.Nullable + private List content = new ArrayList<>(); + + public static final String JSON_PROPERTY_PAGINATION = "pagination"; + private JsonNullable pagination = JsonNullable.undefined(); + + public GetEndpoints200ResponseAllOfData() { + } + + public GetEndpoints200ResponseAllOfData content(@jakarta.annotation.Nullable List content) { + this.content = content; + return this; + } + + public GetEndpoints200ResponseAllOfData addContentItem(ModelsEndpointResponse contentItem) { + if (this.content == null) { + this.content = new ArrayList<>(); + } + this.content.add(contentItem); + return this; + } + + /** + * Get content + * @return content + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getContent() { + return content; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContent(@jakarta.annotation.Nullable List content) { + this.content = content; + } + + + public GetEndpoints200ResponseAllOfData pagination(@jakarta.annotation.Nullable DatastorePaginationData pagination) { + this.pagination = JsonNullable.of(pagination); + return this; + } + + /** + * Get pagination + * @return pagination + */ + @jakarta.annotation.Nullable + @JsonIgnore + public DatastorePaginationData getPagination() { + return pagination.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_PAGINATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getPagination_JsonNullable() { + return pagination; + } + + @JsonProperty(JSON_PROPERTY_PAGINATION) + public void setPagination_JsonNullable(JsonNullable pagination) { + this.pagination = pagination; + } + + public void setPagination(@jakarta.annotation.Nullable DatastorePaginationData pagination) { + this.pagination = JsonNullable.of(pagination); + } + + + /** + * Return true if this GetEndpoints_200_response_allOf_data object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEndpoints200ResponseAllOfData getEndpoints200ResponseAllOfData = (GetEndpoints200ResponseAllOfData) o; + return Objects.equals(this.content, getEndpoints200ResponseAllOfData.content) && + equalsNullable(this.pagination, getEndpoints200ResponseAllOfData.pagination); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(content, hashCodeNullable(pagination)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEndpoints200ResponseAllOfData {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `content` to the URL query string + if (getContent() != null) { + for (int i = 0; i < getContent().size(); i++) { + if (getContent().get(i) != null) { + joiner.add(getContent().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%scontent%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `pagination` to the URL query string + if (getPagination() != null) { + joiner.add(getPagination().toUrlQueryString(prefix + "pagination" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetEventDeliveriesPaged200Response.java b/src/main/java/com/getconvoy/models/GetEventDeliveriesPaged200Response.java new file mode 100644 index 0000000..b44d568 --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetEventDeliveriesPaged200Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.GetEventDeliveriesPaged200ResponseAllOfData; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetEventDeliveriesPaged200Response + */ +@JsonPropertyOrder({ + GetEventDeliveriesPaged200Response.JSON_PROPERTY_MESSAGE, + GetEventDeliveriesPaged200Response.JSON_PROPERTY_STATUS, + GetEventDeliveriesPaged200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetEventDeliveriesPaged200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private GetEventDeliveriesPaged200ResponseAllOfData data; + + public GetEventDeliveriesPaged200Response() { + } + + public GetEventDeliveriesPaged200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public GetEventDeliveriesPaged200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public GetEventDeliveriesPaged200Response data(@jakarta.annotation.Nullable GetEventDeliveriesPaged200ResponseAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GetEventDeliveriesPaged200ResponseAllOfData getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable GetEventDeliveriesPaged200ResponseAllOfData data) { + this.data = data; + } + + + /** + * Return true if this GetEventDeliveriesPaged_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEventDeliveriesPaged200Response getEventDeliveriesPaged200Response = (GetEventDeliveriesPaged200Response) o; + return Objects.equals(this.message, getEventDeliveriesPaged200Response.message) && + Objects.equals(this.status, getEventDeliveriesPaged200Response.status) && + Objects.equals(this.data, getEventDeliveriesPaged200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEventDeliveriesPaged200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetEventDeliveriesPaged200ResponseAllOfData.java b/src/main/java/com/getconvoy/models/GetEventDeliveriesPaged200ResponseAllOfData.java new file mode 100644 index 0000000..3c9846a --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetEventDeliveriesPaged200ResponseAllOfData.java @@ -0,0 +1,223 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastorePaginationData; +import com.getconvoy.models.ModelsEventDeliveryResponse; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetEventDeliveriesPaged200ResponseAllOfData + */ +@JsonPropertyOrder({ + GetEventDeliveriesPaged200ResponseAllOfData.JSON_PROPERTY_CONTENT, + GetEventDeliveriesPaged200ResponseAllOfData.JSON_PROPERTY_PAGINATION +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetEventDeliveriesPaged200ResponseAllOfData { + public static final String JSON_PROPERTY_CONTENT = "content"; + @jakarta.annotation.Nullable + private List content = new ArrayList<>(); + + public static final String JSON_PROPERTY_PAGINATION = "pagination"; + private JsonNullable pagination = JsonNullable.undefined(); + + public GetEventDeliveriesPaged200ResponseAllOfData() { + } + + public GetEventDeliveriesPaged200ResponseAllOfData content(@jakarta.annotation.Nullable List content) { + this.content = content; + return this; + } + + public GetEventDeliveriesPaged200ResponseAllOfData addContentItem(ModelsEventDeliveryResponse contentItem) { + if (this.content == null) { + this.content = new ArrayList<>(); + } + this.content.add(contentItem); + return this; + } + + /** + * Get content + * @return content + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getContent() { + return content; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContent(@jakarta.annotation.Nullable List content) { + this.content = content; + } + + + public GetEventDeliveriesPaged200ResponseAllOfData pagination(@jakarta.annotation.Nullable DatastorePaginationData pagination) { + this.pagination = JsonNullable.of(pagination); + return this; + } + + /** + * Get pagination + * @return pagination + */ + @jakarta.annotation.Nullable + @JsonIgnore + public DatastorePaginationData getPagination() { + return pagination.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_PAGINATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getPagination_JsonNullable() { + return pagination; + } + + @JsonProperty(JSON_PROPERTY_PAGINATION) + public void setPagination_JsonNullable(JsonNullable pagination) { + this.pagination = pagination; + } + + public void setPagination(@jakarta.annotation.Nullable DatastorePaginationData pagination) { + this.pagination = JsonNullable.of(pagination); + } + + + /** + * Return true if this GetEventDeliveriesPaged_200_response_allOf_data object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEventDeliveriesPaged200ResponseAllOfData getEventDeliveriesPaged200ResponseAllOfData = (GetEventDeliveriesPaged200ResponseAllOfData) o; + return Objects.equals(this.content, getEventDeliveriesPaged200ResponseAllOfData.content) && + equalsNullable(this.pagination, getEventDeliveriesPaged200ResponseAllOfData.pagination); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(content, hashCodeNullable(pagination)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEventDeliveriesPaged200ResponseAllOfData {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `content` to the URL query string + if (getContent() != null) { + for (int i = 0; i < getContent().size(); i++) { + if (getContent().get(i) != null) { + joiner.add(getContent().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%scontent%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `pagination` to the URL query string + if (getPagination() != null) { + joiner.add(getPagination().toUrlQueryString(prefix + "pagination" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetEventDelivery200Response.java b/src/main/java/com/getconvoy/models/GetEventDelivery200Response.java new file mode 100644 index 0000000..b9bd034 --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetEventDelivery200Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsEventDeliveryResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetEventDelivery200Response + */ +@JsonPropertyOrder({ + GetEventDelivery200Response.JSON_PROPERTY_MESSAGE, + GetEventDelivery200Response.JSON_PROPERTY_STATUS, + GetEventDelivery200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetEventDelivery200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private ModelsEventDeliveryResponse data; + + public GetEventDelivery200Response() { + } + + public GetEventDelivery200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public GetEventDelivery200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public GetEventDelivery200Response data(@jakarta.annotation.Nullable ModelsEventDeliveryResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsEventDeliveryResponse getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable ModelsEventDeliveryResponse data) { + this.data = data; + } + + + /** + * Return true if this GetEventDelivery_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEventDelivery200Response getEventDelivery200Response = (GetEventDelivery200Response) o; + return Objects.equals(this.message, getEventDelivery200Response.message) && + Objects.equals(this.status, getEventDelivery200Response.status) && + Objects.equals(this.data, getEventDelivery200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEventDelivery200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetEventTypes200Response.java b/src/main/java/com/getconvoy/models/GetEventTypes200Response.java new file mode 100644 index 0000000..32fcae9 --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetEventTypes200Response.java @@ -0,0 +1,236 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsEventTypeResponse; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetEventTypes200Response + */ +@JsonPropertyOrder({ + GetEventTypes200Response.JSON_PROPERTY_MESSAGE, + GetEventTypes200Response.JSON_PROPERTY_STATUS, + GetEventTypes200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetEventTypes200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private List data = new ArrayList<>(); + + public GetEventTypes200Response() { + } + + public GetEventTypes200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public GetEventTypes200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public GetEventTypes200Response data(@jakarta.annotation.Nullable List data) { + this.data = data; + return this; + } + + public GetEventTypes200Response addDataItem(ModelsEventTypeResponse dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable List data) { + this.data = data; + } + + + /** + * Return true if this GetEventTypes_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEventTypes200Response getEventTypes200Response = (GetEventTypes200Response) o; + return Objects.equals(this.message, getEventTypes200Response.message) && + Objects.equals(this.status, getEventTypes200Response.status) && + Objects.equals(this.data, getEventTypes200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEventTypes200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + for (int i = 0; i < getData().size(); i++) { + if (getData().get(i) != null) { + joiner.add(getData().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sdata%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetEventsPaged200Response.java b/src/main/java/com/getconvoy/models/GetEventsPaged200Response.java new file mode 100644 index 0000000..fef7528 --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetEventsPaged200Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.GetEventsPaged200ResponseAllOfData; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetEventsPaged200Response + */ +@JsonPropertyOrder({ + GetEventsPaged200Response.JSON_PROPERTY_MESSAGE, + GetEventsPaged200Response.JSON_PROPERTY_STATUS, + GetEventsPaged200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetEventsPaged200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private GetEventsPaged200ResponseAllOfData data; + + public GetEventsPaged200Response() { + } + + public GetEventsPaged200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public GetEventsPaged200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public GetEventsPaged200Response data(@jakarta.annotation.Nullable GetEventsPaged200ResponseAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GetEventsPaged200ResponseAllOfData getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable GetEventsPaged200ResponseAllOfData data) { + this.data = data; + } + + + /** + * Return true if this GetEventsPaged_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEventsPaged200Response getEventsPaged200Response = (GetEventsPaged200Response) o; + return Objects.equals(this.message, getEventsPaged200Response.message) && + Objects.equals(this.status, getEventsPaged200Response.status) && + Objects.equals(this.data, getEventsPaged200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEventsPaged200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetEventsPaged200ResponseAllOfData.java b/src/main/java/com/getconvoy/models/GetEventsPaged200ResponseAllOfData.java new file mode 100644 index 0000000..c715f10 --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetEventsPaged200ResponseAllOfData.java @@ -0,0 +1,223 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastorePaginationData; +import com.getconvoy.models.ModelsEventResponse; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetEventsPaged200ResponseAllOfData + */ +@JsonPropertyOrder({ + GetEventsPaged200ResponseAllOfData.JSON_PROPERTY_CONTENT, + GetEventsPaged200ResponseAllOfData.JSON_PROPERTY_PAGINATION +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetEventsPaged200ResponseAllOfData { + public static final String JSON_PROPERTY_CONTENT = "content"; + @jakarta.annotation.Nullable + private List content = new ArrayList<>(); + + public static final String JSON_PROPERTY_PAGINATION = "pagination"; + private JsonNullable pagination = JsonNullable.undefined(); + + public GetEventsPaged200ResponseAllOfData() { + } + + public GetEventsPaged200ResponseAllOfData content(@jakarta.annotation.Nullable List content) { + this.content = content; + return this; + } + + public GetEventsPaged200ResponseAllOfData addContentItem(ModelsEventResponse contentItem) { + if (this.content == null) { + this.content = new ArrayList<>(); + } + this.content.add(contentItem); + return this; + } + + /** + * Get content + * @return content + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getContent() { + return content; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContent(@jakarta.annotation.Nullable List content) { + this.content = content; + } + + + public GetEventsPaged200ResponseAllOfData pagination(@jakarta.annotation.Nullable DatastorePaginationData pagination) { + this.pagination = JsonNullable.of(pagination); + return this; + } + + /** + * Get pagination + * @return pagination + */ + @jakarta.annotation.Nullable + @JsonIgnore + public DatastorePaginationData getPagination() { + return pagination.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_PAGINATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getPagination_JsonNullable() { + return pagination; + } + + @JsonProperty(JSON_PROPERTY_PAGINATION) + public void setPagination_JsonNullable(JsonNullable pagination) { + this.pagination = pagination; + } + + public void setPagination(@jakarta.annotation.Nullable DatastorePaginationData pagination) { + this.pagination = JsonNullable.of(pagination); + } + + + /** + * Return true if this GetEventsPaged_200_response_allOf_data object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEventsPaged200ResponseAllOfData getEventsPaged200ResponseAllOfData = (GetEventsPaged200ResponseAllOfData) o; + return Objects.equals(this.content, getEventsPaged200ResponseAllOfData.content) && + equalsNullable(this.pagination, getEventsPaged200ResponseAllOfData.pagination); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(content, hashCodeNullable(pagination)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEventsPaged200ResponseAllOfData {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `content` to the URL query string + if (getContent() != null) { + for (int i = 0; i < getContent().size(); i++) { + if (getContent().get(i) != null) { + joiner.add(getContent().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%scontent%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `pagination` to the URL query string + if (getPagination() != null) { + joiner.add(getPagination().toUrlQueryString(prefix + "pagination" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetFilters200Response.java b/src/main/java/com/getconvoy/models/GetFilters200Response.java new file mode 100644 index 0000000..91d89f2 --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetFilters200Response.java @@ -0,0 +1,236 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsFilterResponse; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetFilters200Response + */ +@JsonPropertyOrder({ + GetFilters200Response.JSON_PROPERTY_MESSAGE, + GetFilters200Response.JSON_PROPERTY_STATUS, + GetFilters200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetFilters200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private List data = new ArrayList<>(); + + public GetFilters200Response() { + } + + public GetFilters200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public GetFilters200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public GetFilters200Response data(@jakarta.annotation.Nullable List data) { + this.data = data; + return this; + } + + public GetFilters200Response addDataItem(ModelsFilterResponse dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable List data) { + this.data = data; + } + + + /** + * Return true if this GetFilters_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFilters200Response getFilters200Response = (GetFilters200Response) o; + return Objects.equals(this.message, getFilters200Response.message) && + Objects.equals(this.status, getFilters200Response.status) && + Objects.equals(this.data, getFilters200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetFilters200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + for (int i = 0; i < getData().size(); i++) { + if (getData().get(i) != null) { + joiner.add(getData().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sdata%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetMetaEvent200Response.java b/src/main/java/com/getconvoy/models/GetMetaEvent200Response.java new file mode 100644 index 0000000..fca6ff9 --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetMetaEvent200Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsMetaEventResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetMetaEvent200Response + */ +@JsonPropertyOrder({ + GetMetaEvent200Response.JSON_PROPERTY_MESSAGE, + GetMetaEvent200Response.JSON_PROPERTY_STATUS, + GetMetaEvent200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetMetaEvent200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private ModelsMetaEventResponse data; + + public GetMetaEvent200Response() { + } + + public GetMetaEvent200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public GetMetaEvent200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public GetMetaEvent200Response data(@jakarta.annotation.Nullable ModelsMetaEventResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsMetaEventResponse getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable ModelsMetaEventResponse data) { + this.data = data; + } + + + /** + * Return true if this GetMetaEvent_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMetaEvent200Response getMetaEvent200Response = (GetMetaEvent200Response) o; + return Objects.equals(this.message, getMetaEvent200Response.message) && + Objects.equals(this.status, getMetaEvent200Response.status) && + Objects.equals(this.data, getMetaEvent200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMetaEvent200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetMetaEventsPaged200Response.java b/src/main/java/com/getconvoy/models/GetMetaEventsPaged200Response.java new file mode 100644 index 0000000..dceb13a --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetMetaEventsPaged200Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.GetMetaEventsPaged200ResponseAllOfData; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetMetaEventsPaged200Response + */ +@JsonPropertyOrder({ + GetMetaEventsPaged200Response.JSON_PROPERTY_MESSAGE, + GetMetaEventsPaged200Response.JSON_PROPERTY_STATUS, + GetMetaEventsPaged200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetMetaEventsPaged200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private GetMetaEventsPaged200ResponseAllOfData data; + + public GetMetaEventsPaged200Response() { + } + + public GetMetaEventsPaged200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public GetMetaEventsPaged200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public GetMetaEventsPaged200Response data(@jakarta.annotation.Nullable GetMetaEventsPaged200ResponseAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GetMetaEventsPaged200ResponseAllOfData getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable GetMetaEventsPaged200ResponseAllOfData data) { + this.data = data; + } + + + /** + * Return true if this GetMetaEventsPaged_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMetaEventsPaged200Response getMetaEventsPaged200Response = (GetMetaEventsPaged200Response) o; + return Objects.equals(this.message, getMetaEventsPaged200Response.message) && + Objects.equals(this.status, getMetaEventsPaged200Response.status) && + Objects.equals(this.data, getMetaEventsPaged200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMetaEventsPaged200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetMetaEventsPaged200ResponseAllOfData.java b/src/main/java/com/getconvoy/models/GetMetaEventsPaged200ResponseAllOfData.java new file mode 100644 index 0000000..e8f7994 --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetMetaEventsPaged200ResponseAllOfData.java @@ -0,0 +1,223 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastorePaginationData; +import com.getconvoy.models.ModelsMetaEventResponse; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetMetaEventsPaged200ResponseAllOfData + */ +@JsonPropertyOrder({ + GetMetaEventsPaged200ResponseAllOfData.JSON_PROPERTY_CONTENT, + GetMetaEventsPaged200ResponseAllOfData.JSON_PROPERTY_PAGINATION +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetMetaEventsPaged200ResponseAllOfData { + public static final String JSON_PROPERTY_CONTENT = "content"; + @jakarta.annotation.Nullable + private List content = new ArrayList<>(); + + public static final String JSON_PROPERTY_PAGINATION = "pagination"; + private JsonNullable pagination = JsonNullable.undefined(); + + public GetMetaEventsPaged200ResponseAllOfData() { + } + + public GetMetaEventsPaged200ResponseAllOfData content(@jakarta.annotation.Nullable List content) { + this.content = content; + return this; + } + + public GetMetaEventsPaged200ResponseAllOfData addContentItem(ModelsMetaEventResponse contentItem) { + if (this.content == null) { + this.content = new ArrayList<>(); + } + this.content.add(contentItem); + return this; + } + + /** + * Get content + * @return content + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getContent() { + return content; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContent(@jakarta.annotation.Nullable List content) { + this.content = content; + } + + + public GetMetaEventsPaged200ResponseAllOfData pagination(@jakarta.annotation.Nullable DatastorePaginationData pagination) { + this.pagination = JsonNullable.of(pagination); + return this; + } + + /** + * Get pagination + * @return pagination + */ + @jakarta.annotation.Nullable + @JsonIgnore + public DatastorePaginationData getPagination() { + return pagination.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_PAGINATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getPagination_JsonNullable() { + return pagination; + } + + @JsonProperty(JSON_PROPERTY_PAGINATION) + public void setPagination_JsonNullable(JsonNullable pagination) { + this.pagination = pagination; + } + + public void setPagination(@jakarta.annotation.Nullable DatastorePaginationData pagination) { + this.pagination = JsonNullable.of(pagination); + } + + + /** + * Return true if this GetMetaEventsPaged_200_response_allOf_data object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMetaEventsPaged200ResponseAllOfData getMetaEventsPaged200ResponseAllOfData = (GetMetaEventsPaged200ResponseAllOfData) o; + return Objects.equals(this.content, getMetaEventsPaged200ResponseAllOfData.content) && + equalsNullable(this.pagination, getMetaEventsPaged200ResponseAllOfData.pagination); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(content, hashCodeNullable(pagination)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMetaEventsPaged200ResponseAllOfData {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `content` to the URL query string + if (getContent() != null) { + for (int i = 0; i < getContent().size(); i++) { + if (getContent().get(i) != null) { + joiner.add(getContent().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%scontent%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `pagination` to the URL query string + if (getPagination() != null) { + joiner.add(getPagination().toUrlQueryString(prefix + "pagination" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetProject200Response.java b/src/main/java/com/getconvoy/models/GetProject200Response.java new file mode 100644 index 0000000..076be0b --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetProject200Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsProjectResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetProject200Response + */ +@JsonPropertyOrder({ + GetProject200Response.JSON_PROPERTY_MESSAGE, + GetProject200Response.JSON_PROPERTY_STATUS, + GetProject200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetProject200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private ModelsProjectResponse data; + + public GetProject200Response() { + } + + public GetProject200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public GetProject200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public GetProject200Response data(@jakarta.annotation.Nullable ModelsProjectResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsProjectResponse getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable ModelsProjectResponse data) { + this.data = data; + } + + + /** + * Return true if this GetProject_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetProject200Response getProject200Response = (GetProject200Response) o; + return Objects.equals(this.message, getProject200Response.message) && + Objects.equals(this.status, getProject200Response.status) && + Objects.equals(this.data, getProject200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetProject200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetProjects200Response.java b/src/main/java/com/getconvoy/models/GetProjects200Response.java new file mode 100644 index 0000000..2613f37 --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetProjects200Response.java @@ -0,0 +1,236 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsProjectResponse; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetProjects200Response + */ +@JsonPropertyOrder({ + GetProjects200Response.JSON_PROPERTY_MESSAGE, + GetProjects200Response.JSON_PROPERTY_STATUS, + GetProjects200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetProjects200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private List data = new ArrayList<>(); + + public GetProjects200Response() { + } + + public GetProjects200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public GetProjects200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public GetProjects200Response data(@jakarta.annotation.Nullable List data) { + this.data = data; + return this; + } + + public GetProjects200Response addDataItem(ModelsProjectResponse dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable List data) { + this.data = data; + } + + + /** + * Return true if this GetProjects_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetProjects200Response getProjects200Response = (GetProjects200Response) o; + return Objects.equals(this.message, getProjects200Response.message) && + Objects.equals(this.status, getProjects200Response.status) && + Objects.equals(this.data, getProjects200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetProjects200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + for (int i = 0; i < getData().size(); i++) { + if (getData().get(i) != null) { + joiner.add(getData().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sdata%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetProjects400Response.java b/src/main/java/com/getconvoy/models/GetProjects400Response.java new file mode 100644 index 0000000..a8c117d --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetProjects400Response.java @@ -0,0 +1,220 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetProjects400Response + */ +@JsonPropertyOrder({ + GetProjects400Response.JSON_PROPERTY_MESSAGE, + GetProjects400Response.JSON_PROPERTY_STATUS, + GetProjects400Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetProjects400Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private Object data; + + public GetProjects400Response() { + } + + public GetProjects400Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public GetProjects400Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public GetProjects400Response data(@jakarta.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable Object data) { + this.data = data; + } + + + /** + * Return true if this GetProjects_400_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetProjects400Response getProjects400Response = (GetProjects400Response) o; + return Objects.equals(this.message, getProjects400Response.message) && + Objects.equals(this.status, getProjects400Response.status) && + Objects.equals(this.data, getProjects400Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetProjects400Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdata%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getData())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetSubscriptions200Response.java b/src/main/java/com/getconvoy/models/GetSubscriptions200Response.java new file mode 100644 index 0000000..ebdaba3 --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetSubscriptions200Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.GetSubscriptions200ResponseAllOfData; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetSubscriptions200Response + */ +@JsonPropertyOrder({ + GetSubscriptions200Response.JSON_PROPERTY_MESSAGE, + GetSubscriptions200Response.JSON_PROPERTY_STATUS, + GetSubscriptions200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetSubscriptions200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private GetSubscriptions200ResponseAllOfData data; + + public GetSubscriptions200Response() { + } + + public GetSubscriptions200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public GetSubscriptions200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public GetSubscriptions200Response data(@jakarta.annotation.Nullable GetSubscriptions200ResponseAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GetSubscriptions200ResponseAllOfData getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable GetSubscriptions200ResponseAllOfData data) { + this.data = data; + } + + + /** + * Return true if this GetSubscriptions_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSubscriptions200Response getSubscriptions200Response = (GetSubscriptions200Response) o; + return Objects.equals(this.message, getSubscriptions200Response.message) && + Objects.equals(this.status, getSubscriptions200Response.status) && + Objects.equals(this.data, getSubscriptions200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSubscriptions200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/GetSubscriptions200ResponseAllOfData.java b/src/main/java/com/getconvoy/models/GetSubscriptions200ResponseAllOfData.java new file mode 100644 index 0000000..ebdcd0e --- /dev/null +++ b/src/main/java/com/getconvoy/models/GetSubscriptions200ResponseAllOfData.java @@ -0,0 +1,223 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastorePaginationData; +import com.getconvoy.models.ModelsSubscriptionResponse; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * GetSubscriptions200ResponseAllOfData + */ +@JsonPropertyOrder({ + GetSubscriptions200ResponseAllOfData.JSON_PROPERTY_CONTENT, + GetSubscriptions200ResponseAllOfData.JSON_PROPERTY_PAGINATION +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class GetSubscriptions200ResponseAllOfData { + public static final String JSON_PROPERTY_CONTENT = "content"; + @jakarta.annotation.Nullable + private List content = new ArrayList<>(); + + public static final String JSON_PROPERTY_PAGINATION = "pagination"; + private JsonNullable pagination = JsonNullable.undefined(); + + public GetSubscriptions200ResponseAllOfData() { + } + + public GetSubscriptions200ResponseAllOfData content(@jakarta.annotation.Nullable List content) { + this.content = content; + return this; + } + + public GetSubscriptions200ResponseAllOfData addContentItem(ModelsSubscriptionResponse contentItem) { + if (this.content == null) { + this.content = new ArrayList<>(); + } + this.content.add(contentItem); + return this; + } + + /** + * Get content + * @return content + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getContent() { + return content; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContent(@jakarta.annotation.Nullable List content) { + this.content = content; + } + + + public GetSubscriptions200ResponseAllOfData pagination(@jakarta.annotation.Nullable DatastorePaginationData pagination) { + this.pagination = JsonNullable.of(pagination); + return this; + } + + /** + * Get pagination + * @return pagination + */ + @jakarta.annotation.Nullable + @JsonIgnore + public DatastorePaginationData getPagination() { + return pagination.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_PAGINATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getPagination_JsonNullable() { + return pagination; + } + + @JsonProperty(JSON_PROPERTY_PAGINATION) + public void setPagination_JsonNullable(JsonNullable pagination) { + this.pagination = pagination; + } + + public void setPagination(@jakarta.annotation.Nullable DatastorePaginationData pagination) { + this.pagination = JsonNullable.of(pagination); + } + + + /** + * Return true if this GetSubscriptions_200_response_allOf_data object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSubscriptions200ResponseAllOfData getSubscriptions200ResponseAllOfData = (GetSubscriptions200ResponseAllOfData) o; + return Objects.equals(this.content, getSubscriptions200ResponseAllOfData.content) && + equalsNullable(this.pagination, getSubscriptions200ResponseAllOfData.pagination); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(content, hashCodeNullable(pagination)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSubscriptions200ResponseAllOfData {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `content` to the URL query string + if (getContent() != null) { + for (int i = 0; i < getContent().size(); i++) { + if (getContent().get(i) != null) { + joiner.add(getContent().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%scontent%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `pagination` to the URL query string + if (getPagination() != null) { + joiner.add(getPagination().toUrlQueryString(prefix + "pagination" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/LoadPortalLinksPaged200Response.java b/src/main/java/com/getconvoy/models/LoadPortalLinksPaged200Response.java new file mode 100644 index 0000000..dd53f31 --- /dev/null +++ b/src/main/java/com/getconvoy/models/LoadPortalLinksPaged200Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.LoadPortalLinksPaged200ResponseAllOfData; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * LoadPortalLinksPaged200Response + */ +@JsonPropertyOrder({ + LoadPortalLinksPaged200Response.JSON_PROPERTY_MESSAGE, + LoadPortalLinksPaged200Response.JSON_PROPERTY_STATUS, + LoadPortalLinksPaged200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class LoadPortalLinksPaged200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private LoadPortalLinksPaged200ResponseAllOfData data; + + public LoadPortalLinksPaged200Response() { + } + + public LoadPortalLinksPaged200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public LoadPortalLinksPaged200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public LoadPortalLinksPaged200Response data(@jakarta.annotation.Nullable LoadPortalLinksPaged200ResponseAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LoadPortalLinksPaged200ResponseAllOfData getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable LoadPortalLinksPaged200ResponseAllOfData data) { + this.data = data; + } + + + /** + * Return true if this LoadPortalLinksPaged_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoadPortalLinksPaged200Response loadPortalLinksPaged200Response = (LoadPortalLinksPaged200Response) o; + return Objects.equals(this.message, loadPortalLinksPaged200Response.message) && + Objects.equals(this.status, loadPortalLinksPaged200Response.status) && + Objects.equals(this.data, loadPortalLinksPaged200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoadPortalLinksPaged200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/LoadPortalLinksPaged200ResponseAllOfData.java b/src/main/java/com/getconvoy/models/LoadPortalLinksPaged200ResponseAllOfData.java new file mode 100644 index 0000000..750ffa9 --- /dev/null +++ b/src/main/java/com/getconvoy/models/LoadPortalLinksPaged200ResponseAllOfData.java @@ -0,0 +1,223 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastorePaginationData; +import com.getconvoy.models.DatastorePortalLinkResponse; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * LoadPortalLinksPaged200ResponseAllOfData + */ +@JsonPropertyOrder({ + LoadPortalLinksPaged200ResponseAllOfData.JSON_PROPERTY_CONTENT, + LoadPortalLinksPaged200ResponseAllOfData.JSON_PROPERTY_PAGINATION +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class LoadPortalLinksPaged200ResponseAllOfData { + public static final String JSON_PROPERTY_CONTENT = "content"; + @jakarta.annotation.Nullable + private List content = new ArrayList<>(); + + public static final String JSON_PROPERTY_PAGINATION = "pagination"; + private JsonNullable pagination = JsonNullable.undefined(); + + public LoadPortalLinksPaged200ResponseAllOfData() { + } + + public LoadPortalLinksPaged200ResponseAllOfData content(@jakarta.annotation.Nullable List content) { + this.content = content; + return this; + } + + public LoadPortalLinksPaged200ResponseAllOfData addContentItem(DatastorePortalLinkResponse contentItem) { + if (this.content == null) { + this.content = new ArrayList<>(); + } + this.content.add(contentItem); + return this; + } + + /** + * Get content + * @return content + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getContent() { + return content; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContent(@jakarta.annotation.Nullable List content) { + this.content = content; + } + + + public LoadPortalLinksPaged200ResponseAllOfData pagination(@jakarta.annotation.Nullable DatastorePaginationData pagination) { + this.pagination = JsonNullable.of(pagination); + return this; + } + + /** + * Get pagination + * @return pagination + */ + @jakarta.annotation.Nullable + @JsonIgnore + public DatastorePaginationData getPagination() { + return pagination.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_PAGINATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getPagination_JsonNullable() { + return pagination; + } + + @JsonProperty(JSON_PROPERTY_PAGINATION) + public void setPagination_JsonNullable(JsonNullable pagination) { + this.pagination = pagination; + } + + public void setPagination(@jakarta.annotation.Nullable DatastorePaginationData pagination) { + this.pagination = JsonNullable.of(pagination); + } + + + /** + * Return true if this LoadPortalLinksPaged_200_response_allOf_data object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoadPortalLinksPaged200ResponseAllOfData loadPortalLinksPaged200ResponseAllOfData = (LoadPortalLinksPaged200ResponseAllOfData) o; + return Objects.equals(this.content, loadPortalLinksPaged200ResponseAllOfData.content) && + equalsNullable(this.pagination, loadPortalLinksPaged200ResponseAllOfData.pagination); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(content, hashCodeNullable(pagination)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoadPortalLinksPaged200ResponseAllOfData {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `content` to the URL query string + if (getContent() != null) { + for (int i = 0; i < getContent().size(); i++) { + if (getContent().get(i) != null) { + joiner.add(getContent().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%scontent%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `pagination` to the URL query string + if (getPagination() != null) { + joiner.add(getPagination().toUrlQueryString(prefix + "pagination" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/LoadSourcesPaged200Response.java b/src/main/java/com/getconvoy/models/LoadSourcesPaged200Response.java new file mode 100644 index 0000000..d8456c2 --- /dev/null +++ b/src/main/java/com/getconvoy/models/LoadSourcesPaged200Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.LoadSourcesPaged200ResponseAllOfData; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * LoadSourcesPaged200Response + */ +@JsonPropertyOrder({ + LoadSourcesPaged200Response.JSON_PROPERTY_MESSAGE, + LoadSourcesPaged200Response.JSON_PROPERTY_STATUS, + LoadSourcesPaged200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class LoadSourcesPaged200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private LoadSourcesPaged200ResponseAllOfData data; + + public LoadSourcesPaged200Response() { + } + + public LoadSourcesPaged200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public LoadSourcesPaged200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public LoadSourcesPaged200Response data(@jakarta.annotation.Nullable LoadSourcesPaged200ResponseAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LoadSourcesPaged200ResponseAllOfData getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable LoadSourcesPaged200ResponseAllOfData data) { + this.data = data; + } + + + /** + * Return true if this LoadSourcesPaged_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoadSourcesPaged200Response loadSourcesPaged200Response = (LoadSourcesPaged200Response) o; + return Objects.equals(this.message, loadSourcesPaged200Response.message) && + Objects.equals(this.status, loadSourcesPaged200Response.status) && + Objects.equals(this.data, loadSourcesPaged200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoadSourcesPaged200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/LoadSourcesPaged200ResponseAllOfData.java b/src/main/java/com/getconvoy/models/LoadSourcesPaged200ResponseAllOfData.java new file mode 100644 index 0000000..18c7562 --- /dev/null +++ b/src/main/java/com/getconvoy/models/LoadSourcesPaged200ResponseAllOfData.java @@ -0,0 +1,223 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastorePaginationData; +import com.getconvoy.models.ModelsSourceResponse; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * LoadSourcesPaged200ResponseAllOfData + */ +@JsonPropertyOrder({ + LoadSourcesPaged200ResponseAllOfData.JSON_PROPERTY_CONTENT, + LoadSourcesPaged200ResponseAllOfData.JSON_PROPERTY_PAGINATION +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class LoadSourcesPaged200ResponseAllOfData { + public static final String JSON_PROPERTY_CONTENT = "content"; + @jakarta.annotation.Nullable + private List content = new ArrayList<>(); + + public static final String JSON_PROPERTY_PAGINATION = "pagination"; + private JsonNullable pagination = JsonNullable.undefined(); + + public LoadSourcesPaged200ResponseAllOfData() { + } + + public LoadSourcesPaged200ResponseAllOfData content(@jakarta.annotation.Nullable List content) { + this.content = content; + return this; + } + + public LoadSourcesPaged200ResponseAllOfData addContentItem(ModelsSourceResponse contentItem) { + if (this.content == null) { + this.content = new ArrayList<>(); + } + this.content.add(contentItem); + return this; + } + + /** + * Get content + * @return content + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getContent() { + return content; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContent(@jakarta.annotation.Nullable List content) { + this.content = content; + } + + + public LoadSourcesPaged200ResponseAllOfData pagination(@jakarta.annotation.Nullable DatastorePaginationData pagination) { + this.pagination = JsonNullable.of(pagination); + return this; + } + + /** + * Get pagination + * @return pagination + */ + @jakarta.annotation.Nullable + @JsonIgnore + public DatastorePaginationData getPagination() { + return pagination.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_PAGINATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getPagination_JsonNullable() { + return pagination; + } + + @JsonProperty(JSON_PROPERTY_PAGINATION) + public void setPagination_JsonNullable(JsonNullable pagination) { + this.pagination = pagination; + } + + public void setPagination(@jakarta.annotation.Nullable DatastorePaginationData pagination) { + this.pagination = JsonNullable.of(pagination); + } + + + /** + * Return true if this LoadSourcesPaged_200_response_allOf_data object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoadSourcesPaged200ResponseAllOfData loadSourcesPaged200ResponseAllOfData = (LoadSourcesPaged200ResponseAllOfData) o; + return Objects.equals(this.content, loadSourcesPaged200ResponseAllOfData.content) && + equalsNullable(this.pagination, loadSourcesPaged200ResponseAllOfData.pagination); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(content, hashCodeNullable(pagination)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoadSourcesPaged200ResponseAllOfData {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `content` to the URL query string + if (getContent() != null) { + for (int i = 0; i < getContent().size(); i++) { + if (getContent().get(i) != null) { + joiner.add(getContent().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%scontent%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `pagination` to the URL query string + if (getPagination() != null) { + joiner.add(getPagination().toUrlQueryString(prefix + "pagination" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsAlertConfiguration.java b/src/main/java/com/getconvoy/models/ModelsAlertConfiguration.java new file mode 100644 index 0000000..d7b56aa --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsAlertConfiguration.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsAlertConfiguration + */ +@JsonPropertyOrder({ + ModelsAlertConfiguration.JSON_PROPERTY_COUNT, + ModelsAlertConfiguration.JSON_PROPERTY_THRESHOLD +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsAlertConfiguration { + public static final String JSON_PROPERTY_COUNT = "count"; + @jakarta.annotation.Nullable + private Integer count; + + public static final String JSON_PROPERTY_THRESHOLD = "threshold"; + @jakarta.annotation.Nullable + private String threshold; + + public ModelsAlertConfiguration() { + } + + public ModelsAlertConfiguration count(@jakarta.annotation.Nullable Integer count) { + this.count = count; + return this; + } + + /** + * Count + * @return count + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCount() { + return count; + } + + + @JsonProperty(value = JSON_PROPERTY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(@jakarta.annotation.Nullable Integer count) { + this.count = count; + } + + + public ModelsAlertConfiguration threshold(@jakarta.annotation.Nullable String threshold) { + this.threshold = threshold; + return this; + } + + /** + * Threshold + * @return threshold + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_THRESHOLD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getThreshold() { + return threshold; + } + + + @JsonProperty(value = JSON_PROPERTY_THRESHOLD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThreshold(@jakarta.annotation.Nullable String threshold) { + this.threshold = threshold; + } + + + /** + * Return true if this models.AlertConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsAlertConfiguration modelsAlertConfiguration = (ModelsAlertConfiguration) o; + return Objects.equals(this.count, modelsAlertConfiguration.count) && + Objects.equals(this.threshold, modelsAlertConfiguration.threshold); + } + + @Override + public int hashCode() { + return Objects.hash(count, threshold); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsAlertConfiguration {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" threshold: ").append(toIndentedString(threshold)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `count` to the URL query string + if (getCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scount%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCount())))); + } + + // add `threshold` to the URL query string + if (getThreshold() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sthreshold%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getThreshold())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsAmqpAuth.java b/src/main/java/com/getconvoy/models/ModelsAmqpAuth.java new file mode 100644 index 0000000..504fd98 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsAmqpAuth.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsAmqpAuth + */ +@JsonPropertyOrder({ + ModelsAmqpAuth.JSON_PROPERTY_PASSWORD, + ModelsAmqpAuth.JSON_PROPERTY_USER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsAmqpAuth { + public static final String JSON_PROPERTY_PASSWORD = "password"; + @jakarta.annotation.Nullable + private String password; + + public static final String JSON_PROPERTY_USER = "user"; + @jakarta.annotation.Nullable + private String user; + + public ModelsAmqpAuth() { + } + + public ModelsAmqpAuth password(@jakarta.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(@jakarta.annotation.Nullable String password) { + this.password = password; + } + + + public ModelsAmqpAuth user(@jakarta.annotation.Nullable String user) { + this.user = user; + return this; + } + + /** + * Get user + * @return user + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_USER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUser() { + return user; + } + + + @JsonProperty(value = JSON_PROPERTY_USER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUser(@jakarta.annotation.Nullable String user) { + this.user = user; + } + + + /** + * Return true if this models.AmqpAuth object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsAmqpAuth modelsAmqpAuth = (ModelsAmqpAuth) o; + return Objects.equals(this.password, modelsAmqpAuth.password) && + Objects.equals(this.user, modelsAmqpAuth.user); + } + + @Override + public int hashCode() { + return Objects.hash(password, user); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsAmqpAuth {\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `password` to the URL query string + if (getPassword() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spassword%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPassword())))); + } + + // add `user` to the URL query string + if (getUser() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suser%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUser())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsAmqpExchange.java b/src/main/java/com/getconvoy/models/ModelsAmqpExchange.java new file mode 100644 index 0000000..0fde7a2 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsAmqpExchange.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsAmqpExchange + */ +@JsonPropertyOrder({ + ModelsAmqpExchange.JSON_PROPERTY_EXCHANGE, + ModelsAmqpExchange.JSON_PROPERTY_ROUTING_KEY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsAmqpExchange { + public static final String JSON_PROPERTY_EXCHANGE = "exchange"; + @jakarta.annotation.Nullable + private String exchange; + + public static final String JSON_PROPERTY_ROUTING_KEY = "routingKey"; + @jakarta.annotation.Nullable + private String routingKey; + + public ModelsAmqpExchange() { + } + + public ModelsAmqpExchange exchange(@jakarta.annotation.Nullable String exchange) { + this.exchange = exchange; + return this; + } + + /** + * Get exchange + * @return exchange + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EXCHANGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExchange() { + return exchange; + } + + + @JsonProperty(value = JSON_PROPERTY_EXCHANGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExchange(@jakarta.annotation.Nullable String exchange) { + this.exchange = exchange; + } + + + public ModelsAmqpExchange routingKey(@jakarta.annotation.Nullable String routingKey) { + this.routingKey = routingKey; + return this; + } + + /** + * Get routingKey + * @return routingKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ROUTING_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRoutingKey() { + return routingKey; + } + + + @JsonProperty(value = JSON_PROPERTY_ROUTING_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRoutingKey(@jakarta.annotation.Nullable String routingKey) { + this.routingKey = routingKey; + } + + + /** + * Return true if this models.AmqpExchange object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsAmqpExchange modelsAmqpExchange = (ModelsAmqpExchange) o; + return Objects.equals(this.exchange, modelsAmqpExchange.exchange) && + Objects.equals(this.routingKey, modelsAmqpExchange.routingKey); + } + + @Override + public int hashCode() { + return Objects.hash(exchange, routingKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsAmqpExchange {\n"); + sb.append(" exchange: ").append(toIndentedString(exchange)).append("\n"); + sb.append(" routingKey: ").append(toIndentedString(routingKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `exchange` to the URL query string + if (getExchange() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sexchange%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getExchange())))); + } + + // add `routingKey` to the URL query string + if (getRoutingKey() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sroutingKey%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRoutingKey())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsAmqpPubSubconfig.java b/src/main/java/com/getconvoy/models/ModelsAmqpPubSubconfig.java new file mode 100644 index 0000000..e915512 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsAmqpPubSubconfig.java @@ -0,0 +1,402 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsAmqpAuth; +import com.getconvoy.models.ModelsAmqpExchange; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsAmqpPubSubconfig + */ +@JsonPropertyOrder({ + ModelsAmqpPubSubconfig.JSON_PROPERTY_HOST, + ModelsAmqpPubSubconfig.JSON_PROPERTY_AUTH, + ModelsAmqpPubSubconfig.JSON_PROPERTY_BIND_EXCHANGE, + ModelsAmqpPubSubconfig.JSON_PROPERTY_DEAD_LETTER_EXCHANGE, + ModelsAmqpPubSubconfig.JSON_PROPERTY_PORT, + ModelsAmqpPubSubconfig.JSON_PROPERTY_QUEUE, + ModelsAmqpPubSubconfig.JSON_PROPERTY_SCHEMA, + ModelsAmqpPubSubconfig.JSON_PROPERTY_VHOST +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsAmqpPubSubconfig { + public static final String JSON_PROPERTY_HOST = "host"; + @jakarta.annotation.Nullable + private String host; + + public static final String JSON_PROPERTY_AUTH = "auth"; + @jakarta.annotation.Nullable + private ModelsAmqpAuth auth; + + public static final String JSON_PROPERTY_BIND_EXCHANGE = "bindExchange"; + @jakarta.annotation.Nullable + private ModelsAmqpExchange bindExchange; + + public static final String JSON_PROPERTY_DEAD_LETTER_EXCHANGE = "deadLetterExchange"; + @jakarta.annotation.Nullable + private String deadLetterExchange; + + public static final String JSON_PROPERTY_PORT = "port"; + @jakarta.annotation.Nullable + private String port; + + public static final String JSON_PROPERTY_QUEUE = "queue"; + @jakarta.annotation.Nullable + private String queue; + + public static final String JSON_PROPERTY_SCHEMA = "schema"; + @jakarta.annotation.Nullable + private String schema; + + public static final String JSON_PROPERTY_VHOST = "vhost"; + @jakarta.annotation.Nullable + private String vhost; + + public ModelsAmqpPubSubconfig() { + } + + public ModelsAmqpPubSubconfig host(@jakarta.annotation.Nullable String host) { + this.host = host; + return this; + } + + /** + * Get host + * @return host + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HOST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHost() { + return host; + } + + + @JsonProperty(value = JSON_PROPERTY_HOST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHost(@jakarta.annotation.Nullable String host) { + this.host = host; + } + + + public ModelsAmqpPubSubconfig auth(@jakarta.annotation.Nullable ModelsAmqpAuth auth) { + this.auth = auth; + return this; + } + + /** + * Get auth + * @return auth + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsAmqpAuth getAuth() { + return auth; + } + + + @JsonProperty(value = JSON_PROPERTY_AUTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuth(@jakarta.annotation.Nullable ModelsAmqpAuth auth) { + this.auth = auth; + } + + + public ModelsAmqpPubSubconfig bindExchange(@jakarta.annotation.Nullable ModelsAmqpExchange bindExchange) { + this.bindExchange = bindExchange; + return this; + } + + /** + * Get bindExchange + * @return bindExchange + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BIND_EXCHANGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsAmqpExchange getBindExchange() { + return bindExchange; + } + + + @JsonProperty(value = JSON_PROPERTY_BIND_EXCHANGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBindExchange(@jakarta.annotation.Nullable ModelsAmqpExchange bindExchange) { + this.bindExchange = bindExchange; + } + + + public ModelsAmqpPubSubconfig deadLetterExchange(@jakarta.annotation.Nullable String deadLetterExchange) { + this.deadLetterExchange = deadLetterExchange; + return this; + } + + /** + * Get deadLetterExchange + * @return deadLetterExchange + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DEAD_LETTER_EXCHANGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeadLetterExchange() { + return deadLetterExchange; + } + + + @JsonProperty(value = JSON_PROPERTY_DEAD_LETTER_EXCHANGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeadLetterExchange(@jakarta.annotation.Nullable String deadLetterExchange) { + this.deadLetterExchange = deadLetterExchange; + } + + + public ModelsAmqpPubSubconfig port(@jakarta.annotation.Nullable String port) { + this.port = port; + return this; + } + + /** + * Get port + * @return port + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PORT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPort() { + return port; + } + + + @JsonProperty(value = JSON_PROPERTY_PORT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPort(@jakarta.annotation.Nullable String port) { + this.port = port; + } + + + public ModelsAmqpPubSubconfig queue(@jakarta.annotation.Nullable String queue) { + this.queue = queue; + return this; + } + + /** + * Get queue + * @return queue + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_QUEUE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQueue() { + return queue; + } + + + @JsonProperty(value = JSON_PROPERTY_QUEUE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQueue(@jakarta.annotation.Nullable String queue) { + this.queue = queue; + } + + + public ModelsAmqpPubSubconfig schema(@jakarta.annotation.Nullable String schema) { + this.schema = schema; + return this; + } + + /** + * Get schema + * @return schema + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SCHEMA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSchema() { + return schema; + } + + + @JsonProperty(value = JSON_PROPERTY_SCHEMA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSchema(@jakarta.annotation.Nullable String schema) { + this.schema = schema; + } + + + public ModelsAmqpPubSubconfig vhost(@jakarta.annotation.Nullable String vhost) { + this.vhost = vhost; + return this; + } + + /** + * Get vhost + * @return vhost + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_VHOST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVhost() { + return vhost; + } + + + @JsonProperty(value = JSON_PROPERTY_VHOST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVhost(@jakarta.annotation.Nullable String vhost) { + this.vhost = vhost; + } + + + /** + * Return true if this models.AmqpPubSubconfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsAmqpPubSubconfig modelsAmqpPubSubconfig = (ModelsAmqpPubSubconfig) o; + return Objects.equals(this.host, modelsAmqpPubSubconfig.host) && + Objects.equals(this.auth, modelsAmqpPubSubconfig.auth) && + Objects.equals(this.bindExchange, modelsAmqpPubSubconfig.bindExchange) && + Objects.equals(this.deadLetterExchange, modelsAmqpPubSubconfig.deadLetterExchange) && + Objects.equals(this.port, modelsAmqpPubSubconfig.port) && + Objects.equals(this.queue, modelsAmqpPubSubconfig.queue) && + Objects.equals(this.schema, modelsAmqpPubSubconfig.schema) && + Objects.equals(this.vhost, modelsAmqpPubSubconfig.vhost); + } + + @Override + public int hashCode() { + return Objects.hash(host, auth, bindExchange, deadLetterExchange, port, queue, schema, vhost); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsAmqpPubSubconfig {\n"); + sb.append(" host: ").append(toIndentedString(host)).append("\n"); + sb.append(" auth: ").append(toIndentedString(auth)).append("\n"); + sb.append(" bindExchange: ").append(toIndentedString(bindExchange)).append("\n"); + sb.append(" deadLetterExchange: ").append(toIndentedString(deadLetterExchange)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append(" queue: ").append(toIndentedString(queue)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); + sb.append(" vhost: ").append(toIndentedString(vhost)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `host` to the URL query string + if (getHost() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shost%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHost())))); + } + + // add `auth` to the URL query string + if (getAuth() != null) { + joiner.add(getAuth().toUrlQueryString(prefix + "auth" + suffix)); + } + + // add `bindExchange` to the URL query string + if (getBindExchange() != null) { + joiner.add(getBindExchange().toUrlQueryString(prefix + "bindExchange" + suffix)); + } + + // add `deadLetterExchange` to the URL query string + if (getDeadLetterExchange() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeadLetterExchange%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeadLetterExchange())))); + } + + // add `port` to the URL query string + if (getPort() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sport%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPort())))); + } + + // add `queue` to the URL query string + if (getQueue() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%squeue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getQueue())))); + } + + // add `schema` to the URL query string + if (getSchema() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sschema%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSchema())))); + } + + // add `vhost` to the URL query string + if (getVhost() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%svhost%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVhost())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsApiKey.java b/src/main/java/com/getconvoy/models/ModelsApiKey.java new file mode 100644 index 0000000..ebf5460 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsApiKey.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsApiKey + */ +@JsonPropertyOrder({ + ModelsApiKey.JSON_PROPERTY_HEADER_NAME, + ModelsApiKey.JSON_PROPERTY_HEADER_VALUE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsApiKey { + public static final String JSON_PROPERTY_HEADER_NAME = "header_name"; + @jakarta.annotation.Nonnull + private String headerName; + + public static final String JSON_PROPERTY_HEADER_VALUE = "header_value"; + @jakarta.annotation.Nonnull + private String headerValue; + + public ModelsApiKey() { + } + + public ModelsApiKey headerName(@jakarta.annotation.Nonnull String headerName) { + this.headerName = headerName; + return this; + } + + /** + * Get headerName + * @return headerName + */ + @jakarta.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_HEADER_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHeaderName() { + return headerName; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADER_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHeaderName(@jakarta.annotation.Nonnull String headerName) { + this.headerName = headerName; + } + + + public ModelsApiKey headerValue(@jakarta.annotation.Nonnull String headerValue) { + this.headerValue = headerValue; + return this; + } + + /** + * Get headerValue + * @return headerValue + */ + @jakarta.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_HEADER_VALUE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHeaderValue() { + return headerValue; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADER_VALUE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHeaderValue(@jakarta.annotation.Nonnull String headerValue) { + this.headerValue = headerValue; + } + + + /** + * Return true if this models.ApiKey object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsApiKey modelsApiKey = (ModelsApiKey) o; + return Objects.equals(this.headerName, modelsApiKey.headerName) && + Objects.equals(this.headerValue, modelsApiKey.headerValue); + } + + @Override + public int hashCode() { + return Objects.hash(headerName, headerValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsApiKey {\n"); + sb.append(" headerName: ").append(toIndentedString(headerName)).append("\n"); + sb.append(" headerValue: ").append(toIndentedString(headerValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `header_name` to the URL query string + if (getHeaderName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheader_name%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHeaderName())))); + } + + // add `header_value` to the URL query string + if (getHeaderValue() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheader_value%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHeaderValue())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsBasicAuth.java b/src/main/java/com/getconvoy/models/ModelsBasicAuth.java new file mode 100644 index 0000000..75c53c9 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsBasicAuth.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsBasicAuth + */ +@JsonPropertyOrder({ + ModelsBasicAuth.JSON_PROPERTY_PASSWORD, + ModelsBasicAuth.JSON_PROPERTY_USERNAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsBasicAuth { + public static final String JSON_PROPERTY_PASSWORD = "password"; + @jakarta.annotation.Nonnull + private String password; + + public static final String JSON_PROPERTY_USERNAME = "username"; + @jakarta.annotation.Nonnull + private String username; + + public ModelsBasicAuth() { + } + + public ModelsBasicAuth password(@jakarta.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @jakarta.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { + return password; + } + + + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPassword(@jakarta.annotation.Nonnull String password) { + this.password = password; + } + + + public ModelsBasicAuth username(@jakarta.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @jakarta.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_USERNAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUsername() { + return username; + } + + + @JsonProperty(value = JSON_PROPERTY_USERNAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUsername(@jakarta.annotation.Nonnull String username) { + this.username = username; + } + + + /** + * Return true if this models.BasicAuth object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsBasicAuth modelsBasicAuth = (ModelsBasicAuth) o; + return Objects.equals(this.password, modelsBasicAuth.password) && + Objects.equals(this.username, modelsBasicAuth.username); + } + + @Override + public int hashCode() { + return Objects.hash(password, username); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsBasicAuth {\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `password` to the URL query string + if (getPassword() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spassword%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPassword())))); + } + + // add `username` to the URL query string + if (getUsername() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%susername%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUsername())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsBroadcastEvent.java b/src/main/java/com/getconvoy/models/ModelsBroadcastEvent.java new file mode 100644 index 0000000..332eb50 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsBroadcastEvent.java @@ -0,0 +1,318 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsBroadcastEvent + */ +@JsonPropertyOrder({ + ModelsBroadcastEvent.JSON_PROPERTY_ACKNOWLEDGED_AT, + ModelsBroadcastEvent.JSON_PROPERTY_CUSTOM_HEADERS, + ModelsBroadcastEvent.JSON_PROPERTY_DATA, + ModelsBroadcastEvent.JSON_PROPERTY_EVENT_TYPE, + ModelsBroadcastEvent.JSON_PROPERTY_IDEMPOTENCY_KEY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsBroadcastEvent { + public static final String JSON_PROPERTY_ACKNOWLEDGED_AT = "acknowledged_at"; + @jakarta.annotation.Nullable + private String acknowledgedAt; + + public static final String JSON_PROPERTY_CUSTOM_HEADERS = "custom_headers"; + @jakarta.annotation.Nullable + private Map customHeaders = new HashMap<>(); + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private Map data = new HashMap<>(); + + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @jakarta.annotation.Nullable + private String eventType; + + public static final String JSON_PROPERTY_IDEMPOTENCY_KEY = "idempotency_key"; + @jakarta.annotation.Nullable + private String idempotencyKey; + + public ModelsBroadcastEvent() { + } + + public ModelsBroadcastEvent acknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { + this.acknowledgedAt = acknowledgedAt; + return this; + } + + /** + * Get acknowledgedAt + * @return acknowledgedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ACKNOWLEDGED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAcknowledgedAt() { + return acknowledgedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_ACKNOWLEDGED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { + this.acknowledgedAt = acknowledgedAt; + } + + + public ModelsBroadcastEvent customHeaders(@jakarta.annotation.Nullable Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + public ModelsBroadcastEvent putCustomHeadersItem(String key, String customHeadersItem) { + if (this.customHeaders == null) { + this.customHeaders = new HashMap<>(); + } + this.customHeaders.put(key, customHeadersItem); + return this; + } + + /** + * Specifies custom headers you want convoy to add when the event is dispatched to your endpoint + * @return customHeaders + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CUSTOM_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getCustomHeaders() { + return customHeaders; + } + + + @JsonProperty(value = JSON_PROPERTY_CUSTOM_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomHeaders(@jakarta.annotation.Nullable Map customHeaders) { + this.customHeaders = customHeaders; + } + + + public ModelsBroadcastEvent data(@jakarta.annotation.Nullable Map data) { + this.data = data; + return this; + } + + public ModelsBroadcastEvent putDataItem(String key, Object dataItem) { + if (this.data == null) { + this.data = new HashMap<>(); + } + this.data.put(key, dataItem); + return this; + } + + /** + * Data is an arbitrary JSON value that gets sent as the body of the webhook to the endpoints + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable Map data) { + this.data = data; + } + + + public ModelsBroadcastEvent eventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Event Type is used for filtering and debugging e.g invoice.paid + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventType() { + return eventType; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + } + + + public ModelsBroadcastEvent idempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + + /** + * Specify a key for event deduplication + * @return idempotencyKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIdempotencyKey() { + return idempotencyKey; + } + + + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + } + + + /** + * Return true if this models.BroadcastEvent object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsBroadcastEvent modelsBroadcastEvent = (ModelsBroadcastEvent) o; + return Objects.equals(this.acknowledgedAt, modelsBroadcastEvent.acknowledgedAt) && + Objects.equals(this.customHeaders, modelsBroadcastEvent.customHeaders) && + Objects.equals(this.data, modelsBroadcastEvent.data) && + Objects.equals(this.eventType, modelsBroadcastEvent.eventType) && + Objects.equals(this.idempotencyKey, modelsBroadcastEvent.idempotencyKey); + } + + @Override + public int hashCode() { + return Objects.hash(acknowledgedAt, customHeaders, data, eventType, idempotencyKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsBroadcastEvent {\n"); + sb.append(" acknowledgedAt: ").append(toIndentedString(acknowledgedAt)).append("\n"); + sb.append(" customHeaders: ").append(toIndentedString(customHeaders)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" idempotencyKey: ").append(toIndentedString(idempotencyKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `acknowledged_at` to the URL query string + if (getAcknowledgedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sacknowledged_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAcknowledgedAt())))); + } + + // add `custom_headers` to the URL query string + if (getCustomHeaders() != null) { + for (String _key : getCustomHeaders().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%scustom_headers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getCustomHeaders().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getCustomHeaders().get(_key))))); + } + } + + // add `data` to the URL query string + if (getData() != null) { + for (String _key : getData().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdata%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getData().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getData().get(_key))))); + } + } + + // add `event_type` to the URL query string + if (getEventType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventType())))); + } + + // add `idempotency_key` to the URL query string + if (getIdempotencyKey() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sidempotency_key%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIdempotencyKey())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsBulkOnboardAcceptedResponse.java b/src/main/java/com/getconvoy/models/ModelsBulkOnboardAcceptedResponse.java new file mode 100644 index 0000000..0bc63f6 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsBulkOnboardAcceptedResponse.java @@ -0,0 +1,220 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsBulkOnboardAcceptedResponse + */ +@JsonPropertyOrder({ + ModelsBulkOnboardAcceptedResponse.JSON_PROPERTY_BATCH_COUNT, + ModelsBulkOnboardAcceptedResponse.JSON_PROPERTY_MESSAGE, + ModelsBulkOnboardAcceptedResponse.JSON_PROPERTY_TOTAL_ITEMS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsBulkOnboardAcceptedResponse { + public static final String JSON_PROPERTY_BATCH_COUNT = "batch_count"; + @jakarta.annotation.Nullable + private Integer batchCount; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_TOTAL_ITEMS = "total_items"; + @jakarta.annotation.Nullable + private Integer totalItems; + + public ModelsBulkOnboardAcceptedResponse() { + } + + public ModelsBulkOnboardAcceptedResponse batchCount(@jakarta.annotation.Nullable Integer batchCount) { + this.batchCount = batchCount; + return this; + } + + /** + * Get batchCount + * @return batchCount + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BATCH_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBatchCount() { + return batchCount; + } + + + @JsonProperty(value = JSON_PROPERTY_BATCH_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBatchCount(@jakarta.annotation.Nullable Integer batchCount) { + this.batchCount = batchCount; + } + + + public ModelsBulkOnboardAcceptedResponse message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public ModelsBulkOnboardAcceptedResponse totalItems(@jakarta.annotation.Nullable Integer totalItems) { + this.totalItems = totalItems; + return this; + } + + /** + * Get totalItems + * @return totalItems + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TOTAL_ITEMS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalItems() { + return totalItems; + } + + + @JsonProperty(value = JSON_PROPERTY_TOTAL_ITEMS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalItems(@jakarta.annotation.Nullable Integer totalItems) { + this.totalItems = totalItems; + } + + + /** + * Return true if this models.BulkOnboardAcceptedResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsBulkOnboardAcceptedResponse modelsBulkOnboardAcceptedResponse = (ModelsBulkOnboardAcceptedResponse) o; + return Objects.equals(this.batchCount, modelsBulkOnboardAcceptedResponse.batchCount) && + Objects.equals(this.message, modelsBulkOnboardAcceptedResponse.message) && + Objects.equals(this.totalItems, modelsBulkOnboardAcceptedResponse.totalItems); + } + + @Override + public int hashCode() { + return Objects.hash(batchCount, message, totalItems); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsBulkOnboardAcceptedResponse {\n"); + sb.append(" batchCount: ").append(toIndentedString(batchCount)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" totalItems: ").append(toIndentedString(totalItems)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `batch_count` to the URL query string + if (getBatchCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbatch_count%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBatchCount())))); + } + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `total_items` to the URL query string + if (getTotalItems() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stotal_items%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTotalItems())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsBulkOnboardDryRunResponse.java b/src/main/java/com/getconvoy/models/ModelsBulkOnboardDryRunResponse.java new file mode 100644 index 0000000..ebb21a6 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsBulkOnboardDryRunResponse.java @@ -0,0 +1,236 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsOnboardValidationError; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsBulkOnboardDryRunResponse + */ +@JsonPropertyOrder({ + ModelsBulkOnboardDryRunResponse.JSON_PROPERTY_ERRORS, + ModelsBulkOnboardDryRunResponse.JSON_PROPERTY_TOTAL_ROWS, + ModelsBulkOnboardDryRunResponse.JSON_PROPERTY_VALID_COUNT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsBulkOnboardDryRunResponse { + public static final String JSON_PROPERTY_ERRORS = "errors"; + @jakarta.annotation.Nullable + private List errors = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL_ROWS = "total_rows"; + @jakarta.annotation.Nullable + private Integer totalRows; + + public static final String JSON_PROPERTY_VALID_COUNT = "valid_count"; + @jakarta.annotation.Nullable + private Integer validCount; + + public ModelsBulkOnboardDryRunResponse() { + } + + public ModelsBulkOnboardDryRunResponse errors(@jakarta.annotation.Nullable List errors) { + this.errors = errors; + return this; + } + + public ModelsBulkOnboardDryRunResponse addErrorsItem(ModelsOnboardValidationError errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ERRORS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getErrors() { + return errors; + } + + + @JsonProperty(value = JSON_PROPERTY_ERRORS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrors(@jakarta.annotation.Nullable List errors) { + this.errors = errors; + } + + + public ModelsBulkOnboardDryRunResponse totalRows(@jakarta.annotation.Nullable Integer totalRows) { + this.totalRows = totalRows; + return this; + } + + /** + * Get totalRows + * @return totalRows + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TOTAL_ROWS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRows() { + return totalRows; + } + + + @JsonProperty(value = JSON_PROPERTY_TOTAL_ROWS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRows(@jakarta.annotation.Nullable Integer totalRows) { + this.totalRows = totalRows; + } + + + public ModelsBulkOnboardDryRunResponse validCount(@jakarta.annotation.Nullable Integer validCount) { + this.validCount = validCount; + return this; + } + + /** + * Get validCount + * @return validCount + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_VALID_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getValidCount() { + return validCount; + } + + + @JsonProperty(value = JSON_PROPERTY_VALID_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidCount(@jakarta.annotation.Nullable Integer validCount) { + this.validCount = validCount; + } + + + /** + * Return true if this models.BulkOnboardDryRunResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsBulkOnboardDryRunResponse modelsBulkOnboardDryRunResponse = (ModelsBulkOnboardDryRunResponse) o; + return Objects.equals(this.errors, modelsBulkOnboardDryRunResponse.errors) && + Objects.equals(this.totalRows, modelsBulkOnboardDryRunResponse.totalRows) && + Objects.equals(this.validCount, modelsBulkOnboardDryRunResponse.validCount); + } + + @Override + public int hashCode() { + return Objects.hash(errors, totalRows, validCount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsBulkOnboardDryRunResponse {\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" totalRows: ").append(toIndentedString(totalRows)).append("\n"); + sb.append(" validCount: ").append(toIndentedString(validCount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `errors` to the URL query string + if (getErrors() != null) { + for (int i = 0; i < getErrors().size(); i++) { + if (getErrors().get(i) != null) { + joiner.add(getErrors().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%serrors%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `total_rows` to the URL query string + if (getTotalRows() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stotal_rows%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTotalRows())))); + } + + // add `valid_count` to the URL query string + if (getValidCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%svalid_count%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getValidCount())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsBulkOnboardRequest.java b/src/main/java/com/getconvoy/models/ModelsBulkOnboardRequest.java new file mode 100644 index 0000000..91c4385 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsBulkOnboardRequest.java @@ -0,0 +1,164 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsOnboardItem; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsBulkOnboardRequest + */ +@JsonPropertyOrder({ + ModelsBulkOnboardRequest.JSON_PROPERTY_ITEMS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsBulkOnboardRequest { + public static final String JSON_PROPERTY_ITEMS = "items"; + @jakarta.annotation.Nullable + private List items = new ArrayList<>(); + + public ModelsBulkOnboardRequest() { + } + + public ModelsBulkOnboardRequest items(@jakarta.annotation.Nullable List items) { + this.items = items; + return this; + } + + public ModelsBulkOnboardRequest addItemsItem(ModelsOnboardItem itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Get items + * @return items + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ITEMS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + + @JsonProperty(value = JSON_PROPERTY_ITEMS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@jakarta.annotation.Nullable List items) { + this.items = items; + } + + + /** + * Return true if this models.BulkOnboardRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsBulkOnboardRequest modelsBulkOnboardRequest = (ModelsBulkOnboardRequest) o; + return Objects.equals(this.items, modelsBulkOnboardRequest.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsBulkOnboardRequest {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sitems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsBulkUpdateFilterRequest.java b/src/main/java/com/getconvoy/models/ModelsBulkUpdateFilterRequest.java new file mode 100644 index 0000000..b3be79c --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsBulkUpdateFilterRequest.java @@ -0,0 +1,415 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsOptionalTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsBulkUpdateFilterRequest + */ +@JsonPropertyOrder({ + ModelsBulkUpdateFilterRequest.JSON_PROPERTY_BODY, + ModelsBulkUpdateFilterRequest.JSON_PROPERTY_ENABLED_AT, + ModelsBulkUpdateFilterRequest.JSON_PROPERTY_EVENT_TYPE, + ModelsBulkUpdateFilterRequest.JSON_PROPERTY_HEADERS, + ModelsBulkUpdateFilterRequest.JSON_PROPERTY_PATH, + ModelsBulkUpdateFilterRequest.JSON_PROPERTY_QUERY, + ModelsBulkUpdateFilterRequest.JSON_PROPERTY_UID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsBulkUpdateFilterRequest { + public static final String JSON_PROPERTY_BODY = "body"; + @jakarta.annotation.Nullable + private Map body = new HashMap<>(); + + public static final String JSON_PROPERTY_ENABLED_AT = "enabled_at"; + @jakarta.annotation.Nullable + private ModelsOptionalTime enabledAt; + + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @jakarta.annotation.Nullable + private String eventType; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + @jakarta.annotation.Nullable + private Map headers = new HashMap<>(); + + public static final String JSON_PROPERTY_PATH = "path"; + @jakarta.annotation.Nullable + private Map path = new HashMap<>(); + + public static final String JSON_PROPERTY_QUERY = "query"; + @jakarta.annotation.Nullable + private Map query = new HashMap<>(); + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nonnull + private String uid; + + public ModelsBulkUpdateFilterRequest() { + } + + public ModelsBulkUpdateFilterRequest body(@jakarta.annotation.Nullable Map body) { + this.body = body; + return this; + } + + public ModelsBulkUpdateFilterRequest putBodyItem(String key, Object bodyItem) { + if (this.body == null) { + this.body = new HashMap<>(); + } + this.body.put(key, bodyItem); + return this; + } + + /** + * Get body + * @return body + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getBody() { + return body; + } + + + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setBody(@jakarta.annotation.Nullable Map body) { + this.body = body; + } + + + public ModelsBulkUpdateFilterRequest enabledAt(@jakarta.annotation.Nullable ModelsOptionalTime enabledAt) { + this.enabledAt = enabledAt; + return this; + } + + /** + * Get enabledAt + * @return enabledAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENABLED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsOptionalTime getEnabledAt() { + return enabledAt; + } + + + @JsonProperty(value = JSON_PROPERTY_ENABLED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabledAt(@jakarta.annotation.Nullable ModelsOptionalTime enabledAt) { + this.enabledAt = enabledAt; + } + + + public ModelsBulkUpdateFilterRequest eventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get eventType + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventType() { + return eventType; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + } + + + public ModelsBulkUpdateFilterRequest headers(@jakarta.annotation.Nullable Map headers) { + this.headers = headers; + return this; + } + + public ModelsBulkUpdateFilterRequest putHeadersItem(String key, Object headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * Get headers + * @return headers + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getHeaders() { + return headers; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(@jakarta.annotation.Nullable Map headers) { + this.headers = headers; + } + + + public ModelsBulkUpdateFilterRequest path(@jakarta.annotation.Nullable Map path) { + this.path = path; + return this; + } + + public ModelsBulkUpdateFilterRequest putPathItem(String key, Object pathItem) { + if (this.path == null) { + this.path = new HashMap<>(); + } + this.path.put(key, pathItem); + return this; + } + + /** + * Get path + * @return path + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PATH, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getPath() { + return path; + } + + + @JsonProperty(value = JSON_PROPERTY_PATH, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@jakarta.annotation.Nullable Map path) { + this.path = path; + } + + + public ModelsBulkUpdateFilterRequest query(@jakarta.annotation.Nullable Map query) { + this.query = query; + return this; + } + + public ModelsBulkUpdateFilterRequest putQueryItem(String key, Object queryItem) { + if (this.query == null) { + this.query = new HashMap<>(); + } + this.query.put(key, queryItem); + return this; + } + + /** + * Get query + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getQuery() { + return query; + } + + + @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setQuery(@jakarta.annotation.Nullable Map query) { + this.query = query; + } + + + public ModelsBulkUpdateFilterRequest uid(@jakarta.annotation.Nonnull String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_UID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUid(@jakarta.annotation.Nonnull String uid) { + this.uid = uid; + } + + + /** + * Return true if this models.BulkUpdateFilterRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsBulkUpdateFilterRequest modelsBulkUpdateFilterRequest = (ModelsBulkUpdateFilterRequest) o; + return Objects.equals(this.body, modelsBulkUpdateFilterRequest.body) && + Objects.equals(this.enabledAt, modelsBulkUpdateFilterRequest.enabledAt) && + Objects.equals(this.eventType, modelsBulkUpdateFilterRequest.eventType) && + Objects.equals(this.headers, modelsBulkUpdateFilterRequest.headers) && + Objects.equals(this.path, modelsBulkUpdateFilterRequest.path) && + Objects.equals(this.query, modelsBulkUpdateFilterRequest.query) && + Objects.equals(this.uid, modelsBulkUpdateFilterRequest.uid); + } + + @Override + public int hashCode() { + return Objects.hash(body, enabledAt, eventType, headers, path, query, uid); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsBulkUpdateFilterRequest {\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" enabledAt: ").append(toIndentedString(enabledAt)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `body` to the URL query string + if (getBody() != null) { + for (String _key : getBody().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbody%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getBody().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBody().get(_key))))); + } + } + + // add `enabled_at` to the URL query string + if (getEnabledAt() != null) { + joiner.add(getEnabledAt().toUrlQueryString(prefix + "enabled_at" + suffix)); + } + + // add `event_type` to the URL query string + if (getEventType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventType())))); + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (String _key : getHeaders().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getHeaders().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getHeaders().get(_key))))); + } + } + + // add `path` to the URL query string + if (getPath() != null) { + for (String _key : getPath().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%spath%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getPath().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getPath().get(_key))))); + } + } + + // add `query` to the URL query string + if (getQuery() != null) { + for (String _key : getQuery().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%squery%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getQuery().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getQuery().get(_key))))); + } + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsCountResponse.java b/src/main/java/com/getconvoy/models/ModelsCountResponse.java new file mode 100644 index 0000000..44656bf --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsCountResponse.java @@ -0,0 +1,148 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsCountResponse + */ +@JsonPropertyOrder({ + ModelsCountResponse.JSON_PROPERTY_NUM +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsCountResponse { + public static final String JSON_PROPERTY_NUM = "num"; + @jakarta.annotation.Nullable + private Integer num; + + public ModelsCountResponse() { + } + + public ModelsCountResponse num(@jakarta.annotation.Nullable Integer num) { + this.num = num; + return this; + } + + /** + * Get num + * @return num + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NUM, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNum() { + return num; + } + + + @JsonProperty(value = JSON_PROPERTY_NUM, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNum(@jakarta.annotation.Nullable Integer num) { + this.num = num; + } + + + /** + * Return true if this models.CountResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsCountResponse modelsCountResponse = (ModelsCountResponse) o; + return Objects.equals(this.num, modelsCountResponse.num); + } + + @Override + public int hashCode() { + return Objects.hash(num); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsCountResponse {\n"); + sb.append(" num: ").append(toIndentedString(num)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `num` to the URL query string + if (getNum() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%snum%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNum())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsCreateEndpoint.java b/src/main/java/com/getconvoy/models/ModelsCreateEndpoint.java new file mode 100644 index 0000000..4bf5747 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsCreateEndpoint.java @@ -0,0 +1,690 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsEndpointAuthentication; +import com.getconvoy.models.ModelsMtlsClientCert; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsCreateEndpoint + */ +@JsonPropertyOrder({ + ModelsCreateEndpoint.JSON_PROPERTY_ADVANCED_SIGNATURES, + ModelsCreateEndpoint.JSON_PROPERTY_APP_I_D, + ModelsCreateEndpoint.JSON_PROPERTY_AUTHENTICATION, + ModelsCreateEndpoint.JSON_PROPERTY_CONTENT_TYPE, + ModelsCreateEndpoint.JSON_PROPERTY_DESCRIPTION, + ModelsCreateEndpoint.JSON_PROPERTY_HTTP_TIMEOUT, + ModelsCreateEndpoint.JSON_PROPERTY_IS_DISABLED, + ModelsCreateEndpoint.JSON_PROPERTY_MTLS_CLIENT_CERT, + ModelsCreateEndpoint.JSON_PROPERTY_NAME, + ModelsCreateEndpoint.JSON_PROPERTY_OWNER_ID, + ModelsCreateEndpoint.JSON_PROPERTY_RATE_LIMIT, + ModelsCreateEndpoint.JSON_PROPERTY_RATE_LIMIT_DURATION, + ModelsCreateEndpoint.JSON_PROPERTY_SECRET, + ModelsCreateEndpoint.JSON_PROPERTY_SLACK_WEBHOOK_URL, + ModelsCreateEndpoint.JSON_PROPERTY_SUPPORT_EMAIL, + ModelsCreateEndpoint.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsCreateEndpoint { + public static final String JSON_PROPERTY_ADVANCED_SIGNATURES = "advanced_signatures"; + @jakarta.annotation.Nullable + private Boolean advancedSignatures; + + public static final String JSON_PROPERTY_APP_I_D = "appID"; + @jakarta.annotation.Nullable + private String appID; + + public static final String JSON_PROPERTY_AUTHENTICATION = "authentication"; + @jakarta.annotation.Nullable + private ModelsEndpointAuthentication authentication; + + public static final String JSON_PROPERTY_CONTENT_TYPE = "content_type"; + @jakarta.annotation.Nullable + private String contentType; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + @jakarta.annotation.Nullable + private String description; + + public static final String JSON_PROPERTY_HTTP_TIMEOUT = "http_timeout"; + @jakarta.annotation.Nullable + private Integer httpTimeout; + + public static final String JSON_PROPERTY_IS_DISABLED = "is_disabled"; + @jakarta.annotation.Nullable + private Boolean isDisabled; + + public static final String JSON_PROPERTY_MTLS_CLIENT_CERT = "mtls_client_cert"; + @jakarta.annotation.Nullable + private ModelsMtlsClientCert mtlsClientCert; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_OWNER_ID = "owner_id"; + @jakarta.annotation.Nullable + private String ownerId; + + public static final String JSON_PROPERTY_RATE_LIMIT = "rate_limit"; + @jakarta.annotation.Nullable + private Integer rateLimit; + + public static final String JSON_PROPERTY_RATE_LIMIT_DURATION = "rate_limit_duration"; + @jakarta.annotation.Nullable + private Integer rateLimitDuration; + + public static final String JSON_PROPERTY_SECRET = "secret"; + @jakarta.annotation.Nullable + private String secret; + + public static final String JSON_PROPERTY_SLACK_WEBHOOK_URL = "slack_webhook_url"; + @jakarta.annotation.Nullable + private String slackWebhookUrl; + + public static final String JSON_PROPERTY_SUPPORT_EMAIL = "support_email"; + @jakarta.annotation.Nullable + private String supportEmail; + + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nullable + private String url; + + public ModelsCreateEndpoint() { + } + + public ModelsCreateEndpoint advancedSignatures(@jakarta.annotation.Nullable Boolean advancedSignatures) { + this.advancedSignatures = advancedSignatures; + return this; + } + + /** + * Convoy supports two [signature formats](https://getconvoy.io/docs/product-manual/signatures) -- simple or advanced. If left unspecified, we default to false. + * @return advancedSignatures + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ADVANCED_SIGNATURES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAdvancedSignatures() { + return advancedSignatures; + } + + + @JsonProperty(value = JSON_PROPERTY_ADVANCED_SIGNATURES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdvancedSignatures(@jakarta.annotation.Nullable Boolean advancedSignatures) { + this.advancedSignatures = advancedSignatures; + } + + + public ModelsCreateEndpoint appID(@jakarta.annotation.Nullable String appID) { + this.appID = appID; + return this; + } + + /** + * Deprecated but necessary for backward compatibility + * @return appID + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_APP_I_D, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppID() { + return appID; + } + + + @JsonProperty(value = JSON_PROPERTY_APP_I_D, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppID(@jakarta.annotation.Nullable String appID) { + this.appID = appID; + } + + + public ModelsCreateEndpoint authentication(@jakarta.annotation.Nullable ModelsEndpointAuthentication authentication) { + this.authentication = authentication; + return this; + } + + /** + * This is used to define any custom authentication required by the endpoint. This shouldn't be needed often because webhook endpoints usually should be exposed to the internet. + * @return authentication + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUTHENTICATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsEndpointAuthentication getAuthentication() { + return authentication; + } + + + @JsonProperty(value = JSON_PROPERTY_AUTHENTICATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthentication(@jakarta.annotation.Nullable ModelsEndpointAuthentication authentication) { + this.authentication = authentication; + } + + + public ModelsCreateEndpoint contentType(@jakarta.annotation.Nullable String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Content type for the endpoint. Defaults to application/json if not specified. + * @return contentType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONTENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContentType() { + return contentType; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentType(@jakarta.annotation.Nullable String contentType) { + this.contentType = contentType; + } + + + public ModelsCreateEndpoint description(@jakarta.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Human-readable description of the endpoint. Think of this as metadata describing the endpoint + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@jakarta.annotation.Nullable String description) { + this.description = description; + } + + + public ModelsCreateEndpoint httpTimeout(@jakarta.annotation.Nullable Integer httpTimeout) { + this.httpTimeout = httpTimeout; + return this; + } + + /** + * Define endpoint http timeout in seconds. + * @return httpTimeout + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HTTP_TIMEOUT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHttpTimeout() { + return httpTimeout; + } + + + @JsonProperty(value = JSON_PROPERTY_HTTP_TIMEOUT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHttpTimeout(@jakarta.annotation.Nullable Integer httpTimeout) { + this.httpTimeout = httpTimeout; + } + + + public ModelsCreateEndpoint isDisabled(@jakarta.annotation.Nullable Boolean isDisabled) { + this.isDisabled = isDisabled; + return this; + } + + /** + * This is used to manually enable/disable the endpoint. + * @return isDisabled + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IS_DISABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsDisabled() { + return isDisabled; + } + + + @JsonProperty(value = JSON_PROPERTY_IS_DISABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDisabled(@jakarta.annotation.Nullable Boolean isDisabled) { + this.isDisabled = isDisabled; + } + + + public ModelsCreateEndpoint mtlsClientCert(@jakarta.annotation.Nullable ModelsMtlsClientCert mtlsClientCert) { + this.mtlsClientCert = mtlsClientCert; + return this; + } + + /** + * mTLS client certificate configuration for the endpoint + * @return mtlsClientCert + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MTLS_CLIENT_CERT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsMtlsClientCert getMtlsClientCert() { + return mtlsClientCert; + } + + + @JsonProperty(value = JSON_PROPERTY_MTLS_CLIENT_CERT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMtlsClientCert(@jakarta.annotation.Nullable ModelsMtlsClientCert mtlsClientCert) { + this.mtlsClientCert = mtlsClientCert; + } + + + public ModelsCreateEndpoint name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Endpoint name. + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public ModelsCreateEndpoint ownerId(@jakarta.annotation.Nullable String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * The OwnerID is used to group more than one endpoint together to achieve [fanout](https://getconvoy.io/docs/manual/endpoints#Endpoint%20Owner%20ID) + * @return ownerId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OWNER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOwnerId() { + return ownerId; + } + + + @JsonProperty(value = JSON_PROPERTY_OWNER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOwnerId(@jakarta.annotation.Nullable String ownerId) { + this.ownerId = ownerId; + } + + + public ModelsCreateEndpoint rateLimit(@jakarta.annotation.Nullable Integer rateLimit) { + this.rateLimit = rateLimit; + return this; + } + + /** + * Rate limit is the total number of requests to be sent to an endpoint in the time duration specified in RateLimitDuration + * @return rateLimit + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRateLimit() { + return rateLimit; + } + + + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRateLimit(@jakarta.annotation.Nullable Integer rateLimit) { + this.rateLimit = rateLimit; + } + + + public ModelsCreateEndpoint rateLimitDuration(@jakarta.annotation.Nullable Integer rateLimitDuration) { + this.rateLimitDuration = rateLimitDuration; + return this; + } + + /** + * Rate limit duration specifies the time range for the rate limit. + * @return rateLimitDuration + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRateLimitDuration() { + return rateLimitDuration; + } + + + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRateLimitDuration(@jakarta.annotation.Nullable Integer rateLimitDuration) { + this.rateLimitDuration = rateLimitDuration; + } + + + public ModelsCreateEndpoint secret(@jakarta.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * Endpoint's webhook secret. If not provided, Convoy autogenerates one for the endpoint. + * @return secret + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecret() { + return secret; + } + + + @JsonProperty(value = JSON_PROPERTY_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(@jakarta.annotation.Nullable String secret) { + this.secret = secret; + } + + + public ModelsCreateEndpoint slackWebhookUrl(@jakarta.annotation.Nullable String slackWebhookUrl) { + this.slackWebhookUrl = slackWebhookUrl; + return this; + } + + /** + * Slack webhook URL is an alternative method to support email where endpoint developers can receive failure notifications on a slack channel. + * @return slackWebhookUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SLACK_WEBHOOK_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSlackWebhookUrl() { + return slackWebhookUrl; + } + + + @JsonProperty(value = JSON_PROPERTY_SLACK_WEBHOOK_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSlackWebhookUrl(@jakarta.annotation.Nullable String slackWebhookUrl) { + this.slackWebhookUrl = slackWebhookUrl; + } + + + public ModelsCreateEndpoint supportEmail(@jakarta.annotation.Nullable String supportEmail) { + this.supportEmail = supportEmail; + return this; + } + + /** + * Endpoint developers support email. This is used for communicating endpoint state changes. You should always turn this on when disabling endpoints are enabled. + * @return supportEmail + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SUPPORT_EMAIL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSupportEmail() { + return supportEmail; + } + + + @JsonProperty(value = JSON_PROPERTY_SUPPORT_EMAIL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportEmail(@jakarta.annotation.Nullable String supportEmail) { + this.supportEmail = supportEmail; + } + + + public ModelsCreateEndpoint url(@jakarta.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * URL is the endpoint's URL prefixed with https. non-https urls are currently not supported. + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = url; + } + + + /** + * Return true if this models.CreateEndpoint object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsCreateEndpoint modelsCreateEndpoint = (ModelsCreateEndpoint) o; + return Objects.equals(this.advancedSignatures, modelsCreateEndpoint.advancedSignatures) && + Objects.equals(this.appID, modelsCreateEndpoint.appID) && + Objects.equals(this.authentication, modelsCreateEndpoint.authentication) && + Objects.equals(this.contentType, modelsCreateEndpoint.contentType) && + Objects.equals(this.description, modelsCreateEndpoint.description) && + Objects.equals(this.httpTimeout, modelsCreateEndpoint.httpTimeout) && + Objects.equals(this.isDisabled, modelsCreateEndpoint.isDisabled) && + Objects.equals(this.mtlsClientCert, modelsCreateEndpoint.mtlsClientCert) && + Objects.equals(this.name, modelsCreateEndpoint.name) && + Objects.equals(this.ownerId, modelsCreateEndpoint.ownerId) && + Objects.equals(this.rateLimit, modelsCreateEndpoint.rateLimit) && + Objects.equals(this.rateLimitDuration, modelsCreateEndpoint.rateLimitDuration) && + Objects.equals(this.secret, modelsCreateEndpoint.secret) && + Objects.equals(this.slackWebhookUrl, modelsCreateEndpoint.slackWebhookUrl) && + Objects.equals(this.supportEmail, modelsCreateEndpoint.supportEmail) && + Objects.equals(this.url, modelsCreateEndpoint.url); + } + + @Override + public int hashCode() { + return Objects.hash(advancedSignatures, appID, authentication, contentType, description, httpTimeout, isDisabled, mtlsClientCert, name, ownerId, rateLimit, rateLimitDuration, secret, slackWebhookUrl, supportEmail, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsCreateEndpoint {\n"); + sb.append(" advancedSignatures: ").append(toIndentedString(advancedSignatures)).append("\n"); + sb.append(" appID: ").append(toIndentedString(appID)).append("\n"); + sb.append(" authentication: ").append(toIndentedString(authentication)).append("\n"); + sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" httpTimeout: ").append(toIndentedString(httpTimeout)).append("\n"); + sb.append(" isDisabled: ").append(toIndentedString(isDisabled)).append("\n"); + sb.append(" mtlsClientCert: ").append(toIndentedString(mtlsClientCert)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append(" rateLimit: ").append(toIndentedString(rateLimit)).append("\n"); + sb.append(" rateLimitDuration: ").append(toIndentedString(rateLimitDuration)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" slackWebhookUrl: ").append(toIndentedString(slackWebhookUrl)).append("\n"); + sb.append(" supportEmail: ").append(toIndentedString(supportEmail)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `advanced_signatures` to the URL query string + if (getAdvancedSignatures() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sadvanced_signatures%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAdvancedSignatures())))); + } + + // add `appID` to the URL query string + if (getAppID() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sappID%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAppID())))); + } + + // add `authentication` to the URL query string + if (getAuthentication() != null) { + joiner.add(getAuthentication().toUrlQueryString(prefix + "authentication" + suffix)); + } + + // add `content_type` to the URL query string + if (getContentType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scontent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getContentType())))); + } + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdescription%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `http_timeout` to the URL query string + if (getHttpTimeout() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shttp_timeout%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHttpTimeout())))); + } + + // add `is_disabled` to the URL query string + if (getIsDisabled() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sis_disabled%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIsDisabled())))); + } + + // add `mtls_client_cert` to the URL query string + if (getMtlsClientCert() != null) { + joiner.add(getMtlsClientCert().toUrlQueryString(prefix + "mtls_client_cert" + suffix)); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `owner_id` to the URL query string + if (getOwnerId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sowner_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOwnerId())))); + } + + // add `rate_limit` to the URL query string + if (getRateLimit() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%srate_limit%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRateLimit())))); + } + + // add `rate_limit_duration` to the URL query string + if (getRateLimitDuration() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%srate_limit_duration%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRateLimitDuration())))); + } + + // add `secret` to the URL query string + if (getSecret() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssecret%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSecret())))); + } + + // add `slack_webhook_url` to the URL query string + if (getSlackWebhookUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sslack_webhook_url%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSlackWebhookUrl())))); + } + + // add `support_email` to the URL query string + if (getSupportEmail() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssupport_email%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSupportEmail())))); + } + + // add `url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsCreateEvent.java b/src/main/java/com/getconvoy/models/ModelsCreateEvent.java new file mode 100644 index 0000000..6f91582 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsCreateEvent.java @@ -0,0 +1,354 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsCreateEvent + */ +@JsonPropertyOrder({ + ModelsCreateEvent.JSON_PROPERTY_APP_ID, + ModelsCreateEvent.JSON_PROPERTY_CUSTOM_HEADERS, + ModelsCreateEvent.JSON_PROPERTY_DATA, + ModelsCreateEvent.JSON_PROPERTY_ENDPOINT_ID, + ModelsCreateEvent.JSON_PROPERTY_EVENT_TYPE, + ModelsCreateEvent.JSON_PROPERTY_IDEMPOTENCY_KEY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsCreateEvent { + public static final String JSON_PROPERTY_APP_ID = "app_id"; + @jakarta.annotation.Nullable + private String appId; + + public static final String JSON_PROPERTY_CUSTOM_HEADERS = "custom_headers"; + @jakarta.annotation.Nullable + private Map customHeaders = new HashMap<>(); + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private Map data = new HashMap<>(); + + public static final String JSON_PROPERTY_ENDPOINT_ID = "endpoint_id"; + @jakarta.annotation.Nullable + private String endpointId; + + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @jakarta.annotation.Nullable + private String eventType; + + public static final String JSON_PROPERTY_IDEMPOTENCY_KEY = "idempotency_key"; + @jakarta.annotation.Nullable + private String idempotencyKey; + + public ModelsCreateEvent() { + } + + public ModelsCreateEvent appId(@jakarta.annotation.Nullable String appId) { + this.appId = appId; + return this; + } + + /** + * Deprecated but necessary for backward compatibility. + * @return appId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_APP_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppId() { + return appId; + } + + + @JsonProperty(value = JSON_PROPERTY_APP_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppId(@jakarta.annotation.Nullable String appId) { + this.appId = appId; + } + + + public ModelsCreateEvent customHeaders(@jakarta.annotation.Nullable Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + public ModelsCreateEvent putCustomHeadersItem(String key, String customHeadersItem) { + if (this.customHeaders == null) { + this.customHeaders = new HashMap<>(); + } + this.customHeaders.put(key, customHeadersItem); + return this; + } + + /** + * Specifies custom headers you want convoy to add when the event is dispatched to your endpoint + * @return customHeaders + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CUSTOM_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getCustomHeaders() { + return customHeaders; + } + + + @JsonProperty(value = JSON_PROPERTY_CUSTOM_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomHeaders(@jakarta.annotation.Nullable Map customHeaders) { + this.customHeaders = customHeaders; + } + + + public ModelsCreateEvent data(@jakarta.annotation.Nullable Map data) { + this.data = data; + return this; + } + + public ModelsCreateEvent putDataItem(String key, Object dataItem) { + if (this.data == null) { + this.data = new HashMap<>(); + } + this.data.put(key, dataItem); + return this; + } + + /** + * Data is an arbitrary JSON value that gets sent as the body of the webhook to the endpoints + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable Map data) { + this.data = data; + } + + + public ModelsCreateEvent endpointId(@jakarta.annotation.Nullable String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * Specifies the endpoint to send this event to. + * @return endpointId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEndpointId() { + return endpointId; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpointId(@jakarta.annotation.Nullable String endpointId) { + this.endpointId = endpointId; + } + + + public ModelsCreateEvent eventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Event Type is used for filtering and debugging e.g invoice.paid + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventType() { + return eventType; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + } + + + public ModelsCreateEvent idempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + + /** + * Specify a key for event deduplication + * @return idempotencyKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIdempotencyKey() { + return idempotencyKey; + } + + + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + } + + + /** + * Return true if this models.CreateEvent object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsCreateEvent modelsCreateEvent = (ModelsCreateEvent) o; + return Objects.equals(this.appId, modelsCreateEvent.appId) && + Objects.equals(this.customHeaders, modelsCreateEvent.customHeaders) && + Objects.equals(this.data, modelsCreateEvent.data) && + Objects.equals(this.endpointId, modelsCreateEvent.endpointId) && + Objects.equals(this.eventType, modelsCreateEvent.eventType) && + Objects.equals(this.idempotencyKey, modelsCreateEvent.idempotencyKey); + } + + @Override + public int hashCode() { + return Objects.hash(appId, customHeaders, data, endpointId, eventType, idempotencyKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsCreateEvent {\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" customHeaders: ").append(toIndentedString(customHeaders)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" endpointId: ").append(toIndentedString(endpointId)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" idempotencyKey: ").append(toIndentedString(idempotencyKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `app_id` to the URL query string + if (getAppId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sapp_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAppId())))); + } + + // add `custom_headers` to the URL query string + if (getCustomHeaders() != null) { + for (String _key : getCustomHeaders().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%scustom_headers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getCustomHeaders().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getCustomHeaders().get(_key))))); + } + } + + // add `data` to the URL query string + if (getData() != null) { + for (String _key : getData().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdata%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getData().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getData().get(_key))))); + } + } + + // add `endpoint_id` to the URL query string + if (getEndpointId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sendpoint_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEndpointId())))); + } + + // add `event_type` to the URL query string + if (getEventType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventType())))); + } + + // add `idempotency_key` to the URL query string + if (getIdempotencyKey() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sidempotency_key%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIdempotencyKey())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsCreateEventType.java b/src/main/java/com/getconvoy/models/ModelsCreateEventType.java new file mode 100644 index 0000000..00108b3 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsCreateEventType.java @@ -0,0 +1,270 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsCreateEventType + */ +@JsonPropertyOrder({ + ModelsCreateEventType.JSON_PROPERTY_CATEGORY, + ModelsCreateEventType.JSON_PROPERTY_DESCRIPTION, + ModelsCreateEventType.JSON_PROPERTY_JSON_SCHEMA, + ModelsCreateEventType.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsCreateEventType { + public static final String JSON_PROPERTY_CATEGORY = "category"; + @jakarta.annotation.Nullable + private String category; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + @jakarta.annotation.Nullable + private String description; + + public static final String JSON_PROPERTY_JSON_SCHEMA = "json_schema"; + @jakarta.annotation.Nullable + private Map jsonSchema = new HashMap<>(); + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public ModelsCreateEventType() { + } + + public ModelsCreateEventType category(@jakarta.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * Category is a product-specific grouping for the event type + * @return category + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCategory() { + return category; + } + + + @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(@jakarta.annotation.Nullable String category) { + this.category = category; + } + + + public ModelsCreateEventType description(@jakarta.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description is used to describe what the event type does + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@jakarta.annotation.Nullable String description) { + this.description = description; + } + + + public ModelsCreateEventType jsonSchema(@jakarta.annotation.Nullable Map jsonSchema) { + this.jsonSchema = jsonSchema; + return this; + } + + public ModelsCreateEventType putJsonSchemaItem(String key, Object jsonSchemaItem) { + if (this.jsonSchema == null) { + this.jsonSchema = new HashMap<>(); + } + this.jsonSchema.put(key, jsonSchemaItem); + return this; + } + + /** + * JSONSchema is the JSON structure of the event type + * @return jsonSchema + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_JSON_SCHEMA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getJsonSchema() { + return jsonSchema; + } + + + @JsonProperty(value = JSON_PROPERTY_JSON_SCHEMA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setJsonSchema(@jakarta.annotation.Nullable Map jsonSchema) { + this.jsonSchema = jsonSchema; + } + + + public ModelsCreateEventType name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Name is the event type name. E.g., invoice.created + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + /** + * Return true if this models.CreateEventType object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsCreateEventType modelsCreateEventType = (ModelsCreateEventType) o; + return Objects.equals(this.category, modelsCreateEventType.category) && + Objects.equals(this.description, modelsCreateEventType.description) && + Objects.equals(this.jsonSchema, modelsCreateEventType.jsonSchema) && + Objects.equals(this.name, modelsCreateEventType.name); + } + + @Override + public int hashCode() { + return Objects.hash(category, description, jsonSchema, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsCreateEventType {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" jsonSchema: ").append(toIndentedString(jsonSchema)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `category` to the URL query string + if (getCategory() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scategory%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCategory())))); + } + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdescription%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `json_schema` to the URL query string + if (getJsonSchema() != null) { + for (String _key : getJsonSchema().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sjson_schema%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getJsonSchema().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getJsonSchema().get(_key))))); + } + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsCreateFilterRequest.java b/src/main/java/com/getconvoy/models/ModelsCreateFilterRequest.java new file mode 100644 index 0000000..4abaeb2 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsCreateFilterRequest.java @@ -0,0 +1,379 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsOptionalTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsCreateFilterRequest + */ +@JsonPropertyOrder({ + ModelsCreateFilterRequest.JSON_PROPERTY_BODY, + ModelsCreateFilterRequest.JSON_PROPERTY_ENABLED_AT, + ModelsCreateFilterRequest.JSON_PROPERTY_EVENT_TYPE, + ModelsCreateFilterRequest.JSON_PROPERTY_HEADERS, + ModelsCreateFilterRequest.JSON_PROPERTY_PATH, + ModelsCreateFilterRequest.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsCreateFilterRequest { + public static final String JSON_PROPERTY_BODY = "body"; + @jakarta.annotation.Nullable + private Map body; + + public static final String JSON_PROPERTY_ENABLED_AT = "enabled_at"; + @jakarta.annotation.Nullable + private ModelsOptionalTime enabledAt; + + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @jakarta.annotation.Nonnull + private String eventType; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + @jakarta.annotation.Nullable + private Map headers; + + public static final String JSON_PROPERTY_PATH = "path"; + @jakarta.annotation.Nullable + private Map path; + + public static final String JSON_PROPERTY_QUERY = "query"; + @jakarta.annotation.Nullable + private Map query; + + public ModelsCreateFilterRequest() { + } + + public ModelsCreateFilterRequest body(@jakarta.annotation.Nullable Map body) { + this.body = body; + return this; + } + + public ModelsCreateFilterRequest putBodyItem(String key, Object bodyItem) { + if (this.body == null) { + this.body = new HashMap<>(); + } + this.body.put(key, bodyItem); + return this; + } + + /** + * Body matching criteria (optional) + * @return body + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getBody() { + return body; + } + + + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setBody(@jakarta.annotation.Nullable Map body) { + this.body = body; + } + + + public ModelsCreateFilterRequest enabledAt(@jakarta.annotation.Nullable ModelsOptionalTime enabledAt) { + this.enabledAt = enabledAt; + return this; + } + + /** + * Non-null when this filter is active. Defaults to now when omitted. + * @return enabledAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENABLED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsOptionalTime getEnabledAt() { + return enabledAt; + } + + + @JsonProperty(value = JSON_PROPERTY_ENABLED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabledAt(@jakarta.annotation.Nullable ModelsOptionalTime enabledAt) { + this.enabledAt = enabledAt; + } + + + public ModelsCreateFilterRequest eventType(@jakarta.annotation.Nonnull String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Type of event this filter applies to (required) + * @return eventType + */ + @jakarta.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEventType() { + return eventType; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEventType(@jakarta.annotation.Nonnull String eventType) { + this.eventType = eventType; + } + + + public ModelsCreateFilterRequest headers(@jakarta.annotation.Nullable Map headers) { + this.headers = headers; + return this; + } + + public ModelsCreateFilterRequest putHeadersItem(String key, Object headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * Header matching criteria (optional) + * @return headers + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getHeaders() { + return headers; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(@jakarta.annotation.Nullable Map headers) { + this.headers = headers; + } + + + public ModelsCreateFilterRequest path(@jakarta.annotation.Nullable Map path) { + this.path = path; + return this; + } + + public ModelsCreateFilterRequest putPathItem(String key, Object pathItem) { + if (this.path == null) { + this.path = new HashMap<>(); + } + this.path.put(key, pathItem); + return this; + } + + /** + * Path matching criteria (optional) + * @return path + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PATH, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getPath() { + return path; + } + + + @JsonProperty(value = JSON_PROPERTY_PATH, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@jakarta.annotation.Nullable Map path) { + this.path = path; + } + + + public ModelsCreateFilterRequest query(@jakarta.annotation.Nullable Map query) { + this.query = query; + return this; + } + + public ModelsCreateFilterRequest putQueryItem(String key, Object queryItem) { + if (this.query == null) { + this.query = new HashMap<>(); + } + this.query.put(key, queryItem); + return this; + } + + /** + * Query matching criteria (optional) + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getQuery() { + return query; + } + + + @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setQuery(@jakarta.annotation.Nullable Map query) { + this.query = query; + } + + + /** + * Return true if this models.CreateFilterRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsCreateFilterRequest modelsCreateFilterRequest = (ModelsCreateFilterRequest) o; + return Objects.equals(this.body, modelsCreateFilterRequest.body) && + Objects.equals(this.enabledAt, modelsCreateFilterRequest.enabledAt) && + Objects.equals(this.eventType, modelsCreateFilterRequest.eventType) && + Objects.equals(this.headers, modelsCreateFilterRequest.headers) && + Objects.equals(this.path, modelsCreateFilterRequest.path) && + Objects.equals(this.query, modelsCreateFilterRequest.query); + } + + @Override + public int hashCode() { + return Objects.hash(body, enabledAt, eventType, headers, path, query); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsCreateFilterRequest {\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" enabledAt: ").append(toIndentedString(enabledAt)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `body` to the URL query string + if (getBody() != null) { + for (String _key : getBody().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbody%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getBody().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBody().get(_key))))); + } + } + + // add `enabled_at` to the URL query string + if (getEnabledAt() != null) { + joiner.add(getEnabledAt().toUrlQueryString(prefix + "enabled_at" + suffix)); + } + + // add `event_type` to the URL query string + if (getEventType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventType())))); + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (String _key : getHeaders().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getHeaders().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getHeaders().get(_key))))); + } + } + + // add `path` to the URL query string + if (getPath() != null) { + for (String _key : getPath().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%spath%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getPath().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getPath().get(_key))))); + } + } + + // add `query` to the URL query string + if (getQuery() != null) { + for (String _key : getQuery().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%squery%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getQuery().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getQuery().get(_key))))); + } + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsCreateProject.java b/src/main/java/com/getconvoy/models/ModelsCreateProject.java new file mode 100644 index 0000000..1739d05 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsCreateProject.java @@ -0,0 +1,257 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsProjectConfig; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsCreateProject + */ +@JsonPropertyOrder({ + ModelsCreateProject.JSON_PROPERTY_CONFIG, + ModelsCreateProject.JSON_PROPERTY_LOGO_URL, + ModelsCreateProject.JSON_PROPERTY_NAME, + ModelsCreateProject.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsCreateProject { + public static final String JSON_PROPERTY_CONFIG = "config"; + @jakarta.annotation.Nullable + private ModelsProjectConfig config; + + public static final String JSON_PROPERTY_LOGO_URL = "logo_url"; + @jakarta.annotation.Nullable + private String logoUrl; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private String type; + + public ModelsCreateProject() { + } + + public ModelsCreateProject config(@jakarta.annotation.Nullable ModelsProjectConfig config) { + this.config = config; + return this; + } + + /** + * Project Config + * @return config + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsProjectConfig getConfig() { + return config; + } + + + @JsonProperty(value = JSON_PROPERTY_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfig(@jakarta.annotation.Nullable ModelsProjectConfig config) { + this.config = config; + } + + + public ModelsCreateProject logoUrl(@jakarta.annotation.Nullable String logoUrl) { + this.logoUrl = logoUrl; + return this; + } + + /** + * Get logoUrl + * @return logoUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_LOGO_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLogoUrl() { + return logoUrl; + } + + + @JsonProperty(value = JSON_PROPERTY_LOGO_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogoUrl(@jakarta.annotation.Nullable String logoUrl) { + this.logoUrl = logoUrl; + } + + + public ModelsCreateProject name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Project Name + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public ModelsCreateProject type(@jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Project Type, supported values are `outgoing`, `incoming` + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + + /** + * Return true if this models.CreateProject object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsCreateProject modelsCreateProject = (ModelsCreateProject) o; + return Objects.equals(this.config, modelsCreateProject.config) && + Objects.equals(this.logoUrl, modelsCreateProject.logoUrl) && + Objects.equals(this.name, modelsCreateProject.name) && + Objects.equals(this.type, modelsCreateProject.type); + } + + @Override + public int hashCode() { + return Objects.hash(config, logoUrl, name, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsCreateProject {\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `config` to the URL query string + if (getConfig() != null) { + joiner.add(getConfig().toUrlQueryString(prefix + "config" + suffix)); + } + + // add `logo_url` to the URL query string + if (getLogoUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%slogo_url%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLogoUrl())))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsCreateProjectResponse.java b/src/main/java/com/getconvoy/models/ModelsCreateProjectResponse.java new file mode 100644 index 0000000..2b1a74e --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsCreateProjectResponse.java @@ -0,0 +1,215 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreAPIKeyResponse; +import com.getconvoy.models.ModelsProjectResponse; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsCreateProjectResponse + */ +@JsonPropertyOrder({ + ModelsCreateProjectResponse.JSON_PROPERTY_API_KEY, + ModelsCreateProjectResponse.JSON_PROPERTY_PROJECT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsCreateProjectResponse { + public static final String JSON_PROPERTY_API_KEY = "api_key"; + private JsonNullable apiKey = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PROJECT = "project"; + private JsonNullable project = JsonNullable.undefined(); + + public ModelsCreateProjectResponse() { + } + + public ModelsCreateProjectResponse apiKey(@jakarta.annotation.Nullable DatastoreAPIKeyResponse apiKey) { + this.apiKey = JsonNullable.of(apiKey); + return this; + } + + /** + * Get apiKey + * @return apiKey + */ + @jakarta.annotation.Nullable + @JsonIgnore + public DatastoreAPIKeyResponse getApiKey() { + return apiKey.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_API_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getApiKey_JsonNullable() { + return apiKey; + } + + @JsonProperty(JSON_PROPERTY_API_KEY) + public void setApiKey_JsonNullable(JsonNullable apiKey) { + this.apiKey = apiKey; + } + + public void setApiKey(@jakarta.annotation.Nullable DatastoreAPIKeyResponse apiKey) { + this.apiKey = JsonNullable.of(apiKey); + } + + + public ModelsCreateProjectResponse project(@jakarta.annotation.Nullable ModelsProjectResponse project) { + this.project = JsonNullable.of(project); + return this; + } + + /** + * Get project + * @return project + */ + @jakarta.annotation.Nullable + @JsonIgnore + public ModelsProjectResponse getProject() { + return project.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_PROJECT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getProject_JsonNullable() { + return project; + } + + @JsonProperty(JSON_PROPERTY_PROJECT) + public void setProject_JsonNullable(JsonNullable project) { + this.project = project; + } + + public void setProject(@jakarta.annotation.Nullable ModelsProjectResponse project) { + this.project = JsonNullable.of(project); + } + + + /** + * Return true if this models.CreateProjectResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsCreateProjectResponse modelsCreateProjectResponse = (ModelsCreateProjectResponse) o; + return equalsNullable(this.apiKey, modelsCreateProjectResponse.apiKey) && + equalsNullable(this.project, modelsCreateProjectResponse.project); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(apiKey), hashCodeNullable(project)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsCreateProjectResponse {\n"); + sb.append(" apiKey: ").append(toIndentedString(apiKey)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `api_key` to the URL query string + if (getApiKey() != null) { + joiner.add(getApiKey().toUrlQueryString(prefix + "api_key" + suffix)); + } + + // add `project` to the URL query string + if (getProject() != null) { + joiner.add(getProject().toUrlQueryString(prefix + "project" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsCreateSource.java b/src/main/java/com/getconvoy/models/ModelsCreateSource.java new file mode 100644 index 0000000..0e8756c --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsCreateSource.java @@ -0,0 +1,491 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreSourceProvider; +import com.getconvoy.models.DatastoreSourceType; +import com.getconvoy.models.ModelsCustomResponse; +import com.getconvoy.models.ModelsPubSubConfig; +import com.getconvoy.models.ModelsVerifierConfig; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsCreateSource + */ +@JsonPropertyOrder({ + ModelsCreateSource.JSON_PROPERTY_BODY_FUNCTION, + ModelsCreateSource.JSON_PROPERTY_CUSTOM_RESPONSE, + ModelsCreateSource.JSON_PROPERTY_EVENT_TYPE_LOCATION, + ModelsCreateSource.JSON_PROPERTY_HEADER_FUNCTION, + ModelsCreateSource.JSON_PROPERTY_IDEMPOTENCY_KEYS, + ModelsCreateSource.JSON_PROPERTY_NAME, + ModelsCreateSource.JSON_PROPERTY_PROVIDER, + ModelsCreateSource.JSON_PROPERTY_PUB_SUB, + ModelsCreateSource.JSON_PROPERTY_TYPE, + ModelsCreateSource.JSON_PROPERTY_VERIFIER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsCreateSource { + public static final String JSON_PROPERTY_BODY_FUNCTION = "body_function"; + @jakarta.annotation.Nullable + private String bodyFunction; + + public static final String JSON_PROPERTY_CUSTOM_RESPONSE = "custom_response"; + @jakarta.annotation.Nullable + private ModelsCustomResponse customResponse; + + public static final String JSON_PROPERTY_EVENT_TYPE_LOCATION = "event_type_location"; + @jakarta.annotation.Nullable + private String eventTypeLocation; + + public static final String JSON_PROPERTY_HEADER_FUNCTION = "header_function"; + @jakarta.annotation.Nullable + private String headerFunction; + + public static final String JSON_PROPERTY_IDEMPOTENCY_KEYS = "idempotency_keys"; + @jakarta.annotation.Nullable + private List idempotencyKeys = new ArrayList<>(); + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_PROVIDER = "provider"; + @jakarta.annotation.Nullable + private DatastoreSourceProvider provider; + + public static final String JSON_PROPERTY_PUB_SUB = "pub_sub"; + @jakarta.annotation.Nullable + private ModelsPubSubConfig pubSub; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private DatastoreSourceType type; + + public static final String JSON_PROPERTY_VERIFIER = "verifier"; + @jakarta.annotation.Nullable + private ModelsVerifierConfig verifier; + + public ModelsCreateSource() { + } + + public ModelsCreateSource bodyFunction(@jakarta.annotation.Nullable String bodyFunction) { + this.bodyFunction = bodyFunction; + return this; + } + + /** + * Function is a javascript function used to mutate the payload immediately after ingesting an event + * @return bodyFunction + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BODY_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBodyFunction() { + return bodyFunction; + } + + + @JsonProperty(value = JSON_PROPERTY_BODY_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBodyFunction(@jakarta.annotation.Nullable String bodyFunction) { + this.bodyFunction = bodyFunction; + } + + + public ModelsCreateSource customResponse(@jakarta.annotation.Nullable ModelsCustomResponse customResponse) { + this.customResponse = customResponse; + return this; + } + + /** + * Custom response is used to define a custom response for incoming webhooks project sources only. + * @return customResponse + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CUSTOM_RESPONSE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsCustomResponse getCustomResponse() { + return customResponse; + } + + + @JsonProperty(value = JSON_PROPERTY_CUSTOM_RESPONSE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomResponse(@jakarta.annotation.Nullable ModelsCustomResponse customResponse) { + this.customResponse = customResponse; + } + + + public ModelsCreateSource eventTypeLocation(@jakarta.annotation.Nullable String eventTypeLocation) { + this.eventTypeLocation = eventTypeLocation; + return this; + } + + /** + * EventTypeLocation is used to specify where Convoy should read the event type from an incoming webhook request. + * @return eventTypeLocation + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE_LOCATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventTypeLocation() { + return eventTypeLocation; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE_LOCATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventTypeLocation(@jakarta.annotation.Nullable String eventTypeLocation) { + this.eventTypeLocation = eventTypeLocation; + } + + + public ModelsCreateSource headerFunction(@jakarta.annotation.Nullable String headerFunction) { + this.headerFunction = headerFunction; + return this; + } + + /** + * Function is a javascript function used to mutate the headers immediately after ingesting an event + * @return headerFunction + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADER_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHeaderFunction() { + return headerFunction; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADER_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaderFunction(@jakarta.annotation.Nullable String headerFunction) { + this.headerFunction = headerFunction; + } + + + public ModelsCreateSource idempotencyKeys(@jakarta.annotation.Nullable List idempotencyKeys) { + this.idempotencyKeys = idempotencyKeys; + return this; + } + + public ModelsCreateSource addIdempotencyKeysItem(String idempotencyKeysItem) { + if (this.idempotencyKeys == null) { + this.idempotencyKeys = new ArrayList<>(); + } + this.idempotencyKeys.add(idempotencyKeysItem); + return this; + } + + /** + * IdempotencyKeys are used to specify parts of a webhook request to uniquely identify the event in an incoming webhooks project. + * @return idempotencyKeys + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEYS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIdempotencyKeys() { + return idempotencyKeys; + } + + + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEYS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdempotencyKeys(@jakarta.annotation.Nullable List idempotencyKeys) { + this.idempotencyKeys = idempotencyKeys; + } + + + public ModelsCreateSource name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Source name. + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public ModelsCreateSource provider(@jakarta.annotation.Nullable DatastoreSourceProvider provider) { + this.provider = provider; + return this; + } + + /** + * Use this to specify one of our predefined source types. + * @return provider + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROVIDER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreSourceProvider getProvider() { + return provider; + } + + + @JsonProperty(value = JSON_PROPERTY_PROVIDER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProvider(@jakarta.annotation.Nullable DatastoreSourceProvider provider) { + this.provider = provider; + } + + + public ModelsCreateSource pubSub(@jakarta.annotation.Nullable ModelsPubSubConfig pubSub) { + this.pubSub = pubSub; + return this; + } + + /** + * PubSub are used to specify message broker sources for outgoing webhooks projects. + * @return pubSub + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PUB_SUB, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsPubSubConfig getPubSub() { + return pubSub; + } + + + @JsonProperty(value = JSON_PROPERTY_PUB_SUB, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPubSub(@jakarta.annotation.Nullable ModelsPubSubConfig pubSub) { + this.pubSub = pubSub; + } + + + public ModelsCreateSource type(@jakarta.annotation.Nullable DatastoreSourceType type) { + this.type = type; + return this; + } + + /** + * Source Type. + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreSourceType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable DatastoreSourceType type) { + this.type = type; + } + + + public ModelsCreateSource verifier(@jakarta.annotation.Nullable ModelsVerifierConfig verifier) { + this.verifier = verifier; + return this; + } + + /** + * Verifiers are used to verify webhook events ingested in incoming webhooks projects. If set, type is required and match the verifier type object you choose. + * @return verifier + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_VERIFIER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsVerifierConfig getVerifier() { + return verifier; + } + + + @JsonProperty(value = JSON_PROPERTY_VERIFIER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVerifier(@jakarta.annotation.Nullable ModelsVerifierConfig verifier) { + this.verifier = verifier; + } + + + /** + * Return true if this models.CreateSource object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsCreateSource modelsCreateSource = (ModelsCreateSource) o; + return Objects.equals(this.bodyFunction, modelsCreateSource.bodyFunction) && + Objects.equals(this.customResponse, modelsCreateSource.customResponse) && + Objects.equals(this.eventTypeLocation, modelsCreateSource.eventTypeLocation) && + Objects.equals(this.headerFunction, modelsCreateSource.headerFunction) && + Objects.equals(this.idempotencyKeys, modelsCreateSource.idempotencyKeys) && + Objects.equals(this.name, modelsCreateSource.name) && + Objects.equals(this.provider, modelsCreateSource.provider) && + Objects.equals(this.pubSub, modelsCreateSource.pubSub) && + Objects.equals(this.type, modelsCreateSource.type) && + Objects.equals(this.verifier, modelsCreateSource.verifier); + } + + @Override + public int hashCode() { + return Objects.hash(bodyFunction, customResponse, eventTypeLocation, headerFunction, idempotencyKeys, name, provider, pubSub, type, verifier); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsCreateSource {\n"); + sb.append(" bodyFunction: ").append(toIndentedString(bodyFunction)).append("\n"); + sb.append(" customResponse: ").append(toIndentedString(customResponse)).append("\n"); + sb.append(" eventTypeLocation: ").append(toIndentedString(eventTypeLocation)).append("\n"); + sb.append(" headerFunction: ").append(toIndentedString(headerFunction)).append("\n"); + sb.append(" idempotencyKeys: ").append(toIndentedString(idempotencyKeys)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" pubSub: ").append(toIndentedString(pubSub)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" verifier: ").append(toIndentedString(verifier)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `body_function` to the URL query string + if (getBodyFunction() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbody_function%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBodyFunction())))); + } + + // add `custom_response` to the URL query string + if (getCustomResponse() != null) { + joiner.add(getCustomResponse().toUrlQueryString(prefix + "custom_response" + suffix)); + } + + // add `event_type_location` to the URL query string + if (getEventTypeLocation() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type_location%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventTypeLocation())))); + } + + // add `header_function` to the URL query string + if (getHeaderFunction() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheader_function%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHeaderFunction())))); + } + + // add `idempotency_keys` to the URL query string + if (getIdempotencyKeys() != null) { + for (int i = 0; i < getIdempotencyKeys().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sidempotency_keys%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getIdempotencyKeys().get(i))))); + } + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `provider` to the URL query string + if (getProvider() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sprovider%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProvider())))); + } + + // add `pub_sub` to the URL query string + if (getPubSub() != null) { + joiner.add(getPubSub().toUrlQueryString(prefix + "pub_sub" + suffix)); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `verifier` to the URL query string + if (getVerifier() != null) { + joiner.add(getVerifier().toUrlQueryString(prefix + "verifier" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsCreateSubscription.java b/src/main/java/com/getconvoy/models/ModelsCreateSubscription.java new file mode 100644 index 0000000..4ea0449 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsCreateSubscription.java @@ -0,0 +1,440 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreDeliveryMode; +import com.getconvoy.models.ModelsAlertConfiguration; +import com.getconvoy.models.ModelsFilterConfiguration; +import com.getconvoy.models.ModelsRateLimitConfiguration; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsCreateSubscription + */ +@JsonPropertyOrder({ + ModelsCreateSubscription.JSON_PROPERTY_ALERT_CONFIG, + ModelsCreateSubscription.JSON_PROPERTY_APP_ID, + ModelsCreateSubscription.JSON_PROPERTY_DELIVERY_MODE, + ModelsCreateSubscription.JSON_PROPERTY_ENDPOINT_ID, + ModelsCreateSubscription.JSON_PROPERTY_FILTER_CONFIG, + ModelsCreateSubscription.JSON_PROPERTY_FUNCTION, + ModelsCreateSubscription.JSON_PROPERTY_NAME, + ModelsCreateSubscription.JSON_PROPERTY_RATE_LIMIT_CONFIG, + ModelsCreateSubscription.JSON_PROPERTY_SOURCE_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsCreateSubscription { + public static final String JSON_PROPERTY_ALERT_CONFIG = "alert_config"; + @jakarta.annotation.Nullable + private ModelsAlertConfiguration alertConfig; + + public static final String JSON_PROPERTY_APP_ID = "app_id"; + @jakarta.annotation.Nullable + private String appId; + + public static final String JSON_PROPERTY_DELIVERY_MODE = "delivery_mode"; + @jakarta.annotation.Nullable + private DatastoreDeliveryMode deliveryMode; + + public static final String JSON_PROPERTY_ENDPOINT_ID = "endpoint_id"; + @jakarta.annotation.Nullable + private String endpointId; + + public static final String JSON_PROPERTY_FILTER_CONFIG = "filter_config"; + @jakarta.annotation.Nullable + private ModelsFilterConfiguration filterConfig; + + public static final String JSON_PROPERTY_FUNCTION = "function"; + @jakarta.annotation.Nullable + private String function; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_RATE_LIMIT_CONFIG = "rate_limit_config"; + @jakarta.annotation.Nullable + private ModelsRateLimitConfiguration rateLimitConfig; + + public static final String JSON_PROPERTY_SOURCE_ID = "source_id"; + @jakarta.annotation.Nullable + private String sourceId; + + public ModelsCreateSubscription() { + } + + public ModelsCreateSubscription alertConfig(@jakarta.annotation.Nullable ModelsAlertConfiguration alertConfig) { + this.alertConfig = alertConfig; + return this; + } + + /** + * Alert configuration + * @return alertConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ALERT_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsAlertConfiguration getAlertConfig() { + return alertConfig; + } + + + @JsonProperty(value = JSON_PROPERTY_ALERT_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlertConfig(@jakarta.annotation.Nullable ModelsAlertConfiguration alertConfig) { + this.alertConfig = alertConfig; + } + + + public ModelsCreateSubscription appId(@jakarta.annotation.Nullable String appId) { + this.appId = appId; + return this; + } + + /** + * Deprecated but necessary for backward compatibility + * @return appId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_APP_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppId() { + return appId; + } + + + @JsonProperty(value = JSON_PROPERTY_APP_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppId(@jakarta.annotation.Nullable String appId) { + this.appId = appId; + } + + + public ModelsCreateSubscription deliveryMode(@jakarta.annotation.Nullable DatastoreDeliveryMode deliveryMode) { + this.deliveryMode = deliveryMode; + return this; + } + + /** + * Delivery mode configuration + * @return deliveryMode + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELIVERY_MODE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreDeliveryMode getDeliveryMode() { + return deliveryMode; + } + + + @JsonProperty(value = JSON_PROPERTY_DELIVERY_MODE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeliveryMode(@jakarta.annotation.Nullable DatastoreDeliveryMode deliveryMode) { + this.deliveryMode = deliveryMode; + } + + + public ModelsCreateSubscription endpointId(@jakarta.annotation.Nullable String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * Destination endpoint ID + * @return endpointId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEndpointId() { + return endpointId; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpointId(@jakarta.annotation.Nullable String endpointId) { + this.endpointId = endpointId; + } + + + public ModelsCreateSubscription filterConfig(@jakarta.annotation.Nullable ModelsFilterConfiguration filterConfig) { + this.filterConfig = filterConfig; + return this; + } + + /** + * Filter configuration + * @return filterConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FILTER_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsFilterConfiguration getFilterConfig() { + return filterConfig; + } + + + @JsonProperty(value = JSON_PROPERTY_FILTER_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilterConfig(@jakarta.annotation.Nullable ModelsFilterConfiguration filterConfig) { + this.filterConfig = filterConfig; + } + + + public ModelsCreateSubscription function(@jakarta.annotation.Nullable String function) { + this.function = function; + return this; + } + + /** + * Convoy supports mutating your request payload using a js function. Use this field to specify a `transform` function for this purpose. See this[https://docs.getconvoy.io/product-manual/subscriptions#functions] for more + * @return function + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFunction() { + return function; + } + + + @JsonProperty(value = JSON_PROPERTY_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFunction(@jakarta.annotation.Nullable String function) { + this.function = function; + } + + + public ModelsCreateSubscription name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Subscription Nme + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public ModelsCreateSubscription rateLimitConfig(@jakarta.annotation.Nullable ModelsRateLimitConfiguration rateLimitConfig) { + this.rateLimitConfig = rateLimitConfig; + return this; + } + + /** + * Rate limit configuration + * @return rateLimitConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsRateLimitConfiguration getRateLimitConfig() { + return rateLimitConfig; + } + + + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRateLimitConfig(@jakarta.annotation.Nullable ModelsRateLimitConfiguration rateLimitConfig) { + this.rateLimitConfig = rateLimitConfig; + } + + + public ModelsCreateSubscription sourceId(@jakarta.annotation.Nullable String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Source Id + * @return sourceId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SOURCE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceId() { + return sourceId; + } + + + @JsonProperty(value = JSON_PROPERTY_SOURCE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceId(@jakarta.annotation.Nullable String sourceId) { + this.sourceId = sourceId; + } + + + /** + * Return true if this models.CreateSubscription object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsCreateSubscription modelsCreateSubscription = (ModelsCreateSubscription) o; + return Objects.equals(this.alertConfig, modelsCreateSubscription.alertConfig) && + Objects.equals(this.appId, modelsCreateSubscription.appId) && + Objects.equals(this.deliveryMode, modelsCreateSubscription.deliveryMode) && + Objects.equals(this.endpointId, modelsCreateSubscription.endpointId) && + Objects.equals(this.filterConfig, modelsCreateSubscription.filterConfig) && + Objects.equals(this.function, modelsCreateSubscription.function) && + Objects.equals(this.name, modelsCreateSubscription.name) && + Objects.equals(this.rateLimitConfig, modelsCreateSubscription.rateLimitConfig) && + Objects.equals(this.sourceId, modelsCreateSubscription.sourceId); + } + + @Override + public int hashCode() { + return Objects.hash(alertConfig, appId, deliveryMode, endpointId, filterConfig, function, name, rateLimitConfig, sourceId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsCreateSubscription {\n"); + sb.append(" alertConfig: ").append(toIndentedString(alertConfig)).append("\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" deliveryMode: ").append(toIndentedString(deliveryMode)).append("\n"); + sb.append(" endpointId: ").append(toIndentedString(endpointId)).append("\n"); + sb.append(" filterConfig: ").append(toIndentedString(filterConfig)).append("\n"); + sb.append(" function: ").append(toIndentedString(function)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" rateLimitConfig: ").append(toIndentedString(rateLimitConfig)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `alert_config` to the URL query string + if (getAlertConfig() != null) { + joiner.add(getAlertConfig().toUrlQueryString(prefix + "alert_config" + suffix)); + } + + // add `app_id` to the URL query string + if (getAppId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sapp_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAppId())))); + } + + // add `delivery_mode` to the URL query string + if (getDeliveryMode() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdelivery_mode%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeliveryMode())))); + } + + // add `endpoint_id` to the URL query string + if (getEndpointId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sendpoint_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEndpointId())))); + } + + // add `filter_config` to the URL query string + if (getFilterConfig() != null) { + joiner.add(getFilterConfig().toUrlQueryString(prefix + "filter_config" + suffix)); + } + + // add `function` to the URL query string + if (getFunction() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sfunction%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFunction())))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `rate_limit_config` to the URL query string + if (getRateLimitConfig() != null) { + joiner.add(getRateLimitConfig().toUrlQueryString(prefix + "rate_limit_config" + suffix)); + } + + // add `source_id` to the URL query string + if (getSourceId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssource_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSourceId())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsCustomResponse.java b/src/main/java/com/getconvoy/models/ModelsCustomResponse.java new file mode 100644 index 0000000..1d2fe4c --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsCustomResponse.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsCustomResponse + */ +@JsonPropertyOrder({ + ModelsCustomResponse.JSON_PROPERTY_BODY, + ModelsCustomResponse.JSON_PROPERTY_CONTENT_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsCustomResponse { + public static final String JSON_PROPERTY_BODY = "body"; + @jakarta.annotation.Nullable + private String body; + + public static final String JSON_PROPERTY_CONTENT_TYPE = "content_type"; + @jakarta.annotation.Nullable + private String contentType; + + public ModelsCustomResponse() { + } + + public ModelsCustomResponse body(@jakarta.annotation.Nullable String body) { + this.body = body; + return this; + } + + /** + * Get body + * @return body + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBody() { + return body; + } + + + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBody(@jakarta.annotation.Nullable String body) { + this.body = body; + } + + + public ModelsCustomResponse contentType(@jakarta.annotation.Nullable String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get contentType + * @return contentType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONTENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContentType() { + return contentType; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentType(@jakarta.annotation.Nullable String contentType) { + this.contentType = contentType; + } + + + /** + * Return true if this models.CustomResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsCustomResponse modelsCustomResponse = (ModelsCustomResponse) o; + return Objects.equals(this.body, modelsCustomResponse.body) && + Objects.equals(this.contentType, modelsCustomResponse.contentType); + } + + @Override + public int hashCode() { + return Objects.hash(body, contentType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsCustomResponse {\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `body` to the URL query string + if (getBody() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbody%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBody())))); + } + + // add `content_type` to the URL query string + if (getContentType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scontent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getContentType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsDynamicEvent.java b/src/main/java/com/getconvoy/models/ModelsDynamicEvent.java new file mode 100644 index 0000000..c6d8dd0 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsDynamicEvent.java @@ -0,0 +1,404 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsDynamicEvent + */ +@JsonPropertyOrder({ + ModelsDynamicEvent.JSON_PROPERTY_CUSTOM_HEADERS, + ModelsDynamicEvent.JSON_PROPERTY_DATA, + ModelsDynamicEvent.JSON_PROPERTY_EVENT_TYPE, + ModelsDynamicEvent.JSON_PROPERTY_EVENT_TYPES, + ModelsDynamicEvent.JSON_PROPERTY_IDEMPOTENCY_KEY, + ModelsDynamicEvent.JSON_PROPERTY_SECRET, + ModelsDynamicEvent.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsDynamicEvent { + public static final String JSON_PROPERTY_CUSTOM_HEADERS = "custom_headers"; + @jakarta.annotation.Nullable + private Map customHeaders = new HashMap<>(); + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private Map data = new HashMap<>(); + + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @jakarta.annotation.Nullable + private String eventType; + + public static final String JSON_PROPERTY_EVENT_TYPES = "event_types"; + @jakarta.annotation.Nullable + private List eventTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_IDEMPOTENCY_KEY = "idempotency_key"; + @jakarta.annotation.Nullable + private String idempotencyKey; + + public static final String JSON_PROPERTY_SECRET = "secret"; + @jakarta.annotation.Nullable + private String secret; + + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nullable + private String url; + + public ModelsDynamicEvent() { + } + + public ModelsDynamicEvent customHeaders(@jakarta.annotation.Nullable Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + public ModelsDynamicEvent putCustomHeadersItem(String key, String customHeadersItem) { + if (this.customHeaders == null) { + this.customHeaders = new HashMap<>(); + } + this.customHeaders.put(key, customHeadersItem); + return this; + } + + /** + * Specifies custom headers you want convoy to add when the event is dispatched to your endpoint + * @return customHeaders + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CUSTOM_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getCustomHeaders() { + return customHeaders; + } + + + @JsonProperty(value = JSON_PROPERTY_CUSTOM_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomHeaders(@jakarta.annotation.Nullable Map customHeaders) { + this.customHeaders = customHeaders; + } + + + public ModelsDynamicEvent data(@jakarta.annotation.Nullable Map data) { + this.data = data; + return this; + } + + public ModelsDynamicEvent putDataItem(String key, Object dataItem) { + if (this.data == null) { + this.data = new HashMap<>(); + } + this.data.put(key, dataItem); + return this; + } + + /** + * Data is an arbitrary JSON value that gets sent as the body of the webhook to the endpoints + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable Map data) { + this.data = data; + } + + + public ModelsDynamicEvent eventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Event Type is used for filtering and debugging e.g invoice.paid + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventType() { + return eventType; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + } + + + public ModelsDynamicEvent eventTypes(@jakarta.annotation.Nullable List eventTypes) { + this.eventTypes = eventTypes; + return this; + } + + public ModelsDynamicEvent addEventTypesItem(String eventTypesItem) { + if (this.eventTypes == null) { + this.eventTypes = new ArrayList<>(); + } + this.eventTypes.add(eventTypesItem); + return this; + } + + /** + * A list of event types for the subscription filter config + * @return eventTypes + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEventTypes() { + return eventTypes; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventTypes(@jakarta.annotation.Nullable List eventTypes) { + this.eventTypes = eventTypes; + } + + + public ModelsDynamicEvent idempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + + /** + * Specify a key for event deduplication + * @return idempotencyKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIdempotencyKey() { + return idempotencyKey; + } + + + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + } + + + public ModelsDynamicEvent secret(@jakarta.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * Endpoint's webhook secret. If not provided, Convoy autogenerates one for the endpoint. + * @return secret + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecret() { + return secret; + } + + + @JsonProperty(value = JSON_PROPERTY_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(@jakarta.annotation.Nullable String secret) { + this.secret = secret; + } + + + public ModelsDynamicEvent url(@jakarta.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * URL is the endpoint's URL prefixed with https. non-https urls are currently not supported. + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = url; + } + + + /** + * Return true if this models.DynamicEvent object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsDynamicEvent modelsDynamicEvent = (ModelsDynamicEvent) o; + return Objects.equals(this.customHeaders, modelsDynamicEvent.customHeaders) && + Objects.equals(this.data, modelsDynamicEvent.data) && + Objects.equals(this.eventType, modelsDynamicEvent.eventType) && + Objects.equals(this.eventTypes, modelsDynamicEvent.eventTypes) && + Objects.equals(this.idempotencyKey, modelsDynamicEvent.idempotencyKey) && + Objects.equals(this.secret, modelsDynamicEvent.secret) && + Objects.equals(this.url, modelsDynamicEvent.url); + } + + @Override + public int hashCode() { + return Objects.hash(customHeaders, data, eventType, eventTypes, idempotencyKey, secret, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsDynamicEvent {\n"); + sb.append(" customHeaders: ").append(toIndentedString(customHeaders)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" eventTypes: ").append(toIndentedString(eventTypes)).append("\n"); + sb.append(" idempotencyKey: ").append(toIndentedString(idempotencyKey)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `custom_headers` to the URL query string + if (getCustomHeaders() != null) { + for (String _key : getCustomHeaders().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%scustom_headers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getCustomHeaders().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getCustomHeaders().get(_key))))); + } + } + + // add `data` to the URL query string + if (getData() != null) { + for (String _key : getData().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdata%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getData().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getData().get(_key))))); + } + } + + // add `event_type` to the URL query string + if (getEventType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventType())))); + } + + // add `event_types` to the URL query string + if (getEventTypes() != null) { + for (int i = 0; i < getEventTypes().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_types%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEventTypes().get(i))))); + } + } + + // add `idempotency_key` to the URL query string + if (getIdempotencyKey() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sidempotency_key%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIdempotencyKey())))); + } + + // add `secret` to the URL query string + if (getSecret() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssecret%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSecret())))); + } + + // add `url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsEndpointAuthentication.java b/src/main/java/com/getconvoy/models/ModelsEndpointAuthentication.java new file mode 100644 index 0000000..e394daa --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsEndpointAuthentication.java @@ -0,0 +1,260 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreEndpointAuthenticationType; +import com.getconvoy.models.ModelsApiKey; +import com.getconvoy.models.ModelsBasicAuth; +import com.getconvoy.models.ModelsOAuth2; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsEndpointAuthentication + */ +@JsonPropertyOrder({ + ModelsEndpointAuthentication.JSON_PROPERTY_API_KEY, + ModelsEndpointAuthentication.JSON_PROPERTY_BASIC_AUTH, + ModelsEndpointAuthentication.JSON_PROPERTY_OAUTH2, + ModelsEndpointAuthentication.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsEndpointAuthentication { + public static final String JSON_PROPERTY_API_KEY = "api_key"; + @jakarta.annotation.Nullable + private ModelsApiKey apiKey; + + public static final String JSON_PROPERTY_BASIC_AUTH = "basic_auth"; + @jakarta.annotation.Nullable + private ModelsBasicAuth basicAuth; + + public static final String JSON_PROPERTY_OAUTH2 = "oauth2"; + @jakarta.annotation.Nullable + private ModelsOAuth2 oauth2; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private DatastoreEndpointAuthenticationType type; + + public ModelsEndpointAuthentication() { + } + + public ModelsEndpointAuthentication apiKey(@jakarta.annotation.Nullable ModelsApiKey apiKey) { + this.apiKey = apiKey; + return this; + } + + /** + * Get apiKey + * @return apiKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_API_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsApiKey getApiKey() { + return apiKey; + } + + + @JsonProperty(value = JSON_PROPERTY_API_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiKey(@jakarta.annotation.Nullable ModelsApiKey apiKey) { + this.apiKey = apiKey; + } + + + public ModelsEndpointAuthentication basicAuth(@jakarta.annotation.Nullable ModelsBasicAuth basicAuth) { + this.basicAuth = basicAuth; + return this; + } + + /** + * Get basicAuth + * @return basicAuth + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BASIC_AUTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsBasicAuth getBasicAuth() { + return basicAuth; + } + + + @JsonProperty(value = JSON_PROPERTY_BASIC_AUTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBasicAuth(@jakarta.annotation.Nullable ModelsBasicAuth basicAuth) { + this.basicAuth = basicAuth; + } + + + public ModelsEndpointAuthentication oauth2(@jakarta.annotation.Nullable ModelsOAuth2 oauth2) { + this.oauth2 = oauth2; + return this; + } + + /** + * Get oauth2 + * @return oauth2 + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OAUTH2, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsOAuth2 getOauth2() { + return oauth2; + } + + + @JsonProperty(value = JSON_PROPERTY_OAUTH2, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOauth2(@jakarta.annotation.Nullable ModelsOAuth2 oauth2) { + this.oauth2 = oauth2; + } + + + public ModelsEndpointAuthentication type(@jakarta.annotation.Nullable DatastoreEndpointAuthenticationType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreEndpointAuthenticationType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable DatastoreEndpointAuthenticationType type) { + this.type = type; + } + + + /** + * Return true if this models.EndpointAuthentication object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsEndpointAuthentication modelsEndpointAuthentication = (ModelsEndpointAuthentication) o; + return Objects.equals(this.apiKey, modelsEndpointAuthentication.apiKey) && + Objects.equals(this.basicAuth, modelsEndpointAuthentication.basicAuth) && + Objects.equals(this.oauth2, modelsEndpointAuthentication.oauth2) && + Objects.equals(this.type, modelsEndpointAuthentication.type); + } + + @Override + public int hashCode() { + return Objects.hash(apiKey, basicAuth, oauth2, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsEndpointAuthentication {\n"); + sb.append(" apiKey: ").append(toIndentedString(apiKey)).append("\n"); + sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n"); + sb.append(" oauth2: ").append(toIndentedString(oauth2)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `api_key` to the URL query string + if (getApiKey() != null) { + joiner.add(getApiKey().toUrlQueryString(prefix + "api_key" + suffix)); + } + + // add `basic_auth` to the URL query string + if (getBasicAuth() != null) { + joiner.add(getBasicAuth().toUrlQueryString(prefix + "basic_auth" + suffix)); + } + + // add `oauth2` to the URL query string + if (getOauth2() != null) { + joiner.add(getOauth2().toUrlQueryString(prefix + "oauth2" + suffix)); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsEndpointResponse.java b/src/main/java/com/getconvoy/models/ModelsEndpointResponse.java new file mode 100644 index 0000000..19c98e3 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsEndpointResponse.java @@ -0,0 +1,1104 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreEndpointAuthentication; +import com.getconvoy.models.DatastoreEndpointStatus; +import com.getconvoy.models.DatastoreMtlsClientCert; +import com.getconvoy.models.DatastoreSecret; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsEndpointResponse + */ +@JsonPropertyOrder({ + ModelsEndpointResponse.JSON_PROPERTY_ADVANCED_SIGNATURES, + ModelsEndpointResponse.JSON_PROPERTY_AUTHENTICATION, + ModelsEndpointResponse.JSON_PROPERTY_CB_STATE, + ModelsEndpointResponse.JSON_PROPERTY_CONTENT_TYPE, + ModelsEndpointResponse.JSON_PROPERTY_CREATED_AT, + ModelsEndpointResponse.JSON_PROPERTY_DELETED_AT, + ModelsEndpointResponse.JSON_PROPERTY_DESCRIPTION, + ModelsEndpointResponse.JSON_PROPERTY_EVENTS, + ModelsEndpointResponse.JSON_PROPERTY_FAILURE_COUNT, + ModelsEndpointResponse.JSON_PROPERTY_FAILURE_RATE, + ModelsEndpointResponse.JSON_PROPERTY_HTTP_TIMEOUT, + ModelsEndpointResponse.JSON_PROPERTY_MTLS_CLIENT_CERT, + ModelsEndpointResponse.JSON_PROPERTY_NAME, + ModelsEndpointResponse.JSON_PROPERTY_OWNER_ID, + ModelsEndpointResponse.JSON_PROPERTY_PERIOD_FAILURE_RATE, + ModelsEndpointResponse.JSON_PROPERTY_PROJECT_ID, + ModelsEndpointResponse.JSON_PROPERTY_RATE_LIMIT, + ModelsEndpointResponse.JSON_PROPERTY_RATE_LIMIT_DURATION, + ModelsEndpointResponse.JSON_PROPERTY_RETRY_COUNT, + ModelsEndpointResponse.JSON_PROPERTY_SECRETS, + ModelsEndpointResponse.JSON_PROPERTY_SLACK_WEBHOOK_URL, + ModelsEndpointResponse.JSON_PROPERTY_STATUS, + ModelsEndpointResponse.JSON_PROPERTY_SUCCESS_COUNT, + ModelsEndpointResponse.JSON_PROPERTY_SUPPORT_EMAIL, + ModelsEndpointResponse.JSON_PROPERTY_UID, + ModelsEndpointResponse.JSON_PROPERTY_UPDATED_AT, + ModelsEndpointResponse.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsEndpointResponse { + public static final String JSON_PROPERTY_ADVANCED_SIGNATURES = "advanced_signatures"; + @jakarta.annotation.Nullable + private Boolean advancedSignatures; + + public static final String JSON_PROPERTY_AUTHENTICATION = "authentication"; + @jakarta.annotation.Nullable + private DatastoreEndpointAuthentication authentication; + + public static final String JSON_PROPERTY_CB_STATE = "cb_state"; + @jakarta.annotation.Nullable + private String cbState; + + public static final String JSON_PROPERTY_CONTENT_TYPE = "content_type"; + @jakarta.annotation.Nullable + private String contentType; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + @jakarta.annotation.Nullable + private String deletedAt; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + @jakarta.annotation.Nullable + private String description; + + public static final String JSON_PROPERTY_EVENTS = "events"; + @jakarta.annotation.Nullable + private Integer events; + + public static final String JSON_PROPERTY_FAILURE_COUNT = "failure_count"; + @jakarta.annotation.Nullable + private Integer failureCount; + + public static final String JSON_PROPERTY_FAILURE_RATE = "failure_rate"; + @jakarta.annotation.Nullable + private BigDecimal failureRate; + + public static final String JSON_PROPERTY_HTTP_TIMEOUT = "http_timeout"; + @jakarta.annotation.Nullable + private Integer httpTimeout; + + public static final String JSON_PROPERTY_MTLS_CLIENT_CERT = "mtls_client_cert"; + @jakarta.annotation.Nullable + private DatastoreMtlsClientCert mtlsClientCert; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_OWNER_ID = "owner_id"; + @jakarta.annotation.Nullable + private String ownerId; + + public static final String JSON_PROPERTY_PERIOD_FAILURE_RATE = "period_failure_rate"; + @jakarta.annotation.Nullable + private BigDecimal periodFailureRate; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + @jakarta.annotation.Nullable + private String projectId; + + public static final String JSON_PROPERTY_RATE_LIMIT = "rate_limit"; + @jakarta.annotation.Nullable + private Integer rateLimit; + + public static final String JSON_PROPERTY_RATE_LIMIT_DURATION = "rate_limit_duration"; + @jakarta.annotation.Nullable + private Integer rateLimitDuration; + + public static final String JSON_PROPERTY_RETRY_COUNT = "retry_count"; + @jakarta.annotation.Nullable + private Integer retryCount; + + public static final String JSON_PROPERTY_SECRETS = "secrets"; + @jakarta.annotation.Nullable + private List secrets = new ArrayList<>(); + + public static final String JSON_PROPERTY_SLACK_WEBHOOK_URL = "slack_webhook_url"; + @jakarta.annotation.Nullable + private String slackWebhookUrl; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private DatastoreEndpointStatus status; + + public static final String JSON_PROPERTY_SUCCESS_COUNT = "success_count"; + @jakarta.annotation.Nullable + private Integer successCount; + + public static final String JSON_PROPERTY_SUPPORT_EMAIL = "support_email"; + @jakarta.annotation.Nullable + private String supportEmail; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + @jakarta.annotation.Nullable + private String updatedAt; + + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nullable + private String url; + + public ModelsEndpointResponse() { + } + + public ModelsEndpointResponse advancedSignatures(@jakarta.annotation.Nullable Boolean advancedSignatures) { + this.advancedSignatures = advancedSignatures; + return this; + } + + /** + * Get advancedSignatures + * @return advancedSignatures + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ADVANCED_SIGNATURES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAdvancedSignatures() { + return advancedSignatures; + } + + + @JsonProperty(value = JSON_PROPERTY_ADVANCED_SIGNATURES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdvancedSignatures(@jakarta.annotation.Nullable Boolean advancedSignatures) { + this.advancedSignatures = advancedSignatures; + } + + + public ModelsEndpointResponse authentication(@jakarta.annotation.Nullable DatastoreEndpointAuthentication authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get authentication + * @return authentication + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUTHENTICATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreEndpointAuthentication getAuthentication() { + return authentication; + } + + + @JsonProperty(value = JSON_PROPERTY_AUTHENTICATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthentication(@jakarta.annotation.Nullable DatastoreEndpointAuthentication authentication) { + this.authentication = authentication; + } + + + public ModelsEndpointResponse cbState(@jakarta.annotation.Nullable String cbState) { + this.cbState = cbState; + return this; + } + + /** + * CBState is the circuit breaker state (\"open\", \"half-open\", \"closed\") so the UI can reflect a tripped breaker on the endpoint status. Nil when CB is off/unlicensed or has no sample for this endpoint. + * @return cbState + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CB_STATE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCbState() { + return cbState; + } + + + @JsonProperty(value = JSON_PROPERTY_CB_STATE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCbState(@jakarta.annotation.Nullable String cbState) { + this.cbState = cbState; + } + + + public ModelsEndpointResponse contentType(@jakarta.annotation.Nullable String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get contentType + * @return contentType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONTENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContentType() { + return contentType; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentType(@jakarta.annotation.Nullable String contentType) { + this.contentType = contentType; + } + + + public ModelsEndpointResponse createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public ModelsEndpointResponse deletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Get deletedAt + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + } + + + public ModelsEndpointResponse description(@jakarta.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@jakarta.annotation.Nullable String description) { + this.description = description; + } + + + public ModelsEndpointResponse events(@jakarta.annotation.Nullable Integer events) { + this.events = events; + return this; + } + + /** + * Get events + * @return events + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getEvents() { + return events; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEvents(@jakarta.annotation.Nullable Integer events) { + this.events = events; + } + + + public ModelsEndpointResponse failureCount(@jakarta.annotation.Nullable Integer failureCount) { + this.failureCount = failureCount; + return this; + } + + /** + * Get failureCount + * @return failureCount + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FAILURE_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getFailureCount() { + return failureCount; + } + + + @JsonProperty(value = JSON_PROPERTY_FAILURE_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFailureCount(@jakarta.annotation.Nullable Integer failureCount) { + this.failureCount = failureCount; + } + + + public ModelsEndpointResponse failureRate(@jakarta.annotation.Nullable BigDecimal failureRate) { + this.failureRate = failureRate; + return this; + } + + /** + * FailureRate is the circuit breaker's rolling failure rate for this endpoint. It is a pointer so the API can return null when no rate was computed (circuit breaker feature off, or sampler not running), distinct from a genuine 0%. + * @return failureRate + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FAILURE_RATE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getFailureRate() { + return failureRate; + } + + + @JsonProperty(value = JSON_PROPERTY_FAILURE_RATE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFailureRate(@jakarta.annotation.Nullable BigDecimal failureRate) { + this.failureRate = failureRate; + } + + + public ModelsEndpointResponse httpTimeout(@jakarta.annotation.Nullable Integer httpTimeout) { + this.httpTimeout = httpTimeout; + return this; + } + + /** + * Get httpTimeout + * @return httpTimeout + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HTTP_TIMEOUT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHttpTimeout() { + return httpTimeout; + } + + + @JsonProperty(value = JSON_PROPERTY_HTTP_TIMEOUT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHttpTimeout(@jakarta.annotation.Nullable Integer httpTimeout) { + this.httpTimeout = httpTimeout; + } + + + public ModelsEndpointResponse mtlsClientCert(@jakarta.annotation.Nullable DatastoreMtlsClientCert mtlsClientCert) { + this.mtlsClientCert = mtlsClientCert; + return this; + } + + /** + * mTLS client certificate configuration + * @return mtlsClientCert + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MTLS_CLIENT_CERT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreMtlsClientCert getMtlsClientCert() { + return mtlsClientCert; + } + + + @JsonProperty(value = JSON_PROPERTY_MTLS_CLIENT_CERT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMtlsClientCert(@jakarta.annotation.Nullable DatastoreMtlsClientCert mtlsClientCert) { + this.mtlsClientCert = mtlsClientCert; + } + + + public ModelsEndpointResponse name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public ModelsEndpointResponse ownerId(@jakarta.annotation.Nullable String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Get ownerId + * @return ownerId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OWNER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOwnerId() { + return ownerId; + } + + + @JsonProperty(value = JSON_PROPERTY_OWNER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOwnerId(@jakarta.annotation.Nullable String ownerId) { + this.ownerId = ownerId; + } + + + public ModelsEndpointResponse periodFailureRate(@jakarta.annotation.Nullable BigDecimal periodFailureRate) { + this.periodFailureRate = periodFailureRate; + return this; + } + + /** + * PeriodFailureRate is the period failure rate from event_deliveries, (Failure+Retry)/(Success+Failure+Retry). Retry counts as failed-so-far. Nil when the range has no counted deliveries; sibling counts are transient. + * @return periodFailureRate + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PERIOD_FAILURE_RATE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPeriodFailureRate() { + return periodFailureRate; + } + + + @JsonProperty(value = JSON_PROPERTY_PERIOD_FAILURE_RATE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPeriodFailureRate(@jakarta.annotation.Nullable BigDecimal periodFailureRate) { + this.periodFailureRate = periodFailureRate; + } + + + public ModelsEndpointResponse projectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Get projectId + * @return projectId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectId() { + return projectId; + } + + + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProjectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + } + + + public ModelsEndpointResponse rateLimit(@jakarta.annotation.Nullable Integer rateLimit) { + this.rateLimit = rateLimit; + return this; + } + + /** + * Get rateLimit + * @return rateLimit + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRateLimit() { + return rateLimit; + } + + + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRateLimit(@jakarta.annotation.Nullable Integer rateLimit) { + this.rateLimit = rateLimit; + } + + + public ModelsEndpointResponse rateLimitDuration(@jakarta.annotation.Nullable Integer rateLimitDuration) { + this.rateLimitDuration = rateLimitDuration; + return this; + } + + /** + * Get rateLimitDuration + * @return rateLimitDuration + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRateLimitDuration() { + return rateLimitDuration; + } + + + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRateLimitDuration(@jakarta.annotation.Nullable Integer rateLimitDuration) { + this.rateLimitDuration = rateLimitDuration; + } + + + public ModelsEndpointResponse retryCount(@jakarta.annotation.Nullable Integer retryCount) { + this.retryCount = retryCount; + return this; + } + + /** + * Get retryCount + * @return retryCount + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RETRY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRetryCount() { + return retryCount; + } + + + @JsonProperty(value = JSON_PROPERTY_RETRY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRetryCount(@jakarta.annotation.Nullable Integer retryCount) { + this.retryCount = retryCount; + } + + + public ModelsEndpointResponse secrets(@jakarta.annotation.Nullable List secrets) { + this.secrets = secrets; + return this; + } + + public ModelsEndpointResponse addSecretsItem(DatastoreSecret secretsItem) { + if (this.secrets == null) { + this.secrets = new ArrayList<>(); + } + this.secrets.add(secretsItem); + return this; + } + + /** + * Get secrets + * @return secrets + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SECRETS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSecrets() { + return secrets; + } + + + @JsonProperty(value = JSON_PROPERTY_SECRETS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecrets(@jakarta.annotation.Nullable List secrets) { + this.secrets = secrets; + } + + + public ModelsEndpointResponse slackWebhookUrl(@jakarta.annotation.Nullable String slackWebhookUrl) { + this.slackWebhookUrl = slackWebhookUrl; + return this; + } + + /** + * Get slackWebhookUrl + * @return slackWebhookUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SLACK_WEBHOOK_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSlackWebhookUrl() { + return slackWebhookUrl; + } + + + @JsonProperty(value = JSON_PROPERTY_SLACK_WEBHOOK_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSlackWebhookUrl(@jakarta.annotation.Nullable String slackWebhookUrl) { + this.slackWebhookUrl = slackWebhookUrl; + } + + + public ModelsEndpointResponse status(@jakarta.annotation.Nullable DatastoreEndpointStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreEndpointStatus getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable DatastoreEndpointStatus status) { + this.status = status; + } + + + public ModelsEndpointResponse successCount(@jakarta.annotation.Nullable Integer successCount) { + this.successCount = successCount; + return this; + } + + /** + * Get successCount + * @return successCount + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SUCCESS_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSuccessCount() { + return successCount; + } + + + @JsonProperty(value = JSON_PROPERTY_SUCCESS_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSuccessCount(@jakarta.annotation.Nullable Integer successCount) { + this.successCount = successCount; + } + + + public ModelsEndpointResponse supportEmail(@jakarta.annotation.Nullable String supportEmail) { + this.supportEmail = supportEmail; + return this; + } + + /** + * Get supportEmail + * @return supportEmail + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SUPPORT_EMAIL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSupportEmail() { + return supportEmail; + } + + + @JsonProperty(value = JSON_PROPERTY_SUPPORT_EMAIL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportEmail(@jakarta.annotation.Nullable String supportEmail) { + this.supportEmail = supportEmail; + } + + + public ModelsEndpointResponse uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + public ModelsEndpointResponse updatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + public ModelsEndpointResponse url(@jakarta.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = url; + } + + + /** + * Return true if this models.EndpointResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsEndpointResponse modelsEndpointResponse = (ModelsEndpointResponse) o; + return Objects.equals(this.advancedSignatures, modelsEndpointResponse.advancedSignatures) && + Objects.equals(this.authentication, modelsEndpointResponse.authentication) && + Objects.equals(this.cbState, modelsEndpointResponse.cbState) && + Objects.equals(this.contentType, modelsEndpointResponse.contentType) && + Objects.equals(this.createdAt, modelsEndpointResponse.createdAt) && + Objects.equals(this.deletedAt, modelsEndpointResponse.deletedAt) && + Objects.equals(this.description, modelsEndpointResponse.description) && + Objects.equals(this.events, modelsEndpointResponse.events) && + Objects.equals(this.failureCount, modelsEndpointResponse.failureCount) && + Objects.equals(this.failureRate, modelsEndpointResponse.failureRate) && + Objects.equals(this.httpTimeout, modelsEndpointResponse.httpTimeout) && + Objects.equals(this.mtlsClientCert, modelsEndpointResponse.mtlsClientCert) && + Objects.equals(this.name, modelsEndpointResponse.name) && + Objects.equals(this.ownerId, modelsEndpointResponse.ownerId) && + Objects.equals(this.periodFailureRate, modelsEndpointResponse.periodFailureRate) && + Objects.equals(this.projectId, modelsEndpointResponse.projectId) && + Objects.equals(this.rateLimit, modelsEndpointResponse.rateLimit) && + Objects.equals(this.rateLimitDuration, modelsEndpointResponse.rateLimitDuration) && + Objects.equals(this.retryCount, modelsEndpointResponse.retryCount) && + Objects.equals(this.secrets, modelsEndpointResponse.secrets) && + Objects.equals(this.slackWebhookUrl, modelsEndpointResponse.slackWebhookUrl) && + Objects.equals(this.status, modelsEndpointResponse.status) && + Objects.equals(this.successCount, modelsEndpointResponse.successCount) && + Objects.equals(this.supportEmail, modelsEndpointResponse.supportEmail) && + Objects.equals(this.uid, modelsEndpointResponse.uid) && + Objects.equals(this.updatedAt, modelsEndpointResponse.updatedAt) && + Objects.equals(this.url, modelsEndpointResponse.url); + } + + @Override + public int hashCode() { + return Objects.hash(advancedSignatures, authentication, cbState, contentType, createdAt, deletedAt, description, events, failureCount, failureRate, httpTimeout, mtlsClientCert, name, ownerId, periodFailureRate, projectId, rateLimit, rateLimitDuration, retryCount, secrets, slackWebhookUrl, status, successCount, supportEmail, uid, updatedAt, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsEndpointResponse {\n"); + sb.append(" advancedSignatures: ").append(toIndentedString(advancedSignatures)).append("\n"); + sb.append(" authentication: ").append(toIndentedString(authentication)).append("\n"); + sb.append(" cbState: ").append(toIndentedString(cbState)).append("\n"); + sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" events: ").append(toIndentedString(events)).append("\n"); + sb.append(" failureCount: ").append(toIndentedString(failureCount)).append("\n"); + sb.append(" failureRate: ").append(toIndentedString(failureRate)).append("\n"); + sb.append(" httpTimeout: ").append(toIndentedString(httpTimeout)).append("\n"); + sb.append(" mtlsClientCert: ").append(toIndentedString(mtlsClientCert)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append(" periodFailureRate: ").append(toIndentedString(periodFailureRate)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" rateLimit: ").append(toIndentedString(rateLimit)).append("\n"); + sb.append(" rateLimitDuration: ").append(toIndentedString(rateLimitDuration)).append("\n"); + sb.append(" retryCount: ").append(toIndentedString(retryCount)).append("\n"); + sb.append(" secrets: ").append(toIndentedString(secrets)).append("\n"); + sb.append(" slackWebhookUrl: ").append(toIndentedString(slackWebhookUrl)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" successCount: ").append(toIndentedString(successCount)).append("\n"); + sb.append(" supportEmail: ").append(toIndentedString(supportEmail)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `advanced_signatures` to the URL query string + if (getAdvancedSignatures() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sadvanced_signatures%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAdvancedSignatures())))); + } + + // add `authentication` to the URL query string + if (getAuthentication() != null) { + joiner.add(getAuthentication().toUrlQueryString(prefix + "authentication" + suffix)); + } + + // add `cb_state` to the URL query string + if (getCbState() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scb_state%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCbState())))); + } + + // add `content_type` to the URL query string + if (getContentType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scontent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getContentType())))); + } + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `deleted_at` to the URL query string + if (getDeletedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeleted_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeletedAt())))); + } + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdescription%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `events` to the URL query string + if (getEvents() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevents%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEvents())))); + } + + // add `failure_count` to the URL query string + if (getFailureCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sfailure_count%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFailureCount())))); + } + + // add `failure_rate` to the URL query string + if (getFailureRate() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sfailure_rate%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFailureRate())))); + } + + // add `http_timeout` to the URL query string + if (getHttpTimeout() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shttp_timeout%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHttpTimeout())))); + } + + // add `mtls_client_cert` to the URL query string + if (getMtlsClientCert() != null) { + joiner.add(getMtlsClientCert().toUrlQueryString(prefix + "mtls_client_cert" + suffix)); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `owner_id` to the URL query string + if (getOwnerId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sowner_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOwnerId())))); + } + + // add `period_failure_rate` to the URL query string + if (getPeriodFailureRate() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%speriod_failure_rate%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPeriodFailureRate())))); + } + + // add `project_id` to the URL query string + if (getProjectId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sproject_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProjectId())))); + } + + // add `rate_limit` to the URL query string + if (getRateLimit() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%srate_limit%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRateLimit())))); + } + + // add `rate_limit_duration` to the URL query string + if (getRateLimitDuration() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%srate_limit_duration%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRateLimitDuration())))); + } + + // add `retry_count` to the URL query string + if (getRetryCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sretry_count%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRetryCount())))); + } + + // add `secrets` to the URL query string + if (getSecrets() != null) { + for (int i = 0; i < getSecrets().size(); i++) { + if (getSecrets().get(i) != null) { + joiner.add(getSecrets().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%ssecrets%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `slack_webhook_url` to the URL query string + if (getSlackWebhookUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sslack_webhook_url%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSlackWebhookUrl())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `success_count` to the URL query string + if (getSuccessCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssuccess_count%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSuccessCount())))); + } + + // add `support_email` to the URL query string + if (getSupportEmail() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssupport_email%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSupportEmail())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + // add `updated_at` to the URL query string + if (getUpdatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%supdated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpdatedAt())))); + } + + // add `url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsEventDeliveryResponse.java b/src/main/java/com/getconvoy/models/ModelsEventDeliveryResponse.java new file mode 100644 index 0000000..8ef1af3 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsEventDeliveryResponse.java @@ -0,0 +1,1072 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreCLIMetadata; +import com.getconvoy.models.DatastoreDeliveryMode; +import com.getconvoy.models.DatastoreDevice; +import com.getconvoy.models.DatastoreEndpoint; +import com.getconvoy.models.DatastoreEvent; +import com.getconvoy.models.DatastoreEventDeliveryStatus; +import com.getconvoy.models.DatastoreMetadata; +import com.getconvoy.models.DatastoreSource; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsEventDeliveryResponse + */ +@JsonPropertyOrder({ + ModelsEventDeliveryResponse.JSON_PROPERTY_ACKNOWLEDGED_AT, + ModelsEventDeliveryResponse.JSON_PROPERTY_CLI_METADATA, + ModelsEventDeliveryResponse.JSON_PROPERTY_CREATED_AT, + ModelsEventDeliveryResponse.JSON_PROPERTY_DELETED_AT, + ModelsEventDeliveryResponse.JSON_PROPERTY_DELIVERY_MODE, + ModelsEventDeliveryResponse.JSON_PROPERTY_DESCRIPTION, + ModelsEventDeliveryResponse.JSON_PROPERTY_DEVICE_ID, + ModelsEventDeliveryResponse.JSON_PROPERTY_DEVICE_METADATA, + ModelsEventDeliveryResponse.JSON_PROPERTY_ENDPOINT_ID, + ModelsEventDeliveryResponse.JSON_PROPERTY_ENDPOINT_METADATA, + ModelsEventDeliveryResponse.JSON_PROPERTY_EVENT_ID, + ModelsEventDeliveryResponse.JSON_PROPERTY_EVENT_METADATA, + ModelsEventDeliveryResponse.JSON_PROPERTY_EVENT_TYPE, + ModelsEventDeliveryResponse.JSON_PROPERTY_HEADERS, + ModelsEventDeliveryResponse.JSON_PROPERTY_IDEMPOTENCY_KEY, + ModelsEventDeliveryResponse.JSON_PROPERTY_LATENCY, + ModelsEventDeliveryResponse.JSON_PROPERTY_LATENCY_SECONDS, + ModelsEventDeliveryResponse.JSON_PROPERTY_METADATA, + ModelsEventDeliveryResponse.JSON_PROPERTY_PROJECT_ID, + ModelsEventDeliveryResponse.JSON_PROPERTY_SOURCE_METADATA, + ModelsEventDeliveryResponse.JSON_PROPERTY_STATUS, + ModelsEventDeliveryResponse.JSON_PROPERTY_SUBSCRIPTION_ID, + ModelsEventDeliveryResponse.JSON_PROPERTY_TARGET_URL, + ModelsEventDeliveryResponse.JSON_PROPERTY_UID, + ModelsEventDeliveryResponse.JSON_PROPERTY_UPDATED_AT, + ModelsEventDeliveryResponse.JSON_PROPERTY_URL_QUERY_PARAMS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsEventDeliveryResponse { + public static final String JSON_PROPERTY_ACKNOWLEDGED_AT = "acknowledged_at"; + @jakarta.annotation.Nullable + private String acknowledgedAt; + + public static final String JSON_PROPERTY_CLI_METADATA = "cli_metadata"; + @jakarta.annotation.Nullable + private DatastoreCLIMetadata cliMetadata; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + @jakarta.annotation.Nullable + private String deletedAt; + + public static final String JSON_PROPERTY_DELIVERY_MODE = "delivery_mode"; + @jakarta.annotation.Nullable + private DatastoreDeliveryMode deliveryMode; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + @jakarta.annotation.Nullable + private String description; + + public static final String JSON_PROPERTY_DEVICE_ID = "device_id"; + @jakarta.annotation.Nullable + private String deviceId; + + public static final String JSON_PROPERTY_DEVICE_METADATA = "device_metadata"; + @jakarta.annotation.Nullable + private DatastoreDevice deviceMetadata; + + public static final String JSON_PROPERTY_ENDPOINT_ID = "endpoint_id"; + @jakarta.annotation.Nullable + private String endpointId; + + public static final String JSON_PROPERTY_ENDPOINT_METADATA = "endpoint_metadata"; + @jakarta.annotation.Nullable + private DatastoreEndpoint endpointMetadata; + + public static final String JSON_PROPERTY_EVENT_ID = "event_id"; + @jakarta.annotation.Nullable + private String eventId; + + public static final String JSON_PROPERTY_EVENT_METADATA = "event_metadata"; + @jakarta.annotation.Nullable + private DatastoreEvent eventMetadata; + + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @jakarta.annotation.Nullable + private String eventType; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + @jakarta.annotation.Nullable + private Map> headers = new HashMap<>(); + + public static final String JSON_PROPERTY_IDEMPOTENCY_KEY = "idempotency_key"; + @jakarta.annotation.Nullable + private String idempotencyKey; + + public static final String JSON_PROPERTY_LATENCY = "latency"; + @jakarta.annotation.Nullable + private String latency; + + public static final String JSON_PROPERTY_LATENCY_SECONDS = "latency_seconds"; + @jakarta.annotation.Nullable + private BigDecimal latencySeconds; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @jakarta.annotation.Nullable + private DatastoreMetadata metadata; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + @jakarta.annotation.Nullable + private String projectId; + + public static final String JSON_PROPERTY_SOURCE_METADATA = "source_metadata"; + @jakarta.annotation.Nullable + private DatastoreSource sourceMetadata; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private DatastoreEventDeliveryStatus status; + + public static final String JSON_PROPERTY_SUBSCRIPTION_ID = "subscription_id"; + @jakarta.annotation.Nullable + private String subscriptionId; + + public static final String JSON_PROPERTY_TARGET_URL = "target_url"; + @jakarta.annotation.Nullable + private String targetUrl; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + @jakarta.annotation.Nullable + private String updatedAt; + + public static final String JSON_PROPERTY_URL_QUERY_PARAMS = "url_query_params"; + @jakarta.annotation.Nullable + private String urlQueryParams; + + public ModelsEventDeliveryResponse() { + } + + public ModelsEventDeliveryResponse acknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { + this.acknowledgedAt = acknowledgedAt; + return this; + } + + /** + * Get acknowledgedAt + * @return acknowledgedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ACKNOWLEDGED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAcknowledgedAt() { + return acknowledgedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_ACKNOWLEDGED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { + this.acknowledgedAt = acknowledgedAt; + } + + + public ModelsEventDeliveryResponse cliMetadata(@jakarta.annotation.Nullable DatastoreCLIMetadata cliMetadata) { + this.cliMetadata = cliMetadata; + return this; + } + + /** + * Get cliMetadata + * @return cliMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CLI_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreCLIMetadata getCliMetadata() { + return cliMetadata; + } + + + @JsonProperty(value = JSON_PROPERTY_CLI_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCliMetadata(@jakarta.annotation.Nullable DatastoreCLIMetadata cliMetadata) { + this.cliMetadata = cliMetadata; + } + + + public ModelsEventDeliveryResponse createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public ModelsEventDeliveryResponse deletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Get deletedAt + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + } + + + public ModelsEventDeliveryResponse deliveryMode(@jakarta.annotation.Nullable DatastoreDeliveryMode deliveryMode) { + this.deliveryMode = deliveryMode; + return this; + } + + /** + * Get deliveryMode + * @return deliveryMode + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELIVERY_MODE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreDeliveryMode getDeliveryMode() { + return deliveryMode; + } + + + @JsonProperty(value = JSON_PROPERTY_DELIVERY_MODE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeliveryMode(@jakarta.annotation.Nullable DatastoreDeliveryMode deliveryMode) { + this.deliveryMode = deliveryMode; + } + + + public ModelsEventDeliveryResponse description(@jakarta.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@jakarta.annotation.Nullable String description) { + this.description = description; + } + + + public ModelsEventDeliveryResponse deviceId(@jakarta.annotation.Nullable String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Get deviceId + * @return deviceId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DEVICE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceId() { + return deviceId; + } + + + @JsonProperty(value = JSON_PROPERTY_DEVICE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceId(@jakarta.annotation.Nullable String deviceId) { + this.deviceId = deviceId; + } + + + public ModelsEventDeliveryResponse deviceMetadata(@jakarta.annotation.Nullable DatastoreDevice deviceMetadata) { + this.deviceMetadata = deviceMetadata; + return this; + } + + /** + * Get deviceMetadata + * @return deviceMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DEVICE_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreDevice getDeviceMetadata() { + return deviceMetadata; + } + + + @JsonProperty(value = JSON_PROPERTY_DEVICE_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceMetadata(@jakarta.annotation.Nullable DatastoreDevice deviceMetadata) { + this.deviceMetadata = deviceMetadata; + } + + + public ModelsEventDeliveryResponse endpointId(@jakarta.annotation.Nullable String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * Get endpointId + * @return endpointId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEndpointId() { + return endpointId; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpointId(@jakarta.annotation.Nullable String endpointId) { + this.endpointId = endpointId; + } + + + public ModelsEventDeliveryResponse endpointMetadata(@jakarta.annotation.Nullable DatastoreEndpoint endpointMetadata) { + this.endpointMetadata = endpointMetadata; + return this; + } + + /** + * Get endpointMetadata + * @return endpointMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreEndpoint getEndpointMetadata() { + return endpointMetadata; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpointMetadata(@jakarta.annotation.Nullable DatastoreEndpoint endpointMetadata) { + this.endpointMetadata = endpointMetadata; + } + + + public ModelsEventDeliveryResponse eventId(@jakarta.annotation.Nullable String eventId) { + this.eventId = eventId; + return this; + } + + /** + * Get eventId + * @return eventId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventId() { + return eventId; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventId(@jakarta.annotation.Nullable String eventId) { + this.eventId = eventId; + } + + + public ModelsEventDeliveryResponse eventMetadata(@jakarta.annotation.Nullable DatastoreEvent eventMetadata) { + this.eventMetadata = eventMetadata; + return this; + } + + /** + * Get eventMetadata + * @return eventMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreEvent getEventMetadata() { + return eventMetadata; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventMetadata(@jakarta.annotation.Nullable DatastoreEvent eventMetadata) { + this.eventMetadata = eventMetadata; + } + + + public ModelsEventDeliveryResponse eventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get eventType + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventType() { + return eventType; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + } + + + public ModelsEventDeliveryResponse headers(@jakarta.annotation.Nullable Map> headers) { + this.headers = headers; + return this; + } + + public ModelsEventDeliveryResponse putHeadersItem(String key, List headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * Get headers + * @return headers + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getHeaders() { + return headers; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(@jakarta.annotation.Nullable Map> headers) { + this.headers = headers; + } + + + public ModelsEventDeliveryResponse idempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + + /** + * Get idempotencyKey + * @return idempotencyKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIdempotencyKey() { + return idempotencyKey; + } + + + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + } + + + public ModelsEventDeliveryResponse latency(@jakarta.annotation.Nullable String latency) { + this.latency = latency; + return this; + } + + /** + * Deprecated: Latency is deprecated. + * @return latency + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_LATENCY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLatency() { + return latency; + } + + + @JsonProperty(value = JSON_PROPERTY_LATENCY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLatency(@jakarta.annotation.Nullable String latency) { + this.latency = latency; + } + + + public ModelsEventDeliveryResponse latencySeconds(@jakarta.annotation.Nullable BigDecimal latencySeconds) { + this.latencySeconds = latencySeconds; + return this; + } + + /** + * Get latencySeconds + * @return latencySeconds + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_LATENCY_SECONDS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getLatencySeconds() { + return latencySeconds; + } + + + @JsonProperty(value = JSON_PROPERTY_LATENCY_SECONDS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLatencySeconds(@jakarta.annotation.Nullable BigDecimal latencySeconds) { + this.latencySeconds = latencySeconds; + } + + + public ModelsEventDeliveryResponse metadata(@jakarta.annotation.Nullable DatastoreMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreMetadata getMetadata() { + return metadata; + } + + + @JsonProperty(value = JSON_PROPERTY_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@jakarta.annotation.Nullable DatastoreMetadata metadata) { + this.metadata = metadata; + } + + + public ModelsEventDeliveryResponse projectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Get projectId + * @return projectId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectId() { + return projectId; + } + + + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProjectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + } + + + public ModelsEventDeliveryResponse sourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { + this.sourceMetadata = sourceMetadata; + return this; + } + + /** + * Get sourceMetadata + * @return sourceMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SOURCE_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreSource getSourceMetadata() { + return sourceMetadata; + } + + + @JsonProperty(value = JSON_PROPERTY_SOURCE_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { + this.sourceMetadata = sourceMetadata; + } + + + public ModelsEventDeliveryResponse status(@jakarta.annotation.Nullable DatastoreEventDeliveryStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreEventDeliveryStatus getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable DatastoreEventDeliveryStatus status) { + this.status = status; + } + + + public ModelsEventDeliveryResponse subscriptionId(@jakarta.annotation.Nullable String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get subscriptionId + * @return subscriptionId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SUBSCRIPTION_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubscriptionId() { + return subscriptionId; + } + + + @JsonProperty(value = JSON_PROPERTY_SUBSCRIPTION_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubscriptionId(@jakarta.annotation.Nullable String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + + public ModelsEventDeliveryResponse targetUrl(@jakarta.annotation.Nullable String targetUrl) { + this.targetUrl = targetUrl; + return this; + } + + /** + * Get targetUrl + * @return targetUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TARGET_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTargetUrl() { + return targetUrl; + } + + + @JsonProperty(value = JSON_PROPERTY_TARGET_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTargetUrl(@jakarta.annotation.Nullable String targetUrl) { + this.targetUrl = targetUrl; + } + + + public ModelsEventDeliveryResponse uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + public ModelsEventDeliveryResponse updatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + public ModelsEventDeliveryResponse urlQueryParams(@jakarta.annotation.Nullable String urlQueryParams) { + this.urlQueryParams = urlQueryParams; + return this; + } + + /** + * Get urlQueryParams + * @return urlQueryParams + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL_QUERY_PARAMS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrlQueryParams() { + return urlQueryParams; + } + + + @JsonProperty(value = JSON_PROPERTY_URL_QUERY_PARAMS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrlQueryParams(@jakarta.annotation.Nullable String urlQueryParams) { + this.urlQueryParams = urlQueryParams; + } + + + /** + * Return true if this models.EventDeliveryResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsEventDeliveryResponse modelsEventDeliveryResponse = (ModelsEventDeliveryResponse) o; + return Objects.equals(this.acknowledgedAt, modelsEventDeliveryResponse.acknowledgedAt) && + Objects.equals(this.cliMetadata, modelsEventDeliveryResponse.cliMetadata) && + Objects.equals(this.createdAt, modelsEventDeliveryResponse.createdAt) && + Objects.equals(this.deletedAt, modelsEventDeliveryResponse.deletedAt) && + Objects.equals(this.deliveryMode, modelsEventDeliveryResponse.deliveryMode) && + Objects.equals(this.description, modelsEventDeliveryResponse.description) && + Objects.equals(this.deviceId, modelsEventDeliveryResponse.deviceId) && + Objects.equals(this.deviceMetadata, modelsEventDeliveryResponse.deviceMetadata) && + Objects.equals(this.endpointId, modelsEventDeliveryResponse.endpointId) && + Objects.equals(this.endpointMetadata, modelsEventDeliveryResponse.endpointMetadata) && + Objects.equals(this.eventId, modelsEventDeliveryResponse.eventId) && + Objects.equals(this.eventMetadata, modelsEventDeliveryResponse.eventMetadata) && + Objects.equals(this.eventType, modelsEventDeliveryResponse.eventType) && + Objects.equals(this.headers, modelsEventDeliveryResponse.headers) && + Objects.equals(this.idempotencyKey, modelsEventDeliveryResponse.idempotencyKey) && + Objects.equals(this.latency, modelsEventDeliveryResponse.latency) && + Objects.equals(this.latencySeconds, modelsEventDeliveryResponse.latencySeconds) && + Objects.equals(this.metadata, modelsEventDeliveryResponse.metadata) && + Objects.equals(this.projectId, modelsEventDeliveryResponse.projectId) && + Objects.equals(this.sourceMetadata, modelsEventDeliveryResponse.sourceMetadata) && + Objects.equals(this.status, modelsEventDeliveryResponse.status) && + Objects.equals(this.subscriptionId, modelsEventDeliveryResponse.subscriptionId) && + Objects.equals(this.targetUrl, modelsEventDeliveryResponse.targetUrl) && + Objects.equals(this.uid, modelsEventDeliveryResponse.uid) && + Objects.equals(this.updatedAt, modelsEventDeliveryResponse.updatedAt) && + Objects.equals(this.urlQueryParams, modelsEventDeliveryResponse.urlQueryParams); + } + + @Override + public int hashCode() { + return Objects.hash(acknowledgedAt, cliMetadata, createdAt, deletedAt, deliveryMode, description, deviceId, deviceMetadata, endpointId, endpointMetadata, eventId, eventMetadata, eventType, headers, idempotencyKey, latency, latencySeconds, metadata, projectId, sourceMetadata, status, subscriptionId, targetUrl, uid, updatedAt, urlQueryParams); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsEventDeliveryResponse {\n"); + sb.append(" acknowledgedAt: ").append(toIndentedString(acknowledgedAt)).append("\n"); + sb.append(" cliMetadata: ").append(toIndentedString(cliMetadata)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" deliveryMode: ").append(toIndentedString(deliveryMode)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" deviceId: ").append(toIndentedString(deviceId)).append("\n"); + sb.append(" deviceMetadata: ").append(toIndentedString(deviceMetadata)).append("\n"); + sb.append(" endpointId: ").append(toIndentedString(endpointId)).append("\n"); + sb.append(" endpointMetadata: ").append(toIndentedString(endpointMetadata)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).append("\n"); + sb.append(" eventMetadata: ").append(toIndentedString(eventMetadata)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" idempotencyKey: ").append(toIndentedString(idempotencyKey)).append("\n"); + sb.append(" latency: ").append(toIndentedString(latency)).append("\n"); + sb.append(" latencySeconds: ").append(toIndentedString(latencySeconds)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" sourceMetadata: ").append(toIndentedString(sourceMetadata)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); + sb.append(" targetUrl: ").append(toIndentedString(targetUrl)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" urlQueryParams: ").append(toIndentedString(urlQueryParams)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `acknowledged_at` to the URL query string + if (getAcknowledgedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sacknowledged_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAcknowledgedAt())))); + } + + // add `cli_metadata` to the URL query string + if (getCliMetadata() != null) { + joiner.add(getCliMetadata().toUrlQueryString(prefix + "cli_metadata" + suffix)); + } + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `deleted_at` to the URL query string + if (getDeletedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeleted_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeletedAt())))); + } + + // add `delivery_mode` to the URL query string + if (getDeliveryMode() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdelivery_mode%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeliveryMode())))); + } + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdescription%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `device_id` to the URL query string + if (getDeviceId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdevice_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeviceId())))); + } + + // add `device_metadata` to the URL query string + if (getDeviceMetadata() != null) { + joiner.add(getDeviceMetadata().toUrlQueryString(prefix + "device_metadata" + suffix)); + } + + // add `endpoint_id` to the URL query string + if (getEndpointId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sendpoint_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEndpointId())))); + } + + // add `endpoint_metadata` to the URL query string + if (getEndpointMetadata() != null) { + joiner.add(getEndpointMetadata().toUrlQueryString(prefix + "endpoint_metadata" + suffix)); + } + + // add `event_id` to the URL query string + if (getEventId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventId())))); + } + + // add `event_metadata` to the URL query string + if (getEventMetadata() != null) { + joiner.add(getEventMetadata().toUrlQueryString(prefix + "event_metadata" + suffix)); + } + + // add `event_type` to the URL query string + if (getEventType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventType())))); + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (String _key : getHeaders().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getHeaders().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getHeaders().get(_key))))); + } + } + + // add `idempotency_key` to the URL query string + if (getIdempotencyKey() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sidempotency_key%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIdempotencyKey())))); + } + + // add `latency` to the URL query string + if (getLatency() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%slatency%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLatency())))); + } + + // add `latency_seconds` to the URL query string + if (getLatencySeconds() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%slatency_seconds%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLatencySeconds())))); + } + + // add `metadata` to the URL query string + if (getMetadata() != null) { + joiner.add(getMetadata().toUrlQueryString(prefix + "metadata" + suffix)); + } + + // add `project_id` to the URL query string + if (getProjectId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sproject_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProjectId())))); + } + + // add `source_metadata` to the URL query string + if (getSourceMetadata() != null) { + joiner.add(getSourceMetadata().toUrlQueryString(prefix + "source_metadata" + suffix)); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `subscription_id` to the URL query string + if (getSubscriptionId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssubscription_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSubscriptionId())))); + } + + // add `target_url` to the URL query string + if (getTargetUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%starget_url%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTargetUrl())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + // add `updated_at` to the URL query string + if (getUpdatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%supdated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpdatedAt())))); + } + + // add `url_query_params` to the URL query string + if (getUrlQueryParams() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl_query_params%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrlQueryParams())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsEventResponse.java b/src/main/java/com/getconvoy/models/ModelsEventResponse.java new file mode 100644 index 0000000..15e1022 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsEventResponse.java @@ -0,0 +1,924 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreEndpoint; +import com.getconvoy.models.DatastoreEventStatus; +import com.getconvoy.models.DatastoreSource; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsEventResponse + */ +@JsonPropertyOrder({ + ModelsEventResponse.JSON_PROPERTY_ACKNOWLEDGED_AT, + ModelsEventResponse.JSON_PROPERTY_APP_ID, + ModelsEventResponse.JSON_PROPERTY_CREATED_AT, + ModelsEventResponse.JSON_PROPERTY_DATA, + ModelsEventResponse.JSON_PROPERTY_DELETED_AT, + ModelsEventResponse.JSON_PROPERTY_ENDPOINT_METADATA, + ModelsEventResponse.JSON_PROPERTY_ENDPOINTS, + ModelsEventResponse.JSON_PROPERTY_EVENT_TYPE, + ModelsEventResponse.JSON_PROPERTY_HEADERS, + ModelsEventResponse.JSON_PROPERTY_IDEMPOTENCY_KEY, + ModelsEventResponse.JSON_PROPERTY_IS_DUPLICATE_EVENT, + ModelsEventResponse.JSON_PROPERTY_METADATA, + ModelsEventResponse.JSON_PROPERTY_PROJECT_ID, + ModelsEventResponse.JSON_PROPERTY_RAW, + ModelsEventResponse.JSON_PROPERTY_SOURCE_ID, + ModelsEventResponse.JSON_PROPERTY_SOURCE_METADATA, + ModelsEventResponse.JSON_PROPERTY_STATUS, + ModelsEventResponse.JSON_PROPERTY_UID, + ModelsEventResponse.JSON_PROPERTY_UPDATED_AT, + ModelsEventResponse.JSON_PROPERTY_URL_PATH, + ModelsEventResponse.JSON_PROPERTY_URL_QUERY_PARAMS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsEventResponse { + public static final String JSON_PROPERTY_ACKNOWLEDGED_AT = "acknowledged_at"; + @jakarta.annotation.Nullable + private String acknowledgedAt; + + public static final String JSON_PROPERTY_APP_ID = "app_id"; + @jakarta.annotation.Nullable + private String appId; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private Map data = new HashMap<>(); + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + @jakarta.annotation.Nullable + private String deletedAt; + + public static final String JSON_PROPERTY_ENDPOINT_METADATA = "endpoint_metadata"; + @jakarta.annotation.Nullable + private List endpointMetadata = new ArrayList<>(); + + public static final String JSON_PROPERTY_ENDPOINTS = "endpoints"; + @jakarta.annotation.Nullable + private List endpoints = new ArrayList<>(); + + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @jakarta.annotation.Nullable + private String eventType; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + @jakarta.annotation.Nullable + private Map> headers = new HashMap<>(); + + public static final String JSON_PROPERTY_IDEMPOTENCY_KEY = "idempotency_key"; + @jakarta.annotation.Nullable + private String idempotencyKey; + + public static final String JSON_PROPERTY_IS_DUPLICATE_EVENT = "is_duplicate_event"; + @jakarta.annotation.Nullable + private Boolean isDuplicateEvent; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @jakarta.annotation.Nullable + private String metadata; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + @jakarta.annotation.Nullable + private String projectId; + + public static final String JSON_PROPERTY_RAW = "raw"; + @jakarta.annotation.Nullable + private String raw; + + public static final String JSON_PROPERTY_SOURCE_ID = "source_id"; + @jakarta.annotation.Nullable + private String sourceId; + + public static final String JSON_PROPERTY_SOURCE_METADATA = "source_metadata"; + @jakarta.annotation.Nullable + private DatastoreSource sourceMetadata; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private DatastoreEventStatus status; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + @jakarta.annotation.Nullable + private String updatedAt; + + public static final String JSON_PROPERTY_URL_PATH = "url_path"; + @jakarta.annotation.Nullable + private String urlPath; + + public static final String JSON_PROPERTY_URL_QUERY_PARAMS = "url_query_params"; + @jakarta.annotation.Nullable + private String urlQueryParams; + + public ModelsEventResponse() { + } + + public ModelsEventResponse acknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { + this.acknowledgedAt = acknowledgedAt; + return this; + } + + /** + * Get acknowledgedAt + * @return acknowledgedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ACKNOWLEDGED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAcknowledgedAt() { + return acknowledgedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_ACKNOWLEDGED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { + this.acknowledgedAt = acknowledgedAt; + } + + + public ModelsEventResponse appId(@jakarta.annotation.Nullable String appId) { + this.appId = appId; + return this; + } + + /** + * Deprecated + * @return appId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_APP_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppId() { + return appId; + } + + + @JsonProperty(value = JSON_PROPERTY_APP_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppId(@jakarta.annotation.Nullable String appId) { + this.appId = appId; + } + + + public ModelsEventResponse createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public ModelsEventResponse data(@jakarta.annotation.Nullable Map data) { + this.data = data; + return this; + } + + public ModelsEventResponse putDataItem(String key, Object dataItem) { + if (this.data == null) { + this.data = new HashMap<>(); + } + this.data.put(key, dataItem); + return this; + } + + /** + * Data is an arbitrary JSON value that gets sent as the body of the webhook to the endpoints + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable Map data) { + this.data = data; + } + + + public ModelsEventResponse deletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Get deletedAt + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + } + + + public ModelsEventResponse endpointMetadata(@jakarta.annotation.Nullable List endpointMetadata) { + this.endpointMetadata = endpointMetadata; + return this; + } + + public ModelsEventResponse addEndpointMetadataItem(DatastoreEndpoint endpointMetadataItem) { + if (this.endpointMetadata == null) { + this.endpointMetadata = new ArrayList<>(); + } + this.endpointMetadata.add(endpointMetadataItem); + return this; + } + + /** + * Get endpointMetadata + * @return endpointMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEndpointMetadata() { + return endpointMetadata; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpointMetadata(@jakarta.annotation.Nullable List endpointMetadata) { + this.endpointMetadata = endpointMetadata; + } + + + public ModelsEventResponse endpoints(@jakarta.annotation.Nullable List endpoints) { + this.endpoints = endpoints; + return this; + } + + public ModelsEventResponse addEndpointsItem(String endpointsItem) { + if (this.endpoints == null) { + this.endpoints = new ArrayList<>(); + } + this.endpoints.add(endpointsItem); + return this; + } + + /** + * Get endpoints + * @return endpoints + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEndpoints() { + return endpoints; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpoints(@jakarta.annotation.Nullable List endpoints) { + this.endpoints = endpoints; + } + + + public ModelsEventResponse eventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get eventType + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventType() { + return eventType; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + } + + + public ModelsEventResponse headers(@jakarta.annotation.Nullable Map> headers) { + this.headers = headers; + return this; + } + + public ModelsEventResponse putHeadersItem(String key, List headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * Get headers + * @return headers + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getHeaders() { + return headers; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(@jakarta.annotation.Nullable Map> headers) { + this.headers = headers; + } + + + public ModelsEventResponse idempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + + /** + * Get idempotencyKey + * @return idempotencyKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIdempotencyKey() { + return idempotencyKey; + } + + + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + } + + + public ModelsEventResponse isDuplicateEvent(@jakarta.annotation.Nullable Boolean isDuplicateEvent) { + this.isDuplicateEvent = isDuplicateEvent; + return this; + } + + /** + * Get isDuplicateEvent + * @return isDuplicateEvent + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IS_DUPLICATE_EVENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsDuplicateEvent() { + return isDuplicateEvent; + } + + + @JsonProperty(value = JSON_PROPERTY_IS_DUPLICATE_EVENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDuplicateEvent(@jakarta.annotation.Nullable Boolean isDuplicateEvent) { + this.isDuplicateEvent = isDuplicateEvent; + } + + + public ModelsEventResponse metadata(@jakarta.annotation.Nullable String metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadata() { + return metadata; + } + + + @JsonProperty(value = JSON_PROPERTY_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@jakarta.annotation.Nullable String metadata) { + this.metadata = metadata; + } + + + public ModelsEventResponse projectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Get projectId + * @return projectId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectId() { + return projectId; + } + + + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProjectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + } + + + public ModelsEventResponse raw(@jakarta.annotation.Nullable String raw) { + this.raw = raw; + return this; + } + + /** + * Get raw + * @return raw + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RAW, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRaw() { + return raw; + } + + + @JsonProperty(value = JSON_PROPERTY_RAW, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRaw(@jakarta.annotation.Nullable String raw) { + this.raw = raw; + } + + + public ModelsEventResponse sourceId(@jakarta.annotation.Nullable String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get sourceId + * @return sourceId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SOURCE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceId() { + return sourceId; + } + + + @JsonProperty(value = JSON_PROPERTY_SOURCE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceId(@jakarta.annotation.Nullable String sourceId) { + this.sourceId = sourceId; + } + + + public ModelsEventResponse sourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { + this.sourceMetadata = sourceMetadata; + return this; + } + + /** + * Get sourceMetadata + * @return sourceMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SOURCE_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreSource getSourceMetadata() { + return sourceMetadata; + } + + + @JsonProperty(value = JSON_PROPERTY_SOURCE_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { + this.sourceMetadata = sourceMetadata; + } + + + public ModelsEventResponse status(@jakarta.annotation.Nullable DatastoreEventStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreEventStatus getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable DatastoreEventStatus status) { + this.status = status; + } + + + public ModelsEventResponse uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + public ModelsEventResponse updatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + public ModelsEventResponse urlPath(@jakarta.annotation.Nullable String urlPath) { + this.urlPath = urlPath; + return this; + } + + /** + * Get urlPath + * @return urlPath + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL_PATH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrlPath() { + return urlPath; + } + + + @JsonProperty(value = JSON_PROPERTY_URL_PATH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrlPath(@jakarta.annotation.Nullable String urlPath) { + this.urlPath = urlPath; + } + + + public ModelsEventResponse urlQueryParams(@jakarta.annotation.Nullable String urlQueryParams) { + this.urlQueryParams = urlQueryParams; + return this; + } + + /** + * Get urlQueryParams + * @return urlQueryParams + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL_QUERY_PARAMS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrlQueryParams() { + return urlQueryParams; + } + + + @JsonProperty(value = JSON_PROPERTY_URL_QUERY_PARAMS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrlQueryParams(@jakarta.annotation.Nullable String urlQueryParams) { + this.urlQueryParams = urlQueryParams; + } + + + /** + * Return true if this models.EventResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsEventResponse modelsEventResponse = (ModelsEventResponse) o; + return Objects.equals(this.acknowledgedAt, modelsEventResponse.acknowledgedAt) && + Objects.equals(this.appId, modelsEventResponse.appId) && + Objects.equals(this.createdAt, modelsEventResponse.createdAt) && + Objects.equals(this.data, modelsEventResponse.data) && + Objects.equals(this.deletedAt, modelsEventResponse.deletedAt) && + Objects.equals(this.endpointMetadata, modelsEventResponse.endpointMetadata) && + Objects.equals(this.endpoints, modelsEventResponse.endpoints) && + Objects.equals(this.eventType, modelsEventResponse.eventType) && + Objects.equals(this.headers, modelsEventResponse.headers) && + Objects.equals(this.idempotencyKey, modelsEventResponse.idempotencyKey) && + Objects.equals(this.isDuplicateEvent, modelsEventResponse.isDuplicateEvent) && + Objects.equals(this.metadata, modelsEventResponse.metadata) && + Objects.equals(this.projectId, modelsEventResponse.projectId) && + Objects.equals(this.raw, modelsEventResponse.raw) && + Objects.equals(this.sourceId, modelsEventResponse.sourceId) && + Objects.equals(this.sourceMetadata, modelsEventResponse.sourceMetadata) && + Objects.equals(this.status, modelsEventResponse.status) && + Objects.equals(this.uid, modelsEventResponse.uid) && + Objects.equals(this.updatedAt, modelsEventResponse.updatedAt) && + Objects.equals(this.urlPath, modelsEventResponse.urlPath) && + Objects.equals(this.urlQueryParams, modelsEventResponse.urlQueryParams); + } + + @Override + public int hashCode() { + return Objects.hash(acknowledgedAt, appId, createdAt, data, deletedAt, endpointMetadata, endpoints, eventType, headers, idempotencyKey, isDuplicateEvent, metadata, projectId, raw, sourceId, sourceMetadata, status, uid, updatedAt, urlPath, urlQueryParams); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsEventResponse {\n"); + sb.append(" acknowledgedAt: ").append(toIndentedString(acknowledgedAt)).append("\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" endpointMetadata: ").append(toIndentedString(endpointMetadata)).append("\n"); + sb.append(" endpoints: ").append(toIndentedString(endpoints)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" idempotencyKey: ").append(toIndentedString(idempotencyKey)).append("\n"); + sb.append(" isDuplicateEvent: ").append(toIndentedString(isDuplicateEvent)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" raw: ").append(toIndentedString(raw)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" sourceMetadata: ").append(toIndentedString(sourceMetadata)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" urlPath: ").append(toIndentedString(urlPath)).append("\n"); + sb.append(" urlQueryParams: ").append(toIndentedString(urlQueryParams)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `acknowledged_at` to the URL query string + if (getAcknowledgedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sacknowledged_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAcknowledgedAt())))); + } + + // add `app_id` to the URL query string + if (getAppId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sapp_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAppId())))); + } + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `data` to the URL query string + if (getData() != null) { + for (String _key : getData().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdata%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getData().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getData().get(_key))))); + } + } + + // add `deleted_at` to the URL query string + if (getDeletedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeleted_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeletedAt())))); + } + + // add `endpoint_metadata` to the URL query string + if (getEndpointMetadata() != null) { + for (int i = 0; i < getEndpointMetadata().size(); i++) { + if (getEndpointMetadata().get(i) != null) { + joiner.add(getEndpointMetadata().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sendpoint_metadata%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `endpoints` to the URL query string + if (getEndpoints() != null) { + for (int i = 0; i < getEndpoints().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sendpoints%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEndpoints().get(i))))); + } + } + + // add `event_type` to the URL query string + if (getEventType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventType())))); + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (String _key : getHeaders().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getHeaders().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getHeaders().get(_key))))); + } + } + + // add `idempotency_key` to the URL query string + if (getIdempotencyKey() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sidempotency_key%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIdempotencyKey())))); + } + + // add `is_duplicate_event` to the URL query string + if (getIsDuplicateEvent() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sis_duplicate_event%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIsDuplicateEvent())))); + } + + // add `metadata` to the URL query string + if (getMetadata() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smetadata%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMetadata())))); + } + + // add `project_id` to the URL query string + if (getProjectId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sproject_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProjectId())))); + } + + // add `raw` to the URL query string + if (getRaw() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sraw%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRaw())))); + } + + // add `source_id` to the URL query string + if (getSourceId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssource_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSourceId())))); + } + + // add `source_metadata` to the URL query string + if (getSourceMetadata() != null) { + joiner.add(getSourceMetadata().toUrlQueryString(prefix + "source_metadata" + suffix)); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + // add `updated_at` to the URL query string + if (getUpdatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%supdated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpdatedAt())))); + } + + // add `url_path` to the URL query string + if (getUrlPath() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl_path%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrlPath())))); + } + + // add `url_query_params` to the URL query string + if (getUrlQueryParams() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl_query_params%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrlQueryParams())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsEventTypeResponse.java b/src/main/java/com/getconvoy/models/ModelsEventTypeResponse.java new file mode 100644 index 0000000..48a4aa7 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsEventTypeResponse.java @@ -0,0 +1,342 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsEventTypeResponse + */ +@JsonPropertyOrder({ + ModelsEventTypeResponse.JSON_PROPERTY_CATEGORY, + ModelsEventTypeResponse.JSON_PROPERTY_DEPRECATED_AT, + ModelsEventTypeResponse.JSON_PROPERTY_DESCRIPTION, + ModelsEventTypeResponse.JSON_PROPERTY_JSON_SCHEMA, + ModelsEventTypeResponse.JSON_PROPERTY_NAME, + ModelsEventTypeResponse.JSON_PROPERTY_UID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsEventTypeResponse { + public static final String JSON_PROPERTY_CATEGORY = "category"; + @jakarta.annotation.Nullable + private String category; + + public static final String JSON_PROPERTY_DEPRECATED_AT = "deprecated_at"; + @jakarta.annotation.Nullable + private String deprecatedAt; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + @jakarta.annotation.Nullable + private String description; + + public static final String JSON_PROPERTY_JSON_SCHEMA = "json_schema"; + @jakarta.annotation.Nullable + private Map jsonSchema = new HashMap<>(); + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public ModelsEventTypeResponse() { + } + + public ModelsEventTypeResponse category(@jakarta.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCategory() { + return category; + } + + + @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(@jakarta.annotation.Nullable String category) { + this.category = category; + } + + + public ModelsEventTypeResponse deprecatedAt(@jakarta.annotation.Nullable String deprecatedAt) { + this.deprecatedAt = deprecatedAt; + return this; + } + + /** + * Get deprecatedAt + * @return deprecatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DEPRECATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeprecatedAt() { + return deprecatedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_DEPRECATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeprecatedAt(@jakarta.annotation.Nullable String deprecatedAt) { + this.deprecatedAt = deprecatedAt; + } + + + public ModelsEventTypeResponse description(@jakarta.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@jakarta.annotation.Nullable String description) { + this.description = description; + } + + + public ModelsEventTypeResponse jsonSchema(@jakarta.annotation.Nullable Map jsonSchema) { + this.jsonSchema = jsonSchema; + return this; + } + + public ModelsEventTypeResponse putJsonSchemaItem(String key, Object jsonSchemaItem) { + if (this.jsonSchema == null) { + this.jsonSchema = new HashMap<>(); + } + this.jsonSchema.put(key, jsonSchemaItem); + return this; + } + + /** + * Get jsonSchema + * @return jsonSchema + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_JSON_SCHEMA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getJsonSchema() { + return jsonSchema; + } + + + @JsonProperty(value = JSON_PROPERTY_JSON_SCHEMA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setJsonSchema(@jakarta.annotation.Nullable Map jsonSchema) { + this.jsonSchema = jsonSchema; + } + + + public ModelsEventTypeResponse name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public ModelsEventTypeResponse uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + /** + * Return true if this models.EventTypeResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsEventTypeResponse modelsEventTypeResponse = (ModelsEventTypeResponse) o; + return Objects.equals(this.category, modelsEventTypeResponse.category) && + Objects.equals(this.deprecatedAt, modelsEventTypeResponse.deprecatedAt) && + Objects.equals(this.description, modelsEventTypeResponse.description) && + Objects.equals(this.jsonSchema, modelsEventTypeResponse.jsonSchema) && + Objects.equals(this.name, modelsEventTypeResponse.name) && + Objects.equals(this.uid, modelsEventTypeResponse.uid); + } + + @Override + public int hashCode() { + return Objects.hash(category, deprecatedAt, description, jsonSchema, name, uid); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsEventTypeResponse {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" deprecatedAt: ").append(toIndentedString(deprecatedAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" jsonSchema: ").append(toIndentedString(jsonSchema)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `category` to the URL query string + if (getCategory() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scategory%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCategory())))); + } + + // add `deprecated_at` to the URL query string + if (getDeprecatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeprecated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeprecatedAt())))); + } + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdescription%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `json_schema` to the URL query string + if (getJsonSchema() != null) { + for (String _key : getJsonSchema().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sjson_schema%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getJsonSchema().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getJsonSchema().get(_key))))); + } + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsExpireSecret.java b/src/main/java/com/getconvoy/models/ModelsExpireSecret.java new file mode 100644 index 0000000..387cdbd --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsExpireSecret.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsExpireSecret + */ +@JsonPropertyOrder({ + ModelsExpireSecret.JSON_PROPERTY_EXPIRATION, + ModelsExpireSecret.JSON_PROPERTY_SECRET +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsExpireSecret { + public static final String JSON_PROPERTY_EXPIRATION = "expiration"; + @jakarta.annotation.Nullable + private Integer expiration; + + public static final String JSON_PROPERTY_SECRET = "secret"; + @jakarta.annotation.Nullable + private String secret; + + public ModelsExpireSecret() { + } + + public ModelsExpireSecret expiration(@jakarta.annotation.Nullable Integer expiration) { + this.expiration = expiration; + return this; + } + + /** + * Amount of time to wait before expiring the old endpoint secret. If AdvancedSignatures is turned on for the project, signatures for both secrets will be generated up until the old signature is expired. + * @return expiration + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EXPIRATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiration() { + return expiration; + } + + + @JsonProperty(value = JSON_PROPERTY_EXPIRATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiration(@jakarta.annotation.Nullable Integer expiration) { + this.expiration = expiration; + } + + + public ModelsExpireSecret secret(@jakarta.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * New Endpoint secret value. + * @return secret + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecret() { + return secret; + } + + + @JsonProperty(value = JSON_PROPERTY_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(@jakarta.annotation.Nullable String secret) { + this.secret = secret; + } + + + /** + * Return true if this models.ExpireSecret object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsExpireSecret modelsExpireSecret = (ModelsExpireSecret) o; + return Objects.equals(this.expiration, modelsExpireSecret.expiration) && + Objects.equals(this.secret, modelsExpireSecret.secret); + } + + @Override + public int hashCode() { + return Objects.hash(expiration, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsExpireSecret {\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `expiration` to the URL query string + if (getExpiration() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sexpiration%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getExpiration())))); + } + + // add `secret` to the URL query string + if (getSecret() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssecret%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSecret())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsFS.java b/src/main/java/com/getconvoy/models/ModelsFS.java new file mode 100644 index 0000000..a1d38b1 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsFS.java @@ -0,0 +1,306 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsFS + */ +@JsonPropertyOrder({ + ModelsFS.JSON_PROPERTY_BODY, + ModelsFS.JSON_PROPERTY_HEADERS, + ModelsFS.JSON_PROPERTY_PATH, + ModelsFS.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsFS { + public static final String JSON_PROPERTY_BODY = "body"; + @jakarta.annotation.Nullable + private Map body = new HashMap<>(); + + public static final String JSON_PROPERTY_HEADERS = "headers"; + @jakarta.annotation.Nullable + private Map headers = new HashMap<>(); + + public static final String JSON_PROPERTY_PATH = "path"; + @jakarta.annotation.Nullable + private Map path = new HashMap<>(); + + public static final String JSON_PROPERTY_QUERY = "query"; + @jakarta.annotation.Nullable + private Map query = new HashMap<>(); + + public ModelsFS() { + } + + public ModelsFS body(@jakarta.annotation.Nullable Map body) { + this.body = body; + return this; + } + + public ModelsFS putBodyItem(String key, Object bodyItem) { + if (this.body == null) { + this.body = new HashMap<>(); + } + this.body.put(key, bodyItem); + return this; + } + + /** + * Get body + * @return body + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getBody() { + return body; + } + + + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setBody(@jakarta.annotation.Nullable Map body) { + this.body = body; + } + + + public ModelsFS headers(@jakarta.annotation.Nullable Map headers) { + this.headers = headers; + return this; + } + + public ModelsFS putHeadersItem(String key, Object headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * Get headers + * @return headers + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getHeaders() { + return headers; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(@jakarta.annotation.Nullable Map headers) { + this.headers = headers; + } + + + public ModelsFS path(@jakarta.annotation.Nullable Map path) { + this.path = path; + return this; + } + + public ModelsFS putPathItem(String key, Object pathItem) { + if (this.path == null) { + this.path = new HashMap<>(); + } + this.path.put(key, pathItem); + return this; + } + + /** + * Get path + * @return path + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PATH, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getPath() { + return path; + } + + + @JsonProperty(value = JSON_PROPERTY_PATH, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@jakarta.annotation.Nullable Map path) { + this.path = path; + } + + + public ModelsFS query(@jakarta.annotation.Nullable Map query) { + this.query = query; + return this; + } + + public ModelsFS putQueryItem(String key, Object queryItem) { + if (this.query == null) { + this.query = new HashMap<>(); + } + this.query.put(key, queryItem); + return this; + } + + /** + * Get query + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getQuery() { + return query; + } + + + @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setQuery(@jakarta.annotation.Nullable Map query) { + this.query = query; + } + + + /** + * Return true if this models.FS object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsFS modelsFS = (ModelsFS) o; + return Objects.equals(this.body, modelsFS.body) && + Objects.equals(this.headers, modelsFS.headers) && + Objects.equals(this.path, modelsFS.path) && + Objects.equals(this.query, modelsFS.query); + } + + @Override + public int hashCode() { + return Objects.hash(body, headers, path, query); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsFS {\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `body` to the URL query string + if (getBody() != null) { + for (String _key : getBody().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbody%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getBody().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBody().get(_key))))); + } + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (String _key : getHeaders().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getHeaders().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getHeaders().get(_key))))); + } + } + + // add `path` to the URL query string + if (getPath() != null) { + for (String _key : getPath().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%spath%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getPath().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getPath().get(_key))))); + } + } + + // add `query` to the URL query string + if (getQuery() != null) { + for (String _key : getQuery().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%squery%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getQuery().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getQuery().get(_key))))); + } + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsFanoutEvent.java b/src/main/java/com/getconvoy/models/ModelsFanoutEvent.java new file mode 100644 index 0000000..12c93c7 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsFanoutEvent.java @@ -0,0 +1,318 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsFanoutEvent + */ +@JsonPropertyOrder({ + ModelsFanoutEvent.JSON_PROPERTY_CUSTOM_HEADERS, + ModelsFanoutEvent.JSON_PROPERTY_DATA, + ModelsFanoutEvent.JSON_PROPERTY_EVENT_TYPE, + ModelsFanoutEvent.JSON_PROPERTY_IDEMPOTENCY_KEY, + ModelsFanoutEvent.JSON_PROPERTY_OWNER_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsFanoutEvent { + public static final String JSON_PROPERTY_CUSTOM_HEADERS = "custom_headers"; + @jakarta.annotation.Nullable + private Map customHeaders = new HashMap<>(); + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private Map data = new HashMap<>(); + + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @jakarta.annotation.Nullable + private String eventType; + + public static final String JSON_PROPERTY_IDEMPOTENCY_KEY = "idempotency_key"; + @jakarta.annotation.Nullable + private String idempotencyKey; + + public static final String JSON_PROPERTY_OWNER_ID = "owner_id"; + @jakarta.annotation.Nullable + private String ownerId; + + public ModelsFanoutEvent() { + } + + public ModelsFanoutEvent customHeaders(@jakarta.annotation.Nullable Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + public ModelsFanoutEvent putCustomHeadersItem(String key, String customHeadersItem) { + if (this.customHeaders == null) { + this.customHeaders = new HashMap<>(); + } + this.customHeaders.put(key, customHeadersItem); + return this; + } + + /** + * Specifies custom headers you want convoy to add when the event is dispatched to your endpoint + * @return customHeaders + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CUSTOM_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getCustomHeaders() { + return customHeaders; + } + + + @JsonProperty(value = JSON_PROPERTY_CUSTOM_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomHeaders(@jakarta.annotation.Nullable Map customHeaders) { + this.customHeaders = customHeaders; + } + + + public ModelsFanoutEvent data(@jakarta.annotation.Nullable Map data) { + this.data = data; + return this; + } + + public ModelsFanoutEvent putDataItem(String key, Object dataItem) { + if (this.data == null) { + this.data = new HashMap<>(); + } + this.data.put(key, dataItem); + return this; + } + + /** + * Data is an arbitrary JSON value that gets sent as the body of the webhook to the endpoints + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable Map data) { + this.data = data; + } + + + public ModelsFanoutEvent eventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Event Type is used for filtering and debugging e.g invoice.paid + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventType() { + return eventType; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + } + + + public ModelsFanoutEvent idempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + + /** + * Specify a key for event deduplication + * @return idempotencyKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIdempotencyKey() { + return idempotencyKey; + } + + + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + } + + + public ModelsFanoutEvent ownerId(@jakarta.annotation.Nullable String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Used for fanout, sends this event to all endpoints with this OwnerID. + * @return ownerId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OWNER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOwnerId() { + return ownerId; + } + + + @JsonProperty(value = JSON_PROPERTY_OWNER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOwnerId(@jakarta.annotation.Nullable String ownerId) { + this.ownerId = ownerId; + } + + + /** + * Return true if this models.FanoutEvent object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsFanoutEvent modelsFanoutEvent = (ModelsFanoutEvent) o; + return Objects.equals(this.customHeaders, modelsFanoutEvent.customHeaders) && + Objects.equals(this.data, modelsFanoutEvent.data) && + Objects.equals(this.eventType, modelsFanoutEvent.eventType) && + Objects.equals(this.idempotencyKey, modelsFanoutEvent.idempotencyKey) && + Objects.equals(this.ownerId, modelsFanoutEvent.ownerId); + } + + @Override + public int hashCode() { + return Objects.hash(customHeaders, data, eventType, idempotencyKey, ownerId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsFanoutEvent {\n"); + sb.append(" customHeaders: ").append(toIndentedString(customHeaders)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" idempotencyKey: ").append(toIndentedString(idempotencyKey)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `custom_headers` to the URL query string + if (getCustomHeaders() != null) { + for (String _key : getCustomHeaders().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%scustom_headers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getCustomHeaders().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getCustomHeaders().get(_key))))); + } + } + + // add `data` to the URL query string + if (getData() != null) { + for (String _key : getData().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdata%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getData().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getData().get(_key))))); + } + } + + // add `event_type` to the URL query string + if (getEventType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventType())))); + } + + // add `idempotency_key` to the URL query string + if (getIdempotencyKey() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sidempotency_key%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIdempotencyKey())))); + } + + // add `owner_id` to the URL query string + if (getOwnerId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sowner_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOwnerId())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsFilterConfiguration.java b/src/main/java/com/getconvoy/models/ModelsFilterConfiguration.java new file mode 100644 index 0000000..b19c9f2 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsFilterConfiguration.java @@ -0,0 +1,199 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsFS; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsFilterConfiguration + */ +@JsonPropertyOrder({ + ModelsFilterConfiguration.JSON_PROPERTY_EVENT_TYPES, + ModelsFilterConfiguration.JSON_PROPERTY_FILTER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsFilterConfiguration { + public static final String JSON_PROPERTY_EVENT_TYPES = "event_types"; + @jakarta.annotation.Nullable + private List eventTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_FILTER = "filter"; + @jakarta.annotation.Nullable + private ModelsFS filter; + + public ModelsFilterConfiguration() { + } + + public ModelsFilterConfiguration eventTypes(@jakarta.annotation.Nullable List eventTypes) { + this.eventTypes = eventTypes; + return this; + } + + public ModelsFilterConfiguration addEventTypesItem(String eventTypesItem) { + if (this.eventTypes == null) { + this.eventTypes = new ArrayList<>(); + } + this.eventTypes.add(eventTypesItem); + return this; + } + + /** + * List of event types that the subscription should match + * @return eventTypes + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEventTypes() { + return eventTypes; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventTypes(@jakarta.annotation.Nullable List eventTypes) { + this.eventTypes = eventTypes; + } + + + public ModelsFilterConfiguration filter(@jakarta.annotation.Nullable ModelsFS filter) { + this.filter = filter; + return this; + } + + /** + * Body & Header filters + * @return filter + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FILTER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsFS getFilter() { + return filter; + } + + + @JsonProperty(value = JSON_PROPERTY_FILTER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilter(@jakarta.annotation.Nullable ModelsFS filter) { + this.filter = filter; + } + + + /** + * Return true if this models.FilterConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsFilterConfiguration modelsFilterConfiguration = (ModelsFilterConfiguration) o; + return Objects.equals(this.eventTypes, modelsFilterConfiguration.eventTypes) && + Objects.equals(this.filter, modelsFilterConfiguration.filter); + } + + @Override + public int hashCode() { + return Objects.hash(eventTypes, filter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsFilterConfiguration {\n"); + sb.append(" eventTypes: ").append(toIndentedString(eventTypes)).append("\n"); + sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `event_types` to the URL query string + if (getEventTypes() != null) { + for (int i = 0; i < getEventTypes().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_types%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEventTypes().get(i))))); + } + } + + // add `filter` to the URL query string + if (getFilter() != null) { + joiner.add(getFilter().toUrlQueryString(prefix + "filter" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsFilterResponse.java b/src/main/java/com/getconvoy/models/ModelsFilterResponse.java new file mode 100644 index 0000000..1eafcd8 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsFilterResponse.java @@ -0,0 +1,642 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsFilterResponse + */ +@JsonPropertyOrder({ + ModelsFilterResponse.JSON_PROPERTY_BODY, + ModelsFilterResponse.JSON_PROPERTY_ENABLED_AT, + ModelsFilterResponse.JSON_PROPERTY_EVENT_TYPE, + ModelsFilterResponse.JSON_PROPERTY_HEADERS, + ModelsFilterResponse.JSON_PROPERTY_PATH, + ModelsFilterResponse.JSON_PROPERTY_QUERY, + ModelsFilterResponse.JSON_PROPERTY_RAW_BODY, + ModelsFilterResponse.JSON_PROPERTY_RAW_HEADERS, + ModelsFilterResponse.JSON_PROPERTY_RAW_PATH, + ModelsFilterResponse.JSON_PROPERTY_RAW_QUERY, + ModelsFilterResponse.JSON_PROPERTY_SUBSCRIPTION_ID, + ModelsFilterResponse.JSON_PROPERTY_UID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsFilterResponse { + public static final String JSON_PROPERTY_BODY = "body"; + @jakarta.annotation.Nullable + private Map body = new HashMap<>(); + + public static final String JSON_PROPERTY_ENABLED_AT = "enabled_at"; + @jakarta.annotation.Nullable + private String enabledAt; + + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @jakarta.annotation.Nullable + private String eventType; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + @jakarta.annotation.Nullable + private Map headers = new HashMap<>(); + + public static final String JSON_PROPERTY_PATH = "path"; + @jakarta.annotation.Nullable + private Map path = new HashMap<>(); + + public static final String JSON_PROPERTY_QUERY = "query"; + @jakarta.annotation.Nullable + private Map query = new HashMap<>(); + + public static final String JSON_PROPERTY_RAW_BODY = "raw_body"; + @jakarta.annotation.Nullable + private Map rawBody = new HashMap<>(); + + public static final String JSON_PROPERTY_RAW_HEADERS = "raw_headers"; + @jakarta.annotation.Nullable + private Map rawHeaders = new HashMap<>(); + + public static final String JSON_PROPERTY_RAW_PATH = "raw_path"; + @jakarta.annotation.Nullable + private Map rawPath = new HashMap<>(); + + public static final String JSON_PROPERTY_RAW_QUERY = "raw_query"; + @jakarta.annotation.Nullable + private Map rawQuery = new HashMap<>(); + + public static final String JSON_PROPERTY_SUBSCRIPTION_ID = "subscription_id"; + @jakarta.annotation.Nullable + private String subscriptionId; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public ModelsFilterResponse() { + } + + public ModelsFilterResponse body(@jakarta.annotation.Nullable Map body) { + this.body = body; + return this; + } + + public ModelsFilterResponse putBodyItem(String key, Object bodyItem) { + if (this.body == null) { + this.body = new HashMap<>(); + } + this.body.put(key, bodyItem); + return this; + } + + /** + * Get body + * @return body + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getBody() { + return body; + } + + + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setBody(@jakarta.annotation.Nullable Map body) { + this.body = body; + } + + + public ModelsFilterResponse enabledAt(@jakarta.annotation.Nullable String enabledAt) { + this.enabledAt = enabledAt; + return this; + } + + /** + * Get enabledAt + * @return enabledAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENABLED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEnabledAt() { + return enabledAt; + } + + + @JsonProperty(value = JSON_PROPERTY_ENABLED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabledAt(@jakarta.annotation.Nullable String enabledAt) { + this.enabledAt = enabledAt; + } + + + public ModelsFilterResponse eventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get eventType + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventType() { + return eventType; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + } + + + public ModelsFilterResponse headers(@jakarta.annotation.Nullable Map headers) { + this.headers = headers; + return this; + } + + public ModelsFilterResponse putHeadersItem(String key, Object headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * Get headers + * @return headers + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getHeaders() { + return headers; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(@jakarta.annotation.Nullable Map headers) { + this.headers = headers; + } + + + public ModelsFilterResponse path(@jakarta.annotation.Nullable Map path) { + this.path = path; + return this; + } + + public ModelsFilterResponse putPathItem(String key, Object pathItem) { + if (this.path == null) { + this.path = new HashMap<>(); + } + this.path.put(key, pathItem); + return this; + } + + /** + * Get path + * @return path + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PATH, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getPath() { + return path; + } + + + @JsonProperty(value = JSON_PROPERTY_PATH, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@jakarta.annotation.Nullable Map path) { + this.path = path; + } + + + public ModelsFilterResponse query(@jakarta.annotation.Nullable Map query) { + this.query = query; + return this; + } + + public ModelsFilterResponse putQueryItem(String key, Object queryItem) { + if (this.query == null) { + this.query = new HashMap<>(); + } + this.query.put(key, queryItem); + return this; + } + + /** + * Get query + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getQuery() { + return query; + } + + + @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setQuery(@jakarta.annotation.Nullable Map query) { + this.query = query; + } + + + public ModelsFilterResponse rawBody(@jakarta.annotation.Nullable Map rawBody) { + this.rawBody = rawBody; + return this; + } + + public ModelsFilterResponse putRawBodyItem(String key, Object rawBodyItem) { + if (this.rawBody == null) { + this.rawBody = new HashMap<>(); + } + this.rawBody.put(key, rawBodyItem); + return this; + } + + /** + * Get rawBody + * @return rawBody + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RAW_BODY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getRawBody() { + return rawBody; + } + + + @JsonProperty(value = JSON_PROPERTY_RAW_BODY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setRawBody(@jakarta.annotation.Nullable Map rawBody) { + this.rawBody = rawBody; + } + + + public ModelsFilterResponse rawHeaders(@jakarta.annotation.Nullable Map rawHeaders) { + this.rawHeaders = rawHeaders; + return this; + } + + public ModelsFilterResponse putRawHeadersItem(String key, Object rawHeadersItem) { + if (this.rawHeaders == null) { + this.rawHeaders = new HashMap<>(); + } + this.rawHeaders.put(key, rawHeadersItem); + return this; + } + + /** + * Get rawHeaders + * @return rawHeaders + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RAW_HEADERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getRawHeaders() { + return rawHeaders; + } + + + @JsonProperty(value = JSON_PROPERTY_RAW_HEADERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setRawHeaders(@jakarta.annotation.Nullable Map rawHeaders) { + this.rawHeaders = rawHeaders; + } + + + public ModelsFilterResponse rawPath(@jakarta.annotation.Nullable Map rawPath) { + this.rawPath = rawPath; + return this; + } + + public ModelsFilterResponse putRawPathItem(String key, Object rawPathItem) { + if (this.rawPath == null) { + this.rawPath = new HashMap<>(); + } + this.rawPath.put(key, rawPathItem); + return this; + } + + /** + * Get rawPath + * @return rawPath + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RAW_PATH, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getRawPath() { + return rawPath; + } + + + @JsonProperty(value = JSON_PROPERTY_RAW_PATH, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setRawPath(@jakarta.annotation.Nullable Map rawPath) { + this.rawPath = rawPath; + } + + + public ModelsFilterResponse rawQuery(@jakarta.annotation.Nullable Map rawQuery) { + this.rawQuery = rawQuery; + return this; + } + + public ModelsFilterResponse putRawQueryItem(String key, Object rawQueryItem) { + if (this.rawQuery == null) { + this.rawQuery = new HashMap<>(); + } + this.rawQuery.put(key, rawQueryItem); + return this; + } + + /** + * Get rawQuery + * @return rawQuery + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RAW_QUERY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getRawQuery() { + return rawQuery; + } + + + @JsonProperty(value = JSON_PROPERTY_RAW_QUERY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setRawQuery(@jakarta.annotation.Nullable Map rawQuery) { + this.rawQuery = rawQuery; + } + + + public ModelsFilterResponse subscriptionId(@jakarta.annotation.Nullable String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get subscriptionId + * @return subscriptionId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SUBSCRIPTION_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubscriptionId() { + return subscriptionId; + } + + + @JsonProperty(value = JSON_PROPERTY_SUBSCRIPTION_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubscriptionId(@jakarta.annotation.Nullable String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + + public ModelsFilterResponse uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + /** + * Return true if this models.FilterResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsFilterResponse modelsFilterResponse = (ModelsFilterResponse) o; + return Objects.equals(this.body, modelsFilterResponse.body) && + Objects.equals(this.enabledAt, modelsFilterResponse.enabledAt) && + Objects.equals(this.eventType, modelsFilterResponse.eventType) && + Objects.equals(this.headers, modelsFilterResponse.headers) && + Objects.equals(this.path, modelsFilterResponse.path) && + Objects.equals(this.query, modelsFilterResponse.query) && + Objects.equals(this.rawBody, modelsFilterResponse.rawBody) && + Objects.equals(this.rawHeaders, modelsFilterResponse.rawHeaders) && + Objects.equals(this.rawPath, modelsFilterResponse.rawPath) && + Objects.equals(this.rawQuery, modelsFilterResponse.rawQuery) && + Objects.equals(this.subscriptionId, modelsFilterResponse.subscriptionId) && + Objects.equals(this.uid, modelsFilterResponse.uid); + } + + @Override + public int hashCode() { + return Objects.hash(body, enabledAt, eventType, headers, path, query, rawBody, rawHeaders, rawPath, rawQuery, subscriptionId, uid); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsFilterResponse {\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" enabledAt: ").append(toIndentedString(enabledAt)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" rawBody: ").append(toIndentedString(rawBody)).append("\n"); + sb.append(" rawHeaders: ").append(toIndentedString(rawHeaders)).append("\n"); + sb.append(" rawPath: ").append(toIndentedString(rawPath)).append("\n"); + sb.append(" rawQuery: ").append(toIndentedString(rawQuery)).append("\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `body` to the URL query string + if (getBody() != null) { + for (String _key : getBody().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbody%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getBody().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBody().get(_key))))); + } + } + + // add `enabled_at` to the URL query string + if (getEnabledAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%senabled_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEnabledAt())))); + } + + // add `event_type` to the URL query string + if (getEventType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventType())))); + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (String _key : getHeaders().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getHeaders().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getHeaders().get(_key))))); + } + } + + // add `path` to the URL query string + if (getPath() != null) { + for (String _key : getPath().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%spath%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getPath().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getPath().get(_key))))); + } + } + + // add `query` to the URL query string + if (getQuery() != null) { + for (String _key : getQuery().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%squery%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getQuery().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getQuery().get(_key))))); + } + } + + // add `raw_body` to the URL query string + if (getRawBody() != null) { + for (String _key : getRawBody().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sraw_body%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getRawBody().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getRawBody().get(_key))))); + } + } + + // add `raw_headers` to the URL query string + if (getRawHeaders() != null) { + for (String _key : getRawHeaders().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sraw_headers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getRawHeaders().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getRawHeaders().get(_key))))); + } + } + + // add `raw_path` to the URL query string + if (getRawPath() != null) { + for (String _key : getRawPath().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sraw_path%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getRawPath().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getRawPath().get(_key))))); + } + } + + // add `raw_query` to the URL query string + if (getRawQuery() != null) { + for (String _key : getRawQuery().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sraw_query%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getRawQuery().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getRawQuery().get(_key))))); + } + } + + // add `subscription_id` to the URL query string + if (getSubscriptionId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssubscription_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSubscriptionId())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsFilterSchema.java b/src/main/java/com/getconvoy/models/ModelsFilterSchema.java new file mode 100644 index 0000000..2fe41b5 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsFilterSchema.java @@ -0,0 +1,299 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsFilterSchema + */ +@JsonPropertyOrder({ + ModelsFilterSchema.JSON_PROPERTY_BODY, + ModelsFilterSchema.JSON_PROPERTY_HEADER, + ModelsFilterSchema.JSON_PROPERTY_PATH, + ModelsFilterSchema.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsFilterSchema { + public static final String JSON_PROPERTY_BODY = "body"; + private JsonNullable body = JsonNullable.of(null); + + public static final String JSON_PROPERTY_HEADER = "header"; + private JsonNullable header = JsonNullable.of(null); + + public static final String JSON_PROPERTY_PATH = "path"; + private JsonNullable path = JsonNullable.of(null); + + public static final String JSON_PROPERTY_QUERY = "query"; + private JsonNullable query = JsonNullable.of(null); + + public ModelsFilterSchema() { + } + + public ModelsFilterSchema body(@jakarta.annotation.Nullable Object body) { + this.body = JsonNullable.of(body); + return this; + } + + /** + * Get body + * @return body + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Object getBody() { + return body.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getBody_JsonNullable() { + return body; + } + + @JsonProperty(JSON_PROPERTY_BODY) + public void setBody_JsonNullable(JsonNullable body) { + this.body = body; + } + + public void setBody(@jakarta.annotation.Nullable Object body) { + this.body = JsonNullable.of(body); + } + + + public ModelsFilterSchema header(@jakarta.annotation.Nullable Object header) { + this.header = JsonNullable.of(header); + return this; + } + + /** + * Get header + * @return header + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Object getHeader() { + return header.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getHeader_JsonNullable() { + return header; + } + + @JsonProperty(JSON_PROPERTY_HEADER) + public void setHeader_JsonNullable(JsonNullable header) { + this.header = header; + } + + public void setHeader(@jakarta.annotation.Nullable Object header) { + this.header = JsonNullable.of(header); + } + + + public ModelsFilterSchema path(@jakarta.annotation.Nullable Object path) { + this.path = JsonNullable.of(path); + return this; + } + + /** + * Get path + * @return path + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Object getPath() { + return path.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_PATH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getPath_JsonNullable() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + public void setPath_JsonNullable(JsonNullable path) { + this.path = path; + } + + public void setPath(@jakarta.annotation.Nullable Object path) { + this.path = JsonNullable.of(path); + } + + + public ModelsFilterSchema query(@jakarta.annotation.Nullable Object query) { + this.query = JsonNullable.of(query); + return this; + } + + /** + * Get query + * @return query + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Object getQuery() { + return query.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getQuery_JsonNullable() { + return query; + } + + @JsonProperty(JSON_PROPERTY_QUERY) + public void setQuery_JsonNullable(JsonNullable query) { + this.query = query; + } + + public void setQuery(@jakarta.annotation.Nullable Object query) { + this.query = JsonNullable.of(query); + } + + + /** + * Return true if this models.FilterSchema object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsFilterSchema modelsFilterSchema = (ModelsFilterSchema) o; + return equalsNullable(this.body, modelsFilterSchema.body) && + equalsNullable(this.header, modelsFilterSchema.header) && + equalsNullable(this.path, modelsFilterSchema.path) && + equalsNullable(this.query, modelsFilterSchema.query); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(body), hashCodeNullable(header), hashCodeNullable(path), hashCodeNullable(query)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsFilterSchema {\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `body` to the URL query string + if (getBody() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbody%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBody())))); + } + + // add `header` to the URL query string + if (getHeader() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheader%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHeader())))); + } + + // add `path` to the URL query string + if (getPath() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spath%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `query` to the URL query string + if (getQuery() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%squery%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getQuery())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsFunctionRequest.java b/src/main/java/com/getconvoy/models/ModelsFunctionRequest.java new file mode 100644 index 0000000..5b4a82b --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsFunctionRequest.java @@ -0,0 +1,234 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsFunctionRequest + */ +@JsonPropertyOrder({ + ModelsFunctionRequest.JSON_PROPERTY_FUNCTION, + ModelsFunctionRequest.JSON_PROPERTY_PAYLOAD, + ModelsFunctionRequest.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsFunctionRequest { + public static final String JSON_PROPERTY_FUNCTION = "function"; + @jakarta.annotation.Nullable + private String function; + + public static final String JSON_PROPERTY_PAYLOAD = "payload"; + @jakarta.annotation.Nullable + private Map payload = new HashMap<>(); + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private String type; + + public ModelsFunctionRequest() { + } + + public ModelsFunctionRequest function(@jakarta.annotation.Nullable String function) { + this.function = function; + return this; + } + + /** + * Get function + * @return function + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFunction() { + return function; + } + + + @JsonProperty(value = JSON_PROPERTY_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFunction(@jakarta.annotation.Nullable String function) { + this.function = function; + } + + + public ModelsFunctionRequest payload(@jakarta.annotation.Nullable Map payload) { + this.payload = payload; + return this; + } + + public ModelsFunctionRequest putPayloadItem(String key, Object payloadItem) { + if (this.payload == null) { + this.payload = new HashMap<>(); + } + this.payload.put(key, payloadItem); + return this; + } + + /** + * Get payload + * @return payload + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PAYLOAD, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getPayload() { + return payload; + } + + + @JsonProperty(value = JSON_PROPERTY_PAYLOAD, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setPayload(@jakarta.annotation.Nullable Map payload) { + this.payload = payload; + } + + + public ModelsFunctionRequest type(@jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + + /** + * Return true if this models.FunctionRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsFunctionRequest modelsFunctionRequest = (ModelsFunctionRequest) o; + return Objects.equals(this.function, modelsFunctionRequest.function) && + Objects.equals(this.payload, modelsFunctionRequest.payload) && + Objects.equals(this.type, modelsFunctionRequest.type); + } + + @Override + public int hashCode() { + return Objects.hash(function, payload, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsFunctionRequest {\n"); + sb.append(" function: ").append(toIndentedString(function)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `function` to the URL query string + if (getFunction() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sfunction%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFunction())))); + } + + // add `payload` to the URL query string + if (getPayload() != null) { + for (String _key : getPayload().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%spayload%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getPayload().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getPayload().get(_key))))); + } + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsFunctionResponse.java b/src/main/java/com/getconvoy/models/ModelsFunctionResponse.java new file mode 100644 index 0000000..40c34dd --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsFunctionResponse.java @@ -0,0 +1,220 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsFunctionResponse + */ +@JsonPropertyOrder({ + ModelsFunctionResponse.JSON_PROPERTY_LOG, + ModelsFunctionResponse.JSON_PROPERTY_PAYLOAD +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsFunctionResponse { + public static final String JSON_PROPERTY_LOG = "log"; + @jakarta.annotation.Nullable + private List log = new ArrayList<>(); + + public static final String JSON_PROPERTY_PAYLOAD = "payload"; + private JsonNullable payload = JsonNullable.of(null); + + public ModelsFunctionResponse() { + } + + public ModelsFunctionResponse log(@jakarta.annotation.Nullable List log) { + this.log = log; + return this; + } + + public ModelsFunctionResponse addLogItem(String logItem) { + if (this.log == null) { + this.log = new ArrayList<>(); + } + this.log.add(logItem); + return this; + } + + /** + * Get log + * @return log + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_LOG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLog() { + return log; + } + + + @JsonProperty(value = JSON_PROPERTY_LOG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLog(@jakarta.annotation.Nullable List log) { + this.log = log; + } + + + public ModelsFunctionResponse payload(@jakarta.annotation.Nullable Object payload) { + this.payload = JsonNullable.of(payload); + return this; + } + + /** + * Get payload + * @return payload + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Object getPayload() { + return payload.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_PAYLOAD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getPayload_JsonNullable() { + return payload; + } + + @JsonProperty(JSON_PROPERTY_PAYLOAD) + public void setPayload_JsonNullable(JsonNullable payload) { + this.payload = payload; + } + + public void setPayload(@jakarta.annotation.Nullable Object payload) { + this.payload = JsonNullable.of(payload); + } + + + /** + * Return true if this models.FunctionResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsFunctionResponse modelsFunctionResponse = (ModelsFunctionResponse) o; + return Objects.equals(this.log, modelsFunctionResponse.log) && + equalsNullable(this.payload, modelsFunctionResponse.payload); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(log, hashCodeNullable(payload)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsFunctionResponse {\n"); + sb.append(" log: ").append(toIndentedString(log)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `log` to the URL query string + if (getLog() != null) { + for (int i = 0; i < getLog().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%slog%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLog().get(i))))); + } + } + + // add `payload` to the URL query string + if (getPayload() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spayload%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPayload())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsGooglePubSubConfig.java b/src/main/java/com/getconvoy/models/ModelsGooglePubSubConfig.java new file mode 100644 index 0000000..a342385 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsGooglePubSubConfig.java @@ -0,0 +1,220 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsGooglePubSubConfig + */ +@JsonPropertyOrder({ + ModelsGooglePubSubConfig.JSON_PROPERTY_PROJECT_ID, + ModelsGooglePubSubConfig.JSON_PROPERTY_SERVICE_ACCOUNT, + ModelsGooglePubSubConfig.JSON_PROPERTY_SUBSCRIPTION_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsGooglePubSubConfig { + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + @jakarta.annotation.Nullable + private String projectId; + + public static final String JSON_PROPERTY_SERVICE_ACCOUNT = "service_account"; + @jakarta.annotation.Nullable + private byte[] serviceAccount; + + public static final String JSON_PROPERTY_SUBSCRIPTION_ID = "subscription_id"; + @jakarta.annotation.Nullable + private String subscriptionId; + + public ModelsGooglePubSubConfig() { + } + + public ModelsGooglePubSubConfig projectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Get projectId + * @return projectId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectId() { + return projectId; + } + + + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProjectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + } + + + public ModelsGooglePubSubConfig serviceAccount(@jakarta.annotation.Nullable byte[] serviceAccount) { + this.serviceAccount = serviceAccount; + return this; + } + + /** + * encoding/json marshals []byte as a base64 string on the wire. + * @return serviceAccount + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SERVICE_ACCOUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getServiceAccount() { + return serviceAccount; + } + + + @JsonProperty(value = JSON_PROPERTY_SERVICE_ACCOUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServiceAccount(@jakarta.annotation.Nullable byte[] serviceAccount) { + this.serviceAccount = serviceAccount; + } + + + public ModelsGooglePubSubConfig subscriptionId(@jakarta.annotation.Nullable String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get subscriptionId + * @return subscriptionId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SUBSCRIPTION_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubscriptionId() { + return subscriptionId; + } + + + @JsonProperty(value = JSON_PROPERTY_SUBSCRIPTION_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubscriptionId(@jakarta.annotation.Nullable String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + + /** + * Return true if this models.GooglePubSubConfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsGooglePubSubConfig modelsGooglePubSubConfig = (ModelsGooglePubSubConfig) o; + return Objects.equals(this.projectId, modelsGooglePubSubConfig.projectId) && + Arrays.equals(this.serviceAccount, modelsGooglePubSubConfig.serviceAccount) && + Objects.equals(this.subscriptionId, modelsGooglePubSubConfig.subscriptionId); + } + + @Override + public int hashCode() { + return Objects.hash(projectId, Arrays.hashCode(serviceAccount), subscriptionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsGooglePubSubConfig {\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" serviceAccount: ").append(toIndentedString(serviceAccount)).append("\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `project_id` to the URL query string + if (getProjectId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sproject_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProjectId())))); + } + + // add `service_account` to the URL query string + if (getServiceAccount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sservice_account%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getServiceAccount())))); + } + + // add `subscription_id` to the URL query string + if (getSubscriptionId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssubscription_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSubscriptionId())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsHMac.java b/src/main/java/com/getconvoy/models/ModelsHMac.java new file mode 100644 index 0000000..7628084 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsHMac.java @@ -0,0 +1,257 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreEncodingType; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsHMac + */ +@JsonPropertyOrder({ + ModelsHMac.JSON_PROPERTY_ENCODING, + ModelsHMac.JSON_PROPERTY_HASH, + ModelsHMac.JSON_PROPERTY_HEADER, + ModelsHMac.JSON_PROPERTY_SECRET +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsHMac { + public static final String JSON_PROPERTY_ENCODING = "encoding"; + @jakarta.annotation.Nonnull + private DatastoreEncodingType encoding; + + public static final String JSON_PROPERTY_HASH = "hash"; + @jakarta.annotation.Nonnull + private String hash; + + public static final String JSON_PROPERTY_HEADER = "header"; + @jakarta.annotation.Nonnull + private String header; + + public static final String JSON_PROPERTY_SECRET = "secret"; + @jakarta.annotation.Nonnull + private String secret; + + public ModelsHMac() { + } + + public ModelsHMac encoding(@jakarta.annotation.Nonnull DatastoreEncodingType encoding) { + this.encoding = encoding; + return this; + } + + /** + * Get encoding + * @return encoding + */ + @jakarta.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ENCODING, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DatastoreEncodingType getEncoding() { + return encoding; + } + + + @JsonProperty(value = JSON_PROPERTY_ENCODING, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEncoding(@jakarta.annotation.Nonnull DatastoreEncodingType encoding) { + this.encoding = encoding; + } + + + public ModelsHMac hash(@jakarta.annotation.Nonnull String hash) { + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + */ + @jakarta.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_HASH, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHash() { + return hash; + } + + + @JsonProperty(value = JSON_PROPERTY_HASH, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHash(@jakarta.annotation.Nonnull String hash) { + this.hash = hash; + } + + + public ModelsHMac header(@jakarta.annotation.Nonnull String header) { + this.header = header; + return this; + } + + /** + * Get header + * @return header + */ + @jakarta.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_HEADER, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHeader() { + return header; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADER, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHeader(@jakarta.annotation.Nonnull String header) { + this.header = header; + } + + + public ModelsHMac secret(@jakarta.annotation.Nonnull String secret) { + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @jakarta.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_SECRET, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSecret() { + return secret; + } + + + @JsonProperty(value = JSON_PROPERTY_SECRET, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSecret(@jakarta.annotation.Nonnull String secret) { + this.secret = secret; + } + + + /** + * Return true if this models.HMac object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsHMac modelsHMac = (ModelsHMac) o; + return Objects.equals(this.encoding, modelsHMac.encoding) && + Objects.equals(this.hash, modelsHMac.hash) && + Objects.equals(this.header, modelsHMac.header) && + Objects.equals(this.secret, modelsHMac.secret); + } + + @Override + public int hashCode() { + return Objects.hash(encoding, hash, header, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsHMac {\n"); + sb.append(" encoding: ").append(toIndentedString(encoding)).append("\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `encoding` to the URL query string + if (getEncoding() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sencoding%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEncoding())))); + } + + // add `hash` to the URL query string + if (getHash() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shash%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHash())))); + } + + // add `header` to the URL query string + if (getHeader() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheader%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHeader())))); + } + + // add `secret` to the URL query string + if (getSecret() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssecret%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSecret())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsIDs.java b/src/main/java/com/getconvoy/models/ModelsIDs.java new file mode 100644 index 0000000..ba81591 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsIDs.java @@ -0,0 +1,162 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsIDs + */ +@JsonPropertyOrder({ + ModelsIDs.JSON_PROPERTY_IDS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsIDs { + public static final String JSON_PROPERTY_IDS = "ids"; + @jakarta.annotation.Nullable + private List ids = new ArrayList<>(); + + public ModelsIDs() { + } + + public ModelsIDs ids(@jakarta.annotation.Nullable List ids) { + this.ids = ids; + return this; + } + + public ModelsIDs addIdsItem(String idsItem) { + if (this.ids == null) { + this.ids = new ArrayList<>(); + } + this.ids.add(idsItem); + return this; + } + + /** + * A list of event delivery IDs to forcefully resend. + * @return ids + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IDS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIds() { + return ids; + } + + + @JsonProperty(value = JSON_PROPERTY_IDS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIds(@jakarta.annotation.Nullable List ids) { + this.ids = ids; + } + + + /** + * Return true if this models.IDs object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsIDs modelsIDs = (ModelsIDs) o; + return Objects.equals(this.ids, modelsIDs.ids); + } + + @Override + public int hashCode() { + return Objects.hash(ids); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsIDs {\n"); + sb.append(" ids: ").append(toIndentedString(ids)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ids` to the URL query string + if (getIds() != null) { + for (int i = 0; i < getIds().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sids%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getIds().get(i))))); + } + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsImportOpenAPISpec.java b/src/main/java/com/getconvoy/models/ModelsImportOpenAPISpec.java new file mode 100644 index 0000000..a5f441d --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsImportOpenAPISpec.java @@ -0,0 +1,148 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsImportOpenAPISpec + */ +@JsonPropertyOrder({ + ModelsImportOpenAPISpec.JSON_PROPERTY_SPEC +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsImportOpenAPISpec { + public static final String JSON_PROPERTY_SPEC = "spec"; + @jakarta.annotation.Nullable + private String spec; + + public ModelsImportOpenAPISpec() { + } + + public ModelsImportOpenAPISpec spec(@jakarta.annotation.Nullable String spec) { + this.spec = spec; + return this; + } + + /** + * Get spec + * @return spec + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SPEC, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSpec() { + return spec; + } + + + @JsonProperty(value = JSON_PROPERTY_SPEC, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSpec(@jakarta.annotation.Nullable String spec) { + this.spec = spec; + } + + + /** + * Return true if this models.ImportOpenAPISpec object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsImportOpenAPISpec modelsImportOpenAPISpec = (ModelsImportOpenAPISpec) o; + return Objects.equals(this.spec, modelsImportOpenAPISpec.spec); + } + + @Override + public int hashCode() { + return Objects.hash(spec); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsImportOpenAPISpec {\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `spec` to the URL query string + if (getSpec() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sspec%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSpec())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsKafkaAuth.java b/src/main/java/com/getconvoy/models/ModelsKafkaAuth.java new file mode 100644 index 0000000..4a598bb --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsKafkaAuth.java @@ -0,0 +1,292 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsKafkaAuth + */ +@JsonPropertyOrder({ + ModelsKafkaAuth.JSON_PROPERTY_HASH, + ModelsKafkaAuth.JSON_PROPERTY_PASSWORD, + ModelsKafkaAuth.JSON_PROPERTY_TLS, + ModelsKafkaAuth.JSON_PROPERTY_TYPE, + ModelsKafkaAuth.JSON_PROPERTY_USERNAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsKafkaAuth { + public static final String JSON_PROPERTY_HASH = "hash"; + @jakarta.annotation.Nullable + private String hash; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + @jakarta.annotation.Nullable + private String password; + + public static final String JSON_PROPERTY_TLS = "tls"; + @jakarta.annotation.Nullable + private Boolean tls; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private String type; + + public static final String JSON_PROPERTY_USERNAME = "username"; + @jakarta.annotation.Nullable + private String username; + + public ModelsKafkaAuth() { + } + + public ModelsKafkaAuth hash(@jakarta.annotation.Nullable String hash) { + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HASH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHash() { + return hash; + } + + + @JsonProperty(value = JSON_PROPERTY_HASH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHash(@jakarta.annotation.Nullable String hash) { + this.hash = hash; + } + + + public ModelsKafkaAuth password(@jakarta.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(@jakarta.annotation.Nullable String password) { + this.password = password; + } + + + public ModelsKafkaAuth tls(@jakarta.annotation.Nullable Boolean tls) { + this.tls = tls; + return this; + } + + /** + * Get tls + * @return tls + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TLS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTls() { + return tls; + } + + + @JsonProperty(value = JSON_PROPERTY_TLS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTls(@jakarta.annotation.Nullable Boolean tls) { + this.tls = tls; + } + + + public ModelsKafkaAuth type(@jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + + public ModelsKafkaAuth username(@jakarta.annotation.Nullable String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; + } + + + @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(@jakarta.annotation.Nullable String username) { + this.username = username; + } + + + /** + * Return true if this models.KafkaAuth object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsKafkaAuth modelsKafkaAuth = (ModelsKafkaAuth) o; + return Objects.equals(this.hash, modelsKafkaAuth.hash) && + Objects.equals(this.password, modelsKafkaAuth.password) && + Objects.equals(this.tls, modelsKafkaAuth.tls) && + Objects.equals(this.type, modelsKafkaAuth.type) && + Objects.equals(this.username, modelsKafkaAuth.username); + } + + @Override + public int hashCode() { + return Objects.hash(hash, password, tls, type, username); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsKafkaAuth {\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" tls: ").append(toIndentedString(tls)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `hash` to the URL query string + if (getHash() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shash%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHash())))); + } + + // add `password` to the URL query string + if (getPassword() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spassword%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPassword())))); + } + + // add `tls` to the URL query string + if (getTls() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stls%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTls())))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `username` to the URL query string + if (getUsername() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%susername%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUsername())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsKafkaPubSubConfig.java b/src/main/java/com/getconvoy/models/ModelsKafkaPubSubConfig.java new file mode 100644 index 0000000..5aa47cd --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsKafkaPubSubConfig.java @@ -0,0 +1,271 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsKafkaAuth; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsKafkaPubSubConfig + */ +@JsonPropertyOrder({ + ModelsKafkaPubSubConfig.JSON_PROPERTY_AUTH, + ModelsKafkaPubSubConfig.JSON_PROPERTY_BROKERS, + ModelsKafkaPubSubConfig.JSON_PROPERTY_CONSUMER_GROUP_ID, + ModelsKafkaPubSubConfig.JSON_PROPERTY_TOPIC_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsKafkaPubSubConfig { + public static final String JSON_PROPERTY_AUTH = "auth"; + @jakarta.annotation.Nullable + private ModelsKafkaAuth auth; + + public static final String JSON_PROPERTY_BROKERS = "brokers"; + @jakarta.annotation.Nullable + private List brokers = new ArrayList<>(); + + public static final String JSON_PROPERTY_CONSUMER_GROUP_ID = "consumer_group_id"; + @jakarta.annotation.Nullable + private String consumerGroupId; + + public static final String JSON_PROPERTY_TOPIC_NAME = "topic_name"; + @jakarta.annotation.Nullable + private String topicName; + + public ModelsKafkaPubSubConfig() { + } + + public ModelsKafkaPubSubConfig auth(@jakarta.annotation.Nullable ModelsKafkaAuth auth) { + this.auth = auth; + return this; + } + + /** + * Get auth + * @return auth + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsKafkaAuth getAuth() { + return auth; + } + + + @JsonProperty(value = JSON_PROPERTY_AUTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuth(@jakarta.annotation.Nullable ModelsKafkaAuth auth) { + this.auth = auth; + } + + + public ModelsKafkaPubSubConfig brokers(@jakarta.annotation.Nullable List brokers) { + this.brokers = brokers; + return this; + } + + public ModelsKafkaPubSubConfig addBrokersItem(String brokersItem) { + if (this.brokers == null) { + this.brokers = new ArrayList<>(); + } + this.brokers.add(brokersItem); + return this; + } + + /** + * Get brokers + * @return brokers + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BROKERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBrokers() { + return brokers; + } + + + @JsonProperty(value = JSON_PROPERTY_BROKERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBrokers(@jakarta.annotation.Nullable List brokers) { + this.brokers = brokers; + } + + + public ModelsKafkaPubSubConfig consumerGroupId(@jakarta.annotation.Nullable String consumerGroupId) { + this.consumerGroupId = consumerGroupId; + return this; + } + + /** + * Get consumerGroupId + * @return consumerGroupId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONSUMER_GROUP_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getConsumerGroupId() { + return consumerGroupId; + } + + + @JsonProperty(value = JSON_PROPERTY_CONSUMER_GROUP_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConsumerGroupId(@jakarta.annotation.Nullable String consumerGroupId) { + this.consumerGroupId = consumerGroupId; + } + + + public ModelsKafkaPubSubConfig topicName(@jakarta.annotation.Nullable String topicName) { + this.topicName = topicName; + return this; + } + + /** + * Get topicName + * @return topicName + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TOPIC_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTopicName() { + return topicName; + } + + + @JsonProperty(value = JSON_PROPERTY_TOPIC_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTopicName(@jakarta.annotation.Nullable String topicName) { + this.topicName = topicName; + } + + + /** + * Return true if this models.KafkaPubSubConfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsKafkaPubSubConfig modelsKafkaPubSubConfig = (ModelsKafkaPubSubConfig) o; + return Objects.equals(this.auth, modelsKafkaPubSubConfig.auth) && + Objects.equals(this.brokers, modelsKafkaPubSubConfig.brokers) && + Objects.equals(this.consumerGroupId, modelsKafkaPubSubConfig.consumerGroupId) && + Objects.equals(this.topicName, modelsKafkaPubSubConfig.topicName); + } + + @Override + public int hashCode() { + return Objects.hash(auth, brokers, consumerGroupId, topicName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsKafkaPubSubConfig {\n"); + sb.append(" auth: ").append(toIndentedString(auth)).append("\n"); + sb.append(" brokers: ").append(toIndentedString(brokers)).append("\n"); + sb.append(" consumerGroupId: ").append(toIndentedString(consumerGroupId)).append("\n"); + sb.append(" topicName: ").append(toIndentedString(topicName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `auth` to the URL query string + if (getAuth() != null) { + joiner.add(getAuth().toUrlQueryString(prefix + "auth" + suffix)); + } + + // add `brokers` to the URL query string + if (getBrokers() != null) { + for (int i = 0; i < getBrokers().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbrokers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getBrokers().get(i))))); + } + } + + // add `consumer_group_id` to the URL query string + if (getConsumerGroupId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sconsumer_group_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getConsumerGroupId())))); + } + + // add `topic_name` to the URL query string + if (getTopicName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stopic_name%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTopicName())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsMetaEventConfiguration.java b/src/main/java/com/getconvoy/models/ModelsMetaEventConfiguration.java new file mode 100644 index 0000000..ff7e531 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsMetaEventConfiguration.java @@ -0,0 +1,306 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsMetaEventConfiguration + */ +@JsonPropertyOrder({ + ModelsMetaEventConfiguration.JSON_PROPERTY_EVENT_TYPE, + ModelsMetaEventConfiguration.JSON_PROPERTY_IS_ENABLED, + ModelsMetaEventConfiguration.JSON_PROPERTY_SECRET, + ModelsMetaEventConfiguration.JSON_PROPERTY_TYPE, + ModelsMetaEventConfiguration.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsMetaEventConfiguration { + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @jakarta.annotation.Nullable + private List eventType = new ArrayList<>(); + + public static final String JSON_PROPERTY_IS_ENABLED = "is_enabled"; + @jakarta.annotation.Nullable + private Boolean isEnabled; + + public static final String JSON_PROPERTY_SECRET = "secret"; + @jakarta.annotation.Nullable + private String secret; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private String type; + + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nullable + private String url; + + public ModelsMetaEventConfiguration() { + } + + public ModelsMetaEventConfiguration eventType(@jakarta.annotation.Nullable List eventType) { + this.eventType = eventType; + return this; + } + + public ModelsMetaEventConfiguration addEventTypeItem(String eventTypeItem) { + if (this.eventType == null) { + this.eventType = new ArrayList<>(); + } + this.eventType.add(eventTypeItem); + return this; + } + + /** + * Get eventType + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEventType() { + return eventType; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventType(@jakarta.annotation.Nullable List eventType) { + this.eventType = eventType; + } + + + public ModelsMetaEventConfiguration isEnabled(@jakarta.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get isEnabled + * @return isEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IS_ENABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsEnabled() { + return isEnabled; + } + + + @JsonProperty(value = JSON_PROPERTY_IS_ENABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsEnabled(@jakarta.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + + public ModelsMetaEventConfiguration secret(@jakarta.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecret() { + return secret; + } + + + @JsonProperty(value = JSON_PROPERTY_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(@jakarta.annotation.Nullable String secret) { + this.secret = secret; + } + + + public ModelsMetaEventConfiguration type(@jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + + public ModelsMetaEventConfiguration url(@jakarta.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = url; + } + + + /** + * Return true if this models.MetaEventConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsMetaEventConfiguration modelsMetaEventConfiguration = (ModelsMetaEventConfiguration) o; + return Objects.equals(this.eventType, modelsMetaEventConfiguration.eventType) && + Objects.equals(this.isEnabled, modelsMetaEventConfiguration.isEnabled) && + Objects.equals(this.secret, modelsMetaEventConfiguration.secret) && + Objects.equals(this.type, modelsMetaEventConfiguration.type) && + Objects.equals(this.url, modelsMetaEventConfiguration.url); + } + + @Override + public int hashCode() { + return Objects.hash(eventType, isEnabled, secret, type, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsMetaEventConfiguration {\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `event_type` to the URL query string + if (getEventType() != null) { + for (int i = 0; i < getEventType().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEventType().get(i))))); + } + } + + // add `is_enabled` to the URL query string + if (getIsEnabled() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sis_enabled%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIsEnabled())))); + } + + // add `secret` to the URL query string + if (getSecret() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssecret%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSecret())))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsMetaEventResponse.java b/src/main/java/com/getconvoy/models/ModelsMetaEventResponse.java new file mode 100644 index 0000000..81affbd --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsMetaEventResponse.java @@ -0,0 +1,439 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreEventDeliveryStatus; +import com.getconvoy.models.DatastoreMetaEventAttempt; +import com.getconvoy.models.DatastoreMetadata; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsMetaEventResponse + */ +@JsonPropertyOrder({ + ModelsMetaEventResponse.JSON_PROPERTY_ATTEMPT, + ModelsMetaEventResponse.JSON_PROPERTY_CREATED_AT, + ModelsMetaEventResponse.JSON_PROPERTY_DELETED_AT, + ModelsMetaEventResponse.JSON_PROPERTY_EVENT_TYPE, + ModelsMetaEventResponse.JSON_PROPERTY_METADATA, + ModelsMetaEventResponse.JSON_PROPERTY_PROJECT_ID, + ModelsMetaEventResponse.JSON_PROPERTY_STATUS, + ModelsMetaEventResponse.JSON_PROPERTY_UID, + ModelsMetaEventResponse.JSON_PROPERTY_UPDATED_AT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsMetaEventResponse { + public static final String JSON_PROPERTY_ATTEMPT = "attempt"; + @jakarta.annotation.Nullable + private DatastoreMetaEventAttempt attempt; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + @jakarta.annotation.Nullable + private String deletedAt; + + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @jakarta.annotation.Nullable + private String eventType; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @jakarta.annotation.Nullable + private DatastoreMetadata metadata; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + @jakarta.annotation.Nullable + private String projectId; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private DatastoreEventDeliveryStatus status; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + @jakarta.annotation.Nullable + private String updatedAt; + + public ModelsMetaEventResponse() { + } + + public ModelsMetaEventResponse attempt(@jakarta.annotation.Nullable DatastoreMetaEventAttempt attempt) { + this.attempt = attempt; + return this; + } + + /** + * Get attempt + * @return attempt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ATTEMPT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreMetaEventAttempt getAttempt() { + return attempt; + } + + + @JsonProperty(value = JSON_PROPERTY_ATTEMPT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttempt(@jakarta.annotation.Nullable DatastoreMetaEventAttempt attempt) { + this.attempt = attempt; + } + + + public ModelsMetaEventResponse createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public ModelsMetaEventResponse deletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Get deletedAt + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + } + + + public ModelsMetaEventResponse eventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get eventType + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventType() { + return eventType; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + } + + + public ModelsMetaEventResponse metadata(@jakarta.annotation.Nullable DatastoreMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreMetadata getMetadata() { + return metadata; + } + + + @JsonProperty(value = JSON_PROPERTY_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@jakarta.annotation.Nullable DatastoreMetadata metadata) { + this.metadata = metadata; + } + + + public ModelsMetaEventResponse projectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Get projectId + * @return projectId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectId() { + return projectId; + } + + + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProjectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + } + + + public ModelsMetaEventResponse status(@jakarta.annotation.Nullable DatastoreEventDeliveryStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreEventDeliveryStatus getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable DatastoreEventDeliveryStatus status) { + this.status = status; + } + + + public ModelsMetaEventResponse uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + public ModelsMetaEventResponse updatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + /** + * Return true if this models.MetaEventResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsMetaEventResponse modelsMetaEventResponse = (ModelsMetaEventResponse) o; + return Objects.equals(this.attempt, modelsMetaEventResponse.attempt) && + Objects.equals(this.createdAt, modelsMetaEventResponse.createdAt) && + Objects.equals(this.deletedAt, modelsMetaEventResponse.deletedAt) && + Objects.equals(this.eventType, modelsMetaEventResponse.eventType) && + Objects.equals(this.metadata, modelsMetaEventResponse.metadata) && + Objects.equals(this.projectId, modelsMetaEventResponse.projectId) && + Objects.equals(this.status, modelsMetaEventResponse.status) && + Objects.equals(this.uid, modelsMetaEventResponse.uid) && + Objects.equals(this.updatedAt, modelsMetaEventResponse.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(attempt, createdAt, deletedAt, eventType, metadata, projectId, status, uid, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsMetaEventResponse {\n"); + sb.append(" attempt: ").append(toIndentedString(attempt)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `attempt` to the URL query string + if (getAttempt() != null) { + joiner.add(getAttempt().toUrlQueryString(prefix + "attempt" + suffix)); + } + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `deleted_at` to the URL query string + if (getDeletedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeleted_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeletedAt())))); + } + + // add `event_type` to the URL query string + if (getEventType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventType())))); + } + + // add `metadata` to the URL query string + if (getMetadata() != null) { + joiner.add(getMetadata().toUrlQueryString(prefix + "metadata" + suffix)); + } + + // add `project_id` to the URL query string + if (getProjectId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sproject_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProjectId())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + // add `updated_at` to the URL query string + if (getUpdatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%supdated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpdatedAt())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsMtlsClientCert.java b/src/main/java/com/getconvoy/models/ModelsMtlsClientCert.java new file mode 100644 index 0000000..4615ff3 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsMtlsClientCert.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsMtlsClientCert + */ +@JsonPropertyOrder({ + ModelsMtlsClientCert.JSON_PROPERTY_CLIENT_CERT, + ModelsMtlsClientCert.JSON_PROPERTY_CLIENT_KEY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsMtlsClientCert { + public static final String JSON_PROPERTY_CLIENT_CERT = "client_cert"; + @jakarta.annotation.Nullable + private String clientCert; + + public static final String JSON_PROPERTY_CLIENT_KEY = "client_key"; + @jakarta.annotation.Nullable + private String clientKey; + + public ModelsMtlsClientCert() { + } + + public ModelsMtlsClientCert clientCert(@jakarta.annotation.Nullable String clientCert) { + this.clientCert = clientCert; + return this; + } + + /** + * ClientCert is the client certificate PEM string + * @return clientCert + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CLIENT_CERT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientCert() { + return clientCert; + } + + + @JsonProperty(value = JSON_PROPERTY_CLIENT_CERT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientCert(@jakarta.annotation.Nullable String clientCert) { + this.clientCert = clientCert; + } + + + public ModelsMtlsClientCert clientKey(@jakarta.annotation.Nullable String clientKey) { + this.clientKey = clientKey; + return this; + } + + /** + * ClientKey is the client private key PEM string + * @return clientKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CLIENT_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientKey() { + return clientKey; + } + + + @JsonProperty(value = JSON_PROPERTY_CLIENT_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientKey(@jakarta.annotation.Nullable String clientKey) { + this.clientKey = clientKey; + } + + + /** + * Return true if this models.MtlsClientCert object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsMtlsClientCert modelsMtlsClientCert = (ModelsMtlsClientCert) o; + return Objects.equals(this.clientCert, modelsMtlsClientCert.clientCert) && + Objects.equals(this.clientKey, modelsMtlsClientCert.clientKey); + } + + @Override + public int hashCode() { + return Objects.hash(clientCert, clientKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsMtlsClientCert {\n"); + sb.append(" clientCert: ").append(toIndentedString(clientCert)).append("\n"); + sb.append(" clientKey: ").append(toIndentedString(clientKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `client_cert` to the URL query string + if (getClientCert() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclient_cert%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getClientCert())))); + } + + // add `client_key` to the URL query string + if (getClientKey() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclient_key%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getClientKey())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsOAuth2.java b/src/main/java/com/getconvoy/models/ModelsOAuth2.java new file mode 100644 index 0000000..24deed4 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsOAuth2.java @@ -0,0 +1,582 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsOAuth2FieldMapping; +import com.getconvoy.models.ModelsOAuth2SigningKey; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsOAuth2 + */ +@JsonPropertyOrder({ + ModelsOAuth2.JSON_PROPERTY_AUDIENCE, + ModelsOAuth2.JSON_PROPERTY_AUTHENTICATION_TYPE, + ModelsOAuth2.JSON_PROPERTY_CLIENT_ID, + ModelsOAuth2.JSON_PROPERTY_CLIENT_SECRET, + ModelsOAuth2.JSON_PROPERTY_EXPIRY_TIME_UNIT, + ModelsOAuth2.JSON_PROPERTY_FIELD_MAPPING, + ModelsOAuth2.JSON_PROPERTY_GRANT_TYPE, + ModelsOAuth2.JSON_PROPERTY_ISSUER, + ModelsOAuth2.JSON_PROPERTY_SCOPE, + ModelsOAuth2.JSON_PROPERTY_SIGNING_ALGORITHM, + ModelsOAuth2.JSON_PROPERTY_SIGNING_KEY, + ModelsOAuth2.JSON_PROPERTY_SUBJECT, + ModelsOAuth2.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsOAuth2 { + public static final String JSON_PROPERTY_AUDIENCE = "audience"; + @jakarta.annotation.Nullable + private String audience; + + public static final String JSON_PROPERTY_AUTHENTICATION_TYPE = "authentication_type"; + @jakarta.annotation.Nullable + private String authenticationType; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @jakarta.annotation.Nullable + private String clientId; + + public static final String JSON_PROPERTY_CLIENT_SECRET = "client_secret"; + @jakarta.annotation.Nullable + private String clientSecret; + + public static final String JSON_PROPERTY_EXPIRY_TIME_UNIT = "expiry_time_unit"; + @jakarta.annotation.Nullable + private String expiryTimeUnit; + + public static final String JSON_PROPERTY_FIELD_MAPPING = "field_mapping"; + @jakarta.annotation.Nullable + private ModelsOAuth2FieldMapping fieldMapping; + + public static final String JSON_PROPERTY_GRANT_TYPE = "grant_type"; + @jakarta.annotation.Nullable + private String grantType; + + public static final String JSON_PROPERTY_ISSUER = "issuer"; + @jakarta.annotation.Nullable + private String issuer; + + public static final String JSON_PROPERTY_SCOPE = "scope"; + @jakarta.annotation.Nullable + private String scope; + + public static final String JSON_PROPERTY_SIGNING_ALGORITHM = "signing_algorithm"; + @jakarta.annotation.Nullable + private String signingAlgorithm; + + public static final String JSON_PROPERTY_SIGNING_KEY = "signing_key"; + @jakarta.annotation.Nullable + private ModelsOAuth2SigningKey signingKey; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @jakarta.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nullable + private String url; + + public ModelsOAuth2() { + } + + public ModelsOAuth2 audience(@jakarta.annotation.Nullable String audience) { + this.audience = audience; + return this; + } + + /** + * Get audience + * @return audience + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUDIENCE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAudience() { + return audience; + } + + + @JsonProperty(value = JSON_PROPERTY_AUDIENCE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudience(@jakarta.annotation.Nullable String audience) { + this.audience = audience; + } + + + public ModelsOAuth2 authenticationType(@jakarta.annotation.Nullable String authenticationType) { + this.authenticationType = authenticationType; + return this; + } + + /** + * Get authenticationType + * @return authenticationType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUTHENTICATION_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthenticationType() { + return authenticationType; + } + + + @JsonProperty(value = JSON_PROPERTY_AUTHENTICATION_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthenticationType(@jakarta.annotation.Nullable String authenticationType) { + this.authenticationType = authenticationType; + } + + + public ModelsOAuth2 clientId(@jakarta.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CLIENT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientId() { + return clientId; + } + + + @JsonProperty(value = JSON_PROPERTY_CLIENT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(@jakarta.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public ModelsOAuth2 clientSecret(@jakarta.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get clientSecret + * @return clientSecret + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CLIENT_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientSecret() { + return clientSecret; + } + + + @JsonProperty(value = JSON_PROPERTY_CLIENT_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientSecret(@jakarta.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + + public ModelsOAuth2 expiryTimeUnit(@jakarta.annotation.Nullable String expiryTimeUnit) { + this.expiryTimeUnit = expiryTimeUnit; + return this; + } + + /** + * Expiry time unit (seconds, milliseconds, minutes, hours) + * @return expiryTimeUnit + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EXPIRY_TIME_UNIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpiryTimeUnit() { + return expiryTimeUnit; + } + + + @JsonProperty(value = JSON_PROPERTY_EXPIRY_TIME_UNIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiryTimeUnit(@jakarta.annotation.Nullable String expiryTimeUnit) { + this.expiryTimeUnit = expiryTimeUnit; + } + + + public ModelsOAuth2 fieldMapping(@jakarta.annotation.Nullable ModelsOAuth2FieldMapping fieldMapping) { + this.fieldMapping = fieldMapping; + return this; + } + + /** + * Field mapping for flexible token response parsing + * @return fieldMapping + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FIELD_MAPPING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsOAuth2FieldMapping getFieldMapping() { + return fieldMapping; + } + + + @JsonProperty(value = JSON_PROPERTY_FIELD_MAPPING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldMapping(@jakarta.annotation.Nullable ModelsOAuth2FieldMapping fieldMapping) { + this.fieldMapping = fieldMapping; + } + + + public ModelsOAuth2 grantType(@jakarta.annotation.Nullable String grantType) { + this.grantType = grantType; + return this; + } + + /** + * Get grantType + * @return grantType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_GRANT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGrantType() { + return grantType; + } + + + @JsonProperty(value = JSON_PROPERTY_GRANT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGrantType(@jakarta.annotation.Nullable String grantType) { + this.grantType = grantType; + } + + + public ModelsOAuth2 issuer(@jakarta.annotation.Nullable String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get issuer + * @return issuer + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ISSUER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIssuer() { + return issuer; + } + + + @JsonProperty(value = JSON_PROPERTY_ISSUER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIssuer(@jakarta.annotation.Nullable String issuer) { + this.issuer = issuer; + } + + + public ModelsOAuth2 scope(@jakarta.annotation.Nullable String scope) { + this.scope = scope; + return this; + } + + /** + * Get scope + * @return scope + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SCOPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScope() { + return scope; + } + + + @JsonProperty(value = JSON_PROPERTY_SCOPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScope(@jakarta.annotation.Nullable String scope) { + this.scope = scope; + } + + + public ModelsOAuth2 signingAlgorithm(@jakarta.annotation.Nullable String signingAlgorithm) { + this.signingAlgorithm = signingAlgorithm; + return this; + } + + /** + * Get signingAlgorithm + * @return signingAlgorithm + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SIGNING_ALGORITHM, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningAlgorithm() { + return signingAlgorithm; + } + + + @JsonProperty(value = JSON_PROPERTY_SIGNING_ALGORITHM, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningAlgorithm(@jakarta.annotation.Nullable String signingAlgorithm) { + this.signingAlgorithm = signingAlgorithm; + } + + + public ModelsOAuth2 signingKey(@jakarta.annotation.Nullable ModelsOAuth2SigningKey signingKey) { + this.signingKey = signingKey; + return this; + } + + /** + * Get signingKey + * @return signingKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SIGNING_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsOAuth2SigningKey getSigningKey() { + return signingKey; + } + + + @JsonProperty(value = JSON_PROPERTY_SIGNING_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningKey(@jakarta.annotation.Nullable ModelsOAuth2SigningKey signingKey) { + this.signingKey = signingKey; + } + + + public ModelsOAuth2 subject(@jakarta.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * Get subject + * @return subject + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SUBJECT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } + + + @JsonProperty(value = JSON_PROPERTY_SUBJECT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@jakarta.annotation.Nullable String subject) { + this.subject = subject; + } + + + public ModelsOAuth2 url(@jakarta.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = url; + } + + + /** + * Return true if this models.OAuth2 object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsOAuth2 modelsOAuth2 = (ModelsOAuth2) o; + return Objects.equals(this.audience, modelsOAuth2.audience) && + Objects.equals(this.authenticationType, modelsOAuth2.authenticationType) && + Objects.equals(this.clientId, modelsOAuth2.clientId) && + Objects.equals(this.clientSecret, modelsOAuth2.clientSecret) && + Objects.equals(this.expiryTimeUnit, modelsOAuth2.expiryTimeUnit) && + Objects.equals(this.fieldMapping, modelsOAuth2.fieldMapping) && + Objects.equals(this.grantType, modelsOAuth2.grantType) && + Objects.equals(this.issuer, modelsOAuth2.issuer) && + Objects.equals(this.scope, modelsOAuth2.scope) && + Objects.equals(this.signingAlgorithm, modelsOAuth2.signingAlgorithm) && + Objects.equals(this.signingKey, modelsOAuth2.signingKey) && + Objects.equals(this.subject, modelsOAuth2.subject) && + Objects.equals(this.url, modelsOAuth2.url); + } + + @Override + public int hashCode() { + return Objects.hash(audience, authenticationType, clientId, clientSecret, expiryTimeUnit, fieldMapping, grantType, issuer, scope, signingAlgorithm, signingKey, subject, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsOAuth2 {\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append(" authenticationType: ").append(toIndentedString(authenticationType)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" expiryTimeUnit: ").append(toIndentedString(expiryTimeUnit)).append("\n"); + sb.append(" fieldMapping: ").append(toIndentedString(fieldMapping)).append("\n"); + sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" signingAlgorithm: ").append(toIndentedString(signingAlgorithm)).append("\n"); + sb.append(" signingKey: ").append(toIndentedString(signingKey)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `audience` to the URL query string + if (getAudience() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%saudience%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAudience())))); + } + + // add `authentication_type` to the URL query string + if (getAuthenticationType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sauthentication_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAuthenticationType())))); + } + + // add `client_id` to the URL query string + if (getClientId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclient_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getClientId())))); + } + + // add `client_secret` to the URL query string + if (getClientSecret() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclient_secret%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getClientSecret())))); + } + + // add `expiry_time_unit` to the URL query string + if (getExpiryTimeUnit() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sexpiry_time_unit%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getExpiryTimeUnit())))); + } + + // add `field_mapping` to the URL query string + if (getFieldMapping() != null) { + joiner.add(getFieldMapping().toUrlQueryString(prefix + "field_mapping" + suffix)); + } + + // add `grant_type` to the URL query string + if (getGrantType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sgrant_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getGrantType())))); + } + + // add `issuer` to the URL query string + if (getIssuer() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sissuer%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIssuer())))); + } + + // add `scope` to the URL query string + if (getScope() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sscope%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getScope())))); + } + + // add `signing_algorithm` to the URL query string + if (getSigningAlgorithm() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssigning_algorithm%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSigningAlgorithm())))); + } + + // add `signing_key` to the URL query string + if (getSigningKey() != null) { + joiner.add(getSigningKey().toUrlQueryString(prefix + "signing_key" + suffix)); + } + + // add `subject` to the URL query string + if (getSubject() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssubject%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSubject())))); + } + + // add `url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsOAuth2FieldMapping.java b/src/main/java/com/getconvoy/models/ModelsOAuth2FieldMapping.java new file mode 100644 index 0000000..b5d15e1 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsOAuth2FieldMapping.java @@ -0,0 +1,220 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsOAuth2FieldMapping + */ +@JsonPropertyOrder({ + ModelsOAuth2FieldMapping.JSON_PROPERTY_ACCESS_TOKEN, + ModelsOAuth2FieldMapping.JSON_PROPERTY_EXPIRES_IN, + ModelsOAuth2FieldMapping.JSON_PROPERTY_TOKEN_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsOAuth2FieldMapping { + public static final String JSON_PROPERTY_ACCESS_TOKEN = "access_token"; + @jakarta.annotation.Nullable + private String accessToken; + + public static final String JSON_PROPERTY_EXPIRES_IN = "expires_in"; + @jakarta.annotation.Nullable + private String expiresIn; + + public static final String JSON_PROPERTY_TOKEN_TYPE = "token_type"; + @jakarta.annotation.Nullable + private String tokenType; + + public ModelsOAuth2FieldMapping() { + } + + public ModelsOAuth2FieldMapping accessToken(@jakarta.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Field name for access token (e.g., \"accessToken\", \"access_token\", \"token\") + * @return accessToken + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ACCESS_TOKEN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccessToken() { + return accessToken; + } + + + @JsonProperty(value = JSON_PROPERTY_ACCESS_TOKEN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessToken(@jakarta.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public ModelsOAuth2FieldMapping expiresIn(@jakarta.annotation.Nullable String expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Field name for expiry time (e.g., \"expiresIn\", \"expires_in\", \"expiresAt\") + * @return expiresIn + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EXPIRES_IN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpiresIn() { + return expiresIn; + } + + + @JsonProperty(value = JSON_PROPERTY_EXPIRES_IN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresIn(@jakarta.annotation.Nullable String expiresIn) { + this.expiresIn = expiresIn; + } + + + public ModelsOAuth2FieldMapping tokenType(@jakarta.annotation.Nullable String tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Field name for token type (e.g., \"tokenType\", \"token_type\") + * @return tokenType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TOKEN_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTokenType() { + return tokenType; + } + + + @JsonProperty(value = JSON_PROPERTY_TOKEN_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTokenType(@jakarta.annotation.Nullable String tokenType) { + this.tokenType = tokenType; + } + + + /** + * Return true if this models.OAuth2FieldMapping object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsOAuth2FieldMapping modelsOAuth2FieldMapping = (ModelsOAuth2FieldMapping) o; + return Objects.equals(this.accessToken, modelsOAuth2FieldMapping.accessToken) && + Objects.equals(this.expiresIn, modelsOAuth2FieldMapping.expiresIn) && + Objects.equals(this.tokenType, modelsOAuth2FieldMapping.tokenType); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, expiresIn, tokenType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsOAuth2FieldMapping {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `access_token` to the URL query string + if (getAccessToken() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%saccess_token%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAccessToken())))); + } + + // add `expires_in` to the URL query string + if (getExpiresIn() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sexpires_in%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getExpiresIn())))); + } + + // add `token_type` to the URL query string + if (getTokenType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stoken_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTokenType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsOAuth2SigningKey.java b/src/main/java/com/getconvoy/models/ModelsOAuth2SigningKey.java new file mode 100644 index 0000000..d7162ce --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsOAuth2SigningKey.java @@ -0,0 +1,580 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsOAuth2SigningKey + */ +@JsonPropertyOrder({ + ModelsOAuth2SigningKey.JSON_PROPERTY_CRV, + ModelsOAuth2SigningKey.JSON_PROPERTY_D, + ModelsOAuth2SigningKey.JSON_PROPERTY_DP, + ModelsOAuth2SigningKey.JSON_PROPERTY_DQ, + ModelsOAuth2SigningKey.JSON_PROPERTY_E, + ModelsOAuth2SigningKey.JSON_PROPERTY_KID, + ModelsOAuth2SigningKey.JSON_PROPERTY_KTY, + ModelsOAuth2SigningKey.JSON_PROPERTY_N, + ModelsOAuth2SigningKey.JSON_PROPERTY_P, + ModelsOAuth2SigningKey.JSON_PROPERTY_Q, + ModelsOAuth2SigningKey.JSON_PROPERTY_QI, + ModelsOAuth2SigningKey.JSON_PROPERTY_X, + ModelsOAuth2SigningKey.JSON_PROPERTY_Y +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsOAuth2SigningKey { + public static final String JSON_PROPERTY_CRV = "crv"; + @jakarta.annotation.Nullable + private String crv; + + public static final String JSON_PROPERTY_D = "d"; + @jakarta.annotation.Nullable + private String d; + + public static final String JSON_PROPERTY_DP = "dp"; + @jakarta.annotation.Nullable + private String dp; + + public static final String JSON_PROPERTY_DQ = "dq"; + @jakarta.annotation.Nullable + private String dq; + + public static final String JSON_PROPERTY_E = "e"; + @jakarta.annotation.Nullable + private String e; + + public static final String JSON_PROPERTY_KID = "kid"; + @jakarta.annotation.Nullable + private String kid; + + public static final String JSON_PROPERTY_KTY = "kty"; + @jakarta.annotation.Nullable + private String kty; + + public static final String JSON_PROPERTY_N = "n"; + @jakarta.annotation.Nullable + private String n; + + public static final String JSON_PROPERTY_P = "p"; + @jakarta.annotation.Nullable + private String p; + + public static final String JSON_PROPERTY_Q = "q"; + @jakarta.annotation.Nullable + private String q; + + public static final String JSON_PROPERTY_QI = "qi"; + @jakarta.annotation.Nullable + private String qi; + + public static final String JSON_PROPERTY_X = "x"; + @jakarta.annotation.Nullable + private String x; + + public static final String JSON_PROPERTY_Y = "y"; + @jakarta.annotation.Nullable + private String y; + + public ModelsOAuth2SigningKey() { + } + + public ModelsOAuth2SigningKey crv(@jakarta.annotation.Nullable String crv) { + this.crv = crv; + return this; + } + + /** + * EC (Elliptic Curve) key fields + * @return crv + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CRV, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCrv() { + return crv; + } + + + @JsonProperty(value = JSON_PROPERTY_CRV, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCrv(@jakarta.annotation.Nullable String crv) { + this.crv = crv; + } + + + public ModelsOAuth2SigningKey d(@jakarta.annotation.Nullable String d) { + this.d = d; + return this; + } + + /** + * Private key (EC) or private exponent (RSA) + * @return d + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_D, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getD() { + return d; + } + + + @JsonProperty(value = JSON_PROPERTY_D, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setD(@jakarta.annotation.Nullable String d) { + this.d = d; + } + + + public ModelsOAuth2SigningKey dp(@jakarta.annotation.Nullable String dp) { + this.dp = dp; + return this; + } + + /** + * RSA first factor CRT exponent (RSA private key only) + * @return dp + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDp() { + return dp; + } + + + @JsonProperty(value = JSON_PROPERTY_DP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDp(@jakarta.annotation.Nullable String dp) { + this.dp = dp; + } + + + public ModelsOAuth2SigningKey dq(@jakarta.annotation.Nullable String dq) { + this.dq = dq; + return this; + } + + /** + * RSA second factor CRT exponent (RSA private key only) + * @return dq + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DQ, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDq() { + return dq; + } + + + @JsonProperty(value = JSON_PROPERTY_DQ, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDq(@jakarta.annotation.Nullable String dq) { + this.dq = dq; + } + + + public ModelsOAuth2SigningKey e(@jakarta.annotation.Nullable String e) { + this.e = e; + return this; + } + + /** + * RSA public exponent (RSA only) + * @return e + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_E, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getE() { + return e; + } + + + @JsonProperty(value = JSON_PROPERTY_E, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setE(@jakarta.annotation.Nullable String e) { + this.e = e; + } + + + public ModelsOAuth2SigningKey kid(@jakarta.annotation.Nullable String kid) { + this.kid = kid; + return this; + } + + /** + * Key ID + * @return kid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_KID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKid() { + return kid; + } + + + @JsonProperty(value = JSON_PROPERTY_KID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKid(@jakarta.annotation.Nullable String kid) { + this.kid = kid; + } + + + public ModelsOAuth2SigningKey kty(@jakarta.annotation.Nullable String kty) { + this.kty = kty; + return this; + } + + /** + * Key type: \"EC\" or \"RSA\" + * @return kty + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_KTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKty() { + return kty; + } + + + @JsonProperty(value = JSON_PROPERTY_KTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKty(@jakarta.annotation.Nullable String kty) { + this.kty = kty; + } + + + public ModelsOAuth2SigningKey n(@jakarta.annotation.Nullable String n) { + this.n = n; + return this; + } + + /** + * RSA key fields + * @return n + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_N, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getN() { + return n; + } + + + @JsonProperty(value = JSON_PROPERTY_N, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setN(@jakarta.annotation.Nullable String n) { + this.n = n; + } + + + public ModelsOAuth2SigningKey p(@jakarta.annotation.Nullable String p) { + this.p = p; + return this; + } + + /** + * RSA first prime factor (RSA private key only) + * @return p + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_P, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getP() { + return p; + } + + + @JsonProperty(value = JSON_PROPERTY_P, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setP(@jakarta.annotation.Nullable String p) { + this.p = p; + } + + + public ModelsOAuth2SigningKey q(@jakarta.annotation.Nullable String q) { + this.q = q; + return this; + } + + /** + * RSA second prime factor (RSA private key only) + * @return q + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_Q, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQ() { + return q; + } + + + @JsonProperty(value = JSON_PROPERTY_Q, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQ(@jakarta.annotation.Nullable String q) { + this.q = q; + } + + + public ModelsOAuth2SigningKey qi(@jakarta.annotation.Nullable String qi) { + this.qi = qi; + return this; + } + + /** + * RSA first CRT coefficient (RSA private key only) + * @return qi + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_QI, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQi() { + return qi; + } + + + @JsonProperty(value = JSON_PROPERTY_QI, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQi(@jakarta.annotation.Nullable String qi) { + this.qi = qi; + } + + + public ModelsOAuth2SigningKey x(@jakarta.annotation.Nullable String x) { + this.x = x; + return this; + } + + /** + * X coordinate (EC only) + * @return x + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_X, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getX() { + return x; + } + + + @JsonProperty(value = JSON_PROPERTY_X, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setX(@jakarta.annotation.Nullable String x) { + this.x = x; + } + + + public ModelsOAuth2SigningKey y(@jakarta.annotation.Nullable String y) { + this.y = y; + return this; + } + + /** + * Y coordinate (EC only) + * @return y + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_Y, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getY() { + return y; + } + + + @JsonProperty(value = JSON_PROPERTY_Y, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setY(@jakarta.annotation.Nullable String y) { + this.y = y; + } + + + /** + * Return true if this models.OAuth2SigningKey object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsOAuth2SigningKey modelsOAuth2SigningKey = (ModelsOAuth2SigningKey) o; + return Objects.equals(this.crv, modelsOAuth2SigningKey.crv) && + Objects.equals(this.d, modelsOAuth2SigningKey.d) && + Objects.equals(this.dp, modelsOAuth2SigningKey.dp) && + Objects.equals(this.dq, modelsOAuth2SigningKey.dq) && + Objects.equals(this.e, modelsOAuth2SigningKey.e) && + Objects.equals(this.kid, modelsOAuth2SigningKey.kid) && + Objects.equals(this.kty, modelsOAuth2SigningKey.kty) && + Objects.equals(this.n, modelsOAuth2SigningKey.n) && + Objects.equals(this.p, modelsOAuth2SigningKey.p) && + Objects.equals(this.q, modelsOAuth2SigningKey.q) && + Objects.equals(this.qi, modelsOAuth2SigningKey.qi) && + Objects.equals(this.x, modelsOAuth2SigningKey.x) && + Objects.equals(this.y, modelsOAuth2SigningKey.y); + } + + @Override + public int hashCode() { + return Objects.hash(crv, d, dp, dq, e, kid, kty, n, p, q, qi, x, y); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsOAuth2SigningKey {\n"); + sb.append(" crv: ").append(toIndentedString(crv)).append("\n"); + sb.append(" d: ").append(toIndentedString(d)).append("\n"); + sb.append(" dp: ").append(toIndentedString(dp)).append("\n"); + sb.append(" dq: ").append(toIndentedString(dq)).append("\n"); + sb.append(" e: ").append(toIndentedString(e)).append("\n"); + sb.append(" kid: ").append(toIndentedString(kid)).append("\n"); + sb.append(" kty: ").append(toIndentedString(kty)).append("\n"); + sb.append(" n: ").append(toIndentedString(n)).append("\n"); + sb.append(" p: ").append(toIndentedString(p)).append("\n"); + sb.append(" q: ").append(toIndentedString(q)).append("\n"); + sb.append(" qi: ").append(toIndentedString(qi)).append("\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `crv` to the URL query string + if (getCrv() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scrv%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCrv())))); + } + + // add `d` to the URL query string + if (getD() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sd%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getD())))); + } + + // add `dp` to the URL query string + if (getDp() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdp%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDp())))); + } + + // add `dq` to the URL query string + if (getDq() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdq%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDq())))); + } + + // add `e` to the URL query string + if (getE() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%se%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getE())))); + } + + // add `kid` to the URL query string + if (getKid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%skid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getKid())))); + } + + // add `kty` to the URL query string + if (getKty() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%skty%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getKty())))); + } + + // add `n` to the URL query string + if (getN() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sn%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getN())))); + } + + // add `p` to the URL query string + if (getP() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sp%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getP())))); + } + + // add `q` to the URL query string + if (getQ() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sq%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getQ())))); + } + + // add `qi` to the URL query string + if (getQi() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sqi%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getQi())))); + } + + // add `x` to the URL query string + if (getX() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sx%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getX())))); + } + + // add `y` to the URL query string + if (getY() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sy%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getY())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsOnboardItem.java b/src/main/java/com/getconvoy/models/ModelsOnboardItem.java new file mode 100644 index 0000000..4cdaa97 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsOnboardItem.java @@ -0,0 +1,292 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsOnboardItem + */ +@JsonPropertyOrder({ + ModelsOnboardItem.JSON_PROPERTY_AUTH_PASSWORD, + ModelsOnboardItem.JSON_PROPERTY_AUTH_USERNAME, + ModelsOnboardItem.JSON_PROPERTY_EVENT_TYPE, + ModelsOnboardItem.JSON_PROPERTY_NAME, + ModelsOnboardItem.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsOnboardItem { + public static final String JSON_PROPERTY_AUTH_PASSWORD = "auth_password"; + @jakarta.annotation.Nullable + private String authPassword; + + public static final String JSON_PROPERTY_AUTH_USERNAME = "auth_username"; + @jakarta.annotation.Nullable + private String authUsername; + + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @jakarta.annotation.Nullable + private String eventType; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nullable + private String url; + + public ModelsOnboardItem() { + } + + public ModelsOnboardItem authPassword(@jakarta.annotation.Nullable String authPassword) { + this.authPassword = authPassword; + return this; + } + + /** + * Get authPassword + * @return authPassword + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUTH_PASSWORD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthPassword() { + return authPassword; + } + + + @JsonProperty(value = JSON_PROPERTY_AUTH_PASSWORD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthPassword(@jakarta.annotation.Nullable String authPassword) { + this.authPassword = authPassword; + } + + + public ModelsOnboardItem authUsername(@jakarta.annotation.Nullable String authUsername) { + this.authUsername = authUsername; + return this; + } + + /** + * Get authUsername + * @return authUsername + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUTH_USERNAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthUsername() { + return authUsername; + } + + + @JsonProperty(value = JSON_PROPERTY_AUTH_USERNAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthUsername(@jakarta.annotation.Nullable String authUsername) { + this.authUsername = authUsername; + } + + + public ModelsOnboardItem eventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get eventType + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventType() { + return eventType; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + } + + + public ModelsOnboardItem name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public ModelsOnboardItem url(@jakarta.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = url; + } + + + /** + * Return true if this models.OnboardItem object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsOnboardItem modelsOnboardItem = (ModelsOnboardItem) o; + return Objects.equals(this.authPassword, modelsOnboardItem.authPassword) && + Objects.equals(this.authUsername, modelsOnboardItem.authUsername) && + Objects.equals(this.eventType, modelsOnboardItem.eventType) && + Objects.equals(this.name, modelsOnboardItem.name) && + Objects.equals(this.url, modelsOnboardItem.url); + } + + @Override + public int hashCode() { + return Objects.hash(authPassword, authUsername, eventType, name, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsOnboardItem {\n"); + sb.append(" authPassword: ").append(toIndentedString(authPassword)).append("\n"); + sb.append(" authUsername: ").append(toIndentedString(authUsername)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `auth_password` to the URL query string + if (getAuthPassword() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sauth_password%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAuthPassword())))); + } + + // add `auth_username` to the URL query string + if (getAuthUsername() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sauth_username%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAuthUsername())))); + } + + // add `event_type` to the URL query string + if (getEventType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventType())))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsOnboardValidationError.java b/src/main/java/com/getconvoy/models/ModelsOnboardValidationError.java new file mode 100644 index 0000000..64d6c74 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsOnboardValidationError.java @@ -0,0 +1,220 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsOnboardValidationError + */ +@JsonPropertyOrder({ + ModelsOnboardValidationError.JSON_PROPERTY_FIELD, + ModelsOnboardValidationError.JSON_PROPERTY_MESSAGE, + ModelsOnboardValidationError.JSON_PROPERTY_ROW +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsOnboardValidationError { + public static final String JSON_PROPERTY_FIELD = "field"; + @jakarta.annotation.Nullable + private String field; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_ROW = "row"; + @jakarta.annotation.Nullable + private Integer row; + + public ModelsOnboardValidationError() { + } + + public ModelsOnboardValidationError field(@jakarta.annotation.Nullable String field) { + this.field = field; + return this; + } + + /** + * Get field + * @return field + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FIELD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getField() { + return field; + } + + + @JsonProperty(value = JSON_PROPERTY_FIELD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setField(@jakarta.annotation.Nullable String field) { + this.field = field; + } + + + public ModelsOnboardValidationError message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public ModelsOnboardValidationError row(@jakarta.annotation.Nullable Integer row) { + this.row = row; + return this; + } + + /** + * Get row + * @return row + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ROW, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRow() { + return row; + } + + + @JsonProperty(value = JSON_PROPERTY_ROW, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRow(@jakarta.annotation.Nullable Integer row) { + this.row = row; + } + + + /** + * Return true if this models.OnboardValidationError object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsOnboardValidationError modelsOnboardValidationError = (ModelsOnboardValidationError) o; + return Objects.equals(this.field, modelsOnboardValidationError.field) && + Objects.equals(this.message, modelsOnboardValidationError.message) && + Objects.equals(this.row, modelsOnboardValidationError.row); + } + + @Override + public int hashCode() { + return Objects.hash(field, message, row); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsOnboardValidationError {\n"); + sb.append(" field: ").append(toIndentedString(field)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" row: ").append(toIndentedString(row)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `field` to the URL query string + if (getField() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sfield%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getField())))); + } + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `row` to the URL query string + if (getRow() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%srow%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRow())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsOptionalTime.java b/src/main/java/com/getconvoy/models/ModelsOptionalTime.java new file mode 100644 index 0000000..948ea2e --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsOptionalTime.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsOptionalTime + */ +@JsonPropertyOrder({ + ModelsOptionalTime.JSON_PROPERTY_SET, + ModelsOptionalTime.JSON_PROPERTY_TIME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsOptionalTime { + public static final String JSON_PROPERTY_SET = "set"; + @jakarta.annotation.Nullable + private Boolean set; + + public static final String JSON_PROPERTY_TIME = "time"; + @jakarta.annotation.Nullable + private String time; + + public ModelsOptionalTime() { + } + + public ModelsOptionalTime set(@jakarta.annotation.Nullable Boolean set) { + this.set = set; + return this; + } + + /** + * Get set + * @return set + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSet() { + return set; + } + + + @JsonProperty(value = JSON_PROPERTY_SET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSet(@jakarta.annotation.Nullable Boolean set) { + this.set = set; + } + + + public ModelsOptionalTime time(@jakarta.annotation.Nullable String time) { + this.time = time; + return this; + } + + /** + * Get time + * @return time + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TIME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTime() { + return time; + } + + + @JsonProperty(value = JSON_PROPERTY_TIME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTime(@jakarta.annotation.Nullable String time) { + this.time = time; + } + + + /** + * Return true if this models.OptionalTime object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsOptionalTime modelsOptionalTime = (ModelsOptionalTime) o; + return Objects.equals(this.set, modelsOptionalTime.set) && + Objects.equals(this.time, modelsOptionalTime.time); + } + + @Override + public int hashCode() { + return Objects.hash(set, time); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsOptionalTime {\n"); + sb.append(" set: ").append(toIndentedString(set)).append("\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `set` to the URL query string + if (getSet() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sset%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSet())))); + } + + // add `time` to the URL query string + if (getTime() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stime%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTime())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsPagedResponse.java b/src/main/java/com/getconvoy/models/ModelsPagedResponse.java new file mode 100644 index 0000000..3bfe635 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsPagedResponse.java @@ -0,0 +1,214 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastorePaginationData; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsPagedResponse + */ +@JsonPropertyOrder({ + ModelsPagedResponse.JSON_PROPERTY_CONTENT, + ModelsPagedResponse.JSON_PROPERTY_PAGINATION +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsPagedResponse { + public static final String JSON_PROPERTY_CONTENT = "content"; + private JsonNullable content = JsonNullable.of(null); + + public static final String JSON_PROPERTY_PAGINATION = "pagination"; + private JsonNullable pagination = JsonNullable.undefined(); + + public ModelsPagedResponse() { + } + + public ModelsPagedResponse content(@jakarta.annotation.Nullable Object content) { + this.content = JsonNullable.of(content); + return this; + } + + /** + * Get content + * @return content + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Object getContent() { + return content.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getContent_JsonNullable() { + return content; + } + + @JsonProperty(JSON_PROPERTY_CONTENT) + public void setContent_JsonNullable(JsonNullable content) { + this.content = content; + } + + public void setContent(@jakarta.annotation.Nullable Object content) { + this.content = JsonNullable.of(content); + } + + + public ModelsPagedResponse pagination(@jakarta.annotation.Nullable DatastorePaginationData pagination) { + this.pagination = JsonNullable.of(pagination); + return this; + } + + /** + * Get pagination + * @return pagination + */ + @jakarta.annotation.Nullable + @JsonIgnore + public DatastorePaginationData getPagination() { + return pagination.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_PAGINATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getPagination_JsonNullable() { + return pagination; + } + + @JsonProperty(JSON_PROPERTY_PAGINATION) + public void setPagination_JsonNullable(JsonNullable pagination) { + this.pagination = pagination; + } + + public void setPagination(@jakarta.annotation.Nullable DatastorePaginationData pagination) { + this.pagination = JsonNullable.of(pagination); + } + + + /** + * Return true if this models.PagedResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsPagedResponse modelsPagedResponse = (ModelsPagedResponse) o; + return equalsNullable(this.content, modelsPagedResponse.content) && + equalsNullable(this.pagination, modelsPagedResponse.pagination); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(content), hashCodeNullable(pagination)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsPagedResponse {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `content` to the URL query string + if (getContent() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scontent%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getContent())))); + } + + // add `pagination` to the URL query string + if (getPagination() != null) { + joiner.add(getPagination().toUrlQueryString(prefix + "pagination" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsProjectConfig.java b/src/main/java/com/getconvoy/models/ModelsProjectConfig.java new file mode 100644 index 0000000..d749f72 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsProjectConfig.java @@ -0,0 +1,587 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ConfigRequestIDHeaderProvider; +import com.getconvoy.models.DatastoreCircuitBreakerConfiguration; +import com.getconvoy.models.ModelsMetaEventConfiguration; +import com.getconvoy.models.ModelsRateLimitConfiguration; +import com.getconvoy.models.ModelsSSLConfiguration; +import com.getconvoy.models.ModelsSignatureConfiguration; +import com.getconvoy.models.ModelsStrategyConfiguration; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsProjectConfig + */ +@JsonPropertyOrder({ + ModelsProjectConfig.JSON_PROPERTY_ADD_EVENT_ID_TRACE_HEADERS, + ModelsProjectConfig.JSON_PROPERTY_CIRCUIT_BREAKER, + ModelsProjectConfig.JSON_PROPERTY_DISABLE_ENDPOINT, + ModelsProjectConfig.JSON_PROPERTY_MAX_PAYLOAD_READ_SIZE, + ModelsProjectConfig.JSON_PROPERTY_META_EVENT, + ModelsProjectConfig.JSON_PROPERTY_MULTIPLE_ENDPOINT_SUBSCRIPTIONS, + ModelsProjectConfig.JSON_PROPERTY_RATELIMIT, + ModelsProjectConfig.JSON_PROPERTY_REPLAY_ATTACKS_PREVENTION_ENABLED, + ModelsProjectConfig.JSON_PROPERTY_REQUEST_ID_HEADER, + ModelsProjectConfig.JSON_PROPERTY_SEARCH_POLICY, + ModelsProjectConfig.JSON_PROPERTY_SIGNATURE, + ModelsProjectConfig.JSON_PROPERTY_SSL, + ModelsProjectConfig.JSON_PROPERTY_STRATEGY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsProjectConfig { + public static final String JSON_PROPERTY_ADD_EVENT_ID_TRACE_HEADERS = "add_event_id_trace_headers"; + @jakarta.annotation.Nullable + private Boolean addEventIdTraceHeaders; + + public static final String JSON_PROPERTY_CIRCUIT_BREAKER = "circuit_breaker"; + @jakarta.annotation.Nullable + private DatastoreCircuitBreakerConfiguration circuitBreaker; + + public static final String JSON_PROPERTY_DISABLE_ENDPOINT = "disable_endpoint"; + @jakarta.annotation.Nullable + private Boolean disableEndpoint; + + public static final String JSON_PROPERTY_MAX_PAYLOAD_READ_SIZE = "max_payload_read_size"; + @jakarta.annotation.Nullable + private Integer maxPayloadReadSize; + + public static final String JSON_PROPERTY_META_EVENT = "meta_event"; + @jakarta.annotation.Nullable + private ModelsMetaEventConfiguration metaEvent; + + public static final String JSON_PROPERTY_MULTIPLE_ENDPOINT_SUBSCRIPTIONS = "multiple_endpoint_subscriptions"; + @jakarta.annotation.Nullable + private Boolean multipleEndpointSubscriptions; + + public static final String JSON_PROPERTY_RATELIMIT = "ratelimit"; + @jakarta.annotation.Nullable + private ModelsRateLimitConfiguration ratelimit; + + public static final String JSON_PROPERTY_REPLAY_ATTACKS_PREVENTION_ENABLED = "replay_attacks_prevention_enabled"; + @jakarta.annotation.Nullable + private Boolean replayAttacksPreventionEnabled; + + public static final String JSON_PROPERTY_REQUEST_ID_HEADER = "request_id_header"; + @jakarta.annotation.Nullable + private ConfigRequestIDHeaderProvider requestIdHeader; + + public static final String JSON_PROPERTY_SEARCH_POLICY = "search_policy"; + @jakarta.annotation.Nullable + private String searchPolicy; + + public static final String JSON_PROPERTY_SIGNATURE = "signature"; + @jakarta.annotation.Nullable + private ModelsSignatureConfiguration signature; + + public static final String JSON_PROPERTY_SSL = "ssl"; + @jakarta.annotation.Nullable + private ModelsSSLConfiguration ssl; + + public static final String JSON_PROPERTY_STRATEGY = "strategy"; + @jakarta.annotation.Nullable + private ModelsStrategyConfiguration strategy; + + public ModelsProjectConfig() { + } + + public ModelsProjectConfig addEventIdTraceHeaders(@jakarta.annotation.Nullable Boolean addEventIdTraceHeaders) { + this.addEventIdTraceHeaders = addEventIdTraceHeaders; + return this; + } + + /** + * Controls of the Event ID and Event Delivery ID Headers are added to the request when events are dispatched to endpoints + * @return addEventIdTraceHeaders + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ADD_EVENT_ID_TRACE_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAddEventIdTraceHeaders() { + return addEventIdTraceHeaders; + } + + + @JsonProperty(value = JSON_PROPERTY_ADD_EVENT_ID_TRACE_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAddEventIdTraceHeaders(@jakarta.annotation.Nullable Boolean addEventIdTraceHeaders) { + this.addEventIdTraceHeaders = addEventIdTraceHeaders; + } + + + public ModelsProjectConfig circuitBreaker(@jakarta.annotation.Nullable DatastoreCircuitBreakerConfiguration circuitBreaker) { + this.circuitBreaker = circuitBreaker; + return this; + } + + /** + * CircuitBreaker is used to configure the project's circuit breaker settings + * @return circuitBreaker + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CIRCUIT_BREAKER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreCircuitBreakerConfiguration getCircuitBreaker() { + return circuitBreaker; + } + + + @JsonProperty(value = JSON_PROPERTY_CIRCUIT_BREAKER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCircuitBreaker(@jakarta.annotation.Nullable DatastoreCircuitBreakerConfiguration circuitBreaker) { + this.circuitBreaker = circuitBreaker; + } + + + public ModelsProjectConfig disableEndpoint(@jakarta.annotation.Nullable Boolean disableEndpoint) { + this.disableEndpoint = disableEndpoint; + return this; + } + + /** + * Controls if the project will disable and endpoint after the retry threshold for an event is reached + * @return disableEndpoint + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DISABLE_ENDPOINT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDisableEndpoint() { + return disableEndpoint; + } + + + @JsonProperty(value = JSON_PROPERTY_DISABLE_ENDPOINT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisableEndpoint(@jakarta.annotation.Nullable Boolean disableEndpoint) { + this.disableEndpoint = disableEndpoint; + } + + + public ModelsProjectConfig maxPayloadReadSize(@jakarta.annotation.Nullable Integer maxPayloadReadSize) { + this.maxPayloadReadSize = maxPayloadReadSize; + return this; + } + + /** + * Specifies how many bytes and incoming project should read from the ingest request, and how many bytes an outgoing project should from the response of your endpoints Defaults to 50KB. + * @return maxPayloadReadSize + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAX_PAYLOAD_READ_SIZE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxPayloadReadSize() { + return maxPayloadReadSize; + } + + + @JsonProperty(value = JSON_PROPERTY_MAX_PAYLOAD_READ_SIZE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxPayloadReadSize(@jakarta.annotation.Nullable Integer maxPayloadReadSize) { + this.maxPayloadReadSize = maxPayloadReadSize; + } + + + public ModelsProjectConfig metaEvent(@jakarta.annotation.Nullable ModelsMetaEventConfiguration metaEvent) { + this.metaEvent = metaEvent; + return this; + } + + /** + * MetaEvent is used to configure the project's meta events + * @return metaEvent + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_META_EVENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsMetaEventConfiguration getMetaEvent() { + return metaEvent; + } + + + @JsonProperty(value = JSON_PROPERTY_META_EVENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetaEvent(@jakarta.annotation.Nullable ModelsMetaEventConfiguration metaEvent) { + this.metaEvent = metaEvent; + } + + + public ModelsProjectConfig multipleEndpointSubscriptions(@jakarta.annotation.Nullable Boolean multipleEndpointSubscriptions) { + this.multipleEndpointSubscriptions = multipleEndpointSubscriptions; + return this; + } + + /** + * MultipleEndpointSubscriptions is used to configure if multiple subscriptions can be created for the endpoint in a project + * @return multipleEndpointSubscriptions + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MULTIPLE_ENDPOINT_SUBSCRIPTIONS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMultipleEndpointSubscriptions() { + return multipleEndpointSubscriptions; + } + + + @JsonProperty(value = JSON_PROPERTY_MULTIPLE_ENDPOINT_SUBSCRIPTIONS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMultipleEndpointSubscriptions(@jakarta.annotation.Nullable Boolean multipleEndpointSubscriptions) { + this.multipleEndpointSubscriptions = multipleEndpointSubscriptions; + } + + + public ModelsProjectConfig ratelimit(@jakarta.annotation.Nullable ModelsRateLimitConfiguration ratelimit) { + this.ratelimit = ratelimit; + return this; + } + + /** + * RateLimit is used to configure the projects rate limiting config values + * @return ratelimit + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RATELIMIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsRateLimitConfiguration getRatelimit() { + return ratelimit; + } + + + @JsonProperty(value = JSON_PROPERTY_RATELIMIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRatelimit(@jakarta.annotation.Nullable ModelsRateLimitConfiguration ratelimit) { + this.ratelimit = ratelimit; + } + + + public ModelsProjectConfig replayAttacksPreventionEnabled(@jakarta.annotation.Nullable Boolean replayAttacksPreventionEnabled) { + this.replayAttacksPreventionEnabled = replayAttacksPreventionEnabled; + return this; + } + + /** + * Controls if your project will add a timestamp to it's webhook signature header to prevent a replay attack, See this blog post[https://getconvoy.io/blog/generating-stripe-like-webhook-signatures] for more] + * @return replayAttacksPreventionEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_REPLAY_ATTACKS_PREVENTION_ENABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getReplayAttacksPreventionEnabled() { + return replayAttacksPreventionEnabled; + } + + + @JsonProperty(value = JSON_PROPERTY_REPLAY_ATTACKS_PREVENTION_ENABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReplayAttacksPreventionEnabled(@jakarta.annotation.Nullable Boolean replayAttacksPreventionEnabled) { + this.replayAttacksPreventionEnabled = replayAttacksPreventionEnabled; + } + + + public ModelsProjectConfig requestIdHeader(@jakarta.annotation.Nullable ConfigRequestIDHeaderProvider requestIdHeader) { + this.requestIdHeader = requestIdHeader; + return this; + } + + /** + * RequestIDHeader is the outbound header name for the stable request id sent on webhook deliveries. + * @return requestIdHeader + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_REQUEST_ID_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ConfigRequestIDHeaderProvider getRequestIdHeader() { + return requestIdHeader; + } + + + @JsonProperty(value = JSON_PROPERTY_REQUEST_ID_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestIdHeader(@jakarta.annotation.Nullable ConfigRequestIDHeaderProvider requestIdHeader) { + this.requestIdHeader = requestIdHeader; + } + + + public ModelsProjectConfig searchPolicy(@jakarta.annotation.Nullable String searchPolicy) { + this.searchPolicy = searchPolicy; + return this; + } + + /** + * Specify the interval in hours for which the event tokenizer runs + * @return searchPolicy + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SEARCH_POLICY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchPolicy() { + return searchPolicy; + } + + + @JsonProperty(value = JSON_PROPERTY_SEARCH_POLICY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchPolicy(@jakarta.annotation.Nullable String searchPolicy) { + this.searchPolicy = searchPolicy; + } + + + public ModelsProjectConfig signature(@jakarta.annotation.Nullable ModelsSignatureConfiguration signature) { + this.signature = signature; + return this; + } + + /** + * Signature is used to configure the project's signature header versions + * @return signature + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SIGNATURE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsSignatureConfiguration getSignature() { + return signature; + } + + + @JsonProperty(value = JSON_PROPERTY_SIGNATURE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignature(@jakarta.annotation.Nullable ModelsSignatureConfiguration signature) { + this.signature = signature; + } + + + public ModelsProjectConfig ssl(@jakarta.annotation.Nullable ModelsSSLConfiguration ssl) { + this.ssl = ssl; + return this; + } + + /** + * SSL is used to configure the project's endpoint ssl enforcement rules + * @return ssl + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SSL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsSSLConfiguration getSsl() { + return ssl; + } + + + @JsonProperty(value = JSON_PROPERTY_SSL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSsl(@jakarta.annotation.Nullable ModelsSSLConfiguration ssl) { + this.ssl = ssl; + } + + + public ModelsProjectConfig strategy(@jakarta.annotation.Nullable ModelsStrategyConfiguration strategy) { + this.strategy = strategy; + return this; + } + + /** + * Strategy is used to configure the project's retry strategies for failing events. + * @return strategy + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STRATEGY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsStrategyConfiguration getStrategy() { + return strategy; + } + + + @JsonProperty(value = JSON_PROPERTY_STRATEGY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStrategy(@jakarta.annotation.Nullable ModelsStrategyConfiguration strategy) { + this.strategy = strategy; + } + + + /** + * Return true if this models.ProjectConfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsProjectConfig modelsProjectConfig = (ModelsProjectConfig) o; + return Objects.equals(this.addEventIdTraceHeaders, modelsProjectConfig.addEventIdTraceHeaders) && + Objects.equals(this.circuitBreaker, modelsProjectConfig.circuitBreaker) && + Objects.equals(this.disableEndpoint, modelsProjectConfig.disableEndpoint) && + Objects.equals(this.maxPayloadReadSize, modelsProjectConfig.maxPayloadReadSize) && + Objects.equals(this.metaEvent, modelsProjectConfig.metaEvent) && + Objects.equals(this.multipleEndpointSubscriptions, modelsProjectConfig.multipleEndpointSubscriptions) && + Objects.equals(this.ratelimit, modelsProjectConfig.ratelimit) && + Objects.equals(this.replayAttacksPreventionEnabled, modelsProjectConfig.replayAttacksPreventionEnabled) && + Objects.equals(this.requestIdHeader, modelsProjectConfig.requestIdHeader) && + Objects.equals(this.searchPolicy, modelsProjectConfig.searchPolicy) && + Objects.equals(this.signature, modelsProjectConfig.signature) && + Objects.equals(this.ssl, modelsProjectConfig.ssl) && + Objects.equals(this.strategy, modelsProjectConfig.strategy); + } + + @Override + public int hashCode() { + return Objects.hash(addEventIdTraceHeaders, circuitBreaker, disableEndpoint, maxPayloadReadSize, metaEvent, multipleEndpointSubscriptions, ratelimit, replayAttacksPreventionEnabled, requestIdHeader, searchPolicy, signature, ssl, strategy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsProjectConfig {\n"); + sb.append(" addEventIdTraceHeaders: ").append(toIndentedString(addEventIdTraceHeaders)).append("\n"); + sb.append(" circuitBreaker: ").append(toIndentedString(circuitBreaker)).append("\n"); + sb.append(" disableEndpoint: ").append(toIndentedString(disableEndpoint)).append("\n"); + sb.append(" maxPayloadReadSize: ").append(toIndentedString(maxPayloadReadSize)).append("\n"); + sb.append(" metaEvent: ").append(toIndentedString(metaEvent)).append("\n"); + sb.append(" multipleEndpointSubscriptions: ").append(toIndentedString(multipleEndpointSubscriptions)).append("\n"); + sb.append(" ratelimit: ").append(toIndentedString(ratelimit)).append("\n"); + sb.append(" replayAttacksPreventionEnabled: ").append(toIndentedString(replayAttacksPreventionEnabled)).append("\n"); + sb.append(" requestIdHeader: ").append(toIndentedString(requestIdHeader)).append("\n"); + sb.append(" searchPolicy: ").append(toIndentedString(searchPolicy)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" ssl: ").append(toIndentedString(ssl)).append("\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `add_event_id_trace_headers` to the URL query string + if (getAddEventIdTraceHeaders() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sadd_event_id_trace_headers%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAddEventIdTraceHeaders())))); + } + + // add `circuit_breaker` to the URL query string + if (getCircuitBreaker() != null) { + joiner.add(getCircuitBreaker().toUrlQueryString(prefix + "circuit_breaker" + suffix)); + } + + // add `disable_endpoint` to the URL query string + if (getDisableEndpoint() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdisable_endpoint%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDisableEndpoint())))); + } + + // add `max_payload_read_size` to the URL query string + if (getMaxPayloadReadSize() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smax_payload_read_size%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMaxPayloadReadSize())))); + } + + // add `meta_event` to the URL query string + if (getMetaEvent() != null) { + joiner.add(getMetaEvent().toUrlQueryString(prefix + "meta_event" + suffix)); + } + + // add `multiple_endpoint_subscriptions` to the URL query string + if (getMultipleEndpointSubscriptions() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smultiple_endpoint_subscriptions%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMultipleEndpointSubscriptions())))); + } + + // add `ratelimit` to the URL query string + if (getRatelimit() != null) { + joiner.add(getRatelimit().toUrlQueryString(prefix + "ratelimit" + suffix)); + } + + // add `replay_attacks_prevention_enabled` to the URL query string + if (getReplayAttacksPreventionEnabled() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sreplay_attacks_prevention_enabled%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getReplayAttacksPreventionEnabled())))); + } + + // add `request_id_header` to the URL query string + if (getRequestIdHeader() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%srequest_id_header%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRequestIdHeader())))); + } + + // add `search_policy` to the URL query string + if (getSearchPolicy() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssearch_policy%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSearchPolicy())))); + } + + // add `signature` to the URL query string + if (getSignature() != null) { + joiner.add(getSignature().toUrlQueryString(prefix + "signature" + suffix)); + } + + // add `ssl` to the URL query string + if (getSsl() != null) { + joiner.add(getSsl().toUrlQueryString(prefix + "ssl" + suffix)); + } + + // add `strategy` to the URL query string + if (getStrategy() != null) { + joiner.add(getStrategy().toUrlQueryString(prefix + "strategy" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsProjectResponse.java b/src/main/java/com/getconvoy/models/ModelsProjectResponse.java new file mode 100644 index 0000000..9d436c8 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsProjectResponse.java @@ -0,0 +1,511 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreProjectConfig; +import com.getconvoy.models.DatastoreProjectStatistics; +import com.getconvoy.models.DatastoreProjectType; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsProjectResponse + */ +@JsonPropertyOrder({ + ModelsProjectResponse.JSON_PROPERTY_CONFIG, + ModelsProjectResponse.JSON_PROPERTY_CREATED_AT, + ModelsProjectResponse.JSON_PROPERTY_DELETED_AT, + ModelsProjectResponse.JSON_PROPERTY_LOGO_URL, + ModelsProjectResponse.JSON_PROPERTY_NAME, + ModelsProjectResponse.JSON_PROPERTY_ORGANISATION_ID, + ModelsProjectResponse.JSON_PROPERTY_RETAINED_EVENTS, + ModelsProjectResponse.JSON_PROPERTY_STATISTICS, + ModelsProjectResponse.JSON_PROPERTY_TYPE, + ModelsProjectResponse.JSON_PROPERTY_UID, + ModelsProjectResponse.JSON_PROPERTY_UPDATED_AT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsProjectResponse { + public static final String JSON_PROPERTY_CONFIG = "config"; + @jakarta.annotation.Nullable + private DatastoreProjectConfig config; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + @jakarta.annotation.Nullable + private String deletedAt; + + public static final String JSON_PROPERTY_LOGO_URL = "logo_url"; + @jakarta.annotation.Nullable + private String logoUrl; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_ORGANISATION_ID = "organisation_id"; + @jakarta.annotation.Nullable + private String organisationId; + + public static final String JSON_PROPERTY_RETAINED_EVENTS = "retained_events"; + @jakarta.annotation.Nullable + private Integer retainedEvents; + + public static final String JSON_PROPERTY_STATISTICS = "statistics"; + @jakarta.annotation.Nullable + private DatastoreProjectStatistics statistics; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private DatastoreProjectType type; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + @jakarta.annotation.Nullable + private String updatedAt; + + public ModelsProjectResponse() { + } + + public ModelsProjectResponse config(@jakarta.annotation.Nullable DatastoreProjectConfig config) { + this.config = config; + return this; + } + + /** + * Get config + * @return config + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreProjectConfig getConfig() { + return config; + } + + + @JsonProperty(value = JSON_PROPERTY_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfig(@jakarta.annotation.Nullable DatastoreProjectConfig config) { + this.config = config; + } + + + public ModelsProjectResponse createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public ModelsProjectResponse deletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Get deletedAt + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + } + + + public ModelsProjectResponse logoUrl(@jakarta.annotation.Nullable String logoUrl) { + this.logoUrl = logoUrl; + return this; + } + + /** + * Get logoUrl + * @return logoUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_LOGO_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLogoUrl() { + return logoUrl; + } + + + @JsonProperty(value = JSON_PROPERTY_LOGO_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogoUrl(@jakarta.annotation.Nullable String logoUrl) { + this.logoUrl = logoUrl; + } + + + public ModelsProjectResponse name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public ModelsProjectResponse organisationId(@jakarta.annotation.Nullable String organisationId) { + this.organisationId = organisationId; + return this; + } + + /** + * Get organisationId + * @return organisationId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ORGANISATION_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOrganisationId() { + return organisationId; + } + + + @JsonProperty(value = JSON_PROPERTY_ORGANISATION_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrganisationId(@jakarta.annotation.Nullable String organisationId) { + this.organisationId = organisationId; + } + + + public ModelsProjectResponse retainedEvents(@jakarta.annotation.Nullable Integer retainedEvents) { + this.retainedEvents = retainedEvents; + return this; + } + + /** + * Get retainedEvents + * @return retainedEvents + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RETAINED_EVENTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRetainedEvents() { + return retainedEvents; + } + + + @JsonProperty(value = JSON_PROPERTY_RETAINED_EVENTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRetainedEvents(@jakarta.annotation.Nullable Integer retainedEvents) { + this.retainedEvents = retainedEvents; + } + + + public ModelsProjectResponse statistics(@jakarta.annotation.Nullable DatastoreProjectStatistics statistics) { + this.statistics = statistics; + return this; + } + + /** + * Get statistics + * @return statistics + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATISTICS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreProjectStatistics getStatistics() { + return statistics; + } + + + @JsonProperty(value = JSON_PROPERTY_STATISTICS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatistics(@jakarta.annotation.Nullable DatastoreProjectStatistics statistics) { + this.statistics = statistics; + } + + + public ModelsProjectResponse type(@jakarta.annotation.Nullable DatastoreProjectType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreProjectType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable DatastoreProjectType type) { + this.type = type; + } + + + public ModelsProjectResponse uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + public ModelsProjectResponse updatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + /** + * Return true if this models.ProjectResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsProjectResponse modelsProjectResponse = (ModelsProjectResponse) o; + return Objects.equals(this.config, modelsProjectResponse.config) && + Objects.equals(this.createdAt, modelsProjectResponse.createdAt) && + Objects.equals(this.deletedAt, modelsProjectResponse.deletedAt) && + Objects.equals(this.logoUrl, modelsProjectResponse.logoUrl) && + Objects.equals(this.name, modelsProjectResponse.name) && + Objects.equals(this.organisationId, modelsProjectResponse.organisationId) && + Objects.equals(this.retainedEvents, modelsProjectResponse.retainedEvents) && + Objects.equals(this.statistics, modelsProjectResponse.statistics) && + Objects.equals(this.type, modelsProjectResponse.type) && + Objects.equals(this.uid, modelsProjectResponse.uid) && + Objects.equals(this.updatedAt, modelsProjectResponse.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(config, createdAt, deletedAt, logoUrl, name, organisationId, retainedEvents, statistics, type, uid, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsProjectResponse {\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" organisationId: ").append(toIndentedString(organisationId)).append("\n"); + sb.append(" retainedEvents: ").append(toIndentedString(retainedEvents)).append("\n"); + sb.append(" statistics: ").append(toIndentedString(statistics)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `config` to the URL query string + if (getConfig() != null) { + joiner.add(getConfig().toUrlQueryString(prefix + "config" + suffix)); + } + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `deleted_at` to the URL query string + if (getDeletedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeleted_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeletedAt())))); + } + + // add `logo_url` to the URL query string + if (getLogoUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%slogo_url%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLogoUrl())))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `organisation_id` to the URL query string + if (getOrganisationId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sorganisation_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOrganisationId())))); + } + + // add `retained_events` to the URL query string + if (getRetainedEvents() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sretained_events%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRetainedEvents())))); + } + + // add `statistics` to the URL query string + if (getStatistics() != null) { + joiner.add(getStatistics().toUrlQueryString(prefix + "statistics" + suffix)); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + // add `updated_at` to the URL query string + if (getUpdatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%supdated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpdatedAt())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsPubSubConfig.java b/src/main/java/com/getconvoy/models/ModelsPubSubConfig.java new file mode 100644 index 0000000..74f45c4 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsPubSubConfig.java @@ -0,0 +1,333 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastorePubSubType; +import com.getconvoy.models.ModelsAmqpPubSubconfig; +import com.getconvoy.models.ModelsGooglePubSubConfig; +import com.getconvoy.models.ModelsKafkaPubSubConfig; +import com.getconvoy.models.ModelsSQSPubSubConfig; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsPubSubConfig + */ +@JsonPropertyOrder({ + ModelsPubSubConfig.JSON_PROPERTY_AMQP, + ModelsPubSubConfig.JSON_PROPERTY_GOOGLE, + ModelsPubSubConfig.JSON_PROPERTY_KAFKA, + ModelsPubSubConfig.JSON_PROPERTY_SQS, + ModelsPubSubConfig.JSON_PROPERTY_TYPE, + ModelsPubSubConfig.JSON_PROPERTY_WORKERS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsPubSubConfig { + public static final String JSON_PROPERTY_AMQP = "amqp"; + @jakarta.annotation.Nullable + private ModelsAmqpPubSubconfig amqp; + + public static final String JSON_PROPERTY_GOOGLE = "google"; + @jakarta.annotation.Nullable + private ModelsGooglePubSubConfig google; + + public static final String JSON_PROPERTY_KAFKA = "kafka"; + @jakarta.annotation.Nullable + private ModelsKafkaPubSubConfig kafka; + + public static final String JSON_PROPERTY_SQS = "sqs"; + @jakarta.annotation.Nullable + private ModelsSQSPubSubConfig sqs; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private DatastorePubSubType type; + + public static final String JSON_PROPERTY_WORKERS = "workers"; + @jakarta.annotation.Nullable + private Integer workers; + + public ModelsPubSubConfig() { + } + + public ModelsPubSubConfig amqp(@jakarta.annotation.Nullable ModelsAmqpPubSubconfig amqp) { + this.amqp = amqp; + return this; + } + + /** + * Get amqp + * @return amqp + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AMQP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsAmqpPubSubconfig getAmqp() { + return amqp; + } + + + @JsonProperty(value = JSON_PROPERTY_AMQP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmqp(@jakarta.annotation.Nullable ModelsAmqpPubSubconfig amqp) { + this.amqp = amqp; + } + + + public ModelsPubSubConfig google(@jakarta.annotation.Nullable ModelsGooglePubSubConfig google) { + this.google = google; + return this; + } + + /** + * Get google + * @return google + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_GOOGLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsGooglePubSubConfig getGoogle() { + return google; + } + + + @JsonProperty(value = JSON_PROPERTY_GOOGLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGoogle(@jakarta.annotation.Nullable ModelsGooglePubSubConfig google) { + this.google = google; + } + + + public ModelsPubSubConfig kafka(@jakarta.annotation.Nullable ModelsKafkaPubSubConfig kafka) { + this.kafka = kafka; + return this; + } + + /** + * Get kafka + * @return kafka + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_KAFKA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsKafkaPubSubConfig getKafka() { + return kafka; + } + + + @JsonProperty(value = JSON_PROPERTY_KAFKA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKafka(@jakarta.annotation.Nullable ModelsKafkaPubSubConfig kafka) { + this.kafka = kafka; + } + + + public ModelsPubSubConfig sqs(@jakarta.annotation.Nullable ModelsSQSPubSubConfig sqs) { + this.sqs = sqs; + return this; + } + + /** + * Get sqs + * @return sqs + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SQS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsSQSPubSubConfig getSqs() { + return sqs; + } + + + @JsonProperty(value = JSON_PROPERTY_SQS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSqs(@jakarta.annotation.Nullable ModelsSQSPubSubConfig sqs) { + this.sqs = sqs; + } + + + public ModelsPubSubConfig type(@jakarta.annotation.Nullable DatastorePubSubType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastorePubSubType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable DatastorePubSubType type) { + this.type = type; + } + + + public ModelsPubSubConfig workers(@jakarta.annotation.Nullable Integer workers) { + this.workers = workers; + return this; + } + + /** + * Get workers + * @return workers + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_WORKERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWorkers() { + return workers; + } + + + @JsonProperty(value = JSON_PROPERTY_WORKERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWorkers(@jakarta.annotation.Nullable Integer workers) { + this.workers = workers; + } + + + /** + * Return true if this models.PubSubConfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsPubSubConfig modelsPubSubConfig = (ModelsPubSubConfig) o; + return Objects.equals(this.amqp, modelsPubSubConfig.amqp) && + Objects.equals(this.google, modelsPubSubConfig.google) && + Objects.equals(this.kafka, modelsPubSubConfig.kafka) && + Objects.equals(this.sqs, modelsPubSubConfig.sqs) && + Objects.equals(this.type, modelsPubSubConfig.type) && + Objects.equals(this.workers, modelsPubSubConfig.workers); + } + + @Override + public int hashCode() { + return Objects.hash(amqp, google, kafka, sqs, type, workers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsPubSubConfig {\n"); + sb.append(" amqp: ").append(toIndentedString(amqp)).append("\n"); + sb.append(" google: ").append(toIndentedString(google)).append("\n"); + sb.append(" kafka: ").append(toIndentedString(kafka)).append("\n"); + sb.append(" sqs: ").append(toIndentedString(sqs)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" workers: ").append(toIndentedString(workers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `amqp` to the URL query string + if (getAmqp() != null) { + joiner.add(getAmqp().toUrlQueryString(prefix + "amqp" + suffix)); + } + + // add `google` to the URL query string + if (getGoogle() != null) { + joiner.add(getGoogle().toUrlQueryString(prefix + "google" + suffix)); + } + + // add `kafka` to the URL query string + if (getKafka() != null) { + joiner.add(getKafka().toUrlQueryString(prefix + "kafka" + suffix)); + } + + // add `sqs` to the URL query string + if (getSqs() != null) { + joiner.add(getSqs().toUrlQueryString(prefix + "sqs" + suffix)); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `workers` to the URL query string + if (getWorkers() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sworkers%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getWorkers())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsRateLimitConfiguration.java b/src/main/java/com/getconvoy/models/ModelsRateLimitConfiguration.java new file mode 100644 index 0000000..36dec68 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsRateLimitConfiguration.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsRateLimitConfiguration + */ +@JsonPropertyOrder({ + ModelsRateLimitConfiguration.JSON_PROPERTY_COUNT, + ModelsRateLimitConfiguration.JSON_PROPERTY_DURATION +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsRateLimitConfiguration { + public static final String JSON_PROPERTY_COUNT = "count"; + @jakarta.annotation.Nullable + private Integer count; + + public static final String JSON_PROPERTY_DURATION = "duration"; + @jakarta.annotation.Nullable + private Integer duration; + + public ModelsRateLimitConfiguration() { + } + + public ModelsRateLimitConfiguration count(@jakarta.annotation.Nullable Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * @return count + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCount() { + return count; + } + + + @JsonProperty(value = JSON_PROPERTY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(@jakarta.annotation.Nullable Integer count) { + this.count = count; + } + + + public ModelsRateLimitConfiguration duration(@jakarta.annotation.Nullable Integer duration) { + this.duration = duration; + return this; + } + + /** + * Get duration + * @return duration + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDuration() { + return duration; + } + + + @JsonProperty(value = JSON_PROPERTY_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDuration(@jakarta.annotation.Nullable Integer duration) { + this.duration = duration; + } + + + /** + * Return true if this models.RateLimitConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsRateLimitConfiguration modelsRateLimitConfiguration = (ModelsRateLimitConfiguration) o; + return Objects.equals(this.count, modelsRateLimitConfiguration.count) && + Objects.equals(this.duration, modelsRateLimitConfiguration.duration); + } + + @Override + public int hashCode() { + return Objects.hash(count, duration); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsRateLimitConfiguration {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `count` to the URL query string + if (getCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scount%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCount())))); + } + + // add `duration` to the URL query string + if (getDuration() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sduration%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDuration())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsRetryConfiguration.java b/src/main/java/com/getconvoy/models/ModelsRetryConfiguration.java new file mode 100644 index 0000000..5eea224 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsRetryConfiguration.java @@ -0,0 +1,257 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreStrategyProvider; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsRetryConfiguration + */ +@JsonPropertyOrder({ + ModelsRetryConfiguration.JSON_PROPERTY_DURATION, + ModelsRetryConfiguration.JSON_PROPERTY_INTERVAL_SECONDS, + ModelsRetryConfiguration.JSON_PROPERTY_RETRY_COUNT, + ModelsRetryConfiguration.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsRetryConfiguration { + public static final String JSON_PROPERTY_DURATION = "duration"; + @jakarta.annotation.Nullable + private String duration; + + public static final String JSON_PROPERTY_INTERVAL_SECONDS = "interval_seconds"; + @jakarta.annotation.Nullable + private Integer intervalSeconds; + + public static final String JSON_PROPERTY_RETRY_COUNT = "retry_count"; + @jakarta.annotation.Nullable + private Integer retryCount; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private DatastoreStrategyProvider type; + + public ModelsRetryConfiguration() { + } + + public ModelsRetryConfiguration duration(@jakarta.annotation.Nullable String duration) { + this.duration = duration; + return this; + } + + /** + * Used to specify a valid Go time duration e.g 10s, 1h3m for how long to wait between event delivery retries + * @return duration + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDuration() { + return duration; + } + + + @JsonProperty(value = JSON_PROPERTY_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDuration(@jakarta.annotation.Nullable String duration) { + this.duration = duration; + } + + + public ModelsRetryConfiguration intervalSeconds(@jakarta.annotation.Nullable Integer intervalSeconds) { + this.intervalSeconds = intervalSeconds; + return this; + } + + /** + * Used to specify a time in seconds for how long to wait between event delivery retries, + * @return intervalSeconds + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_INTERVAL_SECONDS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIntervalSeconds() { + return intervalSeconds; + } + + + @JsonProperty(value = JSON_PROPERTY_INTERVAL_SECONDS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIntervalSeconds(@jakarta.annotation.Nullable Integer intervalSeconds) { + this.intervalSeconds = intervalSeconds; + } + + + public ModelsRetryConfiguration retryCount(@jakarta.annotation.Nullable Integer retryCount) { + this.retryCount = retryCount; + return this; + } + + /** + * Used to specify the max number of retries + * @return retryCount + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RETRY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRetryCount() { + return retryCount; + } + + + @JsonProperty(value = JSON_PROPERTY_RETRY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRetryCount(@jakarta.annotation.Nullable Integer retryCount) { + this.retryCount = retryCount; + } + + + public ModelsRetryConfiguration type(@jakarta.annotation.Nullable DatastoreStrategyProvider type) { + this.type = type; + return this; + } + + /** + * Retry Strategy type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreStrategyProvider getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable DatastoreStrategyProvider type) { + this.type = type; + } + + + /** + * Return true if this models.RetryConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsRetryConfiguration modelsRetryConfiguration = (ModelsRetryConfiguration) o; + return Objects.equals(this.duration, modelsRetryConfiguration.duration) && + Objects.equals(this.intervalSeconds, modelsRetryConfiguration.intervalSeconds) && + Objects.equals(this.retryCount, modelsRetryConfiguration.retryCount) && + Objects.equals(this.type, modelsRetryConfiguration.type); + } + + @Override + public int hashCode() { + return Objects.hash(duration, intervalSeconds, retryCount, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsRetryConfiguration {\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" intervalSeconds: ").append(toIndentedString(intervalSeconds)).append("\n"); + sb.append(" retryCount: ").append(toIndentedString(retryCount)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `duration` to the URL query string + if (getDuration() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sduration%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDuration())))); + } + + // add `interval_seconds` to the URL query string + if (getIntervalSeconds() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sinterval_seconds%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIntervalSeconds())))); + } + + // add `retry_count` to the URL query string + if (getRetryCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sretry_count%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRetryCount())))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsSQSPubSubConfig.java b/src/main/java/com/getconvoy/models/ModelsSQSPubSubConfig.java new file mode 100644 index 0000000..3da4cd3 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsSQSPubSubConfig.java @@ -0,0 +1,256 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsSQSPubSubConfig + */ +@JsonPropertyOrder({ + ModelsSQSPubSubConfig.JSON_PROPERTY_ACCESS_KEY_ID, + ModelsSQSPubSubConfig.JSON_PROPERTY_DEFAULT_REGION, + ModelsSQSPubSubConfig.JSON_PROPERTY_QUEUE_NAME, + ModelsSQSPubSubConfig.JSON_PROPERTY_SECRET_KEY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsSQSPubSubConfig { + public static final String JSON_PROPERTY_ACCESS_KEY_ID = "access_key_id"; + @jakarta.annotation.Nullable + private String accessKeyId; + + public static final String JSON_PROPERTY_DEFAULT_REGION = "default_region"; + @jakarta.annotation.Nullable + private String defaultRegion; + + public static final String JSON_PROPERTY_QUEUE_NAME = "queue_name"; + @jakarta.annotation.Nullable + private String queueName; + + public static final String JSON_PROPERTY_SECRET_KEY = "secret_key"; + @jakarta.annotation.Nullable + private String secretKey; + + public ModelsSQSPubSubConfig() { + } + + public ModelsSQSPubSubConfig accessKeyId(@jakarta.annotation.Nullable String accessKeyId) { + this.accessKeyId = accessKeyId; + return this; + } + + /** + * Get accessKeyId + * @return accessKeyId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ACCESS_KEY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccessKeyId() { + return accessKeyId; + } + + + @JsonProperty(value = JSON_PROPERTY_ACCESS_KEY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessKeyId(@jakarta.annotation.Nullable String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + + public ModelsSQSPubSubConfig defaultRegion(@jakarta.annotation.Nullable String defaultRegion) { + this.defaultRegion = defaultRegion; + return this; + } + + /** + * Get defaultRegion + * @return defaultRegion + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DEFAULT_REGION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDefaultRegion() { + return defaultRegion; + } + + + @JsonProperty(value = JSON_PROPERTY_DEFAULT_REGION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultRegion(@jakarta.annotation.Nullable String defaultRegion) { + this.defaultRegion = defaultRegion; + } + + + public ModelsSQSPubSubConfig queueName(@jakarta.annotation.Nullable String queueName) { + this.queueName = queueName; + return this; + } + + /** + * Get queueName + * @return queueName + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_QUEUE_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQueueName() { + return queueName; + } + + + @JsonProperty(value = JSON_PROPERTY_QUEUE_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQueueName(@jakarta.annotation.Nullable String queueName) { + this.queueName = queueName; + } + + + public ModelsSQSPubSubConfig secretKey(@jakarta.annotation.Nullable String secretKey) { + this.secretKey = secretKey; + return this; + } + + /** + * Get secretKey + * @return secretKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SECRET_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecretKey() { + return secretKey; + } + + + @JsonProperty(value = JSON_PROPERTY_SECRET_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecretKey(@jakarta.annotation.Nullable String secretKey) { + this.secretKey = secretKey; + } + + + /** + * Return true if this models.SQSPubSubConfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsSQSPubSubConfig modelsSQSPubSubConfig = (ModelsSQSPubSubConfig) o; + return Objects.equals(this.accessKeyId, modelsSQSPubSubConfig.accessKeyId) && + Objects.equals(this.defaultRegion, modelsSQSPubSubConfig.defaultRegion) && + Objects.equals(this.queueName, modelsSQSPubSubConfig.queueName) && + Objects.equals(this.secretKey, modelsSQSPubSubConfig.secretKey); + } + + @Override + public int hashCode() { + return Objects.hash(accessKeyId, defaultRegion, queueName, secretKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsSQSPubSubConfig {\n"); + sb.append(" accessKeyId: ").append(toIndentedString(accessKeyId)).append("\n"); + sb.append(" defaultRegion: ").append(toIndentedString(defaultRegion)).append("\n"); + sb.append(" queueName: ").append(toIndentedString(queueName)).append("\n"); + sb.append(" secretKey: ").append(toIndentedString(secretKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `access_key_id` to the URL query string + if (getAccessKeyId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%saccess_key_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAccessKeyId())))); + } + + // add `default_region` to the URL query string + if (getDefaultRegion() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdefault_region%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDefaultRegion())))); + } + + // add `queue_name` to the URL query string + if (getQueueName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%squeue_name%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getQueueName())))); + } + + // add `secret_key` to the URL query string + if (getSecretKey() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssecret_key%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSecretKey())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsSSLConfiguration.java b/src/main/java/com/getconvoy/models/ModelsSSLConfiguration.java new file mode 100644 index 0000000..48a7362 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsSSLConfiguration.java @@ -0,0 +1,148 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsSSLConfiguration + */ +@JsonPropertyOrder({ + ModelsSSLConfiguration.JSON_PROPERTY_ENFORCE_SECURE_ENDPOINTS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsSSLConfiguration { + public static final String JSON_PROPERTY_ENFORCE_SECURE_ENDPOINTS = "enforce_secure_endpoints"; + @jakarta.annotation.Nullable + private Boolean enforceSecureEndpoints; + + public ModelsSSLConfiguration() { + } + + public ModelsSSLConfiguration enforceSecureEndpoints(@jakarta.annotation.Nullable Boolean enforceSecureEndpoints) { + this.enforceSecureEndpoints = enforceSecureEndpoints; + return this; + } + + /** + * Get enforceSecureEndpoints + * @return enforceSecureEndpoints + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENFORCE_SECURE_ENDPOINTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnforceSecureEndpoints() { + return enforceSecureEndpoints; + } + + + @JsonProperty(value = JSON_PROPERTY_ENFORCE_SECURE_ENDPOINTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnforceSecureEndpoints(@jakarta.annotation.Nullable Boolean enforceSecureEndpoints) { + this.enforceSecureEndpoints = enforceSecureEndpoints; + } + + + /** + * Return true if this models.SSLConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsSSLConfiguration modelsSSLConfiguration = (ModelsSSLConfiguration) o; + return Objects.equals(this.enforceSecureEndpoints, modelsSSLConfiguration.enforceSecureEndpoints); + } + + @Override + public int hashCode() { + return Objects.hash(enforceSecureEndpoints); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsSSLConfiguration {\n"); + sb.append(" enforceSecureEndpoints: ").append(toIndentedString(enforceSecureEndpoints)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `enforce_secure_endpoints` to the URL query string + if (getEnforceSecureEndpoints() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%senforce_secure_endpoints%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEnforceSecureEndpoints())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsSignatureConfiguration.java b/src/main/java/com/getconvoy/models/ModelsSignatureConfiguration.java new file mode 100644 index 0000000..5d499aa --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsSignatureConfiguration.java @@ -0,0 +1,201 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ConfigSignatureHeaderProvider; +import com.getconvoy.models.ModelsSignatureVersion; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsSignatureConfiguration + */ +@JsonPropertyOrder({ + ModelsSignatureConfiguration.JSON_PROPERTY_HEADER, + ModelsSignatureConfiguration.JSON_PROPERTY_VERSIONS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsSignatureConfiguration { + public static final String JSON_PROPERTY_HEADER = "header"; + @jakarta.annotation.Nullable + private ConfigSignatureHeaderProvider header; + + public static final String JSON_PROPERTY_VERSIONS = "versions"; + @jakarta.annotation.Nullable + private List versions = new ArrayList<>(); + + public ModelsSignatureConfiguration() { + } + + public ModelsSignatureConfiguration header(@jakarta.annotation.Nullable ConfigSignatureHeaderProvider header) { + this.header = header; + return this; + } + + /** + * Get header + * @return header + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ConfigSignatureHeaderProvider getHeader() { + return header; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeader(@jakarta.annotation.Nullable ConfigSignatureHeaderProvider header) { + this.header = header; + } + + + public ModelsSignatureConfiguration versions(@jakarta.annotation.Nullable List versions) { + this.versions = versions; + return this; + } + + public ModelsSignatureConfiguration addVersionsItem(ModelsSignatureVersion versionsItem) { + if (this.versions == null) { + this.versions = new ArrayList<>(); + } + this.versions.add(versionsItem); + return this; + } + + /** + * Get versions + * @return versions + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_VERSIONS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getVersions() { + return versions; + } + + + @JsonProperty(value = JSON_PROPERTY_VERSIONS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersions(@jakarta.annotation.Nullable List versions) { + this.versions = versions; + } + + + /** + * Return true if this models.SignatureConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsSignatureConfiguration modelsSignatureConfiguration = (ModelsSignatureConfiguration) o; + return Objects.equals(this.header, modelsSignatureConfiguration.header) && + Objects.equals(this.versions, modelsSignatureConfiguration.versions); + } + + @Override + public int hashCode() { + return Objects.hash(header, versions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsSignatureConfiguration {\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" versions: ").append(toIndentedString(versions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `header` to the URL query string + if (getHeader() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheader%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHeader())))); + } + + // add `versions` to the URL query string + if (getVersions() != null) { + for (int i = 0; i < getVersions().size(); i++) { + if (getVersions().get(i) != null) { + joiner.add(getVersions().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sversions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsSignatureVersion.java b/src/main/java/com/getconvoy/models/ModelsSignatureVersion.java new file mode 100644 index 0000000..24e310b --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsSignatureVersion.java @@ -0,0 +1,256 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsSignatureVersion + */ +@JsonPropertyOrder({ + ModelsSignatureVersion.JSON_PROPERTY_CREATED_AT, + ModelsSignatureVersion.JSON_PROPERTY_ENCODING, + ModelsSignatureVersion.JSON_PROPERTY_HASH, + ModelsSignatureVersion.JSON_PROPERTY_UID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsSignatureVersion { + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_ENCODING = "encoding"; + @jakarta.annotation.Nullable + private String encoding; + + public static final String JSON_PROPERTY_HASH = "hash"; + @jakarta.annotation.Nullable + private String hash; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public ModelsSignatureVersion() { + } + + public ModelsSignatureVersion createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public ModelsSignatureVersion encoding(@jakarta.annotation.Nullable String encoding) { + this.encoding = encoding; + return this; + } + + /** + * Get encoding + * @return encoding + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENCODING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEncoding() { + return encoding; + } + + + @JsonProperty(value = JSON_PROPERTY_ENCODING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncoding(@jakarta.annotation.Nullable String encoding) { + this.encoding = encoding; + } + + + public ModelsSignatureVersion hash(@jakarta.annotation.Nullable String hash) { + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HASH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHash() { + return hash; + } + + + @JsonProperty(value = JSON_PROPERTY_HASH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHash(@jakarta.annotation.Nullable String hash) { + this.hash = hash; + } + + + public ModelsSignatureVersion uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + /** + * Return true if this models.SignatureVersion object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsSignatureVersion modelsSignatureVersion = (ModelsSignatureVersion) o; + return Objects.equals(this.createdAt, modelsSignatureVersion.createdAt) && + Objects.equals(this.encoding, modelsSignatureVersion.encoding) && + Objects.equals(this.hash, modelsSignatureVersion.hash) && + Objects.equals(this.uid, modelsSignatureVersion.uid); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, encoding, hash, uid); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsSignatureVersion {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" encoding: ").append(toIndentedString(encoding)).append("\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `encoding` to the URL query string + if (getEncoding() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sencoding%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEncoding())))); + } + + // add `hash` to the URL query string + if (getHash() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shash%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHash())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsSourceResponse.java b/src/main/java/com/getconvoy/models/ModelsSourceResponse.java new file mode 100644 index 0000000..c3da77b --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsSourceResponse.java @@ -0,0 +1,864 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreCustomResponse; +import com.getconvoy.models.DatastoreProviderConfig; +import com.getconvoy.models.DatastorePubSubConfig; +import com.getconvoy.models.DatastoreSourceProvider; +import com.getconvoy.models.DatastoreSourceType; +import com.getconvoy.models.DatastoreVerifierConfig; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsSourceResponse + */ +@JsonPropertyOrder({ + ModelsSourceResponse.JSON_PROPERTY_BODY_FUNCTION, + ModelsSourceResponse.JSON_PROPERTY_CREATED_AT, + ModelsSourceResponse.JSON_PROPERTY_CUSTOM_RESPONSE, + ModelsSourceResponse.JSON_PROPERTY_DELETED_AT, + ModelsSourceResponse.JSON_PROPERTY_EVENT_TYPE_LOCATION, + ModelsSourceResponse.JSON_PROPERTY_FORWARD_HEADERS, + ModelsSourceResponse.JSON_PROPERTY_HEADER_FUNCTION, + ModelsSourceResponse.JSON_PROPERTY_IDEMPOTENCY_KEYS, + ModelsSourceResponse.JSON_PROPERTY_IS_DISABLED, + ModelsSourceResponse.JSON_PROPERTY_MASK_ID, + ModelsSourceResponse.JSON_PROPERTY_NAME, + ModelsSourceResponse.JSON_PROPERTY_PROJECT_ID, + ModelsSourceResponse.JSON_PROPERTY_PROVIDER, + ModelsSourceResponse.JSON_PROPERTY_PROVIDER_CONFIG, + ModelsSourceResponse.JSON_PROPERTY_PUB_SUB, + ModelsSourceResponse.JSON_PROPERTY_TYPE, + ModelsSourceResponse.JSON_PROPERTY_UID, + ModelsSourceResponse.JSON_PROPERTY_UPDATED_AT, + ModelsSourceResponse.JSON_PROPERTY_URL, + ModelsSourceResponse.JSON_PROPERTY_VERIFIER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsSourceResponse { + public static final String JSON_PROPERTY_BODY_FUNCTION = "body_function"; + @jakarta.annotation.Nullable + private String bodyFunction; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_CUSTOM_RESPONSE = "custom_response"; + @jakarta.annotation.Nullable + private DatastoreCustomResponse customResponse; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + @jakarta.annotation.Nullable + private String deletedAt; + + public static final String JSON_PROPERTY_EVENT_TYPE_LOCATION = "event_type_location"; + @jakarta.annotation.Nullable + private String eventTypeLocation; + + public static final String JSON_PROPERTY_FORWARD_HEADERS = "forward_headers"; + @jakarta.annotation.Nullable + private List forwardHeaders = new ArrayList<>(); + + public static final String JSON_PROPERTY_HEADER_FUNCTION = "header_function"; + @jakarta.annotation.Nullable + private String headerFunction; + + public static final String JSON_PROPERTY_IDEMPOTENCY_KEYS = "idempotency_keys"; + @jakarta.annotation.Nullable + private List idempotencyKeys = new ArrayList<>(); + + public static final String JSON_PROPERTY_IS_DISABLED = "is_disabled"; + @jakarta.annotation.Nullable + private Boolean isDisabled; + + public static final String JSON_PROPERTY_MASK_ID = "mask_id"; + @jakarta.annotation.Nullable + private String maskId; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + @jakarta.annotation.Nullable + private String projectId; + + public static final String JSON_PROPERTY_PROVIDER = "provider"; + @jakarta.annotation.Nullable + private DatastoreSourceProvider provider; + + public static final String JSON_PROPERTY_PROVIDER_CONFIG = "provider_config"; + @jakarta.annotation.Nullable + private DatastoreProviderConfig providerConfig; + + public static final String JSON_PROPERTY_PUB_SUB = "pub_sub"; + @jakarta.annotation.Nullable + private DatastorePubSubConfig pubSub; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private DatastoreSourceType type; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + @jakarta.annotation.Nullable + private String updatedAt; + + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nullable + private String url; + + public static final String JSON_PROPERTY_VERIFIER = "verifier"; + @jakarta.annotation.Nullable + private DatastoreVerifierConfig verifier; + + public ModelsSourceResponse() { + } + + public ModelsSourceResponse bodyFunction(@jakarta.annotation.Nullable String bodyFunction) { + this.bodyFunction = bodyFunction; + return this; + } + + /** + * Get bodyFunction + * @return bodyFunction + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BODY_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBodyFunction() { + return bodyFunction; + } + + + @JsonProperty(value = JSON_PROPERTY_BODY_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBodyFunction(@jakarta.annotation.Nullable String bodyFunction) { + this.bodyFunction = bodyFunction; + } + + + public ModelsSourceResponse createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public ModelsSourceResponse customResponse(@jakarta.annotation.Nullable DatastoreCustomResponse customResponse) { + this.customResponse = customResponse; + return this; + } + + /** + * Get customResponse + * @return customResponse + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CUSTOM_RESPONSE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreCustomResponse getCustomResponse() { + return customResponse; + } + + + @JsonProperty(value = JSON_PROPERTY_CUSTOM_RESPONSE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomResponse(@jakarta.annotation.Nullable DatastoreCustomResponse customResponse) { + this.customResponse = customResponse; + } + + + public ModelsSourceResponse deletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Get deletedAt + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + } + + + public ModelsSourceResponse eventTypeLocation(@jakarta.annotation.Nullable String eventTypeLocation) { + this.eventTypeLocation = eventTypeLocation; + return this; + } + + /** + * Get eventTypeLocation + * @return eventTypeLocation + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE_LOCATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventTypeLocation() { + return eventTypeLocation; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE_LOCATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventTypeLocation(@jakarta.annotation.Nullable String eventTypeLocation) { + this.eventTypeLocation = eventTypeLocation; + } + + + public ModelsSourceResponse forwardHeaders(@jakarta.annotation.Nullable List forwardHeaders) { + this.forwardHeaders = forwardHeaders; + return this; + } + + public ModelsSourceResponse addForwardHeadersItem(String forwardHeadersItem) { + if (this.forwardHeaders == null) { + this.forwardHeaders = new ArrayList<>(); + } + this.forwardHeaders.add(forwardHeadersItem); + return this; + } + + /** + * Get forwardHeaders + * @return forwardHeaders + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FORWARD_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getForwardHeaders() { + return forwardHeaders; + } + + + @JsonProperty(value = JSON_PROPERTY_FORWARD_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForwardHeaders(@jakarta.annotation.Nullable List forwardHeaders) { + this.forwardHeaders = forwardHeaders; + } + + + public ModelsSourceResponse headerFunction(@jakarta.annotation.Nullable String headerFunction) { + this.headerFunction = headerFunction; + return this; + } + + /** + * Get headerFunction + * @return headerFunction + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADER_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHeaderFunction() { + return headerFunction; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADER_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaderFunction(@jakarta.annotation.Nullable String headerFunction) { + this.headerFunction = headerFunction; + } + + + public ModelsSourceResponse idempotencyKeys(@jakarta.annotation.Nullable List idempotencyKeys) { + this.idempotencyKeys = idempotencyKeys; + return this; + } + + public ModelsSourceResponse addIdempotencyKeysItem(String idempotencyKeysItem) { + if (this.idempotencyKeys == null) { + this.idempotencyKeys = new ArrayList<>(); + } + this.idempotencyKeys.add(idempotencyKeysItem); + return this; + } + + /** + * Get idempotencyKeys + * @return idempotencyKeys + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEYS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIdempotencyKeys() { + return idempotencyKeys; + } + + + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEYS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdempotencyKeys(@jakarta.annotation.Nullable List idempotencyKeys) { + this.idempotencyKeys = idempotencyKeys; + } + + + public ModelsSourceResponse isDisabled(@jakarta.annotation.Nullable Boolean isDisabled) { + this.isDisabled = isDisabled; + return this; + } + + /** + * Get isDisabled + * @return isDisabled + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IS_DISABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsDisabled() { + return isDisabled; + } + + + @JsonProperty(value = JSON_PROPERTY_IS_DISABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDisabled(@jakarta.annotation.Nullable Boolean isDisabled) { + this.isDisabled = isDisabled; + } + + + public ModelsSourceResponse maskId(@jakarta.annotation.Nullable String maskId) { + this.maskId = maskId; + return this; + } + + /** + * Get maskId + * @return maskId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MASK_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMaskId() { + return maskId; + } + + + @JsonProperty(value = JSON_PROPERTY_MASK_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaskId(@jakarta.annotation.Nullable String maskId) { + this.maskId = maskId; + } + + + public ModelsSourceResponse name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public ModelsSourceResponse projectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Get projectId + * @return projectId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectId() { + return projectId; + } + + + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProjectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + } + + + public ModelsSourceResponse provider(@jakarta.annotation.Nullable DatastoreSourceProvider provider) { + this.provider = provider; + return this; + } + + /** + * Get provider + * @return provider + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROVIDER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreSourceProvider getProvider() { + return provider; + } + + + @JsonProperty(value = JSON_PROPERTY_PROVIDER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProvider(@jakarta.annotation.Nullable DatastoreSourceProvider provider) { + this.provider = provider; + } + + + public ModelsSourceResponse providerConfig(@jakarta.annotation.Nullable DatastoreProviderConfig providerConfig) { + this.providerConfig = providerConfig; + return this; + } + + /** + * Get providerConfig + * @return providerConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROVIDER_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreProviderConfig getProviderConfig() { + return providerConfig; + } + + + @JsonProperty(value = JSON_PROPERTY_PROVIDER_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderConfig(@jakarta.annotation.Nullable DatastoreProviderConfig providerConfig) { + this.providerConfig = providerConfig; + } + + + public ModelsSourceResponse pubSub(@jakarta.annotation.Nullable DatastorePubSubConfig pubSub) { + this.pubSub = pubSub; + return this; + } + + /** + * Get pubSub + * @return pubSub + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PUB_SUB, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastorePubSubConfig getPubSub() { + return pubSub; + } + + + @JsonProperty(value = JSON_PROPERTY_PUB_SUB, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPubSub(@jakarta.annotation.Nullable DatastorePubSubConfig pubSub) { + this.pubSub = pubSub; + } + + + public ModelsSourceResponse type(@jakarta.annotation.Nullable DatastoreSourceType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreSourceType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable DatastoreSourceType type) { + this.type = type; + } + + + public ModelsSourceResponse uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + public ModelsSourceResponse updatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + public ModelsSourceResponse url(@jakarta.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = url; + } + + + public ModelsSourceResponse verifier(@jakarta.annotation.Nullable DatastoreVerifierConfig verifier) { + this.verifier = verifier; + return this; + } + + /** + * Get verifier + * @return verifier + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_VERIFIER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreVerifierConfig getVerifier() { + return verifier; + } + + + @JsonProperty(value = JSON_PROPERTY_VERIFIER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVerifier(@jakarta.annotation.Nullable DatastoreVerifierConfig verifier) { + this.verifier = verifier; + } + + + /** + * Return true if this models.SourceResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsSourceResponse modelsSourceResponse = (ModelsSourceResponse) o; + return Objects.equals(this.bodyFunction, modelsSourceResponse.bodyFunction) && + Objects.equals(this.createdAt, modelsSourceResponse.createdAt) && + Objects.equals(this.customResponse, modelsSourceResponse.customResponse) && + Objects.equals(this.deletedAt, modelsSourceResponse.deletedAt) && + Objects.equals(this.eventTypeLocation, modelsSourceResponse.eventTypeLocation) && + Objects.equals(this.forwardHeaders, modelsSourceResponse.forwardHeaders) && + Objects.equals(this.headerFunction, modelsSourceResponse.headerFunction) && + Objects.equals(this.idempotencyKeys, modelsSourceResponse.idempotencyKeys) && + Objects.equals(this.isDisabled, modelsSourceResponse.isDisabled) && + Objects.equals(this.maskId, modelsSourceResponse.maskId) && + Objects.equals(this.name, modelsSourceResponse.name) && + Objects.equals(this.projectId, modelsSourceResponse.projectId) && + Objects.equals(this.provider, modelsSourceResponse.provider) && + Objects.equals(this.providerConfig, modelsSourceResponse.providerConfig) && + Objects.equals(this.pubSub, modelsSourceResponse.pubSub) && + Objects.equals(this.type, modelsSourceResponse.type) && + Objects.equals(this.uid, modelsSourceResponse.uid) && + Objects.equals(this.updatedAt, modelsSourceResponse.updatedAt) && + Objects.equals(this.url, modelsSourceResponse.url) && + Objects.equals(this.verifier, modelsSourceResponse.verifier); + } + + @Override + public int hashCode() { + return Objects.hash(bodyFunction, createdAt, customResponse, deletedAt, eventTypeLocation, forwardHeaders, headerFunction, idempotencyKeys, isDisabled, maskId, name, projectId, provider, providerConfig, pubSub, type, uid, updatedAt, url, verifier); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsSourceResponse {\n"); + sb.append(" bodyFunction: ").append(toIndentedString(bodyFunction)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" customResponse: ").append(toIndentedString(customResponse)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" eventTypeLocation: ").append(toIndentedString(eventTypeLocation)).append("\n"); + sb.append(" forwardHeaders: ").append(toIndentedString(forwardHeaders)).append("\n"); + sb.append(" headerFunction: ").append(toIndentedString(headerFunction)).append("\n"); + sb.append(" idempotencyKeys: ").append(toIndentedString(idempotencyKeys)).append("\n"); + sb.append(" isDisabled: ").append(toIndentedString(isDisabled)).append("\n"); + sb.append(" maskId: ").append(toIndentedString(maskId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" providerConfig: ").append(toIndentedString(providerConfig)).append("\n"); + sb.append(" pubSub: ").append(toIndentedString(pubSub)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" verifier: ").append(toIndentedString(verifier)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `body_function` to the URL query string + if (getBodyFunction() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbody_function%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBodyFunction())))); + } + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `custom_response` to the URL query string + if (getCustomResponse() != null) { + joiner.add(getCustomResponse().toUrlQueryString(prefix + "custom_response" + suffix)); + } + + // add `deleted_at` to the URL query string + if (getDeletedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeleted_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeletedAt())))); + } + + // add `event_type_location` to the URL query string + if (getEventTypeLocation() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type_location%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventTypeLocation())))); + } + + // add `forward_headers` to the URL query string + if (getForwardHeaders() != null) { + for (int i = 0; i < getForwardHeaders().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sforward_headers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getForwardHeaders().get(i))))); + } + } + + // add `header_function` to the URL query string + if (getHeaderFunction() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheader_function%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHeaderFunction())))); + } + + // add `idempotency_keys` to the URL query string + if (getIdempotencyKeys() != null) { + for (int i = 0; i < getIdempotencyKeys().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sidempotency_keys%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getIdempotencyKeys().get(i))))); + } + } + + // add `is_disabled` to the URL query string + if (getIsDisabled() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sis_disabled%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIsDisabled())))); + } + + // add `mask_id` to the URL query string + if (getMaskId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smask_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMaskId())))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `project_id` to the URL query string + if (getProjectId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sproject_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProjectId())))); + } + + // add `provider` to the URL query string + if (getProvider() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sprovider%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProvider())))); + } + + // add `provider_config` to the URL query string + if (getProviderConfig() != null) { + joiner.add(getProviderConfig().toUrlQueryString(prefix + "provider_config" + suffix)); + } + + // add `pub_sub` to the URL query string + if (getPubSub() != null) { + joiner.add(getPubSub().toUrlQueryString(prefix + "pub_sub" + suffix)); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + // add `updated_at` to the URL query string + if (getUpdatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%supdated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpdatedAt())))); + } + + // add `url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + // add `verifier` to the URL query string + if (getVerifier() != null) { + joiner.add(getVerifier().toUrlQueryString(prefix + "verifier" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsStrategyConfiguration.java b/src/main/java/com/getconvoy/models/ModelsStrategyConfiguration.java new file mode 100644 index 0000000..50c9a3d --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsStrategyConfiguration.java @@ -0,0 +1,220 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsStrategyConfiguration + */ +@JsonPropertyOrder({ + ModelsStrategyConfiguration.JSON_PROPERTY_DURATION, + ModelsStrategyConfiguration.JSON_PROPERTY_RETRY_COUNT, + ModelsStrategyConfiguration.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsStrategyConfiguration { + public static final String JSON_PROPERTY_DURATION = "duration"; + @jakarta.annotation.Nullable + private Integer duration; + + public static final String JSON_PROPERTY_RETRY_COUNT = "retry_count"; + @jakarta.annotation.Nullable + private Integer retryCount; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private String type; + + public ModelsStrategyConfiguration() { + } + + public ModelsStrategyConfiguration duration(@jakarta.annotation.Nullable Integer duration) { + this.duration = duration; + return this; + } + + /** + * Get duration + * @return duration + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDuration() { + return duration; + } + + + @JsonProperty(value = JSON_PROPERTY_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDuration(@jakarta.annotation.Nullable Integer duration) { + this.duration = duration; + } + + + public ModelsStrategyConfiguration retryCount(@jakarta.annotation.Nullable Integer retryCount) { + this.retryCount = retryCount; + return this; + } + + /** + * Get retryCount + * @return retryCount + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RETRY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRetryCount() { + return retryCount; + } + + + @JsonProperty(value = JSON_PROPERTY_RETRY_COUNT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRetryCount(@jakarta.annotation.Nullable Integer retryCount) { + this.retryCount = retryCount; + } + + + public ModelsStrategyConfiguration type(@jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + + /** + * Return true if this models.StrategyConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsStrategyConfiguration modelsStrategyConfiguration = (ModelsStrategyConfiguration) o; + return Objects.equals(this.duration, modelsStrategyConfiguration.duration) && + Objects.equals(this.retryCount, modelsStrategyConfiguration.retryCount) && + Objects.equals(this.type, modelsStrategyConfiguration.type); + } + + @Override + public int hashCode() { + return Objects.hash(duration, retryCount, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsStrategyConfiguration {\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" retryCount: ").append(toIndentedString(retryCount)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `duration` to the URL query string + if (getDuration() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sduration%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDuration())))); + } + + // add `retry_count` to the URL query string + if (getRetryCount() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sretry_count%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRetryCount())))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsSubscriptionResponse.java b/src/main/java/com/getconvoy/models/ModelsSubscriptionResponse.java new file mode 100644 index 0000000..0f22d83 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsSubscriptionResponse.java @@ -0,0 +1,697 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreAlertConfiguration; +import com.getconvoy.models.DatastoreDeliveryMode; +import com.getconvoy.models.DatastoreDevice; +import com.getconvoy.models.DatastoreEndpoint; +import com.getconvoy.models.DatastoreFilterConfiguration; +import com.getconvoy.models.DatastoreRateLimitConfiguration; +import com.getconvoy.models.DatastoreRetryConfiguration; +import com.getconvoy.models.DatastoreSource; +import com.getconvoy.models.DatastoreSubscriptionType; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsSubscriptionResponse + */ +@JsonPropertyOrder({ + ModelsSubscriptionResponse.JSON_PROPERTY_ALERT_CONFIG, + ModelsSubscriptionResponse.JSON_PROPERTY_CREATED_AT, + ModelsSubscriptionResponse.JSON_PROPERTY_DELETED_AT, + ModelsSubscriptionResponse.JSON_PROPERTY_DELIVERY_MODE, + ModelsSubscriptionResponse.JSON_PROPERTY_DEVICE_METADATA, + ModelsSubscriptionResponse.JSON_PROPERTY_ENDPOINT_METADATA, + ModelsSubscriptionResponse.JSON_PROPERTY_FILTER_CONFIG, + ModelsSubscriptionResponse.JSON_PROPERTY_FUNCTION, + ModelsSubscriptionResponse.JSON_PROPERTY_NAME, + ModelsSubscriptionResponse.JSON_PROPERTY_PROJECT_ID, + ModelsSubscriptionResponse.JSON_PROPERTY_RATE_LIMIT_CONFIG, + ModelsSubscriptionResponse.JSON_PROPERTY_RETRY_CONFIG, + ModelsSubscriptionResponse.JSON_PROPERTY_SOURCE_METADATA, + ModelsSubscriptionResponse.JSON_PROPERTY_TYPE, + ModelsSubscriptionResponse.JSON_PROPERTY_UID, + ModelsSubscriptionResponse.JSON_PROPERTY_UPDATED_AT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsSubscriptionResponse { + public static final String JSON_PROPERTY_ALERT_CONFIG = "alert_config"; + @jakarta.annotation.Nullable + private DatastoreAlertConfiguration alertConfig; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @jakarta.annotation.Nullable + private String createdAt; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + @jakarta.annotation.Nullable + private String deletedAt; + + public static final String JSON_PROPERTY_DELIVERY_MODE = "delivery_mode"; + @jakarta.annotation.Nullable + private DatastoreDeliveryMode deliveryMode; + + public static final String JSON_PROPERTY_DEVICE_METADATA = "device_metadata"; + @jakarta.annotation.Nullable + private DatastoreDevice deviceMetadata; + + public static final String JSON_PROPERTY_ENDPOINT_METADATA = "endpoint_metadata"; + @jakarta.annotation.Nullable + private DatastoreEndpoint endpointMetadata; + + public static final String JSON_PROPERTY_FILTER_CONFIG = "filter_config"; + @jakarta.annotation.Nullable + private DatastoreFilterConfiguration filterConfig; + + public static final String JSON_PROPERTY_FUNCTION = "function"; + @jakarta.annotation.Nullable + private String function; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + @jakarta.annotation.Nullable + private String projectId; + + public static final String JSON_PROPERTY_RATE_LIMIT_CONFIG = "rate_limit_config"; + @jakarta.annotation.Nullable + private DatastoreRateLimitConfiguration rateLimitConfig; + + public static final String JSON_PROPERTY_RETRY_CONFIG = "retry_config"; + @jakarta.annotation.Nullable + private DatastoreRetryConfiguration retryConfig; + + public static final String JSON_PROPERTY_SOURCE_METADATA = "source_metadata"; + @jakarta.annotation.Nullable + private DatastoreSource sourceMetadata; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private DatastoreSubscriptionType type; + + public static final String JSON_PROPERTY_UID = "uid"; + @jakarta.annotation.Nullable + private String uid; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + @jakarta.annotation.Nullable + private String updatedAt; + + public ModelsSubscriptionResponse() { + } + + public ModelsSubscriptionResponse alertConfig(@jakarta.annotation.Nullable DatastoreAlertConfiguration alertConfig) { + this.alertConfig = alertConfig; + return this; + } + + /** + * subscription config + * @return alertConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ALERT_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreAlertConfiguration getAlertConfig() { + return alertConfig; + } + + + @JsonProperty(value = JSON_PROPERTY_ALERT_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlertConfig(@jakarta.annotation.Nullable DatastoreAlertConfiguration alertConfig) { + this.alertConfig = alertConfig; + } + + + public ModelsSubscriptionResponse createdAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public ModelsSubscriptionResponse deletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Get deletedAt + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = deletedAt; + } + + + public ModelsSubscriptionResponse deliveryMode(@jakarta.annotation.Nullable DatastoreDeliveryMode deliveryMode) { + this.deliveryMode = deliveryMode; + return this; + } + + /** + * Get deliveryMode + * @return deliveryMode + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELIVERY_MODE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreDeliveryMode getDeliveryMode() { + return deliveryMode; + } + + + @JsonProperty(value = JSON_PROPERTY_DELIVERY_MODE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeliveryMode(@jakarta.annotation.Nullable DatastoreDeliveryMode deliveryMode) { + this.deliveryMode = deliveryMode; + } + + + public ModelsSubscriptionResponse deviceMetadata(@jakarta.annotation.Nullable DatastoreDevice deviceMetadata) { + this.deviceMetadata = deviceMetadata; + return this; + } + + /** + * Get deviceMetadata + * @return deviceMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DEVICE_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreDevice getDeviceMetadata() { + return deviceMetadata; + } + + + @JsonProperty(value = JSON_PROPERTY_DEVICE_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceMetadata(@jakarta.annotation.Nullable DatastoreDevice deviceMetadata) { + this.deviceMetadata = deviceMetadata; + } + + + public ModelsSubscriptionResponse endpointMetadata(@jakarta.annotation.Nullable DatastoreEndpoint endpointMetadata) { + this.endpointMetadata = endpointMetadata; + return this; + } + + /** + * Get endpointMetadata + * @return endpointMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreEndpoint getEndpointMetadata() { + return endpointMetadata; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpointMetadata(@jakarta.annotation.Nullable DatastoreEndpoint endpointMetadata) { + this.endpointMetadata = endpointMetadata; + } + + + public ModelsSubscriptionResponse filterConfig(@jakarta.annotation.Nullable DatastoreFilterConfiguration filterConfig) { + this.filterConfig = filterConfig; + return this; + } + + /** + * Get filterConfig + * @return filterConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FILTER_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreFilterConfiguration getFilterConfig() { + return filterConfig; + } + + + @JsonProperty(value = JSON_PROPERTY_FILTER_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilterConfig(@jakarta.annotation.Nullable DatastoreFilterConfiguration filterConfig) { + this.filterConfig = filterConfig; + } + + + public ModelsSubscriptionResponse function(@jakarta.annotation.Nullable String function) { + this.function = function; + return this; + } + + /** + * Get function + * @return function + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFunction() { + return function; + } + + + @JsonProperty(value = JSON_PROPERTY_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFunction(@jakarta.annotation.Nullable String function) { + this.function = function; + } + + + public ModelsSubscriptionResponse name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public ModelsSubscriptionResponse projectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Get projectId + * @return projectId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectId() { + return projectId; + } + + + @JsonProperty(value = JSON_PROPERTY_PROJECT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProjectId(@jakarta.annotation.Nullable String projectId) { + this.projectId = projectId; + } + + + public ModelsSubscriptionResponse rateLimitConfig(@jakarta.annotation.Nullable DatastoreRateLimitConfiguration rateLimitConfig) { + this.rateLimitConfig = rateLimitConfig; + return this; + } + + /** + * Get rateLimitConfig + * @return rateLimitConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreRateLimitConfiguration getRateLimitConfig() { + return rateLimitConfig; + } + + + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRateLimitConfig(@jakarta.annotation.Nullable DatastoreRateLimitConfiguration rateLimitConfig) { + this.rateLimitConfig = rateLimitConfig; + } + + + public ModelsSubscriptionResponse retryConfig(@jakarta.annotation.Nullable DatastoreRetryConfiguration retryConfig) { + this.retryConfig = retryConfig; + return this; + } + + /** + * Get retryConfig + * @return retryConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RETRY_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreRetryConfiguration getRetryConfig() { + return retryConfig; + } + + + @JsonProperty(value = JSON_PROPERTY_RETRY_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRetryConfig(@jakarta.annotation.Nullable DatastoreRetryConfiguration retryConfig) { + this.retryConfig = retryConfig; + } + + + public ModelsSubscriptionResponse sourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { + this.sourceMetadata = sourceMetadata; + return this; + } + + /** + * Get sourceMetadata + * @return sourceMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SOURCE_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreSource getSourceMetadata() { + return sourceMetadata; + } + + + @JsonProperty(value = JSON_PROPERTY_SOURCE_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { + this.sourceMetadata = sourceMetadata; + } + + + public ModelsSubscriptionResponse type(@jakarta.annotation.Nullable DatastoreSubscriptionType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreSubscriptionType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable DatastoreSubscriptionType type) { + this.type = type; + } + + + public ModelsSubscriptionResponse uid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUid() { + return uid; + } + + + @JsonProperty(value = JSON_PROPERTY_UID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(@jakarta.annotation.Nullable String uid) { + this.uid = uid; + } + + + public ModelsSubscriptionResponse updatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(value = JSON_PROPERTY_UPDATED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@jakarta.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + /** + * Return true if this models.SubscriptionResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsSubscriptionResponse modelsSubscriptionResponse = (ModelsSubscriptionResponse) o; + return Objects.equals(this.alertConfig, modelsSubscriptionResponse.alertConfig) && + Objects.equals(this.createdAt, modelsSubscriptionResponse.createdAt) && + Objects.equals(this.deletedAt, modelsSubscriptionResponse.deletedAt) && + Objects.equals(this.deliveryMode, modelsSubscriptionResponse.deliveryMode) && + Objects.equals(this.deviceMetadata, modelsSubscriptionResponse.deviceMetadata) && + Objects.equals(this.endpointMetadata, modelsSubscriptionResponse.endpointMetadata) && + Objects.equals(this.filterConfig, modelsSubscriptionResponse.filterConfig) && + Objects.equals(this.function, modelsSubscriptionResponse.function) && + Objects.equals(this.name, modelsSubscriptionResponse.name) && + Objects.equals(this.projectId, modelsSubscriptionResponse.projectId) && + Objects.equals(this.rateLimitConfig, modelsSubscriptionResponse.rateLimitConfig) && + Objects.equals(this.retryConfig, modelsSubscriptionResponse.retryConfig) && + Objects.equals(this.sourceMetadata, modelsSubscriptionResponse.sourceMetadata) && + Objects.equals(this.type, modelsSubscriptionResponse.type) && + Objects.equals(this.uid, modelsSubscriptionResponse.uid) && + Objects.equals(this.updatedAt, modelsSubscriptionResponse.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(alertConfig, createdAt, deletedAt, deliveryMode, deviceMetadata, endpointMetadata, filterConfig, function, name, projectId, rateLimitConfig, retryConfig, sourceMetadata, type, uid, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsSubscriptionResponse {\n"); + sb.append(" alertConfig: ").append(toIndentedString(alertConfig)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" deliveryMode: ").append(toIndentedString(deliveryMode)).append("\n"); + sb.append(" deviceMetadata: ").append(toIndentedString(deviceMetadata)).append("\n"); + sb.append(" endpointMetadata: ").append(toIndentedString(endpointMetadata)).append("\n"); + sb.append(" filterConfig: ").append(toIndentedString(filterConfig)).append("\n"); + sb.append(" function: ").append(toIndentedString(function)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" rateLimitConfig: ").append(toIndentedString(rateLimitConfig)).append("\n"); + sb.append(" retryConfig: ").append(toIndentedString(retryConfig)).append("\n"); + sb.append(" sourceMetadata: ").append(toIndentedString(sourceMetadata)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `alert_config` to the URL query string + if (getAlertConfig() != null) { + joiner.add(getAlertConfig().toUrlQueryString(prefix + "alert_config" + suffix)); + } + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `deleted_at` to the URL query string + if (getDeletedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeleted_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeletedAt())))); + } + + // add `delivery_mode` to the URL query string + if (getDeliveryMode() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdelivery_mode%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeliveryMode())))); + } + + // add `device_metadata` to the URL query string + if (getDeviceMetadata() != null) { + joiner.add(getDeviceMetadata().toUrlQueryString(prefix + "device_metadata" + suffix)); + } + + // add `endpoint_metadata` to the URL query string + if (getEndpointMetadata() != null) { + joiner.add(getEndpointMetadata().toUrlQueryString(prefix + "endpoint_metadata" + suffix)); + } + + // add `filter_config` to the URL query string + if (getFilterConfig() != null) { + joiner.add(getFilterConfig().toUrlQueryString(prefix + "filter_config" + suffix)); + } + + // add `function` to the URL query string + if (getFunction() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sfunction%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFunction())))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `project_id` to the URL query string + if (getProjectId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sproject_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProjectId())))); + } + + // add `rate_limit_config` to the URL query string + if (getRateLimitConfig() != null) { + joiner.add(getRateLimitConfig().toUrlQueryString(prefix + "rate_limit_config" + suffix)); + } + + // add `retry_config` to the URL query string + if (getRetryConfig() != null) { + joiner.add(getRetryConfig().toUrlQueryString(prefix + "retry_config" + suffix)); + } + + // add `source_metadata` to the URL query string + if (getSourceMetadata() != null) { + joiner.add(getSourceMetadata().toUrlQueryString(prefix + "source_metadata" + suffix)); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `uid` to the URL query string + if (getUid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUid())))); + } + + // add `updated_at` to the URL query string + if (getUpdatedAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%supdated_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpdatedAt())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsTestFilter.java b/src/main/java/com/getconvoy/models/ModelsTestFilter.java new file mode 100644 index 0000000..2bf5a81 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsTestFilter.java @@ -0,0 +1,185 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsFilterSchema; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsTestFilter + */ +@JsonPropertyOrder({ + ModelsTestFilter.JSON_PROPERTY_REQUEST, + ModelsTestFilter.JSON_PROPERTY_SCHEMA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsTestFilter { + public static final String JSON_PROPERTY_REQUEST = "request"; + @jakarta.annotation.Nullable + private ModelsFilterSchema request; + + public static final String JSON_PROPERTY_SCHEMA = "schema"; + @jakarta.annotation.Nullable + private ModelsFilterSchema schema; + + public ModelsTestFilter() { + } + + public ModelsTestFilter request(@jakarta.annotation.Nullable ModelsFilterSchema request) { + this.request = request; + return this; + } + + /** + * Same Request & Headers + * @return request + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_REQUEST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsFilterSchema getRequest() { + return request; + } + + + @JsonProperty(value = JSON_PROPERTY_REQUEST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequest(@jakarta.annotation.Nullable ModelsFilterSchema request) { + this.request = request; + } + + + public ModelsTestFilter schema(@jakarta.annotation.Nullable ModelsFilterSchema schema) { + this.schema = schema; + return this; + } + + /** + * Sample test schema + * @return schema + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SCHEMA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsFilterSchema getSchema() { + return schema; + } + + + @JsonProperty(value = JSON_PROPERTY_SCHEMA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSchema(@jakarta.annotation.Nullable ModelsFilterSchema schema) { + this.schema = schema; + } + + + /** + * Return true if this models.TestFilter object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsTestFilter modelsTestFilter = (ModelsTestFilter) o; + return Objects.equals(this.request, modelsTestFilter.request) && + Objects.equals(this.schema, modelsTestFilter.schema); + } + + @Override + public int hashCode() { + return Objects.hash(request, schema); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsTestFilter {\n"); + sb.append(" request: ").append(toIndentedString(request)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `request` to the URL query string + if (getRequest() != null) { + joiner.add(getRequest().toUrlQueryString(prefix + "request" + suffix)); + } + + // add `schema` to the URL query string + if (getSchema() != null) { + joiner.add(getSchema().toUrlQueryString(prefix + "schema" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsTestFilterRequest.java b/src/main/java/com/getconvoy/models/ModelsTestFilterRequest.java new file mode 100644 index 0000000..dc613ec --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsTestFilterRequest.java @@ -0,0 +1,207 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsTestFilterRequestScopes; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsTestFilterRequest + */ +@JsonPropertyOrder({ + ModelsTestFilterRequest.JSON_PROPERTY_PAYLOAD, + ModelsTestFilterRequest.JSON_PROPERTY_REQUEST +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsTestFilterRequest { + public static final String JSON_PROPERTY_PAYLOAD = "payload"; + private JsonNullable payload = JsonNullable.of(null); + + public static final String JSON_PROPERTY_REQUEST = "request"; + @jakarta.annotation.Nullable + private ModelsTestFilterRequestScopes request; + + public ModelsTestFilterRequest() { + } + + public ModelsTestFilterRequest payload(@jakarta.annotation.Nullable Object payload) { + this.payload = JsonNullable.of(payload); + return this; + } + + /** + * Sample payload to test against body filter rules. Optional when request scopes are supplied. + * @return payload + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Object getPayload() { + return payload.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_PAYLOAD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getPayload_JsonNullable() { + return payload; + } + + @JsonProperty(JSON_PROPERTY_PAYLOAD) + public void setPayload_JsonNullable(JsonNullable payload) { + this.payload = payload; + } + + public void setPayload(@jakarta.annotation.Nullable Object payload) { + this.payload = JsonNullable.of(payload); + } + + + public ModelsTestFilterRequest request(@jakarta.annotation.Nullable ModelsTestFilterRequestScopes request) { + this.request = request; + return this; + } + + /** + * Request scopes to test against the filter. + * @return request + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_REQUEST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsTestFilterRequestScopes getRequest() { + return request; + } + + + @JsonProperty(value = JSON_PROPERTY_REQUEST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequest(@jakarta.annotation.Nullable ModelsTestFilterRequestScopes request) { + this.request = request; + } + + + /** + * Return true if this models.TestFilterRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsTestFilterRequest modelsTestFilterRequest = (ModelsTestFilterRequest) o; + return equalsNullable(this.payload, modelsTestFilterRequest.payload) && + Objects.equals(this.request, modelsTestFilterRequest.request); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(payload), request); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsTestFilterRequest {\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append(" request: ").append(toIndentedString(request)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `payload` to the URL query string + if (getPayload() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spayload%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPayload())))); + } + + // add `request` to the URL query string + if (getRequest() != null) { + joiner.add(getRequest().toUrlQueryString(prefix + "request" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsTestFilterRequestScopes.java b/src/main/java/com/getconvoy/models/ModelsTestFilterRequestScopes.java new file mode 100644 index 0000000..6851dd8 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsTestFilterRequestScopes.java @@ -0,0 +1,364 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsTestFilterRequestScopes + */ +@JsonPropertyOrder({ + ModelsTestFilterRequestScopes.JSON_PROPERTY_BODY, + ModelsTestFilterRequestScopes.JSON_PROPERTY_HEADER, + ModelsTestFilterRequestScopes.JSON_PROPERTY_HEADERS, + ModelsTestFilterRequestScopes.JSON_PROPERTY_PATH, + ModelsTestFilterRequestScopes.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsTestFilterRequestScopes { + public static final String JSON_PROPERTY_BODY = "body"; + private JsonNullable body = JsonNullable.of(null); + + public static final String JSON_PROPERTY_HEADER = "header"; + @jakarta.annotation.Nullable + private Map header = new HashMap<>(); + + public static final String JSON_PROPERTY_HEADERS = "headers"; + @jakarta.annotation.Nullable + private Map headers; + + public static final String JSON_PROPERTY_PATH = "path"; + @jakarta.annotation.Nullable + private Map path = new HashMap<>(); + + public static final String JSON_PROPERTY_QUERY = "query"; + @jakarta.annotation.Nullable + private Map query = new HashMap<>(); + + public ModelsTestFilterRequestScopes() { + } + + public ModelsTestFilterRequestScopes body(@jakarta.annotation.Nullable Object body) { + this.body = JsonNullable.of(body); + return this; + } + + /** + * Get body + * @return body + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Object getBody() { + return body.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getBody_JsonNullable() { + return body; + } + + @JsonProperty(JSON_PROPERTY_BODY) + public void setBody_JsonNullable(JsonNullable body) { + this.body = body; + } + + public void setBody(@jakarta.annotation.Nullable Object body) { + this.body = JsonNullable.of(body); + } + + + public ModelsTestFilterRequestScopes header(@jakarta.annotation.Nullable Map header) { + this.header = header; + return this; + } + + public ModelsTestFilterRequestScopes putHeaderItem(String key, Object headerItem) { + if (this.header == null) { + this.header = new HashMap<>(); + } + this.header.put(key, headerItem); + return this; + } + + /** + * Get header + * @return header + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADER, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getHeader() { + return header; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADER, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setHeader(@jakarta.annotation.Nullable Map header) { + this.header = header; + } + + + public ModelsTestFilterRequestScopes headers(@jakarta.annotation.Nullable Map headers) { + this.headers = headers; + return this; + } + + public ModelsTestFilterRequestScopes putHeadersItem(String key, Object headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * Headers accepts either \"headers\" or \"header\" for compatibility with the subscription filter tester. + * @return headers + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getHeaders() { + return headers; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(@jakarta.annotation.Nullable Map headers) { + this.headers = headers; + } + + + public ModelsTestFilterRequestScopes path(@jakarta.annotation.Nullable Map path) { + this.path = path; + return this; + } + + public ModelsTestFilterRequestScopes putPathItem(String key, Object pathItem) { + if (this.path == null) { + this.path = new HashMap<>(); + } + this.path.put(key, pathItem); + return this; + } + + /** + * Get path + * @return path + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PATH, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getPath() { + return path; + } + + + @JsonProperty(value = JSON_PROPERTY_PATH, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@jakarta.annotation.Nullable Map path) { + this.path = path; + } + + + public ModelsTestFilterRequestScopes query(@jakarta.annotation.Nullable Map query) { + this.query = query; + return this; + } + + public ModelsTestFilterRequestScopes putQueryItem(String key, Object queryItem) { + if (this.query == null) { + this.query = new HashMap<>(); + } + this.query.put(key, queryItem); + return this; + } + + /** + * Get query + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getQuery() { + return query; + } + + + @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setQuery(@jakarta.annotation.Nullable Map query) { + this.query = query; + } + + + /** + * Return true if this models.TestFilterRequestScopes object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsTestFilterRequestScopes modelsTestFilterRequestScopes = (ModelsTestFilterRequestScopes) o; + return equalsNullable(this.body, modelsTestFilterRequestScopes.body) && + Objects.equals(this.header, modelsTestFilterRequestScopes.header) && + Objects.equals(this.headers, modelsTestFilterRequestScopes.headers) && + Objects.equals(this.path, modelsTestFilterRequestScopes.path) && + Objects.equals(this.query, modelsTestFilterRequestScopes.query); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(body), header, headers, path, query); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsTestFilterRequestScopes {\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `body` to the URL query string + if (getBody() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbody%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBody())))); + } + + // add `header` to the URL query string + if (getHeader() != null) { + for (String _key : getHeader().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheader%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getHeader().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getHeader().get(_key))))); + } + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (String _key : getHeaders().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getHeaders().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getHeaders().get(_key))))); + } + } + + // add `path` to the URL query string + if (getPath() != null) { + for (String _key : getPath().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%spath%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getPath().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getPath().get(_key))))); + } + } + + // add `query` to the URL query string + if (getQuery() != null) { + for (String _key : getQuery().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%squery%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getQuery().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getQuery().get(_key))))); + } + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsTestFilterResponse.java b/src/main/java/com/getconvoy/models/ModelsTestFilterResponse.java new file mode 100644 index 0000000..da18d3c --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsTestFilterResponse.java @@ -0,0 +1,148 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsTestFilterResponse + */ +@JsonPropertyOrder({ + ModelsTestFilterResponse.JSON_PROPERTY_IS_MATCH +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsTestFilterResponse { + public static final String JSON_PROPERTY_IS_MATCH = "is_match"; + @jakarta.annotation.Nullable + private Boolean isMatch; + + public ModelsTestFilterResponse() { + } + + public ModelsTestFilterResponse isMatch(@jakarta.annotation.Nullable Boolean isMatch) { + this.isMatch = isMatch; + return this; + } + + /** + * Whether the payload matches the filter criteria + * @return isMatch + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IS_MATCH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsMatch() { + return isMatch; + } + + + @JsonProperty(value = JSON_PROPERTY_IS_MATCH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMatch(@jakarta.annotation.Nullable Boolean isMatch) { + this.isMatch = isMatch; + } + + + /** + * Return true if this models.TestFilterResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsTestFilterResponse modelsTestFilterResponse = (ModelsTestFilterResponse) o; + return Objects.equals(this.isMatch, modelsTestFilterResponse.isMatch); + } + + @Override + public int hashCode() { + return Objects.hash(isMatch); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsTestFilterResponse {\n"); + sb.append(" isMatch: ").append(toIndentedString(isMatch)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `is_match` to the URL query string + if (getIsMatch() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sis_match%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIsMatch())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsTestOAuth2Request.java b/src/main/java/com/getconvoy/models/ModelsTestOAuth2Request.java new file mode 100644 index 0000000..4ac2142 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsTestOAuth2Request.java @@ -0,0 +1,149 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsOAuth2; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsTestOAuth2Request + */ +@JsonPropertyOrder({ + ModelsTestOAuth2Request.JSON_PROPERTY_OAUTH2 +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsTestOAuth2Request { + public static final String JSON_PROPERTY_OAUTH2 = "oauth2"; + @jakarta.annotation.Nullable + private ModelsOAuth2 oauth2; + + public ModelsTestOAuth2Request() { + } + + public ModelsTestOAuth2Request oauth2(@jakarta.annotation.Nullable ModelsOAuth2 oauth2) { + this.oauth2 = oauth2; + return this; + } + + /** + * Get oauth2 + * @return oauth2 + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OAUTH2, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsOAuth2 getOauth2() { + return oauth2; + } + + + @JsonProperty(value = JSON_PROPERTY_OAUTH2, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOauth2(@jakarta.annotation.Nullable ModelsOAuth2 oauth2) { + this.oauth2 = oauth2; + } + + + /** + * Return true if this models.TestOAuth2Request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsTestOAuth2Request modelsTestOAuth2Request = (ModelsTestOAuth2Request) o; + return Objects.equals(this.oauth2, modelsTestOAuth2Request.oauth2); + } + + @Override + public int hashCode() { + return Objects.hash(oauth2); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsTestOAuth2Request {\n"); + sb.append(" oauth2: ").append(toIndentedString(oauth2)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `oauth2` to the URL query string + if (getOauth2() != null) { + joiner.add(getOauth2().toUrlQueryString(prefix + "oauth2" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsTestOAuth2Response.java b/src/main/java/com/getconvoy/models/ModelsTestOAuth2Response.java new file mode 100644 index 0000000..5d2d365 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsTestOAuth2Response.java @@ -0,0 +1,328 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsTestOAuth2Response + */ +@JsonPropertyOrder({ + ModelsTestOAuth2Response.JSON_PROPERTY_ACCESS_TOKEN, + ModelsTestOAuth2Response.JSON_PROPERTY_ERROR, + ModelsTestOAuth2Response.JSON_PROPERTY_EXPIRES_AT, + ModelsTestOAuth2Response.JSON_PROPERTY_MESSAGE, + ModelsTestOAuth2Response.JSON_PROPERTY_SUCCESS, + ModelsTestOAuth2Response.JSON_PROPERTY_TOKEN_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsTestOAuth2Response { + public static final String JSON_PROPERTY_ACCESS_TOKEN = "access_token"; + @jakarta.annotation.Nullable + private String accessToken; + + public static final String JSON_PROPERTY_ERROR = "error"; + @jakarta.annotation.Nullable + private String error; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @jakarta.annotation.Nullable + private String expiresAt; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_SUCCESS = "success"; + @jakarta.annotation.Nullable + private Boolean success; + + public static final String JSON_PROPERTY_TOKEN_TYPE = "token_type"; + @jakarta.annotation.Nullable + private String tokenType; + + public ModelsTestOAuth2Response() { + } + + public ModelsTestOAuth2Response accessToken(@jakarta.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get accessToken + * @return accessToken + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ACCESS_TOKEN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccessToken() { + return accessToken; + } + + + @JsonProperty(value = JSON_PROPERTY_ACCESS_TOKEN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessToken(@jakarta.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public ModelsTestOAuth2Response error(@jakarta.annotation.Nullable String error) { + this.error = error; + return this; + } + + /** + * Get error + * @return error + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ERROR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getError() { + return error; + } + + + @JsonProperty(value = JSON_PROPERTY_ERROR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setError(@jakarta.annotation.Nullable String error) { + this.error = error; + } + + + public ModelsTestOAuth2Response expiresAt(@jakarta.annotation.Nullable String expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * Get expiresAt + * @return expiresAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EXPIRES_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(value = JSON_PROPERTY_EXPIRES_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@jakarta.annotation.Nullable String expiresAt) { + this.expiresAt = expiresAt; + } + + + public ModelsTestOAuth2Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public ModelsTestOAuth2Response success(@jakarta.annotation.Nullable Boolean success) { + this.success = success; + return this; + } + + /** + * Get success + * @return success + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SUCCESS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSuccess() { + return success; + } + + + @JsonProperty(value = JSON_PROPERTY_SUCCESS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSuccess(@jakarta.annotation.Nullable Boolean success) { + this.success = success; + } + + + public ModelsTestOAuth2Response tokenType(@jakarta.annotation.Nullable String tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Get tokenType + * @return tokenType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TOKEN_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTokenType() { + return tokenType; + } + + + @JsonProperty(value = JSON_PROPERTY_TOKEN_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTokenType(@jakarta.annotation.Nullable String tokenType) { + this.tokenType = tokenType; + } + + + /** + * Return true if this models.TestOAuth2Response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsTestOAuth2Response modelsTestOAuth2Response = (ModelsTestOAuth2Response) o; + return Objects.equals(this.accessToken, modelsTestOAuth2Response.accessToken) && + Objects.equals(this.error, modelsTestOAuth2Response.error) && + Objects.equals(this.expiresAt, modelsTestOAuth2Response.expiresAt) && + Objects.equals(this.message, modelsTestOAuth2Response.message) && + Objects.equals(this.success, modelsTestOAuth2Response.success) && + Objects.equals(this.tokenType, modelsTestOAuth2Response.tokenType); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, error, expiresAt, message, success, tokenType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsTestOAuth2Response {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `access_token` to the URL query string + if (getAccessToken() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%saccess_token%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAccessToken())))); + } + + // add `error` to the URL query string + if (getError() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%serror%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getError())))); + } + + // add `expires_at` to the URL query string + if (getExpiresAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sexpires_at%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getExpiresAt())))); + } + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `success` to the URL query string + if (getSuccess() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssuccess%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSuccess())))); + } + + // add `token_type` to the URL query string + if (getTokenType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stoken_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTokenType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsUpdateCustomResponse.java b/src/main/java/com/getconvoy/models/ModelsUpdateCustomResponse.java new file mode 100644 index 0000000..f1850b6 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsUpdateCustomResponse.java @@ -0,0 +1,213 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsUpdateCustomResponse + */ +@JsonPropertyOrder({ + ModelsUpdateCustomResponse.JSON_PROPERTY_BODY, + ModelsUpdateCustomResponse.JSON_PROPERTY_CONTENT_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsUpdateCustomResponse { + public static final String JSON_PROPERTY_BODY = "body"; + private JsonNullable body = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_CONTENT_TYPE = "content_type"; + private JsonNullable contentType = JsonNullable.undefined(); + + public ModelsUpdateCustomResponse() { + } + + public ModelsUpdateCustomResponse body(@jakarta.annotation.Nullable String body) { + this.body = JsonNullable.of(body); + return this; + } + + /** + * Get body + * @return body + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getBody() { + return body.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getBody_JsonNullable() { + return body; + } + + @JsonProperty(JSON_PROPERTY_BODY) + public void setBody_JsonNullable(JsonNullable body) { + this.body = body; + } + + public void setBody(@jakarta.annotation.Nullable String body) { + this.body = JsonNullable.of(body); + } + + + public ModelsUpdateCustomResponse contentType(@jakarta.annotation.Nullable String contentType) { + this.contentType = JsonNullable.of(contentType); + return this; + } + + /** + * Get contentType + * @return contentType + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getContentType() { + return contentType.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_CONTENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getContentType_JsonNullable() { + return contentType; + } + + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE) + public void setContentType_JsonNullable(JsonNullable contentType) { + this.contentType = contentType; + } + + public void setContentType(@jakarta.annotation.Nullable String contentType) { + this.contentType = JsonNullable.of(contentType); + } + + + /** + * Return true if this models.UpdateCustomResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsUpdateCustomResponse modelsUpdateCustomResponse = (ModelsUpdateCustomResponse) o; + return equalsNullable(this.body, modelsUpdateCustomResponse.body) && + equalsNullable(this.contentType, modelsUpdateCustomResponse.contentType); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(body), hashCodeNullable(contentType)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsUpdateCustomResponse {\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `body` to the URL query string + if (getBody() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbody%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBody())))); + } + + // add `content_type` to the URL query string + if (getContentType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scontent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getContentType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsUpdateEndpoint.java b/src/main/java/com/getconvoy/models/ModelsUpdateEndpoint.java new file mode 100644 index 0000000..d96a959 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsUpdateEndpoint.java @@ -0,0 +1,654 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsEndpointAuthentication; +import com.getconvoy.models.ModelsMtlsClientCert; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsUpdateEndpoint + */ +@JsonPropertyOrder({ + ModelsUpdateEndpoint.JSON_PROPERTY_ADVANCED_SIGNATURES, + ModelsUpdateEndpoint.JSON_PROPERTY_AUTHENTICATION, + ModelsUpdateEndpoint.JSON_PROPERTY_CONTENT_TYPE, + ModelsUpdateEndpoint.JSON_PROPERTY_DESCRIPTION, + ModelsUpdateEndpoint.JSON_PROPERTY_HTTP_TIMEOUT, + ModelsUpdateEndpoint.JSON_PROPERTY_IS_DISABLED, + ModelsUpdateEndpoint.JSON_PROPERTY_MTLS_CLIENT_CERT, + ModelsUpdateEndpoint.JSON_PROPERTY_NAME, + ModelsUpdateEndpoint.JSON_PROPERTY_OWNER_ID, + ModelsUpdateEndpoint.JSON_PROPERTY_RATE_LIMIT, + ModelsUpdateEndpoint.JSON_PROPERTY_RATE_LIMIT_DURATION, + ModelsUpdateEndpoint.JSON_PROPERTY_SECRET, + ModelsUpdateEndpoint.JSON_PROPERTY_SLACK_WEBHOOK_URL, + ModelsUpdateEndpoint.JSON_PROPERTY_SUPPORT_EMAIL, + ModelsUpdateEndpoint.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsUpdateEndpoint { + public static final String JSON_PROPERTY_ADVANCED_SIGNATURES = "advanced_signatures"; + @jakarta.annotation.Nullable + private Boolean advancedSignatures; + + public static final String JSON_PROPERTY_AUTHENTICATION = "authentication"; + @jakarta.annotation.Nullable + private ModelsEndpointAuthentication authentication; + + public static final String JSON_PROPERTY_CONTENT_TYPE = "content_type"; + @jakarta.annotation.Nullable + private String contentType; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + @jakarta.annotation.Nullable + private String description; + + public static final String JSON_PROPERTY_HTTP_TIMEOUT = "http_timeout"; + @jakarta.annotation.Nullable + private Integer httpTimeout; + + public static final String JSON_PROPERTY_IS_DISABLED = "is_disabled"; + @jakarta.annotation.Nullable + private Boolean isDisabled; + + public static final String JSON_PROPERTY_MTLS_CLIENT_CERT = "mtls_client_cert"; + @jakarta.annotation.Nullable + private ModelsMtlsClientCert mtlsClientCert; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_OWNER_ID = "owner_id"; + @jakarta.annotation.Nullable + private String ownerId; + + public static final String JSON_PROPERTY_RATE_LIMIT = "rate_limit"; + @jakarta.annotation.Nullable + private Integer rateLimit; + + public static final String JSON_PROPERTY_RATE_LIMIT_DURATION = "rate_limit_duration"; + @jakarta.annotation.Nullable + private Integer rateLimitDuration; + + public static final String JSON_PROPERTY_SECRET = "secret"; + @jakarta.annotation.Nullable + private String secret; + + public static final String JSON_PROPERTY_SLACK_WEBHOOK_URL = "slack_webhook_url"; + @jakarta.annotation.Nullable + private String slackWebhookUrl; + + public static final String JSON_PROPERTY_SUPPORT_EMAIL = "support_email"; + @jakarta.annotation.Nullable + private String supportEmail; + + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nullable + private String url; + + public ModelsUpdateEndpoint() { + } + + public ModelsUpdateEndpoint advancedSignatures(@jakarta.annotation.Nullable Boolean advancedSignatures) { + this.advancedSignatures = advancedSignatures; + return this; + } + + /** + * Convoy supports two [signature formats](https://getconvoy.io/docs/product-manual/signatures) -- simple or advanced. If left unspecified, we default to false. + * @return advancedSignatures + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ADVANCED_SIGNATURES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAdvancedSignatures() { + return advancedSignatures; + } + + + @JsonProperty(value = JSON_PROPERTY_ADVANCED_SIGNATURES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdvancedSignatures(@jakarta.annotation.Nullable Boolean advancedSignatures) { + this.advancedSignatures = advancedSignatures; + } + + + public ModelsUpdateEndpoint authentication(@jakarta.annotation.Nullable ModelsEndpointAuthentication authentication) { + this.authentication = authentication; + return this; + } + + /** + * This is used to define any custom authentication required by the endpoint. This shouldn't be needed often because webhook endpoints usually should be exposed to the internet. + * @return authentication + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUTHENTICATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsEndpointAuthentication getAuthentication() { + return authentication; + } + + + @JsonProperty(value = JSON_PROPERTY_AUTHENTICATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthentication(@jakarta.annotation.Nullable ModelsEndpointAuthentication authentication) { + this.authentication = authentication; + } + + + public ModelsUpdateEndpoint contentType(@jakarta.annotation.Nullable String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Content type for the endpoint. Defaults to application/json if not specified. + * @return contentType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONTENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContentType() { + return contentType; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentType(@jakarta.annotation.Nullable String contentType) { + this.contentType = contentType; + } + + + public ModelsUpdateEndpoint description(@jakarta.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Human-readable description of the endpoint. Think of this as metadata describing the endpoint + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@jakarta.annotation.Nullable String description) { + this.description = description; + } + + + public ModelsUpdateEndpoint httpTimeout(@jakarta.annotation.Nullable Integer httpTimeout) { + this.httpTimeout = httpTimeout; + return this; + } + + /** + * Define endpoint http timeout in seconds. + * @return httpTimeout + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HTTP_TIMEOUT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHttpTimeout() { + return httpTimeout; + } + + + @JsonProperty(value = JSON_PROPERTY_HTTP_TIMEOUT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHttpTimeout(@jakarta.annotation.Nullable Integer httpTimeout) { + this.httpTimeout = httpTimeout; + } + + + public ModelsUpdateEndpoint isDisabled(@jakarta.annotation.Nullable Boolean isDisabled) { + this.isDisabled = isDisabled; + return this; + } + + /** + * This is used to manually enable/disable the endpoint. + * @return isDisabled + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IS_DISABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsDisabled() { + return isDisabled; + } + + + @JsonProperty(value = JSON_PROPERTY_IS_DISABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDisabled(@jakarta.annotation.Nullable Boolean isDisabled) { + this.isDisabled = isDisabled; + } + + + public ModelsUpdateEndpoint mtlsClientCert(@jakarta.annotation.Nullable ModelsMtlsClientCert mtlsClientCert) { + this.mtlsClientCert = mtlsClientCert; + return this; + } + + /** + * mTLS client certificate configuration for the endpoint + * @return mtlsClientCert + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MTLS_CLIENT_CERT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsMtlsClientCert getMtlsClientCert() { + return mtlsClientCert; + } + + + @JsonProperty(value = JSON_PROPERTY_MTLS_CLIENT_CERT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMtlsClientCert(@jakarta.annotation.Nullable ModelsMtlsClientCert mtlsClientCert) { + this.mtlsClientCert = mtlsClientCert; + } + + + public ModelsUpdateEndpoint name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public ModelsUpdateEndpoint ownerId(@jakarta.annotation.Nullable String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * The OwnerID is used to group more than one endpoint together to achieve [fanout](https://getconvoy.io/docs/manual/endpoints#Endpoint%20Owner%20ID) + * @return ownerId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OWNER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOwnerId() { + return ownerId; + } + + + @JsonProperty(value = JSON_PROPERTY_OWNER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOwnerId(@jakarta.annotation.Nullable String ownerId) { + this.ownerId = ownerId; + } + + + public ModelsUpdateEndpoint rateLimit(@jakarta.annotation.Nullable Integer rateLimit) { + this.rateLimit = rateLimit; + return this; + } + + /** + * Rate limit is the total number of requests to be sent to an endpoint in the time duration specified in RateLimitDuration + * @return rateLimit + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRateLimit() { + return rateLimit; + } + + + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRateLimit(@jakarta.annotation.Nullable Integer rateLimit) { + this.rateLimit = rateLimit; + } + + + public ModelsUpdateEndpoint rateLimitDuration(@jakarta.annotation.Nullable Integer rateLimitDuration) { + this.rateLimitDuration = rateLimitDuration; + return this; + } + + /** + * Rate limit duration specifies the time range for the rate limit. + * @return rateLimitDuration + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRateLimitDuration() { + return rateLimitDuration; + } + + + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT_DURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRateLimitDuration(@jakarta.annotation.Nullable Integer rateLimitDuration) { + this.rateLimitDuration = rateLimitDuration; + } + + + public ModelsUpdateEndpoint secret(@jakarta.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * Endpoint's webhook secret. If not provided, Convoy autogenerates one for the endpoint. + * @return secret + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecret() { + return secret; + } + + + @JsonProperty(value = JSON_PROPERTY_SECRET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(@jakarta.annotation.Nullable String secret) { + this.secret = secret; + } + + + public ModelsUpdateEndpoint slackWebhookUrl(@jakarta.annotation.Nullable String slackWebhookUrl) { + this.slackWebhookUrl = slackWebhookUrl; + return this; + } + + /** + * Slack webhook URL is an alternative method to support email where endpoint developers can receive failure notifications on a slack channel. + * @return slackWebhookUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SLACK_WEBHOOK_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSlackWebhookUrl() { + return slackWebhookUrl; + } + + + @JsonProperty(value = JSON_PROPERTY_SLACK_WEBHOOK_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSlackWebhookUrl(@jakarta.annotation.Nullable String slackWebhookUrl) { + this.slackWebhookUrl = slackWebhookUrl; + } + + + public ModelsUpdateEndpoint supportEmail(@jakarta.annotation.Nullable String supportEmail) { + this.supportEmail = supportEmail; + return this; + } + + /** + * Endpoint developers support email. This is used for communicating endpoint state changes. You should always turn this on when disabling endpoints are enabled. + * @return supportEmail + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SUPPORT_EMAIL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSupportEmail() { + return supportEmail; + } + + + @JsonProperty(value = JSON_PROPERTY_SUPPORT_EMAIL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportEmail(@jakarta.annotation.Nullable String supportEmail) { + this.supportEmail = supportEmail; + } + + + public ModelsUpdateEndpoint url(@jakarta.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * URL is the endpoint's URL prefixed with https. non-https urls are currently not supported. + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = url; + } + + + /** + * Return true if this models.UpdateEndpoint object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsUpdateEndpoint modelsUpdateEndpoint = (ModelsUpdateEndpoint) o; + return Objects.equals(this.advancedSignatures, modelsUpdateEndpoint.advancedSignatures) && + Objects.equals(this.authentication, modelsUpdateEndpoint.authentication) && + Objects.equals(this.contentType, modelsUpdateEndpoint.contentType) && + Objects.equals(this.description, modelsUpdateEndpoint.description) && + Objects.equals(this.httpTimeout, modelsUpdateEndpoint.httpTimeout) && + Objects.equals(this.isDisabled, modelsUpdateEndpoint.isDisabled) && + Objects.equals(this.mtlsClientCert, modelsUpdateEndpoint.mtlsClientCert) && + Objects.equals(this.name, modelsUpdateEndpoint.name) && + Objects.equals(this.ownerId, modelsUpdateEndpoint.ownerId) && + Objects.equals(this.rateLimit, modelsUpdateEndpoint.rateLimit) && + Objects.equals(this.rateLimitDuration, modelsUpdateEndpoint.rateLimitDuration) && + Objects.equals(this.secret, modelsUpdateEndpoint.secret) && + Objects.equals(this.slackWebhookUrl, modelsUpdateEndpoint.slackWebhookUrl) && + Objects.equals(this.supportEmail, modelsUpdateEndpoint.supportEmail) && + Objects.equals(this.url, modelsUpdateEndpoint.url); + } + + @Override + public int hashCode() { + return Objects.hash(advancedSignatures, authentication, contentType, description, httpTimeout, isDisabled, mtlsClientCert, name, ownerId, rateLimit, rateLimitDuration, secret, slackWebhookUrl, supportEmail, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsUpdateEndpoint {\n"); + sb.append(" advancedSignatures: ").append(toIndentedString(advancedSignatures)).append("\n"); + sb.append(" authentication: ").append(toIndentedString(authentication)).append("\n"); + sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" httpTimeout: ").append(toIndentedString(httpTimeout)).append("\n"); + sb.append(" isDisabled: ").append(toIndentedString(isDisabled)).append("\n"); + sb.append(" mtlsClientCert: ").append(toIndentedString(mtlsClientCert)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append(" rateLimit: ").append(toIndentedString(rateLimit)).append("\n"); + sb.append(" rateLimitDuration: ").append(toIndentedString(rateLimitDuration)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" slackWebhookUrl: ").append(toIndentedString(slackWebhookUrl)).append("\n"); + sb.append(" supportEmail: ").append(toIndentedString(supportEmail)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `advanced_signatures` to the URL query string + if (getAdvancedSignatures() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sadvanced_signatures%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAdvancedSignatures())))); + } + + // add `authentication` to the URL query string + if (getAuthentication() != null) { + joiner.add(getAuthentication().toUrlQueryString(prefix + "authentication" + suffix)); + } + + // add `content_type` to the URL query string + if (getContentType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scontent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getContentType())))); + } + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdescription%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `http_timeout` to the URL query string + if (getHttpTimeout() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shttp_timeout%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHttpTimeout())))); + } + + // add `is_disabled` to the URL query string + if (getIsDisabled() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sis_disabled%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIsDisabled())))); + } + + // add `mtls_client_cert` to the URL query string + if (getMtlsClientCert() != null) { + joiner.add(getMtlsClientCert().toUrlQueryString(prefix + "mtls_client_cert" + suffix)); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `owner_id` to the URL query string + if (getOwnerId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sowner_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOwnerId())))); + } + + // add `rate_limit` to the URL query string + if (getRateLimit() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%srate_limit%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRateLimit())))); + } + + // add `rate_limit_duration` to the URL query string + if (getRateLimitDuration() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%srate_limit_duration%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRateLimitDuration())))); + } + + // add `secret` to the URL query string + if (getSecret() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssecret%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSecret())))); + } + + // add `slack_webhook_url` to the URL query string + if (getSlackWebhookUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sslack_webhook_url%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSlackWebhookUrl())))); + } + + // add `support_email` to the URL query string + if (getSupportEmail() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssupport_email%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSupportEmail())))); + } + + // add `url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%surl%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsUpdateEventType.java b/src/main/java/com/getconvoy/models/ModelsUpdateEventType.java new file mode 100644 index 0000000..0946eac --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsUpdateEventType.java @@ -0,0 +1,234 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsUpdateEventType + */ +@JsonPropertyOrder({ + ModelsUpdateEventType.JSON_PROPERTY_CATEGORY, + ModelsUpdateEventType.JSON_PROPERTY_DESCRIPTION, + ModelsUpdateEventType.JSON_PROPERTY_JSON_SCHEMA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsUpdateEventType { + public static final String JSON_PROPERTY_CATEGORY = "category"; + @jakarta.annotation.Nullable + private String category; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + @jakarta.annotation.Nullable + private String description; + + public static final String JSON_PROPERTY_JSON_SCHEMA = "json_schema"; + @jakarta.annotation.Nullable + private Map jsonSchema = new HashMap<>(); + + public ModelsUpdateEventType() { + } + + public ModelsUpdateEventType category(@jakarta.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * Category is a product-specific grouping for the event type + * @return category + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCategory() { + return category; + } + + + @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(@jakarta.annotation.Nullable String category) { + this.category = category; + } + + + public ModelsUpdateEventType description(@jakarta.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description is used to describe what the event type does + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@jakarta.annotation.Nullable String description) { + this.description = description; + } + + + public ModelsUpdateEventType jsonSchema(@jakarta.annotation.Nullable Map jsonSchema) { + this.jsonSchema = jsonSchema; + return this; + } + + public ModelsUpdateEventType putJsonSchemaItem(String key, Object jsonSchemaItem) { + if (this.jsonSchema == null) { + this.jsonSchema = new HashMap<>(); + } + this.jsonSchema.put(key, jsonSchemaItem); + return this; + } + + /** + * JSONSchema is the JSON structure of the event type + * @return jsonSchema + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_JSON_SCHEMA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getJsonSchema() { + return jsonSchema; + } + + + @JsonProperty(value = JSON_PROPERTY_JSON_SCHEMA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setJsonSchema(@jakarta.annotation.Nullable Map jsonSchema) { + this.jsonSchema = jsonSchema; + } + + + /** + * Return true if this models.UpdateEventType object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsUpdateEventType modelsUpdateEventType = (ModelsUpdateEventType) o; + return Objects.equals(this.category, modelsUpdateEventType.category) && + Objects.equals(this.description, modelsUpdateEventType.description) && + Objects.equals(this.jsonSchema, modelsUpdateEventType.jsonSchema); + } + + @Override + public int hashCode() { + return Objects.hash(category, description, jsonSchema); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsUpdateEventType {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" jsonSchema: ").append(toIndentedString(jsonSchema)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `category` to the URL query string + if (getCategory() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scategory%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCategory())))); + } + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdescription%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `json_schema` to the URL query string + if (getJsonSchema() != null) { + for (String _key : getJsonSchema().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sjson_schema%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getJsonSchema().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getJsonSchema().get(_key))))); + } + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsUpdateFilterRequest.java b/src/main/java/com/getconvoy/models/ModelsUpdateFilterRequest.java new file mode 100644 index 0000000..c32aed6 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsUpdateFilterRequest.java @@ -0,0 +1,415 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsOptionalTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsUpdateFilterRequest + */ +@JsonPropertyOrder({ + ModelsUpdateFilterRequest.JSON_PROPERTY_BODY, + ModelsUpdateFilterRequest.JSON_PROPERTY_ENABLED_AT, + ModelsUpdateFilterRequest.JSON_PROPERTY_EVENT_TYPE, + ModelsUpdateFilterRequest.JSON_PROPERTY_HEADERS, + ModelsUpdateFilterRequest.JSON_PROPERTY_IS_FLATTENED, + ModelsUpdateFilterRequest.JSON_PROPERTY_PATH, + ModelsUpdateFilterRequest.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsUpdateFilterRequest { + public static final String JSON_PROPERTY_BODY = "body"; + @jakarta.annotation.Nullable + private Map body; + + public static final String JSON_PROPERTY_ENABLED_AT = "enabled_at"; + @jakarta.annotation.Nullable + private ModelsOptionalTime enabledAt; + + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @jakarta.annotation.Nullable + private String eventType; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + @jakarta.annotation.Nullable + private Map headers; + + public static final String JSON_PROPERTY_IS_FLATTENED = "is_flattened"; + @jakarta.annotation.Nullable + private Boolean isFlattened; + + public static final String JSON_PROPERTY_PATH = "path"; + @jakarta.annotation.Nullable + private Map path; + + public static final String JSON_PROPERTY_QUERY = "query"; + @jakarta.annotation.Nullable + private Map query; + + public ModelsUpdateFilterRequest() { + } + + public ModelsUpdateFilterRequest body(@jakarta.annotation.Nullable Map body) { + this.body = body; + return this; + } + + public ModelsUpdateFilterRequest putBodyItem(String key, Object bodyItem) { + if (this.body == null) { + this.body = new HashMap<>(); + } + this.body.put(key, bodyItem); + return this; + } + + /** + * Body matching criteria (optional) + * @return body + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getBody() { + return body; + } + + + @JsonProperty(value = JSON_PROPERTY_BODY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setBody(@jakarta.annotation.Nullable Map body) { + this.body = body; + } + + + public ModelsUpdateFilterRequest enabledAt(@jakarta.annotation.Nullable ModelsOptionalTime enabledAt) { + this.enabledAt = enabledAt; + return this; + } + + /** + * Non-null when this filter is active. + * @return enabledAt + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENABLED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsOptionalTime getEnabledAt() { + return enabledAt; + } + + + @JsonProperty(value = JSON_PROPERTY_ENABLED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabledAt(@jakarta.annotation.Nullable ModelsOptionalTime enabledAt) { + this.enabledAt = enabledAt; + } + + + public ModelsUpdateFilterRequest eventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Type of event this filter applies to (optional) + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventType() { + return eventType; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventType(@jakarta.annotation.Nullable String eventType) { + this.eventType = eventType; + } + + + public ModelsUpdateFilterRequest headers(@jakarta.annotation.Nullable Map headers) { + this.headers = headers; + return this; + } + + public ModelsUpdateFilterRequest putHeadersItem(String key, Object headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * Header matching criteria (optional) + * @return headers + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getHeaders() { + return headers; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(@jakarta.annotation.Nullable Map headers) { + this.headers = headers; + } + + + public ModelsUpdateFilterRequest isFlattened(@jakarta.annotation.Nullable Boolean isFlattened) { + this.isFlattened = isFlattened; + return this; + } + + /** + * Whether the filter uses flattened JSON paths (optional) + * @return isFlattened + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IS_FLATTENED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsFlattened() { + return isFlattened; + } + + + @JsonProperty(value = JSON_PROPERTY_IS_FLATTENED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsFlattened(@jakarta.annotation.Nullable Boolean isFlattened) { + this.isFlattened = isFlattened; + } + + + public ModelsUpdateFilterRequest path(@jakarta.annotation.Nullable Map path) { + this.path = path; + return this; + } + + public ModelsUpdateFilterRequest putPathItem(String key, Object pathItem) { + if (this.path == null) { + this.path = new HashMap<>(); + } + this.path.put(key, pathItem); + return this; + } + + /** + * Path matching criteria (optional) + * @return path + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PATH, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getPath() { + return path; + } + + + @JsonProperty(value = JSON_PROPERTY_PATH, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@jakarta.annotation.Nullable Map path) { + this.path = path; + } + + + public ModelsUpdateFilterRequest query(@jakarta.annotation.Nullable Map query) { + this.query = query; + return this; + } + + public ModelsUpdateFilterRequest putQueryItem(String key, Object queryItem) { + if (this.query == null) { + this.query = new HashMap<>(); + } + this.query.put(key, queryItem); + return this; + } + + /** + * Query matching criteria (optional) + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getQuery() { + return query; + } + + + @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setQuery(@jakarta.annotation.Nullable Map query) { + this.query = query; + } + + + /** + * Return true if this models.UpdateFilterRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsUpdateFilterRequest modelsUpdateFilterRequest = (ModelsUpdateFilterRequest) o; + return Objects.equals(this.body, modelsUpdateFilterRequest.body) && + Objects.equals(this.enabledAt, modelsUpdateFilterRequest.enabledAt) && + Objects.equals(this.eventType, modelsUpdateFilterRequest.eventType) && + Objects.equals(this.headers, modelsUpdateFilterRequest.headers) && + Objects.equals(this.isFlattened, modelsUpdateFilterRequest.isFlattened) && + Objects.equals(this.path, modelsUpdateFilterRequest.path) && + Objects.equals(this.query, modelsUpdateFilterRequest.query); + } + + @Override + public int hashCode() { + return Objects.hash(body, enabledAt, eventType, headers, isFlattened, path, query); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsUpdateFilterRequest {\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" enabledAt: ").append(toIndentedString(enabledAt)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" isFlattened: ").append(toIndentedString(isFlattened)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `body` to the URL query string + if (getBody() != null) { + for (String _key : getBody().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbody%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getBody().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBody().get(_key))))); + } + } + + // add `enabled_at` to the URL query string + if (getEnabledAt() != null) { + joiner.add(getEnabledAt().toUrlQueryString(prefix + "enabled_at" + suffix)); + } + + // add `event_type` to the URL query string + if (getEventType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventType())))); + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (String _key : getHeaders().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getHeaders().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getHeaders().get(_key))))); + } + } + + // add `is_flattened` to the URL query string + if (getIsFlattened() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sis_flattened%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIsFlattened())))); + } + + // add `path` to the URL query string + if (getPath() != null) { + for (String _key : getPath().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%spath%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getPath().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getPath().get(_key))))); + } + } + + // add `query` to the URL query string + if (getQuery() != null) { + for (String _key : getQuery().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%squery%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getQuery().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getQuery().get(_key))))); + } + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsUpdateProject.java b/src/main/java/com/getconvoy/models/ModelsUpdateProject.java new file mode 100644 index 0000000..93ab75c --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsUpdateProject.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsProjectConfig; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsUpdateProject + */ +@JsonPropertyOrder({ + ModelsUpdateProject.JSON_PROPERTY_CONFIG, + ModelsUpdateProject.JSON_PROPERTY_LOGO_URL, + ModelsUpdateProject.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsUpdateProject { + public static final String JSON_PROPERTY_CONFIG = "config"; + @jakarta.annotation.Nullable + private ModelsProjectConfig config; + + public static final String JSON_PROPERTY_LOGO_URL = "logo_url"; + @jakarta.annotation.Nullable + private String logoUrl; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public ModelsUpdateProject() { + } + + public ModelsUpdateProject config(@jakarta.annotation.Nullable ModelsProjectConfig config) { + this.config = config; + return this; + } + + /** + * Project Config + * @return config + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsProjectConfig getConfig() { + return config; + } + + + @JsonProperty(value = JSON_PROPERTY_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfig(@jakarta.annotation.Nullable ModelsProjectConfig config) { + this.config = config; + } + + + public ModelsUpdateProject logoUrl(@jakarta.annotation.Nullable String logoUrl) { + this.logoUrl = logoUrl; + return this; + } + + /** + * Get logoUrl + * @return logoUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_LOGO_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLogoUrl() { + return logoUrl; + } + + + @JsonProperty(value = JSON_PROPERTY_LOGO_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogoUrl(@jakarta.annotation.Nullable String logoUrl) { + this.logoUrl = logoUrl; + } + + + public ModelsUpdateProject name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Project Name + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + /** + * Return true if this models.UpdateProject object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsUpdateProject modelsUpdateProject = (ModelsUpdateProject) o; + return Objects.equals(this.config, modelsUpdateProject.config) && + Objects.equals(this.logoUrl, modelsUpdateProject.logoUrl) && + Objects.equals(this.name, modelsUpdateProject.name); + } + + @Override + public int hashCode() { + return Objects.hash(config, logoUrl, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsUpdateProject {\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `config` to the URL query string + if (getConfig() != null) { + joiner.add(getConfig().toUrlQueryString(prefix + "config" + suffix)); + } + + // add `logo_url` to the URL query string + if (getLogoUrl() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%slogo_url%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLogoUrl())))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsUpdateSource.java b/src/main/java/com/getconvoy/models/ModelsUpdateSource.java new file mode 100644 index 0000000..7297ecb --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsUpdateSource.java @@ -0,0 +1,538 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreSourceType; +import com.getconvoy.models.ModelsPubSubConfig; +import com.getconvoy.models.ModelsUpdateCustomResponse; +import com.getconvoy.models.ModelsVerifierConfig; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsUpdateSource + */ +@JsonPropertyOrder({ + ModelsUpdateSource.JSON_PROPERTY_BODY_FUNCTION, + ModelsUpdateSource.JSON_PROPERTY_CUSTOM_RESPONSE, + ModelsUpdateSource.JSON_PROPERTY_EVENT_TYPE_LOCATION, + ModelsUpdateSource.JSON_PROPERTY_FORWARD_HEADERS, + ModelsUpdateSource.JSON_PROPERTY_HEADER_FUNCTION, + ModelsUpdateSource.JSON_PROPERTY_IDEMPOTENCY_KEYS, + ModelsUpdateSource.JSON_PROPERTY_IS_DISABLED, + ModelsUpdateSource.JSON_PROPERTY_NAME, + ModelsUpdateSource.JSON_PROPERTY_PUB_SUB, + ModelsUpdateSource.JSON_PROPERTY_TYPE, + ModelsUpdateSource.JSON_PROPERTY_VERIFIER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsUpdateSource { + public static final String JSON_PROPERTY_BODY_FUNCTION = "body_function"; + @jakarta.annotation.Nullable + private String bodyFunction; + + public static final String JSON_PROPERTY_CUSTOM_RESPONSE = "custom_response"; + @jakarta.annotation.Nullable + private ModelsUpdateCustomResponse customResponse; + + public static final String JSON_PROPERTY_EVENT_TYPE_LOCATION = "event_type_location"; + @jakarta.annotation.Nullable + private String eventTypeLocation; + + public static final String JSON_PROPERTY_FORWARD_HEADERS = "forward_headers"; + @jakarta.annotation.Nullable + private List forwardHeaders = new ArrayList<>(); + + public static final String JSON_PROPERTY_HEADER_FUNCTION = "header_function"; + @jakarta.annotation.Nullable + private String headerFunction; + + public static final String JSON_PROPERTY_IDEMPOTENCY_KEYS = "idempotency_keys"; + @jakarta.annotation.Nullable + private List idempotencyKeys = new ArrayList<>(); + + public static final String JSON_PROPERTY_IS_DISABLED = "is_disabled"; + @jakarta.annotation.Nullable + private Boolean isDisabled; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_PUB_SUB = "pub_sub"; + @jakarta.annotation.Nullable + private ModelsPubSubConfig pubSub; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nullable + private DatastoreSourceType type; + + public static final String JSON_PROPERTY_VERIFIER = "verifier"; + @jakarta.annotation.Nullable + private ModelsVerifierConfig verifier; + + public ModelsUpdateSource() { + } + + public ModelsUpdateSource bodyFunction(@jakarta.annotation.Nullable String bodyFunction) { + this.bodyFunction = bodyFunction; + return this; + } + + /** + * Function is a javascript function used to mutate the payload immediately after ingesting an event + * @return bodyFunction + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BODY_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBodyFunction() { + return bodyFunction; + } + + + @JsonProperty(value = JSON_PROPERTY_BODY_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBodyFunction(@jakarta.annotation.Nullable String bodyFunction) { + this.bodyFunction = bodyFunction; + } + + + public ModelsUpdateSource customResponse(@jakarta.annotation.Nullable ModelsUpdateCustomResponse customResponse) { + this.customResponse = customResponse; + return this; + } + + /** + * Custom response is used to define a custom response for incoming webhooks project sources only. + * @return customResponse + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CUSTOM_RESPONSE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsUpdateCustomResponse getCustomResponse() { + return customResponse; + } + + + @JsonProperty(value = JSON_PROPERTY_CUSTOM_RESPONSE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomResponse(@jakarta.annotation.Nullable ModelsUpdateCustomResponse customResponse) { + this.customResponse = customResponse; + } + + + public ModelsUpdateSource eventTypeLocation(@jakarta.annotation.Nullable String eventTypeLocation) { + this.eventTypeLocation = eventTypeLocation; + return this; + } + + /** + * EventTypeLocation is used to specify where Convoy should read the event type from an incoming webhook request. + * @return eventTypeLocation + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE_LOCATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventTypeLocation() { + return eventTypeLocation; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_TYPE_LOCATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventTypeLocation(@jakarta.annotation.Nullable String eventTypeLocation) { + this.eventTypeLocation = eventTypeLocation; + } + + + public ModelsUpdateSource forwardHeaders(@jakarta.annotation.Nullable List forwardHeaders) { + this.forwardHeaders = forwardHeaders; + return this; + } + + public ModelsUpdateSource addForwardHeadersItem(String forwardHeadersItem) { + if (this.forwardHeaders == null) { + this.forwardHeaders = new ArrayList<>(); + } + this.forwardHeaders.add(forwardHeadersItem); + return this; + } + + /** + * Soecfy header you want convoy to save from the ingest request and forward to your endpoints when the event is dispatched. + * @return forwardHeaders + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FORWARD_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getForwardHeaders() { + return forwardHeaders; + } + + + @JsonProperty(value = JSON_PROPERTY_FORWARD_HEADERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForwardHeaders(@jakarta.annotation.Nullable List forwardHeaders) { + this.forwardHeaders = forwardHeaders; + } + + + public ModelsUpdateSource headerFunction(@jakarta.annotation.Nullable String headerFunction) { + this.headerFunction = headerFunction; + return this; + } + + /** + * Function is a javascript function used to mutate the headers immediately after ingesting an event + * @return headerFunction + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEADER_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHeaderFunction() { + return headerFunction; + } + + + @JsonProperty(value = JSON_PROPERTY_HEADER_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaderFunction(@jakarta.annotation.Nullable String headerFunction) { + this.headerFunction = headerFunction; + } + + + public ModelsUpdateSource idempotencyKeys(@jakarta.annotation.Nullable List idempotencyKeys) { + this.idempotencyKeys = idempotencyKeys; + return this; + } + + public ModelsUpdateSource addIdempotencyKeysItem(String idempotencyKeysItem) { + if (this.idempotencyKeys == null) { + this.idempotencyKeys = new ArrayList<>(); + } + this.idempotencyKeys.add(idempotencyKeysItem); + return this; + } + + /** + * IdempotencyKeys are used to specify parts of a webhook request to uniquely identify the event in an incoming webhooks project. + * @return idempotencyKeys + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEYS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIdempotencyKeys() { + return idempotencyKeys; + } + + + @JsonProperty(value = JSON_PROPERTY_IDEMPOTENCY_KEYS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdempotencyKeys(@jakarta.annotation.Nullable List idempotencyKeys) { + this.idempotencyKeys = idempotencyKeys; + } + + + public ModelsUpdateSource isDisabled(@jakarta.annotation.Nullable Boolean isDisabled) { + this.isDisabled = isDisabled; + return this; + } + + /** + * This is used to manually enable/disable the source. + * @return isDisabled + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IS_DISABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsDisabled() { + return isDisabled; + } + + + @JsonProperty(value = JSON_PROPERTY_IS_DISABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDisabled(@jakarta.annotation.Nullable Boolean isDisabled) { + this.isDisabled = isDisabled; + } + + + public ModelsUpdateSource name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Source name. + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public ModelsUpdateSource pubSub(@jakarta.annotation.Nullable ModelsPubSubConfig pubSub) { + this.pubSub = pubSub; + return this; + } + + /** + * PubSub are used to specify message broker sources for outgoing webhooks projects, you only need to specify this when the source type is `pub_sub`. + * @return pubSub + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PUB_SUB, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsPubSubConfig getPubSub() { + return pubSub; + } + + + @JsonProperty(value = JSON_PROPERTY_PUB_SUB, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPubSub(@jakarta.annotation.Nullable ModelsPubSubConfig pubSub) { + this.pubSub = pubSub; + } + + + public ModelsUpdateSource type(@jakarta.annotation.Nullable DatastoreSourceType type) { + this.type = type; + return this; + } + + /** + * Source Type. + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreSourceType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@jakarta.annotation.Nullable DatastoreSourceType type) { + this.type = type; + } + + + public ModelsUpdateSource verifier(@jakarta.annotation.Nullable ModelsVerifierConfig verifier) { + this.verifier = verifier; + return this; + } + + /** + * Verifiers are used to verify webhook events ingested in incoming webhooks projects. If set, type is required and match the verifier type object you choose. + * @return verifier + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_VERIFIER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsVerifierConfig getVerifier() { + return verifier; + } + + + @JsonProperty(value = JSON_PROPERTY_VERIFIER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVerifier(@jakarta.annotation.Nullable ModelsVerifierConfig verifier) { + this.verifier = verifier; + } + + + /** + * Return true if this models.UpdateSource object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsUpdateSource modelsUpdateSource = (ModelsUpdateSource) o; + return Objects.equals(this.bodyFunction, modelsUpdateSource.bodyFunction) && + Objects.equals(this.customResponse, modelsUpdateSource.customResponse) && + Objects.equals(this.eventTypeLocation, modelsUpdateSource.eventTypeLocation) && + Objects.equals(this.forwardHeaders, modelsUpdateSource.forwardHeaders) && + Objects.equals(this.headerFunction, modelsUpdateSource.headerFunction) && + Objects.equals(this.idempotencyKeys, modelsUpdateSource.idempotencyKeys) && + Objects.equals(this.isDisabled, modelsUpdateSource.isDisabled) && + Objects.equals(this.name, modelsUpdateSource.name) && + Objects.equals(this.pubSub, modelsUpdateSource.pubSub) && + Objects.equals(this.type, modelsUpdateSource.type) && + Objects.equals(this.verifier, modelsUpdateSource.verifier); + } + + @Override + public int hashCode() { + return Objects.hash(bodyFunction, customResponse, eventTypeLocation, forwardHeaders, headerFunction, idempotencyKeys, isDisabled, name, pubSub, type, verifier); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsUpdateSource {\n"); + sb.append(" bodyFunction: ").append(toIndentedString(bodyFunction)).append("\n"); + sb.append(" customResponse: ").append(toIndentedString(customResponse)).append("\n"); + sb.append(" eventTypeLocation: ").append(toIndentedString(eventTypeLocation)).append("\n"); + sb.append(" forwardHeaders: ").append(toIndentedString(forwardHeaders)).append("\n"); + sb.append(" headerFunction: ").append(toIndentedString(headerFunction)).append("\n"); + sb.append(" idempotencyKeys: ").append(toIndentedString(idempotencyKeys)).append("\n"); + sb.append(" isDisabled: ").append(toIndentedString(isDisabled)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" pubSub: ").append(toIndentedString(pubSub)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" verifier: ").append(toIndentedString(verifier)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `body_function` to the URL query string + if (getBodyFunction() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbody_function%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBodyFunction())))); + } + + // add `custom_response` to the URL query string + if (getCustomResponse() != null) { + joiner.add(getCustomResponse().toUrlQueryString(prefix + "custom_response" + suffix)); + } + + // add `event_type_location` to the URL query string + if (getEventTypeLocation() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sevent_type_location%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEventTypeLocation())))); + } + + // add `forward_headers` to the URL query string + if (getForwardHeaders() != null) { + for (int i = 0; i < getForwardHeaders().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sforward_headers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getForwardHeaders().get(i))))); + } + } + + // add `header_function` to the URL query string + if (getHeaderFunction() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheader_function%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHeaderFunction())))); + } + + // add `idempotency_keys` to the URL query string + if (getIdempotencyKeys() != null) { + for (int i = 0; i < getIdempotencyKeys().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sidempotency_keys%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getIdempotencyKeys().get(i))))); + } + } + + // add `is_disabled` to the URL query string + if (getIsDisabled() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sis_disabled%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIsDisabled())))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `pub_sub` to the URL query string + if (getPubSub() != null) { + joiner.add(getPubSub().toUrlQueryString(prefix + "pub_sub" + suffix)); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `verifier` to the URL query string + if (getVerifier() != null) { + joiner.add(getVerifier().toUrlQueryString(prefix + "verifier" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsUpdateSubscription.java b/src/main/java/com/getconvoy/models/ModelsUpdateSubscription.java new file mode 100644 index 0000000..e706e9d --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsUpdateSubscription.java @@ -0,0 +1,477 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreDeliveryMode; +import com.getconvoy.models.ModelsAlertConfiguration; +import com.getconvoy.models.ModelsFilterConfiguration; +import com.getconvoy.models.ModelsRateLimitConfiguration; +import com.getconvoy.models.ModelsRetryConfiguration; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsUpdateSubscription + */ +@JsonPropertyOrder({ + ModelsUpdateSubscription.JSON_PROPERTY_ALERT_CONFIG, + ModelsUpdateSubscription.JSON_PROPERTY_APP_ID, + ModelsUpdateSubscription.JSON_PROPERTY_DELIVERY_MODE, + ModelsUpdateSubscription.JSON_PROPERTY_ENDPOINT_ID, + ModelsUpdateSubscription.JSON_PROPERTY_FILTER_CONFIG, + ModelsUpdateSubscription.JSON_PROPERTY_FUNCTION, + ModelsUpdateSubscription.JSON_PROPERTY_NAME, + ModelsUpdateSubscription.JSON_PROPERTY_RATE_LIMIT_CONFIG, + ModelsUpdateSubscription.JSON_PROPERTY_RETRY_CONFIG, + ModelsUpdateSubscription.JSON_PROPERTY_SOURCE_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsUpdateSubscription { + public static final String JSON_PROPERTY_ALERT_CONFIG = "alert_config"; + @jakarta.annotation.Nullable + private ModelsAlertConfiguration alertConfig; + + public static final String JSON_PROPERTY_APP_ID = "app_id"; + @jakarta.annotation.Nullable + private String appId; + + public static final String JSON_PROPERTY_DELIVERY_MODE = "delivery_mode"; + @jakarta.annotation.Nullable + private DatastoreDeliveryMode deliveryMode; + + public static final String JSON_PROPERTY_ENDPOINT_ID = "endpoint_id"; + @jakarta.annotation.Nullable + private String endpointId; + + public static final String JSON_PROPERTY_FILTER_CONFIG = "filter_config"; + @jakarta.annotation.Nullable + private ModelsFilterConfiguration filterConfig; + + public static final String JSON_PROPERTY_FUNCTION = "function"; + @jakarta.annotation.Nullable + private String function; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_RATE_LIMIT_CONFIG = "rate_limit_config"; + @jakarta.annotation.Nullable + private ModelsRateLimitConfiguration rateLimitConfig; + + public static final String JSON_PROPERTY_RETRY_CONFIG = "retry_config"; + @jakarta.annotation.Nullable + private ModelsRetryConfiguration retryConfig; + + public static final String JSON_PROPERTY_SOURCE_ID = "source_id"; + @jakarta.annotation.Nullable + private String sourceId; + + public ModelsUpdateSubscription() { + } + + public ModelsUpdateSubscription alertConfig(@jakarta.annotation.Nullable ModelsAlertConfiguration alertConfig) { + this.alertConfig = alertConfig; + return this; + } + + /** + * Alert configuration + * @return alertConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ALERT_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsAlertConfiguration getAlertConfig() { + return alertConfig; + } + + + @JsonProperty(value = JSON_PROPERTY_ALERT_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlertConfig(@jakarta.annotation.Nullable ModelsAlertConfiguration alertConfig) { + this.alertConfig = alertConfig; + } + + + public ModelsUpdateSubscription appId(@jakarta.annotation.Nullable String appId) { + this.appId = appId; + return this; + } + + /** + * Deprecated but necessary for backward compatibility + * @return appId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_APP_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppId() { + return appId; + } + + + @JsonProperty(value = JSON_PROPERTY_APP_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppId(@jakarta.annotation.Nullable String appId) { + this.appId = appId; + } + + + public ModelsUpdateSubscription deliveryMode(@jakarta.annotation.Nullable DatastoreDeliveryMode deliveryMode) { + this.deliveryMode = deliveryMode; + return this; + } + + /** + * Delivery mode configuration + * @return deliveryMode + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DELIVERY_MODE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreDeliveryMode getDeliveryMode() { + return deliveryMode; + } + + + @JsonProperty(value = JSON_PROPERTY_DELIVERY_MODE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeliveryMode(@jakarta.annotation.Nullable DatastoreDeliveryMode deliveryMode) { + this.deliveryMode = deliveryMode; + } + + + public ModelsUpdateSubscription endpointId(@jakarta.annotation.Nullable String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * Destination endpoint ID + * @return endpointId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEndpointId() { + return endpointId; + } + + + @JsonProperty(value = JSON_PROPERTY_ENDPOINT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpointId(@jakarta.annotation.Nullable String endpointId) { + this.endpointId = endpointId; + } + + + public ModelsUpdateSubscription filterConfig(@jakarta.annotation.Nullable ModelsFilterConfiguration filterConfig) { + this.filterConfig = filterConfig; + return this; + } + + /** + * Filter configuration + * @return filterConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FILTER_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsFilterConfiguration getFilterConfig() { + return filterConfig; + } + + + @JsonProperty(value = JSON_PROPERTY_FILTER_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilterConfig(@jakarta.annotation.Nullable ModelsFilterConfiguration filterConfig) { + this.filterConfig = filterConfig; + } + + + public ModelsUpdateSubscription function(@jakarta.annotation.Nullable String function) { + this.function = function; + return this; + } + + /** + * Convoy supports mutating your request payload using a js function. Use this field to specify a `transform` function for this purpose. See this[https://docs.getconvoy.io/product-manual/subscriptions#functions] for more + * @return function + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFunction() { + return function; + } + + + @JsonProperty(value = JSON_PROPERTY_FUNCTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFunction(@jakarta.annotation.Nullable String function) { + this.function = function; + } + + + public ModelsUpdateSubscription name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Subscription Nme + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public ModelsUpdateSubscription rateLimitConfig(@jakarta.annotation.Nullable ModelsRateLimitConfiguration rateLimitConfig) { + this.rateLimitConfig = rateLimitConfig; + return this; + } + + /** + * Rate limit configuration + * @return rateLimitConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsRateLimitConfiguration getRateLimitConfig() { + return rateLimitConfig; + } + + + @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRateLimitConfig(@jakarta.annotation.Nullable ModelsRateLimitConfiguration rateLimitConfig) { + this.rateLimitConfig = rateLimitConfig; + } + + + public ModelsUpdateSubscription retryConfig(@jakarta.annotation.Nullable ModelsRetryConfiguration retryConfig) { + this.retryConfig = retryConfig; + return this; + } + + /** + * Retry configuration + * @return retryConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RETRY_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsRetryConfiguration getRetryConfig() { + return retryConfig; + } + + + @JsonProperty(value = JSON_PROPERTY_RETRY_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRetryConfig(@jakarta.annotation.Nullable ModelsRetryConfiguration retryConfig) { + this.retryConfig = retryConfig; + } + + + public ModelsUpdateSubscription sourceId(@jakarta.annotation.Nullable String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Source Id + * @return sourceId + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SOURCE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceId() { + return sourceId; + } + + + @JsonProperty(value = JSON_PROPERTY_SOURCE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceId(@jakarta.annotation.Nullable String sourceId) { + this.sourceId = sourceId; + } + + + /** + * Return true if this models.UpdateSubscription object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsUpdateSubscription modelsUpdateSubscription = (ModelsUpdateSubscription) o; + return Objects.equals(this.alertConfig, modelsUpdateSubscription.alertConfig) && + Objects.equals(this.appId, modelsUpdateSubscription.appId) && + Objects.equals(this.deliveryMode, modelsUpdateSubscription.deliveryMode) && + Objects.equals(this.endpointId, modelsUpdateSubscription.endpointId) && + Objects.equals(this.filterConfig, modelsUpdateSubscription.filterConfig) && + Objects.equals(this.function, modelsUpdateSubscription.function) && + Objects.equals(this.name, modelsUpdateSubscription.name) && + Objects.equals(this.rateLimitConfig, modelsUpdateSubscription.rateLimitConfig) && + Objects.equals(this.retryConfig, modelsUpdateSubscription.retryConfig) && + Objects.equals(this.sourceId, modelsUpdateSubscription.sourceId); + } + + @Override + public int hashCode() { + return Objects.hash(alertConfig, appId, deliveryMode, endpointId, filterConfig, function, name, rateLimitConfig, retryConfig, sourceId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsUpdateSubscription {\n"); + sb.append(" alertConfig: ").append(toIndentedString(alertConfig)).append("\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" deliveryMode: ").append(toIndentedString(deliveryMode)).append("\n"); + sb.append(" endpointId: ").append(toIndentedString(endpointId)).append("\n"); + sb.append(" filterConfig: ").append(toIndentedString(filterConfig)).append("\n"); + sb.append(" function: ").append(toIndentedString(function)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" rateLimitConfig: ").append(toIndentedString(rateLimitConfig)).append("\n"); + sb.append(" retryConfig: ").append(toIndentedString(retryConfig)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `alert_config` to the URL query string + if (getAlertConfig() != null) { + joiner.add(getAlertConfig().toUrlQueryString(prefix + "alert_config" + suffix)); + } + + // add `app_id` to the URL query string + if (getAppId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sapp_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAppId())))); + } + + // add `delivery_mode` to the URL query string + if (getDeliveryMode() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdelivery_mode%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeliveryMode())))); + } + + // add `endpoint_id` to the URL query string + if (getEndpointId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sendpoint_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEndpointId())))); + } + + // add `filter_config` to the URL query string + if (getFilterConfig() != null) { + joiner.add(getFilterConfig().toUrlQueryString(prefix + "filter_config" + suffix)); + } + + // add `function` to the URL query string + if (getFunction() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sfunction%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFunction())))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `rate_limit_config` to the URL query string + if (getRateLimitConfig() != null) { + joiner.add(getRateLimitConfig().toUrlQueryString(prefix + "rate_limit_config" + suffix)); + } + + // add `retry_config` to the URL query string + if (getRetryConfig() != null) { + joiner.add(getRetryConfig().toUrlQueryString(prefix + "retry_config" + suffix)); + } + + // add `source_id` to the URL query string + if (getSourceId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssource_id%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSourceId())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/ModelsVerifierConfig.java b/src/main/java/com/getconvoy/models/ModelsVerifierConfig.java new file mode 100644 index 0000000..a84a188 --- /dev/null +++ b/src/main/java/com/getconvoy/models/ModelsVerifierConfig.java @@ -0,0 +1,260 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.DatastoreVerifierType; +import com.getconvoy.models.ModelsApiKey; +import com.getconvoy.models.ModelsBasicAuth; +import com.getconvoy.models.ModelsHMac; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * ModelsVerifierConfig + */ +@JsonPropertyOrder({ + ModelsVerifierConfig.JSON_PROPERTY_API_KEY, + ModelsVerifierConfig.JSON_PROPERTY_BASIC_AUTH, + ModelsVerifierConfig.JSON_PROPERTY_HMAC, + ModelsVerifierConfig.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class ModelsVerifierConfig { + public static final String JSON_PROPERTY_API_KEY = "api_key"; + @jakarta.annotation.Nullable + private ModelsApiKey apiKey; + + public static final String JSON_PROPERTY_BASIC_AUTH = "basic_auth"; + @jakarta.annotation.Nullable + private ModelsBasicAuth basicAuth; + + public static final String JSON_PROPERTY_HMAC = "hmac"; + @jakarta.annotation.Nullable + private ModelsHMac hmac; + + public static final String JSON_PROPERTY_TYPE = "type"; + @jakarta.annotation.Nonnull + private DatastoreVerifierType type; + + public ModelsVerifierConfig() { + } + + public ModelsVerifierConfig apiKey(@jakarta.annotation.Nullable ModelsApiKey apiKey) { + this.apiKey = apiKey; + return this; + } + + /** + * Get apiKey + * @return apiKey + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_API_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsApiKey getApiKey() { + return apiKey; + } + + + @JsonProperty(value = JSON_PROPERTY_API_KEY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiKey(@jakarta.annotation.Nullable ModelsApiKey apiKey) { + this.apiKey = apiKey; + } + + + public ModelsVerifierConfig basicAuth(@jakarta.annotation.Nullable ModelsBasicAuth basicAuth) { + this.basicAuth = basicAuth; + return this; + } + + /** + * Get basicAuth + * @return basicAuth + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BASIC_AUTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsBasicAuth getBasicAuth() { + return basicAuth; + } + + + @JsonProperty(value = JSON_PROPERTY_BASIC_AUTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBasicAuth(@jakarta.annotation.Nullable ModelsBasicAuth basicAuth) { + this.basicAuth = basicAuth; + } + + + public ModelsVerifierConfig hmac(@jakarta.annotation.Nullable ModelsHMac hmac) { + this.hmac = hmac; + return this; + } + + /** + * Get hmac + * @return hmac + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HMAC, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsHMac getHmac() { + return hmac; + } + + + @JsonProperty(value = JSON_PROPERTY_HMAC, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHmac(@jakarta.annotation.Nullable ModelsHMac hmac) { + this.hmac = hmac; + } + + + public ModelsVerifierConfig type(@jakarta.annotation.Nonnull DatastoreVerifierType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @jakarta.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DatastoreVerifierType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@jakarta.annotation.Nonnull DatastoreVerifierType type) { + this.type = type; + } + + + /** + * Return true if this models.VerifierConfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelsVerifierConfig modelsVerifierConfig = (ModelsVerifierConfig) o; + return Objects.equals(this.apiKey, modelsVerifierConfig.apiKey) && + Objects.equals(this.basicAuth, modelsVerifierConfig.basicAuth) && + Objects.equals(this.hmac, modelsVerifierConfig.hmac) && + Objects.equals(this.type, modelsVerifierConfig.type); + } + + @Override + public int hashCode() { + return Objects.hash(apiKey, basicAuth, hmac, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelsVerifierConfig {\n"); + sb.append(" apiKey: ").append(toIndentedString(apiKey)).append("\n"); + sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n"); + sb.append(" hmac: ").append(toIndentedString(hmac)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `api_key` to the URL query string + if (getApiKey() != null) { + joiner.add(getApiKey().toUrlQueryString(prefix + "api_key" + suffix)); + } + + // add `basic_auth` to the URL query string + if (getBasicAuth() != null) { + joiner.add(getBasicAuth().toUrlQueryString(prefix + "basic_auth" + suffix)); + } + + // add `hmac` to the URL query string + if (getHmac() != null) { + joiner.add(getHmac().toUrlQueryString(prefix + "hmac" + suffix)); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/TestFilter200Response.java b/src/main/java/com/getconvoy/models/TestFilter200Response.java new file mode 100644 index 0000000..28100b5 --- /dev/null +++ b/src/main/java/com/getconvoy/models/TestFilter200Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsTestFilterResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * TestFilter200Response + */ +@JsonPropertyOrder({ + TestFilter200Response.JSON_PROPERTY_MESSAGE, + TestFilter200Response.JSON_PROPERTY_STATUS, + TestFilter200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class TestFilter200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private ModelsTestFilterResponse data; + + public TestFilter200Response() { + } + + public TestFilter200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public TestFilter200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public TestFilter200Response data(@jakarta.annotation.Nullable ModelsTestFilterResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsTestFilterResponse getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable ModelsTestFilterResponse data) { + this.data = data; + } + + + /** + * Return true if this TestFilter_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestFilter200Response testFilter200Response = (TestFilter200Response) o; + return Objects.equals(this.message, testFilter200Response.message) && + Objects.equals(this.status, testFilter200Response.status) && + Objects.equals(this.data, testFilter200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestFilter200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/TestOAuth2Connection200Response.java b/src/main/java/com/getconvoy/models/TestOAuth2Connection200Response.java new file mode 100644 index 0000000..4393965 --- /dev/null +++ b/src/main/java/com/getconvoy/models/TestOAuth2Connection200Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsTestOAuth2Response; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * TestOAuth2Connection200Response + */ +@JsonPropertyOrder({ + TestOAuth2Connection200Response.JSON_PROPERTY_MESSAGE, + TestOAuth2Connection200Response.JSON_PROPERTY_STATUS, + TestOAuth2Connection200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class TestOAuth2Connection200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private ModelsTestOAuth2Response data; + + public TestOAuth2Connection200Response() { + } + + public TestOAuth2Connection200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public TestOAuth2Connection200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public TestOAuth2Connection200Response data(@jakarta.annotation.Nullable ModelsTestOAuth2Response data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsTestOAuth2Response getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable ModelsTestOAuth2Response data) { + this.data = data; + } + + + /** + * Return true if this TestOAuth2Connection_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestOAuth2Connection200Response testOAuth2Connection200Response = (TestOAuth2Connection200Response) o; + return Objects.equals(this.message, testOAuth2Connection200Response.message) && + Objects.equals(this.status, testOAuth2Connection200Response.status) && + Objects.equals(this.data, testOAuth2Connection200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestOAuth2Connection200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/TestSubscriptionFilter200Response.java b/src/main/java/com/getconvoy/models/TestSubscriptionFilter200Response.java new file mode 100644 index 0000000..c3dfee6 --- /dev/null +++ b/src/main/java/com/getconvoy/models/TestSubscriptionFilter200Response.java @@ -0,0 +1,220 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * TestSubscriptionFilter200Response + */ +@JsonPropertyOrder({ + TestSubscriptionFilter200Response.JSON_PROPERTY_MESSAGE, + TestSubscriptionFilter200Response.JSON_PROPERTY_STATUS, + TestSubscriptionFilter200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class TestSubscriptionFilter200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private Boolean data; + + public TestSubscriptionFilter200Response() { + } + + public TestSubscriptionFilter200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public TestSubscriptionFilter200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public TestSubscriptionFilter200Response data(@jakarta.annotation.Nullable Boolean data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable Boolean data) { + this.data = data; + } + + + /** + * Return true if this TestSubscriptionFilter_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestSubscriptionFilter200Response testSubscriptionFilter200Response = (TestSubscriptionFilter200Response) o; + return Objects.equals(this.message, testSubscriptionFilter200Response.message) && + Objects.equals(this.status, testSubscriptionFilter200Response.status) && + Objects.equals(this.data, testSubscriptionFilter200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestSubscriptionFilter200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdata%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getData())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/UtilServerResponse.java b/src/main/java/com/getconvoy/models/UtilServerResponse.java new file mode 100644 index 0000000..85b2912 --- /dev/null +++ b/src/main/java/com/getconvoy/models/UtilServerResponse.java @@ -0,0 +1,184 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * UtilServerResponse + */ +@JsonPropertyOrder({ + UtilServerResponse.JSON_PROPERTY_MESSAGE, + UtilServerResponse.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class UtilServerResponse { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public UtilServerResponse() { + } + + public UtilServerResponse message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public UtilServerResponse status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + /** + * Return true if this util.ServerResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UtilServerResponse utilServerResponse = (UtilServerResponse) o; + return Objects.equals(this.message, utilServerResponse.message) && + Objects.equals(this.status, utilServerResponse.status); + } + + @Override + public int hashCode() { + return Objects.hash(message, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UtilServerResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + return joiner.toString(); + } +} + diff --git a/src/main/java/com/getconvoy/models/V1ProjectsProjectIDSourcesTestFunctionPost200Response.java b/src/main/java/com/getconvoy/models/V1ProjectsProjectIDSourcesTestFunctionPost200Response.java new file mode 100644 index 0000000..99ac92e --- /dev/null +++ b/src/main/java/com/getconvoy/models/V1ProjectsProjectIDSourcesTestFunctionPost200Response.java @@ -0,0 +1,221 @@ +/* + * Convoy API Reference + * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification. + * + * The version of the OpenAPI document: 26.3.5 + * Contact: support@getconvoy.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.getconvoy.models; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.getconvoy.models.ModelsFunctionResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.getconvoy.client.ApiClient; +/** + * V1ProjectsProjectIDSourcesTestFunctionPost200Response + */ +@JsonPropertyOrder({ + V1ProjectsProjectIDSourcesTestFunctionPost200Response.JSON_PROPERTY_MESSAGE, + V1ProjectsProjectIDSourcesTestFunctionPost200Response.JSON_PROPERTY_STATUS, + V1ProjectsProjectIDSourcesTestFunctionPost200Response.JSON_PROPERTY_DATA +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") +public class V1ProjectsProjectIDSourcesTestFunctionPost200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nullable + private Boolean status; + + public static final String JSON_PROPERTY_DATA = "data"; + @jakarta.annotation.Nullable + private ModelsFunctionResponse data; + + public V1ProjectsProjectIDSourcesTestFunctionPost200Response() { + } + + public V1ProjectsProjectIDSourcesTestFunctionPost200Response message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public V1ProjectsProjectIDSourcesTestFunctionPost200Response status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + + public V1ProjectsProjectIDSourcesTestFunctionPost200Response data(@jakarta.annotation.Nullable ModelsFunctionResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelsFunctionResponse getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@jakarta.annotation.Nullable ModelsFunctionResponse data) { + this.data = data; + } + + + /** + * Return true if this _v1_projects__projectID__sources_test_function_post_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ProjectsProjectIDSourcesTestFunctionPost200Response v1ProjectsProjectIDSourcesTestFunctionPost200Response = (V1ProjectsProjectIDSourcesTestFunctionPost200Response) o; + return Objects.equals(this.message, v1ProjectsProjectIDSourcesTestFunctionPost200Response.message) && + Objects.equals(this.status, v1ProjectsProjectIDSourcesTestFunctionPost200Response.status) && + Objects.equals(this.data, v1ProjectsProjectIDSourcesTestFunctionPost200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(message, status, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ProjectsProjectIDSourcesTestFunctionPost200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/src/test/java/com/getconvoy/api/EventsApiContractTest.java b/src/test/java/com/getconvoy/api/EventsApiContractTest.java new file mode 100644 index 0000000..a19806a --- /dev/null +++ b/src/test/java/com/getconvoy/api/EventsApiContractTest.java @@ -0,0 +1,93 @@ +package com.getconvoy.api; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.getconvoy.client.ApiClient; +import com.getconvoy.client.ApiException; +import com.sun.net.httpserver.HttpServer; +import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +/** + * Offline route-contract test: proves the generated client sends the verb, + * path, auth header, and JSON body the Convoy server expects, using the JDK's + * built-in HTTP server (no live instance, no extra dependencies). + */ +class EventsApiContractTest { + + // Plain class, not a record: the SDK compiles with -source 11. + private static final class Captured { + final String method; + final String path; + final String auth; + final String contentType; + final String body; + + Captured(String method, String path, String auth, String contentType, String body) { + this.method = method; + this.path = path; + this.auth = auth; + this.contentType = contentType; + this.body = body; + } + } + + private static HttpServer server; + private static ApiClient client; + private static final AtomicReference captured = new AtomicReference<>(); + + @BeforeAll + static void startServer() throws Exception { + server = HttpServer.create(new InetSocketAddress(0), 0); + server.createContext("/", exchange -> { + captured.set(new Captured( + exchange.getRequestMethod(), + exchange.getRequestURI().toString(), + exchange.getRequestHeaders().getFirst("Authorization"), + exchange.getRequestHeaders().getFirst("Content-Type"), + new String(exchange.getRequestBody().readAllBytes(), StandardCharsets.UTF_8))); + byte[] resp = "{\"status\":true,\"message\":\"ok\",\"data\":null}" + .getBytes(StandardCharsets.UTF_8); + exchange.getResponseHeaders().set("Content-Type", "application/json"); + exchange.sendResponseHeaders(201, resp.length); + try (OutputStream os = exchange.getResponseBody()) { + os.write(resp); + } + }); + server.start(); + + client = new ApiClient(); + client.updateBaseUri("http://127.0.0.1:" + server.getAddress().getPort() + "/api"); + client.setRequestInterceptor(b -> b.header("Authorization", "Bearer test-key")); + } + + @AfterAll + static void stopServer() { + server.stop(0); + } + + @Test + void createEndpointEventSendsExpectedRequest() throws ApiException { + new EventsApi(client).createEndpointEvent("proj-1", + new com.getconvoy.models.ModelsCreateEvent() + .endpointId("ep-1") + .eventType("invoice.paid") + .data(Map.of("amount", 100))); + + Captured req = captured.get(); + assertEquals("POST", req.method); + assertEquals("/api/v1/projects/proj-1/events", req.path); + assertEquals("Bearer test-key", req.auth); + assertEquals("application/json", req.contentType); + assertTrue(req.body.contains("\"endpoint_id\":\"ep-1\""), req.body); + assertTrue(req.body.contains("\"event_type\":\"invoice.paid\""), req.body); + assertTrue(req.body.contains("\"amount\":100"), req.body); + } +} diff --git a/src/test/java/com/getconvoy/models/EventDataRoundTripTest.java b/src/test/java/com/getconvoy/models/EventDataRoundTripTest.java new file mode 100644 index 0000000..3bf5c0f --- /dev/null +++ b/src/test/java/com/getconvoy/models/EventDataRoundTripTest.java @@ -0,0 +1,49 @@ +package com.getconvoy.models; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.getconvoy.client.JSON; +import java.util.Map; +import org.junit.jupiter.api.Test; + +/** + * Regression test for arbitrary-JSON event payloads. The OpenAPI spec must + * keep event {@code data} an open map ({@code additionalProperties: true}, + * frain-dev/convoy#2737); if a regeneration ever narrows it, payload keys + * would be silently dropped and these assertions fail. + */ +class EventDataRoundTripTest { + + private final ObjectMapper mapper = JSON.getDefault().getMapper(); + + @Test + void outboundEventDataKeepsAllKeys() throws Exception { + ModelsCreateEvent ev = new ModelsCreateEvent() + .endpointId("ep-1") + .eventType("invoice.paid") + .data(Map.of( + "amount", 100, + "currency", "USD", + "nested", Map.of("customer", "cus_123"))); + + String out = mapper.writeValueAsString(ev); + + assertTrue(out.contains("\"amount\":100"), out); + assertTrue(out.contains("\"currency\":\"USD\""), out); + assertTrue(out.contains("\"customer\":\"cus_123\""), out); + } + + @Test + void inboundEventDataKeepsAllKeys() throws Exception { + String inbound = "{\"uid\":\"evt-1\",\"event_type\":\"invoice.paid\"," + + "\"data\":{\"amount\":100,\"nested\":{\"customer\":\"cus_123\"}}}"; + + DatastoreEvent parsed = mapper.readValue(inbound, DatastoreEvent.class); + + Map data = parsed.getData(); + assertEquals(100, data.get("amount")); + assertEquals(Map.of("customer", "cus_123"), data.get("nested")); + } +}