예제 #1
0
    def create(self, job_part_ids: List[int]) -> models.Analysis:
        """Create new analysis.

        :param job_part_ids: Target of analysis.
        :return: Result of analysis.
        """
        return models.Analysis(self._post('analyse/create', {
            'jobPart': job_part_ids,
        }))
예제 #2
0
    def get(self, analysis_id: int) -> models.Analysis:
        """Call get API.

        :param analysis_id: Get analysis of this id.
        :return: Result of analysis.
        """
        return models.Analysis(self._get('analyse/get', {
            'analyse': analysis_id,
        }))
예제 #3
0
    def get_by_project(self, project_id: str) -> List[models.Analysis]:
        """List Analyses By Project.

        :param project_id: Project ID for which you want to get the analyses.
        :return: List of Analyses.
        """
        return [
            models.Analysis(client) for client in self._get(
                'analyse/listByProject', {'project': project_id})
        ]
예제 #4
0
    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 kwags: Another non required parameters, you can pass.
        """
        res = self._post(
            'analyse/create', dict(kwargs, jobPart=job_parts, callbackUrl=callback_url))

        return models.AsynchronousRequest(res['asyncRequest']), models.Analysis(res['analyse'])
예제 #5
0
 def create(self, job_part_ids: typing.List[int]) -> models.Analysis:
     return models.Analysis(self._post('analyse/create', {
         'jobPart': job_part_ids,
     }))
예제 #6
0
 def get(self, analysis_id: {'Get analysis of this id', int}) -> models.Analysis:
     return models.Analysis(self._get('analyse/get', {
         'analyse': analysis_id,
     }))