Class: Kaltura::Service::ConversionProfileService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/kaltura/service/conversion_profile_service.rb

Overview

The Conversion Profile Service is responsible for adding and managing conversion profiles.

Examples:

Create a new conversion profile:

conversion_profile = Kaltura::ConversionProfile.new
conversion_profile.name = "waffles"
conversion_profile.is_default = "true"
conversion_profile.clip_duration = 15
client.conversion_profile_service.add(conversion_profile)

Retrieve a conversion profile:

client.conversion_profile_service.get(224)

Update a conversion profile:

update_profile = Kaltura::ConversionProfile.new
update_profile.description = "why does the documentor love waffles so much?"
update_profile.clip_start = 3
client.conversion_profile_service.update(224,update_profile)

Delete a conversion profile:

client.conversion_profile_service.delete(224)

Retrieve all conversion profiles with an ID of 224

filter = Kaltura::Filter::ConversionProfileFilter.new
filter.id_equal = 224
client.conversion_profile_service.list(filter)

Instance Attribute Summary

Attributes inherited from BaseService

#client

Instance Method Summary collapse

Methods inherited from BaseService

#initialize, #perform_request

Constructor Details

This class inherits a constructor from Kaltura::Service::BaseService

Instance Method Details

#add(conversion_profile) ⇒ Kaltura::ConversionProfile

Adds a new conversion profile.

Parameters:

Returns:

  • (Kaltura::ConversionProfile)

    The conversion profile as it is stored on the Kaltura server. It might be important to store the ID returned.

Raises:



43
44
45
46
47
# File 'lib/kaltura/service/conversion_profile_service.rb', line 43

def add(conversion_profile)
	kparams = {}
	client.add_param(kparams, 'conversionProfile', conversion_profile)
	perform_request('conversionProfile','add',kparams,false)
end

#delete(id) ⇒ nil

Deletes a conversion profile by ID.

Parameters:

  • id (Integer)

    The conversion profile ID.

Returns:

  • (nil)

    Returns nothing.

Raises:



92
93
94
95
96
# File 'lib/kaltura/service/conversion_profile_service.rb', line 92

def delete(id)
	kparams = {}
	client.add_param(kparams, 'id', id)
	perform_request('conversionProfile','delete',kparams,false)
end

#get(id) ⇒ Kaltura::ConversionProfile

Retrieves a conversion profile by ID.

Parameters:

  • id (Integer)

    The conversion profile ID.

Returns:

Raises:



58
59
60
61
62
# File 'lib/kaltura/service/conversion_profile_service.rb', line 58

def get(id)
	kparams = {}
	client.add_param(kparams, 'id', id)
	perform_request('conversionProfile','get',kparams,false)
end

#list(filter = nil, pager = nil) ⇒ Kaltura::Response::ConversionProfileListResponse

Lists conversion profiles given a filter with paging support for larger result sets.

Parameters:

Returns:

Raises:



108
109
110
111
112
113
# File 'lib/kaltura/service/conversion_profile_service.rb', line 108

def list(filter=nil, pager=nil)
	kparams = {}
	client.add_param(kparams, 'filter', filter)
	client.add_param(kparams, 'pager', pager)
	perform_request('conversionProfile','list',kparams,false)
end

#update(id, conversion_profile) ⇒ Kaltura::ConversionProfile

Updates a conversion profile given an ID and a newly instantiated ConversionProfile. It will update any populated fields on the provided profile.

Parameters:

  • id (Integer)

    The conversion profile ID.

  • conversion_profile (Kaltura::ConversionProfile)

    Newly instantiated conversion profile with the fields to update.

Returns:

Raises:



76
77
78
79
80
81
# File 'lib/kaltura/service/conversion_profile_service.rb', line 76

def update(id, conversion_profile)
	kparams = {}
	client.add_param(kparams, 'id', id)
	client.add_param(kparams, 'conversionProfile', conversion_profile)
	perform_request('conversionProfile','update',kparams,false)
end