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

com.citrix.sharefile.api.entities.SFWorkflowsEntity 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 SFWorkflowsEntity extends SFEntitiesBase
{
	public SFWorkflowsEntity(ISFApiClient client) {
		super(client);
	}

	/**
	* Gets workflows initiated by the current user.
	* Restrictions:
	* * Skip must be a multiple of 25.
	* * Top must be 25. It's preferred to not supply this.
	* * Sort is only supported for LastUpdatedDate and Due
	* @return A feed of Workflow objects
	*/
	public ISFQuery> getInitiated()	{

		SFApiQuery> sfApiQuery = new SFApiQuery>(this.client);
		sfApiQuery.setFrom("Workflows");
		sfApiQuery.setAction("Initiated");
		sfApiQuery.setHttpMethod("GET");
		return sfApiQuery;
	}

	/**
	* Gets workflows shared with the current user.
	* Restrictions:
	* * Skip must be a multiple of 25.
	* * Top must be 25. It's preferred to not supply this.
	* * Sort is only supported for LastUpdatedDate and Due
	* @return A feed of Workflow objects
	*/
	public ISFQuery> getShared()	{

		SFApiQuery> sfApiQuery = new SFApiQuery>(this.client);
		sfApiQuery.setFrom("Workflows");
		sfApiQuery.setAction("Shared");
		sfApiQuery.setHttpMethod("GET");
		return sfApiQuery;
	}

	/**
	* Get a workflow by id.
	* @param url 	 	
	* @return A Workflow object
	*/
	public ISFQuery get(URI url) throws InvalidOrMissingParameterException 	{
		if (url == null) {
			throw new InvalidOrMissingParameterException("url");
		}

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

	/**
	* Get a protocol link to view a workflow in a web browser.
	* Only the latest version of each major browser is supported.
	* @param url 	 	
	* @return A ItemProtocolLink set for the Workflow
	*/
	public ISFQuery getLink(URI url) throws InvalidOrMissingParameterException 	{
		if (url == null) {
			throw new InvalidOrMissingParameterException("url");
		}

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

	/**
	* Create an Approval Workflow
    * {
    * "Participants":
    * [
    * {
    * "Contact":
    * {
    * "Email": "[email protected]"
    * },
    * "Role": "Active"
    * },
    * {
    * "Contact":
    * {
    * "Email": "[email protected]"
    * },
    * "Role": "Passive"
    * }
    * ]
    * }
	* @param url 	 	
	* @param request 	 	
	* @return A new approval workflow
	*/
	public ISFQuery createApproval(URI url, SFCreateWorkflowParams request) throws InvalidOrMissingParameterException 	{
		if (url == null) {
			throw new InvalidOrMissingParameterException("url");
		}
		if (request == null) {
			throw new InvalidOrMissingParameterException("request");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("Items");
		sfApiQuery.setAction("Workflows");
		sfApiQuery.addIds(url);
		sfApiQuery.addSubAction("Approval");
		sfApiQuery.setBody(request);
		sfApiQuery.setHttpMethod("POST");
		return sfApiQuery;
	}

	/**
	* Create a Feedback Workflow
    * {
    * "Participants":
    * [
    * {
    * "Contact":
    * {
    * "Email": "[email protected]"
    * },
    * "Role": "Active"
    * },
    * {
    * "Contact":
    * {
    * "Email": "[email protected]"
    * },
    * "Role": "Passive"
    * }
    * ]
    * }
	* @param url 	 	
	* @param request 	 	
	* @return A new feedback workflow
	*/
	public ISFQuery createFeedback(URI url, SFCreateWorkflowParams request) throws InvalidOrMissingParameterException 	{
		if (url == null) {
			throw new InvalidOrMissingParameterException("url");
		}
		if (request == null) {
			throw new InvalidOrMissingParameterException("request");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("Items");
		sfApiQuery.setAction("Workflows");
		sfApiQuery.addIds(url);
		sfApiQuery.addSubAction("Feedback");
		sfApiQuery.setBody(request);
		sfApiQuery.setHttpMethod("POST");
		return sfApiQuery;
	}

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy