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

net.leanix.api.BookmarksApi Maven / Gradle / Ivy

There is a newer version: 3.9.32
Show newest version
package net.leanix.api;

import net.leanix.api.common.ApiException;
import net.leanix.api.common.ApiClient;
import net.leanix.api.common.Configuration;
import net.leanix.api.common.Pair;

import javax.ws.rs.core.GenericType;

import net.leanix.api.models.Bookmark;
import net.leanix.api.models.BookmarkListResponse;
import net.leanix.api.models.BookmarkResponse;
import net.leanix.api.models.BookmarkWorkingCopy;
import java.util.UUID;

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


public class BookmarksApi {
  private ApiClient apiClient;

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

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

  public ApiClient getApiClient() {
    return apiClient;
  }

  public void setApiClient(ApiClient apiClient) {
    this.apiClient = apiClient;
  }

  /**
   * createBookmark
   * Saves a bookmark in the database
   * @param body bookmark (optional)
   * @return BookmarkResponse
   * @throws ApiException if fails to make API call
   */
  public BookmarkResponse createBookmark(Bookmark body) throws ApiException {
    Object localVarPostBody = body;
    
    // create path and map variables
    String localVarPath = "/bookmarks".replaceAll("\\{format\\}","json");

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = 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[] { "token" };

    GenericType localVarReturnType = new GenericType() {};
    return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
  /**
   * deleteBookmark
   * Deletes a bookmark identified by the given ID
   * @param id  (required)
   * @throws ApiException if fails to make API call
   */
  public void deleteBookmark(UUID id) throws ApiException {
    Object localVarPostBody = null;
    
    // verify the required parameter 'id' is set
    if (id == null) {
      throw new ApiException(400, "Missing the required parameter 'id' when calling deleteBookmark");
    }
    
    // create path and map variables
    String localVarPath = "/bookmarks/{id}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = 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[] { "token" };


    apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
  }
  /**
   * deleteWorkingCopy
   * Deletes a working copy for a bookmark stored in the database
   * @param id  (required)
   * @return BookmarkResponse
   * @throws ApiException if fails to make API call
   */
  public BookmarkResponse deleteWorkingCopy(UUID id) throws ApiException {
    Object localVarPostBody = null;
    
    // verify the required parameter 'id' is set
    if (id == null) {
      throw new ApiException(400, "Missing the required parameter 'id' when calling deleteWorkingCopy");
    }
    
    // create path and map variables
    String localVarPath = "/bookmarks/{id}/workingCopy".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = 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[] { "token" };

    GenericType localVarReturnType = new GenericType() {};
    return apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
  /**
   * getBookmark
   * Retrieves a bookmark by ID
   * @param id  (required)
   * @return BookmarkResponse
   * @throws ApiException if fails to make API call
   */
  public BookmarkResponse getBookmark(UUID id) throws ApiException {
    Object localVarPostBody = null;
    
    // verify the required parameter 'id' is set
    if (id == null) {
      throw new ApiException(400, "Missing the required parameter 'id' when calling getBookmark");
    }
    
    // create path and map variables
    String localVarPath = "/bookmarks/{id}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = 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[] { "token" };

    GenericType localVarReturnType = new GenericType() {};
    return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
  /**
   * getBookmarks
   * Retrieves all stored bookmarks a user can read.
   * @param bookmarkType Specifies the bookmark type (required)
   * @param groupKey A key used to separate bookmarks within the same query type (optional)
   * @param sharingType Specifies the sharing type which the returned bookmarks need to have (optional)
   * @return BookmarkListResponse
   * @throws ApiException if fails to make API call
   */
  public BookmarkListResponse getBookmarks(String bookmarkType, String groupKey, String sharingType) throws ApiException {
    Object localVarPostBody = null;
    
    // verify the required parameter 'bookmarkType' is set
    if (bookmarkType == null) {
      throw new ApiException(400, "Missing the required parameter 'bookmarkType' when calling getBookmarks");
    }
    
    // create path and map variables
    String localVarPath = "/bookmarks".replaceAll("\\{format\\}","json");

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarFormParams = new HashMap();

    localVarQueryParams.addAll(apiClient.parameterToPairs("", "bookmarkType", bookmarkType));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "groupKey", groupKey));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "sharingType", sharingType));

    
    
    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[] { "token" };

    GenericType localVarReturnType = new GenericType() {};
    return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
  /**
   * updateBookmark
   * Updates a bookmark stored in the database
   * @param id  (required)
   * @param body bookmark (optional)
   * @return BookmarkResponse
   * @throws ApiException if fails to make API call
   */
  public BookmarkResponse updateBookmark(UUID id, Bookmark body) throws ApiException {
    Object localVarPostBody = body;
    
    // verify the required parameter 'id' is set
    if (id == null) {
      throw new ApiException(400, "Missing the required parameter 'id' when calling updateBookmark");
    }
    
    // create path and map variables
    String localVarPath = "/bookmarks/{id}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = 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[] { "token" };

    GenericType localVarReturnType = new GenericType() {};
    return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
  /**
   * updateWorkingCopy
   * Updates a working copy for a bookmark stored in the database
   * @param id  (required)
   * @param body workingCopy (optional)
   * @return BookmarkResponse
   * @throws ApiException if fails to make API call
   */
  public BookmarkResponse updateWorkingCopy(UUID id, BookmarkWorkingCopy body) throws ApiException {
    Object localVarPostBody = body;
    
    // verify the required parameter 'id' is set
    if (id == null) {
      throw new ApiException(400, "Missing the required parameter 'id' when calling updateWorkingCopy");
    }
    
    // create path and map variables
    String localVarPath = "/bookmarks/{id}/workingCopy".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = 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[] { "token" };

    GenericType localVarReturnType = new GenericType() {};
    return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy