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

com.seeq.api.FoldersApi Maven / Gradle / Ivy

There is a newer version: 66.0.0-v202407310200
Show newest version
package com.seeq.api;

import com.seeq.ApiException;
import com.seeq.ApiClient;
import com.seeq.Configuration;
import com.seeq.model.*;
import com.seeq.Pair;

import javax.ws.rs.core.GenericType;
import javax.ws.rs.ProcessingException;

import com.seeq.model.ArchiveOutputV1;
import com.seeq.model.FolderInputV1;
import com.seeq.model.FolderNavigationOutputV1;
import com.seeq.model.FolderOutputV1;
import java.util.UUID;
import com.seeq.model.WorkbenchItemOutputListV1;


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

  public class FoldersApi {
  private ApiClient apiClient;
  private long retryTimeout = 5_000; // Default of 5 seconds

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

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

  public void setRetryTimeout(long retryTimeout) {
    this.retryTimeout = retryTimeout;
  }

  public long getRetryTimeout() {
    return this.retryTimeout;
  }

  public ApiClient getApiClient() {
  return apiClient;
  }

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

    /**
    * Archive a folder and all of its content
    * 
      * @param folderId ID of the folder to archive (required)
      * @return ArchiveOutputV1
    * @throws ApiException if fails to make API call
    */
    public ArchiveOutputV1 archiveFolder(String folderId) throws ApiException {
        ApiClient.ApiResponse localVarResponse = archiveFolderWithHttpInfo(folderId);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Archive a folder and all of its content
    * 
      * @param folderId ID of the folder to archive (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse archiveFolderWithHttpInfo(String folderId) throws ApiException {
    Object localVarPostBody = null;
      // verify the required parameter 'folderId' is set
      if (folderId == null) {
      throw new ApiException(400, "Missing the required parameter 'folderId' when calling archiveFolder");
      }
    // create path and map variables
    String localVarPath = "/folders/{folderId}"
      .replaceAll("\\{" + "folderId" + "\\}", apiClient.escapeString(folderId.toString()));

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


    
    
      final String[] localVarAccepts = {
    "application/vnd.seeq.v1+json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

      final String[] localVarContentTypes = {
    
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

      String[] localVarAuthNames = new String[] { "api_key" };

      long apiClientInvocationTime = System.currentTimeMillis();
      while(true) {
        try {
        GenericType localVarReturnType = new GenericType() {};
        return apiClient.invokeAPIWithHttpInfo(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
          // Possible exceptions:
          // ===================
          // * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
          //    during conversion of the response entity data to an instance of a particular Java type).
          // * ProcessingException - in case the request processing or subsequent I/O operation fails.
          // * WebApplicationException - in case the response status code of the response returned by the server is not
          //    successful and the specified response type is not Response.
          // * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
          //    in ApiException(s)
        } catch (ApiException | ProcessingException e) {
          if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
            long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
            if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
              continue;
            }
          }
          throw e;
        }
      } // while
      }
    /**
    * Create a folder
    * 
      * @param body Folder information (required)
      * @return FolderOutputV1
    * @throws ApiException if fails to make API call
    */
    public FolderOutputV1 createFolder(FolderInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = createFolderWithHttpInfo(body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Create a folder
    * 
      * @param body Folder information (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse createFolderWithHttpInfo(FolderInputV1 body) throws ApiException {
    Object localVarPostBody = body;
      // verify the required parameter 'body' is set
      if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling createFolder");
      }
    // create path and map variables
    String localVarPath = "/folders";

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


    
    
      final String[] localVarAccepts = {
    "application/vnd.seeq.v1+json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

      final String[] localVarContentTypes = {
    "application/vnd.seeq.v1+json"
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

      String[] localVarAuthNames = new String[] { "api_key" };

      long apiClientInvocationTime = System.currentTimeMillis();
      while(true) {
        try {
        GenericType localVarReturnType = new GenericType() {};
        return apiClient.invokeAPIWithHttpInfo(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
          // Possible exceptions:
          // ===================
          // * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
          //    during conversion of the response entity data to an instance of a particular Java type).
          // * ProcessingException - in case the request processing or subsequent I/O operation fails.
          // * WebApplicationException - in case the response status code of the response returned by the server is not
          //    successful and the specified response type is not Response.
          // * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
          //    in ApiException(s)
        } catch (ApiException | ProcessingException e) {
          if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
            long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
            if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
              continue;
            }
          }
          throw e;
        }
      } // while
      }
    /**
    * Get navigation context for a folder. 
    * 
      * @param folderId ID of the folder to retrieve. (required)
      * @param root What sharing category results should be returned for (optional)
      * @return FolderNavigationOutputV1
    * @throws ApiException if fails to make API call
    */
    public FolderNavigationOutputV1 getAncestors(String folderId, String root) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getAncestorsWithHttpInfo(folderId, root);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get navigation context for a folder. 
    * 
      * @param folderId ID of the folder to retrieve. (required)
      * @param root What sharing category results should be returned for (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getAncestorsWithHttpInfo(String folderId, String root) throws ApiException {
    Object localVarPostBody = null;
      // verify the required parameter 'folderId' is set
      if (folderId == null) {
      throw new ApiException(400, "Missing the required parameter 'folderId' when calling getAncestors");
      }
    // create path and map variables
    String localVarPath = "/folders/{folderId}/ancestors"
      .replaceAll("\\{" + "folderId" + "\\}", apiClient.escapeString(folderId.toString()));

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

      localVarQueryParams.addAll(apiClient.parameterToPairs("", "root", root));

    
    
      final String[] localVarAccepts = {
    "application/vnd.seeq.v1+json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

      final String[] localVarContentTypes = {
    
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

      String[] localVarAuthNames = new String[] { "api_key" };

      long apiClientInvocationTime = System.currentTimeMillis();
      while(true) {
        try {
        GenericType localVarReturnType = new GenericType() {};
        return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
          // Possible exceptions:
          // ===================
          // * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
          //    during conversion of the response entity data to an instance of a particular Java type).
          // * ProcessingException - in case the request processing or subsequent I/O operation fails.
          // * WebApplicationException - in case the response status code of the response returned by the server is not
          //    successful and the specified response type is not Response.
          // * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
          //    in ApiException(s)
        } catch (ApiException | ProcessingException e) {
          if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
            long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
            if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
              continue;
            }
          }
          throw e;
        }
      } // while
      }
    /**
    * Get information about a folder
    * 
      * @param folderId ID of the folder to retrieve. Special values of 'mine', 'corporate', or 'users' (admins only) fetch the authenticated user's home folder, the corporate folder, or the folder of all home folders, respectively. (required)
      * @return FolderOutputV1
    * @throws ApiException if fails to make API call
    */
    public FolderOutputV1 getFolder(String folderId) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getFolderWithHttpInfo(folderId);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get information about a folder
    * 
      * @param folderId ID of the folder to retrieve. Special values of 'mine', 'corporate', or 'users' (admins only) fetch the authenticated user's home folder, the corporate folder, or the folder of all home folders, respectively. (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getFolderWithHttpInfo(String folderId) throws ApiException {
    Object localVarPostBody = null;
      // verify the required parameter 'folderId' is set
      if (folderId == null) {
      throw new ApiException(400, "Missing the required parameter 'folderId' when calling getFolder");
      }
    // create path and map variables
    String localVarPath = "/folders/{folderId}"
      .replaceAll("\\{" + "folderId" + "\\}", apiClient.escapeString(folderId.toString()));

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


    
    
      final String[] localVarAccepts = {
    "application/vnd.seeq.v1+json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

      final String[] localVarContentTypes = {
    
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

      String[] localVarAuthNames = new String[] { "api_key" };

      long apiClientInvocationTime = System.currentTimeMillis();
      while(true) {
        try {
        GenericType localVarReturnType = new GenericType() {};
        return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
          // Possible exceptions:
          // ===================
          // * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
          //    during conversion of the response entity data to an instance of a particular Java type).
          // * ProcessingException - in case the request processing or subsequent I/O operation fails.
          // * WebApplicationException - in case the response status code of the response returned by the server is not
          //    successful and the specified response type is not Response.
          // * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
          //    in ApiException(s)
        } catch (ApiException | ProcessingException e) {
          if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
            long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
            if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
              continue;
            }
          }
          throw e;
        }
      } // while
      }
    /**
    * Get all root folders and workbooks, or folder content if a parent folder id is specified.
    * 
      * @param filter If set to 'mine' or 'owner', only workbench items under the current user's home folder will be returned. If set to 'public' only workbench items shared with the Everyone group will be returned, excluding items under the corporate folder. If set to 'sharedOrPublic' only workbench items shared with the current user or a group they belong to are returned, excluding items under the corporate folder. If set to 'sharedDirectlyWithMe' only workbench items directly shared with the current user will be returned, excluding items under the corporate folder and items shared with groups the user belongs to. If set to 'shared' only workbench items shared with the current user or a group they belong to (except the Everyone group) are returned, excluding items under the corporate folder. If set to 'corporate', only workbench items under the corporate folder are returned. If set to 'users', only items under other user's home folders are returned. If set to 'all' (or not specified), all workbench items the current user has access to will be returned. (optional, default to all)
      * @param userId The user ID to return folders for, defaults to the current user if not specified. Only an admin user is allowed to specify a user ID. (optional)
      * @param isArchived When true, returns only archived workbench items. (optional, default to false)
      * @param sortOrder A field by which to order the folders followed by a space and 'asc' or 'desc'. Field name can be one of: createdAt, updatedAt, name, owner (optional, default to createdAt asc)
      * @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
      * @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
      * @param onlyPinned When true, returns only pinned workbench items are returned. The given folderId is not applied. (optional, default to false)
      * @param folderId The folder to return the content of. If not specified, only root folders are returned unless filtering to specific IDs, filtering to pinned or archived items, sorting by last opened timestamp, or a text search is provided. (optional)
      * @param ids The IDs of items to return. (optional)
      * @param types The types of items to return. (optional)
      * @param textSearch Search text by which to filter items' names. (optional)
      * @param isExact If true, uses the exact query terms supplied by the user instead of stemming the query to its root words (optional, default to false)
      * @param root The highest ancestor that items should have, if possible (optional)
      * @param searchFields Search by name, description, or document body.  Searches name by default when no field is supplied (optional)
      * @param creatorIds List of creator IDs to filter on (optional)
      * @param ownerIds List of owner IDs to filter on (optional)
      * @param locations List of locations to search under, may be 'mine', 'others', or 'corporate'. 'mine' searches all items under the current user's home folder. 'others' searches items under home folders belonging to all users other than the current user. 'corporate' searches the corporate folder, if enabled. Values may be used together. No values searches all locations. (optional)
      * @param accessStatuses List of access statuses to search by, may be 'public', 'groups', or 'directly'. 'public' searches items shared with the Everyone group, if enabled. 'groups' searches items shared with groups the current user belongs to. 'directly' searches items directly accessible by the current user. No values searches all access statuses. (optional)
      * @return WorkbenchItemOutputListV1
    * @throws ApiException if fails to make API call
    */
    public WorkbenchItemOutputListV1 getFolders(String filter, String userId, Boolean isArchived, String sortOrder, Integer offset, Integer limit, Boolean onlyPinned, String folderId, List ids, List types, String textSearch, Boolean isExact, String root, List searchFields, List creatorIds, List ownerIds, List locations, List accessStatuses) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getFoldersWithHttpInfo(filter, userId, isArchived, sortOrder, offset, limit, onlyPinned, folderId, ids, types, textSearch, isExact, root, searchFields, creatorIds, ownerIds, locations, accessStatuses);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get all root folders and workbooks, or folder content if a parent folder id is specified.
    * 
      * @param filter If set to 'mine' or 'owner', only workbench items under the current user's home folder will be returned. If set to 'public' only workbench items shared with the Everyone group will be returned, excluding items under the corporate folder. If set to 'sharedOrPublic' only workbench items shared with the current user or a group they belong to are returned, excluding items under the corporate folder. If set to 'sharedDirectlyWithMe' only workbench items directly shared with the current user will be returned, excluding items under the corporate folder and items shared with groups the user belongs to. If set to 'shared' only workbench items shared with the current user or a group they belong to (except the Everyone group) are returned, excluding items under the corporate folder. If set to 'corporate', only workbench items under the corporate folder are returned. If set to 'users', only items under other user's home folders are returned. If set to 'all' (or not specified), all workbench items the current user has access to will be returned. (optional, default to all)
      * @param userId The user ID to return folders for, defaults to the current user if not specified. Only an admin user is allowed to specify a user ID. (optional)
      * @param isArchived When true, returns only archived workbench items. (optional, default to false)
      * @param sortOrder A field by which to order the folders followed by a space and 'asc' or 'desc'. Field name can be one of: createdAt, updatedAt, name, owner (optional, default to createdAt asc)
      * @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
      * @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
      * @param onlyPinned When true, returns only pinned workbench items are returned. The given folderId is not applied. (optional, default to false)
      * @param folderId The folder to return the content of. If not specified, only root folders are returned unless filtering to specific IDs, filtering to pinned or archived items, sorting by last opened timestamp, or a text search is provided. (optional)
      * @param ids The IDs of items to return. (optional)
      * @param types The types of items to return. (optional)
      * @param textSearch Search text by which to filter items' names. (optional)
      * @param isExact If true, uses the exact query terms supplied by the user instead of stemming the query to its root words (optional, default to false)
      * @param root The highest ancestor that items should have, if possible (optional)
      * @param searchFields Search by name, description, or document body.  Searches name by default when no field is supplied (optional)
      * @param creatorIds List of creator IDs to filter on (optional)
      * @param ownerIds List of owner IDs to filter on (optional)
      * @param locations List of locations to search under, may be 'mine', 'others', or 'corporate'. 'mine' searches all items under the current user's home folder. 'others' searches items under home folders belonging to all users other than the current user. 'corporate' searches the corporate folder, if enabled. Values may be used together. No values searches all locations. (optional)
      * @param accessStatuses List of access statuses to search by, may be 'public', 'groups', or 'directly'. 'public' searches items shared with the Everyone group, if enabled. 'groups' searches items shared with groups the current user belongs to. 'directly' searches items directly accessible by the current user. No values searches all access statuses. (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getFoldersWithHttpInfo(String filter, String userId, Boolean isArchived, String sortOrder, Integer offset, Integer limit, Boolean onlyPinned, String folderId, List ids, List types, String textSearch, Boolean isExact, String root, List searchFields, List creatorIds, List ownerIds, List locations, List accessStatuses) throws ApiException {
    Object localVarPostBody = null;
    // create path and map variables
    String localVarPath = "/folders";

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

      localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "userId", userId));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "isArchived", isArchived));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "sortOrder", sortOrder));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "onlyPinned", onlyPinned));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "folderId", folderId));
      localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "ids", ids));
      localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "types", types));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "textSearch", textSearch));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "isExact", isExact));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "root", root));
      localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "searchFields", searchFields));
      localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "creatorIds", creatorIds));
      localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "ownerIds", ownerIds));
      localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "locations", locations));
      localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "accessStatuses", accessStatuses));

    
    
      final String[] localVarAccepts = {
    "application/vnd.seeq.v1+json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

      final String[] localVarContentTypes = {
    
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

      String[] localVarAuthNames = new String[] { "api_key" };

      long apiClientInvocationTime = System.currentTimeMillis();
      while(true) {
        try {
        GenericType localVarReturnType = new GenericType() {};
        return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
          // Possible exceptions:
          // ===================
          // * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
          //    during conversion of the response entity data to an instance of a particular Java type).
          // * ProcessingException - in case the request processing or subsequent I/O operation fails.
          // * WebApplicationException - in case the response status code of the response returned by the server is not
          //    successful and the specified response type is not Response.
          // * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
          //    in ApiException(s)
        } catch (ApiException | ProcessingException e) {
          if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
            long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
            if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
              continue;
            }
          }
          throw e;
        }
      } // while
      }
    /**
    * Get subfolders of a folder. 
    * 
      * @param folderId ID of the folder to retrieve. Special values of 'mine', 'corporate', 'sharedOrPublic', or 'users' can be used to fetch the top level categories. (required)
      * @param root What sharing category results should be returned for (optional)
      * @return FolderNavigationOutputV1
    * @throws ApiException if fails to make API call
    */
    public FolderNavigationOutputV1 getSubfolders(String folderId, String root) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getSubfoldersWithHttpInfo(folderId, root);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get subfolders of a folder. 
    * 
      * @param folderId ID of the folder to retrieve. Special values of 'mine', 'corporate', 'sharedOrPublic', or 'users' can be used to fetch the top level categories. (required)
      * @param root What sharing category results should be returned for (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getSubfoldersWithHttpInfo(String folderId, String root) throws ApiException {
    Object localVarPostBody = null;
      // verify the required parameter 'folderId' is set
      if (folderId == null) {
      throw new ApiException(400, "Missing the required parameter 'folderId' when calling getSubfolders");
      }
    // create path and map variables
    String localVarPath = "/folders/{folderId}/subfolders"
      .replaceAll("\\{" + "folderId" + "\\}", apiClient.escapeString(folderId.toString()));

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

      localVarQueryParams.addAll(apiClient.parameterToPairs("", "root", root));

    
    
      final String[] localVarAccepts = {
    "application/vnd.seeq.v1+json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

      final String[] localVarContentTypes = {
    
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

      String[] localVarAuthNames = new String[] { "api_key" };

      long apiClientInvocationTime = System.currentTimeMillis();
      while(true) {
        try {
        GenericType localVarReturnType = new GenericType() {};
        return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
          // Possible exceptions:
          // ===================
          // * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
          //    during conversion of the response entity data to an instance of a particular Java type).
          // * ProcessingException - in case the request processing or subsequent I/O operation fails.
          // * WebApplicationException - in case the response status code of the response returned by the server is not
          //    successful and the specified response type is not Response.
          // * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
          //    in ApiException(s)
        } catch (ApiException | ProcessingException e) {
          if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
            long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
            if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
              continue;
            }
          }
          throw e;
        }
      } // while
      }
    /**
    * Move specified item to specified folder
    * 
      * @param folderId ID of folder to move item to. Special values of 'mine' or 'corporate' move the item to the authenticated user's home folder or the corporate folder, respectively. (required)
      * @param itemId ID of item to move to folder (required)
      * @return FolderOutputV1
    * @throws ApiException if fails to make API call
    */
    public FolderOutputV1 moveItemToFolder(String folderId, String itemId) throws ApiException {
        ApiClient.ApiResponse localVarResponse = moveItemToFolderWithHttpInfo(folderId, itemId);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Move specified item to specified folder
    * 
      * @param folderId ID of folder to move item to. Special values of 'mine' or 'corporate' move the item to the authenticated user's home folder or the corporate folder, respectively. (required)
      * @param itemId ID of item to move to folder (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse moveItemToFolderWithHttpInfo(String folderId, String itemId) throws ApiException {
    Object localVarPostBody = null;
      // verify the required parameter 'folderId' is set
      if (folderId == null) {
      throw new ApiException(400, "Missing the required parameter 'folderId' when calling moveItemToFolder");
      }
      // verify the required parameter 'itemId' is set
      if (itemId == null) {
      throw new ApiException(400, "Missing the required parameter 'itemId' when calling moveItemToFolder");
      }
    // create path and map variables
    String localVarPath = "/folders/{folderId}/{itemId}"
      .replaceAll("\\{" + "folderId" + "\\}", apiClient.escapeString(folderId.toString()))
      .replaceAll("\\{" + "itemId" + "\\}", apiClient.escapeString(itemId.toString()));

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


    
    
      final String[] localVarAccepts = {
    "application/vnd.seeq.v1+json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

      final String[] localVarContentTypes = {
    "application/vnd.seeq.v1+json"
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

      String[] localVarAuthNames = new String[] { "api_key" };

      long apiClientInvocationTime = System.currentTimeMillis();
      while(true) {
        try {
        GenericType localVarReturnType = new GenericType() {};
        return apiClient.invokeAPIWithHttpInfo(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
          // Possible exceptions:
          // ===================
          // * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
          //    during conversion of the response entity data to an instance of a particular Java type).
          // * ProcessingException - in case the request processing or subsequent I/O operation fails.
          // * WebApplicationException - in case the response status code of the response returned by the server is not
          //    successful and the specified response type is not Response.
          // * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
          //    in ApiException(s)
        } catch (ApiException | ProcessingException e) {
          if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
            long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
            if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
              continue;
            }
          }
          throw e;
        }
      } // while
      }
    /**
    * Remove specified item from specified folder. The item will be moved to the root level.
    * 
      * @param folderId ID of folder to remove item from (required)
      * @param itemId ID of item to remove from folder (required)
      * @return FolderOutputV1
    * @throws ApiException if fails to make API call
    */
    public FolderOutputV1 removeItemFromFolder(String folderId, String itemId) throws ApiException {
        ApiClient.ApiResponse localVarResponse = removeItemFromFolderWithHttpInfo(folderId, itemId);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Remove specified item from specified folder. The item will be moved to the root level.
    * 
      * @param folderId ID of folder to remove item from (required)
      * @param itemId ID of item to remove from folder (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse removeItemFromFolderWithHttpInfo(String folderId, String itemId) throws ApiException {
    Object localVarPostBody = null;
      // verify the required parameter 'folderId' is set
      if (folderId == null) {
      throw new ApiException(400, "Missing the required parameter 'folderId' when calling removeItemFromFolder");
      }
      // verify the required parameter 'itemId' is set
      if (itemId == null) {
      throw new ApiException(400, "Missing the required parameter 'itemId' when calling removeItemFromFolder");
      }
    // create path and map variables
    String localVarPath = "/folders/{folderId}/{itemId}"
      .replaceAll("\\{" + "folderId" + "\\}", apiClient.escapeString(folderId.toString()))
      .replaceAll("\\{" + "itemId" + "\\}", apiClient.escapeString(itemId.toString()));

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


    
    
      final String[] localVarAccepts = {
    "application/vnd.seeq.v1+json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

      final String[] localVarContentTypes = {
    
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

      String[] localVarAuthNames = new String[] { "api_key" };

      long apiClientInvocationTime = System.currentTimeMillis();
      while(true) {
        try {
        GenericType localVarReturnType = new GenericType() {};
        return apiClient.invokeAPIWithHttpInfo(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
          // Possible exceptions:
          // ===================
          // * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
          //    during conversion of the response entity data to an instance of a particular Java type).
          // * ProcessingException - in case the request processing or subsequent I/O operation fails.
          // * WebApplicationException - in case the response status code of the response returned by the server is not
          //    successful and the specified response type is not Response.
          // * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
          //    in ApiException(s)
        } catch (ApiException | ProcessingException e) {
          if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
            long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
            if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
              continue;
            }
          }
          throw e;
        }
      } // while
      }
    }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy