Skip to content

Commit

Permalink
[0.3.5] Assign providers from template
Browse files Browse the repository at this point in the history
  • Loading branch information
zerodayz committed Oct 24, 2020
1 parent 28ceaab commit 1c25bf9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
4 changes: 3 additions & 1 deletion memsource_cli/api/project_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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 = {}

Expand Down
29 changes: 29 additions & 0 deletions memsource_cli/project/v1/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1c25bf9

Please sign in to comment.