mux_ruby 2.1.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +4 -4
- data/docs/AssetNonStandardInputReasons.md +2 -0
- data/docs/CreateLiveStreamRequest.md +2 -0
- data/docs/ExportsApi.md +1 -1
- data/docs/FiltersApi.md +2 -2
- data/docs/GetLiveStreamPlaybackIDResponse.md +18 -0
- data/docs/LiveStreamEmbeddedSubtitleSettings.md +24 -0
- data/docs/LiveStreamsApi.md +144 -0
- data/docs/MetricsApi.md +2 -2
- data/docs/RealTimeBreakdownValue.md +2 -2
- data/docs/RealTimeTimeseriesDatapoint.md +2 -2
- data/docs/UpdateLiveStreamEmbeddedSubtitlesRequest.md +18 -0
- data/examples/data/exercise-errors.rb +0 -2
- data/examples/video/exercise-assets.rb +1 -0
- data/gen/generator-config.json +2 -1
- data/gen/templates/gemspec.mustache +1 -0
- data/lib/mux_ruby/api/exports_api.rb +2 -2
- data/lib/mux_ruby/api/filters_api.rb +4 -4
- data/lib/mux_ruby/api/live_streams_api.rb +138 -0
- data/lib/mux_ruby/api/metrics_api.rb +2 -2
- data/lib/mux_ruby/models/asset_non_standard_input_reasons.rb +23 -1
- data/lib/mux_ruby/models/create_live_stream_request.rb +13 -1
- data/lib/mux_ruby/models/get_live_stream_playback_id_response.rb +218 -0
- data/lib/mux_ruby/models/live_stream_embedded_subtitle_settings.rb +287 -0
- data/lib/mux_ruby/models/real_time_breakdown_value.rb +7 -7
- data/lib/mux_ruby/models/real_time_timeseries_datapoint.rb +7 -7
- data/lib/mux_ruby/models/track.rb +0 -12
- data/lib/mux_ruby/models/update_live_stream_embedded_subtitles_request.rb +221 -0
- data/lib/mux_ruby/version.rb +1 -1
- data/lib/mux_ruby.rb +3 -0
- data/mux_ruby.gemspec +1 -0
- data/spec/models/get_live_stream_playback_id_response_spec.rb +34 -0
- data/spec/models/live_stream_embedded_subtitle_settings_spec.rb +56 -0
- data/spec/models/update_live_stream_embedded_subtitles_request_spec.rb +34 -0
- metadata +109 -96
@@ -602,6 +602,73 @@ module MuxRuby
|
|
602
602
|
return data, status_code, headers
|
603
603
|
end
|
604
604
|
|
605
|
+
# Retrieve a live stream playback ID
|
606
|
+
# @param live_stream_id [String] The live stream ID
|
607
|
+
# @param playback_id [String] The live stream's playback ID.
|
608
|
+
# @param [Hash] opts the optional parameters
|
609
|
+
# @return [GetLiveStreamPlaybackIDResponse]
|
610
|
+
def get_live_stream_playback_id(live_stream_id, playback_id, opts = {})
|
611
|
+
data, _status_code, _headers = get_live_stream_playback_id_with_http_info(live_stream_id, playback_id, opts)
|
612
|
+
data
|
613
|
+
end
|
614
|
+
|
615
|
+
# Retrieve a live stream playback ID
|
616
|
+
# @param live_stream_id [String] The live stream ID
|
617
|
+
# @param playback_id [String] The live stream's playback ID.
|
618
|
+
# @param [Hash] opts the optional parameters
|
619
|
+
# @return [Array<(GetLiveStreamPlaybackIDResponse, Integer, Hash)>] GetLiveStreamPlaybackIDResponse data, response status code and response headers
|
620
|
+
def get_live_stream_playback_id_with_http_info(live_stream_id, playback_id, opts = {})
|
621
|
+
if @api_client.config.debugging
|
622
|
+
@api_client.config.logger.debug 'Calling API: LiveStreamsApi.get_live_stream_playback_id ...'
|
623
|
+
end
|
624
|
+
# verify the required parameter 'live_stream_id' is set
|
625
|
+
if @api_client.config.client_side_validation && live_stream_id.nil?
|
626
|
+
fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.get_live_stream_playback_id"
|
627
|
+
end
|
628
|
+
# verify the required parameter 'playback_id' is set
|
629
|
+
if @api_client.config.client_side_validation && playback_id.nil?
|
630
|
+
fail ArgumentError, "Missing the required parameter 'playback_id' when calling LiveStreamsApi.get_live_stream_playback_id"
|
631
|
+
end
|
632
|
+
# resource path
|
633
|
+
local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids/{PLAYBACK_ID}'.sub('{' + 'LIVE_STREAM_ID' + '}', CGI.escape(live_stream_id.to_s)).sub('{' + 'PLAYBACK_ID' + '}', CGI.escape(playback_id.to_s))
|
634
|
+
|
635
|
+
# query parameters
|
636
|
+
query_params = opts[:query_params] || {}
|
637
|
+
|
638
|
+
# header parameters
|
639
|
+
header_params = opts[:header_params] || {}
|
640
|
+
# HTTP header 'Accept' (if needed)
|
641
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
642
|
+
|
643
|
+
# form parameters
|
644
|
+
form_params = opts[:form_params] || {}
|
645
|
+
|
646
|
+
# http body (model)
|
647
|
+
post_body = opts[:debug_body]
|
648
|
+
|
649
|
+
# return_type
|
650
|
+
return_type = opts[:debug_return_type] || 'GetLiveStreamPlaybackIDResponse'
|
651
|
+
|
652
|
+
# auth_names
|
653
|
+
auth_names = opts[:debug_auth_names] || ['accessToken']
|
654
|
+
|
655
|
+
new_options = opts.merge(
|
656
|
+
:operation => :"LiveStreamsApi.get_live_stream_playback_id",
|
657
|
+
:header_params => header_params,
|
658
|
+
:query_params => query_params,
|
659
|
+
:form_params => form_params,
|
660
|
+
:body => post_body,
|
661
|
+
:auth_names => auth_names,
|
662
|
+
:return_type => return_type
|
663
|
+
)
|
664
|
+
|
665
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
666
|
+
if @api_client.config.debugging
|
667
|
+
@api_client.config.logger.debug "API called: LiveStreamsApi#get_live_stream_playback_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
668
|
+
end
|
669
|
+
return data, status_code, headers
|
670
|
+
end
|
671
|
+
|
605
672
|
# Retrieve a Live Stream Simulcast Target
|
606
673
|
# Retrieves the details of the simulcast target created for the parent live stream. Supply the unique live stream ID and simulcast target ID that was returned in the response of create simulcast target request, and Mux will return the corresponding information.
|
607
674
|
# @param live_stream_id [String] The live stream ID
|
@@ -860,5 +927,76 @@ module MuxRuby
|
|
860
927
|
end
|
861
928
|
return data, status_code, headers
|
862
929
|
end
|
930
|
+
|
931
|
+
# Update a live stream's embedded subtitles
|
932
|
+
# Configures a live stream to receive embedded closed captions. The resulting Asset's subtitle text track will have `closed_captions: true` set.
|
933
|
+
# @param live_stream_id [String] The live stream ID
|
934
|
+
# @param update_live_stream_embedded_subtitles_request [UpdateLiveStreamEmbeddedSubtitlesRequest]
|
935
|
+
# @param [Hash] opts the optional parameters
|
936
|
+
# @return [LiveStreamResponse]
|
937
|
+
def update_live_stream_embedded_subtitles(live_stream_id, update_live_stream_embedded_subtitles_request, opts = {})
|
938
|
+
data, _status_code, _headers = update_live_stream_embedded_subtitles_with_http_info(live_stream_id, update_live_stream_embedded_subtitles_request, opts)
|
939
|
+
data
|
940
|
+
end
|
941
|
+
|
942
|
+
# Update a live stream's embedded subtitles
|
943
|
+
# Configures a live stream to receive embedded closed captions. The resulting Asset's subtitle text track will have `closed_captions: true` set.
|
944
|
+
# @param live_stream_id [String] The live stream ID
|
945
|
+
# @param update_live_stream_embedded_subtitles_request [UpdateLiveStreamEmbeddedSubtitlesRequest]
|
946
|
+
# @param [Hash] opts the optional parameters
|
947
|
+
# @return [Array<(LiveStreamResponse, Integer, Hash)>] LiveStreamResponse data, response status code and response headers
|
948
|
+
def update_live_stream_embedded_subtitles_with_http_info(live_stream_id, update_live_stream_embedded_subtitles_request, opts = {})
|
949
|
+
if @api_client.config.debugging
|
950
|
+
@api_client.config.logger.debug 'Calling API: LiveStreamsApi.update_live_stream_embedded_subtitles ...'
|
951
|
+
end
|
952
|
+
# verify the required parameter 'live_stream_id' is set
|
953
|
+
if @api_client.config.client_side_validation && live_stream_id.nil?
|
954
|
+
fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.update_live_stream_embedded_subtitles"
|
955
|
+
end
|
956
|
+
# verify the required parameter 'update_live_stream_embedded_subtitles_request' is set
|
957
|
+
if @api_client.config.client_side_validation && update_live_stream_embedded_subtitles_request.nil?
|
958
|
+
fail ArgumentError, "Missing the required parameter 'update_live_stream_embedded_subtitles_request' when calling LiveStreamsApi.update_live_stream_embedded_subtitles"
|
959
|
+
end
|
960
|
+
# resource path
|
961
|
+
local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/embedded-subtitles'.sub('{' + 'LIVE_STREAM_ID' + '}', CGI.escape(live_stream_id.to_s))
|
962
|
+
|
963
|
+
# query parameters
|
964
|
+
query_params = opts[:query_params] || {}
|
965
|
+
|
966
|
+
# header parameters
|
967
|
+
header_params = opts[:header_params] || {}
|
968
|
+
# HTTP header 'Accept' (if needed)
|
969
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
970
|
+
# HTTP header 'Content-Type'
|
971
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
972
|
+
|
973
|
+
# form parameters
|
974
|
+
form_params = opts[:form_params] || {}
|
975
|
+
|
976
|
+
# http body (model)
|
977
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_live_stream_embedded_subtitles_request)
|
978
|
+
|
979
|
+
# return_type
|
980
|
+
return_type = opts[:debug_return_type] || 'LiveStreamResponse'
|
981
|
+
|
982
|
+
# auth_names
|
983
|
+
auth_names = opts[:debug_auth_names] || ['accessToken']
|
984
|
+
|
985
|
+
new_options = opts.merge(
|
986
|
+
:operation => :"LiveStreamsApi.update_live_stream_embedded_subtitles",
|
987
|
+
:header_params => header_params,
|
988
|
+
:query_params => query_params,
|
989
|
+
:form_params => form_params,
|
990
|
+
:body => post_body,
|
991
|
+
:auth_names => auth_names,
|
992
|
+
:return_type => return_type
|
993
|
+
)
|
994
|
+
|
995
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
996
|
+
if @api_client.config.debugging
|
997
|
+
@api_client.config.logger.debug "API called: LiveStreamsApi#update_live_stream_embedded_subtitles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
998
|
+
end
|
999
|
+
return data, status_code, headers
|
1000
|
+
end
|
863
1001
|
end
|
864
1002
|
end
|
@@ -27,7 +27,7 @@ module MuxRuby
|
|
27
27
|
# @option opts [Array<String>] :filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint.
|
28
28
|
# @option opts [String] :measurement Measurement for the provided metric. If omitted, the default for the metric will be used.
|
29
29
|
# @option opts [String] :order_direction Sort order.
|
30
|
-
# @option opts [String] :group_by Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the
|
30
|
+
# @option opts [String] :group_by Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the timeframe. For timeframes of 6 hours or less, the default granularity is `ten_minutes`. Between 6 hours and 15 hours inclusive, the default granularity is `hour`. The granularity of timeframes that exceed 15 hours is `day`. This default behaviour is subject to change; it is strongly suggested that you explicitly specify the granularity.
|
31
31
|
# @return [GetMetricTimeseriesDataResponse]
|
32
32
|
def get_metric_timeseries_data(metric_id, opts = {})
|
33
33
|
data, _status_code, _headers = get_metric_timeseries_data_with_http_info(metric_id, opts)
|
@@ -42,7 +42,7 @@ module MuxRuby
|
|
42
42
|
# @option opts [Array<String>] :filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint.
|
43
43
|
# @option opts [String] :measurement Measurement for the provided metric. If omitted, the default for the metric will be used.
|
44
44
|
# @option opts [String] :order_direction Sort order.
|
45
|
-
# @option opts [String] :group_by Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the
|
45
|
+
# @option opts [String] :group_by Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the timeframe. For timeframes of 6 hours or less, the default granularity is `ten_minutes`. Between 6 hours and 15 hours inclusive, the default granularity is `hour`. The granularity of timeframes that exceed 15 hours is `day`. This default behaviour is subject to change; it is strongly suggested that you explicitly specify the granularity.
|
46
46
|
# @return [Array<(GetMetricTimeseriesDataResponse, Integer, Hash)>] GetMetricTimeseriesDataResponse data, response status code and response headers
|
47
47
|
def get_metric_timeseries_data_with_http_info(metric_id, opts = {})
|
48
48
|
if @api_client.config.debugging
|
@@ -31,6 +31,9 @@ module MuxRuby
|
|
31
31
|
# The video resolution of the input file. Video resolution higher than 2048 pixels on any one dimension (height or width) is considered non-standard, The resolution value is presented as `width` x `height` in pixels.
|
32
32
|
attr_accessor :video_resolution
|
33
33
|
|
34
|
+
# The video bitrate of the input file is `high`. This parameter is present when the average bitrate of any key frame interval (also known as Group of Pictures or GOP) is higher than what's considered standard which typically is 16 Mbps.
|
35
|
+
attr_accessor :video_bitrate
|
36
|
+
|
34
37
|
# The video pixel aspect ratio of the input file.
|
35
38
|
attr_accessor :pixel_aspect_ratio
|
36
39
|
|
@@ -73,6 +76,7 @@ module MuxRuby
|
|
73
76
|
:'video_gop_size' => :'video_gop_size',
|
74
77
|
:'video_frame_rate' => :'video_frame_rate',
|
75
78
|
:'video_resolution' => :'video_resolution',
|
79
|
+
:'video_bitrate' => :'video_bitrate',
|
76
80
|
:'pixel_aspect_ratio' => :'pixel_aspect_ratio',
|
77
81
|
:'video_edit_list' => :'video_edit_list',
|
78
82
|
:'audio_edit_list' => :'audio_edit_list',
|
@@ -93,6 +97,7 @@ module MuxRuby
|
|
93
97
|
:'video_gop_size' => :'String',
|
94
98
|
:'video_frame_rate' => :'String',
|
95
99
|
:'video_resolution' => :'String',
|
100
|
+
:'video_bitrate' => :'String',
|
96
101
|
:'pixel_aspect_ratio' => :'String',
|
97
102
|
:'video_edit_list' => :'String',
|
98
103
|
:'audio_edit_list' => :'String',
|
@@ -141,6 +146,10 @@ module MuxRuby
|
|
141
146
|
self.video_resolution = attributes[:'video_resolution']
|
142
147
|
end
|
143
148
|
|
149
|
+
if attributes.key?(:'video_bitrate')
|
150
|
+
self.video_bitrate = attributes[:'video_bitrate']
|
151
|
+
end
|
152
|
+
|
144
153
|
if attributes.key?(:'pixel_aspect_ratio')
|
145
154
|
self.pixel_aspect_ratio = attributes[:'pixel_aspect_ratio']
|
146
155
|
end
|
@@ -170,6 +179,8 @@ module MuxRuby
|
|
170
179
|
def valid?
|
171
180
|
video_gop_size_validator = EnumAttributeValidator.new('String', ["high"])
|
172
181
|
return false unless video_gop_size_validator.valid?(@video_gop_size)
|
182
|
+
video_bitrate_validator = EnumAttributeValidator.new('String', ["high"])
|
183
|
+
return false unless video_bitrate_validator.valid?(@video_bitrate)
|
173
184
|
video_edit_list_validator = EnumAttributeValidator.new('String', ["non-standard"])
|
174
185
|
return false unless video_edit_list_validator.valid?(@video_edit_list)
|
175
186
|
audio_edit_list_validator = EnumAttributeValidator.new('String', ["non-standard"])
|
@@ -189,6 +200,16 @@ module MuxRuby
|
|
189
200
|
@video_gop_size = video_gop_size
|
190
201
|
end
|
191
202
|
|
203
|
+
# Custom attribute writer method checking allowed values (enum).
|
204
|
+
# @param [Object] video_bitrate Object to be assigned
|
205
|
+
def video_bitrate=(video_bitrate)
|
206
|
+
validator = EnumAttributeValidator.new('String', ["high"])
|
207
|
+
unless validator.valid?(video_bitrate)
|
208
|
+
fail ArgumentError, "invalid value for \"video_bitrate\", must be one of #{validator.allowable_values}."
|
209
|
+
end
|
210
|
+
@video_bitrate = video_bitrate
|
211
|
+
end
|
212
|
+
|
192
213
|
# Custom attribute writer method checking allowed values (enum).
|
193
214
|
# @param [Object] video_edit_list Object to be assigned
|
194
215
|
def video_edit_list=(video_edit_list)
|
@@ -229,6 +250,7 @@ module MuxRuby
|
|
229
250
|
video_gop_size == o.video_gop_size &&
|
230
251
|
video_frame_rate == o.video_frame_rate &&
|
231
252
|
video_resolution == o.video_resolution &&
|
253
|
+
video_bitrate == o.video_bitrate &&
|
232
254
|
pixel_aspect_ratio == o.pixel_aspect_ratio &&
|
233
255
|
video_edit_list == o.video_edit_list &&
|
234
256
|
audio_edit_list == o.audio_edit_list &&
|
@@ -244,7 +266,7 @@ module MuxRuby
|
|
244
266
|
# Calculates hash code according to all attributes.
|
245
267
|
# @return [Integer] Hash code
|
246
268
|
def hash
|
247
|
-
[video_codec, audio_codec, video_gop_size, video_frame_rate, video_resolution, pixel_aspect_ratio, video_edit_list, audio_edit_list, unexpected_media_file_parameters].hash
|
269
|
+
[video_codec, audio_codec, video_gop_size, video_frame_rate, video_resolution, video_bitrate, pixel_aspect_ratio, video_edit_list, audio_edit_list, unexpected_media_file_parameters].hash
|
248
270
|
end
|
249
271
|
|
250
272
|
# Builds the object from hash
|
@@ -27,6 +27,9 @@ module MuxRuby
|
|
27
27
|
# Force the live stream to only process the audio track when the value is set to true. Mux drops the video track if broadcasted.
|
28
28
|
attr_accessor :audio_only
|
29
29
|
|
30
|
+
# Describe the embedded closed caption contents of the incoming live stream.
|
31
|
+
attr_accessor :embedded_subtitles
|
32
|
+
|
30
33
|
# Latency is the time from when the streamer does something in real life to when you see it happen in the player. Set this if you want lower latency for your live stream. Note: Reconnect windows are incompatible with Reduced Latency and will always be set to zero (0) seconds. Read more here: https://mux.com/blog/reduced-latency-for-mux-live-streaming-now-available/
|
31
34
|
attr_accessor :reduced_latency
|
32
35
|
|
@@ -46,6 +49,7 @@ module MuxRuby
|
|
46
49
|
:'reconnect_window' => :'reconnect_window',
|
47
50
|
:'passthrough' => :'passthrough',
|
48
51
|
:'audio_only' => :'audio_only',
|
52
|
+
:'embedded_subtitles' => :'embedded_subtitles',
|
49
53
|
:'reduced_latency' => :'reduced_latency',
|
50
54
|
:'low_latency' => :'low_latency',
|
51
55
|
:'test' => :'test',
|
@@ -66,6 +70,7 @@ module MuxRuby
|
|
66
70
|
:'reconnect_window' => :'Float',
|
67
71
|
:'passthrough' => :'String',
|
68
72
|
:'audio_only' => :'Boolean',
|
73
|
+
:'embedded_subtitles' => :'Array<LiveStreamEmbeddedSubtitleSettings>',
|
69
74
|
:'reduced_latency' => :'Boolean',
|
70
75
|
:'low_latency' => :'Boolean',
|
71
76
|
:'test' => :'Boolean',
|
@@ -116,6 +121,12 @@ module MuxRuby
|
|
116
121
|
self.audio_only = attributes[:'audio_only']
|
117
122
|
end
|
118
123
|
|
124
|
+
if attributes.key?(:'embedded_subtitles')
|
125
|
+
if (value = attributes[:'embedded_subtitles']).is_a?(Array)
|
126
|
+
self.embedded_subtitles = value
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
119
130
|
if attributes.key?(:'reduced_latency')
|
120
131
|
self.reduced_latency = attributes[:'reduced_latency']
|
121
132
|
end
|
@@ -182,6 +193,7 @@ module MuxRuby
|
|
182
193
|
reconnect_window == o.reconnect_window &&
|
183
194
|
passthrough == o.passthrough &&
|
184
195
|
audio_only == o.audio_only &&
|
196
|
+
embedded_subtitles == o.embedded_subtitles &&
|
185
197
|
reduced_latency == o.reduced_latency &&
|
186
198
|
low_latency == o.low_latency &&
|
187
199
|
test == o.test &&
|
@@ -197,7 +209,7 @@ module MuxRuby
|
|
197
209
|
# Calculates hash code according to all attributes.
|
198
210
|
# @return [Integer] Hash code
|
199
211
|
def hash
|
200
|
-
[playback_policy, new_asset_settings, reconnect_window, passthrough, audio_only, reduced_latency, low_latency, test, simulcast_targets].hash
|
212
|
+
[playback_policy, new_asset_settings, reconnect_window, passthrough, audio_only, embedded_subtitles, reduced_latency, low_latency, test, simulcast_targets].hash
|
201
213
|
end
|
202
214
|
|
203
215
|
# Builds the object from hash
|
@@ -0,0 +1,218 @@
|
|
1
|
+
=begin
|
2
|
+
#Mux API
|
3
|
+
|
4
|
+
#Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v1
|
7
|
+
Contact: devex@mux.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MuxRuby
|
17
|
+
class GetLiveStreamPlaybackIDResponse
|
18
|
+
attr_accessor :data
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'data' => :'data'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns all the JSON keys this model knows about
|
28
|
+
def self.acceptable_attributes
|
29
|
+
attribute_map.values
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.openapi_types
|
34
|
+
{
|
35
|
+
:'data' => :'PlaybackID'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::GetLiveStreamPlaybackIDResponse` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::GetLiveStreamPlaybackIDResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'data')
|
61
|
+
self.data = attributes[:'data']
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
66
|
+
# @return Array for valid properties with the reasons
|
67
|
+
def list_invalid_properties
|
68
|
+
invalid_properties = Array.new
|
69
|
+
invalid_properties
|
70
|
+
end
|
71
|
+
|
72
|
+
# Check to see if the all the properties in the model are valid
|
73
|
+
# @return true if the model is valid
|
74
|
+
def valid?
|
75
|
+
true
|
76
|
+
end
|
77
|
+
|
78
|
+
# Checks equality by comparing each attribute.
|
79
|
+
# @param [Object] Object to be compared
|
80
|
+
def ==(o)
|
81
|
+
return true if self.equal?(o)
|
82
|
+
self.class == o.class &&
|
83
|
+
data == o.data
|
84
|
+
end
|
85
|
+
|
86
|
+
# @see the `==` method
|
87
|
+
# @param [Object] Object to be compared
|
88
|
+
def eql?(o)
|
89
|
+
self == o
|
90
|
+
end
|
91
|
+
|
92
|
+
# Calculates hash code according to all attributes.
|
93
|
+
# @return [Integer] Hash code
|
94
|
+
def hash
|
95
|
+
[data].hash
|
96
|
+
end
|
97
|
+
|
98
|
+
# Builds the object from hash
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
100
|
+
# @return [Object] Returns the model itself
|
101
|
+
def self.build_from_hash(attributes)
|
102
|
+
new.build_from_hash(attributes)
|
103
|
+
end
|
104
|
+
|
105
|
+
# Builds the object from hash
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
# @return [Object] Returns the model itself
|
108
|
+
def build_from_hash(attributes)
|
109
|
+
return nil unless attributes.is_a?(Hash)
|
110
|
+
self.class.openapi_types.each_pair do |key, type|
|
111
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
112
|
+
self.send("#{key}=", nil)
|
113
|
+
elsif type =~ /\AArray<(.*)>/i
|
114
|
+
# check to ensure the input is an array given that the attribute
|
115
|
+
# is documented as an array but the input is not
|
116
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
117
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
118
|
+
end
|
119
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
120
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
self
|
125
|
+
end
|
126
|
+
|
127
|
+
# Deserializes the data based on type
|
128
|
+
# @param string type Data type
|
129
|
+
# @param string value Value to be deserialized
|
130
|
+
# @return [Object] Deserialized data
|
131
|
+
def _deserialize(type, value)
|
132
|
+
case type.to_sym
|
133
|
+
when :Time
|
134
|
+
Time.parse(value)
|
135
|
+
when :Date
|
136
|
+
Date.parse(value)
|
137
|
+
when :String
|
138
|
+
value.to_s
|
139
|
+
when :Integer
|
140
|
+
value.to_i
|
141
|
+
when :Float
|
142
|
+
value.to_f
|
143
|
+
when :Boolean
|
144
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
145
|
+
true
|
146
|
+
else
|
147
|
+
false
|
148
|
+
end
|
149
|
+
when :Object
|
150
|
+
# generic object (usually a Hash), return directly
|
151
|
+
value
|
152
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
153
|
+
inner_type = Regexp.last_match[:inner_type]
|
154
|
+
value.map { |v| _deserialize(inner_type, v) }
|
155
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
156
|
+
k_type = Regexp.last_match[:k_type]
|
157
|
+
v_type = Regexp.last_match[:v_type]
|
158
|
+
{}.tap do |hash|
|
159
|
+
value.each do |k, v|
|
160
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
else # model
|
164
|
+
# models (e.g. Pet) or oneOf
|
165
|
+
klass = MuxRuby.const_get(type)
|
166
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
# Returns the string representation of the object
|
171
|
+
# @return [String] String presentation of the object
|
172
|
+
def to_s
|
173
|
+
to_hash.to_s
|
174
|
+
end
|
175
|
+
|
176
|
+
# to_body is an alias to to_hash (backward compatibility)
|
177
|
+
# @return [Hash] Returns the object in the form of hash
|
178
|
+
def to_body
|
179
|
+
to_hash
|
180
|
+
end
|
181
|
+
|
182
|
+
# Returns the object in the form of hash
|
183
|
+
# @return [Hash] Returns the object in the form of hash
|
184
|
+
def to_hash
|
185
|
+
hash = {}
|
186
|
+
self.class.attribute_map.each_pair do |attr, param|
|
187
|
+
value = self.send(attr)
|
188
|
+
if value.nil?
|
189
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
190
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
191
|
+
end
|
192
|
+
|
193
|
+
hash[param] = _to_hash(value)
|
194
|
+
end
|
195
|
+
hash
|
196
|
+
end
|
197
|
+
|
198
|
+
# Outputs non-array value in the form of hash
|
199
|
+
# For object, use to_hash. Otherwise, just return the value
|
200
|
+
# @param [Object] value Any valid value
|
201
|
+
# @return [Hash] Returns the value in the form of hash
|
202
|
+
def _to_hash(value)
|
203
|
+
if value.is_a?(Array)
|
204
|
+
value.compact.map { |v| _to_hash(v) }
|
205
|
+
elsif value.is_a?(Hash)
|
206
|
+
{}.tap do |hash|
|
207
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
208
|
+
end
|
209
|
+
elsif value.respond_to? :to_hash
|
210
|
+
value.to_hash
|
211
|
+
else
|
212
|
+
value
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
end
|
217
|
+
|
218
|
+
end
|