# Path: courseraresearchexports/constants/api_constants.py
# ANONYMITY_LEVEL_COORDINATOR = 'HASHED_IDS_NO_PII'
# 
# ANONYMITY_LEVEL_ISOLATED = 'HASHED_IDS_WITH_ISOLATED_UGC_NO_PII'
# 
# EXPORT_TYPE_TABLES = 'RESEARCH_WITH_SCHEMAS'
# 
# EXPORT_TYPE_CLICKSTREAM = 'RESEARCH_EVENTING'
# 
# EXPORT_TYPE_GRADEBOOK = 'GRADEBOOK'
# 
# SCHEMA_NAMES = [
#     'demographics',
#     'users',
#     'course_membership',
#     'course_progress',
#     'feedback',
#     'assessments',
#     'course_grades',
#     'peer_assignments',
#     'discussions',
#     'programming_assignments',
#     'course_content',
#     'ecb',
#     'notebooks',
#     'transactions']
# 
# Path: courseraresearchexports/models/utils.py
# def requests_response_to_model(response_transformer):
#     def response_transform_decorator(original_func):
#         def response_transformer_wrapper(*args, **kwargs):
# def lookup_course_slug_by_id(course_id):
# def lookup_course_id_by_slug(course_slug):
# def lookup_partner_id_by_short_name(partner_short_name):
# def lookup_partner_short_name_by_id(partner_id):


from courseraresearchexports.constants.api_constants import \
    ANONYMITY_LEVEL_COORDINATOR, ANONYMITY_LEVEL_ISOLATED, EXPORT_TYPE_TABLES,\
    EXPORT_TYPE_CLICKSTREAM, EXPORT_TYPE_GRADEBOOK, SCHEMA_NAMES
from courseraresearchexports.models import utils
                    'groupId': self._group_id
                }}
        if self._export_type:
            json_request['exportType'] = self._export_type
        if self._anonymity_level:
            json_request['anonymityLevel'] = self._anonymity_level
        if self._statement_of_purpose:
            json_request['statementOfPurpose'] = self._statement_of_purpose
        if self._schema_names:
            json_request['schemaNames'] = self._schema_names
        if self._interval:
            json_request['interval'] = {
                'start': self._interval[0], 'end': self._interval[1]}
        if self._ignore_existing:
            json_request['ignoreExisting'] = self._ignore_existing

        return json_request

    @classmethod
    def from_args(cls, **kwargs):
        """
        Create a ExportResource object using the parameters required. Performs
        course_id/partner_id inference if possible.
        :param kwargs:
        :return export_request: ExportRequest
        """
        if kwargs.get('course_slug') and not kwargs.get('course_id'):
            kwargs['course_id'] = utils.lookup_course_id_by_slug(
                kwargs['course_slug'])
        elif kwargs.get('partner_short_name') and not kwargs.get('partner_id'):

# Path: courseraresearchexports/constants/api_constants.py
# ANONYMITY_LEVEL_COORDINATOR = 'HASHED_IDS_NO_PII'
# 
# ANONYMITY_LEVEL_ISOLATED = 'HASHED_IDS_WITH_ISOLATED_UGC_NO_PII'
# 
# EXPORT_TYPE_TABLES = 'RESEARCH_WITH_SCHEMAS'
# 
# EXPORT_TYPE_CLICKSTREAM = 'RESEARCH_EVENTING'
# 
# EXPORT_TYPE_GRADEBOOK = 'GRADEBOOK'
# 
# SCHEMA_NAMES = [
#     'demographics',
#     'users',
#     'course_membership',
#     'course_progress',
#     'feedback',
#     'assessments',
#     'course_grades',
#     'peer_assignments',
#     'discussions',
#     'programming_assignments',
#     'course_content',
#     'ecb',
#     'notebooks',
#     'transactions']
# 
# Path: courseraresearchexports/models/utils.py
# def requests_response_to_model(response_transformer):
#     def response_transform_decorator(original_func):
#         def response_transformer_wrapper(*args, **kwargs):
# def lookup_course_slug_by_id(course_id):
# def lookup_course_id_by_slug(course_slug):
# def lookup_partner_id_by_short_name(partner_short_name):
# def lookup_partner_short_name_by_id(partner_id):


# Path: courseraresearchexports/models/ExportRequest.py
from courseraresearchexports.constants.api_constants import \
    ANONYMITY_LEVEL_COORDINATOR, ANONYMITY_LEVEL_ISOLATED, EXPORT_TYPE_TABLES,\
    EXPORT_TYPE_CLICKSTREAM, EXPORT_TYPE_GRADEBOOK, SCHEMA_NAMES
from courseraresearchexports.models import utils

                    'groupId': self._group_id
                }}
        if self._export_type:
            json_request['exportType'] = self._export_type
        if self._anonymity_level:
            json_request['anonymityLevel'] = self._anonymity_level
        if self._statement_of_purpose:
            json_request['statementOfPurpose'] = self._statement_of_purpose
        if self._schema_names:
            json_request['schemaNames'] = self._schema_names
        if self._interval:
            json_request['interval'] = {
                'start': self._interval[0], 'end': self._interval[1]}
        if self._ignore_existing:
            json_request['ignoreExisting'] = self._ignore_existing

        return json_request

    @classmethod
    def from_args(cls, **kwargs):
        """
        Create a ExportResource object using the parameters required. Performs
        course_id/partner_id inference if possible.
        :param kwargs:
        :return export_request: ExportRequest
        """
        if kwargs.get('course_slug') and not kwargs.get('course_id'):
            kwargs['course_id'] = utils.lookup_course_id_by_slug(
                kwargs['course_slug'])
        elif kwargs.get('partner_short_name') and not kwargs.get('partner_id'):

            kwargs['partner_id'] = utils.lookup_partner_id_by_short_name(