mux_ruby 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +8 -0
  3. data/Gemfile.lock +79 -0
  4. data/LICENSE +7 -0
  5. data/README.md +121 -0
  6. data/Rakefile +10 -0
  7. data/docs/AbridgedVideoView.md +18 -0
  8. data/docs/Asset.md +27 -0
  9. data/docs/AssetErrors.md +9 -0
  10. data/docs/AssetMaster.md +9 -0
  11. data/docs/AssetResponse.md +8 -0
  12. data/docs/AssetStaticRenditions.md +9 -0
  13. data/docs/AssetStaticRenditionsFiles.md +13 -0
  14. data/docs/AssetsApi.md +476 -0
  15. data/docs/BreakdownValue.md +12 -0
  16. data/docs/CreateAssetRequest.md +13 -0
  17. data/docs/CreateLiveStreamRequest.md +9 -0
  18. data/docs/CreatePlaybackIDRequest.md +8 -0
  19. data/docs/CreatePlaybackIDResponse.md +8 -0
  20. data/docs/CreateUploadRequest.md +10 -0
  21. data/docs/DirectUploadsApi.md +214 -0
  22. data/docs/Error.md +15 -0
  23. data/docs/ErrorsApi.md +64 -0
  24. data/docs/ExportsApi.md +56 -0
  25. data/docs/FilterValue.md +9 -0
  26. data/docs/FiltersApi.md +118 -0
  27. data/docs/GetAssetInputInfoResponse.md +8 -0
  28. data/docs/GetAssetPlaybackIDResponse.md +8 -0
  29. data/docs/GetMetricTimeseriesDataResponse.md +10 -0
  30. data/docs/GetOverallValuesResponse.md +10 -0
  31. data/docs/InputFile.md +9 -0
  32. data/docs/InputInfo.md +9 -0
  33. data/docs/InputSettings.md +10 -0
  34. data/docs/InputSettingsOverlaySettings.md +14 -0
  35. data/docs/InputTrack.md +18 -0
  36. data/docs/Insight.md +13 -0
  37. data/docs/ListAllMetricValuesResponse.md +10 -0
  38. data/docs/ListAssetsResponse.md +8 -0
  39. data/docs/ListBreakdownValuesResponse.md +10 -0
  40. data/docs/ListErrorsResponse.md +10 -0
  41. data/docs/ListExportsResponse.md +10 -0
  42. data/docs/ListFilterValuesResponse.md +10 -0
  43. data/docs/ListFiltersResponse.md +10 -0
  44. data/docs/ListFiltersResponseData.md +9 -0
  45. data/docs/ListInsightsResponse.md +10 -0
  46. data/docs/ListLiveStreamsResponse.md +8 -0
  47. data/docs/ListSigningKeysResponse.md +8 -0
  48. data/docs/ListUploadsResponse.md +8 -0
  49. data/docs/ListVideoViewsResponse.md +10 -0
  50. data/docs/LiveStream.md +17 -0
  51. data/docs/LiveStreamResponse.md +8 -0
  52. data/docs/LiveStreamsApi.md +420 -0
  53. data/docs/Metric.md +12 -0
  54. data/docs/MetricsApi.md +322 -0
  55. data/docs/OverallValues.md +11 -0
  56. data/docs/PlaybackID.md +9 -0
  57. data/docs/PlaybackPolicy.md +7 -0
  58. data/docs/Score.md +13 -0
  59. data/docs/SignalLiveStreamCompleteResponse.md +8 -0
  60. data/docs/SigningKey.md +10 -0
  61. data/docs/SigningKeyResponse.md +8 -0
  62. data/docs/Track.md +17 -0
  63. data/docs/URLSigningKeysApi.md +215 -0
  64. data/docs/UpdateAssetMP4SupportRequest.md +8 -0
  65. data/docs/Upload.md +15 -0
  66. data/docs/UploadError.md +9 -0
  67. data/docs/UploadResponse.md +8 -0
  68. data/docs/VideoView.md +117 -0
  69. data/docs/VideoViewEvent.md +11 -0
  70. data/docs/VideoViewResponse.md +9 -0
  71. data/docs/VideoViewsApi.md +126 -0
  72. data/examples/data/exercise-errors.rb +23 -0
  73. data/examples/data/exercise-exports.rb +22 -0
  74. data/examples/data/exercise-filters.rb +29 -0
  75. data/examples/data/exercise-metrics.rb +52 -0
  76. data/examples/data/exercise-video-views.rb +30 -0
  77. data/examples/video/create-live-stream.rb +25 -0
  78. data/examples/video/exercise-assets.rb +95 -0
  79. data/examples/video/exercise-live-streams.rb +89 -0
  80. data/examples/video/exercise-signing-keys.rb +46 -0
  81. data/examples/video/exercise-uploads.rb +49 -0
  82. data/examples/video/ingest.rb +37 -0
  83. data/examples/video/list-everything.rb +48 -0
  84. data/github-ruby-sdk.png +0 -0
  85. data/lib/mux_ruby/api/assets_api.rb +507 -0
  86. data/lib/mux_ruby/api/direct_uploads_api.rb +224 -0
  87. data/lib/mux_ruby/api/errors_api.rb +69 -0
  88. data/lib/mux_ruby/api/exports_api.rb +63 -0
  89. data/lib/mux_ruby/api/filters_api.rb +128 -0
  90. data/lib/mux_ruby/api/live_streams_api.rb +440 -0
  91. data/lib/mux_ruby/api/metrics_api.rb +393 -0
  92. data/lib/mux_ruby/api/url_signing_keys_api.rb +219 -0
  93. data/lib/mux_ruby/api/video_views_api.rb +140 -0
  94. data/lib/mux_ruby/api_client.rb +400 -0
  95. data/lib/mux_ruby/api_error.rb +44 -0
  96. data/lib/mux_ruby/configuration.rb +244 -0
  97. data/lib/mux_ruby/models/abridged_video_view.rb +274 -0
  98. data/lib/mux_ruby/models/asset.rb +409 -0
  99. data/lib/mux_ruby/models/asset_errors.rb +195 -0
  100. data/lib/mux_ruby/models/asset_master.rb +193 -0
  101. data/lib/mux_ruby/models/asset_response.rb +184 -0
  102. data/lib/mux_ruby/models/asset_static_renditions.rb +232 -0
  103. data/lib/mux_ruby/models/asset_static_renditions_files.rb +279 -0
  104. data/lib/mux_ruby/models/breakdown_value.rb +220 -0
  105. data/lib/mux_ruby/models/create_asset_request.rb +267 -0
  106. data/lib/mux_ruby/models/create_live_stream_request.rb +195 -0
  107. data/lib/mux_ruby/models/create_playback_id_request.rb +184 -0
  108. data/lib/mux_ruby/models/create_playback_id_response.rb +184 -0
  109. data/lib/mux_ruby/models/create_upload_request.rb +235 -0
  110. data/lib/mux_ruby/models/error.rb +247 -0
  111. data/lib/mux_ruby/models/filter_value.rb +193 -0
  112. data/lib/mux_ruby/models/get_asset_input_info_response.rb +186 -0
  113. data/lib/mux_ruby/models/get_asset_playback_id_response.rb +184 -0
  114. data/lib/mux_ruby/models/get_metric_timeseries_data_response.rb +206 -0
  115. data/lib/mux_ruby/models/get_overall_values_response.rb +204 -0
  116. data/lib/mux_ruby/models/input_file.rb +195 -0
  117. data/lib/mux_ruby/models/input_info.rb +193 -0
  118. data/lib/mux_ruby/models/input_settings.rb +203 -0
  119. data/lib/mux_ruby/models/input_settings_overlay_settings.rb +238 -0
  120. data/lib/mux_ruby/models/input_track.rb +274 -0
  121. data/lib/mux_ruby/models/insight.rb +229 -0
  122. data/lib/mux_ruby/models/list_all_metric_values_response.rb +206 -0
  123. data/lib/mux_ruby/models/list_assets_response.rb +186 -0
  124. data/lib/mux_ruby/models/list_breakdown_values_response.rb +206 -0
  125. data/lib/mux_ruby/models/list_errors_response.rb +206 -0
  126. data/lib/mux_ruby/models/list_exports_response.rb +206 -0
  127. data/lib/mux_ruby/models/list_filter_values_response.rb +206 -0
  128. data/lib/mux_ruby/models/list_filters_response.rb +204 -0
  129. data/lib/mux_ruby/models/list_filters_response_data.rb +197 -0
  130. data/lib/mux_ruby/models/list_insights_response.rb +206 -0
  131. data/lib/mux_ruby/models/list_live_streams_response.rb +186 -0
  132. data/lib/mux_ruby/models/list_signing_keys_response.rb +186 -0
  133. data/lib/mux_ruby/models/list_uploads_response.rb +186 -0
  134. data/lib/mux_ruby/models/list_video_views_response.rb +206 -0
  135. data/lib/mux_ruby/models/live_stream.rb +269 -0
  136. data/lib/mux_ruby/models/live_stream_response.rb +184 -0
  137. data/lib/mux_ruby/models/metric.rb +220 -0
  138. data/lib/mux_ruby/models/overall_values.rb +211 -0
  139. data/lib/mux_ruby/models/playback_id.rb +193 -0
  140. data/lib/mux_ruby/models/playback_policy.rb +31 -0
  141. data/lib/mux_ruby/models/score.rb +231 -0
  142. data/lib/mux_ruby/models/signal_live_stream_complete_response.rb +184 -0
  143. data/lib/mux_ruby/models/signing_key.rb +202 -0
  144. data/lib/mux_ruby/models/signing_key_response.rb +184 -0
  145. data/lib/mux_ruby/models/track.rb +265 -0
  146. data/lib/mux_ruby/models/update_asset_mp4_support_request.rb +219 -0
  147. data/lib/mux_ruby/models/upload.rb +311 -0
  148. data/lib/mux_ruby/models/upload_error.rb +194 -0
  149. data/lib/mux_ruby/models/upload_response.rb +184 -0
  150. data/lib/mux_ruby/models/video_view.rb +1167 -0
  151. data/lib/mux_ruby/models/video_view_event.rb +211 -0
  152. data/lib/mux_ruby/models/video_view_response.rb +195 -0
  153. data/lib/mux_ruby/version.rb +8 -0
  154. data/lib/mux_ruby.rb +97 -0
  155. data/mux_ruby.gemspec +38 -0
  156. data/spec/api/assets_api_spec.rb +136 -0
  157. data/spec/api/direct_uploads_api_spec.rb +74 -0
  158. data/spec/api/errors_api_spec.rb +41 -0
  159. data/spec/api/exports_api_spec.rb +39 -0
  160. data/spec/api/filters_api_spec.rb +55 -0
  161. data/spec/api/live_streams_api_spec.rb +122 -0
  162. data/spec/api/metrics_api_spec.rb +110 -0
  163. data/spec/api/url_signing_keys_api_spec.rb +76 -0
  164. data/spec/api/video_views_api_spec.rb +58 -0
  165. data/spec/api_client_spec.rb +219 -0
  166. data/spec/configuration_spec.rb +35 -0
  167. data/spec/models/abridged_video_view_spec.rb +94 -0
  168. data/spec/models/asset_errors_spec.rb +40 -0
  169. data/spec/models/asset_master_spec.rb +40 -0
  170. data/spec/models/asset_response_spec.rb +34 -0
  171. data/spec/models/asset_spec.rb +156 -0
  172. data/spec/models/asset_static_renditions_files_spec.rb +72 -0
  173. data/spec/models/asset_static_renditions_spec.rb +44 -0
  174. data/spec/models/breakdown_value_spec.rb +58 -0
  175. data/spec/models/create_asset_request_spec.rb +68 -0
  176. data/spec/models/create_live_stream_request_spec.rb +40 -0
  177. data/spec/models/create_playback_id_request_spec.rb +34 -0
  178. data/spec/models/create_playback_id_response_spec.rb +34 -0
  179. data/spec/models/create_upload_request_spec.rb +46 -0
  180. data/spec/models/error_spec.rb +76 -0
  181. data/spec/models/filter_value_spec.rb +40 -0
  182. data/spec/models/get_asset_input_info_response_spec.rb +34 -0
  183. data/spec/models/get_asset_playback_id_response_spec.rb +34 -0
  184. data/spec/models/get_metric_timeseries_data_response_spec.rb +46 -0
  185. data/spec/models/get_overall_values_response_spec.rb +46 -0
  186. data/spec/models/input_file_spec.rb +40 -0
  187. data/spec/models/input_info_spec.rb +40 -0
  188. data/spec/models/input_settings_overlay_settings_spec.rb +70 -0
  189. data/spec/models/input_settings_spec.rb +46 -0
  190. data/spec/models/input_track_spec.rb +94 -0
  191. data/spec/models/insight_spec.rb +64 -0
  192. data/spec/models/list_all_metric_values_response_spec.rb +46 -0
  193. data/spec/models/list_assets_response_spec.rb +34 -0
  194. data/spec/models/list_breakdown_values_response_spec.rb +46 -0
  195. data/spec/models/list_errors_response_spec.rb +46 -0
  196. data/spec/models/list_exports_response_spec.rb +46 -0
  197. data/spec/models/list_filter_values_response_spec.rb +46 -0
  198. data/spec/models/list_filters_response_data_spec.rb +40 -0
  199. data/spec/models/list_filters_response_spec.rb +46 -0
  200. data/spec/models/list_insights_response_spec.rb +46 -0
  201. data/spec/models/list_live_streams_response_spec.rb +34 -0
  202. data/spec/models/list_signing_keys_response_spec.rb +34 -0
  203. data/spec/models/list_uploads_response_spec.rb +34 -0
  204. data/spec/models/list_video_views_response_spec.rb +46 -0
  205. data/spec/models/live_stream_response_spec.rb +34 -0
  206. data/spec/models/live_stream_spec.rb +88 -0
  207. data/spec/models/metric_spec.rb +58 -0
  208. data/spec/models/overall_values_spec.rb +52 -0
  209. data/spec/models/playback_id_spec.rb +40 -0
  210. data/spec/models/playback_policy_spec.rb +28 -0
  211. data/spec/models/score_spec.rb +64 -0
  212. data/spec/models/signal_live_stream_complete_response_spec.rb +34 -0
  213. data/spec/models/signing_key_response_spec.rb +34 -0
  214. data/spec/models/signing_key_spec.rb +46 -0
  215. data/spec/models/track_spec.rb +88 -0
  216. data/spec/models/update_asset_mp4_support_request_spec.rb +38 -0
  217. data/spec/models/upload_error_spec.rb +40 -0
  218. data/spec/models/upload_response_spec.rb +34 -0
  219. data/spec/models/upload_spec.rb +80 -0
  220. data/spec/models/video_view_event_spec.rb +52 -0
  221. data/spec/models/video_view_response_spec.rb +40 -0
  222. data/spec/models/video_view_spec.rb +688 -0
  223. data/spec/spec_helper.rb +104 -0
  224. metadata +514 -0
@@ -0,0 +1,219 @@
1
+ =begin
2
+ # Mux Ruby - Copyright 2019 Mux Inc.
3
+ # NOTE: This file is auto generated. Do not edit this file manually.
4
+ =end
5
+
6
+ require 'spec_helper'
7
+
8
+ describe MuxRuby::ApiClient do
9
+ context 'initialization' do
10
+ context 'URL stuff' do
11
+ context 'host' do
12
+ it 'removes http from host' do
13
+ MuxRuby.configure { |c| c.host = 'http://example.com' }
14
+ expect(MuxRuby::Configuration.default.host).to eq('example.com')
15
+ end
16
+
17
+ it 'removes https from host' do
18
+ MuxRuby.configure { |c| c.host = 'https://wookiee.com' }
19
+ expect(MuxRuby::ApiClient.default.config.host).to eq('wookiee.com')
20
+ end
21
+
22
+ it 'removes trailing path from host' do
23
+ MuxRuby.configure { |c| c.host = 'hobo.com/v4' }
24
+ expect(MuxRuby::Configuration.default.host).to eq('hobo.com')
25
+ end
26
+ end
27
+
28
+ context 'base_path' do
29
+ it "prepends a slash to base_path" do
30
+ MuxRuby.configure { |c| c.base_path = 'v4/dog' }
31
+ expect(MuxRuby::Configuration.default.base_path).to eq('/v4/dog')
32
+ end
33
+
34
+ it "doesn't prepend a slash if one is already there" do
35
+ MuxRuby.configure { |c| c.base_path = '/v4/dog' }
36
+ expect(MuxRuby::Configuration.default.base_path).to eq('/v4/dog')
37
+ end
38
+
39
+ it "ends up as a blank string if nil" do
40
+ MuxRuby.configure { |c| c.base_path = nil }
41
+ expect(MuxRuby::Configuration.default.base_path).to eq('')
42
+ end
43
+ end
44
+ end
45
+ end
46
+
47
+ describe 'params_encoding in #build_request' do
48
+ let(:config) { MuxRuby::Configuration.new }
49
+ let(:api_client) { MuxRuby::ApiClient.new(config) }
50
+
51
+ it 'defaults to nil' do
52
+ expect(MuxRuby::Configuration.default.params_encoding).to eq(nil)
53
+ expect(config.params_encoding).to eq(nil)
54
+
55
+ request = api_client.build_request(:get, '/test')
56
+ expect(request.options[:params_encoding]).to eq(nil)
57
+ end
58
+
59
+ it 'can be customized' do
60
+ config.params_encoding = :multi
61
+ request = api_client.build_request(:get, '/test')
62
+ expect(request.options[:params_encoding]).to eq(:multi)
63
+ end
64
+ end
65
+
66
+ describe 'timeout in #build_request' do
67
+ let(:config) { MuxRuby::Configuration.new }
68
+ let(:api_client) { MuxRuby::ApiClient.new(config) }
69
+
70
+ it 'defaults to 0' do
71
+ expect(MuxRuby::Configuration.default.timeout).to eq(0)
72
+ expect(config.timeout).to eq(0)
73
+
74
+ request = api_client.build_request(:get, '/test')
75
+ expect(request.options[:timeout]).to eq(0)
76
+ end
77
+
78
+ it 'can be customized' do
79
+ config.timeout = 100
80
+ request = api_client.build_request(:get, '/test')
81
+ expect(request.options[:timeout]).to eq(100)
82
+ end
83
+ end
84
+
85
+ describe '#deserialize' do
86
+ it "handles Array<Integer>" do
87
+ api_client = MuxRuby::ApiClient.new
88
+ headers = { 'Content-Type' => 'application/json' }
89
+ response = double('response', headers: headers, body: '[12, 34]')
90
+ data = api_client.deserialize(response, 'Array<Integer>')
91
+ expect(data).to be_instance_of(Array)
92
+ expect(data).to eq([12, 34])
93
+ end
94
+
95
+ it 'handles Array<Array<Integer>>' do
96
+ api_client = MuxRuby::ApiClient.new
97
+ headers = { 'Content-Type' => 'application/json' }
98
+ response = double('response', headers: headers, body: '[[12, 34], [56]]')
99
+ data = api_client.deserialize(response, 'Array<Array<Integer>>')
100
+ expect(data).to be_instance_of(Array)
101
+ expect(data).to eq([[12, 34], [56]])
102
+ end
103
+
104
+ it 'handles Hash<String, String>' do
105
+ api_client = MuxRuby::ApiClient.new
106
+ headers = { 'Content-Type' => 'application/json' }
107
+ response = double('response', headers: headers, body: '{"message": "Hello"}')
108
+ data = api_client.deserialize(response, 'Hash<String, String>')
109
+ expect(data).to be_instance_of(Hash)
110
+ expect(data).to eq(:message => 'Hello')
111
+ end
112
+ end
113
+
114
+ describe "#object_to_hash" do
115
+ it 'ignores nils and includes empty arrays' do
116
+ # uncomment below to test object_to_hash for model
117
+ # api_client = MuxRuby::ApiClient.new
118
+ # _model = MuxRuby::ModelName.new
119
+ # update the model attribute below
120
+ # _model.id = 1
121
+ # update the expected value (hash) below
122
+ # expected = {id: 1, name: '', tags: []}
123
+ # expect(api_client.object_to_hash(_model)).to eq(expected)
124
+ end
125
+ end
126
+
127
+ describe '#build_collection_param' do
128
+ let(:param) { ['aa', 'bb', 'cc'] }
129
+ let(:api_client) { MuxRuby::ApiClient.new }
130
+
131
+ it 'works for csv' do
132
+ expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
133
+ end
134
+
135
+ it 'works for ssv' do
136
+ expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
137
+ end
138
+
139
+ it 'works for tsv' do
140
+ expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
141
+ end
142
+
143
+ it 'works for pipes' do
144
+ expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
145
+ end
146
+
147
+ it 'works for multi' do
148
+ expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
149
+ end
150
+
151
+ it 'fails for invalid collection format' do
152
+ expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID')
153
+ end
154
+ end
155
+
156
+ describe '#json_mime?' do
157
+ let(:api_client) { MuxRuby::ApiClient.new }
158
+
159
+ it 'works' do
160
+ expect(api_client.json_mime?(nil)).to eq false
161
+ expect(api_client.json_mime?('')).to eq false
162
+
163
+ expect(api_client.json_mime?('application/json')).to eq true
164
+ expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
165
+ expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
166
+
167
+ expect(api_client.json_mime?('application/xml')).to eq false
168
+ expect(api_client.json_mime?('text/plain')).to eq false
169
+ expect(api_client.json_mime?('application/jsonp')).to eq false
170
+ end
171
+ end
172
+
173
+ describe '#select_header_accept' do
174
+ let(:api_client) { MuxRuby::ApiClient.new }
175
+
176
+ it 'works' do
177
+ expect(api_client.select_header_accept(nil)).to be_nil
178
+ expect(api_client.select_header_accept([])).to be_nil
179
+
180
+ expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
181
+ expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
182
+ expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
183
+
184
+ expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
185
+ expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
186
+ end
187
+ end
188
+
189
+ describe '#select_header_content_type' do
190
+ let(:api_client) { MuxRuby::ApiClient.new }
191
+
192
+ it 'works' do
193
+ expect(api_client.select_header_content_type(nil)).to eq('application/json')
194
+ expect(api_client.select_header_content_type([])).to eq('application/json')
195
+
196
+ expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
197
+ expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
198
+ expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
199
+ expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
200
+ expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
201
+ end
202
+ end
203
+
204
+ describe '#sanitize_filename' do
205
+ let(:api_client) { MuxRuby::ApiClient.new }
206
+
207
+ it 'works' do
208
+ expect(api_client.sanitize_filename('sun')).to eq('sun')
209
+ expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
210
+ expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
211
+ expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
212
+ expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
213
+ expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
214
+ expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
215
+ expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
216
+ expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
217
+ end
218
+ end
219
+ end
@@ -0,0 +1,35 @@
1
+ =begin
2
+ # Mux Ruby - Copyright 2019 Mux Inc.
3
+ # NOTE: This file is auto generated. Do not edit this file manually.
4
+ =end
5
+
6
+ require 'spec_helper'
7
+
8
+ describe MuxRuby::Configuration do
9
+ let(:config) { MuxRuby::Configuration.default }
10
+
11
+ before(:each) do
12
+ # uncomment below to setup host and base_path
13
+ # require 'URI'
14
+ # uri = URI.parse("https://api.mux.com")
15
+ # MuxRuby.configure do |c|
16
+ # c.host = uri.host
17
+ # c.base_path = uri.path
18
+ # end
19
+ end
20
+
21
+ describe '#base_url' do
22
+ it 'should have the default value' do
23
+ # uncomment below to test default value of the base path
24
+ # expect(config.base_url).to eq("https://api.mux.com")
25
+ end
26
+
27
+ it 'should remove trailing slashes' do
28
+ [nil, '', '/', '//'].each do |base_path|
29
+ config.base_path = base_path
30
+ # uncomment below to test trailing slashes
31
+ # expect(config.base_url).to eq("https://api.mux.com")
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,94 @@
1
+ =begin
2
+ # Mux Ruby - Copyright 2019 Mux Inc.
3
+ # NOTE: This file is auto generated. Do not edit this file manually.
4
+ =end
5
+
6
+ require 'spec_helper'
7
+ require 'json'
8
+ require 'date'
9
+
10
+ # Unit tests for MuxRuby::AbridgedVideoView
11
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
12
+ # Please update as you see appropriate
13
+ describe 'AbridgedVideoView' do
14
+ before do
15
+ # run before each test
16
+ @instance = MuxRuby::AbridgedVideoView.new
17
+ end
18
+
19
+ after do
20
+ # run after each test
21
+ end
22
+
23
+ describe 'test an instance of AbridgedVideoView' do
24
+ it 'should create an instance of AbridgedVideoView' do
25
+ expect(@instance).to be_instance_of(MuxRuby::AbridgedVideoView)
26
+ end
27
+ end
28
+ describe 'test attribute "id"' do
29
+ it 'should work' do
30
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
31
+ end
32
+ end
33
+
34
+ describe 'test attribute "viewer_os_family"' do
35
+ it 'should work' do
36
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
37
+ end
38
+ end
39
+
40
+ describe 'test attribute "viewer_application_name"' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ describe 'test attribute "video_title"' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
49
+ end
50
+ end
51
+
52
+ describe 'test attribute "total_row_count"' do
53
+ it 'should work' do
54
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+ end
56
+ end
57
+
58
+ describe 'test attribute "player_error_message"' do
59
+ it 'should work' do
60
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
61
+ end
62
+ end
63
+
64
+ describe 'test attribute "player_error_code"' do
65
+ it 'should work' do
66
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
67
+ end
68
+ end
69
+
70
+ describe 'test attribute "error_type_id"' do
71
+ it 'should work' do
72
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
73
+ end
74
+ end
75
+
76
+ describe 'test attribute "country_code"' do
77
+ it 'should work' do
78
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
79
+ end
80
+ end
81
+
82
+ describe 'test attribute "view_start"' do
83
+ it 'should work' do
84
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
85
+ end
86
+ end
87
+
88
+ describe 'test attribute "view_end"' do
89
+ it 'should work' do
90
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
91
+ end
92
+ end
93
+
94
+ end
@@ -0,0 +1,40 @@
1
+ =begin
2
+ # Mux Ruby - Copyright 2019 Mux Inc.
3
+ # NOTE: This file is auto generated. Do not edit this file manually.
4
+ =end
5
+
6
+ require 'spec_helper'
7
+ require 'json'
8
+ require 'date'
9
+
10
+ # Unit tests for MuxRuby::AssetErrors
11
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
12
+ # Please update as you see appropriate
13
+ describe 'AssetErrors' do
14
+ before do
15
+ # run before each test
16
+ @instance = MuxRuby::AssetErrors.new
17
+ end
18
+
19
+ after do
20
+ # run after each test
21
+ end
22
+
23
+ describe 'test an instance of AssetErrors' do
24
+ it 'should create an instance of AssetErrors' do
25
+ expect(@instance).to be_instance_of(MuxRuby::AssetErrors)
26
+ end
27
+ end
28
+ describe 'test attribute "type"' do
29
+ it 'should work' do
30
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
31
+ end
32
+ end
33
+
34
+ describe 'test attribute "messages"' do
35
+ it 'should work' do
36
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
37
+ end
38
+ end
39
+
40
+ end
@@ -0,0 +1,40 @@
1
+ =begin
2
+ # Mux Ruby - Copyright 2019 Mux Inc.
3
+ # NOTE: This file is auto generated. Do not edit this file manually.
4
+ =end
5
+
6
+ require 'spec_helper'
7
+ require 'json'
8
+ require 'date'
9
+
10
+ # Unit tests for MuxRuby::AssetMaster
11
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
12
+ # Please update as you see appropriate
13
+ describe 'AssetMaster' do
14
+ before do
15
+ # run before each test
16
+ @instance = MuxRuby::AssetMaster.new
17
+ end
18
+
19
+ after do
20
+ # run after each test
21
+ end
22
+
23
+ describe 'test an instance of AssetMaster' do
24
+ it 'should create an instance of AssetMaster' do
25
+ expect(@instance).to be_instance_of(MuxRuby::AssetMaster)
26
+ end
27
+ end
28
+ describe 'test attribute "status"' do
29
+ it 'should work' do
30
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
31
+ end
32
+ end
33
+
34
+ describe 'test attribute "url"' do
35
+ it 'should work' do
36
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
37
+ end
38
+ end
39
+
40
+ end
@@ -0,0 +1,34 @@
1
+ =begin
2
+ # Mux Ruby - Copyright 2019 Mux Inc.
3
+ # NOTE: This file is auto generated. Do not edit this file manually.
4
+ =end
5
+
6
+ require 'spec_helper'
7
+ require 'json'
8
+ require 'date'
9
+
10
+ # Unit tests for MuxRuby::AssetResponse
11
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
12
+ # Please update as you see appropriate
13
+ describe 'AssetResponse' do
14
+ before do
15
+ # run before each test
16
+ @instance = MuxRuby::AssetResponse.new
17
+ end
18
+
19
+ after do
20
+ # run after each test
21
+ end
22
+
23
+ describe 'test an instance of AssetResponse' do
24
+ it 'should create an instance of AssetResponse' do
25
+ expect(@instance).to be_instance_of(MuxRuby::AssetResponse)
26
+ end
27
+ end
28
+ describe 'test attribute "data"' do
29
+ it 'should work' do
30
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
31
+ end
32
+ end
33
+
34
+ end
@@ -0,0 +1,156 @@
1
+ =begin
2
+ # Mux Ruby - Copyright 2019 Mux Inc.
3
+ # NOTE: This file is auto generated. Do not edit this file manually.
4
+ =end
5
+
6
+ require 'spec_helper'
7
+ require 'json'
8
+ require 'date'
9
+
10
+ # Unit tests for MuxRuby::Asset
11
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
12
+ # Please update as you see appropriate
13
+ describe 'Asset' do
14
+ before do
15
+ # run before each test
16
+ @instance = MuxRuby::Asset.new
17
+ end
18
+
19
+ after do
20
+ # run after each test
21
+ end
22
+
23
+ describe 'test an instance of Asset' do
24
+ it 'should create an instance of Asset' do
25
+ expect(@instance).to be_instance_of(MuxRuby::Asset)
26
+ end
27
+ end
28
+ describe 'test attribute "id"' do
29
+ it 'should work' do
30
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
31
+ end
32
+ end
33
+
34
+ describe 'test attribute "created_at"' do
35
+ it 'should work' do
36
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
37
+ end
38
+ end
39
+
40
+ describe 'test attribute "deleted_at"' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ describe 'test attribute "status"' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
49
+ end
50
+ end
51
+
52
+ describe 'test attribute "duration"' do
53
+ it 'should work' do
54
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+ end
56
+ end
57
+
58
+ describe 'test attribute "max_stored_resolution"' do
59
+ it 'should work' do
60
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
61
+ end
62
+ end
63
+
64
+ describe 'test attribute "max_stored_frame_rate"' do
65
+ it 'should work' do
66
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
67
+ end
68
+ end
69
+
70
+ describe 'test attribute "aspect_ratio"' do
71
+ it 'should work' do
72
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
73
+ end
74
+ end
75
+
76
+ describe 'test attribute "playback_ids"' do
77
+ it 'should work' do
78
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
79
+ end
80
+ end
81
+
82
+ describe 'test attribute "tracks"' do
83
+ it 'should work' do
84
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
85
+ end
86
+ end
87
+
88
+ describe 'test attribute "demo"' do
89
+ it 'should work' do
90
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
91
+ end
92
+ end
93
+
94
+ describe 'test attribute "errors"' do
95
+ it 'should work' do
96
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
97
+ end
98
+ end
99
+
100
+ describe 'test attribute "per_title_encode"' do
101
+ it 'should work' do
102
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
103
+ end
104
+ end
105
+
106
+ describe 'test attribute "is_live"' do
107
+ it 'should work' do
108
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
109
+ end
110
+ end
111
+
112
+ describe 'test attribute "passthrough"' do
113
+ it 'should work' do
114
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
115
+ end
116
+ end
117
+
118
+ describe 'test attribute "live_stream_id"' do
119
+ it 'should work' do
120
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
121
+ end
122
+ end
123
+
124
+ describe 'test attribute "master"' do
125
+ it 'should work' do
126
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
127
+ end
128
+ end
129
+
130
+ describe 'test attribute "master_access"' do
131
+ it 'should work' do
132
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
133
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["temporary", "none"])
134
+ # validator.allowable_values.each do |value|
135
+ # expect { @instance.master_access = value }.not_to raise_error
136
+ # end
137
+ end
138
+ end
139
+
140
+ describe 'test attribute "mp4_support"' do
141
+ it 'should work' do
142
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
143
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["standard", "none"])
144
+ # validator.allowable_values.each do |value|
145
+ # expect { @instance.mp4_support = value }.not_to raise_error
146
+ # end
147
+ end
148
+ end
149
+
150
+ describe 'test attribute "static_renditions"' do
151
+ it 'should work' do
152
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
153
+ end
154
+ end
155
+
156
+ end
@@ -0,0 +1,72 @@
1
+ =begin
2
+ # Mux Ruby - Copyright 2019 Mux Inc.
3
+ # NOTE: This file is auto generated. Do not edit this file manually.
4
+ =end
5
+
6
+ require 'spec_helper'
7
+ require 'json'
8
+ require 'date'
9
+
10
+ # Unit tests for MuxRuby::AssetStaticRenditionsFiles
11
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
12
+ # Please update as you see appropriate
13
+ describe 'AssetStaticRenditionsFiles' do
14
+ before do
15
+ # run before each test
16
+ @instance = MuxRuby::AssetStaticRenditionsFiles.new
17
+ end
18
+
19
+ after do
20
+ # run after each test
21
+ end
22
+
23
+ describe 'test an instance of AssetStaticRenditionsFiles' do
24
+ it 'should create an instance of AssetStaticRenditionsFiles' do
25
+ expect(@instance).to be_instance_of(MuxRuby::AssetStaticRenditionsFiles)
26
+ end
27
+ end
28
+ describe 'test attribute "name"' do
29
+ it 'should work' do
30
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
31
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["low.mp4", "medium.mp4", "high.mp4"])
32
+ # validator.allowable_values.each do |value|
33
+ # expect { @instance.name = value }.not_to raise_error
34
+ # end
35
+ end
36
+ end
37
+
38
+ describe 'test attribute "ext"' do
39
+ it 'should work' do
40
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
41
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["mp4"])
42
+ # validator.allowable_values.each do |value|
43
+ # expect { @instance.ext = value }.not_to raise_error
44
+ # end
45
+ end
46
+ end
47
+
48
+ describe 'test attribute "height"' do
49
+ it 'should work' do
50
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
51
+ end
52
+ end
53
+
54
+ describe 'test attribute "width"' do
55
+ it 'should work' do
56
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
57
+ end
58
+ end
59
+
60
+ describe 'test attribute "bitrate"' do
61
+ it 'should work' do
62
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
63
+ end
64
+ end
65
+
66
+ describe 'test attribute "filesize"' do
67
+ it 'should work' do
68
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
69
+ end
70
+ end
71
+
72
+ end