# coding: utf-8

"""
    SCORM Cloud Rest API

    REST API used for SCORM Cloud integrations.  # noqa: E501

    OpenAPI spec version: 2.0
    Contact: systems@rusticisoftware.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import
from deprecated import deprecated

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from rustici_software_cloud_v2.api_client import ApiClient


class XapiApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def create_statement_pipe(self, xapi_statement_pipe, **kwargs):  # noqa: E501
        """Create an xAPI Statement Pipe   # noqa: E501

        Creates an xAPI statement pipe.  >**Note:** >This method is asynchronous.  A returned success status indicates a background process has been started, but there will still be a delay before the creation of the xAPI statement pipe takes place.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_statement_pipe(xapi_statement_pipe, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param XapiStatementPipePostSchema xapi_statement_pipe: (required)
        :return: StringResultSchema
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.create_statement_pipe_with_http_info(xapi_statement_pipe, **kwargs)  # noqa: E501
        else:
            (data) = self.create_statement_pipe_with_http_info(xapi_statement_pipe, **kwargs)  # noqa: E501
            return data

    def create_statement_pipe_with_http_info(self, xapi_statement_pipe, **kwargs):  # noqa: E501
        """Create an xAPI Statement Pipe   # noqa: E501

        Creates an xAPI statement pipe.  >**Note:** >This method is asynchronous.  A returned success status indicates a background process has been started, but there will still be a delay before the creation of the xAPI statement pipe takes place.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_statement_pipe_with_http_info(xapi_statement_pipe, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param XapiStatementPipePostSchema xapi_statement_pipe: (required)
        :return: StringResultSchema
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['xapi_statement_pipe']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method create_statement_pipe" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'xapi_statement_pipe' is set
        if ('xapi_statement_pipe' not in params or
                params['xapi_statement_pipe'] is None):
            raise ValueError("Missing the required parameter `xapi_statement_pipe` when calling `create_statement_pipe`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'xapi_statement_pipe' in params:
            body_params = params['xapi_statement_pipe']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['APP_NORMAL', 'OAUTH']  # noqa: E501

        return self.api_client.call_api(
            '/xapi/statementPipes', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='StringResultSchema',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def create_xapi_credential(self, xapi_credential, **kwargs):  # noqa: E501
        """Create xAPI Credentials   # noqa: E501

        Creates an xAPI credential combination from the provided secret and a generated ID.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_xapi_credential(xapi_credential, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param XapiCredentialPostSchema xapi_credential: (required)
        :return: StringResultSchema
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.create_xapi_credential_with_http_info(xapi_credential, **kwargs)  # noqa: E501
        else:
            (data) = self.create_xapi_credential_with_http_info(xapi_credential, **kwargs)  # noqa: E501
            return data

    def create_xapi_credential_with_http_info(self, xapi_credential, **kwargs):  # noqa: E501
        """Create xAPI Credentials   # noqa: E501

        Creates an xAPI credential combination from the provided secret and a generated ID.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_xapi_credential_with_http_info(xapi_credential, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param XapiCredentialPostSchema xapi_credential: (required)
        :return: StringResultSchema
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['xapi_credential']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method create_xapi_credential" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'xapi_credential' is set
        if ('xapi_credential' not in params or
                params['xapi_credential'] is None):
            raise ValueError("Missing the required parameter `xapi_credential` when calling `create_xapi_credential`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'xapi_credential' in params:
            body_params = params['xapi_credential']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['APP_NORMAL', 'OAUTH']  # noqa: E501

        return self.api_client.call_api(
            '/xapi/credentials', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='StringResultSchema',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def delete_statement_pipe(self, statement_pipe_id, **kwargs):  # noqa: E501
        """Delete an xAPI Statement Pipe   # noqa: E501

        Deletes the specified xAPI statement pipe  >**Note:** >This method is asynchronous.  A returned success status indicates a background process has been started, but there will still be a delay before the deletion takes place.  Recreating a statement pipe with the same ID too quickly could cause the statement pipe to end up in a faulty state.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_statement_pipe(statement_pipe_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str statement_pipe_id: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.delete_statement_pipe_with_http_info(statement_pipe_id, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_statement_pipe_with_http_info(statement_pipe_id, **kwargs)  # noqa: E501
            return data

    def delete_statement_pipe_with_http_info(self, statement_pipe_id, **kwargs):  # noqa: E501
        """Delete an xAPI Statement Pipe   # noqa: E501

        Deletes the specified xAPI statement pipe  >**Note:** >This method is asynchronous.  A returned success status indicates a background process has been started, but there will still be a delay before the deletion takes place.  Recreating a statement pipe with the same ID too quickly could cause the statement pipe to end up in a faulty state.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_statement_pipe_with_http_info(statement_pipe_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str statement_pipe_id: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['statement_pipe_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method delete_statement_pipe" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'statement_pipe_id' is set
        if ('statement_pipe_id' not in params or
                params['statement_pipe_id'] is None):
            raise ValueError("Missing the required parameter `statement_pipe_id` when calling `delete_statement_pipe`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'statement_pipe_id' in params:
            path_params['statementPipeId'] = params['statement_pipe_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['APP_NORMAL', 'OAUTH']  # noqa: E501

        return self.api_client.call_api(
            '/xapi/statementPipes/{statementPipeId}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def delete_xapi_credential(self, xapi_credential_id, **kwargs):  # noqa: E501
        """Delete xAPI Credentials   # noqa: E501

        Deletes the specified xAPI credentials.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_xapi_credential(xapi_credential_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str xapi_credential_id: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.delete_xapi_credential_with_http_info(xapi_credential_id, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_xapi_credential_with_http_info(xapi_credential_id, **kwargs)  # noqa: E501
            return data

    def delete_xapi_credential_with_http_info(self, xapi_credential_id, **kwargs):  # noqa: E501
        """Delete xAPI Credentials   # noqa: E501

        Deletes the specified xAPI credentials.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_xapi_credential_with_http_info(xapi_credential_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str xapi_credential_id: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['xapi_credential_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method delete_xapi_credential" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'xapi_credential_id' is set
        if ('xapi_credential_id' not in params or
                params['xapi_credential_id'] is None):
            raise ValueError("Missing the required parameter `xapi_credential_id` when calling `delete_xapi_credential`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'xapi_credential_id' in params:
            path_params['xapiCredentialId'] = params['xapi_credential_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['APP_NORMAL', 'OAUTH']  # noqa: E501

        return self.api_client.call_api(
            '/xapi/credentials/{xapiCredentialId}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_statement_pipe(self, statement_pipe_id, **kwargs):  # noqa: E501
        """Get detailed information about an xAPI Statement Pipe   # noqa: E501

        Returns detailed information about the xAPI pipe.  This includes source and target urls, the last time a statement was successfully forwarded, and how many attempts have been made to send data to the target url.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_statement_pipe(statement_pipe_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str statement_pipe_id: (required)
        :return: XapiStatementPipeSchema
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_statement_pipe_with_http_info(statement_pipe_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_statement_pipe_with_http_info(statement_pipe_id, **kwargs)  # noqa: E501
            return data

    def get_statement_pipe_with_http_info(self, statement_pipe_id, **kwargs):  # noqa: E501
        """Get detailed information about an xAPI Statement Pipe   # noqa: E501

        Returns detailed information about the xAPI pipe.  This includes source and target urls, the last time a statement was successfully forwarded, and how many attempts have been made to send data to the target url.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_statement_pipe_with_http_info(statement_pipe_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str statement_pipe_id: (required)
        :return: XapiStatementPipeSchema
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['statement_pipe_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_statement_pipe" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'statement_pipe_id' is set
        if ('statement_pipe_id' not in params or
                params['statement_pipe_id'] is None):
            raise ValueError("Missing the required parameter `statement_pipe_id` when calling `get_statement_pipe`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'statement_pipe_id' in params:
            path_params['statementPipeId'] = params['statement_pipe_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['APP_NORMAL', 'OAUTH']  # noqa: E501

        return self.api_client.call_api(
            '/xapi/statementPipes/{statementPipeId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='XapiStatementPipeSchema',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_statement_pipes(self, **kwargs):  # noqa: E501
        """Get a list of xAPI Statement Pipes   # noqa: E501

        Returns a list of all xAPI statement pipes.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_statement_pipes(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: XapiStatementPipeListSchema
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_statement_pipes_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_statement_pipes_with_http_info(**kwargs)  # noqa: E501
            return data

    def get_statement_pipes_with_http_info(self, **kwargs):  # noqa: E501
        """Get a list of xAPI Statement Pipes   # noqa: E501

        Returns a list of all xAPI statement pipes.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_statement_pipes_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: XapiStatementPipeListSchema
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = []  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_statement_pipes" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['APP_NORMAL', 'OAUTH']  # noqa: E501

        return self.api_client.call_api(
            '/xapi/statementPipes', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='XapiStatementPipeListSchema',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_xapi_credential(self, xapi_credential_id, **kwargs):  # noqa: E501
        """Get detailed information about the xAPI Credentials   # noqa: E501

        Returns detailed information about the xAPI credentials.  This includes the id (username), secret (password), permissions, and whether or not the credentials are enabled.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_xapi_credential(xapi_credential_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str xapi_credential_id: (required)
        :return: XapiCredentialSchema
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_xapi_credential_with_http_info(xapi_credential_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_xapi_credential_with_http_info(xapi_credential_id, **kwargs)  # noqa: E501
            return data

    def get_xapi_credential_with_http_info(self, xapi_credential_id, **kwargs):  # noqa: E501
        """Get detailed information about the xAPI Credentials   # noqa: E501

        Returns detailed information about the xAPI credentials.  This includes the id (username), secret (password), permissions, and whether or not the credentials are enabled.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_xapi_credential_with_http_info(xapi_credential_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str xapi_credential_id: (required)
        :return: XapiCredentialSchema
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['xapi_credential_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_xapi_credential" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'xapi_credential_id' is set
        if ('xapi_credential_id' not in params or
                params['xapi_credential_id'] is None):
            raise ValueError("Missing the required parameter `xapi_credential_id` when calling `get_xapi_credential`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'xapi_credential_id' in params:
            path_params['xapiCredentialId'] = params['xapi_credential_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['APP_NORMAL', 'OAUTH']  # noqa: E501

        return self.api_client.call_api(
            '/xapi/credentials/{xapiCredentialId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='XapiCredentialSchema',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_xapi_credentials(self, **kwargs):  # noqa: E501
        """Get a list of xAPI Credentials   # noqa: E501

        Returns a list of xAPI credentials.  Can be filtered using the request parameters to provide a subset of results.  >**Note:** >This request is paginated and will only provide a limited amount of resources at a time.  If there are more results to be collected, a `more` token provided with the response which can be passed to get the next page of results.  When passing this token, no other filter parameters can be sent as part of the request.  The resources will continue to respect the filters passed in by the original request.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_xapi_credentials(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param datetime since: Filter by ISO 8601 TimeStamp inclusive (defaults to UTC)
        :param datetime until: Filter by ISO 8601 TimeStamp inclusive (defaults to UTC)
        :param str datetime_filter: Specifies field that `since` and `until` parameters are applied against
        :param str filter: Optional string which filters results by a specified field (described by filterBy).
        :param str filter_by: Optional enum parameter for specifying the field on which to run the filter. 
        :param str order_by: Optional enum parameter for specifying the field and order by which to sort the results. 
        :param str more: Pagination token returned as `more` property of multi page list requests
        :param bool include_total_count: Include the total count of results matching the provided filters as a header on the initial request.  The header will not be present on subsequent requests resulting from passing the `more` token. 
        :return: XapiCredentialsListSchema
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_xapi_credentials_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_xapi_credentials_with_http_info(**kwargs)  # noqa: E501
            return data

    def get_xapi_credentials_with_http_info(self, **kwargs):  # noqa: E501
        """Get a list of xAPI Credentials   # noqa: E501

        Returns a list of xAPI credentials.  Can be filtered using the request parameters to provide a subset of results.  >**Note:** >This request is paginated and will only provide a limited amount of resources at a time.  If there are more results to be collected, a `more` token provided with the response which can be passed to get the next page of results.  When passing this token, no other filter parameters can be sent as part of the request.  The resources will continue to respect the filters passed in by the original request.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_xapi_credentials_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param datetime since: Filter by ISO 8601 TimeStamp inclusive (defaults to UTC)
        :param datetime until: Filter by ISO 8601 TimeStamp inclusive (defaults to UTC)
        :param str datetime_filter: Specifies field that `since` and `until` parameters are applied against
        :param str filter: Optional string which filters results by a specified field (described by filterBy).
        :param str filter_by: Optional enum parameter for specifying the field on which to run the filter. 
        :param str order_by: Optional enum parameter for specifying the field and order by which to sort the results. 
        :param str more: Pagination token returned as `more` property of multi page list requests
        :param bool include_total_count: Include the total count of results matching the provided filters as a header on the initial request.  The header will not be present on subsequent requests resulting from passing the `more` token. 
        :return: XapiCredentialsListSchema
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['since', 'until', 'datetime_filter', 'filter', 'filter_by', 'order_by', 'more', 'include_total_count']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_xapi_credentials" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'since' in params:
            query_params.append(('since', params['since']))  # noqa: E501
        if 'until' in params:
            query_params.append(('until', params['until']))  # noqa: E501
        if 'datetime_filter' in params:
            query_params.append(('datetimeFilter', params['datetime_filter']))  # noqa: E501
        if 'filter' in params:
            query_params.append(('filter', params['filter']))  # noqa: E501
        if 'filter_by' in params:
            query_params.append(('filterBy', params['filter_by']))  # noqa: E501
        if 'order_by' in params:
            query_params.append(('orderBy', params['order_by']))  # noqa: E501
        if 'more' in params:
            query_params.append(('more', params['more']))  # noqa: E501
        if 'include_total_count' in params:
            query_params.append(('includeTotalCount', params['include_total_count']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['APP_NORMAL', 'OAUTH']  # noqa: E501

        return self.api_client.call_api(
            '/xapi/credentials', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='XapiCredentialsListSchema',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def set_statement_pipe(self, statement_pipe_id, xapi_statement_pipe, **kwargs):  # noqa: E501
        """Create or update an xAPI Statement Pipe   # noqa: E501

        Creates or updates information about the xAPI statement pipe.  - If the xAPI statement pipe is instead being updated, the pipe will start over and forward any statements it finds, even if it had already forwarded those statements.  If the pipe being edited is currently being processed, then this request will fail with a status code of 409.  >**Note:** >This method is asynchronous.  A returned success status indicates a background process has been started, but there will still be a delay before the creation of the xAPI statement pipe takes place.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.set_statement_pipe(statement_pipe_id, xapi_statement_pipe, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str statement_pipe_id: (required)
        :param XapiStatementPipePutSchema xapi_statement_pipe: (required)
        :return: StringResultSchema
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.set_statement_pipe_with_http_info(statement_pipe_id, xapi_statement_pipe, **kwargs)  # noqa: E501
        else:
            (data) = self.set_statement_pipe_with_http_info(statement_pipe_id, xapi_statement_pipe, **kwargs)  # noqa: E501
            return data

    def set_statement_pipe_with_http_info(self, statement_pipe_id, xapi_statement_pipe, **kwargs):  # noqa: E501
        """Create or update an xAPI Statement Pipe   # noqa: E501

        Creates or updates information about the xAPI statement pipe.  - If the xAPI statement pipe is instead being updated, the pipe will start over and forward any statements it finds, even if it had already forwarded those statements.  If the pipe being edited is currently being processed, then this request will fail with a status code of 409.  >**Note:** >This method is asynchronous.  A returned success status indicates a background process has been started, but there will still be a delay before the creation of the xAPI statement pipe takes place.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.set_statement_pipe_with_http_info(statement_pipe_id, xapi_statement_pipe, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str statement_pipe_id: (required)
        :param XapiStatementPipePutSchema xapi_statement_pipe: (required)
        :return: StringResultSchema
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['statement_pipe_id', 'xapi_statement_pipe']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method set_statement_pipe" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'statement_pipe_id' is set
        if ('statement_pipe_id' not in params or
                params['statement_pipe_id'] is None):
            raise ValueError("Missing the required parameter `statement_pipe_id` when calling `set_statement_pipe`")  # noqa: E501
        # verify the required parameter 'xapi_statement_pipe' is set
        if ('xapi_statement_pipe' not in params or
                params['xapi_statement_pipe'] is None):
            raise ValueError("Missing the required parameter `xapi_statement_pipe` when calling `set_statement_pipe`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'statement_pipe_id' in params:
            path_params['statementPipeId'] = params['statement_pipe_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'xapi_statement_pipe' in params:
            body_params = params['xapi_statement_pipe']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['APP_NORMAL', 'OAUTH']  # noqa: E501

        return self.api_client.call_api(
            '/xapi/statementPipes/{statementPipeId}', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='StringResultSchema',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def set_xapi_credential(self, xapi_credential_id, xapi_credential, **kwargs):  # noqa: E501
        """Create or update xAPI Credentials   # noqa: E501

        Creates or updates information about the xAPI credentials.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.set_xapi_credential(xapi_credential_id, xapi_credential, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str xapi_credential_id: (required)
        :param XapiCredentialPostSchema xapi_credential: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.set_xapi_credential_with_http_info(xapi_credential_id, xapi_credential, **kwargs)  # noqa: E501
        else:
            (data) = self.set_xapi_credential_with_http_info(xapi_credential_id, xapi_credential, **kwargs)  # noqa: E501
            return data

    def set_xapi_credential_with_http_info(self, xapi_credential_id, xapi_credential, **kwargs):  # noqa: E501
        """Create or update xAPI Credentials   # noqa: E501

        Creates or updates information about the xAPI credentials.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.set_xapi_credential_with_http_info(xapi_credential_id, xapi_credential, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str xapi_credential_id: (required)
        :param XapiCredentialPostSchema xapi_credential: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['xapi_credential_id', 'xapi_credential']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method set_xapi_credential" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'xapi_credential_id' is set
        if ('xapi_credential_id' not in params or
                params['xapi_credential_id'] is None):
            raise ValueError("Missing the required parameter `xapi_credential_id` when calling `set_xapi_credential`")  # noqa: E501
        # verify the required parameter 'xapi_credential' is set
        if ('xapi_credential' not in params or
                params['xapi_credential'] is None):
            raise ValueError("Missing the required parameter `xapi_credential` when calling `set_xapi_credential`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'xapi_credential_id' in params:
            path_params['xapiCredentialId'] = params['xapi_credential_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'xapi_credential' in params:
            body_params = params['xapi_credential']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['APP_NORMAL', 'OAUTH']  # noqa: E501

        return self.api_client.call_api(
            '/xapi/credentials/{xapiCredentialId}', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
