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

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

	/**
	* Get Apps for Current User
	* @return A feed of ConnectedApp objects
	*/
	public ISFQuery> get()	{

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

	/**
	* Get Apps for given User
	* @param userUrl 	 	
	* @return A feed of ConnectedApp objects
	*/
	public ISFQuery> getByUser(URI userUrl) throws InvalidOrMissingParameterException 	{
		if (userUrl == null) {
			throw new InvalidOrMissingParameterException("userUrl");
		}

		SFApiQuery> sfApiQuery = new SFApiQuery>(this.client);
		sfApiQuery.setFrom("Users");
		sfApiQuery.setAction("Apps");
		sfApiQuery.addIds(userUrl);
		sfApiQuery.setHttpMethod("GET");
		return sfApiQuery;
	}

	public ISFQuery get(URI url) throws InvalidOrMissingParameterException 	{
		if (url == null) {
			throw new InvalidOrMissingParameterException("url");
		}

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

	/**
	* Get App by ID
	* @param userUrl 	 	
	* @return ConnectedApp
	*/
	public ISFQuery getByUser(URI userUrl, String appid) throws InvalidOrMissingParameterException 	{
		if (userUrl == null) {
			throw new InvalidOrMissingParameterException("userUrl");
		}
		if (appid == null) {
			throw new InvalidOrMissingParameterException("appid");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("Users");
		sfApiQuery.setAction("Apps");
		sfApiQuery.addIds(userUrl);
		sfApiQuery.addActionIds(appid);
		sfApiQuery.setHttpMethod("GET");
		return sfApiQuery;
	}

	/**
	* Revoke App access for Current User
	* @param appUrl 	 	
	* @return no data on success
	*/
	public ISFQuery delete(URI appUrl) throws InvalidOrMissingParameterException 	{
		if (appUrl == null) {
			throw new InvalidOrMissingParameterException("appUrl");
		}

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

	/**
	* Revoke App access for a given User
	* @param userUrl 	 	
	* @return no data on success
	*/
	public ISFQuery deleteByUser(URI userUrl, String appid) throws InvalidOrMissingParameterException 	{
		if (userUrl == null) {
			throw new InvalidOrMissingParameterException("userUrl");
		}
		if (appid == null) {
			throw new InvalidOrMissingParameterException("appid");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("Users");
		sfApiQuery.setAction("Apps");
		sfApiQuery.addIds(userUrl);
		sfApiQuery.addActionIds(appid);
		sfApiQuery.setHttpMethod("DELETE");
		return sfApiQuery;
	}

	/**
	* Get all Two Factor Authentication Apps for the Current User
	* @return A feed of TwoFactorAuthApp objects
	*/
	public ISFQuery> tFA()	{

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

	public ISFQuery> getTFAByUser(URI url) throws InvalidOrMissingParameterException 	{
		if (url == null) {
			throw new InvalidOrMissingParameterException("url");
		}

		SFApiQuery> sfApiQuery = new SFApiQuery>(this.client);
		sfApiQuery.setFrom("Users");
		sfApiQuery.setAction("TFA");
		sfApiQuery.addIds(url);
		sfApiQuery.setHttpMethod("GET");
		return sfApiQuery;
	}

	/**
	* Get Two Factor Authentication App by ID for the Current User
	* @return TwoFactorAuthApp
	*/
	public ISFQuery tFA(String appid) throws InvalidOrMissingParameterException 	{
		if (appid == null) {
			throw new InvalidOrMissingParameterException("appid");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("Apps");
		sfApiQuery.setAction("TFA");
		sfApiQuery.addActionIds(appid);
		sfApiQuery.setHttpMethod("GET");
		return sfApiQuery;
	}

	public ISFQuery getTFAByUser(URI url, String tfaAppId) throws InvalidOrMissingParameterException 	{
		if (url == null) {
			throw new InvalidOrMissingParameterException("url");
		}
		if (tfaAppId == null) {
			throw new InvalidOrMissingParameterException("tfaAppId");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("Users");
		sfApiQuery.setAction("TFA");
		sfApiQuery.addIds(url);
		sfApiQuery.addActionIds(tfaAppId);
		sfApiQuery.setHttpMethod("GET");
		return sfApiQuery;
	}

	/**
	* Revoke Two Factor Auth App by ID
	* @return no data on success
	*/
	public ISFQuery deleteTFA(String tfaAppId) throws InvalidOrMissingParameterException 	{
		if (tfaAppId == null) {
			throw new InvalidOrMissingParameterException("tfaAppId");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("Apps");
		sfApiQuery.setAction("TFA");
		sfApiQuery.addActionIds(tfaAppId);
		sfApiQuery.setHttpMethod("DELETE");
		return sfApiQuery;
	}

	/**
	* Revoke Two Factor Auth App by ID
	* @param userUrl 	 	
	* @return no data on success
	*/
	public ISFQuery deleteTFA(URI userUrl, String tfaAppId) throws InvalidOrMissingParameterException 	{
		if (userUrl == null) {
			throw new InvalidOrMissingParameterException("userUrl");
		}
		if (tfaAppId == null) {
			throw new InvalidOrMissingParameterException("tfaAppId");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("Users");
		sfApiQuery.setAction("TFA");
		sfApiQuery.addIds(userUrl);
		sfApiQuery.addActionIds(tfaAppId);
		sfApiQuery.setHttpMethod("DELETE");
		return sfApiQuery;
	}

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy