rev-api 2.2.1 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +22 -21
  3. data/.ruby-gemset +1 -1
  4. data/.ruby-version +1 -1
  5. data/.travis.yml +8 -8
  6. data/Gemfile +3 -3
  7. data/LICENSE +191 -191
  8. data/README.md +131 -132
  9. data/Rakefile +13 -13
  10. data/examples/cli.rb +270 -270
  11. data/lib/rev-api.rb +26 -26
  12. data/lib/rev-api/api.rb +326 -326
  13. data/lib/rev-api/api_serializable.rb +30 -30
  14. data/lib/rev-api/exceptions.rb +97 -97
  15. data/lib/rev-api/http_client.rb +97 -97
  16. data/lib/rev-api/models/order.rb +129 -130
  17. data/lib/rev-api/models/order_request.rb +292 -194
  18. data/lib/rev-api/version.rb +3 -3
  19. data/rev-api.gemspec +33 -34
  20. data/spec/fixtures/api_cassettes/cancel_order.yml +38 -38
  21. data/spec/fixtures/api_cassettes/cancel_order_not_allowed.yml +40 -40
  22. data/spec/fixtures/api_cassettes/get_attachment_content.yml +399 -399
  23. data/spec/fixtures/api_cassettes/get_attachment_content_as_pdf.yml +399 -399
  24. data/spec/fixtures/api_cassettes/get_attachment_content_as_text.yml +65 -65
  25. data/spec/fixtures/api_cassettes/get_attachment_content_as_youtube_transcript.yml +66 -66
  26. data/spec/fixtures/api_cassettes/get_attachment_content_unacceptable_representation.yml +42 -42
  27. data/spec/fixtures/api_cassettes/get_attachment_content_with_invalid_id.yml +42 -42
  28. data/spec/fixtures/api_cassettes/get_attachment_metadata.yml +42 -42
  29. data/spec/fixtures/api_cassettes/get_attachment_with_invalid_id.yml +40 -40
  30. data/spec/fixtures/api_cassettes/get_orders.yml +122 -122
  31. data/spec/fixtures/api_cassettes/get_orders_with_clientRef.yml +41 -41
  32. data/spec/fixtures/api_cassettes/get_tc_order.yml +44 -44
  33. data/spec/fixtures/api_cassettes/get_third_page_of_orders.yml +52 -52
  34. data/spec/fixtures/api_cassettes/link_input.yml +44 -44
  35. data/spec/fixtures/api_cassettes/link_input_with_all_attributes.yml +44 -44
  36. data/spec/fixtures/api_cassettes/link_input_with_spaces_in_filename.yml +45 -45
  37. data/spec/fixtures/api_cassettes/not_found_order.yml +42 -42
  38. data/spec/fixtures/api_cassettes/submit_cp_order.yml +44 -45
  39. data/spec/fixtures/api_cassettes/submit_su_order.yml +44 -45
  40. data/spec/fixtures/api_cassettes/submit_tc_order_with_account_balance.yml +44 -45
  41. data/spec/fixtures/api_cassettes/submit_tc_order_with_invalid_request.yml +45 -45
  42. data/spec/fixtures/api_cassettes/submit_tc_order_without_specifying_payment.yml +44 -45
  43. data/spec/fixtures/api_cassettes/unauthorized.yml +42 -42
  44. data/spec/fixtures/api_cassettes/upload_input.yml +90 -90
  45. data/spec/fixtures/api_cassettes/upload_input_with_invalid_content_type.yml +91 -91
  46. data/spec/lib/rev/api_spec.rb +30 -24
  47. data/spec/lib/rev/cancel_order_spec.rb +24 -24
  48. data/spec/lib/rev/exceptions_spec.rb +8 -8
  49. data/spec/lib/rev/get_attachment_content_spec.rb +79 -79
  50. data/spec/lib/rev/get_attachment_metadata_spec.rb +33 -33
  51. data/spec/lib/rev/get_order_spec.rb +52 -52
  52. data/spec/lib/rev/get_orders_spec.rb +62 -62
  53. data/spec/lib/rev/http_client_spec.rb +32 -32
  54. data/spec/lib/rev/models/order_request_spec.rb +122 -11
  55. data/spec/lib/rev/models/order_spec.rb +58 -58
  56. data/spec/lib/rev/post_inputs_spec.rb +94 -94
  57. data/spec/lib/rev/post_order_spec.rb +163 -163
  58. data/spec/spec_helper.rb +47 -49
  59. data/spec/test_helpers.rb +5 -0
  60. metadata +54 -69
  61. data/.coveralls.yml +0 -2
