mux_ruby 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +79 -0
- data/LICENSE +7 -0
- data/README.md +121 -0
- data/Rakefile +10 -0
- data/docs/AbridgedVideoView.md +18 -0
- data/docs/Asset.md +27 -0
- data/docs/AssetErrors.md +9 -0
- data/docs/AssetMaster.md +9 -0
- data/docs/AssetResponse.md +8 -0
- data/docs/AssetStaticRenditions.md +9 -0
- data/docs/AssetStaticRenditionsFiles.md +13 -0
- data/docs/AssetsApi.md +476 -0
- data/docs/BreakdownValue.md +12 -0
- data/docs/CreateAssetRequest.md +13 -0
- data/docs/CreateLiveStreamRequest.md +9 -0
- data/docs/CreatePlaybackIDRequest.md +8 -0
- data/docs/CreatePlaybackIDResponse.md +8 -0
- data/docs/CreateUploadRequest.md +10 -0
- data/docs/DirectUploadsApi.md +214 -0
- data/docs/Error.md +15 -0
- data/docs/ErrorsApi.md +64 -0
- data/docs/ExportsApi.md +56 -0
- data/docs/FilterValue.md +9 -0
- data/docs/FiltersApi.md +118 -0
- data/docs/GetAssetInputInfoResponse.md +8 -0
- data/docs/GetAssetPlaybackIDResponse.md +8 -0
- data/docs/GetMetricTimeseriesDataResponse.md +10 -0
- data/docs/GetOverallValuesResponse.md +10 -0
- data/docs/InputFile.md +9 -0
- data/docs/InputInfo.md +9 -0
- data/docs/InputSettings.md +10 -0
- data/docs/InputSettingsOverlaySettings.md +14 -0
- data/docs/InputTrack.md +18 -0
- data/docs/Insight.md +13 -0
- data/docs/ListAllMetricValuesResponse.md +10 -0
- data/docs/ListAssetsResponse.md +8 -0
- data/docs/ListBreakdownValuesResponse.md +10 -0
- data/docs/ListErrorsResponse.md +10 -0
- data/docs/ListExportsResponse.md +10 -0
- data/docs/ListFilterValuesResponse.md +10 -0
- data/docs/ListFiltersResponse.md +10 -0
- data/docs/ListFiltersResponseData.md +9 -0
- data/docs/ListInsightsResponse.md +10 -0
- data/docs/ListLiveStreamsResponse.md +8 -0
- data/docs/ListSigningKeysResponse.md +8 -0
- data/docs/ListUploadsResponse.md +8 -0
- data/docs/ListVideoViewsResponse.md +10 -0
- data/docs/LiveStream.md +17 -0
- data/docs/LiveStreamResponse.md +8 -0
- data/docs/LiveStreamsApi.md +420 -0
- data/docs/Metric.md +12 -0
- data/docs/MetricsApi.md +322 -0
- data/docs/OverallValues.md +11 -0
- data/docs/PlaybackID.md +9 -0
- data/docs/PlaybackPolicy.md +7 -0
- data/docs/Score.md +13 -0
- data/docs/SignalLiveStreamCompleteResponse.md +8 -0
- data/docs/SigningKey.md +10 -0
- data/docs/SigningKeyResponse.md +8 -0
- data/docs/Track.md +17 -0
- data/docs/URLSigningKeysApi.md +215 -0
- data/docs/UpdateAssetMP4SupportRequest.md +8 -0
- data/docs/Upload.md +15 -0
- data/docs/UploadError.md +9 -0
- data/docs/UploadResponse.md +8 -0
- data/docs/VideoView.md +117 -0
- data/docs/VideoViewEvent.md +11 -0
- data/docs/VideoViewResponse.md +9 -0
- data/docs/VideoViewsApi.md +126 -0
- data/examples/data/exercise-errors.rb +23 -0
- data/examples/data/exercise-exports.rb +22 -0
- data/examples/data/exercise-filters.rb +29 -0
- data/examples/data/exercise-metrics.rb +52 -0
- data/examples/data/exercise-video-views.rb +30 -0
- data/examples/video/create-live-stream.rb +25 -0
- data/examples/video/exercise-assets.rb +95 -0
- data/examples/video/exercise-live-streams.rb +89 -0
- data/examples/video/exercise-signing-keys.rb +46 -0
- data/examples/video/exercise-uploads.rb +49 -0
- data/examples/video/ingest.rb +37 -0
- data/examples/video/list-everything.rb +48 -0
- data/github-ruby-sdk.png +0 -0
- data/lib/mux_ruby/api/assets_api.rb +507 -0
- data/lib/mux_ruby/api/direct_uploads_api.rb +224 -0
- data/lib/mux_ruby/api/errors_api.rb +69 -0
- data/lib/mux_ruby/api/exports_api.rb +63 -0
- data/lib/mux_ruby/api/filters_api.rb +128 -0
- data/lib/mux_ruby/api/live_streams_api.rb +440 -0
- data/lib/mux_ruby/api/metrics_api.rb +393 -0
- data/lib/mux_ruby/api/url_signing_keys_api.rb +219 -0
- data/lib/mux_ruby/api/video_views_api.rb +140 -0
- data/lib/mux_ruby/api_client.rb +400 -0
- data/lib/mux_ruby/api_error.rb +44 -0
- data/lib/mux_ruby/configuration.rb +244 -0
- data/lib/mux_ruby/models/abridged_video_view.rb +274 -0
- data/lib/mux_ruby/models/asset.rb +409 -0
- data/lib/mux_ruby/models/asset_errors.rb +195 -0
- data/lib/mux_ruby/models/asset_master.rb +193 -0
- data/lib/mux_ruby/models/asset_response.rb +184 -0
- data/lib/mux_ruby/models/asset_static_renditions.rb +232 -0
- data/lib/mux_ruby/models/asset_static_renditions_files.rb +279 -0
- data/lib/mux_ruby/models/breakdown_value.rb +220 -0
- data/lib/mux_ruby/models/create_asset_request.rb +267 -0
- data/lib/mux_ruby/models/create_live_stream_request.rb +195 -0
- data/lib/mux_ruby/models/create_playback_id_request.rb +184 -0
- data/lib/mux_ruby/models/create_playback_id_response.rb +184 -0
- data/lib/mux_ruby/models/create_upload_request.rb +235 -0
- data/lib/mux_ruby/models/error.rb +247 -0
- data/lib/mux_ruby/models/filter_value.rb +193 -0
- data/lib/mux_ruby/models/get_asset_input_info_response.rb +186 -0
- data/lib/mux_ruby/models/get_asset_playback_id_response.rb +184 -0
- data/lib/mux_ruby/models/get_metric_timeseries_data_response.rb +206 -0
- data/lib/mux_ruby/models/get_overall_values_response.rb +204 -0
- data/lib/mux_ruby/models/input_file.rb +195 -0
- data/lib/mux_ruby/models/input_info.rb +193 -0
- data/lib/mux_ruby/models/input_settings.rb +203 -0
- data/lib/mux_ruby/models/input_settings_overlay_settings.rb +238 -0
- data/lib/mux_ruby/models/input_track.rb +274 -0
- data/lib/mux_ruby/models/insight.rb +229 -0
- data/lib/mux_ruby/models/list_all_metric_values_response.rb +206 -0
- data/lib/mux_ruby/models/list_assets_response.rb +186 -0
- data/lib/mux_ruby/models/list_breakdown_values_response.rb +206 -0
- data/lib/mux_ruby/models/list_errors_response.rb +206 -0
- data/lib/mux_ruby/models/list_exports_response.rb +206 -0
- data/lib/mux_ruby/models/list_filter_values_response.rb +206 -0
- data/lib/mux_ruby/models/list_filters_response.rb +204 -0
- data/lib/mux_ruby/models/list_filters_response_data.rb +197 -0
- data/lib/mux_ruby/models/list_insights_response.rb +206 -0
- data/lib/mux_ruby/models/list_live_streams_response.rb +186 -0
- data/lib/mux_ruby/models/list_signing_keys_response.rb +186 -0
- data/lib/mux_ruby/models/list_uploads_response.rb +186 -0
- data/lib/mux_ruby/models/list_video_views_response.rb +206 -0
- data/lib/mux_ruby/models/live_stream.rb +269 -0
- data/lib/mux_ruby/models/live_stream_response.rb +184 -0
- data/lib/mux_ruby/models/metric.rb +220 -0
- data/lib/mux_ruby/models/overall_values.rb +211 -0
- data/lib/mux_ruby/models/playback_id.rb +193 -0
- data/lib/mux_ruby/models/playback_policy.rb +31 -0
- data/lib/mux_ruby/models/score.rb +231 -0
- data/lib/mux_ruby/models/signal_live_stream_complete_response.rb +184 -0
- data/lib/mux_ruby/models/signing_key.rb +202 -0
- data/lib/mux_ruby/models/signing_key_response.rb +184 -0
- data/lib/mux_ruby/models/track.rb +265 -0
- data/lib/mux_ruby/models/update_asset_mp4_support_request.rb +219 -0
- data/lib/mux_ruby/models/upload.rb +311 -0
- data/lib/mux_ruby/models/upload_error.rb +194 -0
- data/lib/mux_ruby/models/upload_response.rb +184 -0
- data/lib/mux_ruby/models/video_view.rb +1167 -0
- data/lib/mux_ruby/models/video_view_event.rb +211 -0
- data/lib/mux_ruby/models/video_view_response.rb +195 -0
- data/lib/mux_ruby/version.rb +8 -0
- data/lib/mux_ruby.rb +97 -0
- data/mux_ruby.gemspec +38 -0
- data/spec/api/assets_api_spec.rb +136 -0
- data/spec/api/direct_uploads_api_spec.rb +74 -0
- data/spec/api/errors_api_spec.rb +41 -0
- data/spec/api/exports_api_spec.rb +39 -0
- data/spec/api/filters_api_spec.rb +55 -0
- data/spec/api/live_streams_api_spec.rb +122 -0
- data/spec/api/metrics_api_spec.rb +110 -0
- data/spec/api/url_signing_keys_api_spec.rb +76 -0
- data/spec/api/video_views_api_spec.rb +58 -0
- data/spec/api_client_spec.rb +219 -0
- data/spec/configuration_spec.rb +35 -0
- data/spec/models/abridged_video_view_spec.rb +94 -0
- data/spec/models/asset_errors_spec.rb +40 -0
- data/spec/models/asset_master_spec.rb +40 -0
- data/spec/models/asset_response_spec.rb +34 -0
- data/spec/models/asset_spec.rb +156 -0
- data/spec/models/asset_static_renditions_files_spec.rb +72 -0
- data/spec/models/asset_static_renditions_spec.rb +44 -0
- data/spec/models/breakdown_value_spec.rb +58 -0
- data/spec/models/create_asset_request_spec.rb +68 -0
- data/spec/models/create_live_stream_request_spec.rb +40 -0
- data/spec/models/create_playback_id_request_spec.rb +34 -0
- data/spec/models/create_playback_id_response_spec.rb +34 -0
- data/spec/models/create_upload_request_spec.rb +46 -0
- data/spec/models/error_spec.rb +76 -0
- data/spec/models/filter_value_spec.rb +40 -0
- data/spec/models/get_asset_input_info_response_spec.rb +34 -0
- data/spec/models/get_asset_playback_id_response_spec.rb +34 -0
- data/spec/models/get_metric_timeseries_data_response_spec.rb +46 -0
- data/spec/models/get_overall_values_response_spec.rb +46 -0
- data/spec/models/input_file_spec.rb +40 -0
- data/spec/models/input_info_spec.rb +40 -0
- data/spec/models/input_settings_overlay_settings_spec.rb +70 -0
- data/spec/models/input_settings_spec.rb +46 -0
- data/spec/models/input_track_spec.rb +94 -0
- data/spec/models/insight_spec.rb +64 -0
- data/spec/models/list_all_metric_values_response_spec.rb +46 -0
- data/spec/models/list_assets_response_spec.rb +34 -0
- data/spec/models/list_breakdown_values_response_spec.rb +46 -0
- data/spec/models/list_errors_response_spec.rb +46 -0
- data/spec/models/list_exports_response_spec.rb +46 -0
- data/spec/models/list_filter_values_response_spec.rb +46 -0
- data/spec/models/list_filters_response_data_spec.rb +40 -0
- data/spec/models/list_filters_response_spec.rb +46 -0
- data/spec/models/list_insights_response_spec.rb +46 -0
- data/spec/models/list_live_streams_response_spec.rb +34 -0
- data/spec/models/list_signing_keys_response_spec.rb +34 -0
- data/spec/models/list_uploads_response_spec.rb +34 -0
- data/spec/models/list_video_views_response_spec.rb +46 -0
- data/spec/models/live_stream_response_spec.rb +34 -0
- data/spec/models/live_stream_spec.rb +88 -0
- data/spec/models/metric_spec.rb +58 -0
- data/spec/models/overall_values_spec.rb +52 -0
- data/spec/models/playback_id_spec.rb +40 -0
- data/spec/models/playback_policy_spec.rb +28 -0
- data/spec/models/score_spec.rb +64 -0
- data/spec/models/signal_live_stream_complete_response_spec.rb +34 -0
- data/spec/models/signing_key_response_spec.rb +34 -0
- data/spec/models/signing_key_spec.rb +46 -0
- data/spec/models/track_spec.rb +88 -0
- data/spec/models/update_asset_mp4_support_request_spec.rb +38 -0
- data/spec/models/upload_error_spec.rb +40 -0
- data/spec/models/upload_response_spec.rb +34 -0
- data/spec/models/upload_spec.rb +80 -0
- data/spec/models/video_view_event_spec.rb +52 -0
- data/spec/models/video_view_response_spec.rb +40 -0
- data/spec/models/video_view_spec.rb +688 -0
- data/spec/spec_helper.rb +104 -0
- metadata +514 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 071d7be8b7ea6111c37e3252ddfde75ac1fb5023
|
4
|
+
data.tar.gz: 875bdcd5f51c8691cf37f8bfa614b05ad4712be6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 81204bff2d0b39af4df872ecbc45e3024bcc7ba48c74a8be90269e0ab51400336948c6bb80740ab2463ec52acdf448d9d008fde70fa95f3ef9665320328947c2
|
7
|
+
data.tar.gz: '00895ba9e6abcd30d6825efeea7b2b58785a8a5fd5714d6cfcf394eb99559964de51176e4218786d1aa893a550413b5da4c1e7b3a7f4aded3216cb32036f5c65'
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
mux_ruby (1.0.0)
|
5
|
+
json (~> 2.1, >= 2.1.0)
|
6
|
+
typhoeus (~> 1.0, >= 1.0.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
ZenTest (4.11.1)
|
12
|
+
addressable (2.5.2)
|
13
|
+
public_suffix (>= 2.0.2, < 4.0)
|
14
|
+
autotest (4.4.6)
|
15
|
+
ZenTest (>= 4.4.1)
|
16
|
+
autotest-fsevent (0.2.14)
|
17
|
+
sys-uname
|
18
|
+
autotest-growl (0.2.16)
|
19
|
+
autotest-rails-pure (4.1.2)
|
20
|
+
byebug (10.0.2)
|
21
|
+
coderay (1.1.2)
|
22
|
+
crack (0.4.3)
|
23
|
+
safe_yaml (~> 1.0.0)
|
24
|
+
diff-lcs (1.3)
|
25
|
+
ethon (0.11.0)
|
26
|
+
ffi (>= 1.3.0)
|
27
|
+
ffi (1.9.25)
|
28
|
+
hashdiff (0.3.7)
|
29
|
+
json (2.1.0)
|
30
|
+
method_source (0.9.0)
|
31
|
+
pry (0.11.3)
|
32
|
+
coderay (~> 1.1.0)
|
33
|
+
method_source (~> 0.9.0)
|
34
|
+
pry-byebug (3.6.0)
|
35
|
+
byebug (~> 10.0)
|
36
|
+
pry (~> 0.10)
|
37
|
+
public_suffix (3.0.3)
|
38
|
+
rake (12.0.0)
|
39
|
+
rspec (3.8.0)
|
40
|
+
rspec-core (~> 3.8.0)
|
41
|
+
rspec-expectations (~> 3.8.0)
|
42
|
+
rspec-mocks (~> 3.8.0)
|
43
|
+
rspec-core (3.8.0)
|
44
|
+
rspec-support (~> 3.8.0)
|
45
|
+
rspec-expectations (3.8.1)
|
46
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
47
|
+
rspec-support (~> 3.8.0)
|
48
|
+
rspec-mocks (3.8.0)
|
49
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
50
|
+
rspec-support (~> 3.8.0)
|
51
|
+
rspec-support (3.8.0)
|
52
|
+
safe_yaml (1.0.4)
|
53
|
+
sys-uname (1.0.3)
|
54
|
+
ffi (>= 1.0.0)
|
55
|
+
typhoeus (1.3.0)
|
56
|
+
ethon (>= 0.9.0)
|
57
|
+
vcr (3.0.3)
|
58
|
+
webmock (1.24.6)
|
59
|
+
addressable (>= 2.3.6)
|
60
|
+
crack (>= 0.3.2)
|
61
|
+
hashdiff
|
62
|
+
|
63
|
+
PLATFORMS
|
64
|
+
ruby
|
65
|
+
|
66
|
+
DEPENDENCIES
|
67
|
+
autotest (~> 4.4, >= 4.4.6)
|
68
|
+
autotest-fsevent (~> 0.2, >= 0.2.12)
|
69
|
+
autotest-growl (~> 0.2, >= 0.2.16)
|
70
|
+
autotest-rails-pure (~> 4.1, >= 4.1.2)
|
71
|
+
mux_ruby!
|
72
|
+
pry-byebug
|
73
|
+
rake (~> 12.0.0)
|
74
|
+
rspec (~> 3.6, >= 3.6.0)
|
75
|
+
vcr (~> 3.0, >= 3.0.1)
|
76
|
+
webmock (~> 1.24, >= 1.24.3)
|
77
|
+
|
78
|
+
BUNDLED WITH
|
79
|
+
1.16.1
|
data/LICENSE
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright 2019 Mux, Inc.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4
|
+
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
![Mux Ruby Banner](github-ruby-sdk.png)
|
2
|
+
|
3
|
+
# Mux Ruby
|
4
|
+
|
5
|
+
Official Mux API wrapper for ruby projects, supporting both Mux Data and Mux Video.
|
6
|
+
|
7
|
+
[Mux Video](https://mux.com/video) is an API-first platform, powered by data and designed by video experts to make beautiful video possible for every development team.
|
8
|
+
|
9
|
+
[Mux Data](https://mux.com/data) is a platform for monitoring your video streaming performance with just a few lines of code. Get in-depth quality of service analytics on web, mobile, and OTT devices.
|
10
|
+
|
11
|
+
Not familiar with Mux? Check out https://mux.com/ for more information.
|
12
|
+
|
13
|
+
## Requirements
|
14
|
+
|
15
|
+
Ruby 1.9.
|
16
|
+
|
17
|
+
Use `bundle install` to install dependencies if you're developing locally.
|
18
|
+
|
19
|
+
## Installation
|
20
|
+
|
21
|
+
### Adding to your Gemfile
|
22
|
+
```
|
23
|
+
gem 'mux_ruby', :git => 'git://github.com/muxinc/mux-ruby.git'
|
24
|
+
```
|
25
|
+
|
26
|
+
### Clone and install locally
|
27
|
+
```
|
28
|
+
git clone https://github.com/muxinc/mux-ruby.git && cd mux-ruby
|
29
|
+
gem build mux_ruby.gemspec
|
30
|
+
gem install mux_ruby.gem
|
31
|
+
```
|
32
|
+
|
33
|
+
## Getting Started
|
34
|
+
|
35
|
+
### Overview
|
36
|
+
|
37
|
+
Mux Ruby is a code generated lightweight wrapper around the Mux REST API and reflects them accurately. This has a few consequences you should watch out for:
|
38
|
+
|
39
|
+
1) For almost all API responses, the object you're looking for will be in the `data` field on the API response object, as in the example below. This is because we designed our APIs with similar concepts to the [JSON:API](https://jsonapi.org/) standard. This means we'll be able to return more metadata from our API calls (such as related entities) without the need to make breaking changes to our APIs. We've decided not to hide that in this library.
|
40
|
+
|
41
|
+
2) We don't use a lot of object orientation. For example API calls that happen on a single asset don't exist in the asset class, but are API calls in the AssetsApi which require an asset ID.
|
42
|
+
|
43
|
+
### Authentication
|
44
|
+
To use the Mux API, you'll need an access token and a secret. [Details on obtaining these can be found here in the Mux documentation.](https://docs.mux.com/docs#section-1-get-an-api-access-token)
|
45
|
+
|
46
|
+
Its up to you to manage your token and secret. In our examples, we read them from `MUX_TOKEN_ID` and `MUX_TOKEN_SECRET` in your environment.
|
47
|
+
|
48
|
+
### Example Usage
|
49
|
+
Below is a quick example of using Mux Ruby to list the Video assets stored in your Mux account.
|
50
|
+
|
51
|
+
Be sure to also checkout the [exmples directory](examples/):
|
52
|
+
* [List Assets, Live Streams, Signing Keys, and Uploads.](examples/video/list-everything.rb)
|
53
|
+
* [Create an Asset, wait for it to become availiable, and print its playback URL](examples/video/ingest.rb)
|
54
|
+
* [Create a new Live Stream and retrieve its Stream key.](examples/video/create-live-stream.rb)
|
55
|
+
|
56
|
+
There's also example usage of every API call (also used for testing):
|
57
|
+
* [Video](examples/video/)
|
58
|
+
* [Assets](examples/video/exercise-assets.rb)
|
59
|
+
* [Live Streams](examples/video/exercise-live-streams.rb)
|
60
|
+
* [Signing Keys](examples/video/exercise-signing-keys.rb)
|
61
|
+
* [Uploads](examples/video/exercise-uploads.rb)
|
62
|
+
* [Data](examples/data/)
|
63
|
+
* [Errors](examples/data/exercise-errors.rb)
|
64
|
+
* [Exports](examples/data/exercise-exports.rb)
|
65
|
+
* [Filters](examples/data/exercise-filters.rb)
|
66
|
+
* [Metrics](examples/data/exercise-metrics.rb)
|
67
|
+
* [Video Views](examples/data/exercise-video-views.rb)
|
68
|
+
|
69
|
+
```ruby
|
70
|
+
#!/usr/bin/env ruby
|
71
|
+
|
72
|
+
require 'mux_ruby'
|
73
|
+
|
74
|
+
# Auth Setup
|
75
|
+
openapi = MuxRuby.configure do |config|
|
76
|
+
config.username = ENV['MUX_TOKEN_ID']
|
77
|
+
config.password = ENV['MUX_TOKEN_SECRET']
|
78
|
+
end
|
79
|
+
|
80
|
+
# API Client Init
|
81
|
+
assets_api = MuxRuby::AssetsApi.new
|
82
|
+
|
83
|
+
# List Assets
|
84
|
+
puts "Listing Assets in account:\n\n"
|
85
|
+
|
86
|
+
assets = assets_api.list_assets()
|
87
|
+
assets.data.each do | asset |
|
88
|
+
puts "Asset ID: #{asset.id}"
|
89
|
+
puts "Status: #{asset.status}"
|
90
|
+
puts "Duration: #{asset.duration.to_s}\n\n"
|
91
|
+
end
|
92
|
+
```
|
93
|
+
|
94
|
+
## Exceptions & Error Handling
|
95
|
+
|
96
|
+
All errors inherit from `ApiError`, you can catch it or you can catch one of the more specific Errors below.
|
97
|
+
|
98
|
+
### NotFoundError
|
99
|
+
|
100
|
+
`NotFoundError` is thrown when a resource is not found. This is useful when trying to get an entity by its ID, for example `get_asset("some-id-here")` in the AssetsApi.
|
101
|
+
|
102
|
+
### UnauthorizedError
|
103
|
+
|
104
|
+
`UnauthorizedError` is thrown when Mux cannot authenticate your request. [You should check you have configured your credentials correctly.](#authentication)
|
105
|
+
|
106
|
+
### ServiceError
|
107
|
+
|
108
|
+
`ServiceError` is thrown when Mux returns a HTTP 5XX Status Code. If you encounter this reproducibly, please get in touch with [support@mux.com](mailto:support@mux.com).
|
109
|
+
|
110
|
+
## Documentation
|
111
|
+
|
112
|
+
[Be sure to check out the documentation in the `docs` directory.](docs/)
|
113
|
+
|
114
|
+
## Issues
|
115
|
+
If you run into problems, [please raise a GitHub issue,](https://github.com/muxinc/mux-ruby/issues) filling in the issue template. We'll take a look as soon as possible.
|
116
|
+
|
117
|
+
## Contributing
|
118
|
+
Please do not submit PRs against this package. It is generated from our OpenAPI definitions - [Please open an issue instead!](https://github.com/muxinc/mux-ruby/issues)
|
119
|
+
|
120
|
+
## License
|
121
|
+
[MIT License.](LICENSE) Copyright 2019 Mux, Inc.
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# MuxRuby::AbridgedVideoView
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**id** | **String** | | [optional]
|
7
|
+
**viewer_os_family** | **String** | | [optional]
|
8
|
+
**viewer_application_name** | **String** | | [optional]
|
9
|
+
**video_title** | **String** | | [optional]
|
10
|
+
**total_row_count** | **Integer** | | [optional]
|
11
|
+
**player_error_message** | **String** | | [optional]
|
12
|
+
**player_error_code** | **String** | | [optional]
|
13
|
+
**error_type_id** | **Integer** | | [optional]
|
14
|
+
**country_code** | **String** | | [optional]
|
15
|
+
**view_start** | **String** | | [optional]
|
16
|
+
**view_end** | **String** | | [optional]
|
17
|
+
|
18
|
+
|
data/docs/Asset.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# MuxRuby::Asset
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**id** | **String** | | [optional]
|
7
|
+
**created_at** | **String** | | [optional]
|
8
|
+
**deleted_at** | **String** | | [optional]
|
9
|
+
**status** | **String** | | [optional]
|
10
|
+
**duration** | **Float** | | [optional]
|
11
|
+
**max_stored_resolution** | **String** | | [optional]
|
12
|
+
**max_stored_frame_rate** | **Float** | | [optional]
|
13
|
+
**aspect_ratio** | **String** | | [optional]
|
14
|
+
**playback_ids** | [**Array<PlaybackID>**](PlaybackID.md) | | [optional]
|
15
|
+
**tracks** | [**Array<Track>**](Track.md) | | [optional]
|
16
|
+
**demo** | **BOOLEAN** | | [optional]
|
17
|
+
**errors** | [**AssetErrors**](AssetErrors.md) | | [optional]
|
18
|
+
**per_title_encode** | **BOOLEAN** | | [optional]
|
19
|
+
**is_live** | **BOOLEAN** | | [optional]
|
20
|
+
**passthrough** | **String** | | [optional]
|
21
|
+
**live_stream_id** | **String** | | [optional]
|
22
|
+
**master** | [**AssetMaster**](AssetMaster.md) | | [optional]
|
23
|
+
**master_access** | **String** | | [optional] [default to 'none']
|
24
|
+
**mp4_support** | **String** | | [optional] [default to 'none']
|
25
|
+
**static_renditions** | [**AssetStaticRenditions**](AssetStaticRenditions.md) | | [optional]
|
26
|
+
|
27
|
+
|
data/docs/AssetErrors.md
ADDED
data/docs/AssetMaster.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# MuxRuby::AssetStaticRenditions
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**status** | **String** | * `ready`: All MP4s are downloadable * `preparing`: We are preparing the MP4s * `disabled`: MP4 support was not requested or has been removed * `errored`: There was a Mux internal error that prevented the MP4s from being created | [optional] [default to 'disabled']
|
7
|
+
**files** | [**Array<AssetStaticRenditionsFiles>**](AssetStaticRenditionsFiles.md) | | [optional]
|
8
|
+
|
9
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# MuxRuby::AssetStaticRenditionsFiles
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**name** | **String** | | [optional]
|
7
|
+
**ext** | **String** | Extension of the static rendition file | [optional]
|
8
|
+
**height** | **Integer** | The height of the static rendition's file in pixels | [optional]
|
9
|
+
**width** | **Integer** | The width of the static rendition's file in pixels | [optional]
|
10
|
+
**bitrate** | **Integer** | The bitrate in bits per second | [optional]
|
11
|
+
**filesize** | **String** | | [optional]
|
12
|
+
|
13
|
+
|