All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.logicdrop.openapi.jersey.api.TemplateServicesApi Maven / Gradle / Ivy

package io.logicdrop.openapi.jersey.api;

import io.logicdrop.openapi.jersey.ApiException;
import io.logicdrop.openapi.jersey.ApiClient;
import io.logicdrop.openapi.jersey.ApiResponse;
import io.logicdrop.openapi.jersey.Configuration;
import io.logicdrop.openapi.jersey.Pair;

import javax.ws.rs.core.GenericType;

import io.logicdrop.openapi.models.ArtifactResponse;
import io.logicdrop.openapi.models.DeleteArtifactRequest;
import java.io.File;
import io.logicdrop.openapi.models.GenerateTemplateRequest;
import io.logicdrop.openapi.models.InlineResponse200;
import io.logicdrop.openapi.models.Template;
import io.logicdrop.openapi.models.UpdateArtifactRequest;
import io.logicdrop.openapi.models.UpdateTemplateResponse;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class TemplateServicesApi {
  private ApiClient apiClient;

  public TemplateServicesApi() {
    this(Configuration.getDefaultApiClient());
  }

  public TemplateServicesApi(ApiClient apiClient) {
    this.apiClient = apiClient;
  }

  public ApiClient getApiClient() {
    return apiClient;
  }

  public void setApiClient(ApiClient apiClient) {
    this.apiClient = apiClient;
  }
  /**
   * Delete template
   * 
   * @param client Client name (required)
   * @param project Project name (required)
   * @param artifact Template name (required)
   * @param v Template version (optional)
   * @return ArtifactResponse
   * @throws ApiException if fails to make API call
   * @http.response.details
     
Status Code Description Response Headers
200 Results of the operation -
400 Bad request -
401 Unauthorized -
403 Forbidden -
404 Not found -
500 Backend Error -
*/ public ArtifactResponse deleteTemplate(String client, String project, String artifact, String v) throws ApiException { return deleteTemplateWithHttpInfo(client, project, artifact, v).getData(); } /** * Delete template * * @param client Client name (required) * @param project Project name (required) * @param artifact Template name (required) * @param v Template version (optional) * @return ApiResponse<ArtifactResponse> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Results of the operation -
400 Bad request -
401 Unauthorized -
403 Forbidden -
404 Not found -
500 Backend Error -
*/ public ApiResponse deleteTemplateWithHttpInfo(String client, String project, String artifact, String v) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'client' is set if (client == null) { throw new ApiException(400, "Missing the required parameter 'client' when calling deleteTemplate"); } // verify the required parameter 'project' is set if (project == null) { throw new ApiException(400, "Missing the required parameter 'project' when calling deleteTemplate"); } // verify the required parameter 'artifact' is set if (artifact == null) { throw new ApiException(400, "Missing the required parameter 'artifact' when calling deleteTemplate"); } // create path and map variables String localVarPath = "/templates/{client}/{project}/{artifact}" .replaceAll("\\{" + "client" + "\\}", apiClient.escapeString(client.toString())) .replaceAll("\\{" + "project" + "\\}", apiClient.escapeString(project.toString())) .replaceAll("\\{" + "artifact" + "\\}", apiClient.escapeString(artifact.toString())); // query params List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); localVarQueryParams.addAll(apiClient.parameterToPairs("", "v", v)); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "api", "jwt", "oauth2" }; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("TemplateServicesApi.deleteTemplate", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } /** * Delete templates * * @param client Client name (required) * @param project Project name (required) * @param deleteArtifactRequest Remove templates by criteria (required) * @return ArtifactResponse * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Results of the operation -
400 Bad request -
401 Unauthorized -
403 Forbidden -
404 Not found -
500 Backend Error -
*/ public ArtifactResponse deleteTemplates(String client, String project, DeleteArtifactRequest deleteArtifactRequest) throws ApiException { return deleteTemplatesWithHttpInfo(client, project, deleteArtifactRequest).getData(); } /** * Delete templates * * @param client Client name (required) * @param project Project name (required) * @param deleteArtifactRequest Remove templates by criteria (required) * @return ApiResponse<ArtifactResponse> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Results of the operation -
400 Bad request -
401 Unauthorized -
403 Forbidden -
404 Not found -
500 Backend Error -
*/ public ApiResponse deleteTemplatesWithHttpInfo(String client, String project, DeleteArtifactRequest deleteArtifactRequest) throws ApiException { Object localVarPostBody = deleteArtifactRequest; // verify the required parameter 'client' is set if (client == null) { throw new ApiException(400, "Missing the required parameter 'client' when calling deleteTemplates"); } // verify the required parameter 'project' is set if (project == null) { throw new ApiException(400, "Missing the required parameter 'project' when calling deleteTemplates"); } // verify the required parameter 'deleteArtifactRequest' is set if (deleteArtifactRequest == null) { throw new ApiException(400, "Missing the required parameter 'deleteArtifactRequest' when calling deleteTemplates"); } // create path and map variables String localVarPath = "/templates/{client}/{project}" .replaceAll("\\{" + "client" + "\\}", apiClient.escapeString(client.toString())) .replaceAll("\\{" + "project" + "\\}", apiClient.escapeString(project.toString())); // query params List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "api", "jwt", "oauth2" }; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("TemplateServicesApi.deleteTemplates", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } /** * Generate template * Generate template * @param client Client name (required) * @param project Project name (required) * @param artifact Template name (required) * @param v Template version (optional) * @param generateTemplateRequest (optional) * @return InlineResponse200 * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 The generated content -
400 Bad request -
401 Unauthorized -
403 Forbidden -
404 Not found -
500 Backend Error -
*/ public InlineResponse200 generateTemplate(String client, String project, String artifact, String v, GenerateTemplateRequest generateTemplateRequest) throws ApiException { return generateTemplateWithHttpInfo(client, project, artifact, v, generateTemplateRequest).getData(); } /** * Generate template * Generate template * @param client Client name (required) * @param project Project name (required) * @param artifact Template name (required) * @param v Template version (optional) * @param generateTemplateRequest (optional) * @return ApiResponse<InlineResponse200> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 The generated content -
400 Bad request -
401 Unauthorized -
403 Forbidden -
404 Not found -
500 Backend Error -
*/ public ApiResponse generateTemplateWithHttpInfo(String client, String project, String artifact, String v, GenerateTemplateRequest generateTemplateRequest) throws ApiException { Object localVarPostBody = generateTemplateRequest; // verify the required parameter 'client' is set if (client == null) { throw new ApiException(400, "Missing the required parameter 'client' when calling generateTemplate"); } // verify the required parameter 'project' is set if (project == null) { throw new ApiException(400, "Missing the required parameter 'project' when calling generateTemplate"); } // verify the required parameter 'artifact' is set if (artifact == null) { throw new ApiException(400, "Missing the required parameter 'artifact' when calling generateTemplate"); } // create path and map variables String localVarPath = "/templates/{client}/{project}/{artifact}/generate" .replaceAll("\\{" + "client" + "\\}", apiClient.escapeString(client.toString())) .replaceAll("\\{" + "project" + "\\}", apiClient.escapeString(project.toString())) .replaceAll("\\{" + "artifact" + "\\}", apiClient.escapeString(artifact.toString())); // query params List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); localVarQueryParams.addAll(apiClient.parameterToPairs("", "v", v)); final String[] localVarAccepts = { "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "api", "jwt", "oauth2" }; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("TemplateServicesApi.generateTemplate", localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } /** * Get template * Get an template * @param client Client name (required) * @param project Project name (required) * @param artifact Template name (required) * @param v Template version (optional) * @param view Fields to return in the results (optional, default to new ArrayList<>()) * @return Template * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Retrieved template -
400 Bad request -
401 Unauthorized -
403 Forbidden -
404 Not found -
500 Backend Error -
*/ public Template getTemplate(String client, String project, String artifact, String v, List view) throws ApiException { return getTemplateWithHttpInfo(client, project, artifact, v, view).getData(); } /** * Get template * Get an template * @param client Client name (required) * @param project Project name (required) * @param artifact Template name (required) * @param v Template version (optional) * @param view Fields to return in the results (optional, default to new ArrayList<>()) * @return ApiResponse<Template> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Retrieved template -
400 Bad request -
401 Unauthorized -
403 Forbidden -
404 Not found -
500 Backend Error -
*/ public ApiResponse