Class: Vzaar::Api

Inherits:
Struct
  • Object
show all
Defined in:
lib/vzaar/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#connObject

Returns the value of attribute conn

Returns:

  • (Object)

    the current value of conn



2
3
4
# File 'lib/vzaar/api.rb', line 2

def conn
  @conn
end

Instance Method Details

#account_type(account_type_id, opts = {}) ⇒ Object



9
10
11
12
# File 'lib/vzaar/api.rb', line 9

def (, opts={})
  _opts = opts.merge(account_type_id: )
  Request::AccountType.new(conn, _opts).execute
end

#add_subtitle(video_id, opts = {}) ⇒ Object



53
54
55
# File 'lib/vzaar/api.rb', line 53

def add_subtitle(video_id, opts={})
  Request::AddSubtitle.new(conn, opts.merge(video_id: video_id)).execute
end

#delete_video(video_id, opts = {}) ⇒ Object



30
31
32
# File 'lib/vzaar/api.rb', line 30

def delete_video(video_id, opts={})
  Request::DeleteVideo.new(conn, opts.merge(video_id: video_id)).execute
end

#edit_video(video_id, opts = {}) ⇒ Object



34
35
36
# File 'lib/vzaar/api.rb', line 34

def edit_video(video_id, opts={})
  Request::EditVideo.new(conn, opts.merge(video_id: video_id)).execute
end

#generate_thumbnail(video_id, opts = {}) ⇒ Object



61
62
63
# File 'lib/vzaar/api.rb', line 61

def generate_thumbnail(video_id, opts={})
  Request::GenerateThumbnail.new(conn, opts.merge(video_id: video_id)).execute
end


65
66
67
68
69
# File 'lib/vzaar/api.rb', line 65

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_video(opts = {}) ⇒ Object



42
43
44
# File 'lib/vzaar/api.rb', line 42

def process_video(opts={})
  Request::ProcessVideo.new(conn, opts).execute
end

#signature(opts = {}) ⇒ Object



38
39
40
# File 'lib/vzaar/api.rb', line 38

def signature(opts={})
  Request::Signature.new(conn, opts).execute
end

#upload_thumbnail(video_id, opts = {}) ⇒ Object



57
58
59
# File 'lib/vzaar/api.rb', line 57

def upload_thumbnail(video_id, opts={})
  Request::UploadThumbnail.new(conn, opts.merge(video_id: video_id)).execute
end

#upload_video(opts = {}) ⇒ Object



46
47
48
49
50
51
# File 'lib/vzaar/api.rb', line 46

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



14
15
16
# File 'lib/vzaar/api.rb', line 14

def user_details(, opts={})
  Request::UserDetails.new(conn, opts.merge(login: )).execute
end

#video_details(video_id, opts = {}) ⇒ Object



18
19
20
# File 'lib/vzaar/api.rb', line 18

def video_details(video_id, opts={})
  Request::VideoDetails.new(conn, opts.merge(video_id: video_id)).execute
end

#video_list(login, opts = {}) ⇒ Object



22
23
24
# File 'lib/vzaar/api.rb', line 22

def video_list(, opts={})
  Request::VideoList.new(conn, opts.merge(login: )).execute
end

#videos(opts = {}) ⇒ Object



26
27
28
# File 'lib/vzaar/api.rb', line 26

def videos(opts={})
  video_list(conn., { authenticated: true, page: opts[:page] })
end

#whoami(opts = {}) ⇒ Object



4
5
6
7
# File 'lib/vzaar/api.rb', line 4

def whoami(opts={})
  resource = Request::WhoAmI.new(conn, opts).execute
  resource.
end