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

com.blazebit.query.connector.kandji.api.CustomAppsApi Maven / Gradle / Ivy

The newest version!
package com.blazebit.query.connector.kandji.api;

import com.blazebit.query.connector.kandji.invoker.ApiException;
import com.blazebit.query.connector.kandji.invoker.ApiClient;
import com.blazebit.query.connector.kandji.invoker.ApiResponse;
import com.blazebit.query.connector.kandji.invoker.Configuration;
import com.blazebit.query.connector.kandji.invoker.Pair;

import jakarta.ws.rs.core.GenericType;

import com.blazebit.query.connector.kandji.model.CreateCustomApp201Response;
import java.io.File;
import com.blazebit.query.connector.kandji.model.ListCustomApps200Response;
import com.blazebit.query.connector.kandji.model.ListCustomApps200ResponseResultsInner;
import com.blazebit.query.connector.kandji.model.UpdateCustomApp200Response;

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

@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-30T07:19:31.168100307Z[Etc/UTC]", comments = "Generator version: 7.10.0")
public class CustomAppsApi {
  private ApiClient apiClient;

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

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

  /**
   * Get the API client
   *
   * @return API client
   */
  public ApiClient getApiClient() {
    return apiClient;
  }

  /**
   * Set the API client
   *
   * @param apiClient an instance of API client
   */
  public void setApiClient(ApiClient apiClient) {
    this.apiClient = apiClient;
  }

