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
- #process_audio(opts = {}) ⇒ Object
- #process_video(opts = {}) ⇒ Object
- #s3_upload(file_path) ⇒ Object
- #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
67 68 69 |
# File 'lib/vzaar/api.rb', line 67 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
75 76 77 |
# File 'lib/vzaar/api.rb', line 75 def generate_thumbnail(video_id, opts={}) Request::GenerateThumbnail.new(conn, opts.merge(video_id: video_id)).execute end |
#link_upload(url, opts = {}) ⇒ Object
79 80 81 82 83 |
# File 'lib/vzaar/api.rb', line 79 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
49 50 51 |
# File 'lib/vzaar/api.rb', line 49 def process_audio(opts={}) Request::ProcessAudio.new(conn, opts).execute end |
#process_video(opts = {}) ⇒ Object
45 46 47 |
# File 'lib/vzaar/api.rb', line 45 def process_video(opts={}) Request::ProcessVideo.new(conn, opts).execute end |
#s3_upload(file_path) ⇒ Object
85 86 87 88 89 |
# File 'lib/vzaar/api.rb', line 85 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 |
# File 'lib/vzaar/api.rb', line 41 def signature(opts={}) Request::Signature.new(conn, opts).execute end |
#upload_audio(opts = {}) ⇒ Object
53 54 55 56 57 58 |
# File 'lib/vzaar/api.rb', line 53 def upload_audio(opts={}) uploader = Uploader.new(conn, signature, opts) uploader.upload do |u| process_audio(u.processing_params) end end |
#upload_thumbnail(video_id, opts = {}) ⇒ Object
71 72 73 |
# File 'lib/vzaar/api.rb', line 71 def upload_thumbnail(video_id, opts={}) Request::UploadThumbnail.new(conn, opts.merge(video_id: video_id)).execute end |
#upload_video(opts = {}) ⇒ Object
60 61 62 63 64 65 |
# File 'lib/vzaar/api.rb', line 60 def upload_video(opts={}) uploader = Uploader.new(conn, signature, 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 |