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

net.leanix.mtm.api.InactiveApi Maven / Gradle / Ivy

package net.leanix.mtm.api;

import net.leanix.dropkit.apiclient.ApiException;
import net.leanix.dropkit.apiclient.ApiClient;
import net.leanix.dropkit.apiclient.Configuration;
import net.leanix.dropkit.apiclient.Pair;

import javax.ws.rs.core.GenericType;

import net.leanix.mtm.api.models.UserListResponse;

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


public class InactiveApi {
  private ApiClient apiClient;

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

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

  public ApiClient getApiClient() {
    return apiClient;
  }

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

  /**
   * inactive
   * List inactive users.
   * @param workspaceId The id of the workspace to query for inactive users. (required)
   * @param alpha The alpha value for significance, when classifying users as inactive. (optional, default to 0.01)
   * @param minDaysUntilAbsent Minimum amount of days, when a regular user is seen as inactive regardless of usual login behavior. (optional, default to 28)
   * @return UserListResponse
   * @throws ApiException if fails to make API call
   */
  public UserListResponse getInactiveUsers(String workspaceId, Double alpha, Integer minDaysUntilAbsent) throws ApiException {
    Object localVarPostBody = null;
    
    // verify the required parameter 'workspaceId' is set
    if (workspaceId == null) {
      throw new ApiException(400, "Missing the required parameter 'workspaceId' when calling getInactiveUsers");
    }
    
    // create path and map variables
    String localVarPath = "/inactive";

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

    localVarQueryParams.addAll(apiClient.parameterToPairs("", "workspaceId", workspaceId));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "alpha", alpha));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "minDaysUntilAbsent", minDaysUntilAbsent));

    
    
    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);
      }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy