com.citrix.sharefile.api.entities.SFFavoritesEntity 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 SFFavoritesEntity extends SFEntitiesBase
{
public SFFavoritesEntity(ISFApiClient client) {
super(client);
}
/**
* Get a list of all favorite items marked by the user
* @param userUrl
*/
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("Favorites");
sfApiQuery.addIds(userUrl);
sfApiQuery.setHttpMethod("GET");
return sfApiQuery;
}
/**
* Get a single favorite item
*/
public ISFQuery getByFavoriteItem(URI url) throws InvalidOrMissingParameterException {
if (url == null) {
throw new InvalidOrMissingParameterException("url");
}
SFApiQuery sfApiQuery = new SFApiQuery(this.client);
sfApiQuery.setFrom("Favorites");
sfApiQuery.addIds(url);
sfApiQuery.setHttpMethod("GET");
return sfApiQuery;
}
/**
* Mark an Item as Favorite
* @param userUrl
* @param itemToMarkFavorite
*/
public ISFQuery createByUser(URI userUrl, SFFavorite itemToMarkFavorite) throws InvalidOrMissingParameterException {
if (userUrl == null) {
throw new InvalidOrMissingParameterException("userUrl");
}
if (itemToMarkFavorite == null) {
throw new InvalidOrMissingParameterException("itemToMarkFavorite");
}
SFApiQuery sfApiQuery = new SFApiQuery(this.client);
sfApiQuery.setFrom("Users");
sfApiQuery.setAction("Favorites");
sfApiQuery.addIds(userUrl);
sfApiQuery.setBody(itemToMarkFavorite);
sfApiQuery.setHttpMethod("POST");
return sfApiQuery;
}
/**
* Update the Favorite Items for a user
* @param userUrl
* @param favoriteItems
*/
public ISFQuery patchByUser(URI userUrl, ArrayList favoriteItems) throws InvalidOrMissingParameterException {
if (userUrl == null) {
throw new InvalidOrMissingParameterException("userUrl");
}
if (favoriteItems == null) {
throw new InvalidOrMissingParameterException("favoriteItems");
}
SFApiQuery sfApiQuery = new SFApiQuery(this.client);
sfApiQuery.setFrom("Users");
sfApiQuery.setAction("Favorites");
sfApiQuery.addIds(userUrl);
sfApiQuery.setBody(favoriteItems);
sfApiQuery.setHttpMethod("PUT");
return sfApiQuery;
}
/**
* Remove the given Favorite item for a user
*/
public ISFQuery delete(URI url) throws InvalidOrMissingParameterException {
if (url == null) {
throw new InvalidOrMissingParameterException("url");
}
SFApiQuery sfApiQuery = new SFApiQuery(this.client);
sfApiQuery.setFrom("Favorites");
sfApiQuery.addIds(url);
sfApiQuery.setHttpMethod("DELETE");
return sfApiQuery;
}
/**
* Remove all Favorite items for a user
* @param userUrl
*/
public ISFQuery deleteInBulkByUser(URI userUrl) throws InvalidOrMissingParameterException {
if (userUrl == null) {
throw new InvalidOrMissingParameterException("userUrl");
}
SFApiQuery sfApiQuery = new SFApiQuery(this.client);
sfApiQuery.setFrom("Users");
sfApiQuery.setAction("Favorites");
sfApiQuery.addIds(userUrl);
sfApiQuery.setHttpMethod("DELETE");
return sfApiQuery;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy