# Path: memsource/constants.py
# class Base(enum.Enum):
# class JobStatus(enum.Enum):
# class ProjectStatus(enum.Enum):
# class AnalysisFormat(enum.Enum):
# class TermBaseFormat(enum.Enum):
# class ApiVersion(enum.Enum):
# class HttpMethod(enum.Enum):
# class BaseRest(enum.Enum):
# class JobStatusRest(enum.Enum):
#     NEW = "New"
#     EMAILED = "Emailed"
#     ASSIGNED = "Assigned"
#     DECLINED_BY_LINGUIST = "Declined_By_Linguist"
#     COMPLETED_BY_LINGUIST = "Completed_By_Linguist"
#     COMPLETED = "Completed"
#     CANCELLED = "Cancelled"
#     NEW = "New"
#     ASSIGNED = "Assigned"
#     COMPLETED = "Completed"
#     CANCELLED = "Cancelled"
#     ACCEPTED_BY_VENDOR = "Accepted_By_Vendor"
#     DECLINED_BY_VENDOR = "Declined_By_Vendor"
#     COMPLETED_BY_VENDOR = "Completed_By_Vendor"
#     CSV = "CSV"
#     LOG = "LOG"
#     CSV_EXTENDED = "CSV_EXTENDED"
#     XLSX = "XLSX"
#     TBX = "TBX"
#     NEW = "NEW"
#     ACCEPTED = "ACCEPTED"
#     DECLINED = "DECLINED"
#     REJECTED = "REJECTED"
#     DELIVERED = "DELIVERED"
#     EMAILED = "EMAILED"
#     COMPLETED = "COMPLETED"
#     CANCELLED = "CANCELLED"
# CHUNK_SIZE = 1024
# CHAR_SET = "UTF-8"
# TM_THRESHOLD = 0.7
# 
# Path: memsource/exceptions.py
# class MemsourceException(Exception):
# class MemsourceApiException(MemsourceException):
# class MemsourceUnsupportedFileException(MemsourceException):
#     def __init__(self, status_code, result_json, url, params):
#     def get_error_code(self):
#     def get_error_description(self):
#     def __init__(self, unsupported_files, original_file_path, url, params):
# 
# Path: memsource/models.py
# class BaseModel(dict):
# class User(BaseModel):
# class Authentication(BaseModel):
# class Client(BaseModel):
# class Domain(BaseModel):
# class Language(BaseModel):
# class Project(BaseModel):
# class Job(BaseModel):
# class JobPart(BaseModel):
# class TranslationMemory(BaseModel):
# class AsynchronousRequest(BaseModel):
# class AsynchronousResponse(BaseModel):
# class Segment(BaseModel):
# class SegmentSearchResult(BaseModel):
# class Analysis(BaseModel):
# class MxliffUnit(BaseModel):
# class TermBase(BaseModel):
#     def __getattr__(self, key):
#     def _iso8601_to_datetime(self, source):
#     def date_created(self):
#     def __init__(self, source):
#     def is_complete(self):
#     def has_error(self):
# 
# Path: memsource/lib/mxliff.py
# class MxliffParser(object):
#     def parse(self, resource: {'XML file content as bytes': bytes}):
#         def to_memsouce_key(s: str) -> str:
#     def parse_group(self, group: objectify.ObjectifiedElement) -> models.MxliffUnit:
#     def parse_tunit_metadata(self, trans_unit: objectify.ObjectifiedElement) -> list:


import io
import os
import os.path
import shutil
import types
import urllib.parse
import uuid
import requests
from typing import (
    Any,
    Dict,
    Iterator,
    List,
    Optional,
    Tuple,
    Union,
)
from memsource import constants, exceptions, models
from memsource.lib import mxliff
            kwargs['format'] = '{base}/async/{api_version}/{path}'

        return super(Asynchronous, self)._make_url(**kwargs)

    def preTranslate(self, job_parts: List[int], translation_memory_threshold: float=0.7,
                     callback_url: str=None) -> models.AsynchronousRequest:
        """Call async pre translate API.

        :param job_parts: List of job_part id.
        :param translation_memory_threshold: If matching score is higher than this, it filled.
        :return: models.AsynchronousRequest
        """
        return models.AsynchronousRequest(self._post('job/preTranslate', {
            'jobPart': job_parts,
            'translationMemoryThreshold': translation_memory_threshold,
            'callbackUrl': callback_url,
        })['asyncRequest'])

    def createAnalysis(
            self, job_parts: int, callback_url: str=None, **kwargs) -> models.AsynchronousRequest:
        """Create analysis asynchronously.

        :param job_parts: Make analysis for these job_part ids.
        :param callback_url: Memsource will send a callback when they finish analyzing.
        :param kwargs: Another non required parameters, you can pass.
        :return: models.AsynchronousRequest
        """
        res = self._post(
            'analyse/create', dict(kwargs, jobPart=job_parts, callbackUrl=callback_url))


# Path: memsource/constants.py
# class Base(enum.Enum):
# class JobStatus(enum.Enum):
# class ProjectStatus(enum.Enum):
# class AnalysisFormat(enum.Enum):
# class TermBaseFormat(enum.Enum):
# class ApiVersion(enum.Enum):
# class HttpMethod(enum.Enum):
# class BaseRest(enum.Enum):
# class JobStatusRest(enum.Enum):
#     NEW = "New"
#     EMAILED = "Emailed"
#     ASSIGNED = "Assigned"
#     DECLINED_BY_LINGUIST = "Declined_By_Linguist"
#     COMPLETED_BY_LINGUIST = "Completed_By_Linguist"
#     COMPLETED = "Completed"
#     CANCELLED = "Cancelled"
#     NEW = "New"
#     ASSIGNED = "Assigned"
#     COMPLETED = "Completed"
#     CANCELLED = "Cancelled"
#     ACCEPTED_BY_VENDOR = "Accepted_By_Vendor"
#     DECLINED_BY_VENDOR = "Declined_By_Vendor"
#     COMPLETED_BY_VENDOR = "Completed_By_Vendor"
#     CSV = "CSV"
#     LOG = "LOG"
#     CSV_EXTENDED = "CSV_EXTENDED"
#     XLSX = "XLSX"
#     TBX = "TBX"
#     NEW = "NEW"
#     ACCEPTED = "ACCEPTED"
#     DECLINED = "DECLINED"
#     REJECTED = "REJECTED"
#     DELIVERED = "DELIVERED"
#     EMAILED = "EMAILED"
#     COMPLETED = "COMPLETED"
#     CANCELLED = "CANCELLED"
# CHUNK_SIZE = 1024
# CHAR_SET = "UTF-8"
# TM_THRESHOLD = 0.7
# 
# Path: memsource/exceptions.py
# class MemsourceException(Exception):
# class MemsourceApiException(MemsourceException):
# class MemsourceUnsupportedFileException(MemsourceException):
#     def __init__(self, status_code, result_json, url, params):
#     def get_error_code(self):
#     def get_error_description(self):
#     def __init__(self, unsupported_files, original_file_path, url, params):
# 
# Path: memsource/models.py
# class BaseModel(dict):
# class User(BaseModel):
# class Authentication(BaseModel):
# class Client(BaseModel):
# class Domain(BaseModel):
# class Language(BaseModel):
# class Project(BaseModel):
# class Job(BaseModel):
# class JobPart(BaseModel):
# class TranslationMemory(BaseModel):
# class AsynchronousRequest(BaseModel):
# class AsynchronousResponse(BaseModel):
# class Segment(BaseModel):
# class SegmentSearchResult(BaseModel):
# class Analysis(BaseModel):
# class MxliffUnit(BaseModel):
# class TermBase(BaseModel):
#     def __getattr__(self, key):
#     def _iso8601_to_datetime(self, source):
#     def date_created(self):
#     def __init__(self, source):
#     def is_complete(self):
#     def has_error(self):
# 
# Path: memsource/lib/mxliff.py
# class MxliffParser(object):
#     def parse(self, resource: {'XML file content as bytes': bytes}):
#         def to_memsouce_key(s: str) -> str:
#     def parse_group(self, group: objectify.ObjectifiedElement) -> models.MxliffUnit:
#     def parse_tunit_metadata(self, trans_unit: objectify.ObjectifiedElement) -> list:


# Path: memsource/api.py
import io
import os
import os.path
import shutil
import types
import urllib.parse
import uuid
import requests
from typing import (
    Any,
    Dict,
    Iterator,
    List,
    Optional,
    Tuple,
    Union,
)
from memsource import constants, exceptions, models
from memsource.lib import mxliff

            kwargs['format'] = '{base}/async/{api_version}/{path}'

        return super(Asynchronous, self)._make_url(**kwargs)

    def preTranslate(self, job_parts: List[int], translation_memory_threshold: float=0.7,
                     callback_url: str=None) -> models.AsynchronousRequest:
        """Call async pre translate API.

        :param job_parts: List of job_part id.
        :param translation_memory_threshold: If matching score is higher than this, it filled.
        :return: models.AsynchronousRequest
        """
        return models.AsynchronousRequest(self._post('job/preTranslate', {
            'jobPart': job_parts,
            'translationMemoryThreshold': translation_memory_threshold,
            'callbackUrl': callback_url,
        })['asyncRequest'])

    def createAnalysis(
            self, job_parts: int, callback_url: str=None, **kwargs) -> models.AsynchronousRequest:
        """Create analysis asynchronously.

        :param job_parts: Make analysis for these job_part ids.
        :param callback_url: Memsource will send a callback when they finish analyzing.
        :param kwargs: Another non required parameters, you can pass.
        :return: models.AsynchronousRequest
        """
        res = self._post(
            'analyse/create', dict(kwargs, jobPart=job_parts, callbackUrl=callback_url))


        return models.AsynchronousRequest(res['asyncRequest']), models.Analysis(res['analyse'])