  /**
   * Create Custom App
   * This request allows you to create a custom app in the Kandji library.  Must have already generated a `file_key` via `Create custom app` endpoint and uploaded the file to S3 using a request similar to the `Upload to S3` example.
   * @param active  (optional)
   * @param auditScript  (optional)
   * @param fileKey  (optional)
   * @param installEnforcement  (optional)
   * @param installType  (optional)
   * @param name  (optional)
   * @param postinstallScript  (optional)
   * @param preinstallScript  (optional)
   * @param restart  (optional)
   * @param selfServiceCategoryId  (optional)
   * @param selfServiceRecommended  (optional)
   * @param showInSelfService  (optional)
   * @param unzipLocation  (optional)
   * @return CreateCustomApp201Response
   * @throws ApiException if fails to make API call
   * @http.response.details
     
Response Details
Status Code Description Response Headers
201 success * Allow -
* Content-Length -
* Content-Security-Policy -
* Cross-Origin-Opener-Policy -
* Date -
* Feature-Policy -
* Referrer-Policy -
* Server -
* Vary -
* X-Content-Type-Options -
* X-Frame-Options -
*/ public CreateCustomApp201Response createCustomApp(String active, String auditScript, String fileKey, String installEnforcement, String installType, String name, String postinstallScript, String preinstallScript, String restart, String selfServiceCategoryId, String selfServiceRecommended, String showInSelfService, String unzipLocation) throws ApiException { return createCustomAppWithHttpInfo(active, auditScript, fileKey, installEnforcement, installType, name, postinstallScript, preinstallScript, restart, selfServiceCategoryId, selfServiceRecommended, showInSelfService, unzipLocation).getData(); } /** * Create Custom App * This request allows you to create a custom app in the Kandji library. Must have already generated a `file_key` via `Create custom app` endpoint and uploaded the file to S3 using a request similar to the `Upload to S3` example. * @param active (optional) * @param auditScript (optional) * @param fileKey (optional) * @param installEnforcement (optional) * @param installType (optional) * @param name (optional) * @param postinstallScript (optional) * @param preinstallScript (optional) * @param restart (optional) * @param selfServiceCategoryId (optional) * @param selfServiceRecommended (optional) * @param showInSelfService (optional) * @param unzipLocation (optional) * @return ApiResponse<CreateCustomApp201Response> * @throws ApiException if fails to make API call * @http.response.details
Response Details
Status Code Description Response Headers
201 success * Allow -
* Content-Length -
* Content-Security-Policy -
* Cross-Origin-Opener-Policy -
* Date -
* Feature-Policy -
* Referrer-Policy -
* Server -
* Vary -
* X-Content-Type-Options -
* X-Frame-Options -
*/ public ApiResponse createCustomAppWithHttpInfo(String active, String auditScript, String fileKey, String installEnforcement, String installType, String name, String postinstallScript, String preinstallScript, String restart, String selfServiceCategoryId, String selfServiceRecommended, String showInSelfService, String unzipLocation) throws ApiException { // Form parameters Map localVarFormParams = new LinkedHashMap<>(); if (active != null) { localVarFormParams.put("active", active); } if (auditScript != null) { localVarFormParams.put("audit_script", auditScript); } if (fileKey != null) { localVarFormParams.put("file_key", fileKey); } if (installEnforcement != null) { localVarFormParams.put("install_enforcement", installEnforcement); } if (installType != null) { localVarFormParams.put("install_type", installType); } if (name != null) { localVarFormParams.put("name", name); } if (postinstallScript != null) { localVarFormParams.put("postinstall_script", postinstallScript); } if (preinstallScript != null) { localVarFormParams.put("preinstall_script", preinstallScript); } if (restart != null) { localVarFormParams.put("restart", restart); } if (selfServiceCategoryId != null) { localVarFormParams.put("self_service_category_id", selfServiceCategoryId); } if (selfServiceRecommended != null) { localVarFormParams.put("self_service_recommended", selfServiceRecommended); } if (showInSelfService != null) { localVarFormParams.put("show_in_self_service", showInSelfService); } if (unzipLocation != null) { localVarFormParams.put("unzip_location", unzipLocation); } String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); String[] localVarAuthNames = new String[] {"bearerAuth"}; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("CustomAppsApi.createCustomApp", "/api/v1/library/custom-apps", "POST", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** * Delete Custom App * NOTICE: This is permanent so be careful. This endpoint sends a request to delete a specific custom app from the Kandji library. ### Request Parameters `library_item_id` (path parameter): The unique identifier of the library item. * @param libraryItemId (required) * @throws ApiException if fails to make API call * @http.response.details
Response Details
Status Code Description Response Headers
204 success * Allow -
* Content-Length -
* Content-Security-Policy -
* Cross-Origin-Opener-Policy -
* Date -
* Feature-Policy -
* Referrer-Policy -
* Server -
* Vary -
* X-Content-Type-Options -
* X-Frame-Options -
404 requested library item not found * Accept-Ranges -
* Access-Control-Allow-Origin -
* Connection -
* Content-Encoding -
* Content-Security-Policy -
* Cross-Origin-Opener-Policy -
* Date -
* Feature-Policy -
* Ratelimit-Limit -
* Ratelimit-Remaining -
* Ratelimit-Reset -
* Referrer-Policy -
* Server -
* Strict-Transport-Security -
* Vary -
* Via -
* X-Cache -
* X-Cache-Hits -
* X-Content-Type-Options -
* X-Frame-Options -
* X-Kong-Proxy-Latency -
* X-Kong-Upstream-Latency -
* X-Ratelimit-Limit-Hour -
* X-Ratelimit-Limit-Second -
* X-Ratelimit-Remaining-Hour -
* X-Ratelimit-Remaining-Second -
* X-Served-By -
* X-Timer -
* transfer-encoding -
*/ public void deleteCustomApp(String libraryItemId) throws ApiException { deleteCustomAppWithHttpInfo(libraryItemId); } /** * Delete Custom App * NOTICE: This is permanent so be careful. This endpoint sends a request to delete a specific custom app from the Kandji library. ### Request Parameters `library_item_id` (path parameter): The unique identifier of the library item. * @param libraryItemId (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details
Response Details
Status Code Description Response Headers
204 success * Allow -
* Content-Length -
* Content-Security-Policy -
* Cross-Origin-Opener-Policy -
* Date -
* Feature-Policy -
* Referrer-Policy -
* Server -
* Vary -
* X-Content-Type-Options -
* X-Frame-Options -
404 requested library item not found * Accept-Ranges -
* Access-Control-Allow-Origin -
* Connection -
* Content-Encoding -
* Content-Security-Policy -
* Cross-Origin-Opener-Policy -
* Date -
* Feature-Policy -
* Ratelimit-Limit -
* Ratelimit-Remaining -
* Ratelimit-Reset -
* Referrer-Policy -
* Server -
* Strict-Transport-Security -
* Vary -
* Via -
* X-Cache -
* X-Cache-Hits -
* X-Content-Type-Options -
* X-Frame-Options -
* X-Kong-Proxy-Latency -
* X-Kong-Upstream-Latency -
* X-Ratelimit-Limit-Hour -
* X-Ratelimit-Limit-Second -
* X-Ratelimit-Remaining-Hour -
* X-Ratelimit-Remaining-Second -
* X-Served-By -
* X-Timer -
* transfer-encoding -
*/ public ApiResponse deleteCustomAppWithHttpInfo(String libraryItemId) throws ApiException { // Check required parameters if (libraryItemId == null) { throw new ApiException(400, "Missing the required parameter 'libraryItemId' when calling deleteCustomApp"); } // Path parameters String localVarPath = "/api/v1/library/custom-apps/{library_item_id}" .replaceAll("\\{library_item_id}", apiClient.escapeString(libraryItemId.toString())); String localVarAccept = apiClient.selectHeaderAccept("text/plain"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"bearerAuth"}; return apiClient.invokeAPI("CustomAppsApi.deleteCustomApp", localVarPath, "DELETE", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** * Get Custom App * This endpoint retrieves details about a specific custom app from the Kandji library. ### Request Parameters `library_item_id` (path parameter): The unique identifier of the library item. * @param libraryItemId (required) * @return ListCustomApps200ResponseResultsInner * @throws ApiException if fails to make API call * @http.response.details
Response Details
Status Code Description Response Headers
200 success * Allow -
* Content-Length -
* Content-Security-Policy -
* Cross-Origin-Opener-Policy -
* Date -
* Feature-Policy -
* Referrer-Policy -
* Server -
* Vary -
* X-Content-Type-Options -
* X-Frame-Options -
*/ public ListCustomApps200ResponseResultsInner getCustomApp(String libraryItemId) throws ApiException { return getCustomAppWithHttpInfo(libraryItemId).getData(); } /** * Get Custom App * This endpoint retrieves details about a specific custom app from the Kandji library. ### Request Parameters `library_item_id` (path parameter): The unique identifier of the library item. * @param libraryItemId (required) * @return ApiResponse<ListCustomApps200ResponseResultsInner> * @throws ApiException if fails to make API call * @http.response.details
Response Details
Status Code Description Response Headers
200 success * Allow -
* Content-Length -
* Content-Security-Policy -
* Cross-Origin-Opener-Policy -
* Date -
* Feature-Policy -
* Referrer-Policy -
* Server -
* Vary -
* X-Content-Type-Options -
* X-Frame-Options -
*/ public ApiResponse getCustomAppWithHttpInfo(String libraryItemId) throws ApiException { // Check required parameters if (libraryItemId == null) { throw new ApiException(400, "Missing the required parameter 'libraryItemId' when calling getCustomApp"); } // Path parameters String localVarPath = "/api/v1/library/custom-apps/{library_item_id}" .replaceAll("\\{library_item_id}", apiClient.escapeString(libraryItemId.toString())); String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"bearerAuth"}; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("CustomAppsApi.getCustomApp", localVarPath, "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** * List Custom Apps * This endpoint makes a request to retrieve a list of custom apps from the Kandji library. * @param page Optional page number. Used when results exceed pagination threshold. A hard upper `limit` is set at 300 device records returned per request. (optional) * @return ListCustomApps200Response * @throws ApiException if fails to make API call * @http.response.details
Response Details
Status Code Description Response Headers
200 success * Allow -
* Content-Length -
* Content-Security-Policy -
* Cross-Origin-Opener-Policy -
* Date -
* Feature-Policy -
* Referrer-Policy -
* Server -
* Vary -
* X-Content-Type-Options -
* X-Frame-Options -
*/ public ListCustomApps200Response listCustomApps(String page) throws ApiException { return listCustomAppsWithHttpInfo(page).getData(); } /** * List Custom Apps * This endpoint makes a request to retrieve a list of custom apps from the Kandji library. * @param page Optional page number. Used when results exceed pagination threshold. A hard upper `limit` is set at 300 device records returned per request. (optional) * @return ApiResponse<ListCustomApps200Response> * @throws ApiException if fails to make API call * @http.response.details
Response Details
Status Code Description Response Headers
200 success * Allow -
* Content-Length -
* Content-Security-Policy -
* Cross-Origin-Opener-Policy -
* Date -
* Feature-Policy -
* Referrer-Policy -
* Server -
* Vary -
* X-Content-Type-Options -
* X-Frame-Options -
*/ public ApiResponse listCustomAppsWithHttpInfo(String page) throws ApiException { // Query parameters List localVarQueryParams = new ArrayList<>( apiClient.parameterToPairs("", "page", page) ); String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"bearerAuth"}; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("CustomAppsApi.listCustomApps", "/api/v1/library/custom-apps", "GET", localVarQueryParams, null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** * Update Custom App * This request allows you to update a custom app in the Kandji library. Must have already generated a `file_key` via `Create custom app` endpoint and uploaded the file to S3 using a request similar to the `Upload to S3` example. ### Request Parameters `library_item_id` (path parameter): The unique identifier of the library item. * @param libraryItemId (required) * @param name (optional) * @return UpdateCustomApp200Response * @throws ApiException if fails to make API call * @http.response.details
Response Details
Status Code Description Response Headers
200 success * Allow -
* Content-Length -
* Content-Security-Policy -
* Cross-Origin-Opener-Policy -
* Date -
* Feature-Policy -
* Referrer-Policy -
* Server -
* Vary -
* X-Content-Type-Options -
* X-Frame-Options -
*/ public UpdateCustomApp200Response updateCustomApp(String libraryItemId, String name) throws ApiException { return updateCustomAppWithHttpInfo(libraryItemId, name).getData(); } /** * Update Custom App * This request allows you to update a custom app in the Kandji library. Must have already generated a `file_key` via `Create custom app` endpoint and uploaded the file to S3 using a request similar to the `Upload to S3` example. ### Request Parameters `library_item_id` (path parameter): The unique identifier of the library item. * @param libraryItemId (required) * @param name (optional) * @return ApiResponse<UpdateCustomApp200Response> * @throws ApiException if fails to make API call * @http.response.details
Response Details
Status Code Description Response Headers
200 success * Allow -
* Content-Length -
* Content-Security-Policy -
* Cross-Origin-Opener-Policy -
* Date -
* Feature-Policy -
* Referrer-Policy -
* Server -
* Vary -
* X-Content-Type-Options -
* X-Frame-Options -
*/ public ApiResponse updateCustomAppWithHttpInfo(String libraryItemId, String name) throws ApiException { // Check required parameters if (libraryItemId == null) { throw new ApiException(400, "Missing the required parameter 'libraryItemId' when calling updateCustomApp"); } // Path parameters String localVarPath = "/api/v1/library/custom-apps/{library_item_id}" .replaceAll("\\{library_item_id}", apiClient.escapeString(libraryItemId.toString())); // Form parameters Map localVarFormParams = new LinkedHashMap<>(); if (name != null) { localVarFormParams.put("name", name); } String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); String[] localVarAuthNames = new String[] {"bearerAuth"}; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("CustomAppsApi.updateCustomApp", localVarPath, "PATCH", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** * Upload Custom App * This request retrieves the S3 upload details need for uploading the app to Amazon S3. Creates a pre-signed `post_url` to upload a new Custom App to S3. The provided `name` will be used to calculate a unique `file_key` in S3. A separate request will have to be made to the `Upload to S3` endpoint to upload the file to S3 directly using the `post_url` and `post_data` from the `Upload Custom App` response. * @throws ApiException if fails to make API call * @http.response.details
Response Details
Status Code Description Response Headers
201 success - create s3 upload * Allow -
* Content-Length -
* Content-Security-Policy -
* Cross-Origin-Opener-Policy -
* Date -
* Feature-Policy -
* Referrer-Policy -
* Server -
* Vary -
* X-Content-Type-Options -
* X-Frame-Options -
*/ public void uploadCustomApp() throws ApiException { uploadCustomAppWithHttpInfo(); } /** * Upload Custom App * This request retrieves the S3 upload details need for uploading the app to Amazon S3. Creates a pre-signed `post_url` to upload a new Custom App to S3. The provided `name` will be used to calculate a unique `file_key` in S3. A separate request will have to be made to the `Upload to S3` endpoint to upload the file to S3 directly using the `post_url` and `post_data` from the `Upload Custom App` response. * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details
Response Details
Status Code Description Response Headers
201 success - create s3 upload * Allow -
* Content-Length -
* Content-Security-Policy -
* Cross-Origin-Opener-Policy -
* Date -
* Feature-Policy -
* Referrer-Policy -
* Server -
* Vary -
* X-Content-Type-Options -
* X-Frame-Options -
*/ public ApiResponse uploadCustomAppWithHttpInfo() throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("text/plain"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); String[] localVarAuthNames = new String[] {"bearerAuth"}; return apiClient.invokeAPI("CustomAppsApi.uploadCustomApp", "/api/v1/library/custom-apps/upload", "POST", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** * Upload to S3 * Example showing separate post request to upload the file to Amazon S3. ### Request Parameters `post_url` (path parameter): The `post_url` from the `Upload custom app` response. ### Request Body For the request body, use the contents of the `post_data` object from the `Upload custom app` response and supply the path to the custom app file in the `file` request parameter. * @param _file (Required) Your file to upload (optional) * @param key Value provided by \\\"Create S3 Upload\\\" (optional) * @param policy Value provided by \\\"Create S3 Upload\\\" (optional) * @param xAmzAlgorithm Value provided by \\\"Create S3 Upload\\\" (optional) * @param xAmzCredential Value provided by \\\"Create S3 Upload\\\" (optional) * @param xAmzDate Value provided by \\\"Create S3 Upload\\\" (optional) * @param xAmzSecurityToken Value provided by \\\"Create S3 Upload\\\" (optional) * @param xAmzSignature Value provided by \\\"Create S3 Upload\\\" (optional) * @throws ApiException if fails to make API call * @http.response.details
Response Details
Status Code Description Response Headers
204 success * Date -
* ETag -
* Location -
* Server -
* x-amz-id-2 -
* x-amz-request-id -
* x-amz-server-side-encryption -
* x-amz-version-id -
*/ public void uploadToS3(File _file, String key, String policy, String xAmzAlgorithm, String xAmzCredential, String xAmzDate, String xAmzSecurityToken, String xAmzSignature) throws ApiException { uploadToS3WithHttpInfo(_file, key, policy, xAmzAlgorithm, xAmzCredential, xAmzDate, xAmzSecurityToken, xAmzSignature); } /** * Upload to S3 * Example showing separate post request to upload the file to Amazon S3. ### Request Parameters `post_url` (path parameter): The `post_url` from the `Upload custom app` response. ### Request Body For the request body, use the contents of the `post_data` object from the `Upload custom app` response and supply the path to the custom app file in the `file` request parameter. * @param _file (Required) Your file to upload (optional) * @param key Value provided by \\\"Create S3 Upload\\\" (optional) * @param policy Value provided by \\\"Create S3 Upload\\\" (optional) * @param xAmzAlgorithm Value provided by \\\"Create S3 Upload\\\" (optional) * @param xAmzCredential Value provided by \\\"Create S3 Upload\\\" (optional) * @param xAmzDate Value provided by \\\"Create S3 Upload\\\" (optional) * @param xAmzSecurityToken Value provided by \\\"Create S3 Upload\\\" (optional) * @param xAmzSignature Value provided by \\\"Create S3 Upload\\\" (optional) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details
Response Details
Status Code Description Response Headers
204 success * Date -
* ETag -
* Location -
* Server -
* x-amz-id-2 -
* x-amz-request-id -
* x-amz-server-side-encryption -
* x-amz-version-id -
*/ public ApiResponse uploadToS3WithHttpInfo(File _file, String key, String policy, String xAmzAlgorithm, String xAmzCredential, String xAmzDate, String xAmzSecurityToken, String xAmzSignature) throws ApiException { // Form parameters Map localVarFormParams = new LinkedHashMap<>(); if (_file != null) { localVarFormParams.put("file", _file); } if (key != null) { localVarFormParams.put("key", key); } if (policy != null) { localVarFormParams.put("policy", policy); } if (xAmzAlgorithm != null) { localVarFormParams.put("x-amz-algorithm", xAmzAlgorithm); } if (xAmzCredential != null) { localVarFormParams.put("x-amz-credential", xAmzCredential); } if (xAmzDate != null) { localVarFormParams.put("x-amz-date", xAmzDate); } if (xAmzSecurityToken != null) { localVarFormParams.put("x-amz-security-token", xAmzSecurityToken); } if (xAmzSignature != null) { localVarFormParams.put("x-amz-signature", xAmzSignature); } String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); String[] localVarAuthNames = new String[] {"bearerAuth"}; return apiClient.invokeAPI("CustomAppsApi.uploadToS3", "/", "POST", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null, false); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy