Skip to content

Commit

Permalink
[0.2.10] Project template show added
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludek Janda committed Nov 11, 2019
1 parent 248ad6e commit 7bd00d1
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 7 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
## Change log

### Version 0.2.10

[0.2.10] Adding feature template show

Added new features such as

- [Template show](https://github.com/unofficial-memsource/memsource-cli-client/wiki/Memsource-Template#template-show)


### Version 0.2.9

[0.2.9] Adding feature job translations delete all
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ Framework will download additional packages:
<a id="markdown-whatsnew" name="whatsnew"></a>
## What's new

Version 0.2.10

[0.2.10] Adding feature template show

Added new features such as

- [Template show](https://github.com/unofficial-memsource/memsource-cli-client/wiki/Memsource-Template#template-show)


Version 0.2.9

[0.2.9] Adding feature job translations delete all
Expand Down
4 changes: 3 additions & 1 deletion memsource_cli/api/project_template_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ def get_project_template_with_http_info(self, project_template_id, **kwargs): #
returns the request thread.
"""

all_params = ['project_template_id'] # noqa: E501
all_params = ['project_template_id','token'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
Expand All @@ -1100,6 +1100,8 @@ def get_project_template_with_http_info(self, project_template_id, **kwargs): #
path_params['projectTemplateId'] = params['project_template_id'] # noqa: E501

query_params = []
if 'token' in params:
query_params.append(('token', params['token'])) # noqa: E501

header_params = {}

Expand Down
12 changes: 6 additions & 6 deletions memsource_cli/models/project_template_notify_provider_dto.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def organization_email_template(self, organization_email_template):
:param organization_email_template: The organization_email_template of this ProjectTemplateNotifyProviderDto. # noqa: E501
:type: IdReference
"""
if organization_email_template is None:
raise ValueError("Invalid value for `organization_email_template`, must not be `None`") # noqa: E501
# if organization_email_template is None:
# raise ValueError("Invalid value for `organization_email_template`, must not be `None`") # noqa: E501

self._organization_email_template = organization_email_template

Expand All @@ -94,10 +94,10 @@ def notification_interval_in_minutes(self, notification_interval_in_minutes):
:param notification_interval_in_minutes: The notification_interval_in_minutes of this ProjectTemplateNotifyProviderDto. # noqa: E501
:type: int
"""
if notification_interval_in_minutes is not None and notification_interval_in_minutes > 1440: # noqa: E501
raise ValueError("Invalid value for `notification_interval_in_minutes`, must be a value less than or equal to `1440`") # noqa: E501
if notification_interval_in_minutes is not None and notification_interval_in_minutes < 0: # noqa: E501
raise ValueError("Invalid value for `notification_interval_in_minutes`, must be a value greater than or equal to `0`") # noqa: E501
# if notification_interval_in_minutes is not None and notification_interval_in_minutes > 1440: # noqa: E501
# raise ValueError("Invalid value for `notification_interval_in_minutes`, must be a value less than or equal to `1440`") # noqa: E501
# if notification_interval_in_minutes is not None and notification_interval_in_minutes < 0: # noqa: E501
# raise ValueError("Invalid value for `notification_interval_in_minutes`, must be a value greater than or equal to `0`") # noqa: E501

self._notification_interval_in_minutes = notification_interval_in_minutes

Expand Down
Empty file.
Empty file.
33 changes: 33 additions & 0 deletions memsource_cli/template/v1/template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env python3
# -*- coding: cp1252 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4

from cliff.show import ShowOne

import memsource_cli
from memsource_cli.lib import utils

class ShowTemplate(ShowOne):
"""
Show template
"""

def get_parser(self, prog_name):
"""Command argument parsing."""
parser = super(ShowTemplate, self).get_parser(prog_name)

parser.add_argument(
'--project-template-id',
type=int,
dest='project_template_id',
help='project_template_id'
)

return parser

def take_action(self, parsed_args):
api = memsource_cli.ProjectTemplateApi(self.app.client)
response = api.get_project_template(token=self.app.client.configuration.token, # noqa: E501
project_template_id=parsed_args.project_template_id)

return utils._print_output(response)
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ memsource.cli =
analyse_language_create = memsource_cli.analysis.v1.analysis:CreateAnalysisByLanguages
analyse_project_list = memsource_cli.analysis.v2.analysis:ListAnalysisByProject
analyse_show = memsource_cli.analysis.v2.analysis:ShowAnalysis
template_show = memsource_cli.template.v1.template:ShowTemplate
translation_pre-translate = memsource_cli.translation.v1.translation:PreTranslate


Expand Down

0 comments on commit 7bd00d1

Please sign in to comment.