=begin
#SCORM Cloud Rest API

#REST API used for SCORM Cloud integrations.

OpenAPI spec version: 2.0

Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.12

=end

require 'uri'

module RusticiSoftwareCloudV2
  class ZoomiApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Delete the Zoomi keys for an Application 
    # Deletes the Zoomi keys for an application. 
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def delete_application_zoomi_keys(opts = {})
      delete_application_zoomi_keys_with_http_info(opts)
      nil
    end

    # Delete the Zoomi keys for an Application 
    # Deletes the Zoomi keys for an application. 
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def delete_application_zoomi_keys_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ZoomiApi.delete_application_zoomi_keys ...'
      end
      # resource path
      local_var_path = '/zoomi/key'

      # 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 = {}

      # http body (model)
      post_body = nil
      auth_names = ['APP_NORMAL', 'OAUTH']
      data, status_code, headers = @api_client.call_api(:DELETE, 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: ZoomiApi#delete_application_zoomi_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Delete the Course from Zoomi 
    # Deletes the course from Zoomi, but the course will remain in SCORM Cloud. 
    # @param course_id 
    # @param version_id 
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def delete_zoomi_course(course_id, version_id, opts = {})
      delete_zoomi_course_with_http_info(course_id, version_id, opts)
      nil
    end

    # Delete the Course from Zoomi 
    # Deletes the course from Zoomi, but the course will remain in SCORM Cloud. 
    # @param course_id 
    # @param version_id 
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def delete_zoomi_course_with_http_info(course_id, version_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ZoomiApi.delete_zoomi_course ...'
      end
      # verify the required parameter 'course_id' is set
      if course_id.nil?
        fail ArgumentError, "Missing the required parameter 'course_id' when calling ZoomiApi.delete_zoomi_course"
      end
      # verify the required parameter 'version_id' is set
      if version_id.nil?
        fail ArgumentError, "Missing the required parameter 'version_id' when calling ZoomiApi.delete_zoomi_course"
      end
      # resource path
      local_var_path = '/zoomi/course/{courseId}/version/{versionId}'.sub('{' + 'courseId' + '}', course_id.to_s).sub('{' + 'versionId' + '}', version_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/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['APP_NORMAL', 'OAUTH']
      data, status_code, headers = @api_client.call_api(:DELETE, 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: ZoomiApi#delete_zoomi_course\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get the Zoomi company ID of an Application 
    # Returns the Zoomi company ID of an application. 
    # @param [Hash] opts the optional parameters
    # @return [StringResultSchema]
    def get_application_zoomi_company_id(opts = {})
      data, _status_code, _headers = get_application_zoomi_company_id_with_http_info(opts)
      data
    end

    # Get the Zoomi company ID of an Application 
    # Returns the Zoomi company ID of an application. 
    # @param [Hash] opts the optional parameters
    # @return [Array<(StringResultSchema, Fixnum, Hash)>] StringResultSchema data, response status code and response headers
    def get_application_zoomi_company_id_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ZoomiApi.get_application_zoomi_company_id ...'
      end
      # resource path
      local_var_path = '/zoomi'

      # 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 = {}

      # http body (model)
      post_body = nil
      auth_names = ['APP_NORMAL', 'OAUTH']
      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 => 'StringResultSchema')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ZoomiApi#get_application_zoomi_company_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get the Zoomi public key for an Application 
    # Returns the Zoomi public key for an application. 
    # @param [Hash] opts the optional parameters
    # @return [StringResultSchema]
    def get_application_zoomi_public_key(opts = {})
      data, _status_code, _headers = get_application_zoomi_public_key_with_http_info(opts)
      data
    end

    # Get the Zoomi public key for an Application 
    # Returns the Zoomi public key for an application. 
    # @param [Hash] opts the optional parameters
    # @return [Array<(StringResultSchema, Fixnum, Hash)>] StringResultSchema data, response status code and response headers
    def get_application_zoomi_public_key_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ZoomiApi.get_application_zoomi_public_key ...'
      end
      # resource path
      local_var_path = '/zoomi/key'

      # 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 = {}

      # http body (model)
      post_body = nil
      auth_names = ['APP_NORMAL', 'OAUTH']
      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 => 'StringResultSchema')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ZoomiApi#get_application_zoomi_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get the Zoomi enabled value of a Course Version 
    # Returns the Zoomi enabled value of a course version. 
    # @param course_id 
    # @param version_id 
    # @param [Hash] opts the optional parameters
    # @return [EnabledSchema]
    def get_course_zoomi_enabled(course_id, version_id, opts = {})
      data, _status_code, _headers = get_course_zoomi_enabled_with_http_info(course_id, version_id, opts)
      data
    end

    # Get the Zoomi enabled value of a Course Version 
    # Returns the Zoomi enabled value of a course version. 
    # @param course_id 
    # @param version_id 
    # @param [Hash] opts the optional parameters
    # @return [Array<(EnabledSchema, Fixnum, Hash)>] EnabledSchema data, response status code and response headers
    def get_course_zoomi_enabled_with_http_info(course_id, version_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ZoomiApi.get_course_zoomi_enabled ...'
      end
      # verify the required parameter 'course_id' is set
      if course_id.nil?
        fail ArgumentError, "Missing the required parameter 'course_id' when calling ZoomiApi.get_course_zoomi_enabled"
      end
      # verify the required parameter 'version_id' is set
      if version_id.nil?
        fail ArgumentError, "Missing the required parameter 'version_id' when calling ZoomiApi.get_course_zoomi_enabled"
      end
      # resource path
      local_var_path = '/zoomi/course/{courseId}/version/{versionId}/enabled'.sub('{' + 'courseId' + '}', course_id.to_s).sub('{' + 'versionId' + '}', version_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/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['APP_NORMAL', 'OAUTH']
      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 => 'EnabledSchema')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ZoomiApi#get_course_zoomi_enabled\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get the status for a Course from Zoomi 
    # Returns the status for a course and starts the upload process to Zoomi if not started. 
    # @param course_id 
    # @param version_id 
    # @param [Hash] opts the optional parameters
    # @return [StringResultSchema]
    def get_zoomi_course_status(course_id, version_id, opts = {})
      data, _status_code, _headers = get_zoomi_course_status_with_http_info(course_id, version_id, opts)
      data
    end

    # Get the status for a Course from Zoomi 
    # Returns the status for a course and starts the upload process to Zoomi if not started. 
    # @param course_id 
    # @param version_id 
    # @param [Hash] opts the optional parameters
    # @return [Array<(StringResultSchema, Fixnum, Hash)>] StringResultSchema data, response status code and response headers
    def get_zoomi_course_status_with_http_info(course_id, version_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ZoomiApi.get_zoomi_course_status ...'
      end
      # verify the required parameter 'course_id' is set
      if course_id.nil?
        fail ArgumentError, "Missing the required parameter 'course_id' when calling ZoomiApi.get_zoomi_course_status"
      end
      # verify the required parameter 'version_id' is set
      if version_id.nil?
        fail ArgumentError, "Missing the required parameter 'version_id' when calling ZoomiApi.get_zoomi_course_status"
      end
      # resource path
      local_var_path = '/zoomi/course/{courseId}/version/{versionId}'.sub('{' + 'courseId' + '}', course_id.to_s).sub('{' + 'versionId' + '}', version_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/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['APP_NORMAL', 'OAUTH']
      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 => 'StringResultSchema')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ZoomiApi#get_zoomi_course_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Begin the import process with Zoomi 
    # Begins the import process with Zoomi.  Must be followed up by a status call. 
    # @param course_id 
    # @param version_id 
    # @param zoomi_course_options 
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def import_course_version_to_zoomi(course_id, version_id, zoomi_course_options, opts = {})
      import_course_version_to_zoomi_with_http_info(course_id, version_id, zoomi_course_options, opts)
      nil
    end

    # Begin the import process with Zoomi 
    # Begins the import process with Zoomi.  Must be followed up by a status call. 
    # @param course_id 
    # @param version_id 
    # @param zoomi_course_options 
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def import_course_version_to_zoomi_with_http_info(course_id, version_id, zoomi_course_options, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ZoomiApi.import_course_version_to_zoomi ...'
      end
      # verify the required parameter 'course_id' is set
      if course_id.nil?
        fail ArgumentError, "Missing the required parameter 'course_id' when calling ZoomiApi.import_course_version_to_zoomi"
      end
      # verify the required parameter 'version_id' is set
      if version_id.nil?
        fail ArgumentError, "Missing the required parameter 'version_id' when calling ZoomiApi.import_course_version_to_zoomi"
      end
      # verify the required parameter 'zoomi_course_options' is set
      if zoomi_course_options.nil?
        fail ArgumentError, "Missing the required parameter 'zoomi_course_options' when calling ZoomiApi.import_course_version_to_zoomi"
      end
      # resource path
      local_var_path = '/zoomi/course/{courseId}/version/{versionId}/import'.sub('{' + 'courseId' + '}', course_id.to_s).sub('{' + 'versionId' + '}', version_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/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(zoomi_course_options)
      auth_names = ['APP_NORMAL', 'OAUTH']
      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: ZoomiApi#import_course_version_to_zoomi\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Set the Zoomi company ID of an Application 
    # Sets the Zoomi company ID value of an application. 
    # @param zoomi_company_id 
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def set_application_zoomi_company_id(zoomi_company_id, opts = {})
      set_application_zoomi_company_id_with_http_info(zoomi_company_id, opts)
      nil
    end

    # Set the Zoomi company ID of an Application 
    # Sets the Zoomi company ID value of an application. 
    # @param zoomi_company_id 
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def set_application_zoomi_company_id_with_http_info(zoomi_company_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ZoomiApi.set_application_zoomi_company_id ...'
      end
      # verify the required parameter 'zoomi_company_id' is set
      if zoomi_company_id.nil?
        fail ArgumentError, "Missing the required parameter 'zoomi_company_id' when calling ZoomiApi.set_application_zoomi_company_id"
      end
      # resource path
      local_var_path = '/zoomi'

      # 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 = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(zoomi_company_id)
      auth_names = ['APP_NORMAL', 'OAUTH']
      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: ZoomiApi#set_application_zoomi_company_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Set the Zoomi enabled value of a Course Version 
    # Sets the Zoomi enabled value of a course version. 
    # @param course_id 
    # @param version_id 
    # @param enabled 
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def set_course_zoomi_enabled(course_id, version_id, enabled, opts = {})
      set_course_zoomi_enabled_with_http_info(course_id, version_id, enabled, opts)
      nil
    end

    # Set the Zoomi enabled value of a Course Version 
    # Sets the Zoomi enabled value of a course version. 
    # @param course_id 
    # @param version_id 
    # @param enabled 
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def set_course_zoomi_enabled_with_http_info(course_id, version_id, enabled, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ZoomiApi.set_course_zoomi_enabled ...'
      end
      # verify the required parameter 'course_id' is set
      if course_id.nil?
        fail ArgumentError, "Missing the required parameter 'course_id' when calling ZoomiApi.set_course_zoomi_enabled"
      end
      # verify the required parameter 'version_id' is set
      if version_id.nil?
        fail ArgumentError, "Missing the required parameter 'version_id' when calling ZoomiApi.set_course_zoomi_enabled"
      end
      # verify the required parameter 'enabled' is set
      if enabled.nil?
        fail ArgumentError, "Missing the required parameter 'enabled' when calling ZoomiApi.set_course_zoomi_enabled"
      end
      # resource path
      local_var_path = '/zoomi/course/{courseId}/version/{versionId}/enabled'.sub('{' + 'courseId' + '}', course_id.to_s).sub('{' + 'versionId' + '}', version_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/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(enabled)
      auth_names = ['APP_NORMAL', 'OAUTH']
      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: ZoomiApi#set_course_zoomi_enabled\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
