Class: Kaltura::KalturaShortLinkService
- Inherits:
-
KalturaServiceBase
- Object
- KalturaServiceBase
- Kaltura::KalturaShortLinkService
- Defined in:
- lib/kaltura_plugins/kaltura_short_link_client_plugin.rb
Overview
Short link service
Instance Attribute Summary
Attributes inherited from KalturaServiceBase
Instance Method Summary collapse
-
#add(short_link) ⇒ Object
Allows you to add a short link object.
-
#delete(id) ⇒ Object
Mark the short link as deleted.
-
#get(id) ⇒ Object
Retrieve an short link object by id.
-
#goto(id, proxy = false) ⇒ Object
Serves short link.
-
#initialize(client) ⇒ KalturaShortLinkService
constructor
A new instance of KalturaShortLinkService.
-
#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ Object
List short link objects by filter and pager.
-
#update(id, short_link) ⇒ Object
Update exisitng short link.
Constructor Details
#initialize(client) ⇒ KalturaShortLinkService
Returns a new instance of KalturaShortLinkService.
143 144 145 |
# File 'lib/kaltura_plugins/kaltura_short_link_client_plugin.rb', line 143 def initialize(client) super(client) end |
Instance Method Details
#add(short_link) ⇒ Object
Allows you to add a short link object
162 163 164 165 166 167 168 169 170 |
# File 'lib/kaltura_plugins/kaltura_short_link_client_plugin.rb', line 162 def add(short_link) kparams = {} client.add_param(kparams, 'shortLink', short_link); client.queue_service_action_call('shortlink_shortlink', 'add', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |
#delete(id) ⇒ Object
Mark the short link as deleted
199 200 201 202 203 204 205 206 207 |
# File 'lib/kaltura_plugins/kaltura_short_link_client_plugin.rb', line 199 def delete(id) kparams = {} client.add_param(kparams, 'id', id); client.queue_service_action_call('shortlink_shortlink', 'delete', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |
#get(id) ⇒ Object
Retrieve an short link object by id
174 175 176 177 178 179 180 181 182 |
# File 'lib/kaltura_plugins/kaltura_short_link_client_plugin.rb', line 174 def get(id) kparams = {} client.add_param(kparams, 'id', id); client.queue_service_action_call('shortlink_shortlink', 'get', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |
#goto(id, proxy = false) ⇒ Object
Serves short link
211 212 213 214 215 216 217 218 |
# File 'lib/kaltura_plugins/kaltura_short_link_client_plugin.rb', line 211 def goto(id, proxy=false) kparams = {} client.add_param(kparams, 'id', id); # proxy the response instead of redirect client.add_param(kparams, 'proxy', proxy); client.queue_service_action_call('shortlink_shortlink', 'goto', kparams); return client.get_serve_url(); end |
#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ Object
List short link objects by filter and pager
149 150 151 152 153 154 155 156 157 158 |
# File 'lib/kaltura_plugins/kaltura_short_link_client_plugin.rb', line 149 def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'filter', filter); client.add_param(kparams, 'pager', pager); client.queue_service_action_call('shortlink_shortlink', 'list', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |
#update(id, short_link) ⇒ Object
Update exisitng short link
186 187 188 189 190 191 192 193 194 195 |
# File 'lib/kaltura_plugins/kaltura_short_link_client_plugin.rb', line 186 def update(id, short_link) kparams = {} client.add_param(kparams, 'id', id); client.add_param(kparams, 'shortLink', short_link); client.queue_service_action_call('shortlink_shortlink', 'update', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |