diff --git a/memsource_cli/api/project_api.py b/memsource_cli/api/project_api.py index 15f0205..b1ce8d9 100644 --- a/memsource_cli/api/project_api.py +++ b/memsource_cli/api/project_api.py @@ -279,7 +279,7 @@ def assign_linguists_from_template_with_http_info(self, template_id, project_uid returns the request thread. """ - all_params = ['template_id', 'project_uid'] # noqa: E501 + all_params = ['template_id', 'project_uid', 'token'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -312,6 +312,8 @@ def assign_linguists_from_template_with_http_info(self, template_id, project_uid path_params['projectUid'] = params['project_uid'] # noqa: E501 query_params = [] + if 'token' in params: + query_params.append(('token', params['token'])) # noqa: E501 header_params = {} diff --git a/memsource_cli/project/v1/project.py b/memsource_cli/project/v1/project.py index 2a2f795..d764a17 100644 --- a/memsource_cli/project/v1/project.py +++ b/memsource_cli/project/v1/project.py @@ -101,6 +101,35 @@ def take_action(self, parsed_args): return utils._print_output(response) +class AssignsProvidersFromTemplate(command.Command): + """ + Assigns providers from template + """ + + def get_parser(self, prog_name): + """Command argument parsing.""" + parser = super(AssignsProvidersFromTemplate, self).get_parser(prog_name) + parser.add_argument( + '--project-id', + action='store', + dest='project_uid', + help='project_uid' + ) + parser.add_argument( + '--template-id', + action='store', + dest='template_id', + help='template_id' + ) + return parser + + def take_action(self, parsed_args): + api = memsource_cli.ProjectApi(self.app.client) + api.assign_linguists_from_template(token=self.app.client.configuration.token, + project_uid=parsed_args.project_uid, + template_id=parsed_args.template_id) + + class DeleteProject(command.Command): """ Deletes a project diff --git a/setup.cfg b/setup.cfg index 23bbcf8..28860a0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,6 +13,7 @@ console_scripts = memsource.cli = auth_whoami = memsource_cli.auth.v1.whoami:WhoAmI auth_login = memsource_cli.auth.v1.login:Login + project_assign_providers = memsource_cli.project.v1.project:AssignsProvidersFromTemplate project_list = memsource_cli.project.v1.project:ListProjects project_show = memsource_cli.project.v1.project:ShowProject project_delete = memsource_cli.project.v1.project:DeleteProject