vzaar_api 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +2 -0
  3. data/README.md +2 -2
  4. data/lib/vzaar_api/abstract.rb +1 -1
  5. data/lib/vzaar_api/lib/active_object.rb +9 -4
  6. data/lib/vzaar_api/lib/api.rb +2 -1
  7. data/lib/vzaar_api/lib/has_resource_url.rb +7 -4
  8. data/lib/vzaar_api/lib/paged_resource.rb +7 -2
  9. data/lib/vzaar_api/lib/will_paginate.rb +5 -1
  10. data/lib/vzaar_api/playlist.rb +1 -1
  11. data/lib/vzaar_api/signature/abstract.rb +17 -4
  12. data/lib/vzaar_api/signature/multipart.rb +1 -1
  13. data/lib/vzaar_api/signature/single.rb +1 -1
  14. data/lib/vzaar_api/strategy/image/abstract.rb +25 -0
  15. data/lib/vzaar_api/strategy/image/create.rb +21 -0
  16. data/lib/vzaar_api/strategy/image/update.rb +11 -0
  17. data/lib/vzaar_api/strategy/subtitle/create.rb +36 -0
  18. data/lib/vzaar_api/upload/s3.rb +2 -4
  19. data/lib/vzaar_api/version.rb +1 -1
  20. data/lib/vzaar_api/video/subtitle.rb +38 -0
  21. data/lib/vzaar_api/video.rb +8 -1
  22. data/lib/vzaar_api.rb +5 -0
  23. data/spec/fixtures/vcr_cassettes/signature/multipart_201.yml +20 -20
  24. data/spec/fixtures/vcr_cassettes/signature/multipart_422.yml +12 -12
  25. data/spec/fixtures/vcr_cassettes/signature/single_201.yml +20 -20
  26. data/spec/fixtures/vcr_cassettes/signature/single_422.yml +11 -11
  27. data/spec/fixtures/vcr_cassettes/subtitles/create_201.yml +58 -0
  28. data/spec/fixtures/vcr_cassettes/subtitles/create_422.yml +48 -0
  29. data/spec/fixtures/vcr_cassettes/subtitles/create_from_file_201.yml +63 -0
  30. data/spec/fixtures/vcr_cassettes/subtitles/delete_204.yml +52 -0
  31. data/spec/fixtures/vcr_cassettes/subtitles/paginate.yml +58 -0
  32. data/spec/fixtures/vcr_cassettes/subtitles/paginate_first.yml +58 -0
  33. data/spec/fixtures/vcr_cassettes/subtitles/paginate_last.yml +113 -0
  34. data/spec/fixtures/vcr_cassettes/subtitles/paginate_next.yml +113 -0
  35. data/spec/fixtures/vcr_cassettes/subtitles/update_200.yml +113 -0
  36. data/spec/fixtures/vcr_cassettes/subtitles/update_422.yml +104 -0
  37. data/spec/fixtures/vcr_cassettes/upload/multipart_201.yml +162 -144
  38. data/spec/fixtures/vcr_cassettes/upload/multipart_403.yml +12 -116545
  39. data/spec/fixtures/vcr_cassettes/upload/single_201.yml +12 -23353
  40. data/spec/fixtures/vcr_cassettes/upload/single_403.yml +12 -23341
  41. data/spec/fixtures/vcr_cassettes/videos/create/link_201.yml +24 -22
  42. data/spec/fixtures/vcr_cassettes/videos/create/path_201.yml +55 -23394
  43. data/spec/fixtures/vcr_cassettes/videos/image_frame_202.yml +61 -0
  44. data/spec/fixtures/vcr_cassettes/videos/image_frame_422.yml +48 -0
  45. data/spec/fixtures/vcr_cassettes/videos/image_upload_frame_202.yml +62 -0
  46. data/spec/fixtures/vcr_cassettes/videos/image_upload_frame_422.yml +49 -0
  47. data/spec/support/files/drex.jpg +0 -0
  48. data/spec/support/files/fr.vtt +4 -0
  49. data/spec/support/helpers.rb +2 -3
  50. data/spec/support/shared_examples.rb +23 -0
  51. data/spec/vzaar_api/signature/multipart_spec.rb +34 -21
  52. data/spec/vzaar_api/signature/single_spec.rb +27 -16
  53. data/spec/vzaar_api/subtitle_spec.rb +206 -0
  54. data/spec/vzaar_api/upload/s3_spec.rb +40 -37
  55. data/spec/vzaar_api/video_spec.rb +55 -2
  56. metadata +45 -4
