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

org.projectodd.openwhisk.api.PackagesApi Maven / Gradle / Ivy

There is a newer version: 0.8
Show newest version
package org.projectodd.openwhisk.api;

import org.projectodd.openwhisk.invoker.ApiException;
import org.projectodd.openwhisk.invoker.ApiClient;
import org.projectodd.openwhisk.invoker.Configuration;
import org.projectodd.openwhisk.invoker.Pair;

import javax.ws.rs.core.GenericType;

import org.projectodd.openwhisk.model.ActionPut;
import org.projectodd.openwhisk.model.EntityBrief;
import org.projectodd.openwhisk.model.ErrorMessage;
import org.projectodd.openwhisk.model.ModelPackage;
import org.projectodd.openwhisk.model.PackagePut;

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


public class PackagesApi {
  private ApiClient apiClient;

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

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

  public ApiClient getApiClient() {
    return apiClient;
  }

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

  /**
   * Delete a package
   * Delete a package
   * @param namespace The entity namespace (required)
   * @param packageName Name of package (required)
   * @throws ApiException if fails to make API call
   */
  public void deletePackage(String namespace, String packageName) throws ApiException {
    Object localVarPostBody = null;
    
    // verify the required parameter 'namespace' is set
    if (namespace == null) {
      throw new ApiException(400, "Missing the required parameter 'namespace' when calling deletePackage");
    }
    
    // verify the required parameter 'packageName' is set
    if (packageName == null) {
      throw new ApiException(400, "Missing the required parameter 'packageName' when calling deletePackage");
    }
    
    // create path and map variables
    String localVarPath = "/namespaces/{namespace}/packages/{packageName}"
      .replaceAll("\\{" + "namespace" + "\\}", apiClient.escapeString(namespace.toString()))
      .replaceAll("\\{" + "packageName" + "\\}", apiClient.escapeString(packageName.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 = {
      
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

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


    apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
  }
  /**
   * Get all packages
   * Get all packages
   * @param namespace The entity namespace (required)
   * @param _public Include publicly shared entitles in the result. (optional)
   * @param limit Number of entities to include in the result (0-200). The default limit is 30. A value of 0 sets the limit to the maximum. (optional)
   * @param skip Number of entities to skip in the result. (optional)
   * @return List<EntityBrief>
   * @throws ApiException if fails to make API call
   */
  public List getAlPackages(String namespace, Boolean _public, Integer limit, Integer skip) throws ApiException {
    Object localVarPostBody = null;
    
    // verify the required parameter 'namespace' is set
    if (namespace == null) {
      throw new ApiException(400, "Missing the required parameter 'namespace' when calling getAlPackages");
    }
    
    // create path and map variables
    String localVarPath = "/namespaces/{namespace}/packages"
      .replaceAll("\\{" + "namespace" + "\\}", apiClient.escapeString(namespace.toString()));

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

    localVarQueryParams.addAll(apiClient.parameterToPairs("", "public", _public));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "skip", skip));

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

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

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

    GenericType> localVarReturnType = new GenericType>() {};
    return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
  /**
   * Get package information
   * Get package information.
   * @param namespace The entity namespace (required)
   * @param packageName Name of package to fetch (required)
   * @return ModelPackage
   * @throws ApiException if fails to make API call
   */
  public ModelPackage getPackageByName(String namespace, String packageName) throws ApiException {
    Object localVarPostBody = null;
    
    // verify the required parameter 'namespace' is set
    if (namespace == null) {
      throw new ApiException(400, "Missing the required parameter 'namespace' when calling getPackageByName");
    }
    
    // verify the required parameter 'packageName' is set
    if (packageName == null) {
      throw new ApiException(400, "Missing the required parameter 'packageName' when calling getPackageByName");
    }
    
    // create path and map variables
    String localVarPath = "/namespaces/{namespace}/packages/{packageName}"
      .replaceAll("\\{" + "namespace" + "\\}", apiClient.escapeString(namespace.toString()))
      .replaceAll("\\{" + "packageName" + "\\}", apiClient.escapeString(packageName.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 = {
      
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

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

    GenericType localVarReturnType = new GenericType() {};
    return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
  /**
   * Create or update a package
   * Create or update a package
   * @param namespace The entity namespace (required)
   * @param packageName Name of package (required)
   * @param _package The package being updated (required)
   * @param overwrite Overwrite item if it exists. Default is false. (optional)
   * @return ActionPut
   * @throws ApiException if fails to make API call
   */
  public ActionPut updatePackage(String namespace, String packageName, PackagePut _package, Boolean overwrite) throws ApiException {
    Object localVarPostBody = _package;
    
    // verify the required parameter 'namespace' is set
    if (namespace == null) {
      throw new ApiException(400, "Missing the required parameter 'namespace' when calling updatePackage");
    }
    
    // verify the required parameter 'packageName' is set
    if (packageName == null) {
      throw new ApiException(400, "Missing the required parameter 'packageName' when calling updatePackage");
    }
    
    // verify the required parameter '_package' is set
    if (_package == null) {
      throw new ApiException(400, "Missing the required parameter '_package' when calling updatePackage");
    }
    
    // create path and map variables
    String localVarPath = "/namespaces/{namespace}/packages/{packageName}"
      .replaceAll("\\{" + "namespace" + "\\}", apiClient.escapeString(namespace.toString()))
      .replaceAll("\\{" + "packageName" + "\\}", apiClient.escapeString(packageName.toString()));

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy