Class: BombBomb::VideosApi

Inherits:
Object
  • Object
show all
Defined in:
lib/bombbomb/api/videos_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ VideosApi

Returns a new instance of VideosApi.



19
20
21
# File 'lib/bombbomb/api/videos_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/bombbomb/api/videos_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_video_encoding_status(video_id, opts = {}) ⇒ VideoEncodingStatusResponse

Video Encoding Status Get information about the current state of encoding for a given video id.

Parameters:

  • video_id

    The video's id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



28
29
30
31
# File 'lib/bombbomb/api/videos_api.rb', line 28

def get_video_encoding_status(video_id, opts = {})
  data, _status_code, _headers = get_video_encoding_status_with_http_info(video_id, opts)
  return data
end

#get_video_encoding_status_with_http_info(video_id, opts = {}) ⇒ Array<(VideoEncodingStatusResponse, Fixnum, Hash)>

Video Encoding Status Get information about the current state of encoding for a given video id.

Parameters:

  • video_id

    The video&#39;s id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/bombbomb/api/videos_api.rb', line 38

def get_video_encoding_status_with_http_info(video_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: VideosApi.get_video_encoding_status ..."
  end
  # verify the required parameter 'video_id' is set
  if @api_client.config.client_side_validation && video_id.nil?
    fail ArgumentError, "Missing the required parameter 'video_id' when calling VideosApi.get_video_encoding_status"
  end
  # resource path
  local_var_path = "/videos/{videoId}/status".sub('{' + 'videoId' + '}', video_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['BBOAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'VideoEncodingStatusResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideosApi#get_video_encoding_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_video_recorder(opts = {}) ⇒ VideoRecorderMethodResponse

Get Live Video Recorder HTML Returns an object with a number of properties to help you put a video recorder on your site. This is to be used in conjunction with the VideoRecordedLive call one the user has confirmed in your UI that the video is how they want it.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    The width of the recorder to present.

  • :video_id (String)

    The id of the video to record

Returns:



84
85
86
87
# File 'lib/bombbomb/api/videos_api.rb', line 84

def get_video_recorder(opts = {})
  data, _status_code, _headers = get_video_recorder_with_http_info(opts)
  return data
end

#get_video_recorder_with_http_info(opts = {}) ⇒ Array<(VideoRecorderMethodResponse, Fixnum, Hash)>

Get Live Video Recorder HTML Returns an object with a number of properties to help you put a video recorder on your site. This is to be used in conjunction with the VideoRecordedLive call one the user has confirmed in your UI that the video is how they want it.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    The width of the recorder to present.

  • :video_id (String)

    The id of the video to record

Returns:



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/bombbomb/api/videos_api.rb', line 95

def get_video_recorder_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: VideosApi.get_video_recorder ..."
  end
  # resource path
  local_var_path = "/videos/live/getRecorder"

  # query parameters
  query_params = {}
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'videoId'] = opts[:'video_id'] if !opts[:'video_id'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['BBOAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'VideoRecorderMethodResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideosApi#get_video_recorder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#mark_live_recording_complete(video_id, filename, title, opts = {}) ⇒ VideoPublicRepresentation

Completes a live recording Used in conjunction with the live recorder method to mark a video recording as complete.

Parameters:

  • video_id

    The id of the video to mark as done.

  • filename

    The filename that was chosen as the final video.

  • title

    The title to give the video

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



140
141
142
143
# File 'lib/bombbomb/api/videos_api.rb', line 140

def mark_live_recording_complete(video_id, filename, title, opts = {})
  data, _status_code, _headers = mark_live_recording_complete_with_http_info(video_id, filename, title, opts)
  return data
end

#mark_live_recording_complete_with_http_info(video_id, filename, title, opts = {}) ⇒ Array<(VideoPublicRepresentation, Fixnum, Hash)>

Completes a live recording Used in conjunction with the live recorder method to mark a video recording as complete.

Parameters:

  • video_id

    The id of the video to mark as done.

  • filename

    The filename that was chosen as the final video.

  • title

    The title to give the video

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(VideoPublicRepresentation, Fixnum, Hash)>)

    VideoPublicRepresentation data, response status code and response headers



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/bombbomb/api/videos_api.rb', line 152

def mark_live_recording_complete_with_http_info(video_id, filename, title, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: VideosApi.mark_live_recording_complete ..."
  end
  # verify the required parameter 'video_id' is set
  if @api_client.config.client_side_validation && video_id.nil?
    fail ArgumentError, "Missing the required parameter 'video_id' when calling VideosApi.mark_live_recording_complete"
  end
  # verify the required parameter 'filename' is set
  if @api_client.config.client_side_validation && filename.nil?
    fail ArgumentError, "Missing the required parameter 'filename' when calling VideosApi.mark_live_recording_complete"
  end
  # verify the required parameter 'title' is set
  if @api_client.config.client_side_validation && title.nil?
    fail ArgumentError, "Missing the required parameter 'title' when calling VideosApi.mark_live_recording_complete"
  end
  # resource path
  local_var_path = "/videos/live/markComplete"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}
  form_params["videoId"] = video_id
  form_params["filename"] = filename
  form_params["title"] = title

  # http body (model)
  post_body = nil
  auth_names = ['BBOAuth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'VideoPublicRepresentation')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideosApi#mark_live_recording_complete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#sign_upload(policy, opts = {}) ⇒ String

Generate Signed Url Generates a signed url to be used for video uploads.

Parameters:

  • policy

    The policy to sign

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :v4 (BOOLEAN)

    Whether to do v4 signing

Returns:



209
210
211
212
# File 'lib/bombbomb/api/videos_api.rb', line 209

def sign_upload(policy, opts = {})
  data, _status_code, _headers = sign_upload_with_http_info(policy, opts)
  return data
end

#sign_upload_with_http_info(policy, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Generate Signed Url Generates a signed url to be used for video uploads.

Parameters:

  • policy

    The policy to sign

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :v4 (BOOLEAN)

    Whether to do v4 signing

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/bombbomb/api/videos_api.rb', line 220

def sign_upload_with_http_info(policy, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: VideosApi.sign_upload ..."
  end
  # verify the required parameter 'policy' is set
  if @api_client.config.client_side_validation && policy.nil?
    fail ArgumentError, "Missing the required parameter 'policy' when calling VideosApi.sign_upload"
  end
  # resource path
  local_var_path = "/video/signedUpload"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}
  form_params["v4"] = opts[:'v4'] if !opts[:'v4'].nil?

  # http body (model)
  post_body = @api_client.object_to_http_body(policy)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideosApi#sign_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_video_thumbnail_v2(video_id, thumbnail, opts = {}) ⇒ nil

Upload thumbnail Upload a new video thumbnail

Parameters:

  • video_id

    The id of the video

  • thumbnail

    The thumbnail being uploaded

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :custom (BOOLEAN)

    The default email to use.

Returns:

  • (nil)


268
269
270
271
# File 'lib/bombbomb/api/videos_api.rb', line 268

def update_video_thumbnail_v2(video_id, thumbnail, opts = {})
  update_video_thumbnail_v2_with_http_info(video_id, thumbnail, opts)
  return nil
end

#update_video_thumbnail_v2_with_http_info(video_id, thumbnail, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Upload thumbnail Upload a new video thumbnail

Parameters:

  • video_id

    The id of the video

  • thumbnail

    The thumbnail being uploaded

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :custom (BOOLEAN)

    The default email to use.

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/bombbomb/api/videos_api.rb', line 280

def update_video_thumbnail_v2_with_http_info(video_id, thumbnail, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: VideosApi.update_video_thumbnail_v2 ..."
  end
  # verify the required parameter 'video_id' is set
  if @api_client.config.client_side_validation && video_id.nil?
    fail ArgumentError, "Missing the required parameter 'video_id' when calling VideosApi.update_video_thumbnail_v2"
  end
  # verify the required parameter 'thumbnail' is set
  if @api_client.config.client_side_validation && thumbnail.nil?
    fail ArgumentError, "Missing the required parameter 'thumbnail' when calling VideosApi.update_video_thumbnail_v2"
  end
  # resource path
  local_var_path = "/videos/thumbnail"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}
  form_params["videoId"] = video_id
  form_params["thumbnail"] = thumbnail
  form_params["custom"] = opts[:'custom'] if !opts[:'custom'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['BBOAuth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideosApi#update_video_thumbnail_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end