@@ -0,0 +1,113 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://app.vzaar.localhost/api/v2/videos/14370501/subtitles/?page=1&per_page=1
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - HTTPClient/1.0 (2.8.3, ruby 2.3.0 (2015-12-25))
12
+ Accept:
13
+ - "*/*"
14
+ Date:
15
+ - Thu, 06 Dec 2018 16:10:00 GMT
16
+ X-Auth-Token:
17
+ - pVrjGuKWP27U_kz4anfy
18
+ X-Client-Id:
19
+ - glide-franca-raise
20
+ Content-Type:
21
+ - application/json
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Cache-Control:
28
+ - max-age=0, private, must-revalidate
29
+ Content-Type:
30
+ - application/json
31
+ Date:
32
+ - Thu, 06 Dec 2018 16:10:01 GMT
33
+ Etag:
34
+ - W/"81da6eae4099f0c3cb8678f7f1b3b92d"
35
+ Server:
36
+ - nginx
37
+ X-Ratelimit-Limit:
38
+ - '200'
39
+ X-Ratelimit-Remaining:
40
+ - '199'
41
+ X-Ratelimit-Reset:
42
+ - '1544112660'
43
+ X-Ratelimit-Reset-In:
44
+ - 59 seconds
45
+ X-Request-Id:
46
+ - b599a106-ba34-48ed-88cd-d85292bdb98d
47
+ X-Runtime:
48
+ - '0.035921'
49
+ Content-Length:
50
+ - '543'
51
+ Connection:
52
+ - keep-alive
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"data":[{"id":26864,"language":"Serbian","code":"sr","title":"14370501-sr.srt","url":"https://view.vzaar.localhost/subtitles/26864","created_at":"2018-12-04T09:30:34.000Z","updated_at":"2018-12-06T15:58:45.000Z"}],"meta":{"total_count":3,"links":{"first":"https://app.vzaar.localhost/api/v2/videos/14370501/subtitles?id=14370501&page=1&per_page=1","next":"https://app.vzaar.localhost/api/v2/videos/14370501/subtitles?id=14370501&page=2&per_page=1","previous":null,"last":"https://app.vzaar.localhost/api/v2/videos/14370501/subtitles?id=14370501&page=3&per_page=1"}}}'
56
+ http_version:
57
+ recorded_at: Thu, 06 Dec 2018 16:10:01 GMT
58
+ - request:
59
+ method: get
60
+ uri: https://app.vzaar.localhost/api/v2/videos/14370501/subtitles
61
+ body:
62
+ encoding: UTF-8
63
+ string: ''
64
+ headers:
65
+ User-Agent:
66
+ - HTTPClient/1.0 (2.8.3, ruby 2.3.0 (2015-12-25))
67
+ Accept:
68
+ - "*/*"
69
+ Date:
70
+ - Thu, 06 Dec 2018 16:10:07 GMT
71
+ X-Auth-Token:
72
+ - pVrjGuKWP27U_kz4anfy
73
+ X-Client-Id:
74
+ - glide-franca-raise
75
+ Content-Type:
76
+ - application/json
77
+ response:
78
+ status:
79
+ code: 200
80
+ message: OK
81
+ headers:
82
+ Cache-Control:
83
+ - max-age=0, private, must-revalidate
84
+ Content-Type:
85
+ - application/json
86
+ Date:
87
+ - Thu, 06 Dec 2018 16:10:08 GMT
88
+ Etag:
89
+ - W/"6f99df74c327f9989c50253e53c7cd2c"
90
+ Server:
91
+ - nginx
92
+ X-Ratelimit-Limit:
93
+ - '200'
94
+ X-Ratelimit-Remaining:
95
+ - '198'
96
+ X-Ratelimit-Reset:
97
+ - '1544112660'
98
+ X-Ratelimit-Reset-In:
99
+ - 52 seconds
100
+ X-Request-Id:
101
+ - d158999f-c51a-4447-80ac-643d5bd6b34b
102
+ X-Runtime:
103
+ - '0.020520'
104
+ Content-Length:
105
+ - '624'
106
+ Connection:
107
+ - keep-alive
108
+ body:
109
+ encoding: UTF-8
110
+ string: '{"data":[{"id":26887,"language":"German","code":"de","title":"14370501-de.vtt","url":"https://view.vzaar.localhost/subtitles/26887","created_at":"2018-12-06T14:29:41.000Z","updated_at":"2018-12-06T14:29:43.000Z"}],"meta":{"total_count":3,"links":{"first":"https://app.vzaar.localhost/api/v2/videos/14370501/subtitles?id=14370501&page=1&per_page=1","next":"https://app.vzaar.localhost/api/v2/videos/14370501/subtitles?id=14370501&page=3&per_page=1","previous":"https://app.vzaar.localhost/api/v2/videos/14370501/subtitles?id=14370501&page=1&per_page=1","last":"https://app.vzaar.localhost/api/v2/videos/14370501/subtitles?id=14370501&page=3&per_page=1"}}}'
111
+ http_version:
112
+ recorded_at: Thu, 06 Dec 2018 16:10:08 GMT
113
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,113 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://app.vzaar.localhost/api/v2/videos/14370501/subtitles/?page=1&per_page=3
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - HTTPClient/1.0 (2.8.3, ruby 2.3.0 (2015-12-25))
12
+ Accept:
13
+ - "*/*"
14
+ Date:
15
+ - Thu, 06 Dec 2018 15:58:40 GMT
16
+ X-Auth-Token:
17
+ - pVrjGuKWP27U_kz4anfy
18
+ X-Client-Id:
19
+ - glide-franca-raise
20
+ Content-Type:
21
+ - application/json
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Cache-Control:
28
+ - max-age=0, private, must-revalidate
29
+ Content-Type:
30
+ - application/json
31
+ Date:
32
+ - Thu, 06 Dec 2018 15:58:40 GMT
33
+ Etag:
34
+ - W/"fd8f7f5f21c6c01185efbfb4d5a2c189"
35
+ Server:
36
+ - nginx
37
+ X-Ratelimit-Limit:
38
+ - '200'
39
+ X-Ratelimit-Remaining:
40
+ - '199'
41
+ X-Ratelimit-Reset:
42
+ - '1544111940'
43
+ X-Ratelimit-Reset-In:
44
+ - 20 seconds
45
+ X-Request-Id:
46
+ - 8b1d6c03-afcb-45ee-80ce-0ff2be195cc4
47
+ X-Runtime:
48
+ - '0.043690'
49
+ Content-Length:
50
+ - '693'
51
+ Connection:
52
+ - keep-alive
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"data":[{"id":26864,"language":"Russian","code":"ru","title":"14370501-ru.srt","url":"https://view.vzaar.localhost/subtitles/26864","created_at":"2018-12-04T09:30:34.000Z","updated_at":"2018-12-04T09:44:37.000Z"},{"id":26887,"language":"German","code":"de","title":"14370501-de.vtt","url":"https://view.vzaar.localhost/subtitles/26887","created_at":"2018-12-06T14:29:41.000Z","updated_at":"2018-12-06T14:29:43.000Z"},{"id":26888,"language":"Polish","code":"pl","title":"14370501-pl.vtt","url":"https://view.vzaar.localhost/subtitles/26888","created_at":"2018-12-06T14:33:29.000Z","updated_at":"2018-12-06T14:33:33.000Z"}],"meta":{"total_count":3,"links":{"first":null,"next":null,"previous":null,"last":null}}}'
56
+ http_version:
57
+ recorded_at: Thu, 06 Dec 2018 15:58:41 GMT
58
+ - request:
59
+ method: patch
60
+ uri: https://app.vzaar.localhost/api/v2/videos/14370501/subtitles/26864
61
+ body:
62
+ encoding: UTF-8
63
+ string: '{"code":"sr"}'
64
+ headers:
65
+ User-Agent:
66
+ - HTTPClient/1.0 (2.8.3, ruby 2.3.0 (2015-12-25))
67
+ Accept:
68
+ - "*/*"
69
+ Date:
70
+ - Thu, 06 Dec 2018 15:58:41 GMT
71
+ X-Auth-Token:
72
+ - pVrjGuKWP27U_kz4anfy
73
+ X-Client-Id:
74
+ - glide-franca-raise
75
+ Content-Type:
76
+ - application/json
77
+ response:
78
+ status:
79
+ code: 200
80
+ message: OK
81
+ headers:
82
+ Cache-Control:
83
+ - max-age=0, private, must-revalidate
84
+ Content-Type:
85
+ - application/json
86
+ Date:
87
+ - Thu, 06 Dec 2018 15:58:41 GMT
88
+ Etag:
89
+ - W/"aa3be874ec5caa9c777c0374076716a0"
90
+ Server:
91
+ - nginx
92
+ X-Ratelimit-Limit:
93
+ - '200'
94
+ X-Ratelimit-Remaining:
95
+ - '198'
96
+ X-Ratelimit-Reset:
97
+ - '1544111940'
98
+ X-Ratelimit-Reset-In:
99
+ - 19 seconds
100
+ X-Request-Id:
101
+ - 68a0fdd0-db11-4d11-8783-69db707f8d79
102
+ X-Runtime:
103
+ - '0.080168'
104
+ Content-Length:
105
+ - '207'
106
+ Connection:
107
+ - keep-alive
108
+ body:
109
+ encoding: UTF-8
110
+ string: '{"data":{"id":26864,"language":"Serbian","code":"sr","title":"14370501-sr.srt","url":"https://view.vzaar.localhost/subtitles/26864","created_at":"2018-12-04T09:30:34.000Z","updated_at":"2018-12-06T15:58:41.504Z"}}'
111
+ http_version:
112
+ recorded_at: Thu, 06 Dec 2018 15:58:41 GMT
113
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,104 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://app.vzaar.localhost/api/v2/videos/14370501/subtitles/?page=1&per_page=3
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - HTTPClient/1.0 (2.8.3, ruby 2.3.0 (2015-12-25))
12
+ Accept:
13
+ - "*/*"
14
+ Date:
15
+ - Thu, 06 Dec 2018 16:19:47 GMT
16
+ X-Auth-Token:
17
+ - pVrjGuKWP27U_kz4anfy
18
+ X-Client-Id:
19
+ - glide-franca-raise
20
+ Content-Type:
21
+ - application/json
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Cache-Control:
28
+ - max-age=0, private, must-revalidate
29
+ Content-Type:
30
+ - application/json
31
+ Date:
32
+ - Thu, 06 Dec 2018 16:19:47 GMT
33
+ Etag:
34
+ - W/"0eda5b588a78c450e9a79cec724adda5"
35
+ Server:
36
+ - nginx
37
+ X-Ratelimit-Limit:
38
+ - '200'
39
+ X-Ratelimit-Remaining:
40
+ - '199'
41
+ X-Ratelimit-Reset:
42
+ - '1544113200'
43
+ X-Ratelimit-Reset-In:
44
+ - 13 seconds
45
+ X-Request-Id:
46
+ - 373ebbec-62bb-425a-82de-9f494cb0aefa
47
+ X-Runtime:
48
+ - '0.055563'
49
+ Content-Length:
50
+ - '693'
51
+ Connection:
52
+ - keep-alive
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"data":[{"id":26864,"language":"Serbian","code":"sr","title":"14370501-sr.srt","url":"https://view.vzaar.localhost/subtitles/26864","created_at":"2018-12-04T09:30:34.000Z","updated_at":"2018-12-06T15:58:45.000Z"},{"id":26887,"language":"German","code":"de","title":"14370501-de.vtt","url":"https://view.vzaar.localhost/subtitles/26887","created_at":"2018-12-06T14:29:41.000Z","updated_at":"2018-12-06T14:29:43.000Z"},{"id":26888,"language":"Polish","code":"pl","title":"14370501-pl.vtt","url":"https://view.vzaar.localhost/subtitles/26888","created_at":"2018-12-06T14:33:29.000Z","updated_at":"2018-12-06T14:33:33.000Z"}],"meta":{"total_count":3,"links":{"first":null,"next":null,"previous":null,"last":null}}}'
56
+ http_version:
57
+ recorded_at: Thu, 06 Dec 2018 16:19:47 GMT
58
+ - request:
59
+ method: patch
60
+ uri: https://app.vzaar.localhost/api/v2/videos/14370501/subtitles/26864
61
+ body:
62
+ encoding: UTF-8
63
+ string: '{"code":""}'
64
+ headers:
65
+ User-Agent:
66
+ - HTTPClient/1.0 (2.8.3, ruby 2.3.0 (2015-12-25))
67
+ Accept:
68
+ - "*/*"
69
+ Date:
70
+ - Thu, 06 Dec 2018 16:19:47 GMT
71
+ X-Auth-Token:
72
+ - pVrjGuKWP27U_kz4anfy
73
+ X-Client-Id:
74
+ - glide-franca-raise
75
+ Content-Type:
76
+ - application/json
77
+ response:
78
+ status:
79
+ code: 422
80
+ message: Unprocessable Entity
81
+ headers:
82
+ Cache-Control:
83
+ - no-cache
84
+ Content-Type:
85
+ - application/json
86
+ Date:
87
+ - Thu, 06 Dec 2018 16:19:48 GMT
88
+ Server:
89
+ - nginx
90
+ X-Request-Id:
91
+ - 8ae7cd30-dd9b-4d50-a3bc-d025ecde1f28
92
+ X-Runtime:
93
+ - '0.055936'
94
+ Content-Length:
95
+ - '126'
96
+ Connection:
97
+ - keep-alive
98
+ body:
99
+ encoding: UTF-8
100
+ string: '{"errors":[{"message":"Invalid parameters","detail":"Validation failed:
101
+ Code field cannot be blank, Language not supported"}]}'
102
+ http_version:
103
+ recorded_at: Thu, 06 Dec 2018 16:19:48 GMT
104
+ recorded_with: VCR 3.0.3