@@ -1,45 +1,44 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://www.revtrunk.com/api/v1/orders
6
- body:
7
- encoding: UTF-8
8
- string: ! '{"payment":{"type":"AccountBalance"},"caption_options":{"inputs":[{"external_link":"http://www.youtube.com/watch?v=UF8uR6Z6KLc"},{"video_length_seconds":900,"external_link":"https://vimeo.com/7976699"}],"output_file_formats":["SubRip"]},"client_ref":"XB432423","comment":"Please
9
- work quickly"}'
10
- headers:
11
- Content-Type:
12
- - application/json
13
- Authorization:
14
- - Rev welcome:AAAAAu/YjZ3phXU5FsF35yIcgiA=
15
- User-Agent:
16
- - RevOfficialRubySDK/1.0.0
17
- response:
18
- status:
19
- code: 201
20
- message: Created
21
- headers:
22
- Cache-Control:
23
- - no-cache
24
- Pragma:
25
- - no-cache
26
- Expires:
27
- - '-1'
28
- Location:
29
- - https://www.revtrunk.com/api/v1/orders/CP12345
30
- Server:
31
- - Microsoft-IIS/7.5
32
- X-Miniprofiler-Ids:
33
- - ! '["43bcb320-a1c9-4e9f-96c1-320e01a31549","ad8a37cd-e5ea-4134-ac9e-0390f722d6f6"]'
34
- X-Powered-By:
35
- - ASP.NET
36
- Date:
37
- - Wed, 18 Sep 2013 00:21:27 GMT
38
- Content-Length:
39
- - '0'
40
- body:
41
- encoding: US-ASCII
42
- string: ''
43
- http_version:
44
- recorded_at: Wed, 18 Sep 2013 00:21:27 GMT
45
- recorded_with: VCR 2.5.0
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.revtrunk.com/api/v1/orders
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"payment":{"type":"AccountBalance"},"caption_options":{"inputs":[{"external_link":"http://www.youtube.com/watch?v=UF8uR6Z6KLc"},{"video_length_seconds":900,"external_link":"https://vimeo.com/7976699"}],"output_file_formats":["SubRip"]},"client_ref":"XB432423"}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Authorization:
13
+ - Rev welcome:AAAAAu/YjZ3phXU5FsF35yIcgiA=
14
+ User-Agent:
15
+ - RevOfficialRubySDK/1.0.0
16
+ response:
17
+ status:
18
+ code: 201
19
+ message: Created
20
+ headers:
21
+ Cache-Control:
22
+ - no-cache
23
+ Pragma:
24
+ - no-cache
25
+ Expires:
26
+ - '-1'
27
+ Location:
28
+ - https://www.revtrunk.com/api/v1/orders/CP12345
29
+ Server:
30
+ - Microsoft-IIS/7.5
31
+ X-Miniprofiler-Ids:
32
+ - ! '["43bcb320-a1c9-4e9f-96c1-320e01a31549","ad8a37cd-e5ea-4134-ac9e-0390f722d6f6"]'
33
+ X-Powered-By:
34
+ - ASP.NET
35
+ Date:
36
+ - Wed, 18 Sep 2013 00:21:27 GMT
37
+ Content-Length:
38
+ - '0'
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ''
42
+ http_version:
43
+ recorded_at: Wed, 18 Sep 2013 00:21:27 GMT
44
+ recorded_with: VCR 2.5.0
@@ -1,45 +1,44 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://www.revtrunk.com/api/v1/orders
6
- body:
7
- encoding: UTF-8
8
- string: ! '{"payment":{"type":"AccountBalance"},"caption_options":{"inputs":[{"external_link":"http://www.youtube.com/watch?v=UF8uR6Z6KLc"},{"video_length_seconds":900,"external_link":"https://vimeo.com/7976699"}],"subtitle_languages":["es","it"],"output_file_formats":["SubRip"]},"client_ref":"XB432423","comment":"Please
9
- work quickly"}'
10
- headers:
11
- Content-Type:
12
- - application/json
13
- Authorization:
14
- - Rev welcome:AAAAAu/YjZ3phXU5FsF35yIcgiA=
15
- User-Agent:
16
- - RevOfficialRubySDK/1.0.0
17
- response:
18
- status:
19
- code: 201
20
- message: Created
21
- headers:
22
- Cache-Control:
23
- - no-cache
24
- Pragma:
25
- - no-cache
26
- Expires:
27
- - '-1'
28
- Location:
29
- - https://www.revtrunk.com/api/v1/orders/CP56789
30
- Server:
31
- - Microsoft-IIS/7.5
32
- X-Miniprofiler-Ids:
33
- - ! '["43bcb320-a1c9-4e9f-96c1-320e01a31549","ad8a37cd-e5ea-4134-ac9e-0390f722d6f6"]'
34
- X-Powered-By:
35
- - ASP.NET
36
- Date:
37
- - Wed, 18 Sep 2013 00:21:27 GMT
38
- Content-Length:
39
- - '0'
40
- body:
41
- encoding: US-ASCII
42
- string: ''
43
- http_version:
44
- recorded_at: Wed, 18 Sep 2013 00:21:27 GMT
45
- recorded_with: VCR 2.5.0
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.revtrunk.com/api/v1/orders
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"payment":{"type":"AccountBalance"},"caption_options":{"inputs":[{"external_link":"http://www.youtube.com/watch?v=UF8uR6Z6KLc"},{"video_length_seconds":900,"external_link":"https://vimeo.com/7976699"}],"subtitle_languages":["es","it"],"output_file_formats":["SubRip"]},"client_ref":"XB432423"}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Authorization:
13
+ - Rev welcome:AAAAAu/YjZ3phXU5FsF35yIcgiA=
14
+ User-Agent:
15
+ - RevOfficialRubySDK/1.0.0
16
+ response:
17
+ status:
18
+ code: 201
19
+ message: Created
20
+ headers:
21
+ Cache-Control:
22
+ - no-cache
23
+ Pragma:
24
+ - no-cache
25
+ Expires:
26
+ - '-1'
27
+ Location:
28
+ - https://www.revtrunk.com/api/v1/orders/CP56789
29
+ Server:
30
+ - Microsoft-IIS/7.5
31
+ X-Miniprofiler-Ids:
32
+ - ! '["43bcb320-a1c9-4e9f-96c1-320e01a31549","ad8a37cd-e5ea-4134-ac9e-0390f722d6f6"]'
33
+ X-Powered-By:
34
+ - ASP.NET
35
+ Date:
36
+ - Wed, 18 Sep 2013 00:21:27 GMT
37
+ Content-Length:
38
+ - '0'
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ''
42
+ http_version:
43
+ recorded_at: Wed, 18 Sep 2013 00:21:27 GMT
44
+ recorded_with: VCR 2.5.0
@@ -1,45 +1,44 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://www.revtrunk.com/api/v1/orders
6
- body:
7
- encoding: UTF-8
8
- string: ! '{"payment":{"type":"AccountBalance"},"transcription_options":{"inputs":[{"external_link":"http://www.youtube.com/watch?v=UF8uR6Z6KLc"},{"audio_length_seconds":900,"external_link":"https://vimeo.com/7976699"}],"verbatim":true,"timestamps":true},"client_ref":"XB432423","comment":"Please
9
- work quickly"}'
10
- headers:
11
- Content-Type:
12
- - application/json
13
- Authorization:
14
- - Rev welcome:AAAAAu/YjZ3phXU5FsF35yIcgiA=
15
- User-Agent:
16
- - RevOfficialRubySDK/1.0.0
17
- response:
18
- status:
19
- code: 201
20
- message: Created
21
- headers:
22
- Cache-Control:
23
- - no-cache
24
- Pragma:
25
- - no-cache
26
- Expires:
27
- - '-1'
28
- Location:
29
- - https://www.revtrunk.com/api/v1/orders/TC0406615008
30
- Server:
31
- - Microsoft-IIS/7.5
32
- X-Miniprofiler-Ids:
33
- - ! '["5b0ebd8f-0726-4610-9bd3-d2738c791f19","c3750845-7fe0-42b2-b928-698a77bd5b41","0d47c50d-e4e3-43ad-bba2-c40966f833e9","be763964-c7a6-4655-950c-1b519805da90","5d9213c0-140f-427e-8a9b-22a73c105b8c","a108c467-b2bd-4fa1-9c6d-5fe331a5e0fc","612832dd-2b2c-47bb-b62b-0fb25513dd15"]'
34
- X-Powered-By:
35
- - ASP.NET
36
- Date:
37
- - Mon, 16 Sep 2013 23:30:37 GMT
38
- Content-Length:
39
- - '0'
40
- body:
41
- encoding: US-ASCII
42
- string: ''
43
- http_version:
44
- recorded_at: Mon, 16 Sep 2013 23:30:36 GMT
45
- recorded_with: VCR 2.5.0
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.revtrunk.com/api/v1/orders
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"payment":{"type":"AccountBalance"},"transcription_options":{"inputs":[{"external_link":"http://www.youtube.com/watch?v=UF8uR6Z6KLc"},{"audio_length_seconds":900,"external_link":"https://vimeo.com/7976699"}],"verbatim":true,"timestamps":true},"client_ref":"XB432423"}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Authorization:
13
+ - Rev welcome:AAAAAu/YjZ3phXU5FsF35yIcgiA=
14
+ User-Agent:
15
+ - RevOfficialRubySDK/1.0.0
16
+ response:
17
+ status:
18
+ code: 201
19
+ message: Created
20
+ headers:
21
+ Cache-Control:
22
+ - no-cache
23
+ Pragma:
24
+ - no-cache
25
+ Expires:
26
+ - '-1'
27
+ Location:
28
+ - https://www.revtrunk.com/api/v1/orders/TC0406615008
29
+ Server:
30
+ - Microsoft-IIS/7.5
31
+ X-Miniprofiler-Ids:
32
+ - ! '["5b0ebd8f-0726-4610-9bd3-d2738c791f19","c3750845-7fe0-42b2-b928-698a77bd5b41","0d47c50d-e4e3-43ad-bba2-c40966f833e9","be763964-c7a6-4655-950c-1b519805da90","5d9213c0-140f-427e-8a9b-22a73c105b8c","a108c467-b2bd-4fa1-9c6d-5fe331a5e0fc","612832dd-2b2c-47bb-b62b-0fb25513dd15"]'
33
+ X-Powered-By:
34
+ - ASP.NET
35
+ Date:
36
+ - Mon, 16 Sep 2013 23:30:37 GMT
37
+ Content-Length:
38
+ - '0'
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ''
42
+ http_version:
43
+ recorded_at: Mon, 16 Sep 2013 23:30:36 GMT
44
+ recorded_with: VCR 2.5.0
@@ -1,45 +1,45 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://www.revtrunk.com/api/v1/orders
6
- body:
7
- encoding: UTF-8
8
- string: ! '{"payment":{"type":"AccountBalance"}}'
9
- headers:
10
- Content-Type:
11
- - application/json
12
- Authorization:
13
- - Rev welcome:AAAAAu/YjZ3phXU5FsF35yIcgiA=
14
- User-Agent:
15
- - RevOfficialRubySDK/1.0.0
16
- response:
17
- status:
18
- code: 400
19
- message: Bad Request
20
- headers:
21
- Cache-Control:
22
- - no-cache
23
- Pragma:
24
- - no-cache
25
- Content-Type:
26
- - application/json; charset=utf-8
27
- Expires:
28
- - '-1'
29
- Server:
30
- - Microsoft-IIS/7.5
31
- X-Miniprofiler-Ids:
32
- - ! '["5b0ebd8f-0726-4610-9bd3-d2738c791f19","c3750845-7fe0-42b2-b928-698a77bd5b41","0d47c50d-e4e3-43ad-bba2-c40966f833e9","be763964-c7a6-4655-950c-1b519805da90","5d9213c0-140f-427e-8a9b-22a73c105b8c","a108c467-b2bd-4fa1-9c6d-5fe331a5e0fc","612832dd-2b2c-47bb-b62b-0fb25513dd15","1e5d0be8-6383-41ca-bb5f-583c28c26591"]'
33
- X-Powered-By:
34
- - ASP.NET
35
- Date:
36
- - Mon, 16 Sep 2013 23:42:39 GMT
37
- Content-Length:
38
- - '100'
39
- body:
40
- encoding: US-ASCII
41
- string: ! '{"code":10004,"message":"You must specify either transcription or caption
42
- options in an order."}'
43
- http_version:
44
- recorded_at: Mon, 16 Sep 2013 23:42:39 GMT
45
- recorded_with: VCR 2.5.0
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.revtrunk.com/api/v1/orders
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"payment":{"type":"AccountBalance"}}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Authorization:
13
+ - Rev welcome:AAAAAu/YjZ3phXU5FsF35yIcgiA=
14
+ User-Agent:
15
+ - RevOfficialRubySDK/1.0.0
16
+ response:
17
+ status:
18
+ code: 400
19
+ message: Bad Request
20
+ headers:
21
+ Cache-Control:
22
+ - no-cache
23
+ Pragma:
24
+ - no-cache
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Expires:
28
+ - '-1'
29
+ Server:
30
+ - Microsoft-IIS/7.5
31
+ X-Miniprofiler-Ids:
32
+ - ! '["5b0ebd8f-0726-4610-9bd3-d2738c791f19","c3750845-7fe0-42b2-b928-698a77bd5b41","0d47c50d-e4e3-43ad-bba2-c40966f833e9","be763964-c7a6-4655-950c-1b519805da90","5d9213c0-140f-427e-8a9b-22a73c105b8c","a108c467-b2bd-4fa1-9c6d-5fe331a5e0fc","612832dd-2b2c-47bb-b62b-0fb25513dd15","1e5d0be8-6383-41ca-bb5f-583c28c26591"]'
33
+ X-Powered-By:
34
+ - ASP.NET
35
+ Date:
36
+ - Mon, 16 Sep 2013 23:42:39 GMT
37
+ Content-Length:
38
+ - '100'
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ! '{"code":10004,"message":"You must specify either transcription or caption
42
+ options in an order."}'
43
+ http_version:
44
+ recorded_at: Mon, 16 Sep 2013 23:42:39 GMT
45
+ recorded_with: VCR 2.5.0
@@ -1,45 +1,44 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://www.revtrunk.com/api/v1/orders
6
- body:
7
- encoding: UTF-8
8
- string: ! '{"payment":{"type":"AccountBalance"},"transcription_options":{"inputs":[{"external_link":"http://www.youtube.com/watch?v=UF8uR6Z6KLc"},{"audio_length_seconds":900,"external_link":"https://vimeo.com/7976699"}],"verbatim":true,"timestamps":true},"client_ref":"XB432423","comment":"Please
9
- work quickly"}'
10
- headers:
11
- Content-Type:
12
- - application/json
13
- Authorization:
14
- - Rev welcome:AAAAAu/YjZ3phXU5FsF35yIcgiA=
15
- User-Agent:
16
- - RevOfficialRubySDK/1.0.0
17
- response:
18
- status:
19
- code: 201
20
- message: Created
21
- headers:
22
- Cache-Control:
23
- - no-cache
24
- Pragma:
25
- - no-cache
26
- Expires:
27
- - '-1'
28
- Location:
29
- - https://www.revtrunk.com/api/v1/orders/TC0406615008
30
- Server:
31
- - Microsoft-IIS/7.5
32
- X-Miniprofiler-Ids:
33
- - ! '["5b0ebd8f-0726-4610-9bd3-d2738c791f19","c3750845-7fe0-42b2-b928-698a77bd5b41","0d47c50d-e4e3-43ad-bba2-c40966f833e9","be763964-c7a6-4655-950c-1b519805da90","5d9213c0-140f-427e-8a9b-22a73c105b8c","a108c467-b2bd-4fa1-9c6d-5fe331a5e0fc","612832dd-2b2c-47bb-b62b-0fb25513dd15"]'
34
- X-Powered-By:
35
- - ASP.NET
36
- Date:
37
- - Mon, 16 Sep 2013 23:30:37 GMT
38
- Content-Length:
39
- - '0'
40
- body:
41
- encoding: US-ASCII
42
- string: ''
43
- http_version:
44
- recorded_at: Mon, 16 Sep 2013 23:30:36 GMT
45
- recorded_with: VCR 2.5.0
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.revtrunk.com/api/v1/orders
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"payment":{"type":"AccountBalance"},"transcription_options":{"inputs":[{"external_link":"http://www.youtube.com/watch?v=UF8uR6Z6KLc"},{"audio_length_seconds":900,"external_link":"https://vimeo.com/7976699"}],"verbatim":true,"timestamps":true},"client_ref":"XB432423"}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Authorization:
13
+ - Rev welcome:AAAAAu/YjZ3phXU5FsF35yIcgiA=
14
+ User-Agent:
15
+ - RevOfficialRubySDK/1.0.0
16
+ response:
17
+ status:
18
+ code: 201
19
+ message: Created
20
+ headers:
21
+ Cache-Control:
22
+ - no-cache
23
+ Pragma:
24
+ - no-cache
25
+ Expires:
26
+ - '-1'
27
+ Location:
28
+ - https://www.revtrunk.com/api/v1/orders/TC0406615008
29
+ Server:
30
+ - Microsoft-IIS/7.5
31
+ X-Miniprofiler-Ids:
32
+ - ! '["5b0ebd8f-0726-4610-9bd3-d2738c791f19","c3750845-7fe0-42b2-b928-698a77bd5b41","0d47c50d-e4e3-43ad-bba2-c40966f833e9","be763964-c7a6-4655-950c-1b519805da90","5d9213c0-140f-427e-8a9b-22a73c105b8c","a108c467-b2bd-4fa1-9c6d-5fe331a5e0fc","612832dd-2b2c-47bb-b62b-0fb25513dd15"]'
33
+ X-Powered-By:
34
+ - ASP.NET
35
+ Date:
36
+ - Mon, 16 Sep 2013 23:30:37 GMT
37
+ Content-Length:
38
+ - '0'
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ''
42
+ http_version:
43
+ recorded_at: Mon, 16 Sep 2013 23:30:36 GMT
44
+ recorded_with: VCR 2.5.0