Class: Vzaar::Api
- Inherits:
-
Struct
- Object
- Struct
- Vzaar::Api
- Defined in:
- lib/vzaar/api.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #account_type(account_type_id, opts = {}) ⇒ Object
- #add_subtitle(video_id, opts = {}) ⇒ Object
- #conn ⇒ Object
- #delete_video(video_id, opts = {}) ⇒ Object
- #edit_video(video_id, opts = {}) ⇒ Object
- #generate_thumbnail(video_id, opts = {}) ⇒ Object
-
#link_upload(url, opts = {}) ⇒ Object
TODO: remove.
- #process_audio(opts = {}) ⇒ Object
- #process_video(opts = {}) ⇒ Object
-
#s3_upload(file_path) ⇒ Object
TODO: remove.
- #signature(opts = {}) ⇒ Object
- #upload_audio(opts = {}) ⇒ Object
- #upload_thumbnail(video_id, opts = {}) ⇒ Object
- #upload_video(opts = {}) ⇒ Object
- #user_details(login, opts = {}) ⇒ Object
- #video_details(video_id, opts = {}) ⇒ Object
- #video_list(login, opts = {}) ⇒ Object
- #videos(opts = {}) ⇒ Object
- #whoami(opts = {}) ⇒ Object
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options
2 3 4 |
# File 'lib/vzaar/api.rb', line 2 def @options end |
Instance Method Details
#account_type(account_type_id, opts = {}) ⇒ Object
12 13 14 15 |
# File 'lib/vzaar/api.rb', line 12 def account_type(account_type_id, opts={}) _opts = opts.merge(account_type_id: account_type_id) Request::AccountType.new(conn, _opts).execute end |
#add_subtitle(video_id, opts = {}) ⇒ Object
69 70 71 |
# File 'lib/vzaar/api.rb', line 69 def add_subtitle(video_id, opts={}) Request::AddSubtitle.new(conn, opts.merge(video_id: video_id)).execute end |
#conn ⇒ Object
3 4 5 |
# File 'lib/vzaar/api.rb', line 3 def conn @conn ||= Connection.new() end |
#delete_video(video_id, opts = {}) ⇒ Object
33 34 35 |
# File 'lib/vzaar/api.rb', line 33 def delete_video(video_id, opts={}) Request::DeleteVideo.new(conn, opts.merge(video_id: video_id)).execute end |
#edit_video(video_id, opts = {}) ⇒ Object
37 38 39 |
# File 'lib/vzaar/api.rb', line 37 def edit_video(video_id, opts={}) Request::EditVideo.new(conn, opts.merge(video_id: video_id)).execute end |
#generate_thumbnail(video_id, opts = {}) ⇒ Object
77 78 79 |
# File 'lib/vzaar/api.rb', line 77 def generate_thumbnail(video_id, opts={}) Request::GenerateThumbnail.new(conn, opts.merge(video_id: video_id)).execute end |
#link_upload(url, opts = {}) ⇒ Object
TODO: remove
82 83 84 85 86 |
# File 'lib/vzaar/api.rb', line 82 def link_upload(url, opts={}) sig = signature _opts = opts.merge({ guid: sig.guid, key: sig.key, url: url }) Request::LinkUpload.new(conn, _opts).execute end |
#process_audio(opts = {}) ⇒ Object
50 51 52 |
# File 'lib/vzaar/api.rb', line 50 def process_audio(opts={}) Request::ProcessAudio.new(conn, opts).execute end |
#process_video(opts = {}) ⇒ Object
46 47 48 |
# File 'lib/vzaar/api.rb', line 46 def process_video(opts={}) Request::ProcessVideo.new(conn, opts).execute end |
#s3_upload(file_path) ⇒ Object
TODO: remove
89 90 91 92 93 |
# File 'lib/vzaar/api.rb', line 89 def s3_upload(file_path) uploader = Uploader.new(conn, signature, path: file_path) uploader.upload uploader.processing_params end |
#signature(opts = {}) ⇒ Object
41 42 43 44 |
# File 'lib/vzaar/api.rb', line 41 def signature(opts={}) opts.delete(:format) Request::Signature.new(conn, opts).execute end |
#upload_audio(opts = {}) ⇒ Object
54 55 56 57 58 59 |
# File 'lib/vzaar/api.rb', line 54 def upload_audio(opts={}) uploader = Uploader.new(conn, signature(opts), opts) uploader.upload do |u| process_audio(u.processing_params) end end |
#upload_thumbnail(video_id, opts = {}) ⇒ Object
73 74 75 |
# File 'lib/vzaar/api.rb', line 73 def upload_thumbnail(video_id, opts={}) Request::UploadThumbnail.new(conn, opts.merge(video_id: video_id)).execute end |
#upload_video(opts = {}) ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/vzaar/api.rb', line 61 def upload_video(opts={}) sig = signature(opts) uploader = Uploader.new(conn, sig, opts) uploader.upload do |u| process_video(u.processing_params) end end |
#user_details(login, opts = {}) ⇒ Object
17 18 19 |
# File 'lib/vzaar/api.rb', line 17 def user_details(login, opts={}) Request::UserDetails.new(conn, opts.merge(login: login)).execute end |
#video_details(video_id, opts = {}) ⇒ Object
21 22 23 |
# File 'lib/vzaar/api.rb', line 21 def video_details(video_id, opts={}) Request::VideoDetails.new(conn, opts.merge(video_id: video_id)).execute end |
#video_list(login, opts = {}) ⇒ Object
25 26 27 |
# File 'lib/vzaar/api.rb', line 25 def video_list(login, opts={}) Request::VideoList.new(conn, opts.merge(login: login)).execute end |
#videos(opts = {}) ⇒ Object
29 30 31 |
# File 'lib/vzaar/api.rb', line 29 def videos(opts={}) video_list(conn.login, opts.merge({ authenticated: true })) end |