diff --git a/src/main/java/io/orkes/conductor/client/SchedulerClient.java b/src/main/java/io/orkes/conductor/client/SchedulerClient.java index b34838b6..b99033e9 100644 --- a/src/main/java/io/orkes/conductor/client/SchedulerClient.java +++ b/src/main/java/io/orkes/conductor/client/SchedulerClient.java @@ -48,4 +48,6 @@ SearchResultWorkflowScheduleExecutionModel searchV22( void deleteTagForSchedule(List body, String name); + List getTagsForSchedule(String 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 bd28cfbc..c57f84c9 100644 --- a/src/main/java/io/orkes/conductor/client/http/OrkesSchedulerClient.java +++ b/src/main/java/io/orkes/conductor/client/http/OrkesSchedulerClient.java @@ -100,4 +100,9 @@ public void putTagForSchedule(List body, String name) { public void deleteTagForSchedule(List body, String name) { schedulerResourceApi.deleteTagForSchedule(body, name); } + + @Override + public List getTagsForSchedule(String name) { + return schedulerResourceApi.getTagsForSchedule(name); + } } diff --git a/src/main/java/io/orkes/conductor/client/http/api/SchedulerResourceApi.java b/src/main/java/io/orkes/conductor/client/http/api/SchedulerResourceApi.java index f6cfeea3..8035ee25 100644 --- a/src/main/java/io/orkes/conductor/client/http/api/SchedulerResourceApi.java +++ b/src/main/java/io/orkes/conductor/client/http/api/SchedulerResourceApi.java @@ -1635,4 +1635,90 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "api_key" }; return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } + + /** + * Get tags by schedule + * + * @param name (required) + * @return List<TagObject> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public List getTagsForSchedule(String name) throws ApiException { + ApiResponse> resp = getTagsForScheduleWithHttpInfo(name); + return resp.getData(); + } + + /** + * Get tags by schedule + * + * @param name (required) + * @return ApiResponse<List<TagObject>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse> getTagsForScheduleWithHttpInfo(String name) throws ApiException { + com.squareup.okhttp.Call call = getTagsForScheduleValidateBeforeCall(name, null, null); + Type localVarReturnType = new TypeReference>() {}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getTagsForScheduleValidateBeforeCall(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 getTagsForSchedule(Async)"); + } + + com.squareup.okhttp.Call call = getTagsForScheduleCall(name, progressListener, progressRequestListener); + return call; + } + + /** + * Build call for getTagsForSchedule + * @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 com.squareup.okhttp.Call getTagsForScheduleCall(String name, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/scheduler/schedules/{name}/tags" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + 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(com.squareup.okhttp.Interceptor.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); + } }