Class: Kaltura::Service::EmailIngestionProfileService

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

Overview

The Email Ingestion Profile Service allows you to manage email ingestion profile records.

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(email_ip) ⇒ Kaltura::EmailIngestionProfile

Adds an email ingestion profile to the Kaltura Database.

Parameters:

Returns:

  • (Kaltura::EmailIngestionProfile)

    Returns the email ingestion profile as stored on the DB. It might be important to store either the email_address or ID fields for later.

Raises:

  • (Kaltura::APIError)

    Raises ‘EMAIL INGESTION PROFILE EMAIL EXISTS’ if there is another profile using the email address provided.



19
20
21
22
23
# File 'lib/kaltura/service/email_ingestion_profile_service.rb', line 19

def add(email_ip)
  kparams = {}
  client.add_param(kparams, 'EmailIP', email_ip)
  perform_request('EmailIngestionProfile','add',kparams,false)
end

#add_media_entry(media_entry, upload_token_id, email_prof_id, from_address, email_msg_id) ⇒ Kaltura::MediaEntry

Adds a Kaltura::MediaEntry from a email ingestion profile. I’m not entirely sure what the aim of this upload action is, rather than using the media service itself.

Parameters:

  • media_entry (Kaltura::MediaEntry)

    A newly instantiated media entry object that will be created in the database.

  • upload_token_id (String)

    The upload token provided by the media service’s upload action.

  • email_profile_id (Integer)

    The email ingestion profile ID.

  • from_address (String)

    The email address the action is coming from?

  • email_msg_id (String)

    The ID of the email message?

Returns:

  • (Kaltura::MediaEntry)

    The newly created media entry as stored in the kaltura database. It would be beneficial to store the entry_id of this object for later.

Raises:

  • (Kaltura::APIError)

    Raises ‘UPLOADED_FILE_NOT_FOUND_BY_TOKEN’ when the upload token cannot be found.



111
112
113
114
115
116
117
118
119
# File 'lib/kaltura/service/email_ingestion_profile_service.rb', line 111

def add_media_entry(media_entry, upload_token_id, email_prof_id, from_address, email_msg_id)
  kparams = {}
  client.add_param(kparams, 'mediaEntry', media_entry)
  client.add_param(kparams, 'uploadTokenId', upload_token_id)
  client.add_param(kparams, 'emailProfId', email_prof_id)
  client.add_param(kparams, 'fromAddress', from_address)
  client.add_param(kparams, 'emailMsgId', email_msg_id)
  perform_request('EmailIngestionProfile','addMediaEntry',kparams,false)
end

#delete(id) ⇒ nil

Deletes an email ingestion profile by ID.

Parameters:

  • id (Integer)

    The ID of the email ingestion profile to delete.

Returns:

  • (nil)

    Returns nothing.

Raises:

  • (Kaltura::APIError)

    Raises ‘EMAIL INGESTION PROFILE NOT FOUND’ if there isnt a profile with the email address provided.



88
89
90
91
92
# File 'lib/kaltura/service/email_ingestion_profile_service.rb', line 88

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

#get(id) ⇒ Kaltura::EmailIngestionProfile

Retrieves an email ingestion profile by ID.

Parameters:

  • id (Integer)

    The ID of the email ingestion profile to find.

Returns:

Raises:

  • (Kaltura::APIError)

    Raises ‘EMAIL INGESTION PROFILE NOT FOUND’ if there isnt a profile with the email address provided.



51
52
53
54
55
# File 'lib/kaltura/service/email_ingestion_profile_service.rb', line 51

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

#get_by_email_address(email_address) ⇒ Kaltura::EmailIngestionProfile

Retrieves an email ingestion profile by the email_address field.

Parameters:

  • email_address (String)

    The email address to find the profile with.

Returns:

Raises:

  • (Kaltura::APIError)

    Raises ‘EMAIL INGESTION PROFILE NOT FOUND’ if there isnt a profile with the email address provided.



35
36
37
38
39
# File 'lib/kaltura/service/email_ingestion_profile_service.rb', line 35

def get_by_email_address(email_address)
  kparams = {}
  client.add_param(kparams, 'emailAddress', email_address)
  perform_request('EmailIngestionProfile','getByEmailAddress',kparams,false)
end

#update(id, email_ip) ⇒ Kaltura::EmailIngestionProfile

Updates an existing email ingestion profile. As with other update API actions it is a best practice to instantiate a new EmailIngestionProfile object and populate the fields with the fields you wish to change of the existing object.

Parameters:

  • id (Integer)

    The ID of the email ingestion profile you wish to update.

  • email_ip (Kaltura::EmailIngestionProfile)

    The newly instantiated email ingestion profile object with the fields you wish to update.

Returns:

Raises:

  • (Kaltura::APIError)

    Raises ‘EMAIL INGESTION PROFILE NOT FOUND’ if there isnt a profile with the email address provided.



71
72
73
74
75
76
# File 'lib/kaltura/service/email_ingestion_profile_service.rb', line 71

def update(id, email_ip)
  kparams = {}
  client.add_param(kparams, 'id', id)
  client.add_param(kparams, 'EmailIP', email_ip)
  perform_request('EmailIngestionProfile','update',kparams,false)
end