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

com.kaltura.client.services.DataService Maven / Gradle / Ivy

Go to download

KalturaClient is a library of Java classes that can be used to interact with the Kaltura REST API. More information about the REST API can be found at http://corp.kaltura.com/Products/Kaltura-API Many of the Java classes in this library are auto-generated from a schema that defines the objects that are used to interect with the API. The current schema can be found at http://www.kaltura.com/api_v3/api_schema.php

There is a newer version: 19.3.0
Show newest version
// ===================================================================================================
//                           _  __     _ _
//                          | |/ /__ _| | |_ _  _ _ _ __ _
//                          | ' .
//
// @ignore
// ===================================================================================================
package com.kaltura.client.services;

import com.kaltura.client.types.DataEntry;
import com.kaltura.client.types.DataEntryFilter;
import com.kaltura.client.types.FilterPager;
import com.kaltura.client.types.GenericDataCenterContentResource;
import com.kaltura.client.utils.request.ListResponseRequestBuilder;
import com.kaltura.client.utils.request.NullRequestBuilder;
import com.kaltura.client.utils.request.RequestBuilder;
import com.kaltura.client.utils.request.ServeRequestBuilder;

/**
 * This class was generated using generate.php
 * against an XML schema provided by Kaltura.
 * 
 * MANUAL CHANGES TO THIS CLASS WILL BE OVERWRITTEN.
 */

/**
 * Data service lets you manage data content (textual content)
 * 
 * @param dataEntry Data entry
 * @param entryId 
 * @param resource 
 * @param entryId Data entry id to delete
 * @param entryId Data entry id
 * @param version Desired version of the data
 * @param filter Document entry filter
 * @param pager Pager
 * @param entryId Data entry id
 * @param version Desired version of the data
 * @param forceProxy force to get the content without redirect
 * @param entryId Data entry id to update
 * @param documentEntry Data entry metadata to update
 */
public class DataService {
	
	public static class AddDataBuilder extends RequestBuilder {
		
		public AddDataBuilder(DataEntry dataEntry) {
			super(DataEntry.class, "data", "add");
			params.add("dataEntry", dataEntry);
		}
	}

	/**
	 * Adds a new data entry
	 * 
	 * @param dataEntry Data entry
	 */
    public static AddDataBuilder add(DataEntry dataEntry)  {
		return new AddDataBuilder(dataEntry);
	}
	
	public static class AddContentDataBuilder extends RequestBuilder {
		
		public AddContentDataBuilder(String entryId, GenericDataCenterContentResource resource) {
			super(String.class, "data", "addContent");
			params.add("entryId", entryId);
			params.add("resource", resource);
		}
		
		public void entryId(String multirequestToken) {
			params.add("entryId", multirequestToken);
		}
	}

	/**
	 * Update the dataContent of data entry using a resource
	 * 
	 * @param entryId 
	 * @param resource 
	 */
    public static AddContentDataBuilder addContent(String entryId, GenericDataCenterContentResource resource)  {
		return new AddContentDataBuilder(entryId, resource);
	}
	
	public static class DeleteDataBuilder extends NullRequestBuilder {
		
		public DeleteDataBuilder(String entryId) {
			super("data", "delete");
			params.add("entryId", entryId);
		}
		
		public void entryId(String multirequestToken) {
			params.add("entryId", multirequestToken);
		}
	}

	/**
	 * Delete a data entry.
	 * 
	 * @param entryId Data entry id to delete
	 */
    public static DeleteDataBuilder delete(String entryId)  {
		return new DeleteDataBuilder(entryId);
	}
	
	public static class GetDataBuilder extends RequestBuilder {
		
		public GetDataBuilder(String entryId, int version) {
			super(DataEntry.class, "data", "get");
			params.add("entryId", entryId);
			params.add("version", version);
		}
		
		public void entryId(String multirequestToken) {
			params.add("entryId", multirequestToken);
		}
		
		public void version(String multirequestToken) {
			params.add("version", multirequestToken);
		}
	}

	public static GetDataBuilder get(String entryId)  {
		return get(entryId, -1);
	}

	/**
	 * Get data entry by ID.
	 * 
	 * @param entryId Data entry id
	 * @param version Desired version of the data
	 */
    public static GetDataBuilder get(String entryId, int version)  {
		return new GetDataBuilder(entryId, version);
	}
	
	public static class ListDataBuilder extends ListResponseRequestBuilder {
		
		public ListDataBuilder(DataEntryFilter filter, FilterPager pager) {
			super(DataEntry.class, "data", "list");
			params.add("filter", filter);
			params.add("pager", pager);
		}
	}

	public static ListDataBuilder list()  {
		return list(null);
	}

	public static ListDataBuilder list(DataEntryFilter filter)  {
		return list(filter, null);
	}

	/**
	 * List data entries by filter with paging support.
	 * 
	 * @param filter Document entry filter
	 * @param pager Pager
	 */
    public static ListDataBuilder list(DataEntryFilter filter, FilterPager pager)  {
		return new ListDataBuilder(filter, pager);
	}
	
	public static class ServeDataBuilder extends ServeRequestBuilder {
		
		public ServeDataBuilder(String entryId, int version, boolean forceProxy) {
			super("data", "serve");
			params.add("entryId", entryId);
			params.add("version", version);
			params.add("forceProxy", forceProxy);
		}
		
		public void entryId(String multirequestToken) {
			params.add("entryId", multirequestToken);
		}
		
		public void version(String multirequestToken) {
			params.add("version", multirequestToken);
		}
		
		public void forceProxy(String multirequestToken) {
			params.add("forceProxy", multirequestToken);
		}
	}

	public static ServeDataBuilder serve(String entryId)  {
		return serve(entryId, -1);
	}

	public static ServeDataBuilder serve(String entryId, int version)  {
		return serve(entryId, version, false);
	}

	/**
	 * return the file from dataContent field.
	 * 
	 * @param entryId Data entry id
	 * @param version Desired version of the data
	 * @param forceProxy force to get the content without redirect
	 */
    public static ServeDataBuilder serve(String entryId, int version, boolean forceProxy)  {
		return new ServeDataBuilder(entryId, version, forceProxy);
	}
	
	public static class UpdateDataBuilder extends RequestBuilder {
		
		public UpdateDataBuilder(String entryId, DataEntry documentEntry) {
			super(DataEntry.class, "data", "update");
			params.add("entryId", entryId);
			params.add("documentEntry", documentEntry);
		}
		
		public void entryId(String multirequestToken) {
			params.add("entryId", multirequestToken);
		}
	}

	/**
	 * Update data entry. Only the properties that were set will be updated.
	 * 
	 * @param entryId Data entry id to update
	 * @param documentEntry Data entry metadata to update
	 */
    public static UpdateDataBuilder update(String entryId, DataEntry documentEntry)  {
		return new UpdateDataBuilder(entryId, documentEntry);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy