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

com.citrix.sharefile.api.entities.SFAsyncOperationsEntity Maven / Gradle / Ivy


// ------------------------------------------------------------------------------
// 
//     This code was generated by a tool.
//  
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
//     
//	   Copyright (c) 2017 Citrix ShareFile. All rights reserved.
// 
// ------------------------------------------------------------------------------

package com.citrix.sharefile.api.entities;

import com.citrix.sharefile.api.*;
import com.citrix.sharefile.api.entities.*;
import com.citrix.sharefile.api.models.*;
import com.citrix.sharefile.api.SFApiQuery;
import com.citrix.sharefile.api.interfaces.ISFQuery;


import java.io.InputStream;
import java.util.ArrayList;
import java.net.URI;
import java.util.Date;
 
import com.google.gson.annotations.SerializedName;
import com.citrix.sharefile.api.enumerations.SFSafeEnum;
import com.citrix.sharefile.api.enumerations.SFSafeEnumFlags;
import com.citrix.sharefile.api.interfaces.ISFApiClient;
import com.citrix.sharefile.api.exceptions.InvalidOrMissingParameterException;

public class SFAsyncOperationsEntity extends SFEntitiesBase
{
	public SFAsyncOperationsEntity(ISFApiClient client) {
		super(client);
	}

	/**
	* Get AsyncOperation by ID
	* Retrieve a single Async Op record by ID
	* @param url 	 	
	* @return A single Async Operation record
	*/
	public ISFQuery get(URI url) throws InvalidOrMissingParameterException 	{
		if (url == null) {
			throw new InvalidOrMissingParameterException("url");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("AsyncOperations");
		sfApiQuery.addIds(url);
		sfApiQuery.setHttpMethod("GET");
		return sfApiQuery;
	}

	/**
	* Get List of AsyncOperations by Operation Batch ID
	* Retrieves all AsyncOperations on the specified batch
	* @param id 	 	
	* @return A Feed of AsyncOperation objects, containing all items in the specified batch
	*/
	public ISFQuery> getByBatch(String id) throws InvalidOrMissingParameterException 	{
		if (id == null) {
			throw new InvalidOrMissingParameterException("id");
		}

		SFApiQuery> sfApiQuery = new SFApiQuery>(this.client);
		sfApiQuery.setFrom("AsyncOperations");
		sfApiQuery.setAction("GetByBatch");
		sfApiQuery.addActionIds(id);
		sfApiQuery.setHttpMethod("GET");
		return sfApiQuery;
	}

	/**
	* Get progress of AsyncOperations by Operation Batch ID
	* Retrieves an AsyncOperation containing batch progress by Operation Batch ID
	* @param id 	 	
	* @return An Async Operation object containing batch progress
	*/
	public ISFQuery getBatch(String id) throws InvalidOrMissingParameterException 	{
		if (id == null) {
			throw new InvalidOrMissingParameterException("id");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("AsyncOperations");
		sfApiQuery.setAction("GetBatch");
		sfApiQuery.addActionIds(id);
		sfApiQuery.setHttpMethod("GET");
		return sfApiQuery;
	}

	/**
	* Get List of AsyncOperations by Folder
	* Retrieves all AsyncOperations associated with the calling user and the Item ID
	* @param id 	 	
	* @return A Feed of AsyncOperation objects, containing all pending operations in the specific folder, for the authenticated SDK user
	*/
	public ISFQuery> getByFolder(String id) throws InvalidOrMissingParameterException 	{
		if (id == null) {
			throw new InvalidOrMissingParameterException("id");
		}

		SFApiQuery> sfApiQuery = new SFApiQuery>(this.client);
		sfApiQuery.setFrom("AsyncOperations");
		sfApiQuery.setAction("GetByFolder");
		sfApiQuery.addActionIds(id);
		sfApiQuery.setHttpMethod("GET");
		return sfApiQuery;
	}

	public ISFQuery create(SFAsyncOperation asyncOp) throws InvalidOrMissingParameterException 	{
		if (asyncOp == null) {
			throw new InvalidOrMissingParameterException("asyncOp");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("AsyncOperations");
		sfApiQuery.setBody(asyncOp);
		sfApiQuery.setHttpMethod("POST");
		return sfApiQuery;
	}

	/**
	* Cancel AsyncOperation
	* Cancels a single Async operation record
	* @param url 	 	
	* @return The modified Async Operation record
	*/
	public ISFQuery cancel(URI url) throws InvalidOrMissingParameterException 	{
		if (url == null) {
			throw new InvalidOrMissingParameterException("url");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("AsyncOperations");
		sfApiQuery.setAction("Cancel");
		sfApiQuery.addIds(url);
		sfApiQuery.setHttpMethod("POST");
		return sfApiQuery;
	}

	/**
	* Delete AsyncOperation
	* Cancels a single Async operation record (same as /Cancel)
	* @param url 	 	
	*/
	public ISFQuery delete(URI url) throws InvalidOrMissingParameterException 	{
		if (url == null) {
			throw new InvalidOrMissingParameterException("url");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("AsyncOperations");
		sfApiQuery.addIds(url);
		sfApiQuery.setHttpMethod("DELETE");
		return sfApiQuery;
	}

	/**
	* Cancel an Operation Batch
	* Cancel an Async Operation batch - all unfinished Async Operation records in that batch
	* will be moved to Cancelled state.
	* @param id 	 	
	* @return A list of the modified Async Operations in the batch
	*/
	public ISFQuery> cancelBatch(String id) throws InvalidOrMissingParameterException 	{
		if (id == null) {
			throw new InvalidOrMissingParameterException("id");
		}

		SFApiQuery> sfApiQuery = new SFApiQuery>(this.client);
		sfApiQuery.setFrom("AsyncOperations");
		sfApiQuery.setAction("CancelBatch");
		sfApiQuery.addActionIds(id);
		sfApiQuery.setHttpMethod("POST");
		return sfApiQuery;
	}

	/**
	* Changes the state of an AsyncOperation
    * { "State": "..." }
	* Only the State parameter is updated, other fields are ignored
	* @param url 	 	
	* @param newAsyncOp 	 	
	* @return The modified Async Operation
	*/
	public ISFQuery update(URI url, SFAsyncOperation newAsyncOp) throws InvalidOrMissingParameterException 	{
		if (url == null) {
			throw new InvalidOrMissingParameterException("url");
		}
		if (newAsyncOp == null) {
			throw new InvalidOrMissingParameterException("newAsyncOp");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("AsyncOperations");
		sfApiQuery.addIds(url);
		sfApiQuery.setBody(newAsyncOp);
		sfApiQuery.setHttpMethod("PATCH");
		return sfApiQuery;
	}

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy