def from_json(cls, json_request):
        """
        Deserialize ExportRequest from json object.
        :param json_request:
        :return export_request: ExportRequest
        """
        kwargs = {}
        request_scope = json_request['scope']
        request_scope_context = request_scope['typeName']

        if request_scope_context == 'courseContext':
            kwargs['course_id'] = request_scope['definition']['courseId']
        elif request_scope_context == 'partnerContext':
            kwargs['partner_id'] = \
                request_scope['definition']['partnerId']['maestroId']
        elif request_scope_context == 'groupContext':
            kwargs['group_id'] = request_scope['definition']['groupId']

        if json_request.get('interval'):
            kwargs['interval'] = [
                json_request['interval']['start'],
                json_request['interval']['end']
            ]

        return cls(
            export_type=json_request.get('exportType'),
            anonymity_level=json_request.get('anonymityLevel'),
            statement_of_purpose=json_request.get('statementOfPurpose'),
            schema_names=json_request.get('schemaNames'),
            ignore_existing=json_request.get('ignoreExisting'),
            **kwargs)