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

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

	/**
	* Get Device Users for Current User
	* @return A feed of DeviceUser objects
	*/
	public ISFQuery> get()	{

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

	/**
	* Get Device by ID
	* @param url 	 	
	* @return Device
	*/
	public ISFQuery get(URI url) throws InvalidOrMissingParameterException 	{
		if (url == null) {
			throw new InvalidOrMissingParameterException("url");
		}

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

	/**
	* Get Devices for given User
	* @param parentUrl 	 	
	* @return List of Devices
	*/
	public ISFQuery> getByUser(URI parentUrl) throws InvalidOrMissingParameterException 	{
		if (parentUrl == null) {
			throw new InvalidOrMissingParameterException("parentUrl");
		}

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

	/**
	* Delete specific Device for given User
	* @param parentUrl 	 	
	* @param id 	 	
	* @return No content
	*/
	public ISFQuery deleteByUser(URI parentUrl, String id) throws InvalidOrMissingParameterException 	{
		if (parentUrl == null) {
			throw new InvalidOrMissingParameterException("parentUrl");
		}
		if (id == null) {
			throw new InvalidOrMissingParameterException("id");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("Users");
		sfApiQuery.setAction("Devices");
		sfApiQuery.addIds(parentUrl);
		sfApiQuery.addActionIds(id);
		sfApiQuery.setHttpMethod("DELETE");
		return sfApiQuery;
	}

	/**
	* Wipe Device
	* @param deviceUrl 	 	
	* @param userid  (default: null)	 	
	* @return no data on success
	*/
	public ISFQuery wipe(URI deviceUrl, String userid) throws InvalidOrMissingParameterException 	{
		if (deviceUrl == null) {
			throw new InvalidOrMissingParameterException("deviceUrl");
		}
		if (userid == null) {
			throw new InvalidOrMissingParameterException("userid");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("Devices");
		sfApiQuery.setAction("Wipe");
		sfApiQuery.addIds(deviceUrl);
		sfApiQuery.addQueryString("userid", userid);
		sfApiQuery.setHttpMethod("POST");
		return sfApiQuery;
	}

	/**
	* Wipe Device
	* @param deviceUrl 	 	
	* @return no data on success
	*/
	public ISFQuery wipe(URI deviceUrl) throws InvalidOrMissingParameterException 	{
		if (deviceUrl == null) {
			throw new InvalidOrMissingParameterException("deviceUrl");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("Devices");
		sfApiQuery.setAction("Wipe");
		sfApiQuery.addIds(deviceUrl);
		sfApiQuery.setHttpMethod("POST");
		return sfApiQuery;
	}

	/**
	* Lock Device
	* @param deviceUrl 	 	
	* @param userid  (default: null)	 	
	* @return no data on success
	*/
	public ISFQuery lock(URI deviceUrl, String userid) throws InvalidOrMissingParameterException 	{
		if (deviceUrl == null) {
			throw new InvalidOrMissingParameterException("deviceUrl");
		}
		if (userid == null) {
			throw new InvalidOrMissingParameterException("userid");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("Devices");
		sfApiQuery.setAction("Lock");
		sfApiQuery.addIds(deviceUrl);
		sfApiQuery.addQueryString("userid", userid);
		sfApiQuery.setHttpMethod("POST");
		return sfApiQuery;
	}

	/**
	* Lock Device
	* @param deviceUrl 	 	
	* @return no data on success
	*/
	public ISFQuery lock(URI deviceUrl) throws InvalidOrMissingParameterException 	{
		if (deviceUrl == null) {
			throw new InvalidOrMissingParameterException("deviceUrl");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("Devices");
		sfApiQuery.setAction("Lock");
		sfApiQuery.addIds(deviceUrl);
		sfApiQuery.setHttpMethod("POST");
		return sfApiQuery;
	}

	/**
	* Unlock Device
	* @param deviceUrl 	 	
	* @param userid  (default: null)	 	
	* @return no data on success
	*/
	public ISFQuery unlock(URI deviceUrl, String userid) throws InvalidOrMissingParameterException 	{
		if (deviceUrl == null) {
			throw new InvalidOrMissingParameterException("deviceUrl");
		}
		if (userid == null) {
			throw new InvalidOrMissingParameterException("userid");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("Devices");
		sfApiQuery.setAction("Unlock");
		sfApiQuery.addIds(deviceUrl);
		sfApiQuery.addQueryString("userid", userid);
		sfApiQuery.setHttpMethod("POST");
		return sfApiQuery;
	}

	/**
	* Unlock Device
	* @param deviceUrl 	 	
	* @return no data on success
	*/
	public ISFQuery unlock(URI deviceUrl) throws InvalidOrMissingParameterException 	{
		if (deviceUrl == null) {
			throw new InvalidOrMissingParameterException("deviceUrl");
		}

		SFApiQuery sfApiQuery = new SFApiQuery(this.client);
		sfApiQuery.setFrom("Devices");
		sfApiQuery.setAction("Unlock");
		sfApiQuery.addIds(deviceUrl);
		sfApiQuery.setHttpMethod("POST");
		return sfApiQuery;
	}

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy