class Aimastering::VideoApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/aimastering/api/video_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

download_video(id, opts = {}) click to toggle source

Download an video data by id.

@param id Video id @param [Hash] opts the optional parameters @return [String]

# File lib/aimastering/api/video_api.rb, line 28
def download_video(id, opts = {})
  data, _status_code, _headers = download_video_with_http_info(id, opts)
  return data
end
download_video_by_token(download_token, opts = {}) click to toggle source

Download an video data by video_download_token.

@param download_token Video download token @param [Hash] opts the optional parameters @return [String]

# File lib/aimastering/api/video_api.rb, line 85
def download_video_by_token(download_token, opts = {})
  data, _status_code, _headers = download_video_by_token_with_http_info(download_token, opts)
  return data
end
download_video_by_token_with_http_info(download_token, opts = {}) click to toggle source

Download an video data by video_download_token.

@param download_token Video download token @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/aimastering/api/video_api.rb, line 95
def download_video_by_token_with_http_info(download_token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: VideoApi.download_video_by_token ..."
  end
  # verify the required parameter 'download_token' is set
  if @api_client.config.client_side_validation && download_token.nil?
    fail ArgumentError, "Missing the required parameter 'download_token' when calling VideoApi.download_video_by_token"
  end
  # resource path
  local_var_path = "/videos/download_by_token"

  # query parameters
  query_params = {}
  query_params[:'download_token'] = download_token

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  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 => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideoApi#download_video_by_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
download_video_with_http_info(id, opts = {}) click to toggle source

Download an video data by id.

@param id Video id @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/aimastering/api/video_api.rb, line 38
def download_video_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: VideoApi.download_video ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling VideoApi.download_video"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling VideoApi.download_video, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/videos/{id}/download".sub('{' + 'id' + '}', 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/octet-stream'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  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 => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideoApi#download_video\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_video(id, opts = {}) click to toggle source

Get an video by id.

@param id Video id @param [Hash] opts the optional parameters @return [Video]

# File lib/aimastering/api/video_api.rb, line 139
def get_video(id, opts = {})
  data, _status_code, _headers = get_video_with_http_info(id, opts)
  return data
end
get_video_download_token(id, opts = {}) click to toggle source

Get an video download token by id.

@param id Video id @param [Hash] opts the optional parameters @return [VideoDownloadToken]

# File lib/aimastering/api/video_api.rb, line 196
def get_video_download_token(id, opts = {})
  data, _status_code, _headers = get_video_download_token_with_http_info(id, opts)
  return data
end
get_video_download_token_with_http_info(id, opts = {}) click to toggle source

Get an video download token by id.

@param id Video id @param [Hash] opts the optional parameters @return [Array<(VideoDownloadToken, Fixnum, Hash)>] VideoDownloadToken data, response status code and response headers

# File lib/aimastering/api/video_api.rb, line 206
def get_video_download_token_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: VideoApi.get_video_download_token ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling VideoApi.get_video_download_token"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling VideoApi.get_video_download_token, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/videos/{id}/download_token".sub('{' + 'id' + '}', 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'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  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 => 'VideoDownloadToken')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideoApi#get_video_download_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_video_with_http_info(id, opts = {}) click to toggle source

Get an video by id.

@param id Video id @param [Hash] opts the optional parameters @return [Array<(Video, Fixnum, Hash)>] Video data, response status code and response headers

# File lib/aimastering/api/video_api.rb, line 149
def get_video_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: VideoApi.get_video ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling VideoApi.get_video"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling VideoApi.get_video, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/videos/{id}".sub('{' + 'id' + '}', 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'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  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 => 'Video')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideoApi#get_video\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_videos(opts = {}) click to toggle source

Get all videos accessable.

@param [Hash] opts the optional parameters @return [Array<Video>]

# File lib/aimastering/api/video_api.rb, line 252
def list_videos(opts = {})
  data, _status_code, _headers = list_videos_with_http_info(opts)
  return data
end
list_videos_with_http_info(opts = {}) click to toggle source

Get all videos accessable.

@param [Hash] opts the optional parameters @return [Array<(Array<Video>, Fixnum, Hash)>] Array<Video> data, response status code and response headers

# File lib/aimastering/api/video_api.rb, line 261
def list_videos_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: VideoApi.list_videos ..."
  end
  # resource path
  local_var_path = "/videos"

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  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 => 'Array<Video>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideoApi#list_videos\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end