diff --git a/.github/workflows/intgtest.yml b/.github/workflows/intgtest.yml
index 642420d8..d46c68ae 100644
--- a/.github/workflows/intgtest.yml
+++ b/.github/workflows/intgtest.yml
@@ -15,21 +15,21 @@ jobs:
name: Integration Tests
steps:
- name: Checkout
- uses: actions/checkout@v3
- - name: Set up Zulu JDK 11
+ uses: actions/checkout@v4
+ - name: Set up Zulu JDK 17
uses: actions/setup-java@v3
with:
distribution: "zulu"
- java-version: "11"
+ java-version: "17"
- name: Build and run tests
run: |
hostname
echo "host is $HOSTNAME"
./gradlew clean test
env:
- SDK_INTEGRATION_TESTS_SERVER_API_URL: ${{ secrets.SDK_INTEGRATION_TESTS_SERVER_API_URL }}
- SDK_INTEGRATION_TESTS_SERVER_KEY_ID: ${{ secrets.SDK_INTEGRATION_TESTS_SERVER_KEY_ID }}
- SDK_INTEGRATION_TESTS_SERVER_KEY_SECRET: ${{ secrets.SDK_INTEGRATION_TESTS_SERVER_KEY_SECRET }}
+ CONDUCTOR_SERVER_URL: ${{ secrets.CONDUCTOR_SERVER_URL }}
+ CONDUCTOR_SERVER_AUTH_KEY: ${{ secrets.CONDUCTOR_SERVER_AUTH_KEY }}
+ CONDUCTOR_SERVER_AUTH_SECRET: ${{ secrets.CONDUCTOR_SERVER_AUTH_SECRET }}
USER1_APPLICATION_ID: ${{ secrets.USER1_APPLICATION_ID }}
USER1_KEY_ID: ${{ secrets.USER1_KEY_ID }}
USER1_SECRET: ${{ secrets.USER1_SECRET }}
diff --git a/.github/workflows/oss.yml b/.github/workflows/oss.yml
index c8f4fdeb..439176c3 100644
--- a/.github/workflows/oss.yml
+++ b/.github/workflows/oss.yml
@@ -17,11 +17,11 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v3
- - name: Set up Zulu JDK 11
- uses: actions/setup-java@v3
+ - name: Set up Zulu JDK 17
+ uses: actions/setup-java@v4
with:
distribution: 'zulu'
- java-version: '11'
+ java-version: '17'
- name: Publish
run: |
export CONDUCTOR_VERSION=${{ github.event.inputs.version }}
diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml
index 3f7d9690..f12f4f47 100644
--- a/.github/workflows/publish-release.yml
+++ b/.github/workflows/publish-release.yml
@@ -18,11 +18,11 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v3
- - name: Set up Zulu JDK 11
- uses: actions/setup-java@v3
+ - name: Set up Zulu JDK 17
+ uses: actions/setup-java@v4
with:
distribution: 'zulu'
- java-version: '11'
+ java-version: '17'
- name: Publish
run: |
export VERSION="${{github.ref_name}}"
diff --git a/build.gradle b/build.gradle
index 25a7f546..574621fe 100644
--- a/build.gradle
+++ b/build.gradle
@@ -30,10 +30,9 @@ ext {
azureIdentity : '1.3.7',
eureka : '1.10.17',
wiremock : '2.33.2',
- ioGRPC : '1.49.0',
- ioGRPC : '1.49.0',
- protoBuf : '3.19.4',
- lombok : '1.18.24',
+ ioGRPC : '1.63.1',
+ protoBuf : '3.25.3',
+ lombok : '1.18.30',
revJAXRS : '2.1.1',
log4j : '2.17.1',
netty : '4.1.77.Final'
@@ -203,9 +202,14 @@ jacocoTestReport {
dependsOn test // tests are required to run before generating the report
}
+allprojects {
+ tasks.withType(Javadoc) {
+ options.addStringOption('Xdoclint:none', '-quiet')
+ }
+}
compileJava {
- sourceCompatibility = 11
- targetCompatibility = 11
+ sourceCompatibility = 17
+ targetCompatibility = 17
}
configurations.implementation {
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 69a97150..a5952066 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/src/main/java/com/netflix/conductor/client/http/TaskClient.java b/src/main/java/com/netflix/conductor/client/http/TaskClient.java
index e1fcbc8d..673e8ec8 100644
--- a/src/main/java/com/netflix/conductor/client/http/TaskClient.java
+++ b/src/main/java/com/netflix/conductor/client/http/TaskClient.java
@@ -22,6 +22,7 @@
import com.netflix.conductor.common.metadata.tasks.TaskResult;
import com.netflix.conductor.common.run.SearchResult;
import com.netflix.conductor.common.utils.ExternalPayloadStorage;
+
import io.orkes.conductor.client.model.TaskSummary;
/** Client for conductor task management including polling for task, updating task status etc. */
diff --git a/src/main/java/io/orkes/conductor/client/IntegrationClient.java b/src/main/java/io/orkes/conductor/client/IntegrationClient.java
new file mode 100644
index 00000000..4667c4ae
--- /dev/null
+++ b/src/main/java/io/orkes/conductor/client/IntegrationClient.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2024 Orkes, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package io.orkes.conductor.client;
+
+import java.util.List;
+import java.util.Map;
+
+import io.orkes.conductor.client.model.TagObject;
+import io.orkes.conductor.client.model.integration.Integration;
+import io.orkes.conductor.client.model.integration.IntegrationApi;
+import io.orkes.conductor.client.model.integration.IntegrationApiUpdate;
+import io.orkes.conductor.client.model.integration.IntegrationUpdate;
+import io.orkes.conductor.client.model.integration.ai.PromptTemplate;
+
+public interface IntegrationClient {
+ /**
+ * Client for managing integrations with external systems. Some examples of integrations are:
+ * 1. AI/LLM providers (e.g. OpenAI, HuggingFace)
+ * 2. Vector DBs (Pinecone, Weaviate etc.)
+ * 3. Kafka
+ * 4. Relational databases
+ *
+ * Integrations are configured as integration -> api with 1->N cardinality.
+ * APIs are the underlying resources for an integration and depending on the type of integration they represent underlying resources.
+ * Examples:
+ * LLM integrations
+ * The integration specifies the name of the integration unique to your environment, api keys and endpoint used.
+ * APIs are the models (e.g. text-davinci-003, or text-embedding-ada-002)
+ *
+ * Vector DB integrations,
+ * The integration represents the cluster, specifies the name of the integration unique to your environment, api keys and endpoint used.
+ * APIs are the indexes (e.g. pinecone) or class (e.g. for weaviate)
+ *
+ * Kafka
+ * The integration represents the cluster, specifies the name of the integration unique to your environment, api keys and endpoint used.
+ * APIs are the topics that are configured for use within this kafka cluster
+ */
+
+ void associatePromptWithIntegration(String aiIntegration, String modelName, String promptName);
+
+ void deleteIntegrationApi(String apiName, String integrationName);
+
+ void deleteIntegration(String integrationName);
+
+ IntegrationApi getIntegrationApi(String apiName, String integrationName);
+
+ List getIntegrationApis(String integrationName);
+
+ Integration getIntegration(String integrationName);
+
+ List getIntegrations(String category, Boolean activeOnly);
+
+ List getPromptsWithIntegration(String aiIntegration, String modelName);
+
+ int getTokenUsageForIntegration(String name, String integrationName);
+
+ Map getTokenUsageForIntegrationProvider(String name);
+
+ void saveIntegrationApi(String integrationName, String apiName, IntegrationApiUpdate apiDetails);
+
+ void saveIntegration(String integrationName, IntegrationUpdate integrationDetails);
+
+ // Tags
+ void deleteTagForIntegrationProvider(List tags, String name);
+ void saveTagForIntegrationProvider(List tags, String name);
+ List getTagsForIntegrationProvider(String name);
+}
diff --git a/src/main/java/io/orkes/conductor/client/OrkesClients.java b/src/main/java/io/orkes/conductor/client/OrkesClients.java
index 216160e5..867221ff 100644
--- a/src/main/java/io/orkes/conductor/client/OrkesClients.java
+++ b/src/main/java/io/orkes/conductor/client/OrkesClients.java
@@ -12,6 +12,8 @@
*/
package io.orkes.conductor.client;
+import com.netflix.conductor.sdk.workflow.executor.WorkflowExecutor;
+
import io.orkes.conductor.client.http.*;
public class OrkesClients {
@@ -49,4 +51,16 @@ public SecretClient getSecretClient() {
public TaskClient getTaskClient() {
return new OrkesTaskClient(apiClient);
}
+
+ public IntegrationClient getIntegrationClient() {
+ return new OrkesIntegrationClient(apiClient);
+ }
+
+ public PromptClient getPromptClient() {
+ return new OrkesPromptClient(apiClient);
+ }
+
+ public WorkflowExecutor getWorkflowExecutor() {
+ return new WorkflowExecutor(getTaskClient(), getWorkflowClient(), getMetadataClient(), 100);
+ }
}
diff --git a/src/main/java/io/orkes/conductor/client/OrkesPromptClient.java b/src/main/java/io/orkes/conductor/client/OrkesPromptClient.java
new file mode 100644
index 00000000..38d60003
--- /dev/null
+++ b/src/main/java/io/orkes/conductor/client/OrkesPromptClient.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2024 Orkes, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package io.orkes.conductor.client;
+
+import java.util.List;
+import java.util.Map;
+
+import io.orkes.conductor.client.http.api.PromptResourceApi;
+import io.orkes.conductor.client.model.TagObject;
+import io.orkes.conductor.client.model.integration.PromptTemplateTestRequest;
+import io.orkes.conductor.client.model.integration.ai.PromptTemplate;
+
+public class OrkesPromptClient implements PromptClient {
+
+ private final PromptResourceApi promptResourceApi;
+
+ public OrkesPromptClient(ApiClient apiClient) {
+ this.promptResourceApi = new PromptResourceApi(apiClient);
+ }
+
+ @Override
+ public void savePrompt(String promptName, String description, String promptTemplate) {
+ promptResourceApi.savePromptTemplate(promptTemplate, description, promptName, List.of());
+ }
+
+ @Override
+ public PromptTemplate getPrompt(String promptName) {
+ return promptResourceApi.getPromptTemplate(promptName);
+ }
+
+ @Override
+ public List getPrompts() {
+ return promptResourceApi.getPromptTemplates();
+ }
+
+ @Override
+ public void deletePrompt(String promptName) {
+ promptResourceApi.deletePromptTemplate(promptName);
+ }
+
+ @Override
+ public List getTagsForPromptTemplate(String promptName) {
+ return promptResourceApi.getTagsForPromptTemplate(promptName);
+ }
+
+ @Override
+ public void updateTagForPromptTemplate(String promptName, List tags) {
+ promptResourceApi.putTagForPromptTemplate(tags, promptName);
+ }
+
+ @Override
+ public void deleteTagForPromptTemplate(String promptName, List tags) {
+ promptResourceApi.deleteTagForPromptTemplate(tags, promptName);
+ }
+
+ @Override
+ public String testPrompt(String promptText, Map variables, String aiIntegration, String textCompleteModel, float temperature, float topP,
+ List stopWords) {
+ PromptTemplateTestRequest request = new PromptTemplateTestRequest();
+ request.setPrompt(promptText);
+ request.setLlmProvider(aiIntegration);
+ request.setModel(textCompleteModel);
+ request.setTemperature((double) temperature);
+ request.setTopP((double) topP);
+ request.setStopWords(stopWords == null ? List.of() : stopWords);
+ request.setPromptVariables(variables);
+ return promptResourceApi.testMessageTemplate(request);
+ }
+}
diff --git a/src/main/java/io/orkes/conductor/client/PromptClient.java b/src/main/java/io/orkes/conductor/client/PromptClient.java
new file mode 100644
index 00000000..cbee63f7
--- /dev/null
+++ b/src/main/java/io/orkes/conductor/client/PromptClient.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2024 Orkes, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package io.orkes.conductor.client;
+
+import java.util.List;
+import java.util.Map;
+
+import io.orkes.conductor.client.model.TagObject;
+import io.orkes.conductor.client.model.integration.ai.PromptTemplate;
+
+public interface PromptClient {
+
+ void savePrompt(String promptName, String description, String promptTemplate);
+
+ PromptTemplate getPrompt(String promptName);
+
+ List getPrompts();
+
+ void deletePrompt(String promptName);
+
+ List getTagsForPromptTemplate(String promptName);
+
+ void updateTagForPromptTemplate(String promptName, List tags);
+
+ void deleteTagForPromptTemplate(String promptName, List tags);
+
+ /**
+ * Tests a prompt template by substituting variables and processing through the specified AI model.
+ *
+ * @param promptText the text of the prompt template
+ * @param variables a map containing variables to be replaced in the template
+ * @param aiIntegration the AI integration context
+ * @param textCompleteModel the AI model used for completing text
+ * @param temperature the randomness of the output (optional, default is 0.1)
+ * @param topP the probability mass to consider from the output distribution (optional, default is 0.9)
+ * @param stopWords a list of words to stop generating further (can be null)
+ * @return the processed prompt text
+ */
+ String testPrompt(String promptText, Map variables, String aiIntegration,
+ String textCompleteModel, float temperature, float topP, List stopWords);
+}
diff --git a/src/main/java/io/orkes/conductor/client/SchedulerClient.java b/src/main/java/io/orkes/conductor/client/SchedulerClient.java
index 86eb1137..67ce4d3b 100644
--- a/src/main/java/io/orkes/conductor/client/SchedulerClient.java
+++ b/src/main/java/io/orkes/conductor/client/SchedulerClient.java
@@ -15,6 +15,7 @@
import java.util.List;
import io.orkes.conductor.client.model.SaveScheduleRequest;
+import io.orkes.conductor.client.model.SearchResultWorkflowScheduleExecution;
import io.orkes.conductor.client.model.SearchResultWorkflowScheduleExecutionModel;
import io.orkes.conductor.client.model.TagObject;
import io.orkes.conductor.client.model.WorkflowSchedule;
@@ -41,8 +42,9 @@ List getNextFewSchedules(
void saveSchedule(SaveScheduleRequest saveScheduleRequest);
- SearchResultWorkflowScheduleExecutionModel searchV22(
- Integer start, Integer size, String sort, String freeText, String query);
+ @Deprecated
+ SearchResultWorkflowScheduleExecutionModel searchV22(Integer start, Integer size, String sort, String freeText, String query);
+ SearchResultWorkflowScheduleExecution search(Integer start, Integer size, String sort, String freeText, String query);
void setSchedulerTags(List body, String name);
diff --git a/src/main/java/io/orkes/conductor/client/http/OrkesIntegrationClient.java b/src/main/java/io/orkes/conductor/client/http/OrkesIntegrationClient.java
new file mode 100644
index 00000000..edbac4c9
--- /dev/null
+++ b/src/main/java/io/orkes/conductor/client/http/OrkesIntegrationClient.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2024 Orkes, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package io.orkes.conductor.client.http;
+
+import java.util.List;
+import java.util.Map;
+
+import io.orkes.conductor.client.ApiClient;
+import io.orkes.conductor.client.IntegrationClient;
+import io.orkes.conductor.client.http.api.IntegrationResourceApi;
+import io.orkes.conductor.client.model.TagObject;
+import io.orkes.conductor.client.model.integration.Integration;
+import io.orkes.conductor.client.model.integration.IntegrationApi;
+import io.orkes.conductor.client.model.integration.IntegrationApiUpdate;
+import io.orkes.conductor.client.model.integration.IntegrationUpdate;
+import io.orkes.conductor.client.model.integration.ai.PromptTemplate;
+
+public class OrkesIntegrationClient extends OrkesClient implements IntegrationClient {
+ private IntegrationResourceApi integrationApi;
+
+ public OrkesIntegrationClient(ApiClient apiClient) {
+ super(apiClient);
+ this.integrationApi = new IntegrationResourceApi(apiClient);
+ }
+
+ public void associatePromptWithIntegration(String aiIntegration, String modelName, String promptName) {
+ integrationApi.associatePromptWithIntegration(aiIntegration, modelName, promptName);
+ }
+
+ public void deleteIntegrationApi(String apiName, String integrationName) {
+ integrationApi.deleteIntegrationApi(apiName, integrationName);
+ }
+
+ public void deleteIntegration(String integrationName) {
+ integrationApi.deleteIntegrationProvider(integrationName);
+ }
+
+ public IntegrationApi getIntegrationApi(String apiName, String integrationName) throws ApiException {
+ try {
+ return integrationApi.getIntegrationApi(apiName, integrationName);
+ } catch (ApiException e) {
+ if (e.getStatusCode() == 404) {
+ return null;
+ }
+ throw e;
+ }
+ }
+
+ public List getIntegrationApis(String integrationName) {
+ return integrationApi.getIntegrationApis(integrationName, true);
+ }
+
+ public Integration getIntegration(String integrationName) throws ApiException {
+ try {
+ return integrationApi.getIntegrationProvider(integrationName);
+ } catch (ApiException e) {
+ if (e.getStatusCode() == 404) {
+ return null;
+ }
+ throw e;
+ }
+ }
+
+ public List getIntegrations(String category, Boolean activeOnly) {
+ return integrationApi.getIntegrationProviders(category, activeOnly);
+ }
+
+ public List getPromptsWithIntegration(String aiIntegration, String modelName) {
+ return integrationApi.getPromptsWithIntegration(aiIntegration, modelName);
+ }
+
+ public void saveIntegrationApi(String integrationName, String apiName, IntegrationApiUpdate apiDetails) {
+ integrationApi.saveIntegrationApi(apiDetails, integrationName, apiName);
+ }
+
+ public void saveIntegration(String integrationName, IntegrationUpdate integrationDetails) {
+ integrationApi.saveIntegrationProvider(integrationDetails, integrationName);
+ }
+
+ public int getTokenUsageForIntegration(String name, String integrationName) {
+ return integrationApi.getTokenUsageForIntegration(name, integrationName);
+ }
+
+ public Map getTokenUsageForIntegrationProvider(String name) {
+ return integrationApi.getTokenUsageForIntegrationProvider(name);
+ }
+
+ // Tags - Implementations are assumed to be placeholders
+
+ public void deleteTagForIntegrationProvider(List tags, String name) {
+ integrationApi.deleteTagForIntegrationProvider(tags, name);
+ }
+ public void saveTagForIntegrationProvider(List tags, String name) {
+ integrationApi.putTagForIntegrationProvider(tags, name);
+ }
+
+ public List getTagsForIntegrationProvider(String name) {
+ return integrationApi.getTagsForIntegrationProvider(name);
+ }
+}
diff --git a/src/main/java/io/orkes/conductor/client/http/OrkesSchedulerClient.java b/src/main/java/io/orkes/conductor/client/http/OrkesSchedulerClient.java
index 5b42c0d1..f740849f 100644
--- a/src/main/java/io/orkes/conductor/client/http/OrkesSchedulerClient.java
+++ b/src/main/java/io/orkes/conductor/client/http/OrkesSchedulerClient.java
@@ -18,6 +18,7 @@
import io.orkes.conductor.client.SchedulerClient;
import io.orkes.conductor.client.http.api.SchedulerResourceApi;
import io.orkes.conductor.client.model.SaveScheduleRequest;
+import io.orkes.conductor.client.model.SearchResultWorkflowScheduleExecution;
import io.orkes.conductor.client.model.SearchResultWorkflowScheduleExecutionModel;
import io.orkes.conductor.client.model.TagObject;
import io.orkes.conductor.client.model.WorkflowSchedule;
@@ -90,6 +91,11 @@ public SearchResultWorkflowScheduleExecutionModel searchV22(
throws ApiException {
return schedulerResourceApi.searchV22(start, size, sort, freeText, query);
}
+ @Override
+ public SearchResultWorkflowScheduleExecution search(Integer start, Integer size, String sort, String freeText, String query)
+ throws ApiException {
+ return schedulerResourceApi.search(start, size, sort, freeText, query);
+ }
@Override
public void setSchedulerTags(List body, String name) {
diff --git a/src/main/java/io/orkes/conductor/client/http/OrkesTaskClient.java b/src/main/java/io/orkes/conductor/client/http/OrkesTaskClient.java
index 2a7d53ad..35d813a1 100644
--- a/src/main/java/io/orkes/conductor/client/http/OrkesTaskClient.java
+++ b/src/main/java/io/orkes/conductor/client/http/OrkesTaskClient.java
@@ -29,9 +29,9 @@
import io.orkes.conductor.client.TaskClient;
import io.orkes.conductor.client.grpc.GrpcTaskClient;
import io.orkes.conductor.client.http.api.TaskResourceApi;
+import io.orkes.conductor.client.model.TaskSummary;
import com.fasterxml.jackson.databind.ObjectMapper;
-import io.orkes.conductor.client.model.TaskSummary;
public class OrkesTaskClient extends TaskClient implements AutoCloseable {
diff --git a/src/main/java/io/orkes/conductor/client/http/api/IntegrationResourceApi.java b/src/main/java/io/orkes/conductor/client/http/api/IntegrationResourceApi.java
new file mode 100644
index 00000000..feb6ace9
--- /dev/null
+++ b/src/main/java/io/orkes/conductor/client/http/api/IntegrationResourceApi.java
@@ -0,0 +1,3011 @@
+/*
+ * Copyright 2024 Orkes, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package io.orkes.conductor.client.http.api;
+
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import io.orkes.conductor.client.ApiClient;
+import io.orkes.conductor.client.http.ApiCallback;
+import io.orkes.conductor.client.http.ApiException;
+import io.orkes.conductor.client.http.ApiResponse;
+import io.orkes.conductor.client.http.Pair;
+import io.orkes.conductor.client.http.ProgressRequestBody;
+import io.orkes.conductor.client.http.ProgressResponseBody;
+import io.orkes.conductor.client.model.TagObject;
+import io.orkes.conductor.client.model.integration.Integration;
+import io.orkes.conductor.client.model.integration.IntegrationApi;
+import io.orkes.conductor.client.model.integration.IntegrationApiUpdate;
+import io.orkes.conductor.client.model.integration.IntegrationDef;
+import io.orkes.conductor.client.model.integration.IntegrationUpdate;
+import io.orkes.conductor.client.model.integration.ai.PromptTemplate;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.squareup.okhttp.Call;
+
+public class IntegrationResourceApi {
+
+ private ApiClient apiClient;
+
+
+
+ public IntegrationResourceApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Build call for associatePromptWithIntegration
+ * @param integrationProvider (required)
+ * @param integrationName (required)
+ * @param promptName (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call associatePromptWithIntegrationCall(String integrationProvider, String integrationName, String promptName,
+ final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
+ throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/integrations/provider/{integration_provider}/integration/{integration_name}/prompt/{prompt_name}".replaceAll(
+ "\\{" + "integration_provider" + "\\}", apiClient.escapeString(integrationProvider))
+ .replaceAll("\\{" + "integration_name" + "\\}", apiClient.escapeString(integrationName))
+ .replaceAll("\\{" + "prompt_name" + "\\}", apiClient.escapeString(promptName));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call associatePromptWithIntegrationValidateBeforeCall(String integrationProvider, String integrationName, String promptName,
+ final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
+ throws ApiException {
+ // verify the required parameter 'integrationProvider' is set
+ if (integrationProvider == null) {
+ throw new ApiException("Missing the required parameter 'integrationProvider' when calling associatePromptWithIntegration(Async)");
+ }
+ // verify the required parameter 'integrationName' is set
+ if (integrationName == null) {
+ throw new ApiException("Missing the required parameter 'integrationName' when calling associatePromptWithIntegration(Async)");
+ }
+ // verify the required parameter 'promptName' is set
+ if (promptName == null) {
+ throw new ApiException("Missing the required parameter 'promptName' when calling associatePromptWithIntegration(Async)");
+ }
+
+ Call call = associatePromptWithIntegrationCall(integrationProvider, integrationName, promptName, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Associate a Prompt Template with an Integration
+ *
+ * @param integrationProvider (required)
+ * @param integrationName (required)
+ * @param promptName (required)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void associatePromptWithIntegration(String integrationProvider, String integrationName, String promptName) throws ApiException {
+ associatePromptWithIntegrationWithHttpInfo(integrationProvider, integrationName, promptName);
+ }
+
+ /**
+ * Associate a Prompt Template with an Integration
+ *
+ * @param integrationProvider (required)
+ * @param integrationName (required)
+ * @param promptName (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse associatePromptWithIntegrationWithHttpInfo(String integrationProvider, String integrationName, String promptName)
+ throws ApiException {
+ Call call = associatePromptWithIntegrationValidateBeforeCall(integrationProvider, integrationName, promptName, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * Associate a Prompt Template with an Integration (asynchronously)
+ *
+ * @param integrationProvider (required)
+ * @param integrationName (required)
+ * @param promptName (required)
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public Call associatePromptWithIntegrationAsync(String integrationProvider, String integrationName, String promptName, final ApiCallback callback)
+ throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ Call call = associatePromptWithIntegrationValidateBeforeCall(integrationProvider, integrationName, promptName, progressListener,
+ progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+
+ /**
+ * Build call for deleteIntegrationApi
+ * @param name (required)
+ * @param integrationName (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call deleteIntegrationApiCall(String name, String integrationName, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/integrations/provider/{name}/integration/{integration_name}".replaceAll("\\{" + "name" + "\\}",
+ apiClient.escapeString(name))
+ .replaceAll("\\{" + "integration_name" + "\\}", apiClient.escapeString(integrationName));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call deleteIntegrationApiValidateBeforeCall(String name, String integrationName, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ // verify the required parameter 'name' is set
+ if (name == null) {
+ throw new ApiException("Missing the required parameter 'name' when calling deleteIntegrationApi(Async)");
+ }
+ // verify the required parameter 'integrationName' is set
+ if (integrationName == null) {
+ throw new ApiException("Missing the required parameter 'integrationName' when calling deleteIntegrationApi(Async)");
+ }
+
+ Call call = deleteIntegrationApiCall(name, integrationName, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Delete an Integration
+ *
+ * @param name (required)
+ * @param integrationName (required)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void deleteIntegrationApi(String name, String integrationName) throws ApiException {
+ deleteIntegrationApiWithHttpInfo(name, integrationName);
+ }
+
+ /**
+ * Delete an Integration
+ *
+ * @param name (required)
+ * @param integrationName (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse deleteIntegrationApiWithHttpInfo(String name, String integrationName) throws ApiException {
+ Call call = deleteIntegrationApiValidateBeforeCall(name, integrationName, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * Delete an Integration (asynchronously)
+ *
+ * @param name (required)
+ * @param integrationName (required)
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public Call deleteIntegrationApiAsync(String name, String integrationName, final ApiCallback callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ Call call = deleteIntegrationApiValidateBeforeCall(name, integrationName, progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+
+ /**
+ * Build call for deleteIntegrationProvider
+ * @param name (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call deleteIntegrationProviderCall(String name, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/integrations/provider/{name}".replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call deleteIntegrationProviderValidateBeforeCall(String name, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ // verify the required parameter 'name' is set
+ if (name == null) {
+ throw new ApiException("Missing the required parameter 'name' when calling deleteIntegrationProvider(Async)");
+ }
+
+ Call call = deleteIntegrationProviderCall(name, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Delete an Integration Provider
+ *
+ * @param name (required)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void deleteIntegrationProvider(String name) throws ApiException {
+ deleteIntegrationProviderWithHttpInfo(name);
+ }
+
+ /**
+ * Delete an Integration Provider
+ *
+ * @param name (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse deleteIntegrationProviderWithHttpInfo(String name) throws ApiException {
+ Call call = deleteIntegrationProviderValidateBeforeCall(name, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * Delete an Integration Provider (asynchronously)
+ *
+ * @param name (required)
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public Call deleteIntegrationProviderAsync(String name, final ApiCallback callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ Call call = deleteIntegrationProviderValidateBeforeCall(name, progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+
+ /**
+ * Build call for deleteTagForIntegration
+ * @param body (required)
+ * @param name (required)
+ * @param integrationName (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call deleteTagForIntegrationCall(List body, String name, String integrationName,
+ final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
+ throws ApiException {
+ Object localVarPostBody = body;
+
+ // create path and map variables
+ String localVarPath = "/integrations/provider/{name}/integration/{integration_name}/tags".replaceAll("\\{" + "name" + "\\}",
+ apiClient.escapeString(name))
+ .replaceAll("\\{" + "integration_name" + "\\}", apiClient.escapeString(integrationName));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = { "application/json" };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call deleteTagForIntegrationValidateBeforeCall(List body, String name, String integrationName,
+ final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
+ throws ApiException {
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException("Missing the required parameter 'body' when calling deleteTagForIntegration(Async)");
+ }
+ // verify the required parameter 'name' is set
+ if (name == null) {
+ throw new ApiException("Missing the required parameter 'name' when calling deleteTagForIntegration(Async)");
+ }
+ // verify the required parameter 'integrationName' is set
+ if (integrationName == null) {
+ throw new ApiException("Missing the required parameter 'integrationName' when calling deleteTagForIntegration(Async)");
+ }
+
+ Call call = deleteTagForIntegrationCall(body, name, integrationName, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Delete a tag for Integration
+ *
+ * @param body (required)
+ * @param name (required)
+ * @param integrationName (required)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void deleteTagForIntegration(List body, String name, String integrationName) throws ApiException {
+ deleteTagForIntegrationWithHttpInfo(body, name, integrationName);
+ }
+
+ /**
+ * Delete a tag for Integration
+ *
+ * @param body (required)
+ * @param name (required)
+ * @param integrationName (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse deleteTagForIntegrationWithHttpInfo(List body, String name, String integrationName) throws ApiException {
+ Call call = deleteTagForIntegrationValidateBeforeCall(body, name, integrationName, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * Delete a tag for Integration (asynchronously)
+ *
+ * @param body (required)
+ * @param name (required)
+ * @param integrationName (required)
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public Call deleteTagForIntegrationAsync(List body, String name, String integrationName, final ApiCallback callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ Call call = deleteTagForIntegrationValidateBeforeCall(body, name, integrationName, progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+
+ /**
+ * Build call for deleteTagForIntegrationProvider
+ * @param body (required)
+ * @param name (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call deleteTagForIntegrationProviderCall(List body, String name, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = body;
+
+ // create path and map variables
+ String localVarPath = "/integrations/provider/{name}/tags".replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = { "application/json" };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call deleteTagForIntegrationProviderValidateBeforeCall(List body, String name,
+ final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
+ throws ApiException {
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException("Missing the required parameter 'body' when calling deleteTagForIntegrationProvider(Async)");
+ }
+ // verify the required parameter 'name' is set
+ if (name == null) {
+ throw new ApiException("Missing the required parameter 'name' when calling deleteTagForIntegrationProvider(Async)");
+ }
+
+ Call call = deleteTagForIntegrationProviderCall(body, name, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Delete a tag for Integration Provider
+ *
+ * @param body (required)
+ * @param name (required)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void deleteTagForIntegrationProvider(List body, String name) throws ApiException {
+ deleteTagForIntegrationProviderWithHttpInfo(body, name);
+ }
+
+ /**
+ * Delete a tag for Integration Provider
+ *
+ * @param body (required)
+ * @param name (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse deleteTagForIntegrationProviderWithHttpInfo(List body, String name) throws ApiException {
+ Call call = deleteTagForIntegrationProviderValidateBeforeCall(body, name, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * Delete a tag for Integration Provider (asynchronously)
+ *
+ * @param body (required)
+ * @param name (required)
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public Call deleteTagForIntegrationProviderAsync(List body, String name, final ApiCallback callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ Call call = deleteTagForIntegrationProviderValidateBeforeCall(body, name, progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+
+ /**
+ * Build call for getIntegrationApi
+ * @param name (required)
+ * @param integrationName (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call getIntegrationApiCall(String name, String integrationName, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/integrations/provider/{name}/integration/{integration_name}".replaceAll("\\{" + "name" + "\\}",
+ apiClient.escapeString(name))
+ .replaceAll("\\{" + "integration_name" + "\\}", apiClient.escapeString(integrationName));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = { "application/json" };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call getIntegrationApiValidateBeforeCall(String name, String integrationName, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ // verify the required parameter 'name' is set
+ if (name == null) {
+ throw new ApiException("Missing the required parameter 'name' when calling getIntegrationApi(Async)");
+ }
+ // verify the required parameter 'integrationName' is set
+ if (integrationName == null) {
+ throw new ApiException("Missing the required parameter 'integrationName' when calling getIntegrationApi(Async)");
+ }
+
+ Call call = getIntegrationApiCall(name, integrationName, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get Integration details
+ *
+ * @param name (required)
+ * @param integrationName (required)
+ * @return IntegrationApi
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public IntegrationApi getIntegrationApi(String name, String integrationName) throws ApiException {
+ ApiResponse resp = getIntegrationApiWithHttpInfo(name, integrationName);
+ return resp.getData();
+ }
+
+ /**
+ * Get Integration details
+ *
+ * @param name (required)
+ * @param integrationName (required)
+ * @return ApiResponse<IntegrationApi>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse getIntegrationApiWithHttpInfo(String name, String integrationName) throws ApiException {
+ Call call = getIntegrationApiValidateBeforeCall(name, integrationName, null, null);
+ Type localVarReturnType = new TypeReference() {
+ }.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Get Integration details (asynchronously)
+ *
+ * @param name (required)
+ * @param integrationName (required)
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public Call getIntegrationApiAsync(String name, String integrationName, final ApiCallback callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ Call call = getIntegrationApiValidateBeforeCall(name, integrationName, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeReference() {
+ }.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+
+ /**
+ * Build call for getIntegrationApis
+ * @param name (required)
+ * @param activeOnly (optional, default to true)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call getIntegrationApisCall(String name, Boolean activeOnly, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/integrations/provider/{name}/integration".replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ if (activeOnly != null) {
+ localVarQueryParams.addAll(apiClient.parameterToPair("activeOnly", activeOnly));
+ }
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = { "application/json" };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call getIntegrationApisValidateBeforeCall(String name, Boolean activeOnly, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ // verify the required parameter 'name' is set
+ if (name == null) {
+ throw new ApiException("Missing the required parameter 'name' when calling getIntegrationApis(Async)");
+ }
+
+ Call call = getIntegrationApisCall(name, activeOnly, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get Integrations of an Integration Provider
+ *
+ * @param name (required)
+ * @param activeOnly (optional, default to true)
+ * @return List<IntegrationApi>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public List getIntegrationApis(String name, Boolean activeOnly) throws ApiException {
+ ApiResponse> resp = getIntegrationApisWithHttpInfo(name, activeOnly);
+ return resp.getData();
+ }
+
+ /**
+ * Get Integrations of an Integration Provider
+ *
+ * @param name (required)
+ * @param activeOnly (optional, default to true)
+ * @return ApiResponse<List<IntegrationApi>>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse> getIntegrationApisWithHttpInfo(String name, Boolean activeOnly) throws ApiException {
+ Call call = getIntegrationApisValidateBeforeCall(name, activeOnly, null, null);
+ Type localVarReturnType = new TypeReference>() {
+ }.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Get Integrations of an Integration Provider (asynchronously)
+ *
+ * @param name (required)
+ * @param activeOnly (optional, default to true)
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public Call getIntegrationApisAsync(String name, Boolean activeOnly, final ApiCallback> callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ Call call = getIntegrationApisValidateBeforeCall(name, activeOnly, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeReference>() {
+ }.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+
+ /**
+ * Build call for getIntegrationAvailableApis
+ * @param name (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call getIntegrationAvailableApisCall(String name, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/integrations/provider/{name}/integration/all".replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = { "application/json" };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call getIntegrationAvailableApisValidateBeforeCall(String name, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ // verify the required parameter 'name' is set
+ if (name == null) {
+ throw new ApiException("Missing the required parameter 'name' when calling getIntegrationAvailableApis(Async)");
+ }
+
+ Call call = getIntegrationAvailableApisCall(name, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get Integrations Available for an Integration Provider
+ *
+ * @param name (required)
+ * @return List<String>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public List getIntegrationAvailableApis(String name) throws ApiException {
+ ApiResponse> resp = getIntegrationAvailableApisWithHttpInfo(name);
+ return resp.getData();
+ }
+
+ /**
+ * Get Integrations Available for an Integration Provider
+ *
+ * @param name (required)
+ * @return ApiResponse<List<String>>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse> getIntegrationAvailableApisWithHttpInfo(String name) throws ApiException {
+ Call call = getIntegrationAvailableApisValidateBeforeCall(name, null, null);
+ Type localVarReturnType = new TypeReference>() {
+ }.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Get Integrations Available for an Integration Provider (asynchronously)
+ *
+ * @param name (required)
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public Call getIntegrationAvailableApisAsync(String name, final ApiCallback> callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ Call call = getIntegrationAvailableApisValidateBeforeCall(name, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeReference>() {
+ }.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+
+ /**
+ * Build call for getIntegrationProvider
+ * @param name (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call getIntegrationProviderCall(String name, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/integrations/provider/{name}".replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = { "application/json" };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call getIntegrationProviderValidateBeforeCall(String name, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ // verify the required parameter 'name' is set
+ if (name == null) {
+ throw new ApiException("Missing the required parameter 'name' when calling getIntegrationProvider(Async)");
+ }
+
+ Call call = getIntegrationProviderCall(name, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get Integration provider
+ *
+ * @param name (required)
+ * @return Integration
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public Integration getIntegrationProvider(String name) throws ApiException {
+ ApiResponse resp = getIntegrationProviderWithHttpInfo(name);
+ return resp.getData();
+ }
+
+ /**
+ * Get Integration provider
+ *
+ * @param name (required)
+ * @return ApiResponse<Integration>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse getIntegrationProviderWithHttpInfo(String name) throws ApiException {
+ Call call = getIntegrationProviderValidateBeforeCall(name, null, null);
+ Type localVarReturnType = new TypeReference() {
+ }.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Get Integration provider (asynchronously)
+ *
+ * @param name (required)
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public Call getIntegrationProviderAsync(String name, final ApiCallback callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ Call call = getIntegrationProviderValidateBeforeCall(name, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeReference() {
+ }.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+
+ /**
+ * Build call for getIntegrationProviderDefs
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call getIntegrationProviderDefsCall(final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/integrations/def";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = { "application/json" };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call getIntegrationProviderDefsValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ Call call = getIntegrationProviderDefsCall(progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get Integration provider definitions
+ *
+ * @return List<IntegrationDef>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public List getIntegrationProviderDefs() throws ApiException {
+ ApiResponse> resp = getIntegrationProviderDefsWithHttpInfo();
+ return resp.getData();
+ }
+
+ /**
+ * Get Integration provider definitions
+ *
+ * @return ApiResponse<List<IntegrationDef>>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse> getIntegrationProviderDefsWithHttpInfo() throws ApiException {
+ Call call = getIntegrationProviderDefsValidateBeforeCall(null, null);
+ Type localVarReturnType = new TypeReference>() {
+ }.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Get Integration provider definitions (asynchronously)
+ *
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public Call getIntegrationProviderDefsAsync(final ApiCallback> callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ Call call = getIntegrationProviderDefsValidateBeforeCall(progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeReference>() {
+ }.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+
+ /**
+ * Build call for getIntegrationProviders
+ * @param category (optional)
+ * @param activeOnly (optional, default to true)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call getIntegrationProvidersCall(String category, Boolean activeOnly, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/integrations/provider";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ if (category != null) {
+ localVarQueryParams.addAll(apiClient.parameterToPair("category", category));
+ }
+ if (activeOnly != null) {
+ localVarQueryParams.addAll(apiClient.parameterToPair("activeOnly", activeOnly));
+ }
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = { "application/json" };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call getIntegrationProvidersValidateBeforeCall(String category, Boolean activeOnly, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ Call call = getIntegrationProvidersCall(category, activeOnly, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get all Integrations Providers
+ *
+ * @param category (optional)
+ * @param activeOnly (optional, default to true)
+ * @return List<Integration>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public List getIntegrationProviders(String category, Boolean activeOnly) throws ApiException {
+ ApiResponse> resp = getIntegrationProvidersWithHttpInfo(category, activeOnly);
+ return resp.getData();
+ }
+
+ /**
+ * Get all Integrations Providers
+ *
+ * @param category (optional)
+ * @param activeOnly (optional, default to true)
+ * @return ApiResponse<List<Integration>>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse> getIntegrationProvidersWithHttpInfo(String category, Boolean activeOnly) throws ApiException {
+ Call call = getIntegrationProvidersValidateBeforeCall(category, activeOnly, null, null);
+ Type localVarReturnType = new TypeReference>() {
+ }.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Get all Integrations Providers (asynchronously)
+ *
+ * @param category (optional)
+ * @param activeOnly (optional, default to true)
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public Call getIntegrationProvidersAsync(String category, Boolean activeOnly, final ApiCallback> callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ Call call = getIntegrationProvidersValidateBeforeCall(category, activeOnly, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeReference>() {
+ }.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+
+ /**
+ * Build call for getPromptsWithIntegration
+ * @param integrationProvider (required)
+ * @param integrationName (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call getPromptsWithIntegrationCall(String integrationProvider, String integrationName, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/integrations/provider/{integration_provider}/integration/{integration_name}/prompt".replaceAll(
+ "\\{" + "integration_provider" + "\\}", apiClient.escapeString(integrationProvider))
+ .replaceAll("\\{" + "integration_name" + "\\}", apiClient.escapeString(integrationName));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = { "application/json" };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call getPromptsWithIntegrationValidateBeforeCall(String integrationProvider, String integrationName,
+ final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
+ throws ApiException {
+ // verify the required parameter 'integrationProvider' is set
+ if (integrationProvider == null) {
+ throw new ApiException("Missing the required parameter 'integrationProvider' when calling getPromptsWithIntegration(Async)");
+ }
+ // verify the required parameter 'integrationName' is set
+ if (integrationName == null) {
+ throw new ApiException("Missing the required parameter 'integrationName' when calling getPromptsWithIntegration(Async)");
+ }
+
+ Call call = getPromptsWithIntegrationCall(integrationProvider, integrationName, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get the list of prompt templates associated with an integration
+ *
+ * @param integrationProvider (required)
+ * @param integrationName (required)
+ * @return List<PromptTemplate>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public List getPromptsWithIntegration(String integrationProvider, String integrationName) throws ApiException {
+ ApiResponse> resp = getPromptsWithIntegrationWithHttpInfo(integrationProvider, integrationName);
+ return resp.getData();
+ }
+
+ /**
+ * Get the list of prompt templates associated with an integration
+ *
+ * @param integrationProvider (required)
+ * @param integrationName (required)
+ * @return ApiResponse<List<PromptTemplate>>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse> getPromptsWithIntegrationWithHttpInfo(String integrationProvider, String integrationName) throws ApiException {
+ Call call = getPromptsWithIntegrationValidateBeforeCall(integrationProvider, integrationName, null, null);
+ Type localVarReturnType = new TypeReference>() {
+ }.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Get the list of prompt templates associated with an integration (asynchronously)
+ *
+ * @param integrationProvider (required)
+ * @param integrationName (required)
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public Call getPromptsWithIntegrationAsync(String integrationProvider, String integrationName, final ApiCallback> callback)
+ throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ Call call = getPromptsWithIntegrationValidateBeforeCall(integrationProvider, integrationName, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeReference>() {
+ }.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+
+ /**
+ * Build call for getProvidersAndIntegrations
+ * @param type (optional)
+ * @param activeOnly (optional, default to true)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call getProvidersAndIntegrationsCall(String type, Boolean activeOnly, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/integrations/all";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ if (type != null) {
+ localVarQueryParams.addAll(apiClient.parameterToPair("type", type));
+ }
+ if (activeOnly != null) {
+ localVarQueryParams.addAll(apiClient.parameterToPair("activeOnly", activeOnly));
+ }
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = { "application/json" };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call getProvidersAndIntegrationsValidateBeforeCall(String type, Boolean activeOnly, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ Call call = getProvidersAndIntegrationsCall(type, activeOnly, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get Integrations Providers and Integrations combo
+ *
+ * @param type (optional)
+ * @param activeOnly (optional, default to true)
+ * @return List<String>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public List getProvidersAndIntegrations(String type, Boolean activeOnly) throws ApiException {
+ ApiResponse> resp = getProvidersAndIntegrationsWithHttpInfo(type, activeOnly);
+ return resp.getData();
+ }
+
+ /**
+ * Get Integrations Providers and Integrations combo
+ *
+ * @param type (optional)
+ * @param activeOnly (optional, default to true)
+ * @return ApiResponse<List<String>>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse> getProvidersAndIntegrationsWithHttpInfo(String type, Boolean activeOnly) throws ApiException {
+ Call call = getProvidersAndIntegrationsValidateBeforeCall(type, activeOnly, null, null);
+ Type localVarReturnType = new TypeReference>() {
+ }.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Get Integrations Providers and Integrations combo (asynchronously)
+ *
+ * @param type (optional)
+ * @param activeOnly (optional, default to true)
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public Call getProvidersAndIntegrationsAsync(String type, Boolean activeOnly, final ApiCallback> callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ Call call = getProvidersAndIntegrationsValidateBeforeCall(type, activeOnly, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeReference>() {
+ }.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+
+ /**
+ * Build call for getTagsForIntegration
+ * @param name (required)
+ * @param integrationName (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call getTagsForIntegrationCall(String name, String integrationName, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/integrations/provider/{name}/integration/{integration_name}/tags".replaceAll("\\{" + "name" + "\\}",
+ apiClient.escapeString(name))
+ .replaceAll("\\{" + "integration_name" + "\\}", apiClient.escapeString(integrationName));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = { "application/json" };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call getTagsForIntegrationValidateBeforeCall(String name, String integrationName, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ // verify the required parameter 'name' is set
+ if (name == null) {
+ throw new ApiException("Missing the required parameter 'name' when calling getTagsForIntegration(Async)");
+ }
+ // verify the required parameter 'integrationName' is set
+ if (integrationName == null) {
+ throw new ApiException("Missing the required parameter 'integrationName' when calling getTagsForIntegration(Async)");
+ }
+
+ Call call = getTagsForIntegrationCall(name, integrationName, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get tags by Integration
+ *
+ * @param name (required)
+ * @param integrationName (required)
+ * @return List<Tag>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public List getTagsForIntegration(String name, String integrationName) throws ApiException {
+ ApiResponse> resp = getTagsForIntegrationWithHttpInfo(name, integrationName);
+ return resp.getData();
+ }
+
+ /**
+ * Get tags by Integration
+ *
+ * @param name (required)
+ * @param integrationName (required)
+ * @return ApiResponse<List<Tag>>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse> getTagsForIntegrationWithHttpInfo(String name, String integrationName) throws ApiException {
+ Call call = getTagsForIntegrationValidateBeforeCall(name, integrationName, null, null);
+ Type localVarReturnType = new TypeReference>() {
+ }.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Get tags by Integration (asynchronously)
+ *
+ * @param name (required)
+ * @param integrationName (required)
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public Call getTagsForIntegrationAsync(String name, String integrationName, final ApiCallback> callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ Call call = getTagsForIntegrationValidateBeforeCall(name, integrationName, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeReference>() {
+ }.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+
+ /**
+ * Build call for getTagsForIntegrationProvider
+ * @param name (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call getTagsForIntegrationProviderCall(String name, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/integrations/provider/{name}/tags".replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = { "application/json" };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call getTagsForIntegrationProviderValidateBeforeCall(String name, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ // verify the required parameter 'name' is set
+ if (name == null) {
+ throw new ApiException("Missing the required parameter 'name' when calling getTagsForIntegrationProvider(Async)");
+ }
+
+ Call call = getTagsForIntegrationProviderCall(name, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get tags by Integration Provider
+ *
+ * @param name (required)
+ * @return List<Tag>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public List getTagsForIntegrationProvider(String name) throws ApiException {
+ ApiResponse> resp = getTagsForIntegrationProviderWithHttpInfo(name);
+ return resp.getData();
+ }
+
+ /**
+ * Get tags by Integration Provider
+ *
+ * @param name (required)
+ * @return ApiResponse<List<Tag>>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse> getTagsForIntegrationProviderWithHttpInfo(String name) throws ApiException {
+ Call call = getTagsForIntegrationProviderValidateBeforeCall(name, null, null);
+ Type localVarReturnType = new TypeReference>() {
+ }.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Get tags by Integration Provider (asynchronously)
+ *
+ * @param name (required)
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public Call getTagsForIntegrationProviderAsync(String name, final ApiCallback> callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ Call call = getTagsForIntegrationProviderValidateBeforeCall(name, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeReference>() {
+ }.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+
+ /**
+ * Build call for getTokenUsageForIntegration
+ * @param name (required)
+ * @param integrationName (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call getTokenUsageForIntegrationCall(String name, String integrationName, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/integrations/provider/{name}/integration/{integration_name}/metrics".replaceAll("\\{" + "name" + "\\}",
+ apiClient.escapeString(name))
+ .replaceAll("\\{" + "integration_name" + "\\}", apiClient.escapeString(integrationName));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = { "application/json" };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call getTokenUsageForIntegrationValidateBeforeCall(String name, String integrationName,
+ final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
+ throws ApiException {
+ // verify the required parameter 'name' is set
+ if (name == null) {
+ throw new ApiException("Missing the required parameter 'name' when calling getTokenUsageForIntegration(Async)");
+ }
+ // verify the required parameter 'integrationName' is set
+ if (integrationName == null) {
+ throw new ApiException("Missing the required parameter 'integrationName' when calling getTokenUsageForIntegration(Async)");
+ }
+
+ Call call = getTokenUsageForIntegrationCall(name, integrationName, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get Token Usage by Integration
+ *
+ * @param name (required)
+ * @param integrationName (required)
+ * @return Integer
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public Integer getTokenUsageForIntegration(String name, String integrationName) throws ApiException {
+ ApiResponse resp = getTokenUsageForIntegrationWithHttpInfo(name, integrationName);
+ return resp.getData();
+ }
+
+ /**
+ * Get Token Usage by Integration
+ *
+ * @param name (required)
+ * @param integrationName (required)
+ * @return ApiResponse<Integer>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse getTokenUsageForIntegrationWithHttpInfo(String name, String integrationName) throws ApiException {
+ Call call = getTokenUsageForIntegrationValidateBeforeCall(name, integrationName, null, null);
+ Type localVarReturnType = new TypeReference() {
+ }.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Get Token Usage by Integration (asynchronously)
+ *
+ * @param name (required)
+ * @param integrationName (required)
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public Call getTokenUsageForIntegrationAsync(String name, String integrationName, final ApiCallback callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ Call call = getTokenUsageForIntegrationValidateBeforeCall(name, integrationName, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeReference() {
+ }.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+
+ /**
+ * Build call for getTokenUsageForIntegrationProvider
+ * @param name (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call getTokenUsageForIntegrationProviderCall(String name, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/integrations/provider/{name}/metrics".replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = { "application/json" };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if (progressListener != null) {
+ apiClient.getHttpClient()
+ .networkInterceptors()
+ .add(new com.squareup.okhttp.Interceptor() {
+ @Override
+ public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams,
+ localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Call getTokenUsageForIntegrationProviderValidateBeforeCall(String name, final ProgressResponseBody.ProgressListener progressListener,
+ final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ // verify the required parameter 'name' is set
+ if (name == null) {
+ throw new ApiException("Missing the required parameter 'name' when calling getTokenUsageForIntegrationProvider(Async)");
+ }
+
+ Call call = getTokenUsageForIntegrationProviderCall(name, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get Token Usage by Integration Provider
+ *
+ * @param name (required)
+ * @return Map<String, String>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public Map