Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions lilt/models/language_pair.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class LanguagePair(object):
'config_id': 'int',
'workflow_template_id': 'int',
'workflow_template_name': 'int',
'workflow_stage_assignments': 'list[WorkflowStageAssignment]'
'workflow_stage_assignments': 'list[WorkflowStageAssignment]',
'instructions': 'str'
}

attribute_map = {
Expand All @@ -61,10 +62,11 @@ class LanguagePair(object):
'config_id': 'configId',
'workflow_template_id': 'workflowTemplateId',
'workflow_template_name': 'workflowTemplateName',
'workflow_stage_assignments': 'workflowStageAssignments'
'workflow_stage_assignments': 'workflowStageAssignments',
'instructions': 'instructions'
}

def __init__(self, trg_lang=None, trg_locale=None, due_date=None, memory_id=None, external_model_id=None, pretranslate=None, auto_accept=None, case_sensitive=None, take_match_attribution=None, config_id=None, workflow_template_id=None, workflow_template_name=None, workflow_stage_assignments=None, local_vars_configuration=None): # noqa: E501
def __init__(self, trg_lang=None, trg_locale=None, due_date=None, memory_id=None, external_model_id=None, pretranslate=None, auto_accept=None, case_sensitive=None, take_match_attribution=None, config_id=None, workflow_template_id=None, workflow_template_name=None, workflow_stage_assignments=None, instructions=None, local_vars_configuration=None): # noqa: E501
"""LanguagePair - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
Expand All @@ -83,6 +85,7 @@ def __init__(self, trg_lang=None, trg_locale=None, due_date=None, memory_id=None
self._workflow_template_id = None
self._workflow_template_name = None
self._workflow_stage_assignments = None
self._instructions = None
self.discriminator = None

self.trg_lang = trg_lang
Expand All @@ -109,6 +112,8 @@ def __init__(self, trg_lang=None, trg_locale=None, due_date=None, memory_id=None
self.workflow_template_name = workflow_template_name
if workflow_stage_assignments is not None:
self.workflow_stage_assignments = workflow_stage_assignments
if instructions is not None:
self.instructions = instructions

@property
def trg_lang(self):
Expand Down Expand Up @@ -411,6 +416,29 @@ def workflow_stage_assignments(self, workflow_stage_assignments):

self._workflow_stage_assignments = workflow_stage_assignments

@property
def instructions(self):
"""Gets the project instructions of this LanguagePair. # noqa: E501

Project instructions for the translation. # noqa: E501

:return: The project instructions of this LanguagePair. # noqa: E501
:rtype: str
"""
return self._instructions

@instructions.setter
def instructions(self, instructions):
"""Sets the project instructions of this LanguagePair.

Project instructions for the translation. # noqa: E501

:param instructions: The project instructions of this LanguagePair. # noqa: E501
:type: str
"""

self._instructions = instructions

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
Expand Down
14 changes: 8 additions & 6 deletions test/test_job_create_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def make_instance(self, include_optional):
return JobCreateParameters(
name = 'My new Job',
due = '2021-10-05T14:48:00.000Z',
src_lang = 'en',
src_locale = 'US',
language_pairs = [
lilt.models.language_pair.LanguagePair(
src_lang = 'en',
src_locale = 'US',
trg_lang = 'de',
trg_locale = 'DE',
due_date = '2021-10-03T13:43:00.000Z',
Expand All @@ -51,17 +51,18 @@ def make_instance(self, include_optional):
auto_accept = True,
case_sensitive = True,
take_match_attribution = True,
config_id = 2332, )
config_id = 2332,
instructions = 'This is a test job' )
],
file_ids = [298, 299]
)
else :
return JobCreateParameters(
name = 'My new Job',
src_lang = 'en',
src_locale = 'US',
language_pairs = [
lilt.models.language_pair.LanguagePair(
src_lang = 'en',
src_locale = 'US',
trg_lang = 'de',
trg_locale = 'DE',
due_date = '2021-10-03T13:43:00.000Z',
Expand All @@ -70,7 +71,8 @@ def make_instance(self, include_optional):
auto_accept = True,
case_sensitive = True,
take_match_attribution = True,
config_id = 2332, )
config_id = 2332,
instructions = 'This is a test job' )
],
file_ids = [298, 299],
)
Expand Down
6 changes: 2 additions & 4 deletions test/test_language_pair.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ def make_instance(self, include_optional):
# model = lilt.models.language_pair.LanguagePair() # noqa: E501
if include_optional :
return LanguagePair(
src_lang = 'en',
src_locale = 'US',
trg_lang = 'de',
trg_locale = 'DE',
due_date = '2021-10-03T13:43:00.000Z',
Expand All @@ -47,8 +45,8 @@ def make_instance(self, include_optional):
auto_accept = True,
case_sensitive = True,
take_match_attribution = True,
config_id = 2332
)
config_id = 2332,
instructions = 'This is a test job' )
else :
return LanguagePair(
trg_lang = 'de',
Expand Down
Loading